/* =============================================
   APP CUSTOM — Минималистичные стили приложения
   ============================================= */

/* ===== GLOBAL OVERRIDES ===== */
html {
    font-family: 'Google Sans', sans-serif;
}

:root {
    --bs-font-sans-serif: 'Google Sans', sans-serif;
}

.btn {
    text-transform: none;
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
    text-transform: none;
}

.text-muted {
    color: #999 !important;
}

/* ===== ALARM ANIMATIONS ===== */
.card.is-loading {
    background: linear-gradient(to left, #1a1a1f, #ec3232);
    background-size: 400% 400%;
    animation: alarm 2s ease infinite;
}

@keyframes alarm {
    0%   { background-position: 0% 15% }
    50%  { background-position: 100% 86% }
    100% { background-position: 0% 15% }
}

.box {
    background: #ff3333;
}

.blink {
    animation: glowBlink 2.5s ease-in-out infinite;
}

.police {
    animation: policeGlow 1s linear infinite;
}

@keyframes glowBlink {
    0%, 100% {
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(255, 50, 50, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.9), 0 0 60px rgba(255, 0, 0, 0.6);
    }
}

@keyframes policeGlow {
    0%, 100% {
        box-shadow: -25px 0 35px rgba(255, 0, 0, 0.7), 25px 0 35px rgba(0, 0, 255, 0);
        background: #ff3333;
    }
    50% {
        box-shadow: 25px 0 35px rgba(0, 0, 255, 0.7), -25px 0 35px rgba(255, 0, 0, 0);
        background: #3333ff;
    }
}

/* ===== CHIP SELECT (quick-select buttons) ===== */
.chip-select .btn,
.quick-select .btn,
.quick-type-select .btn,
.quick-geo-select .btn,
.quick-time-select .btn {
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
    min-height: 44px;
}

.chip-select .btn:hover,
.quick-select .btn:hover,
.quick-type-select .btn:hover,
.quick-geo-select .btn:hover,
.quick-time-select .btn:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

.chip-select .btn.active,
.chip-select .btn.btn-dark,
.quick-select .btn.active,
.quick-select .btn.btn-dark,
.quick-select .btn.btn-light,
.quick-type-select .btn.active,
.quick-type-select .btn.btn-dark,
.quick-geo-select .btn.active,
.quick-geo-select .btn.btn-dark,
.quick-geo-select .btn.btn-light,
.quick-time-select .btn.active,
.quick-time-select .btn.btn-dark {
    background: #1a1a1a;
    color: #fff;
}

/* ===== STORE NAV (board page navigation) ===== */
.store-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

/* ===== ALARM CARDS (JS-generated) ===== */
.alarm-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    margin-bottom: 0;
}

.alarm-card.urgent {
    background: #e63030;
    color: #fff;
}

.alarm-card .alarm-time {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Google Sans', sans-serif;
    line-height: 1;
    letter-spacing: -2px;
    margin: 0;
}

.alarm-card .alarm-product {
    font-size: 15px;
    font-weight: 600;
    margin: 6px 0 0;
    line-height: 1.3;
}

.alarm-card .alarm-location {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-top: 10px;
    margin-bottom: 12px;
}

.alarm-card.urgent .alarm-location {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.alarm-card.urgent .alarm-product {
    color: rgba(255, 255, 255, .9);
}

.alarm-card .btn {
    margin-top: 14px;
}

/* ===== VIRTUAL KEYBOARD ===== */
.quantity-keyboard .btn {
    height: 52px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    background: #f0f0f0;
    color: #1a1a1a;
    border-radius: 12px;
    transition: all .15s ease;
}

.quantity-keyboard .btn:hover {
    background: #e5e5e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, .08);
}

.quantity-keyboard .btn:active,
.quantity-keyboard .btn.pressed {
    transform: scale(0.95);
    background: #1a1a1a;
    color: #fff;
}

.quantity-keyboard .btn-clear {
    background: #fee;
    color: #d4566b;
}

.quantity-keyboard .btn-clear:hover {
    background: #fdd;
}

/* ===== SELECT2 OVERRIDES ===== */
.select2-results__option[role=option] {
    border-radius: .375rem;
    margin-block: .125rem;
    margin-inline: .5rem;
    padding-block: .543rem;
    padding-inline: 1.25rem;
}

.select2-search--dropdown .select2-search__field {
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: #e8e8e8;
    border-radius: .5rem;
    inline-size: calc(100% - 1rem);
    margin-block: .25rem;
    margin-block-end: 0;
    margin-inline: .5rem;
}

.select2-container--default .select2-selection--single {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    height: 44px;
    padding-top: 6px;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}

.select2-dropdown {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
    margin-top: 4px;
}

/* ===== VOICE INPUT ===== */
.voice-listening {
    background-color: #d4566b !important;
    color: #fff !important;
    animation: voice-pulse 1.5s infinite;
}

@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 86, 107, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(212, 86, 107, 0); }
}

