@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-v20-cyrillic_latin-100.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-v20-cyrillic_latin-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-v20-cyrillic_latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-v20-cyrillic_latin-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-v20-cyrillic_latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-v20-cyrillic_latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-v20-cyrillic_latin-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-main: #f4f7f8;
    --bg-card: #ffffff;
    --header-bg: #14262b;
    --header-active: #1d353c;
    --border: #e5e7eb;
    --accent: #10b981;
    --accent-dark: #065f46;
    --accent-hover: #059669;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; }
body { background: #e8edf0; color: var(--text-main); height: 100vh; overflow: hidden; }
.brand-font { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }


/* --- ЭКРАН ВХОДА И БЛОКИРОВКИ --- */
.fullscreen-overlay { position: fixed; inset: 0; background: radial-gradient(circle at 50% 32%, #181a1f 0%, #0b1010 100%); display: flex; align-items: center; justify-content: center; z-index: 9000; }
.auth-box { background: #ffffff; width: 400px; max-width: 94vw; padding: 30px; border-radius: 16px; border-top: 1px solid rgba(255, 255, 255, 0.9); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 4px 16px rgba(0, 0, 0, 0.35); }
.auth-logo { font-size: 28px; color: var(--accent); text-align: center; margin-bottom: 4px; }
.auth-sub { text-align: center; color: #6b7280; font-size: 13px; margin-bottom: 24px; }

/* --- ФИРМЕННАЯ ИКОНКА ЛОГОТИПА ЦЕХ --- */
.ceh-logo { display: inline-flex; align-items: center; padding-right: 10px; margin-right: 4px; user-select: none; }
.ceh-logo-box { width: 36px; height: 36px; border-radius: 9px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ceh-logo-box img { width: 42px; height: 42px; object-fit: cover; display: block; }

/* --- ОБОЛОЧКА ПРИЛОЖЕНИЯ (ОГРАНИЧЕНИЕ 1500px) --- */
.app-shell { display: flex; flex-direction: column; height: 100vh; width: 100%; background: var(--bg-main); }
.top-bar { height: 60px; background: var(--header-bg); display: flex; align-items: stretch; padding: 0 16px; gap: 4px; z-index: 100; }
.nav-btn { padding: 0 15px; display: flex; align-items: center; gap: 7px; border: none; border-bottom: 3px solid transparent; background: transparent; color: #a7b8bd; cursor: pointer; font-weight: 600; font-size: 14px; position: relative; transition: all 0.15s; white-space: nowrap; }
.nav-btn:hover { background: var(--header-active); color: #ffffff; }
.nav-btn.active { background: var(--header-active); color: #10b981; font-weight: 600; border-bottom-color: #10b981; }
.nav-ic { font-size: 16px; line-height: 1; opacity: 0.9; }

.dropdown-wrap { position: relative; display: flex; align-items: stretch; }
.dropdown-menu { display: none; position: absolute; top: 60px; left: 0; background: var(--header-bg); min-width: 215px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); z-index: 1000; border: 1px solid #233c43; }
.dropdown-wrap:hover .dropdown-menu { display: block; }
.dropdown-item { padding: 11px 16px; color: #d1d5db; cursor: pointer; font-size: 14px; border-bottom: 1px solid #233c43; }
.dropdown-item:hover { background: var(--header-active); color: #ffffff; }

.user-info { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #a7b8bd; font-size: 13px; }

/* --- КОНТЕЙНЕРЫ --- */
.main-area { flex: 1; overflow: hidden; display: flex; }
.tab-view { display: none; flex: 1; overflow: hidden; }
.tab-view.active { display: flex; }
.scroll-pad { flex: 1; overflow-y: auto; padding: 20px; }
.card { background: #ffffff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }

/* --- ФОРМЫ И КНОПКИ --- */
label { display: block; color: #4b5563; font-size: 13px; margin-bottom: 5px; font-weight: 500; }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 8px; background: #ffffff; border: 1px solid #d1d5db; color: var(--text-main); outline: none; transition: all 0.15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12); }
input[type="checkbox"] { width: auto; accent-color: var(--accent); cursor: pointer; }

.btn { padding: 9px 14px; border-radius: 8px; border: 1px solid #d1d5db; background: #ffffff; color: #374151; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.btn:hover { background: #f3f4f6; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #ffffff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.btn-sm { padding: 5px 9px; font-size: 12px; }

/* --- КАССА (ЗАКАЗ / ДЕТАЛИ НА ВСЮ ШИРИНУ БЛОКА) --- */
.pos-left { width: 500px; background: #ffffff; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sub-tabs { display: flex; width: 100%; background: #f8fafc; padding: 6px 6px 0 6px; gap: 4px; border-bottom: 1px solid var(--border); }
.sub-tab { flex: 1; text-align: center; padding: 11px 12px; background: transparent; color: #6b7280; border-radius: 8px 8px 0 0; cursor: pointer; font-weight: 600; border: 1px solid transparent; border-bottom: none; transition: all 0.15s; }
.sub-tab:hover { color: #1f2937; }
.sub-tab.active { background: #ffffff; color: #059669; border-color: var(--border); margin-bottom: -1px; }

.sub-panel { display: none; flex: 1; flex-direction: column; overflow-y: auto; }
.sub-panel.active { display: flex; }

.qty-circle { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #e5e7eb; background: #f9fafb; color: #374151; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.qty-circle:hover { background: #e5e7eb; }

.pay-choice { flex: 1; padding: 11px; border-radius: 8px; border: 1.5px solid #e5e7eb; background: #ffffff; color: #374151; font-weight: 600; cursor: pointer; text-align: center; transition: all 0.15s; }
.pay-choice.active { border-color: #10b981; color: #059669; background: #ffffff; }

.type-tabs { display: flex; gap: 8px; }
.type-tab { flex: 1; text-align: center; padding: 9px; border-radius: 8px; background: #f3f4f6; border: 1.5px solid #e5e7eb; color: #6b7280; cursor: pointer; font-weight: 600; }
.type-tab.active { background: #ecfdf5; color: #047857; border-color: #10b981; }

.pos-right { flex: 1; display: flex; flex-direction: column; padding: 16px 20px; gap: 14px; overflow: hidden; background: var(--bg-main); }
.cat-bar { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.cat-pill { padding: 12px 24px; border-radius: 8px; background: #ffffff; border: 1px solid #e5e7eb; color: #374151; cursor: pointer; white-space: nowrap; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.cat-pill.active { background: var(--accent); color: #ffffff; border-color: var(--accent); box-shadow: none; }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; overflow-y: auto; align-content: start; padding: 4px 2px 12px 2px; }
.dish-card { background: #ffffff; border: 1.5px solid #e5e7eb; border-radius: 10px; padding: 14px 10px; text-align: center; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; min-height: 86px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); transition: border-color 0.15s, box-shadow 0.15s; }
.dish-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12); }
.dish-name { font-weight: 600; color: #1f2937; font-size: 13px; line-height: 1.3; }
.dish-price { color: #059669; font-weight: 700; margin-top: 8px; font-size: 13px; }

/* --- ДВУХКОЛОНОЧНЫЙ КАТАЛОГ И ТАБЛИЦЫ --- */
.catalog-layout { flex: 1; display: flex; background: #ffffff; overflow: hidden; }
.cat-sidebar { width: 240px; background: #ffffff; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.cat-sidebar-list { flex: 1; overflow-y: auto; padding: 10px; }
.cat-side-item { padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #4b5563; border-bottom: 1px solid #f3f4f6; }
.cat-side-item.active { background: #ecfdf5; font-weight: 700; color: #047857; border-left: 3px solid var(--accent); }
.cat-sidebar-footer { padding: 12px; background: #f9fafb; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.prod-main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-main); }
.prod-toolbar { padding: 14px 20px; background: #ffffff; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.table-scroll { flex: 1; overflow-y: auto; padding: 0 20px 20px 20px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 14px; color: #6b7280; font-size: 11px; letter-spacing: 0.4px; border-bottom: 1px solid var(--border); text-transform: uppercase; background: #ffffff; position: sticky; top: 0; z-index: 5; }
td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; background: #ffffff; }

.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.order-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: background-color 0.35s ease, color 0.35s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease, box-shadow 0.25s ease;
}

.order-card.card-leaving {
    opacity: 0 !important;
    transform: scale(0.9) translateY(-12px) !important;
    pointer-events: none;
}
.badge { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* --- МОДАЛЬНЫЕ ОКНА И УВЕДОМЛЕНИЯ (ПЛАВНОЕ ПОЯВЛЕНИЕ И УВЕЛИЧЕННЫЙ МАСШТАБ) --- */
@keyframes popInModal {
    from { opacity: 0; transform: scale(0.94) translateY(14px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideInToast {
    from { opacity: 0; transform: translateY(18px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(17, 24, 39, 0.5); backdrop-filter: blur(2px); z-index: 2000; justify-content: center; align-items: center; }
.modal-box { background: #ffffff; width: 680px; max-width: 95vw; max-height: 92vh; border-radius: 14px; box-shadow: 0 24px 48px rgba(0,0,0,0.22); display: flex; flex-direction: column; overflow: hidden; animation: popInModal 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.modal-header { padding: 18px 24px; font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.modal-body { padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px; background: #f9fafb; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

.toast-box {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    align-items: flex-end;
}

.toast {
    background: #f97316;
    color: #ffffff;
    padding: 22px 32px;
    border-radius: 14px;
    border-left: 6px solid #c2410c;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.4;
    min-width: 340px;
    max-width: 480px;
    text-align: left;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    animation: slideInToast 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}



/* --- НЕЙТРАЛЬНО-СЕРЫЕ КНОПКИ НА КАРТОЧКЕ ЗАКАЗА С АНИМАЦИЕЙ --- */
.order-action-btn {
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background-color 0.18s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease;
}

.order-action-btn:hover {
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.13);
    transform: translateY(-1px);
}

.order-action-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
/* --- ИКОНКИ РЕДАКТИРОВАНИЯ И ОТМЕНЫ В ШАПКЕ КАРТОЧКИ --- */
.order-icon-btn {
    border: none;
    background: transparent;
    border-radius: 7px;
    padding: 5px 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.72;
    transition: background-color 0.18s ease, opacity 0.18s ease, transform 0.14s ease;
}

.order-icon-btn:hover {
    background: rgba(255, 255, 255, 0.65);
    opacity: 1;
    transform: translateY(-1px);
}

.order-icon-btn:active {
    transform: scale(0.92);
}
.ceh-dd { position: relative; display: inline-block; width: 100%; }
.ceh-dd-btn {
    width: 100%; height: 38px; padding: 0 12px; border-radius: 8px;
    border: 1px solid var(--border, rgba(0,0,0,0.18)); background: #fff;
    font-size: 13px; display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; gap: 8px; text-align: left;
}
.ceh-dd-menu {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid rgba(0,0,0,0.18); border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12); max-height: 230px; overflow-y: auto; z-index: 999;
}
.ceh-dd.open .ceh-dd-menu { display: block; }
.ceh-dd-opt { padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid rgba(0,0,0,0.05); }
.ceh-dd-opt:hover, .ceh-dd-opt.active { background: rgba(16, 185, 129, 0.1); font-weight: 600; }
#ed-p-loss::-webkit-outer-spin-button,
#ed-p-loss::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#ed-p-loss { -moz-appearance: textfield; appearance: textfield; }
#ed-p-loss:focus { box-shadow: none !important; outline: none !important; }
/* --- ФИРМЕННЫЕ ТУМБЛЕРЫ (TOGGLE SWITCH) ДЛЯ ВСЕХ ЧЕКБОКСОВ CRM --- */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 36px !important;
    height: 20px !important;
    min-width: 36px !important;
    min-height: 20px !important;
    padding: 0 !important;
    background: #d1d5db;
    border: 1px solid #cbd5e1;
    border-radius: 999px !important;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    vertical-align: middle;
    flex-shrink: 0;
    margin: 0;
    box-sizing: border-box !important;
}

input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    top: 50%;
    left: 2px;
    transform: translate(0, -50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

input[type="checkbox"]:checked {
    background: #10b981;
    border-color: #059669;
}

input[type="checkbox"]:checked::before {
    transform: translate(16px, -50%);
}

input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22) !important;
}

input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
@media (max-width: 900px) {
    .settings-subpanel {
        grid-template-columns: 1fr !important;
    }
}

/* --- ИНДИКАТОР СТАТУСА ККТ В ВЕРХНЕЙ ПАНЕЛИ --- */
.kkt-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.kkt-pill.ok {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}
.kkt-pill.warn {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}
.kkt-pill.err {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}
.kkt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: kktPulse 1.8s infinite ease-in-out;
}
.kkt-pill.ok .kkt-dot { background: #10b981; box-shadow: 0 0 8px #10b981; }
.kkt-pill.warn .kkt-dot { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.kkt-pill.err .kkt-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

@keyframes kktPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.38; transform: scale(0.82); }
}
