/* ==========================================================================
   OPIDO Partner – design system
   Built on Bootstrap 5.3. Brand: navy (#1B3A6B) + orange accent (#F28C28).
   ========================================================================== */

:root {
    --brand: #1B3A6B;
    --brand-700: #142C52;
    --brand-600: #1F4580;
    --brand-100: #DCE6F5;
    --brand-50: #EEF3FB;
    --accent: #F28C28;
    --accent-600: #D9731A;
    --accent-50: #FFF4E8;

    --bg: #F4F6FA;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --border: #E4E8EF;
    --border-strong: #CFD6E1;

    --text: #0F1B2D;
    --text-2: #4A5568;
    --muted: #8A94A6;

    --success: #12805C;  --success-bg: #E6F6EE;
    --warning: #B45309;  --warning-bg: #FEF3E2;
    --danger:  #C81E1E;  --danger-bg:  #FDECEC;
    --info:    #1D6FD8;  --info-bg:    #E8F1FD;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06);
    --shadow: 0 1px 3px rgba(15, 27, 45, .06), 0 6px 16px rgba(15, 27, 45, .05);
    --shadow-lg: 0 12px 40px rgba(15, 27, 45, .14);

    --sidebar-w: 264px;
    --topbar-h: 68px;

    /* Bootstrap bridges */
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--border);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 27, 58, 107;
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 31, 69, 128;
    --bs-link-hover-color: var(--brand);
    --bs-focus-ring-color: rgba(27, 58, 107, .18);
}

* { -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--bs-body-font-family);
    font-size: 14px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    font-feature-settings: 'cv11', 'ss01';
}
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 650; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted-x { color: var(--muted) !important; }
.text-2 { color: var(--text-2) !important; }
.fw-650 { font-weight: 650; }
.fw-500 { font-weight: 500; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn { font-weight: 550; font-size: 14px; border-radius: var(--radius-sm); padding: .55rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn-sm { padding: .35rem .7rem; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: .75rem 1.25rem; font-size: 15px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700); --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent-600); --bs-btn-hover-border-color: var(--accent-600); --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--accent-600); --bs-btn-active-border-color: var(--accent-600); }
.btn-light-x { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.btn-light-x:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; }
.btn-ghost-danger { color: var(--danger); background: transparent; border: 1px solid transparent; }
.btn-ghost-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-ghost { color: var(--text-2); background: transparent; border: 1px solid transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Forms ---------- */
.form-label { font-weight: 550; font-size: 13px; color: var(--text); margin-bottom: .4rem; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control, .form-select {
    font-size: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
    padding: .6rem .8rem; color: var(--text); background-color: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #A0A9B8; }
.form-control:focus, .form-select:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(27, 58, 107, .10); }
.form-control[readonly] { background: var(--surface-2); color: var(--text-2); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: .35rem; }
.field-error { display: block; font-size: 12.5px; color: var(--danger); margin-top: .35rem; }
.field-error:empty { display: none; }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-2); font-size: 14px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }
.input-icon > .form-control { padding-left: 2.5rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(27, 58, 107, .10); }

