/* Habi & Co. Seller Center: a calm, professional admin. Light work area, warm charcoal sidebar,
   Habi's terracotta as the one accent color. Inter with tabular numbers for money and counts. */
:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --line: #e7e5e1;
  --line-2: #f0eeeb;
  --text: #1c1917;
  --text-2: #44403c;
  --muted: #78716c;
  --brand: #b4532a;
  --brand-600: #9a4422;
  --brand-50: #fbf1ec;
  --side: #1c1815;
  --side-2: #2a2420;
  --side-text: #d6cfc7;
  --ok: #15803d; --ok-bg: #ecfdf3;
  --warn: #b45309; --warn-bg: #fff6e5;
  --danger: #c0362c; --danger-bg: #fef1f0;
  --info: #1d5bd8; --info-bg: #eef4ff;
  --violet: #6d3fd1; --violet-bg: #f3efff;
  --teal: #0f766e; --teal-bg: #e9f8f6;
  --gray: #57534e; --gray-bg: #f1efed;
  --r: 12px;
  --r-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 8px 24px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 24px 60px rgba(28, 25, 23, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
small { font-size: 12px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.ico { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; padding: 8px 14px; background: #fff; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }
.upper { text-transform: uppercase; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; color: var(--text); }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; }
.tone-text-warn { color: var(--warn); }
.tone-text-danger { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none !important; transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .ico { width: 16px; height: 16px; }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 1px 2px rgba(154, 68, 34, 0.35); }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: #d6d3cf; }
.btn-ghost { color: var(--text-2); background: transparent; }
.btn-ghost:hover { background: var(--gray-bg); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger:hover { background: #a42c23; }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: var(--danger-bg); }
.btn-dark { color: #f5efe8; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); }
.btn-dark:hover { background: rgba(255, 255, 255, 0.16); }
.btn-brand { color: #fff; background: var(--brand); }
.btn-brand:hover { background: var(--brand-600); }
.link-btn { padding: 0; border: 0; background: none; color: var(--brand-600); font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-sm { font-size: 13px; font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer; transition: background 0.15s; }
.icon-btn:hover { background: var(--gray-bg); }

/* ---------- Badges and chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-violet { color: var(--violet); background: var(--violet-bg); }
.badge-teal { color: var(--teal); background: var(--teal-bg); }
.badge-gray { color: var(--gray); background: var(--gray-bg); }
.badge-brand { color: var(--brand-600); background: var(--brand-50); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--gray-bg); }
.chip-website { color: #8a3d1d; background: #fbede6; }
.chip-facebook { color: #1f4fb3; background: #edf2fe; }
.chip-instagram { color: #a5285f; background: #fdeef4; }
.chip-bazaar { color: #4a5530; background: #f0f2e6; }
.code { display: inline-block; padding: 1px 7px; border: 1px dashed #d9a58c; border-radius: 6px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--brand-600); background: var(--brand-50); }
.code-lg { font-size: 13px; padding: 3px 9px; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 5px; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; font: 600 11px/1.5 var(--font); color: var(--muted); background: var(--surface); text-align: center; }

/* ---------- Sample bar ---------- */
/* On desktop the bar stays on top (46px), and the sidebar and top bar stick just under it */
.demo-bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 46px; padding: 7px 20px; color: #e9e2da; background: #0f0d0b; font-size: 13px; }
.demo-tag { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #ffcfb6; background: rgba(180, 83, 42, 0.35); }
.demo-text { color: #b8afa6; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

/* ---------- Start screen ---------- */
.welcome { min-height: calc(100vh - 46px); display: grid; place-items: center; padding: 40px 16px; background: radial-gradient(900px 500px at 15% 0%, #f6e2d6 0%, transparent 60%), radial-gradient(800px 500px at 100% 100%, #ece6dc 0%, transparent 60%), var(--bg); }
.welcome-card { width: min(640px, 100%); padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); text-align: center; animation: rise 0.6s var(--ease) both; }
.welcome-tag { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-600); background: var(--brand-50); }
.welcome-logo { margin: 18px auto 12px; border-radius: 14px; box-shadow: 0 8px 22px rgba(180, 83, 42, 0.3); }
.welcome h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.welcome-lead { margin: 10px auto 22px; max-width: 480px; color: var(--muted); font-size: 15px; }
.welcome-features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; text-align: left; }
.welcome-features li { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.welcome-features b { display: block; font-size: 13.5px; }
.welcome-features span { font-size: 12.5px; color: var(--muted); }
.welcome-choose { margin-bottom: 10px; font-weight: 600; color: var(--text-2); }
.welcome-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-btn { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.role-btn:hover { border-color: var(--brand); box-shadow: 0 8px 24px rgba(180, 83, 42, 0.14); transform: translateY(-2px); }
.role-btn b { display: block; margin-bottom: 2px; font-size: 14px; }
.role-btn span span { font-size: 12.5px; color: var(--muted); }
.role-icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; color: var(--brand); background: var(--brand-50); }
.welcome-fine { margin: 20px auto 10px; max-width: 470px; font-size: 12.5px; color: var(--muted); }
.welcome-links { display: flex; justify-content: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- App frame ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 46px); }
.sidebar { position: sticky; top: 46px; display: flex; flex-direction: column; height: calc(100vh - 46px); overflow-y: auto; padding: 16px 12px; color: var(--side-text); background: var(--side); z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side-brand img { border-radius: 9px; }
.side-brand b { display: block; color: #fff; font-size: 15px; }
.side-brand span { font-size: 12px; color: #9c938a; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; text-decoration: none !important; transition: background 0.15s, color 0.15s; }
.nav-link .ico { color: #9c938a; transition: color 0.15s; }
.nav-link:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-link.is-active { color: #fff; background: rgba(255, 255, 255, 0.09); }
.nav-link.is-active .ico { color: #f0a47f; }
.nav-link.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; color: #fff; background: var(--brand); }
.nav-count.is-warn { color: #3b2a12; background: #f3c26b; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.side-store { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; color: var(--side-text); font-weight: 500; font-size: 13px; }
.side-store:hover { color: #fff; background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 6px 2px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.side-user b { display: block; color: #fff; font-size: 13px; }
.side-user span { font-size: 12px; color: #9c938a; }
.side-user .icon-btn { margin-left: auto; color: #9c938a; }
.side-user .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #7a3416; background: linear-gradient(135deg, #f8d9c8, #efc1a7); }
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(15, 13, 11, 0.45); }

.main { min-width: 0; }
.topbar { position: sticky; top: 46px; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: rgba(245, 245, 243, 0.86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.search-trigger { display: flex; align-items: center; gap: 10px; width: min(460px, 100%); height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer; text-align: left; box-shadow: var(--shadow-sm); transition: border-color 0.15s; }
.search-trigger:hover { border-color: #d6d3cf; }
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.bell-wrap { position: relative; }
.bell-dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--bg); border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 13px; text-align: center; color: #fff; background: var(--danger); }
#bellBtn.is-ringing .ico { animation: ring 0.9s ease; transform-origin: 50% 0; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.18s var(--ease); }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.bell-list { margin: 0; padding: 6px; list-style: none; max-height: 380px; overflow-y: auto; }
.bell-list a { display: block; padding: 9px 10px 9px 22px; border-radius: 8px; color: var(--text-2); position: relative; text-decoration: none; }
.bell-list a:hover { background: var(--surface-2); }
.bell-list a.is-unread { color: var(--text); font-weight: 500; }
.bell-list a.is-unread::before { content: ""; position: absolute; left: 9px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.bell-list small { display: block; }
.bell-empty { padding: 20px; text-align: center; color: var(--muted); }
.top-user { display: flex; align-items: center; gap: 9px; padding-left: 10px; border-left: 1px solid var(--line); }
.top-user-name { display: flex; flex-direction: column; font-weight: 600; font-size: 13px; line-height: 1.25; }

.view { max-width: 1340px; margin: 0 auto; padding: 26px 28px 60px; outline: none; }
.view.is-entering { animation: fadeUp 0.35s var(--ease); }

/* ---------- Page parts ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 20px; }
.page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-head h1 .badge { font-size: 12.5px; }
.page-head p { margin-top: 4px; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; color: var(--muted); font-weight: 600; font-size: 13px; }
.back:hover { color: var(--text); text-decoration: none; }
.back .ico { width: 16px; height: 16px; }
.hint-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--warn); background: var(--warn-bg); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-flush .card-head { padding: 18px 20px 0; }
.card-head h2 { font-size: 15px; font-weight: 650; }
.card-head p { margin-top: 2px; font-size: 12.5px; color: var(--muted); }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #ebe9e5; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; transition: background 0.15s, box-shadow 0.15s, color 0.15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(28, 25, 23, 0.14); }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg-full { display: flex; margin-bottom: 14px; }
.seg-full .seg-btn { flex: 1; justify-content: center; cursor: pointer; }
.seg-btn:has(input:focus-visible) { outline: 2px solid var(--brand); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.kpi-k { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpis-sm .kpi-v, .kpis-5 .kpi-v { font-size: 22px; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-d { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.kpi-d .ico { width: 14px; height: 14px; }
.kpi-d em { margin-left: 3px; font-style: normal; font-weight: 400; color: var(--muted); }
.kpi-d.is-up { color: var(--ok); }
.kpi-d.is-down { color: var(--danger); }
.kpi-link { color: inherit; text-decoration: none !important; transition: border-color 0.15s, box-shadow 0.15s; }
.kpi-link:hover { border-color: #d6d3cf; box-shadow: var(--shadow); }

.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.grid-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.col { display: grid; gap: 14px; }
/* Let cards shrink so one-line text truncates instead of pushing the column wider */
.grid-main > *, .grid-3 > *, .grid-2 > *, .grid-detail > *, .col > * { min-width: 0; }
.todo-item { min-width: 0; }

/* Chart */
.chart { min-height: 270px; }
.chart-box { position: relative; }
.chart svg { display: block; overflow: visible; }
.c-grid { stroke: var(--line-2); }
.c-axis { font-size: 11px; fill: #a8a29e; font-variant-numeric: tabular-nums; }
.c-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) 0.1s forwards; }
.c-area { opacity: 0; animation: fadeIn 0.8s ease 0.5s forwards; }
.c-guide { stroke: #d6d3cf; stroke-dasharray: 3 3; }
.c-hit { cursor: crosshair; }
.c-tip { position: absolute; z-index: 2; min-width: 150px; padding: 9px 11px; border-radius: 10px; background: #1c1917; color: #fff; font-size: 12px; box-shadow: var(--shadow-lg); pointer-events: none; }
.c-tip b { display: block; margin-bottom: 4px; font-weight: 600; color: #e7e5e4; }
.c-tip span { display: flex; align-items: center; gap: 7px; }
.c-tip i { width: 8px; height: 8px; border-radius: 2px; }
.c-tip em { margin-left: auto; padding-left: 12px; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-inline { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 14px; height: 0; border-top: 2.5px solid var(--brand); border-radius: 2px; }
.legend-inline .lg-prev { border-top: 2px dashed #a3aab5; }

/* To-do list */
.todo { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none !important; transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.todo-item:hover { border-color: #d6d3cf; background: var(--surface-2); transform: translateX(2px); }
.todo-item.is-done { opacity: 0.55; }
.todo-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; }
.tone-warn { color: var(--warn); background: var(--warn-bg); }
.tone-info { color: var(--info); background: var(--info-bg); }
.tone-violet { color: var(--violet); background: var(--violet-bg); }
.tone-danger { color: var(--danger); background: var(--danger-bg); }
.todo-text { flex: 1; min-width: 0; }
.todo-text b { display: block; font-size: 13.5px; font-weight: 600; }
.todo-text small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.todo-n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-go { color: #a8a29e; }

/* Bar lists */
.barlist { margin: 0; padding: 0; list-style: none; display: grid; gap: 13px; }
.barlist li { display: flex; align-items: center; gap: 11px; }
.barlist img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.bl-main { flex: 1; min-width: 0; }
.bl-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 13px; }
.bl-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.bl-top b { font-variant-numeric: tabular-nums; }
.bl-track { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bl-track i { display: block; height: 100%; border-radius: inherit; transform-origin: left; animation: grow 0.9s var(--ease) both; }
.bl-sub { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 140px; height: 140px; flex-shrink: 0; }
.donut circle { transition: stroke-dasharray 0.6s var(--ease); }
.donut-k { font-size: 11px; fill: var(--muted); }
.donut-v { font-size: 17px; font-weight: 700; fill: var(--text); }
.legend { flex: 1; margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; column-gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend em { grid-column: 2 / 4; font-style: normal; font-size: 11.5px; color: var(--muted); }

/* Latest orders */
.mini-orders { margin: 0; padding: 4px 8px 8px; list-style: none; }
.mini-orders a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: inherit; text-decoration: none; }
.mini-orders a:hover { background: var(--surface-2); }
.mo-main { flex: 1; min-width: 0; }
.mo-main b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mo-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.mo-side b { font-size: 13px; font-variant-numeric: tabular-nums; }
.mo-side .badge { font-size: 11px; }

/* Tabs and toolbars */
.tabs { display: flex; gap: 2px; margin-bottom: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--brand); }
.tab-count { padding: 0 7px; border-radius: 999px; font-size: 11.5px; line-height: 19px; color: var(--muted); background: #ebe9e5; }
.tab-count.is-hot { color: #fff; background: var(--brand); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.toolbar select { height: 36px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 9px center / 14px no-repeat; -webkit-appearance: none; appearance: none; cursor: pointer; }
.search-field { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-field .ico { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.search-field input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.search-field input:focus, .toolbar select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(180, 83, 42, 0.14); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all 0.15s; }
.chip-btn span { margin-left: 3px; color: var(--muted); font-size: 12px; }
.chip-btn:hover { border-color: #d6d3cf; }
.chip-btn.is-active { color: #fff; background: var(--text); border-color: var(--text); }
.chip-btn.is-active span { color: #d6d3cf; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--brand-50); border-bottom: 1px solid #f1d8cb; animation: fadeIn 0.2s ease; }
.bulk b { margin-right: 6px; font-size: 13px; color: var(--brand-600); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table td small { display: block; margin-top: 1px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-click tbody tr, .row-click { cursor: pointer; transition: background 0.12s; }
.table-click tbody tr:hover, .row-click:hover { background: #fbfaf8; }
.table tr.is-selected { background: #fdf6f2; }
.table a.strong { color: var(--text); }
.col-check { width: 40px; padding-right: 0 !important; }
.col-check input, .check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.prod-cell { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.prod-cell img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line-2); }
.prod-cell b { display: block; font-weight: 600; }
.strike { text-decoration: line-through; }
.stock-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; }
.dot-ok { background: var(--ok); } .dot-warn { background: #e8a02c; } .dot-danger { background: var(--danger); }
.delta { display: inline-block; min-width: 38px; padding: 1px 7px; border-radius: 6px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.delta.is-plus { color: var(--ok); background: var(--ok-bg); }
.delta.is-minus { color: var(--danger); background: var(--danger-bg); }
.meter { display: block; width: 70px; height: 4px; margin: 5px 0 0 auto; border-radius: 9px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.pager div { display: flex; gap: 6px; }
.empty { display: grid; justify-items: center; gap: 4px; padding: 48px 20px; text-align: center; }
.empty .ico { width: 34px; height: 34px; margin-bottom: 6px; padding: 7px; border-radius: 50%; color: var(--muted); background: var(--gray-bg); }
.empty b { font-size: 15px; }
.empty p { color: var(--muted); }

/* Order detail */
.stepper { display: flex; margin: 0 0 16px; padding: 14px 20px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); counter-reset: s; }
.stepper li { position: relative; flex: 1; display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; margin: 0 12px; border-radius: 2px; background: var(--line); }
.stepper li.is-done:not(:last-child)::after { background: var(--brand); }
.stepper li > span { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); font-size: 12px; background: var(--surface); }
.stepper li > span .ico { width: 14px; height: 14px; stroke-width: 3; }
.stepper li.is-done { color: var(--text); }
.stepper li.is-done > span { color: #fff; background: var(--brand); border-color: var(--brand); }
.stepper li.is-current { color: var(--brand-600); }
.stepper li.is-current > span { border-color: var(--brand); color: var(--brand-600); box-shadow: 0 0 0 4px rgba(180, 83, 42, 0.12); }
.lines { margin: 0 0 6px; padding: 0; list-style: none; }
.lines li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 90px; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.lines img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line-2); }
.lines b { font-weight: 600; }
.lines small { display: block; }
.lines-q { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum { margin: 0; display: grid; gap: 7px; padding-top: 8px; }
.sum div { display: flex; justify-content: space-between; gap: 10px; }
.sum dt { color: var(--text-2); }
.sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.sum-total { padding-top: 9px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 700; }
.sum-total dt { color: var(--text); }
.sum-profit { padding: 9px 11px; border-radius: 9px; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.sum-profit dt { color: var(--ok); }
.sum-profit small { color: var(--ok); font-weight: 500; }
.kv { margin: 0; display: grid; gap: 9px; }
.kv div { display: flex; justify-content: space-between; gap: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }
.proof { display: flex; gap: 16px; align-items: center; margin-top: 14px; padding: 14px; border: 1px dashed #e8c48c; border-radius: 10px; background: #fffbf3; }
.proof p { font-size: 13px; color: var(--text-2); }
.proof-receipt { flex-shrink: 0; display: grid; gap: 2px; width: 190px; padding: 14px; border-radius: 12px; background: linear-gradient(160deg, #2c5bd6, #1e3f9a); color: #dfe8ff; font-size: 11.5px; box-shadow: 0 8px 18px rgba(30, 63, 154, 0.3); transform: rotate(-2deg); }
.proof-receipt b { font-size: 20px; color: #fff; }
.proof-k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }
.timeline { margin: 0 0 14px; padding: 0; list-style: none; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; background: var(--line-2); }
.tl-dot { flex-shrink: 0; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--brand); background: var(--surface); }
.timeline li:first-child .tl-dot { background: var(--brand); }
.timeline li.is-note .tl-dot { border-color: #e8a02c; }
.timeline li.is-note p { padding: 7px 10px; border-radius: 8px; background: #fff8ea; }
.note-form { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.note-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); resize: vertical; }
.note-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(180, 83, 42, 0.14); }
.cust-link { display: flex; align-items: center; gap: 11px; padding: 10px; margin: -6px -6px 10px; border-radius: 10px; color: inherit; text-decoration: none !important; }
.cust-link:hover { background: var(--surface-2); }
.cust-link > span:nth-child(2) { flex: 1; }
.cust-link b { display: block; }
.contact { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; }
.contact li { display: flex; align-items: flex-start; gap: 9px; color: var(--text-2); word-break: break-word; }
.contact .ico { width: 16px; height: 16px; margin-top: 1px; color: var(--muted); }
.addr { display: flex; gap: 10px; color: var(--text-2); }
.addr .ico { margin-top: 2px; color: var(--muted); }
.hint { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.hint .ico { width: 16px; height: 16px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; }
.field select { padding-right: 30px; -webkit-appearance: none; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center / 14px no-repeat; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(180, 83, 42, 0.14); }
.field input[readonly] { color: var(--muted); background: var(--surface-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-help { font-size: 12px; color: var(--muted); }
.field-err { font-size: 12.5px; font-weight: 500; color: var(--danger); }
.field.has-error input, .field.has-error select { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192, 54, 44, 0.12); }
.check { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; font-weight: 500; cursor: pointer; }
.img-pick { display: flex; gap: 14px; align-items: flex-start; }
.img-pick > img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.img-grid { display: grid; grid-template-columns: repeat(6, 40px); gap: 6px; }
.img-grid button { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; overflow: hidden; }
.img-grid button img { width: 36px; height: 36px; object-fit: cover; }
.img-grid button.is-on { border-color: var(--brand); }
.profit-box { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: var(--r-sm); background: var(--ok-bg); color: var(--ok); }
.profit-box span { font-size: 12.5px; font-weight: 600; }
.profit-box .is-low { color: var(--warn); }
.form-foot { display: flex; justify-content: flex-end; padding-top: 4px; }

/* Settings */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.switches { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 10px 4px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { position: relative; flex-shrink: 0; width: 38px; height: 22px; border-radius: 99px; background: #d6d3cf; transition: background 0.2s; }
.switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--ease); }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-text b { display: block; font-size: 13.5px; }
.team { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 4px; }
.team li { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.team li > span:nth-child(2) { flex: 1; }
.team b { display: block; font-size: 13.5px; }
.perm { padding: 14px; border-radius: 10px; background: var(--surface-2); }
.perm h3 { margin-bottom: 8px; font-size: 13px; }
.perm ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.perm li { display: flex; align-items: center; gap: 8px; }
.perm .ico { width: 15px; height: 15px; color: var(--ok); stroke-width: 2.5; }
.perm .is-no { color: var(--muted); }
.perm .is-no .ico { color: var(--danger); }

/* Customer drawer */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 16px; }
.stat-row div { padding: 11px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.stat-row span { display: block; font-size: 12px; color: var(--muted); }
.stat-row b { font-size: 16px; font-variant-numeric: tabular-nums; }
.ov-body .contact { margin-bottom: 16px; }
.drawer-h { margin: 6px 0 8px; font-size: 14px; }
.hist { margin: 0; padding: 0; list-style: none; }
.hist a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none; border-radius: 6px; }
.hist a:hover { background: var(--surface-2); }
.hist b { display: block; }
.hist-r { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }

/* ---------- Overlays: modal, drawer, search ---------- */
.ov { position: fixed; inset: 0; z-index: 100; display: flex; }
.ov-scrim { position: absolute; inset: 0; background: rgba(15, 13, 11, 0.42); opacity: 0; transition: opacity 0.2s ease; }
.ov.is-in .ov-scrim { opacity: 1; }
.ov.is-out .ov-scrim { opacity: 0; }
.ov-panel { position: relative; display: flex; flex-direction: column; margin: 0; background: var(--surface); box-shadow: var(--shadow-lg); }
.ov-modal { align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; overflow-y: auto; }
.ov-modal .ov-panel { width: min(480px, 100%); border-radius: 16px; opacity: 0; transform: translateY(12px) scale(0.98); transition: opacity 0.2s ease, transform 0.25s var(--ease); }
.ov-modal .ov-panel.is-wide { width: min(640px, 100%); }
.ov-modal.is-in .ov-panel { opacity: 1; transform: none; }
.ov-modal.is-out .ov-panel { opacity: 0; transform: translateY(8px) scale(0.98); }
.ov-drawer { justify-content: flex-end; }
.ov-drawer .ov-panel { width: min(520px, 100%); height: 100%; transform: translateX(100%); transition: transform 0.3s var(--ease); }
.ov-drawer.is-in .ov-panel { transform: none; }
.ov-drawer.is-out .ov-panel { transform: translateX(100%); }
.ov-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line-2); }
.ov-head h2 { font-size: 17px; font-weight: 700; }
.ov-head p { margin-top: 3px; font-size: 13px; color: var(--muted); }
.ov-head .icon-btn { margin: -6px -8px 0 0; }
.ov-body { flex: 1; padding: 18px 20px 6px; overflow-y: auto; }
.ov-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.ov-drawer .ov-foot { border-radius: 0; }
.confirm-text { color: var(--text-2); padding-bottom: 12px; }
.is-cmdk .ov-head { display: none; }
.is-cmdk .ov-body { padding: 0; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line-2); }
.cmdk-input .ico { color: var(--muted); }
.cmdk-input input { flex: 1; height: 54px; border: 0; outline: none; font-size: 15px; background: none; }
.cmdk-list { margin: 0; padding: 6px; list-style: none; max-height: 380px; overflow-y: auto; }
.cmdk-group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cmdk-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.cmdk-item > .ico { color: var(--muted); }
.cmdk-item span { flex: 1; min-width: 0; font-weight: 500; }
.cmdk-item small { display: block; font-weight: 400; }
.cmdk-go { opacity: 0; }
.cmdk-item.is-active { background: var(--brand-50); }
.cmdk-item.is-active > .ico { color: var(--brand); opacity: 1; }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted); }
.cmdk-hint { display: flex; gap: 6px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: grid; gap: 8px; width: min(400px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; border-radius: 12px; color: #fff; background: #1c1917; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toastIn 0.35s var(--ease); }
.toast > .ico { color: #86efac; }
.toast-error > .ico { color: #fca5a5; }
.toast-order { background: linear-gradient(135deg, #2a1a12, #1c1917); border: 1px solid rgba(240, 164, 127, 0.35); }
.toast-order > .ico { color: #f0a47f; }
.toast span { flex: 1; }
.toast-link { padding: 5px 10px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: #fff; background: rgba(255, 255, 255, 0.14); }
.toast-link:hover { background: rgba(255, 255, 255, 0.24); text-decoration: none; }
.toast-x { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: #a8a29e; cursor: pointer; }
.toast-x .ico { width: 15px; height: 15px; }
.toast-x:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
.kpis .kpi { animation: fadeUp 0.45s var(--ease) both; }
.kpis .kpi:nth-child(2) { animation-delay: 0.04s; } .kpis .kpi:nth-child(3) { animation-delay: 0.08s; } .kpis .kpi:nth-child(4) { animation-delay: 0.12s; } .kpis .kpi:nth-child(5) { animation-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .c-line { stroke-dashoffset: 0; }
  .c-area { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1240px) { .demo-text { display: none; } }
@media (max-width: 1200px) {
  .kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > .card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* The sample bar can wrap on small screens, so it scrolls away and the top bar sticks to the very top */
  .demo-bar { position: relative; }
  .topbar { top: 0; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; height: auto; transform: translateX(-100%); transition: transform 0.3s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .view { padding: 20px 16px 48px; }
  .grid-main, .grid-detail, .grid-2, .settings { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none; }
}
@media (max-width: 720px) {
  .kpis, .kpis-5 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-v { font-size: 21px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; }
  .top-user-name { display: none; }
  .page-head h1 { font-size: 21px; }
  .hide-sm { display: none; }
  .welcome-card { padding: 26px 18px; }
  .welcome-features, .welcome-roles { grid-template-columns: 1fr; }
  .field-row-4 { grid-template-columns: 1fr 1fr; }
  .stepper { padding: 12px; overflow-x: auto; }
  .stepper li { font-size: 12px; min-width: 64px; flex-direction: column; gap: 4px; }
  .stepper li:not(:last-child)::after { position: absolute; left: calc(50% + 18px); right: calc(-50% + 18px); top: 12px; margin: 0; }
  .lines li { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .lines li .lines-q { display: none; }
  .lines img { width: 44px; height: 44px; }
  .proof { flex-direction: column; align-items: flex-start; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .demo-text { display: none; }
  .demo-actions { margin-left: 0; }
  .toolbar .search-field { max-width: none; min-width: 100%; }
  .img-grid { grid-template-columns: repeat(4, 40px); }
}
@media (max-width: 420px) {
  .field-row { grid-template-columns: 1fr; }
  .kpis-sm { grid-template-columns: 1fr 1fr; }
}

/* ---------- Print: invoices and packing slips ---------- */
.print-root { display: none; }
@media print {
  body.printing > *:not(.print-root) { display: none !important; }
  body.printing .print-root { display: block; }
  body { background: #fff; font-size: 12px; }
  .pr-doc { padding: 10mm 6mm; page-break-after: always; color: #000; }
  .pr-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 2px solid #000; }
  .pr-head h1 { font-size: 22px; }
  .pr-head p, .pr-cols p { color: #333; }
  .pr-meta { text-align: right; }
  .pr-meta h2 { font-size: 18px; text-transform: uppercase; letter-spacing: 0.06em; }
  .pr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 16px 0; }
  .pr-cols h3 { margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #555; }
  .pr-table, .pr-totals { width: 100%; border-collapse: collapse; }
  .pr-table th { padding: 6px 4px; border-bottom: 1px solid #000; text-align: left; font-size: 11px; }
  .pr-table td { padding: 8px 4px; border-bottom: 1px solid #ccc; }
  .pr-table .num, .pr-totals .num { text-align: right; }
  .pr-box { width: 24px; font-size: 16px; }
  .pr-totals { width: 50%; margin: 12px 0 0 auto; }
  .pr-totals td { padding: 4px; }
  .pr-grand td { padding-top: 8px; border-top: 2px solid #000; font-size: 15px; font-weight: 700; }
  .pr-thanks, .pr-sign { margin-top: 28px; color: #333; }
}
