/* Koleksi Guru Kreatif: admin look (clean light canvas, blue accent, large rounded cards).
   Applied only when <html class="adm"> is set, so the customer pages are never affected.
   The whole admin is re-themed through its colour tokens; the rules below add structure and the new dashboard. */

/* ============ tokens ============ */
html.adm {
  --bg: #f3f5f9; --surface: #ffffff; --surface-alt: #f3f5f9; --surface-raised: #ffffff;
  --border: #e3e8f0; --border-soft: #e9edf4;
  --text: #0f172a; --text-muted: #64748b; --text-faint: #94a3b8;
  --brand: #2f5bff; --brand-strong: #2447d9; --brand-soft: #eaf0ff;
  --accent: #2f5bff; --accent-strong: #2447d9; --accent-soft: #eaf0ff;
  --success: #16a34a; --success-bg: #e6f6ec; --warning: #d97706; --warning-bg: #fff3df;
  --danger: #dc2626; --danger-bg: #fdeaea; --info: #2563eb; --info-bg: #e8f0ff;
  --sidebar-bg: #ffffff; --sidebar-text: #475569; --sidebar-text-active: #2f5bff;
  --sidebar-active-bg: #eaf0ff; --sidebar-border: #edf0f6;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04); --shadow-md: 0 8px 28px rgba(15, 23, 42, .08); --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 22px;
  --a-green: #22c55e; --a-orange: #f59e0b; --a-ease: cubic-bezier(.2, .8, .2, 1); --a-spring: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: dark) {
  html.adm:not([data-theme="light"]) {
    --bg: #0b1020; --surface: #121a2e; --surface-alt: #18223a; --surface-raised: #16203a;
    --border: #243049; --border-soft: #1d2842; --text: #e8edf7; --text-muted: #9aa7bf; --text-faint: #6b7a96;
    --brand: #5b8cff; --brand-strong: #4a78eb; --brand-soft: #172447; --accent: #5b8cff; --accent-strong: #4a78eb; --accent-soft: #172447;
    --success: #4ade80; --success-bg: rgba(74, 222, 128, .14); --warning: #fbbf24; --warning-bg: rgba(251, 191, 36, .14);
    --danger: #f87171; --danger-bg: rgba(248, 113, 113, .14); --info: #7aa7ff; --info-bg: rgba(122, 167, 255, .14);
    --sidebar-bg: #0f1629; --sidebar-text: #9aa7bf; --sidebar-text-active: #8fb0ff; --sidebar-active-bg: #172447; --sidebar-border: #1b2540;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 8px 28px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  }
}
html.adm[data-theme="dark"] {
  --bg: #0b1020; --surface: #121a2e; --surface-alt: #18223a; --surface-raised: #16203a;
  --border: #243049; --border-soft: #1d2842; --text: #e8edf7; --text-muted: #9aa7bf; --text-faint: #6b7a96;
  --brand: #5b8cff; --brand-strong: #4a78eb; --brand-soft: #172447; --accent: #5b8cff; --accent-strong: #4a78eb; --accent-soft: #172447;
  --success: #4ade80; --success-bg: rgba(74, 222, 128, .14); --warning: #fbbf24; --warning-bg: rgba(251, 191, 36, .14);
  --danger: #f87171; --danger-bg: rgba(248, 113, 113, .14); --info: #7aa7ff; --info-bg: rgba(122, 167, 255, .14);
  --sidebar-bg: #0f1629; --sidebar-text: #9aa7bf; --sidebar-text-active: #8fb0ff; --sidebar-active-bg: #172447; --sidebar-border: #1b2540;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 8px 28px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}
html.adm body { background: var(--bg); }
/* index.html has no doctype (quirks mode), where tables do not inherit text colour. :where() keeps this at zero weight so class colours still win. */
:where(html.adm) table { color: var(--text); }

/* ============ sidebar ============ */
.adm .sidebar { width: 252px; flex-basis: 252px; background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); transition: width .35s var(--a-ease), transform .3s var(--a-ease); }
.adm .main { margin-left: 252px; transition: margin-left .35s var(--a-ease); }
.adm .sb-head { display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px 20px; }
.adm .sb-head .mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: linear-gradient(145deg, #5b8cff, var(--brand-strong)); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 16px; box-shadow: 0 8px 18px -6px rgba(47, 91, 255, .55); }
.adm .sb-head .brand { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--text); white-space: nowrap; }
.adm .sb-head .brand b { color: var(--brand); }
.adm .sb-collapse { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; border: 0; background: none; color: var(--text-faint); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s, transform .35s var(--a-spring); }
.adm .sb-collapse:hover { background: var(--surface-alt); color: var(--text); }
.adm .nav-scroll { padding: 6px 14px 12px; }
.adm .nav-group-label { display: none; }
.adm .nav-item { position: relative; gap: 12px; padding: 11px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; color: var(--sidebar-text); margin-bottom: 2px; transition: background .2s, color .2s, transform .2s var(--a-spring); white-space: nowrap; text-decoration: none; }
.adm .nav-item svg { opacity: .9; width: 18px; height: 18px; transition: transform .3s var(--a-spring); }
.adm .nav-item:hover { background: var(--surface-alt); color: var(--text); }
.adm .nav-item:hover svg { transform: scale(1.12); }
.adm .nav-item:active { transform: scale(.98); }
.adm .nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-text-active); }
.adm .nav-item.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); animation: aPop .4s var(--a-spring); }
@keyframes aPop { from { transform: scaleY(0); } }
.adm .nav-item .nav-badge { background: var(--success-bg); color: var(--success); font-family: var(--font-body); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.adm .nav-sep { height: 1px; background: var(--sidebar-border); margin: 10px 8px; }
.adm .nav-group { margin-bottom: 2px; }
.adm .nav-toggle .chev { margin-left: auto; transition: transform .3s var(--a-ease); }
.adm .nav-group.open .nav-toggle .chev { transform: rotate(180deg); }
.adm .nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--a-ease); }
.adm .nav-group.open .nav-sub { grid-template-rows: 1fr; }
.adm .nav-sub > div { overflow: hidden; margin-left: 24px; border-left: 1.5px solid var(--sidebar-border); padding-left: 8px; }
.adm .nav-item.sub { padding: 9px 14px; font-size: 13.5px; font-weight: 500; }
.adm .sb-bottom { padding: 8px 14px 16px; border-top: 1px solid var(--sidebar-border); }
.adm .sb-share { margin-top: 10px; padding: 18px; border-radius: 20px; color: #fff; background: radial-gradient(160px 100px at 85% -10%, rgba(255, 255, 255, .22), transparent 70%), linear-gradient(150deg, #3b66ff 0%, #1e3fd0 60%, #14238a 100%); position: relative; overflow: hidden; }
.adm .sb-share::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px); background-size: 9px 9px; mask-image: linear-gradient(135deg, transparent 30%, #000); opacity: .6; pointer-events: none; }
.adm .sb-share .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); margin-bottom: 12px; }
.adm .sb-share b { display: block; font-family: var(--font-display); font-size: 15px; }
.adm .sb-share p { margin: 4px 0 14px; font-size: 12px; line-height: 1.45; opacity: .85; word-break: break-all; position: relative; z-index: 1; }
.adm .sb-share button { position: relative; z-index: 1; width: 100%; height: 38px; border: 0; border-radius: 999px; background: #2a52ee; color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); transition: transform .2s var(--a-spring), background .2s; }
.adm .sb-share button:hover { background: #1f43d6; transform: translateY(-1px); }
.adm .sb-share button:active { transform: scale(.97); }
/* collapsed (icon-only) sidebar */
.adm .shell.collapsed .sidebar { width: 78px; flex-basis: 78px; }
.adm .shell.collapsed .main { margin-left: 78px; }
.adm .shell.collapsed .sb-head .brand, .adm .shell.collapsed .nav-item span:not(.nav-badge), .adm .shell.collapsed .nav-toggle .chev, .adm .shell.collapsed .sb-share { display: none; }
.adm .shell.collapsed .sb-head { padding: 20px 0 14px; justify-content: center; flex-direction: column; gap: 12px; }
.adm .shell.collapsed .sb-collapse { margin: 0; transform: rotate(180deg); }
.adm .shell.collapsed .nav-item { justify-content: center; padding: 12px; }
.adm .shell.collapsed .nav-item .nav-badge { position: absolute; top: 2px; right: 4px; padding: 0 6px; font-size: 10px; }
.adm .shell.collapsed .nav-sub > div { margin-left: 0; border: 0; padding: 0; }
.adm .shell.collapsed .nav-item::before { left: -14px; }

.adm .sb-install { margin-top: 10px; padding: 14px 16px; border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); animation: aPopIn .4s var(--a-spring); }
.adm .sb-install[hidden] { display: none; }
.adm .sb-install b { display: block; font-size: 13.5px; color: var(--text); }
.adm .sb-install p { margin: 4px 0 10px; font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.adm .sb-install .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.adm .sb-install button { border: 0; background: var(--brand); color: #fff; border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: 12.5px; cursor: pointer; transition: transform .2s var(--a-spring); }
.adm .sb-install button:hover { transform: translateY(-1px); }
.adm .sb-install a { font-size: 12.5px; font-weight: 600; color: var(--brand); text-decoration: none; }
.adm .shell.collapsed .sb-install { display: none; }

/* ============ top bar ============ */
.adm .topbar { height: 68px; padding: 0 28px; gap: 16px; background: color-mix(in srgb, var(--surface) 90%, transparent); border-bottom: 1px solid var(--border-soft); }
.adm .topbar-title { display: none; }
.adm .search { margin-left: 0; max-width: 380px; }
.adm .search input { height: 42px; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--surface-alt); padding: 0 56px 0 42px; cursor: pointer; transition: border-color .2s, box-shadow .25s; }
.adm .search input:hover { border-color: var(--brand); }
.adm .search svg { left: 16px; top: 14px; }
.adm .search kbd { position: absolute; right: 12px; top: 9px; font-family: var(--font-body); font-size: 11.5px; color: var(--text-faint); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 2px 7px; pointer-events: none; }
.adm .icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-soft); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .25s var(--a-spring), box-shadow .25s, color .2s; }
.adm .icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: var(--surface); }
.adm .icon-btn:active { transform: scale(.92); }
.adm .icon-btn .dot { top: 9px; right: 10px; background: #ef4444; border-color: var(--surface); }
.adm .profile-chip { padding: 0; border-radius: 50%; border: 0; background: none; }
.adm .profile-chip .name { display: none; }
.adm .avatar { width: 42px; height: 42px; font-size: 13px; background: linear-gradient(145deg, #7ea3ff, var(--brand)); color: #fff; box-shadow: var(--shadow-sm); transition: transform .25s var(--a-spring); }
.adm .profile-chip:hover .avatar { transform: scale(1.08); }
.adm .chip-filter.lang-switch { border-radius: 999px; }
.adm .content { padding: 26px 28px 60px; max-width: 1440px; }

/* ============ shared components ============ */
.adm .page-head h1 { font-size: 28px; letter-spacing: -.02em; }
.adm .card { border-radius: var(--radius-lg); border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); transition: box-shadow .3s var(--a-ease), transform .3s var(--a-ease); }
.adm .btn { height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 700; border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .2s var(--a-spring), box-shadow .25s, background .2s, border-color .2s; }
.adm .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.adm .btn:active { transform: scale(.97); }
.adm .btn-primary { background: var(--brand); border-color: var(--brand); box-shadow: 0 10px 22px -8px rgba(47, 91, 255, .55); }
.adm .btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.adm .btn-sm { height: 32px; padding: 0 14px; }
.adm .chip-filter { border-radius: 999px; }
.adm .view.active { animation: aView .45s var(--a-ease) backwards; }
@keyframes aView { from { opacity: 0; transform: translateY(12px); } }
.adm table tbody tr { transition: background .15s; }
.adm .pill { border-radius: 999px; }
.adm input:focus, .adm select:focus, .adm textarea:focus { outline: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); border-color: var(--brand); }

/* ============ dashboard ============ */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head h1 { font-size: 30px; letter-spacing: -.03em; }
.dash-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-range { display: inline-flex; align-items: center; height: 44px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); padding: 0 6px 0 16px; gap: 10px; font-size: 13.5px; font-weight: 600; }
.dash-range svg { color: var(--text-muted); }
.dash-range select { height: 100%; border: 0; border-left: 1px solid var(--border); background: transparent; padding: 0 12px 0 14px; font-size: 13.5px; font-weight: 600; color: var(--text); font-family: inherit; cursor: pointer; border-radius: 0 999px 999px 0; }
.dash-custom { display: inline-flex; gap: 8px; align-items: center; }
.dash-custom[hidden] { display: none; }
.dash-custom input { height: 44px; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--surface); padding: 0 14px; font-size: 13px; color: var(--text); font-family: inherit; }
.dash-ctrl .btn svg { flex: none; }

.dgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.dw { grid-column: span var(--span, 12); background: var(--surface); border: 1px solid var(--border-soft); border-radius: 26px; box-shadow: var(--shadow-sm); padding: 20px 22px; min-width: 0; position: relative; animation: aRise .6s var(--a-ease) backwards; transition: box-shadow .3s var(--a-ease), transform .3s var(--a-ease); }
.dw:hover { box-shadow: var(--shadow-md); }
.dw-s-kpi { background: none; border: 0; box-shadow: none; padding: 0; }
.dw-s-kpi:hover { box-shadow: none; }
@keyframes aRise { from { opacity: 0; transform: translateY(20px) scale(.985); } }
.dw-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; position: relative; }
.dw-hd h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.dw-menu { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--text-faint); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.dw-menu:hover { background: var(--surface-alt); color: var(--text); }
.dw-pop { position: absolute; z-index: 20; top: 38px; right: 0; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); animation: aPopIn .25s var(--a-spring); }
@keyframes aPopIn { from { opacity: 0; transform: translateY(-6px) scale(.95); } }
.dw-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.dw-pop button:hover:not(:disabled) { background: var(--surface-alt); }
.dw-pop button:disabled { opacity: .35; cursor: default; }
.dw-pop button.danger { color: var(--danger); }
.dw-empty { padding: 36px 12px; text-align: center; color: var(--text-faint); font-size: 14px; }
.dw-empty.big { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--border); border-radius: 24px; padding: 60px 20px; }

