/*
 * Admin design layer, loaded after CoreUI. Shares the storefront's identity:
 * ink-navy chrome (#0B1324), one "volt" blue for actions (#2450F0), Sora for
 * headings, Onest for UI text. Works in CoreUI's light and dark themes.
 * Cache-busted with ?v= in layouts/admin.blade.php.
 */

/* ───────────────────────── Tokens ───────────────────────── */
:root,
[data-coreui-theme="light"] {
    --adm-ink: #0b1324;
    --adm-ink-2: #18223a;
    --adm-brand: #2450f0;
    --adm-brand-strong: #1a3cc4;
    --adm-brand-soft: #eaf0ff;
    --adm-bg: #f4f6fa;
    --adm-card: #ffffff;
    --adm-line: #e4e8ef;
    --adm-line-strong: #cdd4df;
    --adm-text: #2a3345;
    --adm-muted: #5b6578;
    --adm-hover: #f6f8fb;
    --adm-selected: #eef3ff;
    --adm-shadow-sm: 0 1px 2px rgba(11, 19, 36, 0.05), 0 1px 3px rgba(11, 19, 36, 0.04);
    --adm-shadow: 0 2px 4px rgba(11, 19, 36, 0.04), 0 12px 28px -10px rgba(11, 19, 36, 0.16);
    --adm-shadow-lg: 0 6px 12px -4px rgba(11, 19, 36, 0.1), 0 28px 56px -18px rgba(11, 19, 36, 0.35);
    --adm-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --adm-display: "Sora", system-ui, sans-serif;
    --adm-ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

    --cui-primary: var(--adm-brand);
    --cui-primary-rgb: 36, 80, 240;
    --cui-link-color: var(--adm-brand);
    --cui-link-hover-color: var(--adm-brand-strong);
    --cui-link-color-rgb: 36, 80, 240;
    --cui-body-bg: var(--adm-bg);
    --cui-body-color: var(--adm-text);
    --cui-emphasis-color: var(--adm-ink);
    --cui-secondary-color: var(--adm-muted);
    --cui-tertiary-bg: #f7f9fc;
    --cui-border-color: var(--adm-line);
    --cui-border-radius: 10px;
    --cui-border-radius-sm: 8px;
    --cui-border-radius-lg: 14px;
    --cui-body-font-family: var(--adm-ui);
    --cui-font-sans-serif: var(--adm-ui);
    --cui-heading-color: var(--adm-ink);
    --cui-card-bg: var(--adm-card);
    --cui-focus-ring-color: rgba(36, 80, 240, 0.22);
}

[data-coreui-theme="dark"] {
    --adm-ink: #070c18;
    --adm-ink-2: #121a2c;
    --adm-brand: #5b7fff;
    --adm-brand-strong: #7d99ff;
    --adm-brand-soft: rgba(91, 127, 255, 0.16);
    --adm-bg: #0e1424;
    --adm-card: #151d30;
    --adm-line: #263049;
    --adm-line-strong: #34405e;
    --adm-text: #d5dbe8;
    --adm-muted: #94a0b8;
    --adm-hover: #1a2338;
    --adm-selected: rgba(91, 127, 255, 0.14);
    --adm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --adm-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.55);
    --adm-shadow-lg: 0 28px 56px -18px rgba(0, 0, 0, 0.7);

    --cui-primary: var(--adm-brand);
    --cui-primary-rgb: 91, 127, 255;
    --cui-link-color: var(--adm-brand);
    --cui-link-hover-color: var(--adm-brand-strong);
    --cui-link-color-rgb: 91, 127, 255;
    --cui-body-bg: var(--adm-bg);
    --cui-body-color: var(--adm-text);
    --cui-emphasis-color: #ffffff;
    --cui-secondary-color: var(--adm-muted);
    --cui-tertiary-bg: #121a2c;
    --cui-border-color: var(--adm-line);
    --cui-heading-color: #f2f5fb;
    --cui-card-bg: var(--adm-card);
}

/* ───────────────────────── Base ───────────────────────── */
body {
    background: var(--adm-bg);
    color: var(--adm-text);
    font-family: var(--adm-ui);
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5, .modal-title {
    font-family: var(--adm-display);
    color: var(--cui-heading-color);
    letter-spacing: -0.02em;
}

::selection {
    background: var(--adm-brand);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--adm-brand);
    outline-offset: 2px;
}

.text-muted,
.text-body-secondary {
    color: var(--adm-muted) !important;
}

code {
    color: var(--adm-brand);
}

/* ───────────────────────── Sidebar ───────────────────────── */
.sidebar.sidebar-dark {
    --cui-sidebar-bg: var(--adm-ink);
    --cui-sidebar-nav-link-color: rgba(255, 255, 255, 0.68);
    --cui-sidebar-nav-link-icon-color: rgba(255, 255, 255, 0.5);
    --cui-sidebar-nav-link-hover-color: #fff;
    --cui-sidebar-nav-link-hover-bg: rgba(255, 255, 255, 0.06);
    --cui-sidebar-nav-link-hover-icon-color: #fff;
    --cui-sidebar-nav-link-active-color: #fff;
    --cui-sidebar-nav-link-active-bg: var(--adm-brand);
    --cui-sidebar-nav-link-active-icon-color: #fff;
    --cui-sidebar-nav-group-bg: transparent;
    --cui-sidebar-nav-title-color: rgba(255, 255, 255, 0.4);
    border-right: 0 !important;
}

.sidebar .sidebar-header {
    padding: 14px 16px;
    border-bottom-color: rgba(255, 255, 255, 0.07) !important;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0 !important;
}

.admin-brand-mark {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--adm-brand);
    color: #fff;
    font-family: var(--adm-display);
    font-size: 17px;
    font-weight: 700;
}

.admin-brand-mark--img {
    background: #fff;
    overflow: hidden;
    padding: 4px;
}

.admin-brand-mark--img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.admin-brand-text strong {
    color: #fff;
    font-family: var(--adm-display);
    font-size: 15px;
}