/* ---------- App shell ---------- */
.app-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
    background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; transition: transform .25s ease;
}
.app-sidebar__brand { height: var(--topbar-h); display: flex; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.app-sidebar__brand img { height: 38px; width: auto; }
.app-sidebar__brand .tag { margin-left: 10px; font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-600); background: var(--accent-50); padding: 3px 7px; border-radius: 6px; }
.app-sidebar__nav { flex: 1; overflow-y: auto; padding: 14px 14px 24px; }
.nav-section { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.nav-item-x {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 1px 0;
    border-radius: 9px; color: var(--text-2); font-weight: 520; font-size: 14px;
    transition: background-color .15s, color .15s;
}
.nav-item-x i { font-size: 17px; width: 20px; text-align: center; color: var(--muted); transition: color .15s; }
.nav-item-x:hover { background: var(--surface-2); color: var(--text); }
.nav-item-x:hover i { color: var(--text-2); }
.nav-item-x.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.nav-item-x.active i { color: var(--brand); }
.nav-item-x.disabled { cursor: default; opacity: .6; }
.nav-item-x.disabled:hover { background: transparent; color: var(--text-2); }
.nav-item-x .soon { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }
.app-sidebar__footer { padding: 14px; border-top: 1px solid var(--border); }
.help-card { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%); color: #fff; border-radius: var(--radius); padding: 14px 16px; font-size: 13px; }
.help-card strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.help-card span { color: rgba(255,255,255,.75); }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar {
    position: sticky; top: 0; z-index: 1030; height: var(--topbar-h);
    background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 28px;
}
.app-topbar__title { font-size: 17px; font-weight: 650; margin: 0; }
.app-topbar__crumb { font-size: 14px; color: var(--muted); display: flex; align-items: center; }
.app-topbar__crumb a:hover { color: var(--text) !important; }
.app-topbar .toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.user-chip:hover { border-color: var(--border-strong); color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; background: var(--brand); color: #fff; flex-shrink: 0; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.user-chip .name { font-weight: 600; font-size: 13.5px; line-height: 1.1; }
.user-chip .role { font-size: 11.5px; color: var(--muted); line-height: 1.1; }
.dropdown-menu { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; font-size: 14px; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; color: var(--text-2); }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item.text-danger:hover { background: var(--danger-bg); }

.app-content { padding: 28px; flex: 1; }
.app-footer { padding: 18px 28px; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.sidebar-open .app-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 27, 45, .45); z-index: 1035; }
    .app-main { margin-left: 0; }
    .app-topbar { padding: 0 16px; }
    .app-topbar .toggle { display: inline-flex; }
    .app-content { padding: 20px 16px; }
    .app-footer { padding: 16px; }
    .user-chip .meta { display: none !important; }
    .app-topbar__crumb > a, .app-topbar__crumb > i { display: none; }
    .user-chip { padding: 3px; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; margin: 0 0 4px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--text-2); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-x + .card-x { margin-top: 24px; }
.card-x__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-x__head h2, .card-x__head h3 { font-size: 16px; margin: 0; font-weight: 650; }
.card-x__head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.card-x__body { padding: 22px; }
.card-x__foot { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.section-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); font-size: 17px; flex-shrink: 0; }

/* ---------- Stat tiles ---------- */
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px; height: 100%; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px;
}
.stat__top { display: flex; align-items: center; justify-content: space-between; }
.stat__label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.stat__icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.stat__sub { font-size: 12.5px; color: var(--muted); }
.tone-brand { background: var(--brand-50); color: var(--brand); }
.tone-accent { background: var(--accent-50); color: var(--accent-600); }
.tone-success { background: var(--success-bg); color: var(--success); }
.tone-warning { background: var(--warning-bg); color: var(--warning); }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; border: 0; line-height: 1.4; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
button.pill, a.pill { cursor: pointer; transition: filter .15s; }
button.pill:hover, a.pill:hover { filter: brightness(.96); }