/* KPI cards */
.dw-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kpi2 { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 24px; padding: 18px 20px 16px; box-shadow: var(--shadow-sm); transition: transform .3s var(--a-spring), box-shadow .3s var(--a-ease); }
.kpi2:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.kp-top { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; }
.kp-top i { color: var(--brand); display: grid; place-items: center; transition: transform .35s var(--a-spring); }
.kpi2:hover .kp-top i { transform: scale(1.2) rotate(-6deg); }
.kp-val { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -.03em; margin: 10px 0 8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kp-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kp-foot small { color: var(--text-faint); font-size: 12px; }
.kpi2.warn .kp-top i { color: var(--warning); }
.kpi2.warn .kp-val { color: var(--warning); }
.dd { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 700; }
.dd.up { background: var(--success-bg); color: var(--success); }
.dd.down { background: var(--danger-bg); color: var(--danger); }
.dd.flat { background: var(--surface-alt); color: var(--text-muted); }
.dd.link { background: none; color: var(--brand); padding: 0; text-decoration: none; }
.dd.link:hover { text-decoration: underline; }

/* Total sales card */
.dw-profit { display: grid; grid-template-columns: minmax(170px, 215px) 1fr; gap: 6px 22px; align-items: end; }
.dw-profit .dw-hd { grid-column: 1 / -1; }
.pf-big { font-family: var(--font-display); font-weight: 800; font-size: 38px; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pf-sub { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pf-sub small { color: var(--text-muted); font-size: 12.5px; }
.pf-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.pf-legend i { display: inline-block; width: 18px; height: 0; margin-right: 8px; vertical-align: middle; border-top: 3px solid var(--brand); border-radius: 3px; }
.pf-legend i.prv { border-top: 2px dashed var(--text-faint); }
.pf-chart { position: relative; height: 200px; cursor: crosshair; }
.pf-chart svg { width: 100%; height: 100%; overflow: visible; }
.pf-chart .axis text { fill: var(--text-faint); font-size: 10.5px; font-family: var(--font-body); }
.pf-chart .axis line.g { stroke: var(--border); stroke-dasharray: 3 4; }
.pf-chart .axis line.base { stroke: var(--border); }
.pf-chart path.cur { stroke: var(--brand); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pf-chart path.prev { stroke: var(--text-faint); stroke-width: 1.6; stroke-dasharray: 4 4; opacity: .7; vector-effect: non-scaling-stroke; }
.pf-chart path.area { animation: aFade 1s ease .4s backwards; }
@keyframes aFade { from { opacity: 0; } }
.pf-chart .cross { stroke: var(--brand); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; transition: opacity .15s; vector-effect: non-scaling-stroke; }
.pf-chart .dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2.5; opacity: 0; transition: opacity .15s; }
.pf-chart.hover .cross, .pf-chart.hover .dot { opacity: 1; }
.pf-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: #0f172a; color: #fff; border-radius: 14px; padding: 10px 14px; font-size: 12px; pointer-events: none; opacity: 0; white-space: nowrap; box-shadow: 0 12px 28px rgba(15, 23, 42, .35); transition: opacity .15s, left .08s linear; z-index: 5; display: flex; flex-direction: column; gap: 2px; }
.pf-tip b { font-size: 12px; opacity: .75; font-weight: 600; }
.pf-tip span { font-size: 16px; font-weight: 800; }
.pf-tip small { opacity: .7; }
.pf-chart.hover .pf-tip { opacity: 1; }
.pf-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 12px; padding: 14px 16px 0; border: 1px solid var(--border-soft); border-radius: 20px; background: linear-gradient(var(--surface), var(--surface-alt)); overflow: hidden; }
.sc { position: relative; padding: 0 0 18px 14px; border-left: 2px solid transparent; }
.sc b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sc span { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.sc span svg { width: 15px; height: 15px; }
.sc u { position: absolute; left: -14px; right: -14px; bottom: 0; height: 7px; border-radius: 8px 8px 0 0; transform-origin: left; animation: aGrow .9s var(--a-ease) .4s backwards; }
.sc u.blue { background: linear-gradient(90deg, #5b8cff, #2f5bff); }
.sc u.green { background: linear-gradient(90deg, #4ade80, #16a34a); }
.sc u.orange { background: linear-gradient(90deg, #fbbf24, #f97316); }
.sc:nth-child(1) { border-left-color: #2f5bff; } .sc:nth-child(2) { border-left-color: #16a34a; } .sc:nth-child(3) { border-left-color: #f97316; }
@keyframes aGrow { from { transform: scaleX(0); } }

/* weekday bars */
.dw-week { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 188px; padding-top: 6px; }
.wd { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.wd em { font-style: normal; font-size: 13px; font-weight: 700; height: 16px; }
.wd .bar { flex: 1; width: 100%; max-width: 42px; display: flex; align-items: flex-end; }
.wd .bar i { display: block; width: 100%; height: var(--h); border-radius: 12px; background: var(--surface-alt); border: 1px solid var(--border-soft); transform-origin: bottom; animation: aBar .8s var(--a-ease) backwards; transition: background .2s, transform .25s var(--a-spring); }
.wd:nth-child(2) .bar i { animation-delay: .05s } .wd:nth-child(3) .bar i { animation-delay: .1s } .wd:nth-child(4) .bar i { animation-delay: .15s } .wd:nth-child(5) .bar i { animation-delay: .2s } .wd:nth-child(6) .bar i { animation-delay: .25s } .wd:nth-child(7) .bar i { animation-delay: .3s }
.wd:hover .bar i { transform: scaleY(1.04); }
.wd.hi .bar i { background: linear-gradient(180deg, #6d95ff, #2f5bff); border-color: transparent; box-shadow: 0 10px 22px -8px rgba(47, 91, 255, .6); }
.wd span { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }
.wd.hi span { color: var(--brand); }
@keyframes aBar { from { transform: scaleY(0); } }

/* best sellers table */
.dw-table { overflow-x: auto; }
.dw-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dw-table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; padding: 4px 8px 12px; border-bottom: 1px solid var(--border-soft); background: none; }
.dw-table th.r, .dw-table td.r { text-align: right; }
.dw-table td { padding: 13px 8px; border-bottom: 1px dashed var(--border); vertical-align: middle; }
.dw-table tbody tr { cursor: pointer; transition: background .15s; }
.dw-table tbody tr:hover { background: var(--surface-alt); }
.dw-table tbody tr:last-child td { border-bottom: 0; }
.dw-table .id { color: var(--text-muted); font-size: 12.5px; }
.nm { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nm .th { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 12px; overflow: hidden; border: 1px solid var(--border-soft); }
.nm .th img { width: 100%; height: 100%; object-fit: cover; }
.nm .tx { font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rv.up { color: var(--success); } .rv.down { color: var(--danger); }
.cf { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--surface-alt); font-weight: 700; font-size: 12.5px; }

/* repeat-customer gauge */
.dw-gauge { position: relative; text-align: center; padding-top: 4px; }
.dw-gauge svg { width: 100%; max-width: 270px; height: auto; }
.dw-gauge line { stroke: var(--border); stroke-width: 5.4; stroke-linecap: round; opacity: 0; animation: aTick .35s ease forwards; animation-delay: var(--d); }
.dw-gauge line.on { stroke: var(--a-green); }
@keyframes aTick { to { opacity: 1; } }
.gv { margin-top: -62px; position: relative; }
.gv b { display: block; font-family: var(--font-display); font-size: 40px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.gv small { color: var(--text-muted); font-size: 12.5px; }
.gbtn { margin-top: 14px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 8px 18px; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; transition: transform .2s var(--a-spring), box-shadow .2s, border-color .2s; }
.gbtn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* recent orders */
.dw-recent { display: flex; flex-direction: column; }
.rr { display: grid; grid-template-columns: 42px minmax(0, 1.6fr) auto auto 110px; align-items: center; gap: 14px; padding: 12px 8px; border: 0; border-bottom: 1px dashed var(--border); background: none; text-align: left; cursor: pointer; border-radius: 12px; font-family: inherit; color: var(--text); transition: background .15s, transform .2s var(--a-ease); }
.rr:last-child { border-bottom: 0; }
.rr:hover { background: var(--surface-alt); transform: translateX(3px); }
.rr .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--brand); background: var(--brand-soft); }
.rr .who { min-width: 0; display: flex; flex-direction: column; }
.rr .who b { font-size: 14px; } .rr .who small { color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr .amt { font-weight: 700; } .rr .ago { color: var(--text-faint); font-size: 12.5px; text-align: right; }

/* ============ widget drawer ============ */
.wdrawer[hidden], .pal[hidden] { display: none; }
.wdrawer { position: fixed; inset: 0; z-index: 120; }
.wd-scrim, .pal-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
.wdrawer.open .wd-scrim, .pal.open .pal-scrim { opacity: 1; }
.wd-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); border-radius: 28px 0 0 28px; padding: 24px; overflow-y: auto; transform: translateX(105%); transition: transform .45s var(--a-ease); }
.wdrawer.open .wd-panel { transform: none; }
.wd-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wd-panel h2 { font-size: 22px; letter-spacing: -.02em; }
.wd-x { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface-alt); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: transform .25s var(--a-spring); }
.wd-x:hover { transform: rotate(90deg); }
.wd-hint { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.wd-list { display: flex; flex-direction: column; gap: 14px; }
.wd-item { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 20px; border: 1px solid var(--border-soft); background: var(--surface); position: relative; transition: transform .25s var(--a-ease), box-shadow .25s, border-color .25s; }
.wd-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.wd-item:not(.on) { border-style: dashed; background: transparent; }
.wd-art { height: 104px; border-radius: 16px; background: var(--surface-alt); display: grid; place-items: center; padding: 10px; overflow: hidden; }
.wd-art svg { width: 100%; height: 100%; }
.pv-bars { display: flex; align-items: flex-end; gap: 6px; height: 100%; width: 80%; } .pv-bars i { flex: 1; border-radius: 6px; background: #dbe2ee; } .pv-bars i.hi { background: #2f5bff; }
.pv-kpi { background: var(--surface); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow-sm); } .pv-kpi b { font-size: 18px; } .pv-kpi s { display: inline-block; width: 22px; height: 7px; border-radius: 4px; background: #22c55e; margin-left: 6px; text-decoration: none; } .pv-kpi small { display: block; color: var(--text-faint); font-size: 10px; }
.pv-table { width: 85%; display: flex; flex-direction: column; gap: 8px; } .pv-table i { height: 12px; border-radius: 6px; background: #dbe2ee; } .pv-table i:nth-child(2) { width: 70%; } .pv-table i:nth-child(3) { width: 85%; }
.wd-body { padding-right: 78px; min-width: 0; }
.wd-body b { font-size: 15px; } .wd-body p { margin: 4px 0 8px; font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
.wd-tag { display: inline-block; font-size: 11.5px; font-weight: 600; background: var(--surface-alt); color: var(--text-muted); padding: 3px 10px; border-radius: 8px; }
.wd-btn { position: absolute; right: 14px; top: 14px; border: 0; background: var(--brand); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: transform .2s var(--a-spring); }
.wd-btn.rem { background: var(--surface-alt); color: var(--text-muted); }
.wd-btn:hover { transform: scale(1.06); } .wd-btn:active { transform: scale(.94); }
.wd-fixed { position: absolute; right: 14px; top: 16px; font-size: 11.5px; color: var(--text-faint); }
.wd-reset { margin-top: 6px; border: 1px dashed var(--border); background: none; border-radius: 16px; padding: 14px; color: var(--text-muted); font-weight: 600; cursor: pointer; transition: color .2s, border-color .2s; }
.wd-reset:hover { color: var(--brand); border-color: var(--brand); }

/* ============ command search ============ */
.pal { position: fixed; inset: 0; z-index: 130; display: grid; place-items: start center; padding-top: 12vh; }
.pal-box { position: relative; width: min(620px, calc(100% - 24px)); background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-lg); overflow: hidden; transform: translateY(-12px) scale(.97); opacity: 0; transition: transform .35s var(--a-spring), opacity .2s; }
.pal.open .pal-box { transform: none; opacity: 1; }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); color: var(--text-faint); }
.pal-in input { flex: 1; border: 0; background: none; font-size: 16px; color: var(--text); font-family: inherit; outline: 0 !important; box-shadow: none !important; }
.pal-in kbd { font-family: inherit; font-size: 11.5px; border: 1px solid var(--border); border-radius: 7px; padding: 2px 7px; color: var(--text-faint); }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.pal-h { padding: 10px 12px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.pal-i { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 11px 12px; border: 0; background: none; border-radius: 14px; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; color: var(--text); font-family: inherit; }
.pal-i small { color: var(--text-faint); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.pal-i.on { background: var(--brand-soft); color: var(--brand); }
.pal-none { padding: 36px; text-align: center; color: var(--text-faint); }

/* ============ responsive ============ */
@media (max-width: 1280px) { .dw-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dw[style*="--span:8"], .dw[style*="--span:4"] { grid-column: span 12; } }
@media (max-width: 900px) {
  .adm .sidebar { transform: translateX(-102%); width: 276px; box-shadow: var(--shadow-lg); }
  .adm .sidebar.open { transform: none; }
  .adm .main, .adm .shell.collapsed .main { margin-left: 0; }
  .adm .shell.collapsed .sidebar { width: 276px; }
  .adm .topbar { padding: 0 14px; gap: 10px; }
  .adm .topbar-menu-btn { display: grid; }
  .adm .content { padding: 18px 14px 60px; }
  .dw-profit { grid-template-columns: 1fr; }
  .pf-chart { height: 170px; }
  .rr { grid-template-columns: 38px minmax(0, 1fr) auto; } .rr .st, .rr .ago { display: none; }
  .dash-head h1 { font-size: 24px; }
}
@media (max-width: 560px) { .dw-kpis { grid-template-columns: 1fr; } .kp-val { font-size: 28px; } .dw { padding: 16px; border-radius: 22px; } .pf-strip { grid-template-columns: 1fr; } .adm .search kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { .adm *, .adm *::before, .adm *::after, .wdrawer *, .pal * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ============ scrollbars and native controls ============
   Without this the browser draws its light default scrollbar, a bright white strip in the dark theme.
   color-scheme makes the browser's own controls (scrollbars, date pickers, selects) follow the theme. */
html.adm { color-scheme: light; --scroll-thumb: rgba(100, 116, 139, .38); --scroll-thumb-hover: rgba(71, 85, 105, .62); }
@media (prefers-color-scheme: dark) {
  html.adm:not([data-theme="light"]) { color-scheme: dark; --scroll-thumb: rgba(154, 167, 191, .3); --scroll-thumb-hover: rgba(154, 167, 191, .58); }
}
html.adm[data-theme="dark"] { color-scheme: dark; --scroll-thumb: rgba(154, 167, 191, .3); --scroll-thumb-hover: rgba(154, 167, 191, .58); }

/* Slim scrollbars with a transparent track everywhere inside the admin. */
html.adm, html.adm * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
html.adm ::-webkit-scrollbar { width: 11px; height: 11px; }
html.adm ::-webkit-scrollbar-track, html.adm ::-webkit-scrollbar-corner { background: transparent; }
html.adm ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; min-height: 40px; }
html.adm ::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: content-box; }

/* The sidebar list only shows its scrollbar while you point at it, so the menu stays clean. */
.adm .nav-scroll { scrollbar-gutter: stable; scrollbar-color: transparent transparent; overscroll-behavior: contain; }
.adm .nav-scroll:hover { scrollbar-color: var(--scroll-thumb) transparent; }
.adm .nav-scroll::-webkit-scrollbar-thumb { background: transparent; background-clip: content-box; }
.adm .nav-scroll:hover::-webkit-scrollbar-thumb { background: var(--scroll-thumb); background-clip: content-box; }
.adm .nav-scroll:hover::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: content-box; }

/* Scrolling inside a panel or drawer should not drag the page behind it. */
.adm .drawer-body, .adm .modal-body, .adm .pal-list, .adm .wd-panel, .adm .product-pick-list { overscroll-behavior: contain; }
html.adm { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html.adm { scroll-behavior: auto; } }

/* On short windows the share card would squeeze the menu down to a few items, so it steps aside and the navigation gets the room. */
@media (max-height: 780px) { .adm .sb-share { display: none; } }
@media (max-height: 640px) { .adm .sb-head { padding-top: 14px; padding-bottom: 8px; } }

/* Product pictures are shown whole in the admin too, never cropped. */
.adm .product-thumb-sm img, .adm .image-drop img, .adm .nm .th img, .adm .product-pick-row .thumb img, .adm .sf-item-thumb img { object-fit: contain; }