.admin-brand-text small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.sidebar-narrow-unfoldable:not(:hover) .admin-brand-text {
    display: none;
}

.sidebar-nav {
    padding: 10px 10px 16px;
}

.sidebar-nav .nav-link {
    margin: 1px 0;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav .nav-link.active {
    font-weight: 600;
    box-shadow: 0 6px 16px -8px rgba(36, 80, 240, 0.8);
}

.sidebar-nav .nav-group-items .nav-link {
    font-size: 13.5px;
}

/* CoreUI scopes the nav colours on .sidebar-nav itself, so the active state is set directly. */
.sidebar-dark .sidebar-nav .nav-link.active {
    background: var(--adm-brand);
    color: #fff;
}

.sidebar-dark .sidebar-nav .nav-link.active .nav-icon {
    color: #fff;
}

.sidebar-dark .sidebar-nav .nav-link:not(.active):hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-nav .nav-group.show > .nav-group-toggle {
    color: #fff;
}

.sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.07) !important;
}

/* ───────────────────────── Header ───────────────────────── */
.header {
    --cui-header-bg: color-mix(in srgb, var(--adm-card) 88%, transparent);
    border-bottom: 1px solid var(--adm-line) !important;
    backdrop-filter: saturate(1.4) blur(10px);
    box-shadow: none;
}

.header .container-fluid + .container-fluid {
    border-top: 1px solid var(--adm-line);
}

.header .nav-link {
    color: var(--adm-muted);
    border-radius: 10px;
}

.header .nav-link:hover {
    color: var(--cui-heading-color);
}

.breadcrumb {
    font-size: 13px;
}

.breadcrumb-item a {
    color: var(--adm-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--adm-brand);
}

.breadcrumb-item.active {
    color: var(--cui-heading-color);
    font-weight: 600;
}

.notif-badge {
    background: #e0480f !important;
}

/* ───────────────────────── Page head ───────────────────────── */
.admin-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    flex-wrap: wrap;
    margin: 4px 0 20px;
}

.admin-page-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.admin-page-sub {
    max-width: 90ch;
    margin: 6px 0 0;
    color: var(--adm-muted);
    font-size: 14px;
}

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

.footer {
    --cui-footer-bg: transparent;
    border-top: 1px solid var(--adm-line);
    color: var(--adm-muted);
    font-size: 13px;
}

/* ───────────────────────── Cards ───────────────────────── */
.card {
    --cui-card-border-color: var(--adm-line);
    --cui-card-border-radius: 14px;
    --cui-card-inner-border-radius: 13px;
    --cui-card-cap-bg: transparent;
    box-shadow: var(--adm-shadow-sm);
    margin-bottom: 1.25rem;
}

.card-header {
    padding: 14px 18px;
    border-bottom-color: var(--adm-line);
    font-weight: 600;
}

.card-header h5,
.card-header .card-title {
    font-size: 16px;
}

.card-body {
    padding: 18px;
}

.card-footer {
    border-top-color: var(--adm-line);
    background: transparent;
}

.stat-card {
    border-left: 0;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--adm-brand);
}

/* ───────────────────────── Buttons ───────────────────────── */
.btn {
    --cui-btn-border-radius: 10px;
    --cui-btn-font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.25s var(--adm-ease), transform 0.2s;
}

.btn-sm {
    --cui-btn-border-radius: 9px;
    font-size: 13px;
    padding: 6px 12px;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary {
    --cui-btn-bg: var(--adm-brand);
    --cui-btn-border-color: var(--adm-brand);
    --cui-btn-hover-bg: var(--adm-brand-strong);
    --cui-btn-hover-border-color: var(--adm-brand-strong);
    --cui-btn-active-bg: var(--adm-brand-strong);
    --cui-btn-active-border-color: var(--adm-brand-strong);
    --cui-btn-disabled-bg: var(--adm-brand);
    --cui-btn-disabled-border-color: var(--adm-brand);
    box-shadow: 0 6px 14px -8px rgba(36, 80, 240, 0.75);
}

.btn-outline-secondary {
    --cui-btn-color: var(--cui-heading-color);
    --cui-btn-border-color: var(--adm-line-strong);
    --cui-btn-hover-bg: var(--adm-hover);
    --cui-btn-hover-color: var(--cui-heading-color);
    --cui-btn-hover-border-color: var(--adm-muted);
    --cui-btn-active-bg: var(--adm-hover);
    --cui-btn-active-color: var(--cui-heading-color);
    background: var(--adm-card);
}

[data-coreui-theme="dark"] .btn-outline-secondary {
    --cui-btn-color: #e6eaf3;
    --cui-btn-border-color: var(--adm-line-strong);
    --cui-btn-hover-bg: var(--adm-hover);
    --cui-btn-hover-color: #fff;
    --cui-btn-hover-border-color: #4a5778;
    --cui-btn-active-color: #fff;
}

.btn-outline-primary {
    --cui-btn-color: var(--adm-brand);
    --cui-btn-border-color: color-mix(in srgb, var(--adm-brand) 40%, transparent);
    --cui-btn-hover-bg: var(--adm-brand);
    --cui-btn-hover-border-color: var(--adm-brand);
}

.btn-light {
    --cui-btn-bg: var(--adm-hover);
    --cui-btn-border-color: var(--adm-line);
    --cui-btn-color: var(--cui-heading-color);
    --cui-btn-hover-bg: var(--adm-line);
    --cui-btn-hover-border-color: var(--adm-line-strong);
    --cui-btn-hover-color: var(--cui-heading-color);
}

.table-actions .btn {
    color: var(--adm-muted);
}

.table-actions .btn:hover {
    background: var(--adm-hover);
    border-color: var(--adm-line) !important;
    color: var(--cui-heading-color);
}

.table-actions .btn.text-danger:hover {
    background: rgba(196, 43, 43, 0.08);
    color: #c42b2b !important;
}

/* ───────────────────────── Forms ───────────────────────── */
.form-control,
.form-select {
    border-color: var(--adm-line-strong);
    border-radius: 10px;
    min-height: 40px;
    font-size: 14px;
    background-color: var(--adm-card);
    transition: border-color 0.2s, box-shadow 0.25s var(--adm-ease);
}

.form-control-sm,
.form-select-sm {
    min-height: 36px;
    border-radius: 9px;
    font-size: 13.5px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--adm-brand);
    box-shadow: 0 0 0 4px rgba(36, 80, 240, 0.14);
}

