* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f1f5f9;
    height: 100vh;
    height: 100dvh;
    color: #0f172a;
    overflow-x: hidden;
    width: 100%;
}
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0b1120 0%, #1e293b 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 10;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 24px;
    font-size: 22px;
    font-weight: 600;
    border-bottom: 1px solid #334155;
}
.logo i { color: #facc15; font-size: 28px; }
.logo span { color: white; }
.menu {
    list-style: none;
    padding: 20px 12px;
    flex: 1;
}
.menu li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #94a3b8;
    transition: background 0.2s, color 0.2s;
}
.menu li i { width: 22px; font-size: 18px; text-align: center; }
.menu li .icon { width: 20px; height: 20px; opacity: 0.9; }
.menu li.active .icon { opacity: 1; }
.logo .icon { color: #facc15; }
.sidebar-footer .icon { color: #94a3b8; }

.menu li:hover { background: #334155; color: #ffffff; }
.menu li.active { background: #334155; color: #facc15; box-shadow: inset 3px 0 0 #facc15; }
.sidebar-footer {
    padding: 16px 16px 16px 20px;
    border-top: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #cbd5e1;
}
.sidebar-footer i { font-size: 22px; color: #94a3b8; }
.sidebar-collapse-btn {
    border: 1px solid #475569;
    background: #1e293b;
    color: #facc15;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
    background: #334155;
}
.content {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
    background: #f8fafc;
}
.content header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.content header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #0f172a;
}

/* Виджеты для главной */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.dashboard-card {
    background: white;
    padding: 24px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.15s, box-shadow 0.2s;
}
.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.dashboard-card .card-icon { font-size: 28px; color: #facc15; margin-bottom: 8px; }
.dashboard-card .card-value { font-size: 26px; font-weight: 700; color: #0f172a; }
.dashboard-card .card-label { font-size: 14px; color: #64748b; margin-top: 4px; }

/* Заглушка */
.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.placeholder .big-icon { font-size: 72px; color: #cbd5e1; margin-bottom: 20px; }
.placeholder h2 { font-size: 24px; font-weight: 500; color: #1e293b; margin-bottom: 8px; }
.placeholder p { color: #64748b; max-width: 400px; }
.placeholder .sub { font-size: 14px; color: #94a3b8; margin-top: 8px; }

/* --- Справочники: список карточек --- */
.ref-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.ref-card {
    background: white;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    text-align: center;
}
.ref-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.ref-card i {
    font-size: 36px;
    color: #facc15;
    margin-bottom: 10px;
}
.ref-card .ref-name {
    font-weight: 600;
    font-size: 16px;
    color: #0f172a;
}

/* --- Таблицы --- */
.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    overflow: auto;
    padding: 16px;
}
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.table-toolbar button {
    background: #facc15;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.table-toolbar button:hover {
    background: #e5b800;
}
table {
    width: 100%;
    border-collapse: collapse;
}
table th {
    text-align: left;
    padding: 12px 10px;
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}
table td {
    padding: 10px 10px;
    border-bottom: 1px solid #e2e8f0;
}
table tr:hover td {
    background: #f8fafc;
}
table .actions {
    display: flex;
    gap: 6px;
}
table .actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
table .actions .edit-btn:hover { background: #dbeafe; color: #2563eb; }
table .actions .delete-btn:hover { background: #fee2e2; color: #dc2626; }

/* --- Модальное окно --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    justify-content: center;
    align-items: flex-end;
    z-index: 200000;
    padding: 0;
    box-sizing: border-box;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: white;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: min(100vw, 600px);
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    box-sizing: border-box;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
        padding: 16px;
    }
    .modal {
        border-radius: 16px;
        width: 600px;
        max-width: min(96vw, 600px);
        max-height: 90vh;
        max-height: 90dvh;
    }
}
body.emp-mode .modal-overlay,
body.emp-embed-mode .modal-overlay {
    z-index: 300000;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}
.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}
.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
}
.modal-close:hover { color: #0f172a; }
.modal-body {
    padding: 24px;
}
.modal-body .form-group {
    margin-bottom: 16px;
}
.modal-body label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #334155;
}
.modal-body input, .modal-body select, .modal-body textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
    outline: none;
    border-color: #facc15;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.2);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 24px;
    border-top: 1px solid #e2e8f0;
}
.modal-footer button {
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.modal-footer .btn-cancel {
    background: #e2e8f0;
    color: #334155;
}
.modal-footer .btn-cancel:hover { background: #cbd5e1; }
.modal-footer .btn-save {
    background: #facc15;
    color: #0f172a;
}
.modal-footer .btn-save:hover { background: #e5b800; }

/* --- Заголовок страницы --- */
.page-header { margin-bottom: 28px; }
.page-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}
.page-header h1 {
    flex: 1;
    min-width: 0;
    font-size: 28px;
    font-weight: 600;
    color: #0f172a;
}
.page-content { min-width: 0; }

/* --- Нижний таббар (мобилка) --- */
.mobile-tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #334155;
    padding: 4px 4px max(6px, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: stretch;
    gap: 2px;
}
.tabbar-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
}
.tabbar-item .icon { width: 22px; height: 22px; opacity: 0.85; }
.tabbar-item.active {
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
}
.tabbar-item.active .icon { opacity: 1; }
.tabbar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.tabbar-more-icon {
    font-size: 22px;
    line-height: 22px;
    font-weight: 700;
}

/* --- Кнопка меню (ПК + мобилка) --- */
.menu-toggle {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 60;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: #0f172a;
    color: #facc15;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    align-items: center;
    justify-content: center;
    transition: left 0.25s ease, background 0.2s;
}
.menu-toggle:hover {
    background: #1e293b;
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 40;
}

/* ПК: сворачивание сайдбара → шире рабочая область */
@media (min-width: 901px) {
    .content {
        padding: 28px 36px 40px;
        padding-left: 36px;
        transition: padding 0.25s ease;
    }
    .table-container {
        border: 1px solid #e2e8f0;
    }
    .sidebar {
        transition: width 0.25s ease, min-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
        overflow: hidden;
    }
    /* кнопка рядом с сайдбаром, не перекрывает лого */
    .menu-toggle {
        left: 12px;
        top: auto;
        bottom: 20px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        opacity: 0.9;
    }
    body.sidebar-collapsed .sidebar {
        width: 0 !important;
        min-width: 0 !important;
        opacity: 0;
        pointer-events: none;
        margin: 0;
        border: none;
        box-shadow: none;
    }
    body.sidebar-collapsed .menu-toggle {
        left: 12px;
        bottom: 20px;
        opacity: 1;
        background: #0f172a;
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    }
    body.sidebar-collapsed .content {
        padding-left: 28px;
    }
}

@media (max-width: 900px) {
    .menu-toggle {
        display: flex;
        top: 12px;
        left: 12px;
        bottom: auto;
        width: 44px;
        height: 44px;
    }
    .mobile-tabbar { display: flex; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        height: 100dvh;
        width: min(300px, 86vw);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        z-index: 50;
        box-shadow: none;
        padding-bottom: env(safe-area-inset-bottom);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,0.35);
    }
    body.sidebar-open .sidebar-backdrop {
        display: block;
    }
    body.sidebar-open {
        overflow: hidden;
    }

    .content {
        padding: 12px 10px 24px;
        padding-top: 58px;
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        overflow-x: hidden;
    }
    .page-header {
        margin-bottom: 12px;
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start;
    }
    .page-header-inner {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        min-width: 0;
    }
    .page-header h1,
    .content header h1 {
        font-size: 17px;
        line-height: 1.25;
        word-break: break-word;
    }
    .nav-btn-text { display: none; }

    .menu li {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 48px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }
    .dashboard-card {
        padding: 14px 12px;
        border-radius: 14px;
    }
    .dashboard-card .card-value { font-size: 20px; }
    .dashboard-card .card-label { font-size: 12px; }

    .ref-list {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .ref-card {
        padding: 14px 10px;
        border-radius: 12px;
        min-width: 0;
    }
    .ref-card .ref-name {
        font-size: 13px;
        line-height: 1.3;
        word-break: break-word;
    }

    .table-container {
        padding: 8px;
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        max-width: 100%;
    }
    table {
        font-size: 12px;
        min-width: 0;
        width: 100%;
    }
    /* широкие таблицы — только внутри скролл-контейнера */
    .table-container table,
    .mobile-scroll table,
    #page-content .mobile-scroll table {
        min-width: 480px;
    }
    table th, table td {
        padding: 8px 6px;
        word-break: normal;
        overflow-wrap: anywhere;
        vertical-align: middle;
    }
    table.sales-matrix td:first-child,
    table.stocks-matrix td:first-child,
    table.sticky-first td:first-child {
        min-width: 150px !important;
        max-width: 200px;
        white-space: normal !important;
        word-break: normal !important;
    }
    table .actions button {
        padding: 8px 10px;
        font-size: 16px;
        min-height: 40px;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .table-toolbar button {
        justify-content: center;
        min-height: 44px;
        width: 100%;
    }

    .modal-overlay {
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: none;
    }
    .modal-header {
        padding: 12px 14px;
        padding-top: max(12px, env(safe-area-inset-top));
        flex-shrink: 0;
        gap: 8px;
    }
    .modal-header h2 {
        font-size: 17px;
        line-height: 1.25;
        word-break: break-word;
        min-width: 0;
        flex: 1;
    }
    .modal-close {
        font-size: 32px;
        min-width: 44px;
        min-height: 44px;
        line-height: 1;
        flex-shrink: 0;
    }
    .modal-body {
        padding: 12px 14px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
    .modal-body .form-group {
        margin-bottom: 12px;
    }
    .modal-body label {
        font-size: 13px;
        margin-bottom: 6px;
        line-height: 1.3;
        word-break: break-word;
    }
    .modal-body input,
    .modal-body select,
    .modal-body textarea {
        font-size: 16px; /* без зума iOS */
        min-height: 46px;
        padding: 12px;
        border-radius: 10px;
        box-sizing: border-box;
        max-width: 100%;
    }
    .modal-body textarea {
        min-height: 96px;
        resize: vertical;
        line-height: 1.4;
    }
    .modal-body input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-height: 22px;
    }
    .modal-body input[type="file"] {
        min-height: 0;
        padding: 8px 0;
    }
    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
        padding: 12px 14px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        flex-shrink: 0;
        border-top: 1px solid #e2e8f0;
        background: #fff;
    }
    .modal-footer button {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
        border-radius: 12px;
    }
    /* фото-блок в форме товара */
    .product-photo-box {
        border: 2px dashed #94a3b8 !important;
        border-radius: 14px !important;
        padding: 14px !important;
        margin-top: 8px !important;
        background: #f8fafc !important;
    }
    .product-photo-box label[for="product-photo-file"] {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 14px 16px !important;
        box-sizing: border-box !important;
        font-size: 15px !important;
        border-radius: 12px !important;
    }
    .product-photo-box img {
        max-width: 100% !important;
        height: auto !important;
        max-height: 200px !important;
        margin: 0 auto 10px !important;
        display: block !important;
    }

    .nav-btn {
        min-height: 40px;
        padding: 8px 10px;
    }

    .content input[type="date"],
    .content input[type="number"],
    .content input[type="text"],
    .content input[type="tel"],
    .content input[type="search"],
    .content select,
    .content textarea,
    .content button {
        max-width: 100%;
    }
    .content input,
    .content select,
    .content textarea {
        font-size: 16px; /* без zoom iOS */
    }

    #page-content,
    #page-content > div,
    #page-content section {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    /* flex-ряды с inline-style — перенос */
    #page-content [style*="display:flex"],
    #page-content [style*="display: flex"] {
        flex-wrap: wrap !important;
        max-width: 100%;
    }
    #page-content [style*="grid-template-columns:repeat"] {
        grid-template-columns: 1fr !important;
    }

    /* кнопки в ряд — не вылезают */
    #page-content button {
        min-height: 42px;
        max-width: 100%;
    }

    /* горизонтальный скролл только в явных контейнерах */
    .mobile-scroll,
    #page-content .table-container,
    #page-content [data-mobile-scroll] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        margin-left: -2px;
        margin-right: -2px;
        padding-bottom: 4px;
    }
    .mobile-scroll > table,
    .mobile-scroll > div {
        min-width: min(100%, 640px);
    }

    /* sticky первая колонка в широких таблицах (если размечена) */
    .mobile-scroll table.sticky-first th:first-child,
    .mobile-scroll table.sticky-first td:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 2;
        box-shadow: 2px 0 4px rgba(0,0,0,0.06);
    }

    /* карточки подменю (Заявки, График…) */
    #page-content .ref-card[data-target] {
        padding: 16px 14px;
    }

    /* компактные заголовки h3 внутри модулей */
    #page-content h3 {
        font-size: 16px;
        line-height: 1.3;
    }
    #page-content h4 {
        font-size: 14px;
    }

    /* поля даты/числа не растягивают экран */
    #page-content input[type="date"],
    #page-content input[type="number"] {
        min-width: 0;
        width: auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-grid,
    .ref-list {
        grid-template-columns: 1fr;
    }
    .tabbar-label { font-size: 9px; }
    .content header h1,
    .page-header h1 {
        font-size: 16px;
    }
    .content {
        padding-left: 8px;
        padding-right: 8px;
    }
    /* на узком экране кнопки-табы модуля — столл в одну линию */
    #page-content .fr-tab,
    #page-content .rep-tab {
        flex: 1 1 auto;
        min-width: calc(50% - 6px);
        text-align: center;
        font-size: 13px;
        padding: 10px 8px !important;
    }
}

