:root {
    --navy: #0b2a4a;
    --navy-2: #123f6b;
    --teal: #0fa3a3;
    --teal-dark: #0b7f7f;
    --ink: #1f2a37;
    --muted: #6b7280;
    --line: #e3e8ef;
    --surface: #ffffff;
    --bg: #f4f6fa;
    --danger: #b42318;
    --success: #067647;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

a {
    text-decoration: none;
}

.app-navbar {
    background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%);
    min-height: 62px;
    box-shadow: 0 2px 12px rgba(11, 42, 74, .18);
}

.app-navbar .navbar-brand {
    color: #fff;
    font-weight: 700;
    letter-spacing: .2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--teal) 0%, #2fd0c0 100%);
    color: #04283f;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, .76);
    font-size: 13.5px;
    padding: 1.15rem .85rem;
    border-bottom: 2px solid transparent;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    color: #fff;
    border-bottom-color: #31d3c4;
}

.app-navbar .dropdown-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transform-origin: top center;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    padding: .45rem;
    font-size: 13.5px;
}

.app-navbar .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    animation: navbar-menu-slide-in .18s ease both;
}

@keyframes navbar-menu-slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-navbar .dropdown-item {
    border-radius: 8px;
    padding: .5rem .7rem;
}

.app-navbar .dropdown-item:hover {
    background: #eef6f6;
    color: var(--teal-dark);
}

.app-navbar .dropdown-item.active {
    background: var(--navy);
    color: #fff;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.navbar-actions { display: flex; align-items: center; gap: 8px; }
.app-navbar .navbar-brand { order: 1; }
.app-navbar .navbar-collapse { order: 2; }
.app-navbar .navbar-actions { order: 3; margin-left: auto; }
.navbar-user-dropdown { order: 2; }
.app-navbar .navbar-toggler { order: 1; padding: 5px 7px; border-radius: 9px; }
.app-navbar .navbar-toggler:hover { background: rgba(255,255,255,.12); }
.app-navbar .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(255,255,255,.2); }
.user-chip.dropdown-toggle::after { display: none; }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 13px;
}

.app-main {
    flex: 1 0 auto;
    padding: 26px 30px 0;
    max-width: 1680px;
    width: 100%;
}

body > footer { flex: 0 0 auto; margin-top: auto; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-title {
    color: var(--navy);
    font-size: 25px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -.2px;
}

.page-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.app-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .04);
    padding: 20px;
}

.app-card {
    margin-bottom: 18px;
}

.section-title {
    font-size: 16px;
    font-weight: 650;
    color: var(--navy);
    margin: 0 0 4px;
}

.section-hint {
    color: var(--muted);
    font-size: 12.5px;
    margin-bottom: 14px;
}

.btn {
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    padding: .48rem .85rem;
}

.btn-primary {
    background: var(--teal);
    border-color: var(--teal);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
}

.btn-outline-primary {
    color: var(--navy);
    border-color: #c9d4e0;
}

.btn-outline-primary:hover {
    background: var(--navy);
    border-color: var(--navy);
}

.btn-outline-success {
    color: var(--success);
    border-color: #a6d9c1;
}

.btn-outline-success:hover {
    background: var(--success);
    border-color: var(--success);
}

.btn-outline-danger {
    color: var(--danger);
    border-color: #f0b7b0;
}

.btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-light {
    background: #f1f4f8;
    border-color: #e2e8f0;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #344054;
    margin-bottom: 4px;
}

.form-control,
.form-select {
    border-color: #d5dbe3;
    border-radius: 8px;
    font-size: 13.5px;
    padding: .5rem .7rem;
}

.form-select {
    padding-right: 1.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 163, 163, .14);
}

.showcase-tabs {
    gap: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    margin-bottom: 14px;
}

.showcase-tabs .nav-link {
    color: #475467;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    padding: .62rem 1rem;
    background: transparent;
    border-bottom: 2px solid transparent;
}

.showcase-tabs .nav-link:hover {
    color: var(--navy);
}

.showcase-tabs .nav-link.active {
    background: transparent;
    color: var(--navy);
    border-bottom-color: var(--teal);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 0;
}