.form-label {
    color: var(--cui-heading-color);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-check-input {
    border-color: var(--adm-line-strong);
    cursor: pointer;
}

.form-check-input:checked,
.form-check-input:indeterminate {
    background-color: var(--adm-brand);
    border-color: var(--adm-brand);
}

.form-switch .form-check-input {
    width: 2.25em;
}

.input-group-text {
    border-color: var(--adm-line-strong);
    background: var(--adm-hover);
    border-radius: 10px;
}

/* ───────────────────────── Badges (soft tints) ───────────────────────── */
.badge {
    padding: 0.42em 0.7em;
    border-radius: 999px;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.01em;
    text-transform: capitalize;
}

.badge.text-bg-success { background: #e6f5ec !important; color: #0e7c47 !important; }
.badge.text-bg-danger { background: #fdeeee !important; color: #b42323 !important; }
.badge.text-bg-warning { background: #fff4e0 !important; color: #9a4d00 !important; }
.badge.text-bg-info { background: #e6f4fb !important; color: #0b6a94 !important; }
.badge.text-bg-primary { background: var(--adm-brand-soft) !important; color: var(--adm-brand) !important; }
.badge.text-bg-secondary { background: #eef0f4 !important; color: #4a5468 !important; }
.badge.text-bg-dark { background: var(--adm-ink) !important; color: #fff !important; }
.badge.text-bg-light { background: var(--adm-hover) !important; color: var(--adm-text) !important; }

[data-coreui-theme="dark"] .badge.text-bg-success { background: rgba(14, 124, 71, 0.22) !important; color: #6fe0a6 !important; }
[data-coreui-theme="dark"] .badge.text-bg-danger { background: rgba(196, 43, 43, 0.22) !important; color: #ff9b9b !important; }
[data-coreui-theme="dark"] .badge.text-bg-warning { background: rgba(224, 138, 0, 0.2) !important; color: #ffc46b !important; }
[data-coreui-theme="dark"] .badge.text-bg-info { background: rgba(11, 106, 148, 0.25) !important; color: #7fd2f5 !important; }
[data-coreui-theme="dark"] .badge.text-bg-secondary { background: rgba(255, 255, 255, 0.08) !important; color: #c3cad8 !important; }

/* ───────────────────────── Alerts ───────────────────────── */
.alert {
    border-radius: 12px;
    border: 0;
    font-size: 14px;
}

.alert-danger { background: #fdeeee; color: #8e1c1c; }
.alert-success { background: #e6f5ec; color: #0a5c35; }
.alert-light { background: var(--adm-card); border: 1px dashed var(--adm-line-strong) !important; }

/* ───────────────────────── Lists & tables ───────────────────────── */
.list-toolbar {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--adm-line);
    border-radius: 14px;
    background: var(--adm-card);
    box-shadow: var(--adm-shadow-sm);
    margin-bottom: 14px !important;
}

.list-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 320px;
    min-width: 200px;
    margin: 0;
}

.list-search i {
    position: absolute;
    left: 12px;
    color: var(--adm-muted);
    font-size: 13px;
    pointer-events: none;
}

.list-search input {
    padding-left: 34px;
}

.table {
    --cui-table-bg: transparent;
    --cui-table-striped-bg: transparent;
    --cui-table-hover-bg: var(--adm-hover);
    --cui-table-border-color: var(--adm-line);
    margin-bottom: 0;
    font-size: 14px;
}

.table > :not(caption) > * > * {
    padding: 12px 14px;
}

.table thead th {
    background: var(--cui-tertiary-bg);
    border-bottom-width: 1px;
    color: var(--adm-muted);
    font-size: 11.5px;
    letter-spacing: 0.04em;
}

.table thead th:first-child { border-top-left-radius: 13px; }
.table thead th:last-child { border-top-right-radius: 13px; }

.table tbody tr {
    transition: background-color 0.15s;
}

/* Rows are separated by lines; zebra striping is turned off (CoreUI paints it as an inset shadow). */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    box-shadow: none !important;
    --cui-table-color-type: inherit;
}

.table a:not(.btn),
.card a:not(.btn):not(.dropdown-item) {
    color: var(--adm-brand);
    font-weight: 600;
    text-decoration: none;
}

.table a:not(.btn):hover,
.card a:not(.btn):not(.dropdown-item):hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.table a.text-body {
    color: var(--cui-heading-color) !important;
}

.table tbody tr:hover > * {
    background: var(--adm-hover);
}

.table tbody tr:last-child > * {
    border-bottom: 0;
}

.table tbody tr.is-selected > *,
.list-group-item.is-selected,
.card.is-selected {
    background: var(--adm-selected) !important;
}

.card.is-selected {
    border-color: var(--adm-brand);
}

.col-check {
    width: 44px;
    padding-right: 4px !important;
}

.col-check .form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin: 0;
}

.img-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.img-thumb-empty {
    display: inline-grid;
    place-items: center;
    background: var(--adm-hover);
    color: var(--adm-muted);
}

.avatar-initials {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--adm-brand-soft);
    color: var(--adm-brand);
    font-size: 12.5px;
    font-weight: 700;
}

.empty-row {
    padding: 48px 16px !important;
    text-align: center;
}

.empty-row i {
    display: block;
    margin-bottom: 8px;
    color: var(--adm-muted);
    font-size: 28px;
}

.empty-row strong {
    display: block;
    color: var(--cui-heading-color);
    font-size: 15px;
}

.empty-row span {
    color: var(--adm-muted);
    font-size: 13.5px;
}

.list-group-item {
    border-color: var(--adm-line);
    background: var(--adm-card);
    transition: background-color 0.15s;
}

.category-tree .list-group-item {
    border-radius: 10px !important;
    margin-bottom: 6px;
    border-width: 1px !important;
}

/* DataTables */
.dataTables_wrapper .dataTables_processing {
    border: 0;
    border-radius: 12px;
    background: var(--adm-card);
    box-shadow: var(--adm-shadow);
    color: var(--cui-heading-color);
}

.pagination {
    --cui-pagination-border-radius: 9px;
    --cui-pagination-border-color: var(--adm-line);
    --cui-pagination-active-bg: var(--adm-ink);
    --cui-pagination-active-border-color: var(--adm-ink);
    --cui-pagination-color: var(--cui-heading-color);
    --cui-pagination-hover-bg: var(--adm-hover);
    gap: 4px;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    border-radius: 9px !important;
    min-width: 34px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

[data-coreui-theme="dark"] .pagination {
    --cui-pagination-active-bg: var(--adm-brand);
    --cui-pagination-active-border-color: var(--adm-brand);
}

/* ───────────────────────── Dropdowns & modals ───────────────────────── */
.dropdown-menu {
    --cui-dropdown-border-color: var(--adm-line);
    --cui-dropdown-border-radius: 12px;
    --cui-dropdown-link-hover-bg: var(--adm-hover);
    --cui-dropdown-link-active-bg: var(--adm-brand);
    padding: 6px;
    box-shadow: var(--adm-shadow-lg);
    animation: adm-pop 0.2s var(--adm-ease);
}

.dropdown-item {
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 14px;
}

.dropdown-item i {
    width: 18px;
    margin-right: 6px;
    color: var(--adm-muted);
}

.dropdown-item.text-danger i {
    color: inherit;
}

.dropdown-header {
    padding: 8px 10px 4px;
    color: var(--adm-muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@keyframes adm-pop {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
}

.modal {
    --cui-modal-border-radius: 18px;
    --cui-modal-border-color: transparent;
    --cui-modal-header-border-color: var(--adm-line);
    --cui-modal-footer-border-color: var(--adm-line);
}

.modal-content {
    box-shadow: var(--adm-shadow-lg);
}

.modal-header {
    align-items: flex-start;
    padding: 18px 22px;
}

.modal-body {
    padding: 20px 22px;
}

.modal-backdrop.show {
    opacity: 0.55;
    backdrop-filter: blur(2px);
}

.admin-confirm-dialog .modal-body {
    padding: 26px 24px 8px;
    text-align: center;
}

.admin-confirm-icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #fdeeee;
    color: #c42b2b;
    font-size: 22px;
}

.admin-confirm-dialog .modal-title {
    margin-bottom: 6px;
    font-size: 18px;
}

.admin-confirm-dialog .modal-footer {
    border-top: 0;
    justify-content: center;
    padding: 14px 24px 22px;
}

.admin-confirm-dialog .modal-footer .btn {
    min-width: 110px;
}

/* ───────────────────────── Export / import tools ───────────────────────── */
.data-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-tools-menu {
    min-width: 300px;
    padding: 8px;
}

.data-tools-format {
    padding: 8px 10px 10px;
    border-radius: 10px;
}

.data-tools-format + .data-tools-format {
    border-top: 1px solid var(--adm-line);
}

.data-tools-format-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--cui-heading-color);
    font-size: 13.5px;
    font-weight: 600;
}

.data-tools-format-label .bi-file-earmark-excel { color: #107c41; }
.data-tools-format-label .bi-filetype-csv { color: var(--adm-brand); }

.data-tools-scopes {
    display: flex;
    gap: 6px;
}

.data-tools-scopes .btn {
    flex: 1;
    padding: 5px 8px;
    font-size: 12.5px;
    box-shadow: none;
}

.data-tools-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 2px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--adm-brand);
    color: #fff;
    font-size: 11px;
}

.import-steps {
    margin: 0;
    padding: 0;
    list-style: none;
}

.import-steps > li {
    position: relative;
    padding: 0 0 22px 44px;
}

.import-steps > li:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 6px;
    left: 15px;
    width: 2px;
    background: var(--adm-line);
}

.import-step-head {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.import-step-no {
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--adm-ink);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

[data-coreui-theme="dark"] .import-step-no {
    background: var(--adm-brand);
}

.import-step-head strong {
    display: block;
    color: var(--cui-heading-color);
    font-size: 15px;
}

.import-step-head span {
    color: var(--adm-muted);
    font-size: 13.5px;
}

.import-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.import-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 26px 16px;
    border: 2px dashed var(--adm-line-strong);
    border-radius: 14px;
    background: var(--cui-tertiary-bg);
    color: var(--adm-muted);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.import-drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.import-drop i {
    color: var(--adm-brand);
    font-size: 30px;
    transition: transform 0.3s var(--adm-ease);
}

.import-drop:hover,
.import-drop.is-over {
    border-color: var(--adm-brand);
    background: var(--adm-brand-soft);
}

.import-drop.is-over i {
    transform: translateY(-4px) scale(1.08);
}

.import-drop.has-file {
    border-style: solid;
    border-color: #0e7c47;
    background: #e6f5ec;
    color: #0a5c35;
}

.import-drop.has-file i {
    color: #0e7c47;
}

[data-coreui-theme="dark"] .import-drop.has-file {
    background: rgba(14, 124, 71, 0.16);
    color: #8ee6b8;
}

.import-drop-text strong {
    color: inherit;
}

.import-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 767px) {
    .import-modes {
        grid-template-columns: 1fr;
    }
}

.import-mode {
    position: relative;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1.5px solid var(--adm-line);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.import-mode input {
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--adm-brand);
}

.import-mode span {
    display: flex;
    flex-direction: column;
    font-size: 13.5px;
}

.import-mode strong {
    color: var(--cui-heading-color);
}

.import-mode small {
    color: var(--adm-muted);
}

.import-mode:has(input:checked) {
    border-color: var(--adm-brand);
    background: var(--adm-selected);
}

.import-guide {
    margin-top: 4px;
    border: 1px solid var(--adm-line);
    border-radius: 12px;
    overflow: hidden;
}

.import-guide summary {
    padding: 12px 14px;
    color: var(--cui-heading-color);
    font-weight: 600;
    cursor: pointer;
    list-style-position: inside;
}

.import-guide summary i {
    margin-right: 6px;
    color: var(--adm-brand);
}

.import-guide[open] summary {
    border-bottom: 1px solid var(--adm-line);
}

.import-guide .table td,
.import-guide .table th {
    padding: 9px 14px;
    font-size: 13px;
}

.import-guide .table thead th:first-child,
.import-guide .table thead th:last-child {
    border-radius: 0;
}

.import-result {
    margin-bottom: 22px;
    padding: 16px;
    border-radius: 14px;
    background: #e6f5ec;
    animation: adm-pop 0.35s var(--adm-ease);
}

.import-result.has-errors {
    background: #fff4e0;
}

[data-coreui-theme="dark"] .import-result {
    background: rgba(14, 124, 71, 0.16);
}

[data-coreui-theme="dark"] .import-result.has-errors {
    background: rgba(224, 138, 0, 0.14);
}

.import-result-head {
    display: flex;
    gap: 12px;
    align-items: center;
}

.import-result-head > i {
    font-size: 24px;
    color: #0e7c47;
}

.import-result.has-errors .import-result-head > i {
    color: #b35c00;
}

.import-result-head strong {
    display: block;
    color: var(--cui-heading-color);
    font-size: 15px;
}

.import-result-head span {
    color: var(--adm-muted);
    font-size: 13px;
}

.import-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.import-stats > div {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--adm-card);
    color: var(--adm-muted);
    font-size: 12.5px;
}

.import-stats span {
    display: block;
    color: var(--cui-heading-color);
    font-family: var(--adm-display);
    font-size: 20px;
    font-weight: 700;
}

.import-stats .is-bad span {
    color: #c42b2b;
}

@media (max-width: 575px) {
    .import-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.import-errors {
    margin-top: 14px;
    border-radius: 10px;
    background: var(--adm-card);
    overflow: hidden;
}

.import-errors-title {
    padding: 10px 12px;
    border-bottom: 1px solid var(--adm-line);
    color: var(--cui-heading-color);
    font-size: 13px;
    font-weight: 600;
}

.import-errors ul {
    max-height: 220px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.import-errors li {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--adm-line);
    font-size: 13px;
}

.import-errors li:last-child {
    border-bottom: 0;
}

.import-errors-row {
    flex-shrink: 0;
    min-width: 56px;
    color: #c42b2b;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.import-warning,
.import-next {
    margin: 10px 0 0;
    font-size: 13px;
}

.import-next {
    color: #0a5c35;
    font-weight: 600;
}

[data-coreui-theme="dark"] .import-next {
    color: #8ee6b8;
}

/* ───────────────────────── Bulk action bar ───────────────────────── */
.bulk-bar {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 24px);
    padding: 8px 8px 8px 16px;
    border-radius: 16px;
    background: var(--adm-ink);
    color: #fff;
    box-shadow: var(--adm-shadow-lg);
    transform: translate(-50%, 140%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s var(--adm-ease), opacity 0.3s;
}

[data-coreui-theme="dark"] .bulk-bar {
    background: #202a44;
    box-shadow: 0 0 0 1px var(--adm-line-strong), var(--adm-shadow-lg);
}

.bulk-bar.is-open {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.bulk-bar.is-busy {
    opacity: 0.75;
    pointer-events: none;
}

.bulk-bar-count {
    white-space: nowrap;
    font-size: 14px;
}

.bulk-bar-count strong {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    margin-right: 4px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--adm-brand);
    font-variant-numeric: tabular-nums;
}

.bulk-bar-all {
    padding: 0;
    border: 0;
    background: none;
    color: #9fb4ff;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.bulk-bar-all:hover {
    color: #fff;
}

.bulk-bar-note {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    white-space: nowrap;
}

.bulk-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.bulk-bar .btn-light {
    --cui-btn-bg: rgba(255, 255, 255, 0.1);
    --cui-btn-border-color: transparent;
    --cui-btn-color: #fff;
    --cui-btn-hover-bg: rgba(255, 255, 255, 0.2);
    --cui-btn-hover-border-color: transparent;
    --cui-btn-hover-color: #fff;
    --cui-btn-active-bg: rgba(255, 255, 255, 0.24);
    --cui-btn-active-color: #fff;
    white-space: nowrap;
}

.bulk-bar .dropdown-menu {
    max-height: 60vh;
    overflow-y: auto;
}

.bulk-bar-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
}

.bulk-bar-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

@media (max-width: 767px) {
    .bulk-bar {
        flex-wrap: wrap;
        bottom: 12px;
        width: calc(100vw - 24px);
        border-radius: 14px;
    }

    .bulk-bar-actions {
        order: 3;
        width: 100%;
        padding: 8px 0 0;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        overflow-x: auto;
    }

    .bulk-bar-close {
        margin-left: auto;
    }
}

/* ───────────────────────── Toasts ───────────────────────── */
.admin-toasts {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(400px, calc(100vw - 32px));
    pointer-events: none;
}

.admin-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 16px;
    border-radius: 14px;
    background: var(--adm-card);
    color: var(--cui-heading-color);
    box-shadow: 0 0 0 1px var(--adm-line), var(--adm-shadow-lg);
    font-size: 14px;
    pointer-events: auto;
    overflow: hidden;
    animation: adm-toast-in 0.45s var(--adm-ease);
}

.admin-toast.is-leaving {
    animation: adm-toast-out 0.25s ease forwards;
}

.admin-toast > i {
    font-size: 20px;
    line-height: 1.1;
}

.admin-toast.is-success > i { color: #0e7c47; }
.admin-toast.is-error > i { color: #c42b2b; }
.admin-toast.is-info > i { color: var(--adm-brand); }

.admin-toast > span:not(.admin-toast-timer) {
    flex: 1;
    padding-top: 1px;
}

.admin-toast button {
    padding: 0 2px;
    border: 0;
    background: none;
    color: var(--adm-muted);
}

.admin-toast-timer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.25;
    transform-origin: left;
    animation: adm-toast-timer 5s linear forwards;
}

.admin-toast.is-success .admin-toast-timer { color: #0e7c47; }
.admin-toast.is-error .admin-toast-timer { color: #c42b2b; animation-duration: 8s; }
.admin-toast.is-info .admin-toast-timer { color: var(--adm-brand); }

@keyframes adm-toast-in {
    from {
        opacity: 0;
        transform: translateX(24px) scale(0.97);
    }
}

@keyframes adm-toast-out {
    to {
        opacity: 0;
        transform: translateX(24px);
    }
}

@keyframes adm-toast-timer {
    to {
        transform: scaleX(0);
    }
}

/* ───────────────────────── Motion preferences ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ═════════════════════════ Shell (v2) ═════════════════════════ */
.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 3000;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--adm-brand);
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
    color: #fff;
}

kbd {
    padding: 2px 6px;
    border: 1px solid var(--adm-line-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--adm-card);
    color: var(--adm-muted);
    font-family: var(--adm-ui);
    font-size: 11px;
    font-weight: 600;
    box-shadow: none;
}

/* Sidebar */
.sidebar {
    --cui-sidebar-width: 15.5rem;
}

.sidebar .sidebar-header {
    min-height: 64px;
}

.admin-nav {
    flex: 1;
    padding: 6px 12px 16px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.admin-nav-section + .admin-nav-section {
    margin-top: 14px;
}

.admin-nav-title {
    padding: 8px 10px 6px;
    color: rgba(255, 255, 255, 0.38);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1px 0;
    padding: 8px 10px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.admin-nav-link > i {
    width: 18px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    text-align: center;
    transition: color 0.15s;
}

.admin-nav-link span:not(.admin-nav-badge) {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.admin-nav-link:hover > i {
    color: #fff;
}

.admin-nav-link.is-active {
    background: var(--adm-brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px -8px rgba(36, 80, 240, 0.9);
}

.admin-nav-link.is-active > i {
    color: #fff;
}

.admin-nav-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e0480f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.admin-nav-badge.is-warning {
    background: rgba(255, 196, 107, 0.18);
    color: #ffc46b;
}

.admin-nav-link.is-active .admin-nav-badge {
    background: #fff;
    color: var(--adm-brand);
}

.admin-sidebar-foot {
    padding: 10px 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Header */
.admin-header {
    min-height: 64px;
    margin-bottom: 0 !important;
}

.admin-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 24px;
}

.admin-header .header-toggler {
    padding: 4px 6px;
    color: var(--cui-heading-color);
    font-size: 22px;
}

.admin-search-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(440px, 100%);
    height: 40px;
    padding: 0 8px 0 14px;
    border: 1px solid var(--adm-line);
    border-radius: 10px;
    background: var(--cui-tertiary-bg);
    color: var(--adm-muted);
    font-size: 14px;
    text-align: left;
    transition: border-color 0.2s, background-color 0.2s;
}

.admin-search-trigger span {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.admin-search-trigger:hover {
    border-color: var(--adm-line-strong);
    background: var(--adm-card);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.admin-new-btn {
    height: 38px;
    padding: 0 14px;
}

.admin-icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--adm-muted);
    font-size: 18px;
    transition: background-color 0.15s, color 0.15s;
}

.admin-icon-btn:hover,
.admin-icon-btn[aria-expanded="true"] {
    background: var(--adm-hover);
    color: var(--cui-heading-color);
}

.admin-dot-badge {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--adm-card);
    border-radius: 999px;
    background: #e0480f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

.admin-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 4px;
    padding: 4px 8px 4px 4px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--cui-heading-color);
    text-align: left;
}

.admin-user-btn:hover,
.admin-user-btn[aria-expanded="true"] {
    background: var(--adm-hover);
}

.admin-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--adm-ink);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
}

[data-coreui-theme="dark"] .admin-avatar {
    background: var(--adm-brand);
}

.admin-user-text {
    flex-direction: column;
    line-height: 1.2;
}

.admin-user-text strong {
    font-size: 13.5px;
}

.admin-user-text small {
    color: var(--adm-muted);
    font-size: 12px;
}

.admin-user-btn .bi-chevron-down {
    color: var(--adm-muted);
    font-size: 11px;
}

.admin-user-menu {
    min-width: 250px;
}

.admin-user-menu-head {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 4px;
}

.admin-user-menu-head small {
    color: var(--adm-muted);
}

.admin-theme-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 2px 6px 6px;
}

.admin-theme-switch button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: 1px solid var(--adm-line);
    border-radius: 9px;
    background: transparent;
    color: var(--adm-muted);
    font-size: 12px;
    font-weight: 600;
}

.admin-theme-switch button i {
    font-size: 16px;
}

.admin-theme-switch button:hover {
    color: var(--cui-heading-color);
}

.admin-theme-switch button.active {
    border-color: var(--adm-brand);
    background: var(--adm-selected);
    color: var(--adm-brand);
}

/* Notifications dropdown */
.notif-dropdown {
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: none;
    padding: 0;
    overflow: hidden;
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--adm-line);
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-list form {
    margin: 0;
}

.notif-item {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--adm-line);
    background: transparent;
    color: var(--cui-heading-color);
    text-align: left;
}

.notif-item:hover {
    background: var(--adm-hover);
}

.notif-item.is-read {
    opacity: 0.65;
}

.notif-icon {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--adm-hover);
}

.notif-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 13px;
}

.notif-text strong {
    font-size: 13.5px;
}

.notif-text span,
.notif-text small {
    color: var(--adm-muted);
}

.notif-empty {
    margin: 0;
    padding: 28px 16px;
    color: var(--adm-muted);
    text-align: center;
}

.notif-all {
    display: block;
    padding: 10px;
    color: var(--adm-brand);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.notif-all:hover {
    background: var(--adm-hover);
}

/* Main area */
.admin-main {
    padding: 20px 0 40px;
}

.admin-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 28px;
}

@media (max-width: 767px) {
    .admin-container {
        padding: 0 14px;
    }

    .admin-header-row {
        padding: 0 12px;
        gap: 6px;
    }

    .admin-search-trigger {
        width: 40px;
        padding: 0;
        justify-content: center;
        background: transparent;
        border-color: transparent;
    }

    .admin-search-trigger span,
    .admin-search-trigger kbd {
        display: none;
    }
}

.admin-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.admin-crumbs li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--adm-muted);
}