.voice-transcript {
    background: #f5f5f5;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 12px;
}

.voice-preview {
    background: #f0faf5;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

/* ===== SPIN ANIMATION ===== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ===== MODALS — borderless ===== */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .12);
}

.modal-header {
    border-bottom: none;
    padding: 24px 24px 8px;
}

.modal-footer {
    border-top: none;
    padding: 8px 24px 24px;
}

.modal-body {
    padding: 16px 24px;
}

/* ===== ALERTS — borderless ===== */
.alert {
    border: none;
    border-radius: 12px;
}

/* ===== TOAST — borderless ===== */
.toast {
    border: none;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
}

.toast-header {
    border-bottom: none;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 16px;
    margin-top: 32px;
}

.section-title:first-of-type {
    margin-top: 0;
}

/* ===== EASTER EGG ===== */
.easter-egg-peek {
    position: fixed;
    top: 10px;
    left: -25px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    border-radius: 0 50% 50% 50%;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 10px rgba(255, 193, 7, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: peekLeft 3s ease-in-out infinite;
}

@keyframes peekLeft {
    0%, 90%, 100% { left: -25px; opacity: 0.7; }
    5%, 85% { left: -10px; opacity: 1; }
}

.easter-egg-peek:hover {
    left: 0px !important;
    transform: scale(1.1);
    box-shadow: 3px 3px 15px rgba(255, 193, 7, 0.5);
    animation-play-state: paused;
}

.easter-egg-peek:active {
    transform: scale(0.95);
}

.easter-egg-gif {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

/* ===== TABLET OPTIMIZATIONS ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    .store-nav {
        gap: 6px;
    }

    .store-nav .store-nav-link {
        padding: 8px 16px;
        font-size: 13px;
    }

    .alarm-card .alarm-time {
        font-size: 3rem;
    }

    .quantity-keyboard .btn {
        height: 56px;
        font-size: 1.2rem;
    }

    .chip-select .btn,
    .quick-select .btn,
    .quick-type-select .btn,
    .quick-geo-select .btn,
    .quick-time-select .btn {
        min-height: 48px;
        padding: 12px 22px;
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .alarm-card .alarm-time {
        font-size: 2.8rem;
    }

    .store-nav {
        gap: 6px;
    }

    .store-nav .store-nav-link {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ===== BATCH ALARM LIST ITEMS ===== */
.alarm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.alarm-list:empty {
    display: none;
}

.alarm-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff;
    border: 2px solid transparent;
    transition: border-color .3s ease, background .3s ease, opacity .3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.alarm-list-item.pending {
    border-color: #ffc107;
}

.alarm-list-item.success {
    border-color: #198754;
    background: #f0faf5;
}

.alarm-list-item.error {
    border-color: #dc3545;
    background: #fef0f0;
}

.alarm-list-item .item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.alarm-list-item .item-icon.type-writeoff {
    background: #fff3e0;
    color: #e65100;
}

.alarm-list-item .item-icon.type-defrost {
    background: #e3f2fd;
    color: #1565c0;
}

.alarm-list-item .item-body {
    flex: 1;
    min-width: 0;
}

.alarm-list-item .item-product {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alarm-list-item .item-meta {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.alarm-list-item .item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.alarm-list-item .item-edit,
.alarm-list-item .item-remove {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f5f5f5;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}

.alarm-list-item .item-edit:hover {
    background: #e8f0fe;
    color: #4361ee;
}

.alarm-list-item .item-remove:hover {
    background: #fee;
    color: #d4566b;
}

.alarm-list-item.editing {
    border-color: #4361ee;
    box-shadow: 0 0 0 2px rgba(67,97,238,.15);
}

.alarm-list-item .item-status-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.alarm-list-item.success .item-actions { display: none; }
.alarm-list-item.success .item-status-icon { display: flex; color: #198754; }
.alarm-list-item.error .item-actions { display: none; }
.alarm-list-item.error .item-status-icon { display: flex; color: #dc3545; }

/* ===== FAB MIC BUTTON ===== */
.fab-mic {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0,0,0,.2);
    cursor: pointer;
    z-index: 1050;
    transition: all .2s;
}

.fab-mic:hover {
    transform: translateX(-50%) scale(1.08);
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

.fab-mic:active {
    transform: translateX(-50%) scale(0.95);
}

.fab-mic.listening {
    background: #d4566b;
    animation: fab-pulse 1.5s infinite;
}

@keyframes fab-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 86, 107, 0.5), 0 6px 24px rgba(0,0,0,.2); }
    50% { box-shadow: 0 0 0 16px rgba(212, 86, 107, 0), 0 6px 24px rgba(0,0,0,.2); }
}

.fab-mic.processing {
    background: #555;
    pointer-events: none;
}

/* Extra bottom padding so content doesn't hide behind FAB */
.batch-create-page {
    padding-bottom: 100px;
}

/* ===== VOICE GUIDE ===== */
.voice-guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1080;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: vg-fade-in .2s ease;
}

@keyframes vg-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.voice-guide-sheet {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: vg-slide-up .25s ease;
}

@keyframes vg-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.voice-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.voice-guide-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.voice-guide-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}

.voice-guide-close:hover {
    background: #eee;
}

.voice-guide-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.voice-guide-section {
    margin-bottom: 16px;
}

.voice-guide-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #999;
    margin-bottom: 8px;
}