.toolbar .filters,
.filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    width: 100%;
}

.toolbar .filters {
    width: auto;
    flex: 1 1 auto;
}

.filters > div {
    flex: 0 0 auto;
    min-width: 0;
}

.filter-field {
    width: 190px;
}

.filter-field-sm {
    width: 150px;
}

.filter-field-wide {
    width: 340px;
    max-width: 100%;
}

.filter-field input,
.filter-field select {
    width: 100%;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar .actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: auto;
    max-height: 62vh;
}

.table-data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.5px;
    margin: 0;
}

.table-data thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7f9fc;
    border-bottom: 1px solid var(--line);
    color: #344054;
    font-weight: 650;
    padding: 9px 10px;
    white-space: nowrap;
    font-size: 11.5px;
    letter-spacing: .1px;
}

.table-data thead th a {
    color: inherit;
}

.table-data thead th a:hover {
    color: var(--teal-dark);
}

.table-data tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #eef1f5;
    color: #283747;
    background: #fff;
}

.table-data tbody tr:last-child td {
    border-bottom: 0;
}

.table-data tbody tr:hover td {
    background: #f8fbfc;
}

.table-data .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.table-data .date {
    white-space: nowrap;
}

.table-data .wide-col {
    min-width: 260px;
    max-width: 420px;
}

.table-data .check-col {
    width: 38px;
    min-width: 38px;
    text-align: center;
}

.table-data .checkbox-cell {
    text-align: center;
}