.admin-crumbs li + li::before {
    content: "\F285";
    font-family: "bootstrap-icons";
    font-size: 10px;
    opacity: 0.6;
}

.admin-crumbs a {
    color: var(--adm-muted);
    text-decoration: none;
}

.admin-crumbs a:hover {
    color: var(--adm-brand);
}

.admin-crumbs [aria-current] {
    color: var(--cui-heading-color);
    font-weight: 600;
}

.admin-page-head {
    margin: 0 0 22px;
}

.admin-page-title {
    font-size: 28px;
}

.admin-error-summary ul {
    margin-top: 6px;
    padding-left: 22px;
}

.admin-footer {
    padding: 14px 28px;
    font-size: 12.5px;
}

/* Sticky form actions */
.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 24px -18px -18px;
    padding: 14px 18px;
    border-top: 1px solid var(--adm-line);
    border-radius: 0 0 14px 14px;
    background: color-mix(in srgb, var(--adm-card) 92%, transparent);
    backdrop-filter: blur(8px);
    box-shadow: 0 -10px 24px -18px rgba(11, 19, 36, 0.35);
}

.card-body > form > .form-actions:last-child,
form > .form-actions:last-child {
    margin-bottom: -18px;
}

form:not(.card-body form) > .form-actions {
    margin: 24px 0 0;
    border: 1px solid var(--adm-line);
    border-radius: 14px;
}

