/*
 * theme.css — the portal's look (loaded LAST, after app.css / kit.css / compact.css): the same warm jewellery feel as the
 * phone app (ivory page, ruby red, gold accents), softer cards, clearer tables and tabs, and each page's own colour
 * (Nav.php `color`, given to the page as --page) as its accent. Only looks: no sizes that a screen's layout depends on
 * (the billing grid, the print pages) are changed here.
 */
:root {
    --brand: #c0294f;
    --brand-dark: #93183a;
    --brand-soft: #fdf0f3;
    --gold: #b8860b;
    --gold-2: #d9a930;
    --gold-soft: #fbf3df;
    --ink: #1f1a17;
    --ink-2: #463d36;
    --muted: #82766b;
    --line: #ece4d8;
    --line-2: #f3ede3;
    --bg: #f7f3ec;
    --card: #ffffff;
    --side: #241219;
    --side-2: #3a1c28;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(70, 45, 20, .05), 0 6px 18px -8px rgba(70, 45, 20, .14);
    --shadow-lift: 0 2px 4px rgba(70, 45, 20, .06), 0 14px 28px -12px rgba(70, 45, 20, .26);
    --ring: 0 0 0 3px rgba(192, 41, 79, .16);
    --page: var(--brand);
}

body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
.has-shell { background:
    radial-gradient(900px 420px at 100% -10%, rgba(217, 169, 48, .10), transparent 60%),
    radial-gradient(700px 380px at 0% 0%, rgba(192, 41, 79, .05), transparent 60%),
    var(--bg) fixed; }
::selection { background: rgba(192, 41, 79, .18); }
.t, .kv-row strong, .stat strong, .hero strong, .rate-cell strong { font-variant-numeric: tabular-nums; }