.table-data td .cell-text {
    display: inline-block;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.table-data td.wide-col .cell-text {
    max-width: 400px;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 12px;
}

.table-footer .pagination {
    margin: 0;
    --bs-pagination-color: var(--navy);
    --bs-pagination-active-bg: var(--teal);
    --bs-pagination-active-border-color: var(--teal);
    --bs-pagination-focus-box-shadow: none;
    --bs-pagination-font-size: 12.5px;
}

.empty-state {
    padding: 48px 20px !important;
    text-align: center;
    color: var(--muted);
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: .25rem .55rem;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-soft.success {
    background: #e7f6ee;
    color: var(--success);
}

.badge-soft.danger {
    background: #fdecea;
    color: var(--danger);
}

.badge-soft.secondary {
    background: #eef2f6;
    color: #475467;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.stat-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 14px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: .15s;
}

.stat-card:hover {
    border-color: #b7dcdc;
    box-shadow: 0 8px 20px rgba(15, 163, 163, .08);
    transform: translateY(-1px);
}

.stat-card .label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 2px;
}

.stat-card .value {
    display: block;
    color: var(--navy);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9f7f7;
    color: var(--teal-dark);
    font-size: 17px;
}

.upload-zone {
    border: 1.5px dashed #bfd0df;
    border-radius: 12px;
    padding: 22px;
    background: #fbfdff;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    cursor: pointer;
    transition: .15s;
}

.upload-zone.dragover {
    border-color: var(--teal);
    background: #f1fbfb;
}

.upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #e9f7f7;
    color: var(--teal-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.upload-zone .file-name {
    font-size: 12.5px;
    color: var(--muted);
}

.nav-tabs .nav-link {
    color: #475467;
    font-size: 13px;
    font-weight: 600;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: .7rem .2rem;
    margin-right: 1.5rem;
}

.nav-tabs .nav-link.active {
    color: var(--navy);
    border-bottom-color: var(--teal);
    background: transparent;
}

.alert {
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-success {
    background: #edfdf5;
    color: #05603a;
    border-color: #b7ebd0;
}

.alert-danger {
    background: #fff4f2;
    color: #912018;
    border-color: #f5c6c0;
}

.alert-warning {
    background: #fffaeb;
    color: #93370d;
    border-color: #fedf89;
}

.alert-info {
    background: #eff8ff;
    color: #175cd3;
    border-color: #b2ddff;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13px;
    color: #475467;
    padding: 10px 0;
}

.report-meta b {
    color: var(--navy);
}

.table-report {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.table-report th,
.table-report td {
    border: 1px solid #cfd8e3;
    padding: 5px 6px;
    vertical-align: top;
}

.table-report thead th {
    background: #eef2f7;
    text-align: center;
    font-weight: 650;
    color: #1f2a37;
}

.table-report thead th[data-grid-col] { position: relative; padding-right: 20px; }
.table-report thead th[data-grid-col] > .sort-ind { position: absolute; top: 6px; right: 6px; }

.table-report tbody td.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.table-report tfoot td {
    font-weight: 700;
    background: #f7f9fc;
}

.table-report .min-col {
    min-width: 230px;
}

.report-scroll {
    overflow: auto;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.form-grid > * {
    width: 100%;
    min-width: 0;
}

.form-grid .col-3 { grid-column: span 3; }
.form-grid .col-4 { grid-column: span 4; }
.form-grid .col-6 { grid-column: span 6; }
.form-grid .col-12 { grid-column: span 12; }

.address-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 12px;
    align-items: start;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.address-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.address-row > .remove-address {
    margin-top: 27px;
}

.settings-repeater {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.settings-repeater-row {
    display: flex;
    gap: 8px;
}

.settings-repeater-row .form-control {
    min-width: 0;
}

.expand-col,
.expand-cell {
    width: 34px;
    min-width: 34px;
    text-align: center;
}

.js-row-expand[aria-expanded="true"] i {
    display: inline-block;
    transform: rotate(180deg);
}

.detail-row > td {
    padding: 14px 18px !important;
    background: #f7f9fc;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px 20px;
}

.detail-sections {
    display: grid;
    gap: 18px;
}

.detail-section-title {
    margin: 0 0 9px;
    color: #29364a;
    font-size: 13px;
    font-weight: 600;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.detail-label {
    color: #687386;
    font-size: 11px;
}

.detail-value {
    color: #1f2937;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(15, 163, 163, .22), transparent 34%),
        radial-gradient(circle at 88% 82%, rgba(47, 208, 192, .16), transparent 30%),
        linear-gradient(135deg, #071e35 0%, #0b2a4a 55%, #113a60 100%);
}

.login-card {
    width: min(430px, 100%);
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .35);
}

.login-body {
    min-height: 100vh;
    min-height: 100dvh;
}

.login-form {
    padding: 38px 36px 30px;
    display: flex;
    flex-direction: column;
}

.login-form h2 {
    color: var(--navy);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-form .sub {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.login-form .btn {
    padding: .7rem 1rem;
}

.login-footer {
    color: #98a2b3;
    font-size: 11.5px;
    margin-top: 22px;
    text-align: center;
}

@media (max-width: 992px) {
    .app-main {
        padding: 18px 14px 0;
    }

    .app-navbar .nav-link {
        padding: .6rem .5rem;
    }

    .app-navbar .container-fluid { flex-wrap: wrap; }
    .app-navbar .navbar-brand { order: 1; }
    .app-navbar .navbar-actions { order: 2; margin-left: auto; }
    .app-navbar .navbar-collapse { flex-basis: 100%; padding: .2rem 0 .35rem; }
    .app-navbar .navbar-collapse { order: 3; }
    .app-navbar .navbar-nav { gap: 2px; }
    .app-navbar .nav-link { border: 0; border-radius: 7px; padding: .38rem .6rem; }
    .app-navbar .nav-link:hover, .app-navbar .nav-link.active { background: rgba(255,255,255,.1); }
    .app-navbar .nav-item.dropdown .dropdown-menu { background: rgba(255,255,255,.98); }
    .app-navbar .navbar-nav .dropdown-menu:not(.show) { display: none; }
    .app-navbar .navbar-nav .dropdown-menu.show { display: block; }
    .navbar-user-dropdown .dropdown-menu { position: absolute; right: 0; left: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .app-navbar .dropdown-menu { transition: none; }
}

@media (max-width: 768px) {
    .form-grid .col-3,
    .form-grid .col-4,
    .form-grid .col-6 {
        grid-column: span 12;
    }

    .address-row {
        grid-template-columns: 1fr;
    }

    .address-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-field,
    .filter-field-sm,
    .filter-field-wide {
        width: 100%;
    }

    .login-form {
        padding: 32px 24px;
    }

    .login-body,
    .login-page {
        min-height: 100svh;
        min-height: 100dvh;
    }

    .login-page {
        padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    }

    .report-filter-actions {
        flex: 1 1 100%;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .report-filter-actions > .btn {
        flex: 0 0 100%;
        width: 100%;
        white-space: normal;
    }
}

/* ---------- Витрина данных: сетка в стиле демо ---------- */

.showcase-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.showcase-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.showcase-head-actions form {
    display: inline-flex;
}

.showcase-head-actions .btn {
    padding: .5rem .95rem;
    font-size: 13px;
}

.showcase-card {
    padding: 10px 12px 6px;
}

.grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 2px 2px 10px;
}

.grid-toolbar-left,
.grid-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 36px;
    border: 1px solid #d5dbe3;
    border-radius: 8px;
    color: var(--navy);
    background: #fff;
    font-size: 14px;
}

.grid-icon-btn:hover {
    color: var(--teal-dark);
    border-color: #9fd3d3;
    background: #f2fbfb;
}

.column-chooser {
    width: 360px;
    max-width: calc(100vw - 32px);
    padding: 0;
    overflow: hidden;
}

.column-chooser-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-weight: 650;
    color: var(--navy);
    font-size: 13px;
}

.column-chooser-head .btn {
    color: var(--teal);
    text-decoration: none;
}

.column-chooser-head .btn:hover {
    color: var(--teal-dark);
}

.column-chooser-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px 12px 12px;
}

.column-choice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 3px 0;
    font-size: 12.5px;
    line-height: 1.35;
}

.column-choice .form-check-input {
    margin-top: 2px;
    flex-shrink: 0;
}

.column-chooser-list .form-check .form-check-input {
    margin-left: 0;
}

.showcase-grid {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
}

.showcase-card .table-wrap {
    max-height: none;
}

.showcase-grid thead th {
    position: sticky;
    background: #f7f9fc;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid #edf1f6;
    color: #344054;
    font-weight: 650;
    font-size: 11.5px;
    line-height: 1.3;
    padding: 8px 8px;
    vertical-align: top;
    white-space: normal;
}

.showcase-grid thead th[data-col] {
    position: sticky;
}

.showcase-grid thead th.sortable-head[data-col] {
    padding-right: 10px;
}

.column-resize-handle {
    position: absolute;
    z-index: 8;
    top: 0;
    right: -2px;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}

.column-resize-handle:hover,
.column-resize-handle:active {
    background: rgba(23, 118, 132, .25);
}

.showcase-grid thead tr.head-row-1 th {
    z-index: 6;
}

.showcase-grid thead tr.head-row-2 th {
    z-index: 5;
}

.showcase-grid thead tr.filter-row th {
    z-index: 4;
}

.showcase-grid thead th.group-head {
    text-align: center;
    background: #eef3f8;
    border-bottom: 1px solid #dde5ee;
    vertical-align: middle;
}

.showcase-grid thead th.sortable-head {
    cursor: pointer;
}

.sort-link {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    color: inherit;
}

.history-header-heading { display: flex; align-items: flex-start; gap: 5px; min-width: 0; }
.history-header-heading > .sort-link { flex: 1 1 auto; min-width: 0; }

.sort-link:hover {
    color: var(--teal-dark);
}

.sort-ind {
    flex-shrink: 0;
    flex-shrink: 0;
    margin-top: 0;
    font-size: 11px;
    opacity: .28;
    margin-left: 5px;
}

.sort-ind.active {
    opacity: 1;
    color: var(--teal-dark);
}

.admin-filter-heading > .sort-link { flex: 1 1 auto; min-width: 0; align-items: flex-start; }

.showcase-grid thead th.filter-cell {
    padding: 5px;
    background: #fbfcfe;
    vertical-align: top;
}

.col-filter {
    position: relative;
    display: grid;
    grid-template-columns: minmax(106px, 1fr);
    gap: 3px;
    align-items: center;
}

.col-filter .filter-input {
    grid-column: 1;
    min-width: 106px;
    height: 28px;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 6px;
    background: #fff;
}

.col-filter .filter-range {
    grid-column: 2;
    grid-row: 1;
}

.col-filter .op-drop {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
    width: 24px;
}

.col-filter .filter-input:not(.filter-range) { padding-left: 27px; }
.col-filter .filter-range { padding-left: 6px; }

.col-filter:has(.filter-range:not(.d-none)) {
    grid-template-columns: repeat(2, minmax(106px, 1fr));
}

.col-filter:has(.filter-range:not(.d-none)) .filter-input:not(.filter-range) {
    grid-column: 1;
}

.op-btn {
    width: 24px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #98a2b3;
    font-size: 12px;
    transition: all .3s ease-in-out;
}

.op-btn:hover {
    background: #eef6f6;
    color: var(--teal-dark);
}

.op-menu {
    font-size: 12.5px;
    min-width: 180px;
    max-height: min(60vh, 360px);
    overflow-y: auto;
}

.op-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.operator-menu-icon {
    display: inline-flex;
    position: relative;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.operator-menu-icon > i { line-height: 1; }
.operator-menu-symbol { font-size: 15px; font-weight: 600; }
.operator-menu-icon .operator-icon-slash {
    position: absolute;
    inset: 1px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #dc3545;
}

.op-menu .dropdown-item.active .operator-menu-icon { color: var(--teal-dark); }

.op-menu.operator-menu-open {
    display: block;
    margin: 0;
}

.form1-filter-control {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    align-items: center;
    width: 100%;
    min-width: 106px;
}

.form1-filter-control > .op-btn {
    position: absolute;
    z-index: 1;
    top: 1px;
    left: 1px;
    width: 24px;
    height: 26px;
}
.form1-filter-control > .form1-col-filter:not(.form1-filter-range) { grid-column: 1; min-width: 106px; }
.form1-filter-control > .form1-filter-range { grid-column: 1; min-width: 106px; }
.form1-filter-control .form-control { box-sizing: border-box; width: 100%; min-width: 106px; height: 28px; padding: 2px 5px 2px 27px; font-size: 11px; }
.form1-filter-control:has(.form1-filter-range:not(.d-none)) { grid-template-columns: repeat(2, minmax(106px, 1fr)); min-width: 215px; }
.form1-filter-control:has(.form1-filter-range:not(.d-none)) > .form1-filter-range { grid-column: 2; padding-left: 5px; }

.choice-filter-button { text-align: left; }
.choice-filter-menu.operator-menu-open,
.choice-filter-menu.show { display: flex; flex-direction: column; }
.choice-filter-menu { min-width: 190px; max-height: min(60vh, 360px); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); background: #fff; }
.choice-filter-options { min-height: 0; max-height: calc(min(60vh, 360px) - 54px); overflow-y: auto; overscroll-behavior: contain; }
.choice-filter-menu .dropdown-item { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.choice-filter-menu .form-check-input { margin: 0; flex: 0 0 auto; }
.user-header-filter { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: #667085; line-height: 1; }
.user-header-filter > i { display: block; font-size: 12px; line-height: 1; }
.user-header-filter:hover, .user-header-filter.is-filtered { color: #2563eb; }
.admin-filter-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; min-width: 0; }
.admin-filter-heading .choice-filter, .history-header-heading .choice-filter { flex: 0 0 16px; align-self: flex-start; line-height: 1; }
.user-header-filter { align-self: flex-start; margin-top: 0; }
.history-header-heading .sort-ind { display: block; margin-top: 2px; line-height: 1; }
.admin-filter-heading > a { overflow: hidden; text-overflow: ellipsis; }
.user-value-filter-menu {
    width: max-content;
    min-width: 220px;
    max-width: calc(100vw - 32px);
    padding: 4px 0;
    border-radius: 8px;
}
.history-value-chooser {
    width: max-content;
}
.user-value-filter-menu .dropdown-item { min-height: 30px; padding: 5px 10px; gap: 6px; font-size: 13px; }
.user-value-filter-menu .dropdown-item { white-space: nowrap; }
.choice-filter-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 6px; padding: 7px 10px 3px; border-top: 1px solid #eaecf0; margin-top: 4px; background: #fff; }
.user-value-filter-menu .choice-filter-actions .btn { padding: 4px 9px; font-size: 12px; }

.op-menu .dropdown-item.active {
    background: #eef6f6;
    color: var(--teal-dark);
}

.showcase-grid tbody td {
    padding: 7px 8px;
    border-bottom: 1px solid #eef1f5;
    border-right: 1px solid #f4f6f9;
    background: #fff;
    vertical-align: top;
}

.showcase-grid tbody td .cell-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.showcase-grid tbody td[data-col="unique_id"] .cell-text {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
    overflow: visible;
    text-overflow: clip;
    user-select: text;
    vertical-align: top;
}

.showcase-grid tbody td.wide-col {
    min-width: 260px;
    max-width: 360px;
}

.showcase-grid tbody td.wide-col .cell-text {
    max-width: 340px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.showcase-grid .check-col,
.showcase-grid .checkbox-cell {
    position: sticky;
    left: 0;
    width: 38px;
    min-width: 38px;
    text-align: center;
    z-index: 3;
}

.showcase-grid thead .check-col {
    z-index: 8;
    background: #f7f9fc;
}

.showcase-grid tbody .checkbox-cell {
    background: #fff;
}

.showcase-grid .action-col,
.showcase-grid .action-cell {
    position: sticky;
    right: 0;
    width: 40px;
    min-width: 40px;
    text-align: center;
    z-index: 3;
    background: #fff;
    box-shadow: -6px 0 8px -7px rgba(15, 23, 42, .35);
}

.showcase-grid thead .action-col {
    z-index: 8;
    background: #f7f9fc;
}

.showcase-grid tbody tr:hover td {
    background: #f8fbfc;
}

.showcase-grid tbody tr:hover td.action-cell,
.showcase-grid tbody tr:hover td.checkbox-cell {
    background: #f8fbfc;
}

.btn-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #475467;
    font-size: 13px;
}

.btn-icon:hover {
    background: #eef6f6;
    border-color: #bfe4e4;
    color: var(--teal-dark);
}

.col-hidden {
    display: none !important;
}

.dx-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 2px 6px;
    font-size: 12.5px;
    color: #475467;
}

.dx-page-sizes {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dx-page-size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    color: #475467;
    cursor: pointer;
}

.dx-page-size:hover {
    background: #eef6f6;
    color: var(--teal-dark);
}

.dx-page-size.dx-selection {
    background: #e6f4f4;
    color: var(--navy);
    font-weight: 700;
}

.dx-pages {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dx-info {
    color: #475467;
    white-space: nowrap;
}

.dx-page-indexes {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dx-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    border-radius: 6px;
    color: #475467;
}

.dx-page:hover {
    background: #eef6f6;
    color: var(--teal-dark);
}

.dx-page.dx-selection {
    background: #e6f4f4;
    color: var(--navy);
    font-weight: 700;
}

.form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

@media (max-width: 768px) {
    .dx-pager,
    .dx-pages {
        align-items: flex-start;
        flex-direction: column;
    }

    .column-chooser {
        width: min(320px, calc(100vw - 32px));
    }
}

/* ---------- Загрузка данных ---------- */

.import-card {
    padding: 14px 18px 18px;
}

.import-tabs {
    margin-bottom: 18px;
}

.simple-uploader {
    max-width: 560px;
    border: 1px dashed #c8d2df;
    border-radius: 10px;
    background: #fbfcfe;
    padding: 16px 18px;
    transition: border-color .15s, background .15s;
}

.simple-uploader.is-dragover {
    border-color: var(--teal);
    background: #f1fbfb;
}

.simple-uploader-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.simple-uploader-btn {
    border: 1px solid #cfd8e3;
    background: #fff;
    font-size: 13px;
    padding: .42rem .9rem;
}

.simple-uploader-or,
.simple-uploader-drop {
    font-size: 13px;
    color: #667085;
}

.simple-uploader-file {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--navy);
    min-height: 18px;
    word-break: break-all;
}

.simple-uploader-actions {
    margin-top: 14px;
}

.simple-uploader-actions .btn {
    min-width: 120px;
}