.form-actions-left {
    display: flex;
    gap: 4px;
}

.form-actions-right {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.form-actions-dirty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b35c00;
    font-size: 13px;
    font-weight: 600;
}

.form-actions-dirty i {
    font-size: 7px;
}

@media (max-width: 575px) {
    .form-actions-right {
        width: 100%;
    }

    .form-actions-right .btn {
        flex: 1;
    }
}

/* Quick search dialog */
.admin-search-modal .modal-dialog {
    max-width: 640px;
    margin-top: 10vh;
}

.admin-search-modal .modal-content {
    overflow: hidden;
}

.admin-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--adm-line);
}

.admin-search-box > i {
    color: var(--adm-brand);
    font-size: 18px;
}

.admin-search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--cui-heading-color);
    font-size: 16px;
}

.admin-search-results {
    max-height: 56vh;
    padding: 6px;
    overflow-y: auto;
    transition: opacity 0.15s;
}

.admin-search-results.is-loading {
    opacity: 0.6;
}

.admin-search-label {
    padding: 10px 12px 4px;
    color: var(--adm-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--cui-heading-color);
    text-decoration: none;
}

.admin-search-item > i:first-child {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--adm-hover);
    color: var(--adm-muted);
}

.admin-search-item span {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.admin-search-item small {
    overflow: hidden;
    color: var(--adm-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.admin-search-enter {
    color: var(--adm-muted);
    opacity: 0;
}

.admin-search-item.is-active {
    background: var(--adm-selected);
    color: var(--cui-heading-color);
}

.admin-search-item.is-active > i:first-child {
    background: var(--adm-brand);
    color: #fff;
}

.admin-search-item.is-active .admin-search-enter {
    opacity: 1;
}

.admin-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 36px 16px;
    color: var(--cui-heading-color);
    text-align: center;
}

.admin-search-empty i {
    color: var(--adm-muted);
    font-size: 24px;
}

.admin-search-empty span {
    color: var(--adm-muted);
    font-size: 13px;
}

.admin-search-foot {
    display: flex;
    gap: 16px;
    padding: 10px 18px;
    border-top: 1px solid var(--adm-line);
    color: var(--adm-muted);
    font-size: 12px;
}

.admin-search-foot kbd {
    margin-right: 2px;
}

/* Filter toolbars: controls keep their natural width instead of stacking full-width. */
.list-toolbar .form-select,
.list-toolbar input[type="date"] {
    width: auto;
    min-width: 150px;
}

@media (max-width: 767px) {
    .list-toolbar .form-select,
    .list-toolbar input[type="date"] {
        flex: 1 1 140px;
    }
}

/* ═════════════════════════ Dashboard & shared bits (v2) ═════════════════════════ */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--adm-line);
    border-radius: 11px;
    background: var(--adm-card);
}