/* ── sidebar: deep plum with gold accents ── */
.sidebar { background: linear-gradient(180deg, #2b1520 0%, #1d0e15 100%); color: #e8dcd5; box-shadow: 1px 0 0 rgba(255, 255, 255, .04), 4px 0 24px -12px rgba(0, 0, 0, .5); }
.sidebar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-2), var(--brand)); }
.brand img { background: #fff; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5); }
.menu { scrollbar-color: #4a2a37 transparent; }
.menu-top, .menu-group-head { color: #eadfd8; border-radius: 10px; }
.menu-top svg, .menu-group-head svg { color: #d9b56a; opacity: 1; }
.menu-top:hover, .menu-group-head:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.menu-top.is-active { background: linear-gradient(90deg, rgba(217, 169, 48, .22), rgba(217, 169, 48, .04)); color: #fff; border-left-color: var(--gold-2); }
.menu-group-body { border-left-color: rgba(217, 169, 48, .22); }
.menu-group-body .menu-item { color: #c4b2ab; }
.menu-group-body .menu-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.menu-group-body .menu-item.is-active { color: #fff; background: rgba(217, 169, 48, .16); box-shadow: inset 2px 0 0 var(--gold-2); }
.menu-group:has(.menu-item.is-active) .menu-group-head { color: #fff; }
.menu-group.is-admin .menu-group-head { color: #f1c75b; }
.is-collapsed .menu-section, .is-collapsed .menu-group { border-color: rgba(255, 255, 255, .08); }
.sidebar-foot { border-top-color: rgba(255, 255, 255, .08); }
.avatar { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }

/* ── top bar: white glass with a hairline ── */
.topbar { background: rgba(255, 253, 250, .82); border-bottom: 1px solid rgba(236, 228, 216, .9); box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 6px 18px -14px rgba(70, 45, 20, .35); }
.topbar-title { color: var(--ink); letter-spacing: -.01em; }
.mod-ico { border-radius: 8px; box-shadow: 0 3px 8px -3px var(--m, #6b7280); }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--line); }
.live-dot { border-radius: 999px; }

/* ── page heading: the page's colour as a small accent bar ── */
.page-head { position: relative; padding: 4px 0 12px 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-head::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 16px; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--page), color-mix(in srgb, var(--page) 45%, var(--gold-2))); }
.page-head h1 { font-size: 21px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
.page-head p.muted, .page-head .muted { color: var(--muted); }
.hello h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.hello h1::after { content: " \2728"; font-size: .8em; }
.section-title, .set-label { color: var(--ink-2); letter-spacing: -.005em; }
.set-label { display: flex; align-items: center; gap: 8px; text-transform: uppercase; font-size: 11.5px; letter-spacing: .09em; color: var(--gold); }
.set-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ── buttons ── */
.btn { border-radius: 10px; border-color: var(--line); box-shadow: 0 1px 1px rgba(70, 45, 20, .04); transition: border-color .15s, background .15s, box-shadow .15s, transform .08s; }
.btn:hover { border-color: #d9cdbb; background: #fffdf9; }
.btn:focus-visible, .chip:focus-visible, .set-card:focus-visible, .quick-item:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: linear-gradient(180deg, #d0335b, var(--brand) 55%, #a8213f); border-color: #a8213f; color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 14px -6px rgba(192, 41, 79, .55); }
.btn-primary:hover { background: linear-gradient(180deg, #c42c52, var(--brand-dark)); border-color: var(--brand-dark); }
.btn-ok { background: linear-gradient(180deg, #1f9a52, #15803d); border-color: #15803d; box-shadow: 0 6px 14px -6px rgba(21, 128, 61, .5); }
.btn-danger { background: #fff; }
.btn-soft { background: var(--brand-soft); border-color: #f5c7d3; }
.link-btn { color: var(--brand); }

/* ── fields ── */
.field input, .field select, .field textarea, .search input, .toolbar select, .toolbar input[type=date], .cf input, .cf select { border-color: #ddd2c2; background-color: #fffefc; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus, .toolbar select:focus, .toolbar input[type=date]:focus { border-color: var(--brand); box-shadow: var(--ring); background-color: #fff; }
.field > span { color: var(--ink-2); }
.search input { border-radius: 999px; }

/* ── tabs / filter chips: one rounded strip ── */
.chips { gap: 6px; }
.chip { border-radius: 999px; border-color: var(--line); background: #fffdf9; color: var(--ink-2); font-weight: 650; }
.chip:hover { border-color: color-mix(in srgb, var(--page) 55%, #fff); color: color-mix(in srgb, var(--page) 85%, #000); background: #fff; }
.chip.is-on { background: linear-gradient(180deg, color-mix(in srgb, var(--page) 88%, #fff), var(--page)); border-color: var(--page); color: #fff; box-shadow: 0 6px 14px -8px var(--page); }
.chip.is-on b { background: rgba(255, 255, 255, .25); color: #fff; }
.tabs { background: #efe8dc; border-radius: 999px; }
.tab { border-radius: 999px; }
.tab.is-on { color: var(--page); }

/* ── cards and panels ── */
.panel, .card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); }
.panel { overflow: clip; }
.panel-head { background: linear-gradient(180deg, #fffdf9, #fbf7f0); border-bottom-color: var(--line-2); }
.panel-head h2 { display: flex; align-items: center; gap: 8px; font-weight: 750; color: var(--ink); }
.panel-head h2::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 2px; transform: rotate(45deg); background: var(--gold-2); }
.panel-head h2:has(.step-no)::before { display: none; }

/* ── stat tiles: a coloured top line, big figures ── */
.stat { border-radius: var(--radius); background: linear-gradient(180deg, #fff, #fffcf7); }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--page), color-mix(in srgb, var(--page) 30%, var(--gold-2))); opacity: .85; }
.stat-amber::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.stat-teal::before { background: linear-gradient(90deg, #0f766e, #2dd4bf); }
.stat-red::before { background: linear-gradient(90deg, #b91c1c, #f87171); }
.stat-blue::before { background: linear-gradient(90deg, #0e7490, #22d3ee); }
a.stat:hover, .stat:hover { box-shadow: var(--shadow-lift); border-color: #e2d6c4; transform: translateY(-1px); }
.stat { transition: box-shadow .15s, transform .15s, border-color .15s; }
.stat small { font-weight: 650; color: var(--muted); }
.stat strong { color: var(--ink); }
.stat-ico { border-radius: 12px; }

/* ── heroes (big money boxes) ── */
.hero { border-radius: var(--radius); box-shadow: var(--shadow-lift); background-image: linear-gradient(135deg, rgba(255, 255, 255, .14) 0 1px, transparent 1px 100%), linear-gradient(135deg, #b45309, #f59e0b); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%); pointer-events: none; }
.hero.teal { background-image: linear-gradient(135deg, #0f766e, #14b8a6); }
.hero-red { background-image: linear-gradient(135deg, #9f1239, #e11d48); }

/* ── tables ── */
.t th { background: #faf6ef; color: #8c7d6d; border-bottom-color: var(--line); font-size: 10.5px; letter-spacing: .07em; }
.t td { border-bottom-color: var(--line-2); }
.t tbody tr { transition: background .1s; }
.t tbody tr:hover td { background: #fdf8ef; }
.t a.row-link:hover, .t tbody tr:hover a.row-link { color: var(--brand); }
.table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
.t-empty, .empty { color: var(--muted); }
.t-empty::before { content: "\25C7"; display: block; margin: 0 auto 6px; font-size: 22px; color: #d8c7a6; }
.pill { border-radius: 999px; padding-left: 9px; padding-right: 9px; }

/* ── key / value lists ── */
.kv-row { border-bottom-color: var(--line-2); }
.kv-row.total { margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--line); border-bottom: 0; }
.kv-row.total strong { color: var(--brand-dark); }

/* ── home ── */
.quick-item { border-radius: 12px; border-color: var(--line); box-shadow: 0 1px 2px rgba(70, 45, 20, .04); transition: box-shadow .15s, transform .15s, border-color .15s, color .15s; }
.quick-item:hover { border-color: color-mix(in srgb, var(--m, var(--brand)) 45%, #fff); color: var(--ink); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.quick-ico { box-shadow: 0 6px 12px -6px var(--m, var(--brand)); }

/* ── settings tiles ── */
.set-card { border-radius: 14px; border-color: var(--line); transition: box-shadow .15s, transform .15s, border-color .15s; }
.set-card > svg { padding: 7px; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); margin-top: 0; }
a.set-card:hover { border-color: #e9c5cf; box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.set-card b { color: var(--ink); }
.set-card.is-app { background: #faf6ef; }
.set-card.is-app > svg { background: #efe8dc; color: var(--muted); }

/* ── notices, toasts, pop-ups ── */
.notice { border-radius: 12px; }
.toast { border-radius: 12px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45); }
.toast-success { background: linear-gradient(135deg, #15803d, #16a34a); }
.toast-error { background: linear-gradient(135deg, #9f1239, #dc2626); }
.modal { border-radius: 18px; box-shadow: 0 30px 70px -20px rgba(36, 18, 25, .55); }
.modal::backdrop { background: rgba(36, 18, 25, .45); }
.sticky-actions { background: linear-gradient(180deg, transparent, var(--bg) 40%); }
.picker-list, .stock-hits, .bell-panel { border-color: var(--line); border-radius: 12px; box-shadow: 0 20px 40px -16px rgba(70, 45, 20, .35); }

/* ── billing screen: same layout, warmer sections ── */
.step-no { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 3px 6px -2px rgba(192, 41, 79, .6); }
.pos-bar { box-shadow: 0 -10px 24px -16px rgba(70, 45, 20, .4); }

/* ── sign-in page: a jewellery panel even before the pictures load ── */
.login2-art { background:
    radial-gradient(600px 400px at 20% 10%, rgba(217, 169, 48, .35), transparent 60%),
    radial-gradient(500px 500px at 90% 90%, rgba(192, 41, 79, .45), transparent 60%),
    linear-gradient(160deg, #5c1630, #241219); }
.login2-art::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 22px); pointer-events: none; }
.login2-panel { background: radial-gradient(500px 300px at 50% 0%, var(--gold-soft), transparent 70%), #fffdf9; }
.login2-card input { border-color: #e6dccd; }
.login2-card .btn-primary, .login2-card .btn { box-shadow: 0 10px 22px -10px rgba(192, 41, 79, .65); }

@media (max-width: 900px) {
    .toolbar select, .toolbar > *, .chips + select { max-width: 100%; min-width: 0; }
    .page-head { padding-left: 11px; }
    .page-head h1 { font-size: 19px; }
    .hello h1 { font-size: 20px; }
}
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .stat:hover, .quick-item:hover, a.set-card:hover { transform: none; } }
@media print {
    .has-shell { background: #fff; }
    .page-head::before, .stat::before, .hero::after { display: none; }
    .panel, .card, .stat { box-shadow: none; }
}
