:root {
    /* 60â30â10 premium system */
    --c60: #F3F2F7;              /* dominant canvas */
    --c30: #16141F;              /* structure / ink */
    --c30-soft: #FFFFFF;         /* elevated panels on light */
    --c30-elevated: #1E1B2A;     /* elevated on dark */
    --c30-muted: #6B6680;        /* secondary text */
    --c30-line: #E4E1EC;         /* hairlines on light */
    --c10: #6D28D9;              /* accent â CTAs, active, focus */
    --c10-deep: #5B21B6;
    --c10-soft: #EDE9FE;
    --c10-glow: rgba(109, 40, 217, 0.28);

    /* Legacy aliases (map to the system) */
    --brand: var(--c10);
    --brand-dark: var(--c10-deep);
    --brand-magenta: #7C3AED;
    --brand-blue: #5B21B6;
    --brand-gradient: linear-gradient(135deg, #7C3AED 0%, #6D28D9 55%, #5B21B6 100%);
    --navy: var(--c30);
    --navy-2: var(--c30-elevated);
    --navy-3: #2A2640;
    --page: var(--c60);
    --text: var(--c30);
    --muted: var(--c30-muted);
    --line: var(--c30-line);
    --shadow: 0 1px 2px rgba(22, 20, 31, 0.04), 0 10px 28px rgba(22, 20, 31, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--page);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
a.link { color: var(--brand-blue); font-weight: 600; }
button, input, select, textarea { font-family: inherit; }

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--navy);
    color: #c9cedc;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 40;
    transition: width .2s ease;
    overflow: hidden;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.sidebar-expand-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #c9cedc;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-expand-btn:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

@media (min-width: 1025px) {
    .sidebar.compact {
        width: 68px;
    }

    .sidebar.compact .sidebar-top {
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        padding-top: 6px;
    }

    .sidebar.compact .sidebar-brand {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar.compact .sidebar-expand-btn {
        margin: 0;
    }

    .sidebar.compact .sidebar-brand .brand-wordmark,
    .sidebar.compact .nav-label,
    .sidebar.compact .nav-item > span,
    .sidebar.compact .badge-new,
    .sidebar.compact .sidebar-user-meta,
    .sidebar.compact .account-link,
    .sidebar.compact .logout-btn span {
        display: none !important;
    }

    .sidebar.compact .nav-item {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        gap: 0;
    }

    .sidebar.compact .sidebar-user {
        justify-content: center;
        padding-left: 8px;
        padding-right: 8px;
        gap: 0;
    }

    .sidebar.compact .sidebar-user form {
        margin-left: 0 !important;
    }

    .sidebar.compact .logout-btn {
        margin-left: 0;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 12px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--c10);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 16px var(--c10-glow);
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    min-width: 0;
}

.brand-logo img {
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 8px 18px rgba(126, 34, 206, 0.45));
}

.sidebar-brand .brand-logo img {
    width: 32px !important;
    height: 32px !important;
}

.sidebar-brand .brand-wordmark {
    font-size: 14px;
}

.brand-wordmark {
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.card .brand-wordmark,
.login-card .brand-wordmark {
    font-size: 20px;
}

.nav-scroll {
    overflow: auto;
    flex: 1;
    padding: 4px 8px 12px;
}

.nav-scroll::-webkit-scrollbar { width: 5px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #343a4e; border-radius: 99px; }

.nav-label {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7b8298;
    font-weight: 600;
    padding: 12px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    color: #c5cad8;
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 1px;
    line-height: 1.25;
}

.nav-item:hover { background: var(--navy-3); color: #fff; }
.nav-item.active {
    background: var(--c10);
    color: #fff;
    box-shadow: 0 8px 18px var(--c10-glow);
}

.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.icon-btn svg, .qa-ico svg { width: 18px; height: 18px; flex-shrink: 0; }

.badge-new {
    margin-left: auto;
    background: #22c55e;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 6px;
}

.sidebar-user {
    border-top: 1px solid #2a3144;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user .avatar {
    width: 30px;
    height: 30px;
    font-size: 11px;
}

.sidebar-user-meta div:first-child {
    font-size: 12px !important;
}

.sidebar-user-meta div:last-child {
    font-size: 11px !important;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c10);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 48px;
    min-height: 48px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px 0 10px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    flex-shrink: 0;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 2px;
    max-width: 160px;
}

.topbar-user-meta {
    min-width: 0;
    line-height: 1.15;
}

.topbar-user-meta span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-user-meta em {
    display: block;
    font-style: normal;
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-panel {
    position: absolute;
    right: 0;
    top: 40px;
    width: min(340px, 92vw);
    padding: 6px 0;
    z-index: 60;
    max-height: min(70vh, 420px);
    overflow: auto;
}

.notif-panel-head {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.notif-panel-head strong { font-size: 13px; }

.notif-panel-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notif-panel-links form { margin: 0; }

.notif-panel-links button {
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
}

.notif-panel-links a { font-size: 11px; }

.notif-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: 0;
    border-top: 1px solid #f1f3f8;
    background: transparent;
    cursor: pointer;
}

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

.notif-item-title {
    font-size: 12px;
    font-weight: 650;
    color: var(--text);
}

.notif-item-meta { font-size: 10px; margin-top: 2px; }

.notif-empty {
    padding: 12px;
    border-top: 1px solid #f1f3f8;
    font-size: 12px;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 0;
    color: #8b93a7;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.logout-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 320px;
    min-width: 0;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: #f3f5fa;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #4b5568;
    position: relative;
    flex-shrink: 0;
}

.icon-btn i,
.icon-btn svg {
    width: 15px;
    height: 15px;
}

.search {
    flex: 1;
    min-width: 0;
    height: 32px;
    border: 1px solid var(--line);
    background: #f8f9fd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    color: var(--muted);
}

.search i,
.search svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    min-width: 0;
    font-size: 12px;
    color: var(--text);
}

.kbd {
    font-size: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 4px;
    padding: 1px 4px;
    color: #9ca3af;
    white-space: nowrap;
    line-height: 1.2;
}

.dot-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    border-radius: 99px;
    background: var(--brand);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: grid;
    place-items: center;
    padding: 0 3px;
}

.page {
    padding: 12px 14px 20px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

@media (max-width: 720px) {
    .topbar-user-meta { display: none; }
    .search .kbd { display: none; }
    .search-wrap { max-width: none; }
}

.page-kicker { color: var(--muted); font-size: 11px; line-height: 1.25; }
.page-kicker strong { color: var(--text); font-weight: 750; font-size: 16px; letter-spacing: -0.02em; }

/* Dense orders desk — more rows on screen */
.orders-desk .toolbar { margin-bottom: 8px; }
.orders-desk-filters {
    padding: 8px 10px;
    margin-bottom: 8px;
}
.orders-desk-table {
    overflow: hidden;
}
.orders-desk-flash {
    padding: 8px 12px;
    margin-bottom: 8px;
}
.orders-desk-flash.is-error {
    background: #fef2f2;
    color: #b91c1c;
}
.orders-desk .filters { gap: 6px; }
.orders-desk .status-flash {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    font-size: 13px;
}
table.data-dense {
    font-size: 12.5px;
}
table.data-dense th {
    padding: 7px 10px;
    font-size: 11px;
}
table.data-dense td {
    padding: 7px 10px;
}
.btn-view-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}
.input-sm, .select-sm {
    height: 34px;
    font-size: 12.5px;
    border-radius: 8px;
}

.card {
    background: var(--c30-soft);
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.stat-card { padding: 16px 16px 8px; overflow: hidden; }
.stat-title { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 4px; }
.stat-delta { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.up { color: #16a34a; }
.down { color: #ef4444; }

.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.section-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.muted { color: var(--muted); font-size: 13px; }

/* Pagination — matches admin cards (no Bootstrap/Tailwind dependency) */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pager-meta {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}
.pager-meta strong {
    color: var(--text);
    font-weight: 700;
}
.pager-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pager-item {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
a.pager-btn:hover {
    background: var(--c10-soft);
    border-color: #ddd6fe;
    color: var(--c10-deep);
}
.pager-item.is-active .pager-btn {
    background: var(--c10);
    border-color: transparent;
    color: #fff;
    cursor: default;
}
.pager-item.is-disabled .pager-btn {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}
.pager-simple .pager-list {
    width: 100%;
    justify-content: space-between;
}
.pager-simple .pager-btn {
    min-width: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary { background: var(--c10); color: #fff; }
.btn-primary:hover { background: var(--c10-deep); }
.btn-ghost { background: var(--c30-soft); color: var(--text); border: 1px solid var(--line); }
.btn-soft { background: var(--c10-soft); color: var(--c10-deep); }

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending { background: #fff4e5; color: #c2410c; }
.badge-approved { background: #e8f8ee; color: #15803d; }
.badge-processing { background: #eef2ff; color: #4338ca; }
.badge-shipped { background: #f3e8ff; color: #7e22ce; }
.badge-delivered { background: #e6fbf7; color: #0f766e; }
.badge-customs { background: #fff7ed; color: #c2410c; }
.badge-transit { background: #e0f2fe; color: #0369a1; }
.badge-active { background: #e8f8ee; color: #15803d; }
.badge-hold { background: #f3f4f6; color: #4b5563; }
.badge-low { background: #fff4e5; color: #c2410c; }
.badge-out { background: #fee2e2; color: #b91c1c; }
.badge-paid { background: #e8f8ee; color: #15803d; }
.badge-unpaid { background: #fee2e2; color: #b91c1c; }
.badge-partial { background: #e0f2fe; color: #0369a1; }
.badge-review { background: #fff4e5; color: #c2410c; }

.table-wrap { overflow: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.data th {
    text-align: left;
    font-size: 12px;
    color: #6b7289;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fafbfe;
}
table.data td {
    padding: 13px 14px;
    border-bottom: 1px solid #f1f3f8;
    vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data a.link { color: var(--brand-blue); font-weight: 600; }

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.field {
    display: block;
    width: 100%;
    min-width: 0;
}

.select, .input {
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
    font-size: 13px;
    color: var(--text);
    outline: none;
}

.textarea,
textarea.input {
    display: block;
    width: 100%;
    min-height: 88px;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-size: 13px;
    color: var(--text);
    outline: none;
    resize: vertical;
    line-height: 1.45;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-span, .form-span { grid-column: 1 / -1; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow: auto; }
.section-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; font-size: 13px; }

.qa-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.qa {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    border-radius: 12px;
    background: #f8f9fd;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    text-align: center;
}
.qa:hover { background: var(--c10-soft); color: var(--c10-deep); }
.qa-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.swatch { width: 10px; height: 10px; border-radius: 99px; display: inline-block; }

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 35;
}
.overlay.show { display: block; }




.order-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(15, 14, 20, 0.48);
    backdrop-filter: blur(3px);
}

.order-modal {
    width: min(1100px, 100%);
    height: min(94vh, 860px);
    max-height: min(94vh, 860px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 24px 64px rgba(22, 20, 31, 0.28);
}

.order-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0;
}

.order-modal-title {
    font-weight: 800;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.order-modal-sub {
    margin-top: 1px;
    font-size: 11.5px;
    color: var(--muted);
}

.order-modal-sub .dot { margin: 0 3px; opacity: .5; }

.order-modal-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.order-modal-status-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.order-history-btn {
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    max-width: 220px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}

.status-pill--pending { background: #fff7ed; color: #c2410c; }
.status-pill--success { background: #ecfdf5; color: #047857; }
.status-pill--danger { background: #fef2f2; color: #b91c1c; }
.status-pill--muted { background: #f1f5f9; color: #475569; }

.order-modal-head-right .btn.is-active {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}
.order-history-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: #312e81;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}


.order-history-panel {
    flex-shrink: 0;
    max-height: min(48vh, 420px);
    overflow: auto;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    padding: 10px 14px 12px;
}
.order-history-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.order-history-head strong {
    font-size: 13px;
    font-weight: 800;
}
.order-history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}
.order-history-summary div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
}
.order-history-summary span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.order-history-summary strong {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
}
.order-invoice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.order-invoice-stamp {
    display: grid;
    gap: 2px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}

.order-history-tabs {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border-radius: 9px;
    background: #e2e8f0;
}
.order-history-tab {
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
}
.order-history-tab.is-active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.order-history-empty {
    padding: 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 10px;
}
.order-history-list {
    display: grid;
    gap: 8px;
}
.order-history-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
}
.order-history-item.is-verified {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.order-history-item.is-pending {
    border-color: #fde68a;
    background: #fffbeb;
}
.order-history-item.is-rejected {
    border-color: #fecaca;
    background: #fef2f2;
}
.order-history-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.order-history-top strong {
    font-size: 15px;
    font-weight: 800;
}
.order-history-meta {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}
.order-history-meta strong {
    color: var(--text);
    font-weight: 700;
}

.order-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}
.order-timeline-item {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0 8px 12px;
    border-left: 2px solid #e2e8f0;
    margin-left: 6px;
    position: relative;
}
.order-timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}
.order-timeline-item.tone-ok::before { background: #16a34a; }
.order-timeline-item.tone-warn::before { background: #d97706; }
.order-timeline-item.tone-bad::before { background: #dc2626; }
.order-timeline-item.tone-info::before { background: #4f46e5; }
.order-timeline-item.tone-muted::before { background: #94a3b8; }
.order-timeline-stamp {
    display: grid;
    gap: 1px;
    font-size: 11px;
    line-height: 1.25;
}
.order-timeline-day {
    font-weight: 800;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: 10px;
}
.order-timeline-date { color: var(--text); font-weight: 650; }
.order-timeline-time { color: var(--muted); }
.order-timeline-body strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
}
.order-timeline-body p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #475569;
}
.order-timeline-body em {
    display: block;
    margin-top: 2px;
    font-style: normal;
    font-size: 11px;
    color: var(--muted);
}

.order-invoice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
}
.order-invoice-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}
.order-invoice-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.order-invoice-kicker {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}
.order-invoice-top strong {
    font-size: 15px;
    font-weight: 800;
}
.order-invoice-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}
.order-invoice-amounts div {
    background: #f8fafc;
    border-radius: 8px;
    padding: 6px 8px;
}
.order-invoice-amounts span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}
.order-invoice-amounts strong {
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 720px) {
    .order-timeline-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.order-modal-error,
.order-modal-loading {
    margin: 16px;
    padding: 28px 16px;
    text-align: center;
    border-radius: 12px;
    font-size: 14px;
    flex-shrink: 0;
}
.order-modal-error { color: #b91c1c; background: #fef2f2; }
.order-modal-loading { color: var(--muted); background: #fafafa; border: 1px dashed var(--line); }

/* Two-pane: products LEFT (primary), actions RIGHT */
.order-modal-main {
    display: none;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.order-modal-main.is-open {
    display: grid;
}

.order-products-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    border-right: 1px solid var(--line);
    background: #fff;
}

.order-products-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    background: #fff;
}
.order-products-head strong {
    font-size: 13px;
    font-weight: 800;
}
.order-products-head span {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}

.order-products-body {
    flex: 1 1 auto;
    min-height: 360px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.order-products-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.order-lines-table {
    width: 100%;
}
.order-lines-table.is-empty {
    display: none;
}
.order-lines-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
    box-shadow: inset 0 -1px 0 var(--line);
}
.order-lines-table th.num,
.order-lines-table td.num { text-align: right; }
.order-lines-table td,
.order-lines-table th {
    padding: 8px 12px;
    vertical-align: top;
}
.order-lines-table tbody tr:hover { background: #fafafa; }
.order-item-name { font-weight: 700; font-size: 13.5px; }

.stock-ok { color: #15803d; font-weight: 700; }
.stock-bad { color: #b91c1c; font-weight: 800; }

.order-notes {
    margin: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    background: #fafafa;
    font-size: 13px;
    color: #334155;
    flex-shrink: 0;
}
.order-notes strong {
    display: block;
    margin-bottom: 2px;
    color: var(--text);
    font-size: 12px;
}

.order-side-pane {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    overflow: auto;
    min-height: 0;
    background: #fafafa;
}

.order-side-signals {
    display: grid;
    gap: 8px;
}

.order-side-signal {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}
.order-side-signal span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}
.order-side-signal strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}
.order-side-signal em {
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}
.order-side-signal.ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.order-side-signal.ok em { color: #15803d; }
.order-side-signal.bad {
    background: #fef2f2;
    border-color: #fecaca;
}
.order-side-signal.bad em { color: #b91c1c; }

.order-reject-banner {
    padding: 8px 12px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
}

.order-status-banner {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--line);
}
.order-status-banner.tone-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.order-status-banner.tone-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.order-status-banner.tone-muted,
.order-status-banner.tone-pending { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.order-advance-box {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #fde68a;
    background: #fffbeb;
}
.order-advance-box strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.order-advance-amount {
    margin-top: 4px;
    font-size: 20px;
    font-weight: 800;
    color: #78350f;
}

.order-side-actions {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding-top: 4px;
}

.order-decide-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: #e2e8f0;
    max-width: none;
}
.order-decide-tab {
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
}
.order-decide-tab.is-active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.order-decide-tab.is-danger.is-active { color: #b91c1c; }

.order-decide-panel {
    display: grid;
    gap: 10px;
}

.order-field {
    display: grid;
    gap: 5px;
    margin: 0;
}
.order-field-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}
.order-field-label em {
    font-style: normal;
    font-weight: 500;
    color: var(--muted);
}
.order-field .input {
    width: 100%;
    height: 40px;
}

.order-override {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #fed7aa;
    background: #fffbeb;
    cursor: pointer;
}
.order-override input {
    margin-top: 2px;
    flex-shrink: 0;
}
.order-override strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #9a3412;
}
.order-override small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #a16207;
    line-height: 1.35;
}

.order-decide-hint {
    margin: 0;
    font-size: 12px;
    color: #b91c1c;
    font-weight: 600;
}

.order-delete-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}

.btn-link-danger {
    border: 0;
    background: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.btn-link-danger:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-view {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}
.btn-view:hover { background: #ede9fe; }

.btn-approve {
    height: 42px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    color: #fff;
    background: #15803d;
    padding: 0 18px;
    white-space: nowrap;
}
.btn-approve:hover { background: #166534; }
.btn-approve:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.btn-reject {
    height: 42px;
    border-radius: 10px;
    font-weight: 700;
    color: #fff;
    background: #b91c1c;
    border: 0;
    padding: 0 18px;
    white-space: nowrap;
}
.btn-reject:hover { background: #991b1b; }

.status-flash {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14px;
}

.status-flash--approved {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.status-flash--rejected {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.status-flash--deleted,
.status-flash--cancelled,
.status-flash--updated {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

.status-flash-main { font-weight: 700; }

.status-flash-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.order-row-flash td {
    background: #ecfdf5 !important;
    animation: orderFlash 2.4s ease;
}

.order-row-active td {
    background: #f5f3ff !important;
}

@keyframes orderFlash {
    0% { background: #bbf7d0; }
    100% { background: #ecfdf5; }
}

.om-fade { transition: opacity .16s ease; }
.om-fade-start { opacity: 0; }
.om-fade-end { opacity: 1; }
.om-pop { transition: transform .18s ease, opacity .18s ease; }
.om-pop-start { opacity: 0; transform: translateY(10px) scale(.98); }
.om-pop-end { opacity: 1; transform: none; }

@media (max-width: 820px) {
    .order-modal {
        height: min(96vh, 100%);
        max-height: min(96vh, 100%);
    }
    .order-modal-main {
        grid-template-columns: 1fr;
        overflow: auto;
    }
    .order-products-pane {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        min-height: 360px;
    }
    .order-products-body {
        min-height: 280px;
        max-height: 50vh;
    }
    .order-side-pane {
        overflow: visible;
    }
}

.form-grid .input, .form-grid .select { width: 100%; }

.product-thumb {
    display: block;
    object-fit: cover;
    border-radius: 12px;
    background: var(--c10-soft);
    border: 1px solid var(--line);
    flex-shrink: 0;
}

.product-thumb-empty {
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--c10-deep);
    background: var(--c10-soft);
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.product-cell > div {
    min-width: 0;
}

/* Warehouse desk â compact professional workspace */
.fw-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.fw-top-actions { display: flex; gap: 6px; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }
.input-sm { height: 34px; font-size: 12.5px; }
.select-sm { height: 34px; font-size: 12.5px; }

.fw-toast {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.fw-toast.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.fw-toast.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.fw-stages {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}
.fw-stage {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.fw-stage:hover { border-color: #c4b5fd; }
.fw-stage.active {
    border-color: #7c3aed;
    background: #faf5ff;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, .1);
}
.fw-stage:disabled { cursor: not-allowed; }
.fw-stage-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #64748b;
}
.fw-stage-count {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.fw-layout {
    display: grid;
    grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    min-height: 520px;
}
.fw-layout.list-collapsed {
    grid-template-columns: 44px minmax(0, 1fr);
}
.fw-list-head-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.fw-list-head-row .input { flex: 1; min-width: 0; }
.fw-list-toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}
.fw-list-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 6px;
    cursor: pointer;
    border: 0;
    background: #fff;
    color: #64748b;
    font-weight: 800;
    font-size: 12px;
}
.fw-list-rail:hover { color: #7c3aed; background: #faf5ff; }
.fw-list, .fw-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 520px;
}
.fw-list-head {
    padding: 8px;
    border-bottom: 1px solid var(--line);
}
.fw-list-body { overflow: auto; flex: 1; }
.fw-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    text-align: left;
    cursor: pointer;
}
.fw-row:hover { background: #f8fafc; }
.fw-row.active {
    background: #f5f3ff;
    box-shadow: inset 3px 0 0 #7c3aed;
}
.fw-row:disabled { cursor: not-allowed; }
.fw-row-title { font-weight: 800; font-size: 12px; color: #0f172a; }
.fw-row-sub { margin-top: 1px; font-size: 11px; color: #64748b; }
.fw-empty { padding: 18px 12px; text-align: center; color: #94a3b8; font-size: 12px; }

.fw-panel-empty {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px;
    font-size: 13px;
}
.fw-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: auto;
}
.fw-panel-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fafafa;
}
.fw-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fw-title { font-size: 16px; font-weight: 800; }
.fw-sub { margin-top: 3px; font-size: 12px; color: #64748b; }

.fw-pipeline {
    display: flex;
    gap: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.fw-pipe-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0 2px;
}
.fw-pipe-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 5px;
    left: calc(50% + 8px);
    right: calc(-50% + 8px);
    height: 2px;
    background: #e2e8f0;
}
.fw-pipe-step.done:not(:last-child)::after { background: #86efac; }
.fw-pipe-dot {
    width: 10px;
    height: 10px;
    margin: 0 auto 4px;
    border-radius: 999px;
    background: #e2e8f0;
    border: 2px solid #cbd5e1;
    position: relative;
    z-index: 1;
}
.fw-pipe-step.done .fw-pipe-dot {
    background: #16a34a;
    border-color: #16a34a;
}
.fw-pipe-step.current .fw-pipe-dot {
    background: #7c3aed;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .18);
}
.fw-pipe-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
}
.fw-pipe-step.done .fw-pipe-label,
.fw-pipe-step.current .fw-pipe-label { color: #334155; }

.fw-split {
    display: grid;
    grid-template-columns: 1.4fr .85fr;
    gap: 0;
    flex: 1;
    min-height: 0;
}
.fw-lines {
    padding: 8px 10px 10px;
    border-right: 1px solid var(--line);
    overflow: auto;
}
.fw-table th, .fw-table td {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    font-size: 12px;
}
.fw-item-name { font-weight: 600; font-size: 12px; }
.fw-item-sku { font-size: 10px; }
.fw-meta-line { margin-top: 8px; font-size: 11px; }

.fw-actions {
    padding: 10px;
    background: #f8fafc;
    position: relative;
    border-left: 0;
}
.fw-actions.is-busy { min-height: 120px; }
.fw-list.is-locked,
.fw-stages.is-locked {
    opacity: .7;
    pointer-events: none;
}
.fw-action-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fw-action-card.is-done {
    border-color: #a7f3d0;
    background: #ecfdf5;
}
.fw-action-title { font-weight: 800; font-size: 13px; }
.fw-action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.fw-deliver-ref { font-size: 11px; }

.fw-btn-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.fw-spinner {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(124, 58, 237, .25);
    border-top-color: #7c3aed;
    animation: fwSpin .7s linear infinite;
    flex-shrink: 0;
}
.fw-spinner.sm { width: 13px; height: 13px; }
.fw-spinner.lg { width: 24px; height: 24px; border-width: 3px; }
.fw-spinner.light {
    border-color: rgba(255,255,255,.35);
    border-top-color: #fff;
}
.fw-busy-veil {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: rgba(248, 250, 252, .88);
    backdrop-filter: blur(1px);
}
.fw-busy-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.fw-busy-title { font-size: 12px; font-weight: 800; color: #0f172a; }

@keyframes fwSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
    .fw-stages { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .fw-layout { grid-template-columns: 1fr; min-height: 0; }
    .fw-list { min-height: 220px; max-height: 280px; }
    .fw-panel { min-height: 420px; }
    .fw-split { grid-template-columns: 1fr; }
    .fw-lines { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
    .fw-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.track-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.track-stage {
    text-align: left;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.track-stage:hover {
    border-color: #c4b5fd;
    transform: translateY(-1px);
}

.track-stage.active {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
    background: linear-gradient(180deg, #faf5ff, #fff);
}

.track-stage.empty .track-stage-count {
    color: #94a3b8;
}

.track-stage-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.track-stage-count {
    margin-top: 4px;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.track-stage-hint {
    margin-top: 4px;
    font-size: 11px;
    color: #94a3b8;
}

.mini-track {
    display: flex;
    align-items: flex-start;
    gap: 2px;
}

.mini-track-step {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.mini-track-dot {
    display: block;
    width: 10px;
    height: 10px;
    margin: 0 auto 4px;
    border-radius: 999px;
    background: #e2e8f0;
    border: 2px solid #cbd5e1;
    position: relative;
}

.mini-track-step:not(:last-child) .mini-track-dot::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    width: calc(100% + 2px);
    height: 2px;
    background: #e2e8f0;
    transform: translateY(-50%);
}

.mini-track-step.done .mini-track-dot {
    background: #16a34a;
    border-color: #16a34a;
}

.mini-track-step.done:not(:last-child) .mini-track-dot::after {
    background: #86efac;
}

.mini-track-step.current .mini-track-dot {
    background: #7c3aed;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.mini-track-label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-track-step.current .mini-track-label,
.mini-track-step.done .mini-track-label {
    color: #334155;
}

.pipeline-card {
    padding: 16px;
    margin-bottom: 14px;
}

.pipeline-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pipeline-track {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.pipeline-step {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f8fafc;
}

.pipeline-step.done {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.pipeline-step.current {
    background: #faf5ff;
    border-color: #c4b5fd;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}

.pipeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    background: #e2e8f0;
    color: #475569;
    margin-bottom: 8px;
}

.pipeline-step.done .pipeline-dot {
    background: #16a34a;
    color: #fff;
}

.pipeline-step.current .pipeline-dot {
    background: #7c3aed;
    color: #fff;
}

.pipeline-label {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.pipeline-at {
    margin-top: 2px;
    font-size: 11px;
    color: #64748b;
}

@media (max-width: 1100px) {
    .track-board {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .pipeline-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .track-board,
    .pipeline-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: none; }
    .overlay.show { display: block; }
    .grid-5, .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
}

/* Partner requests desk ï¿½ dense professional layout */
.partner-desk { display: grid; gap: 10px; }
.partner-desk-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.partner-desk-top-actions { display: flex; gap: 8px; }
.partner-flash {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}
.partner-flash.is-ok { background: #e8f8ee; color: #15803d; }
.partner-flash.is-error { background: #fee2e2; color: #b91c1c; }

.partner-cred {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #ddd6fe;
    background: #faf5ff;
}
.partner-cred-title { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.partner-cred-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12.5px;
}
.partner-cred-grid em {
    font-style: normal;
    color: var(--muted);
    margin-right: 4px;
    font-weight: 600;
}
.partner-cred-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.partner-desk-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 10px;
    align-items: start;
}

.partner-panel {
    background: var(--c30-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    min-width: 0;
}
.partner-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #fafafa;
}
.partner-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.partner-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
}
.partner-tab b {
    font-size: 11px;
    font-weight: 800;
    color: var(--text);
    background: #eee;
    border-radius: 999px;
    padding: 1px 6px;
}
.partner-tab.is-active {
    background: var(--c10-soft);
    color: var(--c10-deep);
}
.partner-tab.is-active b {
    background: var(--c10);
    color: #fff;
}

.partner-list { display: grid; }
.partner-row,
.partner-msg {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f0f5;
}
.partner-row:last-child,
.partner-msg:last-child { border-bottom: 0; }
.partner-row.is-pending { background: linear-gradient(90deg, rgba(109,40,217,.04), transparent 40%); }
.partner-row:hover,
.partner-msg:hover { background: #faf9fc; }

.partner-row-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.partner-row-title strong {
    font-size: 13.5px;
    letter-spacing: -0.01em;
}
.partner-shop-link { font-size: 12px; }
.partner-source {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #CCFBF1;
    color: #0F766E;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.partner-source.is-web { background: #E0F2FE; color: #0369A1; }
.partner-panel-head { flex-wrap: wrap; }
.partner-sources { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: #EFEDF5; }
.partner-src {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
}
.partner-src b { font-size: 10.5px; color: #8a86a0; }
.partner-src.is-active { background: #fff; color: var(--c10-deep); box-shadow: 0 1px 2px rgba(20, 16, 40, .08); }
.partner-login { margin: 6px 0 0; font-size: 11.5px; font-weight: 600; color: #6b6780; }
.partner-login::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.partner-login.is-waiting { color: #B45309; }
.partner-login.is-ready { color: #047857; }
.partner-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    color: var(--muted);
}
.partner-row-meta span:not(:last-child)::after {
    content: "";
}
.partner-row-note {
    margin: 5px 0 0;
    font-size: 12px;
    color: #5b5670;
    line-height: 1.35;
}
.partner-row-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    min-width: 96px;
}
.partner-row-actions .btn,
.partner-cred-actions .btn { width: 100%; justify-content: center; }
.partner-btn-reject { color: #b91c1c !important; }

.partner-messages .partner-msg {
    grid-template-columns: 1fr;
    gap: 4px;
}
.partner-msg-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.partner-msg-top strong { font-size: 13px; }
.partner-msg-subject {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
}
.partner-msg-status .select {
    width: 100%;
    height: 32px;
    font-size: 12px;
    margin-top: 4px;
}

.partner-empty {
    padding: 28px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.partner-pager {
    padding: 8px 10px;
    border-top: 1px solid var(--line);
}

@media (max-width: 1100px) {
    .partner-desk-grid { grid-template-columns: 1fr; }
    .partner-row-actions {
        flex-direction: row;
        min-width: 0;
    }
    .partner-row-actions .btn { width: auto; }
}

/* Portal wholesale shop (ecommerce) */
.shop-desk { display: grid; gap: 10px; }
.shop-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.shop-cart-btn { position: relative; gap: 8px; }
.shop-cart-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: var(--c10-deep);
    font-size: 11px;
    font-weight: 800;
    display: inline-grid;
    place-items: center;
}
.shop-flash {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}
.shop-flash.is-ok { background: #e8f8ee; color: #15803d; }
.shop-flash.is-error { background: #fee2e2; color: #b91c1c; }
.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.shop-filters .input { flex: 1; min-width: 180px; }
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}
.shop-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}
.shop-card.is-oos { opacity: .72; }
.shop-card-media {
    position: relative;
    aspect-ratio: 1.15 / 1;
    background: #f4f2f8;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.shop-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.shop-card-fallback {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 24px;
    color: var(--c10-deep);
    background: var(--c10-soft);
}
.shop-stock-pill {
    position: absolute;
    left: 8px;
    bottom: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
}
.shop-stock-pill.is-in { color: #15803d; }
.shop-stock-pill.is-out { color: #b91c1c; }
.shop-card-body {
    padding: 10px 12px 12px;
    display: grid;
    gap: 4px;
}
.shop-card-sku {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.02em;
}
.shop-card-name {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    min-height: 2.5em;
}
.shop-card-cat { font-size: 11px; color: var(--muted); }
.shop-card-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-top: 2px;
}
.shop-card-actions {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}
.shop-qty {
    display: inline-grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.shop-qty button {
    height: 34px;
    border: 0;
    background: #f6f5f9;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.shop-qty button:disabled { opacity: .4; cursor: not-allowed; }
.shop-qty input {
    height: 34px;
    border: 0;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    width: 100%;
}
.shop-qty-sm {
    grid-template-columns: 28px 28px 28px;
    width: auto;
}
.shop-qty-sm span {
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}
.shop-empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.shop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,14,20,.35);
    z-index: 60;
}
.shop-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(400px, 100vw);
    height: 100vh;
    background: #fff;
    z-index: 70;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform .2s ease;
    box-shadow: -12px 0 40px rgba(0,0,0,.12);
}
.shop-drawer.is-open { transform: none; }
.shop-drawer-head,
.shop-drawer-foot {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.shop-drawer-foot {
    border-bottom: 0;
    border-top: 1px solid var(--line);
    display: block;
}
.shop-drawer-body {
    flex: 1;
    overflow: auto;
    padding: 8px 10px;
}
.shop-line {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px 6px;
    border-bottom: 1px solid #f1f0f5;
}
.shop-line-main { min-width: 0; }
.shop-line-main strong {
    display: block;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shop-line-total {
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.shop-line-remove {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.shop-summary {
    display: grid;
    gap: 4px;
    font-size: 13px;
}
.shop-summary > div {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
}
.shop-summary strong { color: var(--text); }
.shop-summary-total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--line);
    font-size: 14px;
}
@media (max-width: 640px) {
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .shop-card-name { font-size: 12.5px; min-height: 2.4em; }
}

/* ===== Portal ecommerce redesign ===== */
.ecom { display: grid; gap: 10px; padding-bottom: 72px; }
.ecom-flash {
    padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
}
.ecom-flash.is-ok { background: #e8f8ee; color: #15803d; }
.ecom-flash.is-error { background: #fee2e2; color: #b91c1c; }

.ecom-hero { position: relative; border-radius: 16px; overflow: hidden; min-height: 168px; }
.ecom-poster {
    width: 100%; min-height: 168px; border: 0; text-align: left; cursor: pointer;
    padding: 22px 24px; color: #fff; display: grid; align-content: end;
}
.ecom-poster.tone-violet {
    background:
        radial-gradient(circle at 88% 20%, rgba(255,255,255,.18), transparent 35%),
        linear-gradient(125deg, #5b21b6 0%, #6d28d9 48%, #2563eb 100%);
}
.ecom-poster.tone-ink {
    background:
        radial-gradient(circle at 12% 80%, rgba(109,40,217,.35), transparent 40%),
        linear-gradient(135deg, #16141f 0%, #2a2640 100%);
}
.ecom-poster.tone-sand {
    background:
        linear-gradient(135deg, #1e1b2a 0%, #3b3358 55%, #6d28d9 120%);
}
.ecom-poster-eye {
    font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    opacity: .85; display: block; margin-bottom: 6px;
}
.ecom-poster h1 {
    margin: 0 0 6px; font-size: clamp(1.25rem, 2.4vw, 1.75rem); letter-spacing: -.03em; max-width: 18ch;
}
.ecom-poster p { margin: 0 0 12px; max-width: 42ch; font-size: 13px; opacity: .88; line-height: 1.4; }
.ecom-poster-cta {
    display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px;
    background: rgba(255,255,255,.16); font-size: 12px; font-weight: 700;
}
.ecom-poster-dots {
    position: absolute; right: 14px; bottom: 12px; display: flex; gap: 6px;
}
.ecom-dot {
    width: 7px; height: 7px; border-radius: 99px; border: 0; background: rgba(255,255,255,.35); cursor: pointer;
}
.ecom-dot.is-active { width: 18px; background: #fff; }

.ecom-bar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
    padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
    position: sticky; top: 8px; z-index: 25; box-shadow: 0 8px 24px rgba(22,20,31,.04);
}
.ecom-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.ecom-tab {
    border: 0; background: transparent; height: 34px; padding: 0 12px; border-radius: 10px;
    font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; display: inline-flex; gap: 5px; align-items: center;
}
.ecom-tab b {
    font-size: 10px; background: #eee; color: var(--text); border-radius: 99px; padding: 1px 6px;
}
.ecom-tab.is-active { background: var(--c10-soft); color: var(--c10-deep); }
.ecom-tab.is-active b { background: var(--c10); color: #fff; }
.ecom-bar-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ecom-search { width: min(220px, 42vw); height: 34px; font-size: 13px; }
.ecom-cat { width: 130px; height: 34px; font-size: 12px; }
.ecom-icon-btn {
    position: relative; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
    background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--text);
}
.ecom-icon-btn span {
    position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 99px; background: var(--c10); color: #fff; font-size: 10px; font-weight: 800;
    display: inline-grid; place-items: center;
}
.ecom-icon-btn.is-cart { background: var(--c10); color: #fff; border-color: transparent; }
.ecom-meta {
    display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 2px;
}

.ecom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.ecom-card {
    background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.ecom-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(22,20,31,.08); }
.ecom-card.is-oos { opacity: .7; }
.ecom-card-media {
    position: relative; aspect-ratio: 1 / 1; background: #f3f1f7; overflow: hidden;
}
.ecom-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ecom-fallback {
    width: 100%; height: 100%; display: grid; place-items: center;
    font-size: 28px; font-weight: 800; color: var(--c10-deep); background: var(--c10-soft);
}
.ecom-badges { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; }
.ecom-badge {
    font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 999px; background: #fff; color: var(--text);
}
.ecom-badge.is-new { background: #6d28d9; color: #fff; }
.ecom-badge.is-hot { background: #0f172a; color: #fff; }
.ecom-badge.is-low { background: #fff7ed; color: #c2410c; }
.ecom-wish {
    position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 999px;
    border: 0; background: rgba(255,255,255,.92); color: #94a3b8; display: grid; place-items: center; cursor: pointer;
}
.ecom-wish.is-on { color: #e11d48; background: #fff; }
.ecom-card-body { padding: 10px; display: grid; gap: 3px; }
.ecom-sku { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.ecom-card-body h3 {
    margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em;
}
.ecom-cat { font-size: 11px; color: var(--muted); }
.ecom-price-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: 2px;
}
.ecom-price-row strong { font-size: 14px; font-weight: 800; }
.ecom-price-row span { font-size: 11px; font-weight: 600; }
.ecom-price-row .ok { color: #15803d; }
.ecom-price-row .no { color: #b91c1c; }
.ecom-card-foot { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 8px; }
.ecom-stepper {
    display: grid; grid-template-columns: 28px 1fr 28px; align-items: center;
    border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; height: 34px;
}
.ecom-stepper button {
    border: 0; background: #f6f5f9; cursor: pointer; font-weight: 800; color: var(--text); height: 100%;
}
.ecom-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.ecom-stepper input {
    border: 0; text-align: center; font-weight: 800; font-size: 12px; width: 100%; height: 100%;
}
.ecom-stepper-xs { width: 88px; grid-template-columns: 26px 28px 26px; height: 30px; }
.ecom-stepper-xs span { display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.ecom-add {
    border: 0; border-radius: 9px; background: var(--c10); color: #fff; font-size: 12px; font-weight: 700;
    padding: 0 12px; cursor: pointer; height: 34px;
}
.ecom-add:disabled { opacity: .4; cursor: not-allowed; }

.ecom-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px; }

.ecom-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 55;
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
    border: 0; border-radius: 999px; background: var(--c30); color: #fff; font-weight: 700; font-size: 13px;
    box-shadow: 0 12px 28px rgba(22,20,31,.28); cursor: pointer;
}
.ecom-scrim {
    position: fixed; inset: 0; background: rgba(15,14,20,.4); z-index: 70;
}
.ecom-sheet {
    position: fixed; top: 0; right: 0; width: min(340px, 100vw); height: 100vh; background: #fff;
    z-index: 80; display: flex; flex-direction: column; transform: translateX(105%);
    transition: transform .2s ease; box-shadow: -10px 0 30px rgba(0,0,0,.12);
}
.ecom-sheet.is-open { transform: none; }
.ecom-sheet-head {
    display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}
.ecom-sheet-head button {
    border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted);
}
.ecom-sheet-body { flex: 1; overflow: auto; padding: 6px 10px; }
.ecom-line {
    display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 8px; align-items: center;
    padding: 10px 4px; border-bottom: 1px solid #f1f0f5;
}
.ecom-line-info { min-width: 0; }
.ecom-line-info strong {
    display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ecom-line-info span { font-size: 11px; color: var(--muted); }
.ecom-line-sum { font-size: 12px; font-weight: 800; white-space: nowrap; }
.ecom-x {
    border: 0; background: transparent; color: #94a3b8; font-size: 18px; cursor: pointer; line-height: 1;
}
.ecom-sheet-foot {
    border-top: 1px solid var(--line); padding: 12px 14px; display: grid; gap: 8px;
}
.ecom-total { display: flex; justify-content: space-between; font-size: 14px; }
.ecom-checkout { width: 100%; justify-content: center; height: 42px; }

@media (max-width: 720px) {
    .ecom-bar { position: static; }
    .ecom-search { width: 100%; }
    .ecom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .ecom-poster { min-height: 150px; padding: 18px; }
    .ecom-fab { right: 12px; bottom: 12px; }
}


/* Full order detail page */
.order-page { max-width: 1200px; }
.order-page-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.order-page-summary div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
}
.order-page-summary span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 2px;
}
.order-page-summary strong {
    font-size: 13px;
    font-weight: 800;
}
.order-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 14px;
    align-items: start;
}
.order-page-main { display: grid; gap: 14px; min-width: 0; }
.order-page-aside { position: sticky; top: 72px; }
.order-page-card { overflow: hidden; }
.order-page-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}
.order-page-card-head strong { font-size: 15px; font-weight: 800; }
.order-page-card-body { padding: 12px 16px 16px; }
.order-page-card-body .order-timeline-item { margin-left: 6px; }
@media (max-width: 960px) {
    .order-page-layout { grid-template-columns: 1fr; }
    .order-page-aside { position: static; }
}



/* Invoice live preview (screen) */
.invoice-preview-wrap {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #eef2f7;
}
.invoice-preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.invoice-preview-toolbar strong { font-size: 14px; font-weight: 800; }
.invoice-preview-sheet {
    padding: 18px 14px 22px;
    overflow: auto;
}
.invoice-preview-sheet .inv-doc {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    padding: 22px 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    font-size: 12px;
    line-height: 1.45;
    color: #0f172a;
}
.inv-doc-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 14px;
    margin-bottom: 18px;
}
.inv-doc-head-right { text-align: right; }
.inv-doc-brand { font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.inv-doc-muted { color: #64748b; }
.inv-doc-title { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.inv-doc-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #e2e8f0;
    color: #334155;
}
.inv-doc-badge-paid { background: #dcfce7; color: #166534; }
.inv-doc-badge-partial { background: #fef3c7; color: #92400e; }
.inv-doc-badge-issued { background: #e0e7ff; color: #3730a3; }
.inv-doc-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}
.inv-doc-meta-col-right { text-align: right; }
.inv-doc-meta-col h4 {
    margin: 0 0 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
}
.inv-doc-meta-col strong { font-size: 14px; }
.inv-doc-lines {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.inv-doc-lines th, .inv-doc-lines td {
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 6px;
    text-align: left;
}
.inv-doc-lines th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    background: #f8fafc;
}
.inv-doc-lines td.num, .inv-doc-lines th.num { text-align: right; }
.inv-doc-totals {
    width: 280px;
    margin-left: auto;
    margin-bottom: 20px;
}
.inv-doc-totals tr td { padding: 4px 0; }
.inv-doc-totals tr td:last-child { text-align: right; font-weight: 600; }
.inv-doc-totals .grand td {
    border-top: 2px solid #0f172a;
    padding-top: 8px;
    font-size: 14px;
    font-weight: 800;
}
.inv-doc-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin: 18px 0 8px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}
.inv-doc-stamp { font-size: 11px; margin-top: 2px; }
.inv-doc-footer {
    margin-top: 28px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 10px;
    color: #64748b;
}
.inv-doc-notes {
    margin-top: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
}
@media (max-width: 720px) {
    .inv-doc-meta { grid-template-columns: 1fr; }
    .inv-doc-meta-col-right { text-align: left; }
    .invoice-preview-sheet .inv-doc { padding: 16px; }
}



.invoice-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow: auto;
}
.invoice-preview-modal-panel {
    width: min(920px, 100%);
    margin: 12px auto 40px;
    background: #eef2f7;
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}
.invoice-preview-modal .invoice-preview-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
}



.order-settlement {
    border: 1px solid #fde68a;
    background: #fffbeb;
    border-radius: 8px;
    padding: 6px 8px 8px;
    margin-bottom: 10px;
}
.order-settlement.is-partial {
    border-color: #fcd34d;
    background: #fffbeb;
}
.order-settlement.is-settled {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.order-settlement-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    align-items: baseline;
}
.order-settlement-head strong { font-size: 12px; font-weight: 800; }
.order-settlement-head span { font-size: 11px; font-weight: 650; color: #92400e; }
.order-settlement.is-settled .order-settlement-head span { color: #166534; }
.order-settlement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 5px;
}
.order-settlement-grid > div {
    background: #fff;
    border: 1px solid #f3e8c8;
    border-radius: 6px;
    padding: 5px 7px;
}
.order-settlement-grid span {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    line-height: 1.2;
}
.order-settlement-grid strong {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}
.order-settlement-rest {
    border-color: #f59e0b !important;
    background: #fff7ed !important;
}
.order-settlement-rest strong { color: #b45309; font-size: 14px; }
.order-settlement-rest em {
    display: block;
    margin-top: 1px;
    font-style: normal;
    font-size: 10px;
    color: #92400e;
    line-height: 1.25;
}
.order-settlement.is-settled .order-settlement-rest {
    border-color: #86efac !important;
    background: #ecfdf5 !important;
}
.order-settlement.is-settled .order-settlement-rest strong { color: #15803d; }
.order-settlement.is-settled .order-settlement-rest em { color: #166534; }
.order-settlement-mini {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 8px;
}
.order-settlement-mini div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 6px;
}
.order-settlement-mini span {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}
.order-settlement-mini strong { font-size: 12px; font-weight: 800; }
.order-settlement-mini .is-rest {
    border-color: #f59e0b;
    background: #fff7ed;
}
.order-settlement-mini .is-rest strong { color: #b45309; }
.inv-doc-settlement {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
}
.inv-doc-settlement div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}
.inv-doc-settlement span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
}
.inv-doc-settlement strong { font-size: 14px; font-weight: 800; }
.inv-doc-settlement .is-rest {
    background: #fff7ed;
    border-color: #fcd34d;
}
.inv-doc-settlement .is-rest strong { color: #b45309; }
.inv-doc-ack {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
}



.pay-due-panel {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 12px;
}
.pay-due-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}
.pay-due-grid > div {
    background: #fff;
    border: 1px solid #f3e8c8;
    border-radius: 8px;
    padding: 8px 10px;
}
.pay-due-grid span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.pay-due-grid strong {
    font-size: 15px;
    font-weight: 800;
}
.pay-due-rest {
    border-color: #f59e0b !important;
    background: #fff7ed !important;
}
.pay-due-rest strong { color: #b45309; font-size: 18px; }
.pay-due-rest em {
    display: block;
    margin-top: 2px;
    font-style: normal;
    font-size: 11px;
    color: #92400e;
}
.pay-due-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}



.pay-create-page {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}
.pay-create-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.pay-create-card {
    padding: 14px 16px;
}
.pay-create-form {
    display: grid;
    gap: 10px;
}
.pay-create-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.pay-create-form .field { margin: 0; }
.pay-create-form .label { margin-bottom: 4px; font-size: 12px; }
.pay-create-form .input,
.pay-create-form .select { height: 36px; }
.pay-create-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 2px;
}
.pay-verify-row {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}
.pay-create-page .pay-due-panel { margin: 0; padding: 8px 10px; }
.pay-create-page .pay-due-grid { gap: 6px; }
.pay-create-page .pay-due-grid > div { padding: 6px 8px; }
.pay-create-page .pay-due-grid strong { font-size: 14px; }
.pay-create-page .pay-due-rest strong { font-size: 16px; }
.pay-create-page .pay-due-actions { margin-top: 8px; }
@media (max-width: 640px) {
    .pay-create-row { grid-template-columns: 1fr; }
}



.invoice-preview-sheet .inv-doc { padding: 16px 18px; font-size: 12px; }
.inv-doc-band { height: 4px; background: #4f46e5; margin: -16px -18px 12px; border-radius: 10px 10px 0 0; }
.inv-doc-number { font-weight: 800; margin-bottom: 4px; }
.inv-doc-info { width: 100%; margin-bottom: 10px; }
.inv-doc-info-bill, .inv-doc-info-meta { vertical-align: top; width: 50%; }
.inv-doc-info-meta { text-align: right; }
.inv-doc-meta-table { margin-left: auto; }
.inv-doc-meta-table td { padding: 2px 0 2px 8px; font-size: 12px; }
.inv-doc-meta-table td:first-child { color: var(--muted); font-weight: 700; text-align: right; padding-right: 8px; }
.inv-doc-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.inv-doc-strong { font-size: 14px; font-weight: 800; }
.inv-doc-settle { width: 100%; border-collapse: separate; border-spacing: 6px 0; margin: 0 0 8px; }
.inv-doc-settle td { width: 33%; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; vertical-align: top; }
.inv-doc-settle span { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.inv-doc-settle strong { font-size: 14px; font-weight: 800; }
.inv-doc-settle .is-rest { background: #fff7ed; border-color: #fcd34d; }
.inv-doc-settle .is-rest strong { color: #b45309; }
.inv-doc-bottom { width: 100%; margin-top: 8px; }
.inv-doc-pay-col { width: 60%; vertical-align: top; padding-right: 12px; }
.inv-doc-tot-col { width: 40%; vertical-align: top; }
.inv-doc-pay { width: 100%; border-collapse: collapse; }
.inv-doc-pay th, .inv-doc-pay td { border-bottom: 1px solid var(--line); padding: 6px 4px; font-size: 12px; text-align: left; }
.inv-doc-pay th { font-size: 10px; text-transform: uppercase; color: var(--muted); background: #f8fafc; }
.inv-doc-totals { width: 100%; border-collapse: collapse; background: transparent; border: 0; border-radius: 0; }
.inv-doc-totals td { padding: 4px 0; }
.inv-doc-totals .grand td { border-top: 2px solid #0f172a; font-weight: 800; font-size: 14px; padding-top: 6px; }
.inv-doc-totals .bal td { color: #b45309; font-weight: 800; }
.inv-doc-totals .num, .inv-doc-pay .num { text-align: right; }
.center { text-align: center; }



.notif-item.is-unread {
    background: #fffbeb;
}
.notif-panel-foot {
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}
.notif-history-row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f3f8;
}
.notif-history-row.is-unread { background: #fffbeb; }
.notif-history-stamp {
    display: grid;
    gap: 1px;
    font-size: 11px;
    line-height: 1.25;
}
.notif-history-day {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text);
}
.notif-history-date { font-weight: 650; }
.notif-history-time { color: var(--muted); }
.notif-history-title {
    font-weight: 750;
    font-size: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
@media (max-width: 720px) {
    .notif-history-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* Roles & permissions — full-page */
.rbac-shell {
    width: 100%;
    max-width: none;
}
.rbac-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.rbac-alert {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
}
.rbac-alert--error {
    background: #fee2e2;
    color: #b91c1c;
}
.rbac-alert ul {
    margin: 0;
    padding-left: 18px;
}
.rbac-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.rbac-field--grow { min-width: 0; }
.rbac-field--preset { min-width: 0; }
.rbac-hint { margin: 6px 0 0; font-size: 12px; }
.rbac-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    padding-bottom: 2px;
}
.rbac-summary__count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-right: 4px;
}
.rbac-summary__btn { padding: 7px 10px; font-size: 12px; }
.rbac-templates__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 10px;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.rbac-templates__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.rbac-template {
    text-align: left;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.rbac-template:hover {
    border-color: #c7d2fe;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}
.rbac-template.is-active {
    border-color: #4f46e5;
    background: #eef2ff;
}
.rbac-template strong {
    font-size: 13px;
    color: var(--text);
}
.rbac-template span {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}
.rbac-template em {
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    color: #4f46e5;
    margin-top: 4px;
}
.rbac-modules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.rbac-module {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.rbac-module.is-on { border-color: #a7f3d0; }
.rbac-module.is-partial { border-color: #c7d2fe; }
.rbac-module__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}
.rbac-module__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: capitalize;
    margin: 0;
}
.rbac-module__meta {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}
.rbac-module__body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 12px;
}
.rbac-perm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    background: #f8f9fd;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
}
.rbac-perm.is-checked {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #312e81;
}
.rbac-perm--readonly {
    cursor: default;
}
.rbac-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(248,250,252,0), var(--page) 28%);
    padding-bottom: 4px;
    z-index: 2;
}
.rbac-index {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.rbac-role-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 160px;
}
.rbac-role-card__top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}
.rbac-role-card h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 750;
}
.rbac-role-card__stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 11px;
    font-weight: 650;
    color: var(--muted);
    white-space: nowrap;
}
.rbac-role-card__desc {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    flex: 1;
}
.rbac-role-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}
.rbac-user__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 14px;
}
.rbac-user__profile,
.rbac-user__roles,
.rbac-user__effective,
.rbac-user__overrides {
    padding: 18px;
}
.rbac-role-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.rbac-role-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
}
.rbac-role-chip.is-on {
    background: #eef2ff;
    border-color: #a5b4fc;
}
.rbac-role-chip strong { font-size: 13px; }
.rbac-role-chip span { font-size: 11px; color: var(--muted); }
.rbac-role-chip input { position: absolute; opacity: 0; pointer-events: none; }

@media (max-width: 980px) {
    .rbac-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .rbac-summary { justify-content: flex-start; }
    .rbac-user__layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .rbac-modules { grid-template-columns: 1fr; }
    .rbac-templates__grid { grid-template-columns: 1fr; }
}

/* Commission pipeline */
.commission-pipeline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.commission-pipe {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.commission-pipe__label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.commission-pipe strong {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.commission-pipe em {
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
}
.commission-pipe.is-accrued { border-color: #c7d2fe; background: #f8faff; }
.commission-pipe.is-approved { border-color: #fde68a; background: #fffbeb; }
.commission-pipe.is-paid { border-color: #bbf7d0; background: #f0fdf4; }
@media (max-width: 720px) {
    .commission-pipeline { grid-template-columns: 1fr; }
}

/* Audit log */
.audit-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.audit-stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.audit-stat__label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.audit-stat strong {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}
.audit-stat em {
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
}
.audit-filters {
    padding: 14px 16px;
    margin-bottom: 14px;
}
.audit-filters__form {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, 0.9fr)) repeat(2, 148px) auto;
    gap: 10px 12px;
    align-items: end;
}
.audit-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.audit-field .input,
.audit-field .select {
    width: 100%;
}
.audit-field--date {
    max-width: 148px;
}
.audit-filters__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 1px;
    white-space: nowrap;
}
.audit-live-hint {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 4px 8px;
}
@media (max-width: 1100px) {
    .audit-filters__form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .audit-field--search {
        grid-column: 1 / -1;
    }
    .audit-field--date {
        max-width: none;
    }
    .audit-filters__actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}
@media (max-width: 640px) {
    .audit-filters__form {
        grid-template-columns: 1fr;
    }
}
.audit-table-card {
    overflow: hidden;
}
.audit-table-wrap {
    overflow-x: auto;
}
.audit-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}
.audit-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    white-space: nowrap;
}
.audit-row td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.audit-row:hover td {
    background: #fafbff;
}
.audit-row.is-open td {
    background: #f8fafc;
    border-bottom-color: transparent;
}
.audit-col-when { width: 118px; }
.audit-col-actor { width: 200px; }
.audit-col-event { width: 180px; }
.audit-col-meta { width: 120px; }
.audit-col-more { width: 88px; text-align: right; }
.audit-stamp {
    display: grid;
    gap: 1px;
    line-height: 1.25;
}
.audit-stamp__day {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text);
}
.audit-stamp__date {
    font-size: 13px;
    font-weight: 700;
}
.audit-stamp__time {
    font-size: 12px;
    color: var(--muted);
}
.audit-actor {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.audit-actor__avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}
.audit-actor__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.audit-actor__email {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
    word-break: break-all;
}
.audit-event {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}
.audit-chip {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1.2;
}
.audit-chip--module {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}
.audit-chip--success {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}
.audit-chip--danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.audit-chip--info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.audit-chip--warn {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}
.audit-chip--neutral {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}
.audit-desc {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}
.audit-entity {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 650;
    color: var(--muted);
}
.audit-change-hint {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
}
.audit-meta {
    display: grid;
    gap: 3px;
}
.audit-meta__ip {
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.audit-meta__ua {
    font-size: 11px;
    color: var(--muted);
}
.audit-more-btn {
    padding: 6px 10px;
    font-size: 12px;
}
.audit-detail-row td {
    padding: 0 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}
.audit-detail {
    display: grid;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.audit-detail__title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.audit-changes {
    display: grid;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.audit-changes__head,
.audit-changes__row {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) 1fr 1fr;
    gap: 0;
    background: #fff;
}
.audit-changes__head {
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
}
.audit-changes__head span,
.audit-changes__row span {
    padding: 8px 10px;
    font-size: 12px;
    border-right: 1px solid var(--line);
}
.audit-changes__head span:last-child,
.audit-changes__row span:last-child {
    border-right: 0;
}
.audit-changes__key {
    font-weight: 700;
    text-transform: capitalize;
    background: #fafafa;
}
.audit-changes__old {
    color: #b91c1c;
    background: #fff7f7;
    word-break: break-word;
}
.audit-changes__new {
    color: #047857;
    background: #f3fdf7;
    word-break: break-word;
    font-weight: 650;
}
.audit-ua {
    display: block;
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted);
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    white-space: normal;
    word-break: break-all;
}
.audit-empty {
    padding: 40px 20px !important;
    text-align: center;
}
.audit-empty strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}
.audit-empty span {
    font-size: 13px;
    color: var(--muted);
}
.audit-pagination {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
}
@media (max-width: 980px) {
    .audit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .audit-stats { grid-template-columns: 1fr; }
    .audit-changes__head,
    .audit-changes__row {
        grid-template-columns: 1fr;
    }
    .audit-changes__head span,
    .audit-changes__row span {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}




/* Settings overview */
.settings-list { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 12px 16px; margin: 0; font-size: 13px; }
.settings-list dt { color: var(--muted, #64748b); font-weight: 500; }
.settings-list dd { margin: 0; font-weight: 600; }
.settings-list dd .link { margin-left: 8px; font-weight: 600; }
.settings-list code { font-size: 12px; background: #f1f5f9; padding: 1px 5px; border-radius: 5px; }
@media (max-width: 560px) { .settings-list { grid-template-columns: 1fr; gap: 4px; } .settings-list dd { margin-bottom: 8px; } }

/* Field activity */
.fa-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fa-seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.fa-seg a { padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.fa-seg a:hover { color: var(--text); background: #f6f5fb; }
.fa-seg a.active { background: var(--c10); color: #fff; }
.fa-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.fa-stat { position: relative; overflow: hidden; padding: 14px 16px; text-decoration: none; color: inherit; display: block; border-top: 3px solid var(--fa); }
.fa-stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 84px; height: 84px; border-radius: 50%; background: var(--fa-soft); }
.fa-stat-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.fa-stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; color: var(--fa-ink); position: relative; z-index: 1; }
.fa-stat-meta { font-size: 11.5px; color: var(--muted); position: relative; z-index: 1; }
a.fa-stat:hover { box-shadow: 0 10px 24px -14px rgba(46,16,101,.35); }
.fa-violet { --fa: #7C3AED; --fa-soft: #F1EAFE; --fa-ink: #5B21B6; }
.fa-blue { --fa: #2563EB; --fa-soft: #E6EEFE; --fa-ink: #1D4ED8; }
.fa-green { --fa: #059669; --fa-soft: #E3F7EF; --fa-ink: #047857; }
.fa-amber { --fa: #D97706; --fa-soft: #FEF1DC; --fa-ink: #B45309; }
.fa-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fa-table td.num, .fa-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fa-table tr.fa-selected td { background: #f7f3ff; }
.fa-bar-cell { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.fa-bar-cell b { min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.fa-bar { flex: 1; height: 7px; border-radius: 99px; background: #efedf6; overflow: hidden; min-width: 80px; }
.fa-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8B5CF6, #6366F1); }
.fa-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-left: 4px; white-space: nowrap; }
.fa-pill.good { background: #E3F7EF; color: #047857; }
.fa-pill.mid { background: #FEF1DC; color: #B45309; }
.fa-pill.low { background: #FDE8E8; color: #B91C1C; }
.fa-added { font-size: 11.5px; color: #B45309; margin-top: 2px; }
.fa-added b { font-weight: 600; }
@media (max-width: 900px) { .fa-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Admin ? Website editor */
.web-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.web-tabs a { padding: 9px 14px; font-weight: 600; font-size: 13px; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.web-tabs a:hover { color: var(--brand); }
.web-tabs a.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.web-intro { margin: 0 0 14px; font-size: 13px; }
.web-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.web-fieldset:disabled { opacity: .75; }
.web-group { padding: 18px 20px; margin-bottom: 14px; }
.web-group .section-title { margin-bottom: 14px; }
.web-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.web-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.web-field.is-wide { grid-column: 1 / -1; }
.web-field .input, .web-field .textarea, .web-field .select { width: 100%; }
.web-help { font-size: 12px; }
.web-error { font-size: 12px; color: #b91c1c; font-weight: 600; }
.web-req { color: #b91c1c; }
.web-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.web-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.web-toggle-track { width: 38px; height: 22px; border-radius: 999px; background: #cbd5e1; position: relative; flex: 0 0 auto; transition: background .15s; }
.web-toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.web-toggle input:checked + .web-toggle-track { background: var(--brand); }
.web-toggle input:checked + .web-toggle-track::after { transform: translateX(16px); }
.web-toggle input:focus-visible + .web-toggle-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.web-image { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.web-image-preview { width: 220px; height: 130px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #f8fafc; }
.web-image-preview.is-logo { width: 96px; height: 96px; object-fit: contain; padding: 8px; }
.web-image-preview.is-empty { display: grid; place-items: center; color: #94a3b8; font-size: 12px; }
.web-image-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 220px; }
.web-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.web-list, .web-items { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.web-list-row { display: flex; gap: 8px; width: 100%; max-width: 560px; }
.web-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); width: 100%; align-items: stretch; }
.web-items > .btn, .web-items > .web-help { align-self: center; justify-self: start; }
.web-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fafbff; display: flex; flex-direction: column; gap: 8px; }
.web-item-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #64748b; }
.web-item-tools { display: flex; gap: 2px; }
.web-item-tools .btn { padding: 2px 8px; min-height: 0; height: 26px; }
.web-item-body { display: flex; flex-direction: column; gap: 6px; }
.web-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center; padding: 12px 16px; margin: 0 -4px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.web-savebar .web-reset { margin-left: auto; color: #b91c1c; }
@media (max-width: 900px) { .web-fields { grid-template-columns: 1fr; } }