/* ---------- Tables ---------- */
.table-x { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table-x thead th {
    font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    background: var(--surface-2); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left;
}
.table-x tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr { transition: background-color .12s; }
.table-x tbody tr:hover { background: #FAFBFD; }
.table-x .primary-cell { color: var(--text); font-weight: 600; }
.table-x .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-x thead th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.thumb { width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-missing { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--surface-2); font-size: 20px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.order-items { list-style: none; margin: 0; padding: 0; min-width: 200px; }
.order-items li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.order-items li + li { border-top: 1px dashed var(--border); }
.order-items .qty { color: var(--muted); font-size: 12px; }
.order-items .price { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Toolbar above tables */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .search { min-width: 240px; }
@media (max-width: 575.98px) { .toolbar .search { min-width: 0; flex: 1; } }

/* Pagination */
.pagination { gap: 4px; margin: 0; }
.page-link { border-radius: 8px !important; border: 1px solid var(--border); color: var(--text-2); font-size: 13px; min-width: 34px; text-align: center; padding: .4rem .7rem; }
.page-link:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-item.disabled .page-link { color: var(--border-strong); background: var(--surface); }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pagination-bar nav p.small.text-muted { display: none; }
.pagination-bar nav .pagination { margin: 0; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 56px 24px; }
.empty__icon { width: 64px; height: 64px; border-radius: 18px; background: var(--brand-50); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 16px; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 18px; }

/* ---------- Upload tiles ---------- */
.dropzone-x {
    position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
    padding: 26px 18px; text-align: center; transition: border-color .15s, background-color .15s; cursor: pointer;
}
.dropzone-x:hover, .dropzone-x.is-drag { border-color: var(--brand-600); background: var(--brand-50); }
.dropzone-x input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-x .icon { font-size: 26px; color: var(--brand); }
.dropzone-x .title { font-weight: 600; margin-top: 6px; color: var(--text); }
.dropzone-x .hint { font-size: 12.5px; color: var(--muted); }
.dropzone-x .files { margin-top: 8px; font-size: 12.5px; color: var(--brand); font-weight: 550; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; margin-top: 14px; }
.preview-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }

.image-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); height: 100%; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.image-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.image-card__media { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; overflow: hidden; }
.image-card__media img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.image-card__badge { position: absolute; top: 10px; left: 10px; background: rgba(15, 27, 45, .72); color: #fff; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.image-card__body { padding: 14px; border-top: 1px solid var(--border); }

/* ---------- Price summary ---------- */
.price-summary { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.price-summary .row-x { display: flex; justify-content: space-between; padding: 4px 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.price-summary .total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; color: var(--text); font-weight: 700; font-size: 17px; }

/* ---------- Sticky form actions ---------- */
.form-actions { position: sticky; bottom: 0; z-index: 5; margin-top: 24px; padding: 14px 18px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Modals ---------- */
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 17px; font-weight: 650; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-backdrop.show { opacity: .45; }

/* ---------- Stepper (delivery tracking) ---------- */
.stepper { display: flex; margin: 4px 0 24px; }
.stepper .step { flex: 1; text-align: center; position: relative; }
.stepper .step::before { content: ''; position: absolute; top: 17px; left: -50%; right: 50%; height: 2px; background: var(--border); }
.stepper .step:first-child::before { display: none; }
.stepper .step.done::before { background: var(--brand); }
.stepper .dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 2px solid var(--border); color: var(--muted); font-size: 16px; }
.stepper .step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stepper .step.done .label { color: var(--text); }
.timeline-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; height: 100%; background: var(--surface); }
.timeline-card h6 { font-size: 14px; font-weight: 650; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { color: var(--text); margin: 0; word-break: break-word; }

/* ---------- Chart ---------- */
.bar-chart { position: relative; padding-left: 30px; }
.bar-chart .plot { position: relative; height: 250px; }
.bar-chart .chart-empty { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.seg__btn { border: 0; background: transparent; color: var(--text-2); font-weight: 550; font-size: 13px; padding: 6px 12px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; }
.seg__btn:hover { color: var(--text); }
.seg__btn.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.seg__count { font-size: 11.5px; background: var(--border); color: var(--text-2); border-radius: 999px; padding: 0 7px; font-variant-numeric: tabular-nums; }
.seg__btn.active .seg__count { background: var(--brand-50); color: var(--brand); }
.bar-chart .gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.bar-chart .gl.base { border-top-color: var(--border-strong); }
.bar-chart .gl span { position: absolute; left: -30px; width: 22px; text-align: right; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-chart .cols, .bar-chart .xlabels { display: grid; grid-template-columns: repeat(var(--n, 14), minmax(0, 1fr)); gap: 2px; }
.bar-chart .cols { position: absolute; inset: 0; align-items: end; }
.bar-chart .bcol { height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 6px 6px 0 0; transition: background-color .12s; }
.bar-chart .bcol:hover, .bar-chart .bcol:focus-visible { background: rgba(27, 58, 107, .05); outline: none; }
.bar-chart .bar { width: min(26px, 62%); background: var(--brand); border-radius: 4px 4px 0 0; transition: background-color .12s; }
.bar-chart .bcol:hover .bar, .bar-chart .bcol:focus-visible .bar { background: var(--brand-600); }
.bar-chart .bcol.today .bar { background: var(--accent); }
.bar-chart .xlabels { margin-top: 8px; font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.bar-chart .xlabels .today { color: var(--accent-600); font-weight: 650; }
@media (max-width: 575.98px) { .bar-chart .xlabels span:nth-child(even) { visibility: hidden; } }
.chart-tip { position: absolute; pointer-events: none; background: var(--text); color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; opacity: 0; transition: opacity .1s; box-shadow: var(--shadow); }
.chart-tip strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-tip.show { opacity: 1; }

/* ---------- Toasts (flash messages) ---------- */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.toast-x { display: flex; align-items: flex-start; gap: 10px; min-width: 300px; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 14px 14px 16px; animation: toast-in .25s ease; }
.toast-x i.lead-icon { font-size: 18px; margin-top: 1px; }
.toast-x .msg { flex: 1; font-size: 13.5px; color: var(--text); font-weight: 500; }
.toast-x .x { background: none; border: 0; color: var(--muted); padding: 0 2px; font-size: 16px; line-height: 1; }
.toast-x.success { border-left-color: var(--success); } .toast-x.success i.lead-icon { color: var(--success); }
.toast-x.error { border-left-color: var(--danger); } .toast-x.error i.lead-icon { color: var(--danger); }
.toast-x.info { border-left-color: var(--info); } .toast-x.info i.lead-icon { color: var(--info); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Alerts ---------- */
.alert-x { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; border: 1px solid; }
.alert-x i { font-size: 18px; }
.alert-x.warning { background: var(--warning-bg); border-color: #F8D9AE; color: #7A3D06; }
.alert-x.danger { background: var(--danger-bg); border-color: #F6C6C6; color: #8F1515; }
.alert-x.info { background: var(--info-bg); border-color: #C6DBF8; color: #164E9A; }

/* ---------- KYC docs ---------- */
.doc-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.doc-card__media { aspect-ratio: 16 / 10; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.doc-card__media img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.doc-card__body { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.doc-card__body .label { font-size: 12px; color: var(--muted); font-weight: 550; text-transform: uppercase; letter-spacing: .05em; }
.doc-card__body .value { font-weight: 650; letter-spacing: .04em; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth__aside {
    position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(1000px 420px at -10% 115%, rgba(242, 140, 40, .22), transparent 60%),
                radial-gradient(900px 500px at 110% -10%, rgba(255, 255, 255, .10), transparent 60%),
                linear-gradient(160deg, var(--brand-600) 0%, var(--brand) 45%, var(--brand-700) 100%);
}
.auth__aside::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 60%); pointer-events: none; }
.auth__aside > * { position: relative; z-index: 1; }
.auth__logo { display: inline-flex; background: #fff; padding: 8px 12px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.auth__logo img { height: 36px; }
.auth__headline { font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; color: #fff; max-width: 460px; margin-bottom: 16px; }
.auth__lead { color: rgba(255,255,255,.78); font-size: 15.5px; max-width: 440px; }
.auth__features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.auth__features li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,.9); }
.auth__features i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.12); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; color: #FFC58A; }
.auth__features strong { display: block; color: #fff; font-weight: 600; }
.auth__features span { font-size: 13px; color: rgba(255,255,255,.7); }
.auth__copy { font-size: 12.5px; color: rgba(255,255,255,.6); }
.auth__main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--bg); }
.auth__card { width: 100%; max-width: 440px; }
.auth__card h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.auth__card .sub { color: var(--text-2); margin-bottom: 28px; }
.auth__panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.auth__mobile-logo { display: none; margin-bottom: 24px; }
.auth__mobile-logo img { height: 40px; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 20px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px 8px; }
.pw-toggle:hover { color: var(--text); }
@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; }
    .auth__aside { display: none; }
    .auth__mobile-logo { display: block; }
    .auth__main { padding: 32px 16px; align-items: flex-start; }
    .auth__panel { padding: 22px; }
}

.success-mark { width: 76px; height: 76px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: inline-flex; align-items: center; justify-content: center; font-size: 38px; margin-bottom: 20px; box-shadow: 0 0 0 10px rgba(18, 128, 92, .06); }

/* CKEditor polish */
.cke_notification_warning { display: none !important; }
.cke_chrome { border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important; overflow: hidden; box-shadow: none !important; }
.cke_top { background: var(--surface-2) !important; border-bottom: 1px solid var(--border) !important; }
.cke_bottom { background: var(--surface-2) !important; border-top: 1px solid var(--border) !important; }

/* SweetAlert2 polish */
.swal2-popup { border-radius: var(--radius-lg) !important; font-family: var(--bs-body-font-family) !important; }
.swal2-title { font-size: 20px !important; color: var(--text) !important; }
.swal2-html-container { color: var(--text-2) !important; font-size: 14px !important; }
.swal2-styled { border-radius: var(--radius-sm) !important; font-weight: 550 !important; font-size: 14px !important; padding: .6rem 1.2rem !important; }
.swal2-styled.swal2-confirm { background: var(--brand) !important; }
.swal2-styled.swal2-confirm.is-danger { background: var(--danger) !important; }
.swal2-styled.swal2-cancel { background: var(--surface) !important; color: var(--text-2) !important; border: 1px solid var(--border-strong) !important; }
.swal2-styled:focus { box-shadow: 0 0 0 4px rgba(27, 58, 107, .15) !important; }