.segmented a,
.segmented button {
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.segmented a:hover,
.segmented button:hover {
    color: var(--cui-heading-color);
}

.segmented .is-on {
    background: var(--adm-ink);
    color: #fff !important;
}

[data-coreui-theme="dark"] .segmented .is-on {
    background: var(--adm-brand);
}

.segmented .seg-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--adm-hover);
    color: var(--adm-muted);
    font-size: 11px;
    text-align: center;
}

.segmented .is-on .seg-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1199px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

.kpi {
    padding: 18px;
    border: 1px solid var(--adm-line);
    border-radius: 14px;
    background: var(--adm-card);
    box-shadow: var(--adm-shadow-sm);
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-label {
    color: var(--adm-muted);
    font-size: 13.5px;
    font-weight: 600;
}

.kpi-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--adm-brand-soft);
    color: var(--adm-brand);
}

.kpi-value {
    margin: 10px 0 6px;
    color: var(--cui-heading-color);
    font-family: var(--adm-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.kpi-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--adm-muted);
    font-size: 12.5px;
}

.kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
}

.kpi-delta.is-up { background: #e6f5ec; color: #0e7c47; }
.kpi-delta.is-down { background: #fdeeee; color: #b42323; }
.kpi-delta.is-flat { background: var(--adm-hover); }

[data-coreui-theme="dark"] .kpi-delta.is-up { background: rgba(14, 124, 71, 0.22); color: #6fe0a6; }
[data-coreui-theme="dark"] .kpi-delta.is-down { background: rgba(196, 43, 43, 0.22); color: #ff9b9b; }

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1199px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

.chart-box {
    position: relative;
    height: 300px;
}

.chart-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--adm-muted);
    font-size: 12.5px;
    font-weight: 500;
}

.chart-legend span {
    display: inline-block;
    width: 12px;
    height: 4px;
    margin-left: 8px;
    border-radius: 2px;
}

.chart-legend .is-revenue { background: var(--adm-brand); }
.chart-legend .is-orders { height: 10px; background: color-mix(in srgb, var(--adm-muted) 30%, transparent); }

.attention-list,
.rank-list {
    margin: 0;
    padding: 6px;
    list-style: none;
}

.attention-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    color: var(--cui-heading-color) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}

.attention-list a:hover {
    background: var(--adm-hover);
}

.attention-list .bi-chevron-right {
    color: var(--adm-muted);
    font-size: 12px;
}

.attention-icon {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.attention-icon.is-warning { background: #fff4e0; color: #9a4d00; }
.attention-icon.is-info { background: var(--adm-brand-soft); color: var(--adm-brand); }
.attention-icon.is-danger { background: #fdeeee; color: #b42323; }

[data-coreui-theme="dark"] .attention-icon.is-warning { background: rgba(224, 138, 0, 0.2); color: #ffc46b; }
[data-coreui-theme="dark"] .attention-icon.is-danger { background: rgba(196, 43, 43, 0.22); color: #ff9b9b; }

.attention-text {
    flex: 1;
    font-size: 14px;
}

.attention-text strong {
    font-family: var(--adm-display);
}

.attention-clear {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 26px 16px;
    text-align: center;
}

.attention-clear i {
    color: #0e7c47;
    font-size: 28px;
}

.attention-clear span {
    color: var(--adm-muted);
    font-size: 13px;
}

.status-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-bar {
    display: grid;
    grid-template-columns: 82px 1fr 34px;
    align-items: center;
    gap: 10px;
    padding: 5px 6px;
    border-radius: 8px;
    color: var(--cui-heading-color) !important;
    font-weight: 500 !important;
    font-size: 13.5px;
    text-decoration: none !important;
}

a.status-bar[href]:hover {
    background: var(--adm-hover);
}

.status-bar-track {
    height: 8px;
    border-radius: 999px;
    background: var(--adm-hover);
    overflow: hidden;
}

.status-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.status-bar-count {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.rank-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--adm-line);
}

.rank-list li:last-child {
    border-bottom: 0;
}

.rank-no {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--adm-hover);
    color: var(--adm-muted);
    font-size: 12px;
    font-weight: 700;
}

.rank-name {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    font-size: 13.5px;
}

.rank-name a {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-name small {
    color: var(--adm-muted);
}

.rank-value {
    font-weight: 700;
    font-size: 13.5px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rank-empty {
    justify-content: center;
    color: var(--adm-muted);
}

/* List status tabs + toolbar bits */
.list-tabs {
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.list-tabs .segmented {
    flex-wrap: nowrap;
}

.list-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 600;
}

.list-date input {
    min-width: 0 !important;
}

/* Order page: progress + next step */
.order-flow .card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-flow-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.order-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.order-badges .badge {
    font-size: 12.5px;
}

.order-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.order-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 600;
}

.order-steps li + li::before {
    content: "";
    width: 28px;
    height: 2px;
    margin-right: 2px;
    border-radius: 2px;
    background: var(--adm-line-strong);
}

.order-steps li.is-done + li::before,
.order-steps li.is-current::before {
    background: #0e7c47;
}

.order-step-dot {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 2px solid var(--adm-line-strong);
    border-radius: 50%;
    font-size: 12px;
}

.order-steps .is-done .order-step-dot {
    border-color: #0e7c47;
    background: #0e7c47;
    color: #fff;
}

.order-steps .is-current {
    color: var(--cui-heading-color);
}

.order-steps .is-current .order-step-dot {
    border-color: var(--adm-brand);
    background: var(--adm-brand);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(36, 80, 240, 0.15);
}

.order-next {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 -18px -18px;
    padding: 14px 18px;
    border-top: 1px solid var(--adm-line);
    border-radius: 0 0 14px 14px;
    background: var(--cui-tertiary-bg);
}

.order-next-text {
    display: flex;
    flex: 1 1 260px;
    flex-direction: column;
    font-size: 13.5px;
}

.order-next-text span {
    color: var(--adm-muted);
}

.order-next .form-control {
    width: 190px;
}

@media (max-width: 767px) {
    .order-steps li span:last-child { display: none; }
    .order-next .form-control { width: 100%; }
}

.admin-page-head {
    flex-wrap: nowrap;
}

.admin-page-head-text {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-page-actions {
    flex-shrink: 0;
    align-items: center;
}

@media (max-width: 767px) {
    .admin-page-head {
        flex-wrap: wrap;
    }
}

/* Phones: header actions wrap instead of widening the page; urgent items first. */
@media (max-width: 767px) {
    .admin-page-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .admin-page-actions .segmented {
        flex-wrap: wrap;
    }

    .admin-page-title {
        font-size: 24px;
    }
}

@media (max-width: 1199px) {
    .dash-side {
        display: contents;
    }

    .dash-side > .card:first-child {
        order: -1;
    }
}