/* безопасная зона iPhone */
@supports (padding: max(0px)) {
    @media (max-width: 900px) {
        .menu-toggle {
            top: max(12px, env(safe-area-inset-top));
            left: max(12px, env(safe-area-inset-left));
        }
    }
}
/* Кнопки навигации */
.nav-btn {
    background: none;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, color 0.2s;
    color: #64748b;
    background: #f1f5f9;
}
.nav-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.nav-btn i {
    font-size: 16px;
}
/* Стили для группировки справочников */
.ref-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
/* --- Login --- */
#login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(145deg, #0b1120 0%, #1e293b 50%, #0f172a 100%);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
body.login-locked .app-container,
body.login-locked .mobile-tabbar,
body.login-locked .menu-toggle {
    visibility: hidden;
    pointer-events: none;
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.login-logo {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin-bottom: 4px;
}
.login-sub {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 18px;
}
.login-card label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin: 10px 0 4px;
}
.login-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}
.login-card button#login-btn {
    width: 100%;
    margin-top: 18px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #0f172a;
    color: #facc15;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}
.login-card button#login-btn:hover { background: #1e293b; }
.login-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    margin-bottom: 8px;
}


/* ===== Sales analysis compact UI ===== */
.sa-page {
    display: grid;
    gap: 12px;
    padding-bottom: 24px;
}
.sa-head {
    background: #fff;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    display: grid;
    gap: 10px;
}
.sa-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sa-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}
.sa-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.sa-btn {
    border: none;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.sa-btn-primary { background: linear-gradient(135deg, #facc15, #eab308); color: #0f172a; }
.sa-btn-ghost { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.sa-btn-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.sa-btn-wide { width: 100%; padding: 12px; font-size: 14px; }

.sa-quick {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.sa-quick::-webkit-scrollbar { display: none; }
.sa-chip {
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.sa-chip.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #facc15;
}

.sa-toolbar {
    background: #fff;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    display: grid;
    gap: 12px;
    transition: opacity .15s ease;
}
.sa-toolbar.is-collapsed {
    display: none;
}

.sa-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.sa-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.sa-field > span {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}
.sa-field input,
.sa-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    min-width: 0;
    min-height: 42px;
}

.sa-pay-filter { display: grid; gap: 6px; }
.sa-subtoggle {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    padding: 0;
    cursor: pointer;
}
.sa-pay-body { display: none; }
.sa-pay-body.is-open { display: grid; gap: 8px; }
.sa-hint { font-size: 11px; color: #94a3b8; line-height: 1.35; }
.sa-pay-types { display: flex; flex-wrap: wrap; gap: 6px; }

.sa-advanced {
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}
.sa-advanced > summary {
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
    list-style: none;
    user-select: none;
}
.sa-advanced > summary::-webkit-details-marker { display: none; }
.sa-advanced-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: end;
    margin-top: 8px;
}
.sa-advanced-body .sa-btn-danger { grid-column: 1 / -1; }

.sa-toolbar-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
}

.sa-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.sa-stat {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    display: grid;
    gap: 4px;
}
.sa-stat-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.sa-stat-val {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    word-break: break-word;
}
.sa-period-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    padding: 0 2px;
}

.sa-card {
    background: #fff;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    min-width: 0;
}
.sa-table-host {
    font-size: 13px;
    color: #94a3b8;
    min-width: 0;
}
.sa-table-scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    max-height: min(70vh, 720px);
    border: 1px solid #f1f5f9;
    border-radius: 12px;
}
.sa-matrix {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.sa-scroll-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}

.sa-cards { display: grid; gap: 8px; }
.sa-item-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    background: #fff;
}
.sa-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.sa-item-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.3;
}
.sa-item-qty {
    flex-shrink: 0;
    font-weight: 800;
    font-size: 16px;
    color: #0f172a;
    background: #fef9c3;
    border-radius: 10px;
    padding: 4px 8px;
}
.sa-item-group {
    margin-top: 4px;
    font-size: 11px;
    color: #6366f1;
    font-weight: 600;
}
.sa-item-cafes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.sa-pill {
    font-size: 11px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 8px;
    color: #334155;
}
.sa-pill b { color: #0f172a; }
.sa-muted { font-size: 12px; color: #94a3b8; }
.sa-group-title {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
    font-weight: 800;
    color: #3730a3;
    background: #eef2ff;
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 4px;
}
.sa-group-title span {
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
}

@media (min-width: 701px) {
    .sa-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .sa-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .sa-toolbar.is-collapsed {
        display: grid; /* на ПК панель можно скрывать кнопкой, но не display:none если не collapsed - actually collapsed still hides */
    }
    .sa-scroll-hint { display: none; }
    .sa-toolbar-actions {
        grid-template-columns: auto 220px;
        justify-content: end;
    }
}

@media (max-width: 700px) {
    .sa-page { gap: 10px; }
    .sa-title { font-size: 16px; }
    .sa-stat-val { font-size: 16px; }
    .sa-head, .sa-toolbar, .sa-card, .sa-stat { border-radius: 14px; }
}

/* чекбоксы в формах */
.modal-body .form-group.form-group-check {
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-body .form-group.form-group-check label {
    margin: 0;
    order: 2;
}
.modal-body .form-group.form-group-check input[type="checkbox"] {
    order: 1;
    width: 22px;
    flex-shrink: 0;
}

body.modal-open { overflow: hidden; touch-action: none; }


/* mobile form UX hint strip */
@media (max-width: 900px) {
  .modal-body::before {
    content: "Прокрутите форму вниз при необходимости · поля адаптированы под телефон";
    display: block;
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 12px;
    line-height: 1.35;
  }
}


/* ===== Сборка (mobile-first) ===== */
.asm-stack { display: grid; gap: 12px; width: 100%; min-width: 0; }
.asm-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  overflow: hidden;
}
.asm-summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.asm-summary::-webkit-details-marker { display: none; }
.asm-summary-hint { font-size: 12px; font-weight: 500; color: #64748b; flex-shrink: 0; }
.asm-card-body { padding: 0 12px 14px; }
.asm-card-title { font-weight: 800; font-size: 15px; padding: 14px 16px 0; }
.asm-muted { font-size: 13px; color: #64748b; line-height: 1.35; margin: 0; padding: 0 16px; }
.asm-label { display: block; font-size: 12px; color: #64748b; margin: 8px 0 4px; font-weight: 600; }
.asm-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
  min-height: 46px;
  background: #fff;
}
.asm-group { margin-top: 12px; }
.asm-group-title { font-weight: 700; color: #3730a3; margin-bottom: 8px; font-size: 13px; }
.asm-lines { display: grid; gap: 8px; }
.asm-line {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.asm-line-warn { border-color: #fde68a; background: #fffbeb; }
.asm-prod-btn {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.asm-prod-name {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
}
.asm-info-ico { color: #94a3b8; flex-shrink: 0; font-size: 14px; }
.asm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 12px;
  color: #64748b;
}
.asm-ok { color: #059669; }
.asm-accept-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #64748b;
}
.asm-accept-row .asm-qty {
  width: 100px;
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
}
.asm-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.asm-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  padding: 12px 14px;
}
.asm-btn-dark { background: #0f172a; color: #fff; }
.asm-btn-ghost { background: #f8fafc; color: #0f172a; border: 1px solid #e2e8f0; }

#pt-pack-root, #au-dispatch, #ad-pack {
  min-width: 0;
  max-width: 100%;
}
.pt-pack-line {
  min-width: 0;
}
.pt-pack-line button.pt-prod-info {
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .asm-mobile-root { padding-bottom: 8px; }
  .asm-card-title, .asm-muted { padding-left: 12px; padding-right: 12px; }
  #pt-pack-pick, #au-order, #au-acc-search {
    font-size: 16px !important;
    min-height: 46px !important;
  }
  /* product info popup on mobile */
  #fr-prod-pop > div {
    max-width: 100% !important;
    margin: 0 8px;
    max-height: 85dvh !important;
  }
}


/* Контроль отправки */
.sc-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sc-metric {
  background: rgba(255,255,255,0.85);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}
.sc-metric span {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
  line-height: 1.2;
}
.sc-metric b {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
  word-break: break-word;
}
@media (min-width: 700px) {
  .sc-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


/* ===== Экзамены — редактор ===== */
.ex-root { display: grid; gap: 12px; min-width: 0; }
.ex-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-tab {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  min-height: 44px;
}
.ex-tab-on {
  border: 2px solid #0f172a !important;
  background: #0f172a !important;
  color: #fff !important;
  font-weight: 700;
}
.ex-body { min-width: 0; }
.ex-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.ex-panel-title { font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.ex-label { display: block; font-size: 12px; color: #64748b; font-weight: 600; margin: 8px 0 4px; }
.ex-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
  min-height: 46px;
  background: #fff;
  max-width: 100%;
}
.ex-textarea { min-height: 72px; resize: vertical; line-height: 1.4; }
.ex-check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; }
.ex-check input { width: 20px; height: 20px; }
.ex-actions { display: grid; gap: 8px; margin-top: 12px; }
.ex-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  padding: 12px;
}
.ex-btn-primary { background: #3b82f6; color: #fff; }
.ex-btn-ghost { background: #f8fafc; color: #0f172a; border: 1px solid #e2e8f0; }
.ex-list { display: grid; gap: 8px; }
.ex-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  min-width: 0;
}
.ex-card-pass { border-color: #a7f3d0; background: #ecfdf5; }
.ex-card-fail { border-color: #fecaca; background: #fef2f2; }
.ex-card-off { opacity: 0.55; }
.ex-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ex-card-main { min-width: 0; flex: 1; }
.ex-card-name { font-weight: 800; font-size: 15px; word-break: break-word; line-height: 1.3; }
.ex-card-sub { font-size: 12px; color: #64748b; margin-top: 4px; word-break: break-word; line-height: 1.35; }
.ex-card-meta { font-size: 12px; color: #64748b; margin-top: 4px; }
.ex-card-btns { display: flex; gap: 6px; flex-shrink: 0; }
.ex-icon-btn {
  min-width: 40px; min-height: 40px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
}
.ex-score-box { text-align: right; flex-shrink: 0; }
.ex-score { font-size: 24px; font-weight: 900; line-height: 1; }
.ex-score.ok, .ex-score-lbl.ok { color: #065f46; }
.ex-score.bad, .ex-score-lbl.bad { color: #b91c1c; }
.ex-score-lbl { font-size: 11px; font-weight: 700; margin-top: 2px; }
.ex-empty { color: #94a3b8; padding: 12px; margin: 0; }
.ex-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ex-range { width: 100%; margin: 8px 0; }
.ex-pass-hint { font-size: 13px; font-weight: 700; margin: 4px 0 8px; }
.ex-pass-hint.ok { color: #065f46; }
.ex-pass-hint.bad { color: #b91c1c; }
.ex-stat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-stat-card {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 12px; flex: 1; min-width: 110px;
}
.ex-stat-t { font-size: 11px; color: #64748b; }
.ex-stat-v { font-size: 22px; font-weight: 800; margin-top: 4px; }
.ex-stat-s { font-size: 11px; color: #94a3b8; }
@media (max-width: 900px) {
  .ex-row2 { grid-template-columns: 1fr; }
  select.ex-input[size] { height: auto; max-height: 180px; }
}


/* ===== Учебные материалы ===== */
.tr-stack { display: grid; gap: 12px; min-width: 0; }
.tr-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-btn {
  min-height: 44px; padding: 10px 14px; border-radius: 12px; border: none;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.tr-btn-primary { background: #3b82f6; color: #fff; }
.tr-btn-ghost { background: #f8fafc; color: #0f172a; border: 1px solid #e2e8f0; }
.tr-btn-danger { background: #fee2e2; color: #b91c1c; }
.tr-list { display: grid; gap: 8px; }
.tr-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px;
  display: grid; gap: 10px;
}
.tr-card-title { font-weight: 800; font-size: 16px; word-break: break-word; }
.tr-card-sub { font-size: 12px; color: #64748b; margin-top: 4px; }
.tr-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-empty { color: #94a3b8; margin: 0; padding: 8px 0; }
.tr-h2 { margin: 0; font-size: 20px; word-break: break-word; }
.tr-desc { color: #64748b; margin: 0; line-height: 1.4; }
.tr-panel {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px;
}
.tr-panel-title { font-weight: 800; margin-bottom: 8px; }
.tr-label { display: block; font-size: 12px; color: #64748b; font-weight: 600; margin: 8px 0 4px; }
.tr-input {
  width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #d1d5db;
  border-radius: 12px; font-size: 16px; min-height: 46px;
}
.tr-textarea { min-height: 90px; resize: vertical; line-height: 1.4; }
.tr-inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 600px) {
  .tr-inline { grid-template-columns: 1fr; }
}
.tr-dep {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 0 0 10px;
  overflow: hidden;
}
.tr-dep-sum {
  cursor: pointer; padding: 12px 14px; font-weight: 800; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.tr-dep-sum::-webkit-details-marker { display: none; }
.tr-sum-actions { display: flex; gap: 6px; }
.tr-sec { margin: 8px 12px; padding: 10px; border: 1px solid #f1f5f9; border-radius: 12px; background: #f8fafc; }
.tr-sec-title { font-weight: 700; margin-bottom: 8px; }
.tr-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.tr-item {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; margin-bottom: 8px;
}
.tr-item-title { font-weight: 700; margin-bottom: 6px; word-break: break-word; }
.tr-item-body { font-size: 14px; line-height: 1.45; color: #334155; word-break: break-word; }
.tr-item-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tr-img { max-width: 100%; max-height: 220px; border-radius: 10px; display: block; margin: 8px 0; }
.tr-item-side { flex: 0 0 78px !important; width: 78px !important; min-width: 78px !important; }
.tr-photo-thumb {
  width: 78px !important; height: 78px !important; min-height: 78px !important;
  border-radius: 10px; overflow: hidden; background: #f1f5f9;
  -webkit-user-select: none; user-select: none;
}
.tr-photo-thumb img {
  width: 78px !important; height: 78px !important;
  object-fit: cover !important; display: block !important;
  max-width: none !important; max-height: none !important;
  margin: 0 !important; border: 0 !important;
}
@media (max-width: 600px) {
  .tr-item-side { flex: 0 0 72px !important; width: 72px !important; min-width: 72px !important; }
  .tr-photo-thumb, .tr-photo-thumb img {
    width: 72px !important; height: 72px !important; min-height: 72px !important;
  }
}

.tr-mini {
  min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid #e2e8f0;
  background: #fff; cursor: pointer; font-size: 13px;
}


/* Exam take grades */
.ex-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.ex-tab {
  min-height:44px; padding:10px 14px; border-radius:12px; border:1px solid #e2e8f0;
  background:#fff; font-weight:700; cursor:pointer; font-size:14px;
}
.ex-tab.on { background:#0f172a; color:#fff; border-color:#0f172a; }
.ex-grade-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.ex-grade-opt {
  display:flex; align-items:center; justify-content:center;
  min-width:48px; min-height:48px; border:1px solid #e2e8f0; border-radius:12px;
  background:#fff; cursor:pointer; position:relative;
}
.ex-grade-opt input { position:absolute; opacity:0; }
.ex-grade-num { font-weight:900; font-size:18px; }
.ex-grade-opt:has(input:checked) { background:#0f172a; color:#fff; border-color:#0f172a; }
.ex-grade-live { margin-top:6px; font-size:12px; color:#64748b; font-weight:600; }
.ex-summary {
  margin-top:12px; padding:12px; border-radius:12px; border:1px solid #e2e8f0;
  font-size:14px;
}
.ex-hint { font-size:13px; color:#64748b; margin:0 0 10px; line-height:1.4; }
.ex-inline { display:grid; grid-template-columns:1fr auto; gap:8px; }
@media (max-width:600px) { .ex-inline { grid-template-columns:1fr; } }


/* Кнопка выхода в шапке — всегда заметна на мобилке */
#auth-logout-top {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}
.page-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
@media (max-width: 900px) {
  #auth-logout-top {
    background: #0f172a !important;
    color: #fff !important;
    border-color: #0f172a !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
  }
}

/* форма справочника / приём кандидата */
#ref-form, .modal-body form {
    padding: 12px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#ref-form label, .modal-body form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}
#ref-form input, #ref-form select, #ref-form textarea,
.modal-body form input, .modal-body form select, .modal-body form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 12px;
    font-size: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    min-height: 44px;
}
#ref-form button[type="submit"], .modal-body form button[type="submit"] {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    background: #0ea5e9;
    color: #fff;
    margin-top: 8px;
    min-height: 48px;
}
.modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
