/*
 * Clean, classic light theme layer. Loaded last, so it restyles every existing component (cards, tables, buttons,
 * forms, badges, tabs, popups) and adds the dashboard pieces: KPI tiles, chart panels, chips, side drawers.
 * Palette: white workspace, hairline borders, dark ink sidebar and buttons, brand gold as the accent.
 */

/* ------------------------------------------------------------ cards + tiles */
.card,
.panel {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card { padding: 22px; }
.card > h3 { margin-top: 0; }

.stat-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }

.stat-card {
    position: relative;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

a.stat-card:hover, .stat-card:hover { border-color: rgba(212, 175, 55, 0.6); background: #fffdf5; }
.stat-card .label { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--color-text-muted); }
.stat-card .value { margin-top: 4px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .value.is-demo { font-size: 15px; font-weight: 500; }
.stat-card .sub { margin-top: 6px; }

/* ------------------------------------------------------------ buttons */
.btn {
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--gold-gradient); color: var(--on-gold); box-shadow: var(--shadow-glow); }
.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1b2740; }

.btn-ghost { background: #fff; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-ghost:hover { border-color: var(--color-gold); color: var(--gold-text); background: #fffdf5; }

.btn-danger { background: #fff; color: var(--color-danger); border: 1px solid #f3c5c5; }
.btn-danger:hover { background: #fdeeee; }
.btn-success { background: #fff; color: var(--color-success); border: 1px solid #b7e1cd; }
.btn-success:hover { background: #ecf8f2; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; }
.btn:focus-visible, a:focus-visible, .seg a:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }

/* ------------------------------------------------------------ forms */
.form-field label { color: var(--color-text-muted); font-size: 13px; font-weight: 500; }

.form-field input,
.form-field select,
.form-field textarea,
.modal select,
textarea,
.orders-filter-bar input[type="search"],
.orders-filter-bar input[type="date"],
.orders-filter-bar select,
.bulk-bar select {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text);
    padding: 10px 13px;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
textarea:focus,
.orders-filter-bar input:focus,
.orders-filter-bar select:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.16);
}

input::placeholder, textarea::placeholder { color: #a0a7b6; }
.form-error { background: #fdeeee; color: #b42318; border: 1px solid #f3c5c5; border-radius: 10px; }

.orders-filter-bar { flex-wrap: wrap; gap: 10px; padding: 0; margin-bottom: 0; background: none; border: 0; }
.card:has(> .orders-filter-bar) { padding: 16px; margin-bottom: 16px; }

/* ------------------------------------------------------------ tables */
.card:has(> .data-table) { padding: 8px 12px 12px; }

.data-table { border-collapse: separate; border-spacing: 0; }

.data-table th {
    background: none;
    border-bottom: 1px solid var(--color-border);
    padding: 12px 12px;
    color: var(--color-text-muted);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.data-table td { padding: 13px 12px; border-bottom: 1px solid var(--color-border-soft); }
.data-table tbody tr { transition: background 0.1s ease; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table a { color: var(--color-text); font-weight: 600; text-decoration: none; }
.data-table a:hover { color: var(--gold-text); }
.data-table a.btn { font-weight: 600; }
.data-table a.btn-primary { color: var(--on-gold); }
.data-table a.btn:hover { color: inherit; }
.data-table a.btn-ghost:hover { color: var(--gold-text); }
.data-table input[type="checkbox"], .check-all { accent-color: var(--ink); width: 15px; height: 15px; }
.product-thumb { width: 42px; height: 42px; border-radius: 9px; border: 1px solid var(--color-border-soft); background: var(--color-surface-raised); }
.pagination { padding: 14px 0 4px; }
.empty-state { color: var(--color-text-muted); }

/* ------------------------------------------------------------ badges: quiet tinted pills */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-role { background: var(--color-gold-soft); color: var(--gold-text); }
.badge-role::before { display: none; }
.badge[class*="badge-status-"] { background: #f0f2f5; color: #566074; }

.badge.badge-status-pending, .badge.badge-status-awaiting_assignment, .badge.badge-status-new { background: #fdf3d8; color: #915f0a; }
.badge.badge-status-confirmed, .badge.badge-status-shipped, .badge.badge-status-processing, .badge.badge-status-packing,
.badge.badge-status-accepted, .badge.badge-status-picked_up, .badge.badge-status-in_transit, .badge.badge-status-assigned, .badge.badge-status-arrived { background: #e4edfd; color: #1f56c4; }
.badge.badge-status-completed, .badge.badge-status-delivered, .badge.badge-status-active, .badge.badge-status-approved,
.badge.badge-status-published, .badge.badge-status-ready, .badge.badge-status-paid, .badge.badge-status-success { background: #e2f5eb; color: #1a7a4f; }
.badge.badge-status-cancelled, .badge.badge-status-failed, .badge.badge-status-returned, .badge.badge-status-rejected,
.badge.badge-status-suspended, .badge.badge-status-inactive { background: #fde8e8; color: #b42318; }
.badge.badge-status-refunded, .badge.badge-status-out_for_delivery { background: var(--color-gold-soft); color: var(--gold-text); }

/* ------------------------------------------------------------ tabs + filter chips */
.tabs {
    display: flex;
    gap: 4px;
    padding: 0;
    margin-bottom: 20px;
    background: none;
    border: 0;
    border-radius: 0;
    overflow-x: auto;
}

.tabs a { padding: 7px 13px; border: 0; margin: 0; border-radius: 8px; color: var(--color-text-muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { background: var(--color-surface-raised); color: var(--color-text); }
.tabs a.active { background: #eceef2; color: var(--color-text); font-weight: 700; box-shadow: none; }

.seg { display: inline-flex; gap: 6px; padding: 0; background: none; border: 0; }

.seg a {
    padding: 6px 13px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: #fff;
    color: var(--color-text);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.seg a:hover { border-color: #b9bfcc; }
.seg a.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ------------------------------------------------------------ misc */
.callout { background: #fffaeb; border: 1px solid #f0e2b0; border-radius: 12px; }
.callout.danger { background: #fdeeee; border-color: #f3c5c5; }
.bulk-bar { background: var(--ink); border: 0; border-radius: 12px; color: #fff; }
.bulk-bar .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.bulk-bar select { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.timeline .step { padding: 5px 12px; background: #f0f2f5; color: var(--color-text-muted); }
.timeline .step.done { background: #e2f5eb; color: #1a7a4f; }
.timeline .step.current { background: var(--color-gold-soft); color: var(--gold-text); }
.section-title { color: var(--color-text-muted); }
.nav-badge { background: var(--gold-gradient); color: var(--on-gold); border-radius: 999px; }
.bar { height: 7px; background: #eceef2; }
.bar > span { background: var(--gold-gradient); border-radius: 999px; }
.kv { border-bottom-color: var(--color-border-soft); }
.stars { color: var(--color-gold); }
code, .setup-required code { background: #f0f2f5; color: #384152; }
.setup-required { border-color: #f0e2b0; background: #fffdf5; }
.setup-required h3 { color: var(--color-warning); }
.step-list li::before { background: #d5d9e2; }
.step-list li.current { color: var(--gold-text); }
.step-list li.current::before { background: var(--color-gold); box-shadow: 0 0 0 4px var(--color-gold-soft); }
.live-dot { background: var(--color-success); }
.order-sidebar h3, .order-detail-grid > .card h3 { color: var(--color-text-muted); font-size: 12px; }
.ok { color: var(--color-success); }
.warn { color: var(--color-warning); }
.bad { color: var(--color-danger); }

/* ------------------------------------------------------------ dashboard */
.page-header .head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header .head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }

.kpi {
    position: relative;
    padding: 20px 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface-raised);
}

.kpi-top { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }

.kpi-ico {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--tone, var(--c-gold));
}

.kpi-label { color: var(--color-text-muted); font-size: 13px; font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-sub { margin-top: 8px; display: flex; align-items: center; gap: 8px; color: var(--color-text-muted); font-size: 12px; }

.delta { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.delta.up { background: #e2f5eb; color: #1a7a4f; }
.delta.down { background: #fde8e8; color: #b42318; }
.delta.flat { background: #eceef2; color: #566074; }

.dash-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.dash-grid.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-grid.g-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid.g-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel { padding: 20px 22px; min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text); }
.panel-head .sub { margin-top: 4px; }
.panel-head a.sub { color: var(--gold-text); font-weight: 600; text-decoration: none; }
.panel-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; display: flex; align-items: center; gap: 10px; }
.panel-note { margin-top: 12px; font-size: 12px; color: var(--color-text-muted); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--color-text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--dot, var(--c-gold)); }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: #eceef2; stroke-width: 1; }
.chart .axis { fill: #8a92a5; font-size: 11px; font-family: var(--font-sans); }
.chart .dot { transition: r 0.1s; }
.chart .dot:hover { r: 6; }
.chart .bar-rect { transition: opacity 0.1s; }
.chart .bar-rect:hover { opacity: 0.7; }
.chart-empty { display: grid; place-items: center; min-height: 170px; color: var(--color-text-muted); font-size: 13px; text-align: center; }

.donut-wrap { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: center; }
.donut-wrap svg { width: 100%; height: auto; }
.donut-center-value { fill: var(--color-text); font-size: 22px; font-weight: 700; font-family: var(--font-sans); }
.donut-center-label { fill: #8a92a5; font-size: 9.5px; font-family: var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; }
.legend-list { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.legend-list div { display: flex; align-items: center; gap: 9px; }
.legend-list i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 2px; background: var(--dot, var(--c-gold)); }
.legend-list b { margin-left: auto; font-weight: 600; }
.legend-list span { color: var(--color-text-muted); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rank-list { display: flex; flex-direction: column; gap: 14px; }
.rank-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.rank-item .thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--color-surface-raised); border: 1px solid var(--color-border-soft); }
.rank-item .thumb.blank { display: grid; place-items: center; color: var(--color-text-muted); }
.rank-item .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .meta { font-size: 12px; color: var(--color-text-muted); }
.rank-item .amount { font-size: 13px; font-weight: 700; text-align: right; }
.rank-item .bar { margin-top: 6px; height: 4px; }

.hbar-list { display: flex; flex-direction: column; gap: 16px; }
.hbar .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 7px; }
.hbar .row span:last-child { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.hbar .track { height: 7px; border-radius: 999px; background: #eceef2; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 999px; background: var(--fill, var(--gold-gradient)); }

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; background: #fffaeb; border: 1px solid #f3e6b8; text-decoration: none; font-size: 13px; transition: background 0.1s; }
.alert-item:hover { background: #fff4d2; }
.alert-item .ico { color: var(--color-warning); }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mini-stat { padding: 14px 16px; border-radius: 12px; background: var(--color-surface-raised); }
.mini-stat .k { font-size: 12px; color: var(--color-text-muted); }
.mini-stat .v { margin-top: 5px; font-size: 20px; font-weight: 700; }

@media (max-width: 1100px) {
    .dash-grid.g-main, .dash-grid.g-three, .dash-grid.g-two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .donut-wrap { grid-template-columns: minmax(0, 1fr); }
    .donut-wrap svg { max-width: 190px; margin: 0 auto; }
}

/* ------------------------------------------------------------ popups: side drawer + centred dialog */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
    background: rgba(15, 21, 34, 0.4);
    animation: fade-in 0.15s ease;
}

.modal-backdrop.is-center { justify-content: center; align-items: center; padding: 16px; }

.modal {
    display: flex;
    flex-direction: column;
    width: min(540px, 100%);
    max-width: none;
    height: 100%;
    max-height: none;
    padding: 0;
    overflow: hidden;
    background: #fff;
    color: var(--color-text);
    border: 0;
    border-radius: 0;
    box-shadow: var(--shadow-pop);
    animation: slide-in 0.22s ease;
}

.modal.is-center { width: min(440px, 100%); height: auto; max-height: 90vh; border-radius: 16px; animation: pop-in 0.16s ease; }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 30px 6px; }
.modal-head .head-btns { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.modal h2 { margin: 6px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--color-text); }
.modal.is-center h2 { font-size: 20px; }
.modal.is-center .modal-head { padding: 22px 24px 0; }

.modal-x {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}

.modal-x:hover { background: var(--color-surface-raised); }
.modal-body { flex: 1; padding: 10px 30px 26px; overflow-y: auto; }
.modal.is-center .modal-body { padding: 8px 24px 6px; flex: 0 1 auto; }
.modal p { margin: 0 0 12px; color: var(--color-text-muted); font-size: 14px; line-height: 1.55; }
.modal .form-field { margin-bottom: 16px; }
.modal .form-field input, .modal .form-field textarea, .modal .form-field select { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0; padding: 16px 30px; border-top: 1px solid var(--color-border-soft); background: #fff; }
.modal.is-center .modal-actions { padding: 18px 24px 22px; border-top: 0; }

/* Quick-view content inside a drawer */
.qv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.qv-actions .btn { padding: 8px 14px; }
.qv-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; color: var(--color-text-muted); font-size: 13px; }
.qv-section { margin-top: 26px; }
.qv-section h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; text-transform: none; color: var(--color-text); }
.qv-section h3 small { color: var(--color-text-muted); font-size: 15px; font-weight: 500; }
.qv-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--color-border-soft); }
.qv-item .tile { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: var(--color-surface-raised); color: #9aa1b2; overflow: hidden; }
.qv-item .tile img { width: 100%; height: 100%; object-fit: cover; }
.qv-item .name { font-size: 14px; line-height: 1.35; }
.qv-item .sub { margin-top: 2px; }
.qv-item .price { font-size: 14px; font-weight: 600; text-align: right; white-space: nowrap; }
.qv-item .price small { color: var(--color-text-muted); font-weight: 500; margin-right: 6px; }
.qv-total { display: flex; justify-content: space-between; padding: 16px 0 4px; font-size: 14px; }
.qv-total b { font-size: 16px; }
.qv-kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px 16px; font-size: 14px; }
.qv-kv dt { color: var(--color-text-muted); }
.qv-kv dd { margin: 0; overflow-wrap: anywhere; }
.qv-hero { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 20px; align-items: start; }
.qv-hero .tile { display: grid; place-items: center; width: 132px; height: 132px; border-radius: 12px; background: var(--color-surface-raised); overflow: hidden; }
.qv-hero .tile img { width: 100%; height: 100%; object-fit: cover; }
.qv-loading { padding: 40px 0; color: var(--color-text-muted); text-align: center; }

/* Toasts */
.toast { background: var(--ink); color: #fff; border: 0; border-left: 4px solid var(--color-success); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 21, 34, 0.25); }
.toast.error { border-left-color: var(--color-danger); }
.toast.info { border-left-color: var(--color-gold); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(28px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 600px) {
    .modal-head { padding: 20px 20px 4px; }
    .modal-body { padding: 8px 20px 20px; }
    .modal-actions { padding: 14px 20px; }
    .qv-hero { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ sign-in: split card */
.auth-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(620px 520px at 8% 8%, #f8f6f0, transparent 70%),
        radial-gradient(700px 500px at 96% 70%, #ececef, transparent 70%),
        #eeeeef;
}

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    width: min(1120px, 100%);
    min-height: 640px;
    overflow: hidden;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 40px 90px rgba(30, 34, 45, 0.16);
}

.auth-visual {
    position: relative;
    min-height: 320px;
    background: #2a2118 url('/assets/img/login-cover.jpg') center / cover no-repeat;
}

.auth-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 14, 6, 0.05) 45%, rgba(20, 14, 6, 0.78));
}

.auth-visual .auth-logo {
    position: absolute;
    left: 40px;
    bottom: 36px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.auth-visual .auth-logo small { display: block; margin-top: 3px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.75); }

.auth-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 56px 44px 0 44px;
}

.auth-panel h1 { margin: 40px 0 12px; font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.auth-panel .auth-sub { margin: 0 0 24px; max-width: 380px; color: #8a90a0; font-size: 15px; line-height: 1.55; }

.portal-choice { display: inline-flex; gap: 8px; margin: 0 0 16px; }
.portal-option span { display: block; padding: 8px 18px; border: 1px solid var(--color-border); border-radius: 999px; background: #fff; text-align: center; font-size: 13.5px; cursor: pointer; }
.portal-option span strong { display: inline; font-size: 13.5px; font-weight: 600; }
.portal-option span small { display: none; }
.portal-option:hover span { border-color: #b9bfcc; }
.portal-option input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; box-shadow: none; }

.auth-field { position: relative; display: block; margin-bottom: 14px; padding: 12px 18px 12px; border-radius: 16px; background: #f6f6f7; transition: box-shadow 0.12s, background 0.12s; }
.auth-field:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--color-gold); }
.auth-field label { display: block; margin: 0 0 3px; color: #9aa0ae; font-size: 14px; font-weight: 400; }
.auth-field input { width: 100%; padding: 2px 0; border: 0; background: transparent; color: var(--color-text); font-size: 16px; }
.auth-field input:focus { outline: none; box-shadow: none; }
.auth-field .eye { position: absolute; right: 16px; bottom: 14px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #6b7385; cursor: pointer; }
.auth-field .eye:hover { background: #ececef; }

.auth-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: auto -44px 0 0; }
.auth-foot .hint { padding: 0 0 34px; color: #8a90a0; font-size: 14px; line-height: 1.5; }
.auth-foot .hint strong { display: block; color: var(--color-text); font-weight: 600; }

.auth-submit {
    flex: 0 0 auto;
    width: 250px;
    height: 100px;
    border: 0;
    border-top-left-radius: 26px;
    background: var(--gold-gradient);
    color: var(--on-gold);
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.12s;
}

.auth-submit:hover { filter: brightness(1.05); }
.auth-submit[disabled] { opacity: 0.6; cursor: wait; }
.auth-panel .form-error { margin-bottom: 14px; }
.auth-panel form.auth-form { display: flex; flex-direction: column; flex: 1; }

@media (max-width: 860px) {
    .auth-split { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 24px; }
    .auth-visual { min-height: 200px; }
    .auth-visual .auth-logo { left: 24px; bottom: 22px; }
    .auth-panel { padding: 28px 24px 0; }
    .auth-panel h1 { margin-top: 0; font-size: 32px; }
    .auth-foot { margin-right: -24px; }
    .auth-submit { width: 200px; height: 84px; font-size: 20px; }
}

/* ------------------------------------------------------------ print stays plain */
@media print {
    .page-header, .page-header::before { background: none !important; box-shadow: none !important; border: 0 !important; }
    .page-header h1::before { display: none; }
    body, .main { background: #fff !important; }
    .modal-backdrop { display: none !important; }
}

/* ------------------------------------------------------------ live tracking map */
.track-map { height: 320px; border-radius: 12px; border: 1px solid var(--color-border); margin-bottom: 12px; z-index: 0; }
.track-facts { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.track-map.map-off, .map-page-map.map-off { display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 13px; color: #6b7280; background: #f6f5f1; }
.track-pin { width: 0; height: 0; }
.track-pin span { display: block; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.track-pin b { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border-radius: 6px; background: #fff; font-size: 11px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

/* ------------------------------------------------------------ vendor fulfilment */
.fulfil-now { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--color-text); }
.fulfil-step { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.fulfil-step .sub { flex-basis: 100%; }
.fulfil-wait { flex-basis: 100%; margin: 0; font-weight: 600; }
.fulfil-done { margin: 10px 0 2px; color: var(--color-success); font-weight: 700; }
.fulfil-live { margin: 12px 0 0; }
.btn-disabled, .btn-disabled[disabled] { background: #eceef2; color: #8a92a5; border: 1px solid #e0e3ea; box-shadow: none; opacity: 1; cursor: not-allowed; }
.stage-label { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #f0f2f5; color: #566074; font-size: 12px; font-weight: 600; white-space: nowrap; }
.stage-ready, .stage-rider_assigned { background: #fdf3d8; color: #915f0a; }
.stage-act { background: var(--color-gold); color: var(--on-gold); }
.stage-picked_up, .stage-in_transit, .stage-arrived { background: #e4edfd; color: #1f56c4; }
.stage-delivered, .stage-completed { background: #e2f5eb; color: #1a7a4f; }
.stage-cancelled, .stage-failed { background: #fde8e8; color: #b42318; }

/* Maps: place search in forms, store map pictures, the full-screen point map */
.place-lookup { margin-top: 6px; }
.place-results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.place-result { text-align: left; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.place-result:hover, .place-result:focus-visible { border-color: var(--color-gold); background: #fffbea; }
.store-map { display: inline-flex; flex-direction: column; gap: 4px; font-size: 12px; }
.store-map img { display: block; width: 160px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--color-border); background: #f6f5f1; }
.map-page { margin: 0; height: 100vh; font-family: var(--font-sans, system-ui, sans-serif); display: flex; flex-direction: column; }
.map-page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--color-border); background: #fff; }
.map-page-map { flex: 1; min-height: 0; }