.voice-guide-example {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.voice-guide-example i {
    color: #d4566b;
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

.voice-guide-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
}

.voice-guide-tag {
    background: #1a1a1a;
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.voice-guide-footer {
    padding: 12px 20px 20px;
}

.voice-guide-fab-help {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    cursor: pointer;
    z-index: 1049;
    transition: all .2s;
}

.voice-guide-fab-help:hover {
    background: #e5e5e5;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

/* ===== CUSTOM DROPDOWN (location) ===== */
.custom-dropdown-wrapper {
    position: relative;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all .2s;
    min-height: 48px;
}

.custom-dropdown-trigger:hover {
    border-color: #ccc;
}

.custom-dropdown-trigger.open {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}

.custom-dropdown-trigger .placeholder {
    color: #999;
}

.custom-dropdown-trigger .chevron {
    transition: transform .2s;
    font-size: 18px;
    color: #999;
}

.custom-dropdown-trigger.open .chevron {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    z-index: 100;
    padding: 6px;
    display: none;
    max-height: 320px;
    overflow-y: auto;
}

.custom-dropdown-menu.show {
    display: block;
}

.custom-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.custom-dropdown-item:hover {
    background: #f5f5f5;
}

.custom-dropdown-item.selected {
    background: #1a1a1a;
    color: #fff;
}

.custom-dropdown-item .dd-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    flex-shrink: 0;
}

.custom-dropdown-item.selected .dd-icon {
    background: rgba(255,255,255,.15);
    color: #fff;
}

/* ===== SCROLL WHEEL PICKER (time) ===== */
.scroll-picker-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    user-select: none;
    -webkit-user-select: none;
}

.scroll-picker-col {
    width: 72px;
    height: 160px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    background: #f5f5f5;
    position: relative;
    scrollbar-width: none;
}

.scroll-picker-col::-webkit-scrollbar {
    display: none;
}

.scroll-picker-col .picker-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #ccc;
    transition: color .15s, transform .15s;
}

.scroll-picker-col .picker-spacer {
    height: 40px;
    flex-shrink: 0;
}

.scroll-picker-col .picker-item.active {
    color: #1a1a1a;
    transform: scale(1.15);
}

.scroll-picker-separator {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 0 2px;
}

/* Highlight band in the center of the picker */
.scroll-picker-col::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    right: 4px;
    height: 40px;
    margin-top: -20px;
    background: rgba(0,0,0,.05);
    border-radius: 10px;
    pointer-events: none;
}

/* Day toggle */
.day-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.day-toggle .btn {
    border-radius: 50px;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e8e8e8;
    background: #fff;
    color: #666;
    transition: all .2s;
}

.day-toggle .btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* ===== PRODUCT TABS (fast / search) ===== */
.product-tabs {
    display: flex;
    gap: 4px;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 12px;
}

.product-tabs .tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.product-tabs .tab-btn.active {
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.product-tab-content {
    display: none;
}

.product-tab-content.active {
    display: block;
}

/* ===== BATCH SUBMIT BUTTON ===== */
.batch-submit-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 16px 0;
    z-index: 50;
    margin: 0 -24px -24px -24px;
    padding: 16px 24px 24px;
    border-radius: 0 0 16px 16px;
}

/* ===== BATCH RESULT ===== */
.batch-result {
    text-align: center;
    padding: 24px 0;
}

.batch-result .result-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.batch-result .result-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.batch-result .result-sub {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

/* ===== ADD FORM TOGGLE ===== */
.add-form-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: 2px dashed #e0e0e0;
    border-radius: 14px;
    background: transparent;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    width: 100%;
    margin-bottom: 16px;
}

.add-form-toggle:hover {
    border-color: #ccc;
    color: #666;
    background: #fafafa;
}

/* ===== INLINE ADD FORM ===== */
.inline-add-form {
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    background: #fff;
}
