/* =====================================================================
   Taaza — Merchant panel (ERP), POS & Super-admin panel
   Light + dark themes, module accent colours, chart tokens.
   ===================================================================== */
:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #F6F5F2; --surface: #FFFFFF; --surface-2: #FAF9F6; --surface-3: #F2F0EB;
  --line: #ECEAE4; --line-2: #E1DED6;
  --text: #17161B; --text-2: #4B4953; --text-3: #85838C; --text-4: #B3B1B8;
  --accent: #D6336C; --accent-ink: #fff; --accent-soft: rgba(214, 51, 108, .09); --accent-line: rgba(214, 51, 108, .28);
  --ok: #157A3B; --ok-bg: #E6F6EC; --warn: #9A6200; --warn-bg: #FFF3D6; --bad: #C0322F; --bad-bg: #FDE9E8; --info: #2563B8; --info-bg: #E7EFFC; --vio: #6D3CC9; --vio-bg: #F0EAFC; --mute-bg: #F0EFEC;
  --r: 14px; --r-sm: 10px; --r-lg: 18px; --r-xl: 22px;
  --sh-sm: 0 1px 2px rgba(20, 18, 30, .04), 0 1px 3px rgba(20, 18, 30, .04);
  --sh: 0 8px 24px -10px rgba(20, 18, 30, .14);
  --sh-lg: 0 24px 60px -24px rgba(20, 18, 30, .35);
  --side-w: 264px; --top-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* chart tokens (dataviz reference palette — light) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --ch-surface: #FFFFFF; --ch-text: #52514e; --ch-muted: #898781; --ch-grid: #ECEAE4; --ch-axis: #c3c2b7; --spark: #b8b6ae;
  --h0: #F2F1EC; --h1: #cde2fb; --h2: #9ec5f4; --h3: #6da7ec; --h4: #3987e5; --h5: #256abf; --h6: #184f95; --h7: #0d366b;
  --o1: #104281; --o2: #1c5cab; --o3: #2a78d6; --o4: #5598e7; --o5: #86b6ef;
  --tz-font: var(--font); --tz-surface: var(--surface); --tz-text: var(--text); --tz-line: var(--line); --tz-radius: 12px; --tz-radius-lg: 18px;
  color-scheme: light;
}
html[data-module="flower"] { --accent: #D6336C; --accent-soft: rgba(214, 51, 108, .09); --accent-line: rgba(214, 51, 108, .3); }
html[data-module="cake"] { --accent: #7C3AED; --accent-soft: rgba(124, 58, 237, .09); --accent-line: rgba(124, 58, 237, .3); }
html[data-module="bakery"] { --accent: #C96A06; --accent-soft: rgba(217, 119, 6, .1); --accent-line: rgba(217, 119, 6, .32); }
html[data-module="plants"] { --accent: #15803D; --accent-soft: rgba(22, 163, 74, .1); --accent-line: rgba(22, 163, 74, .32); }
html[data-app="admin"] { --accent: #4F46E5; --accent-soft: rgba(79, 70, 229, .09); --accent-line: rgba(79, 70, 229, .3); }

html[data-theme="dark"] {
  --bg: #0D0D0F; --surface: #1a1a19; --surface-2: #1F1F1E; --surface-3: #262625;
  --line: #2A2A29; --line-2: #343432;
  --text: #F4F3EF; --text-2: #C9C7C0; --text-3: #8F8D86; --text-4: #5E5D58;
  --ok: #4ACB6E; --ok-bg: rgba(12, 163, 12, .14); --warn: #F5BD3F; --warn-bg: rgba(250, 178, 25, .14); --bad: #F07A78; --bad-bg: rgba(208, 59, 59, .16); --info: #7AA8F0; --info-bg: rgba(57, 135, 229, .16); --vio: #B49CF5; --vio-bg: rgba(144, 133, 233, .16); --mute-bg: #2A2A29;
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .3); --sh: 0 10px 30px -12px rgba(0, 0, 0, .6); --sh-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --ch-surface: #1a1a19; --ch-text: #c3c2b7; --ch-muted: #898781; --ch-grid: #2c2c2a; --ch-axis: #383835; --spark: #5c5b56;
  --h0: #222221; --h1: #0d366b; --h2: #104281; --h3: #184f95; --h4: #1c5cab; --h5: #2a78d6; --h6: #5598e7; --h7: #86b6ef;
  --o1: #86b6ef; --o2: #5598e7; --o3: #3987e5; --o4: #256abf; --o5: #184f95;
  --tz-scrim: rgba(0, 0, 0, .6); --tz-x-bg: rgba(255, 255, 255, .06); --tz-x-hover: rgba(255, 255, 255, .12);
  color-scheme: dark;
}
html[data-theme="dark"][data-module="flower"] { --accent: #EC5C8F; }
html[data-theme="dark"][data-module="cake"] { --accent: #9D6BFA; }
html[data-theme="dark"][data-module="bakery"] { --accent: #F0952C; --accent-ink: #1a1206; }
html[data-theme="dark"][data-module="plants"] { --accent: #34B862; --accent-ink: #06170c; }
html[data-theme="dark"][data-app="admin"] { --accent: #7C74F0; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
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'; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
p { margin: 0; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num, .tbl td.r, .tbl th.r { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); } .muted-2 { color: var(--text-2); }
.r { text-align: right; } .c { text-align: center; }
.nowrap { white-space: nowrap; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex { display: flex; align-items: center; gap: 10px; } .flex-1 { flex: 1; min-width: 0; } .wrap-f { flex-wrap: wrap; }
.between { justify-content: space-between; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.hide { display: none !important; }

/* ---------- Shell ---------- */
.pn-app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; transition: grid-template-columns .3s var(--ease); }
.pn-side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; }
.pn-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.pn-brand .mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #FFB21A, #FF7A1A 55%, #E5197B); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 6px 14px -6px rgba(255, 122, 26, .7); }
.pn-brand .mark svg { width: 20px; height: 20px; }
.pn-brand b { font-size: 17px; letter-spacing: -.02em; display: block; line-height: 1.1; }
.pn-brand small { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; }
.pn-brand .collapse { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--text-3); display: grid; place-items: center; }
.pn-brand .collapse:hover { background: var(--surface-3); color: var(--text); }
.mod-switch { margin: 6px 12px 8px; position: relative; }
.mod-switch > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; transition: border-color .2s, background .2s; }
.mod-switch > button:hover { border-color: var(--line-2); background: var(--surface-3); }
.mod-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.mod-ic .ic { width: 17px; height: 17px; }
.mod-switch b { display: block; font-size: 13.5px; line-height: 1.2; }
.mod-switch small { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.mod-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); padding: 6px; z-index: 60; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .2s var(--ease); }
.mod-switch.open .mod-menu { opacity: 1; visibility: visible; transform: none; }
.mod-menu button, .mod-menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 0; background: none; text-align: left; }
.mod-menu button:hover, .mod-menu a:hover { background: var(--surface-3); }
.mod-menu .st { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; letter-spacing: .02em; text-transform: uppercase; }
.st.active { background: var(--ok-bg); color: var(--ok); } .st.trial { background: var(--warn-bg); color: var(--warn); } .st.locked { background: var(--mute-bg); color: var(--text-3); }
.mod-menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pn-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.pn-nav h6 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-4); font-weight: 700; margin: 16px 10px 6px; }
.pn-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 13.5px; position: relative; transition: background .15s, color .15s; }
.pn-nav a .ic { width: 18px; height: 18px; color: var(--text-3); transition: color .15s; }
.pn-nav a:hover { background: var(--surface-3); color: var(--text); }
.pn-nav a:hover .ic { color: var(--text-2); }
.pn-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pn-nav a.active .ic { color: var(--accent); }
.pn-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.pn-nav a .cnt { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--accent-ink); padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.pn-nav a .lock { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--text-3); background: var(--mute-bg); padding: 2px 7px; border-radius: 999px; text-transform: capitalize; }
.pn-nav a .lock .ic { width: 11px; height: 11px; color: inherit; }
.pn-side-foot { padding: 12px; border-top: 1px solid var(--line); }
.plan-card { border-radius: 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; }
.plan-card b { font-size: 13.5px; display: flex; align-items: center; justify-content: space-between; }
.plan-card .bar { height: 6px; border-radius: 99px; background: var(--surface-3); margin: 10px 0 8px; overflow: hidden; }
.plan-card .bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.plan-card a { font-weight: 700; color: var(--accent); }
.pn-main { min-width: 0; display: flex; flex-direction: column; }
.pn-top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.pn-top .burger { display: none; }
.pn-search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-3); cursor: pointer; transition: border-color .2s; }
.pn-search:hover { border-color: var(--line-2); }
.pn-search > span:not(.kbd) { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-3); font-family: inherit; }
.pn-top-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: none; display: grid; place-items: center; color: var(--text-2); position: relative; transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
.icon-btn .ic { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.branch-sel { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--text-2); }
.branch-sel select { border: 0; background: none; outline: none; font-weight: 600; max-width: 150px; cursor: pointer; }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 12px; border: 1px solid transparent; background: none; }
.me:hover { background: var(--surface); border-color: var(--line); }
.me b { font-size: 13px; display: block; line-height: 1.2; text-align: left; }
.me small { font-size: 11.5px; color: var(--text-3); display: block; text-align: left; }
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); padding: 6px; z-index: 70; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s var(--ease); }
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: none; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: 0; background: none; font-size: 13.5px; color: var(--text-2); text-align: left; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--surface-3); color: var(--text); }
.dd-menu .ic { width: 17px; height: 17px; }
.dd-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.dd-head { padding: 10px 10px 8px; }
.notif { width: 360px; padding: 0; }
.notif .nh { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif .nl { max-height: 380px; overflow: auto; }
.notif .ni { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notif .ni:hover { background: var(--surface-2); }
.notif .ni .nic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif .ni b { font-weight: 600; }
.notif .ni small { color: var(--text-3); display: block; margin-top: 2px; }
.notif .ni.unread { background: var(--accent-soft); }
.pn-content { padding: 24px 28px 48px; max-width: 1560px; width: 100%; margin: 0 auto; flex: 1; animation: pageIn .45s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pn-overlay { display: none; }

/* collapsed sidebar */
.pn-app.collapsed { --side-w: 76px; }
.pn-app.collapsed .pn-brand > div, .pn-app.collapsed .mod-switch b, .pn-app.collapsed .mod-switch small, .pn-app.collapsed .mod-switch .chev, .pn-app.collapsed .pn-nav h6, .pn-app.collapsed .pn-nav a span, .pn-app.collapsed .pn-nav a .cnt, .pn-app.collapsed .pn-nav a .lock, .pn-app.collapsed .plan-card { display: none; }
.pn-app.collapsed .pn-nav a { justify-content: center; padding: 10px; }
.pn-app.collapsed .mod-switch > button { justify-content: center; padding: 8px; }
.pn-app.collapsed .pn-brand { flex-direction: column; padding: 14px 8px; }
.pn-app.collapsed .pn-brand .collapse { margin: 6px 0 0; transform: rotate(180deg); }
.pn-app.collapsed .mod-menu { width: 260px; }

/* ---------- Page head ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.ph p { color: var(--text-3); margin-top: 4px; font-size: 14px; }
.ph .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; font-weight: 500; }
.crumb a:hover { color: var(--text); }
.crumb .ic { width: 12px; height: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
.btn:hover { border-color: var(--text-4); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px var(--accent); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-light { background: var(--surface); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ok { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-xs .ic { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.s-3 { grid-column: span 3; } .s-4 { grid-column: span 4; } .s-5 { grid-column: span 5; } .s-6 { grid-column: span 6; } .s-7 { grid-column: span 7; } .s-8 { grid-column: span 8; } .s-9 { grid-column: span 9; } .s-12 { grid-column: span 12; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; flex-wrap: wrap; }
.card-h h3 { font-size: 15px; font-weight: 650; }
.card-h p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.card-h .acts { display: flex; gap: 6px; align-items: center; }
.card-b { padding: 16px 18px 18px; }
.card-b.flush { padding: 8px 0 0; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card.pad { padding: 18px; }
.card.hover { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card.hover:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.sec-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- KPI tiles ---------- */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .kl { font-size: 13px; color: var(--text-3); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .kl .ic { width: 16px; height: 16px; }
.kpi .kv { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.kpi .kd { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.delta .ic { width: 13px; height: 13px; }
.delta.up { color: var(--ok); background: var(--ok-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--text-3); background: var(--mute-bg); }
.kpi .spark { position: relative; height: 36px; margin-top: 4px; }
.ch-spark { display: block; overflow: visible; }
.ch-spark-l { fill: none; stroke: var(--spark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-spark-a { fill: var(--spark); opacity: .12; }
.ch-spark-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--s1); box-shadow: 0 0 0 2px var(--surface); transform: translate(-50%, -50%); }
.hero-fig { font-size: 48px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }

/* ---------- Badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--mute-bg); color: var(--text-2); white-space: nowrap; line-height: 1.35; }
.badge .ic { width: 12px; height: 12px; }
.badge::before { content: none; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); } .b-bad { background: var(--bad-bg); color: var(--bad); } .b-info { background: var(--info-bg); color: var(--info); } .b-vio { background: var(--vio-bg); color: var(--vio); } .b-acc { background: var(--accent-soft); color: var(--accent); } .b-mute { background: var(--mute-bg); color: var(--text-3); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.chan { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.chan .ic { width: 15px; height: 15px; color: var(--text-3); }
.veg-dot { width: 13px; height: 13px; border: 1.5px solid #138a36; border-radius: 2px; display: inline-grid; place-items: center; flex: none; }
.veg-dot::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #138a36; }
.veg-dot.egg { border-color: #8B4513; } .veg-dot.egg::after { background: #8B4513; }

/* ---------- Tables ---------- */
.tbl-tools { display: flex; align-items: center; gap: 8px; padding: 14px 18px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tbl-tools .search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); flex: 1; min-width: 180px; max-width: 320px; }
.tbl-tools .search input { border: 0; outline: none; background: none; flex: 1; min-width: 0; font-size: 13.5px; }
.tbl-tools .search .ic { color: var(--text-3); width: 17px; height: 17px; }
.tbl-tools select.sel { height: 36px; width: auto; min-width: 130px; }
.tbl-tools .grow { flex: 1; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.tbl th.sort { cursor: pointer; user-select: none; }
.tbl th.sort:hover { color: var(--text); }
.tbl th .si { display: inline-block; margin-left: 4px; opacity: .5; }
.tbl th.asc .si, .tbl th.desc .si { opacity: 1; color: var(--accent); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl td.wrap { white-space: normal; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .cb { width: 36px; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.tbl .prod { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.tbl .prod img, .thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; }
.tbl .prod b { font-weight: 600; display: block; }
.tbl .prod small { color: var(--text-3); }
.tbl .who { display: flex; align-items: center; gap: 10px; }
.tbl .who b { font-weight: 600; display: block; line-height: 1.3; }
.tbl .who small { color: var(--text-3); }
.tbl .acts { display: flex; gap: 4px; justify-content: flex-end; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.pager { display: flex; gap: 4px; align-items: center; }
.pager button { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; padding: 0 8px; }
.pager button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pager button:disabled { opacity: .4; pointer-events: none; }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); font-weight: 600; font-size: 13px; color: var(--accent); }
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty .ic { width: 42px; height: 42px; color: var(--text-4); margin: 0 auto 12px; display: block; }
.empty b { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.fr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fr.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fr.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fl > label, .fl > .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; gap: 6px; }
.fl > label small { font-weight: 500; color: var(--text-3); }
.inp, .sel, .ta { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.ta { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.inp:focus, .sel:focus, .ta:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sel { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2385838C' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.inp-g { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.inp-g:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp-g .inp { border: 0; box-shadow: none !important; border-radius: 0; }
.inp-g .ad { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--text-3); font-weight: 600; font-size: 13px; white-space: nowrap; }
.help { font-size: 12px; color: var(--text-3); }
.chk { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.switch { position: relative; width: 40px; height: 23px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row b { font-weight: 600; display: block; }
.set-row small { color: var(--text-3); font-size: 12.5px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.seg button .ic { width: 16px; height: 16px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 12.5px; color: var(--text-2); transition: .15s; }
.chip:hover { border-color: var(--text-4); color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-3); }
.chip.on .n { background: rgba(255, 255, 255, .2); color: inherit; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); min-height: 40px; }
.tag-input label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tag-input label:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.tag-input input { accent-color: var(--accent); width: 14px; height: 14px; }
.upl { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--text-3); cursor: pointer; transition: border-color .15s, background .15s; display: block; }
.upl:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.upl .ic { width: 26px; height: 26px; margin: 0 auto 6px; display: block; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.img-grid .im { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); }
.img-grid .im img { width: 100%; height: 100%; object-fit: cover; }
.img-grid .im .rm { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.img-grid .im .rm .ic { width: 13px; height: 13px; }
.img-grid .im .main { position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 700; background: rgba(0, 0, 0, .6); color: #fff; padding: 2px 6px; border-radius: 6px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 11px 14px; font-weight: 600; font-size: 13.5px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: color .15s, border-color .15s; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs button.active, .tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-3); }
.tabs button.active .n { background: var(--accent-soft); color: var(--accent); }
.card > .tabs { padding: 0 12px; }

/* ---------- Lists, timelines, misc ---------- */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .lic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.li .lic .ic { width: 17px; height: 17px; }
.li b { font-weight: 600; display: block; font-size: 13.5px; }
.li small { color: var(--text-3); font-size: 12.5px; }
.li .end { margin-left: auto; text-align: right; flex: none; }
.tl { position: relative; padding-left: 26px; display: grid; gap: 16px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-i { position: relative; }
.tl-i::before { content: ""; position: absolute; left: -24px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-2); }
.tl-i.done::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-i.now::before { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); animation: ping 1.8s infinite; }
@keyframes ping { 50% { box-shadow: 0 0 0 7px var(--accent-soft); } }
.tl-i b { font-weight: 600; display: block; }
.tl-i small { color: var(--text-3); }
.kv-list { display: grid; gap: 10px; font-size: 13.5px; }
.kv-list div { display: flex; justify-content: space-between; gap: 12px; }
.kv-list span { color: var(--text-3); }
.kv-list b { font-weight: 600; text-align: right; }
.kv-list .tot { padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 15px; }
.prog { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.prog span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .8s var(--ease); }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--accent-line); background: var(--accent-soft); margin-bottom: 20px; }
.banner .bi { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.banner b { display: block; font-weight: 650; }
.banner small { color: var(--text-2); }
.banner .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.banner.warn { border-color: rgba(250, 178, 25, .45); background: var(--warn-bg); }
.banner.warn .bi { background: #E49B00; color: #fff; }
.avatar-stack { display: flex; }
.avatar-stack .tz-av { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .tz-av:first-child { margin-left: 0; }
.dot-s { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-s.ok { background: #16a34a; } .dot-s.warn { background: #f59e0b; } .dot-s.bad { background: #dc2626; } .dot-s.mute { background: var(--text-4); }
.code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
pre.code { padding: 12px; overflow: auto; white-space: pre-wrap; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kb-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-height: 300px; transition: background .2s, border-color .2s; }
.kb-col.over { background: var(--accent-soft); border-color: var(--accent-line); }
.kb-col h4 { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 650; padding: 4px 6px 10px; }
.kb-col h4 .n { font-size: 11.5px; color: var(--text-3); background: var(--surface); border: 1px solid var(--line); padding: 1px 8px; border-radius: 99px; }
.kb-list { display: grid; gap: 8px; min-height: 60px; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; box-shadow: var(--sh-sm); cursor: grab; transition: transform .15s, box-shadow .15s; font-size: 13px; }
.kb-card:hover { box-shadow: var(--sh); }
.kb-card.dragging { opacity: .5; transform: rotate(2deg); }
.kb-card .t { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kb-card b { font-weight: 650; }
.kb-card .m { color: var(--text-3); font-size: 12px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.kb-card .f { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; }

/* ---------- Lock gate ---------- */
.gate { position: relative; }
.gate-cover { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-start; justify-content: center; padding-top: 90px; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 40%, transparent), var(--bg) 340px); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.gate-box { max-width: 480px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: var(--sh-lg); }
.gate-box .gi { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 16px; background: var(--accent-soft); color: var(--accent); }
.gate-box .gi .ic { width: 28px; height: 28px; }
.gate-box h2 { font-size: 21px; margin-bottom: 8px; }
.gate-box p { color: var(--text-2); margin-bottom: 20px; }
.gate-locked { filter: blur(1.5px) grayscale(.2); pointer-events: none; user-select: none; opacity: .7; max-height: 900px; overflow: hidden; }

/* ---------- Command palette ---------- */
.cmdk-ov { position: fixed; inset: 0; z-index: 10010; background: rgba(10, 8, 20, .45); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.cmdk { width: min(620px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-lg); overflow: hidden; animation: pageIn .25s var(--ease); }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-in input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; }
.cmdk-l { max-height: 420px; overflow: auto; padding: 6px; }
.cmdk-l h6 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 10px 10px 4px; }
.cmdk-l a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.cmdk-l a .ic { color: var(--text-3); }
.cmdk-l a small { margin-left: auto; color: var(--text-3); font-size: 12px; }
.cmdk-l a.on, .cmdk-l a:hover { background: var(--accent-soft); color: var(--accent); }
.cmdk-l a.on .ic { color: var(--accent); }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; min-width: 0; }
.chart.ch-refetch { opacity: .5; transition: opacity .2s; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 8px; }
.ch-lg { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 4px 8px; border-radius: 8px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.ch-lg:hover { background: var(--surface-3); }
.ch-lg.off { opacity: .45; }
.ch-lg.off .ch-key { background: transparent !important; }
.ch-key { display: inline-block; flex: none; }
.ch-key.line { width: 14px; height: 2.5px; border-radius: 2px; background: var(--c); }
.ch-key.rect { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.ch-key.none { width: 0; }
.ch-plot { position: relative; }
.ch-plot svg { display: block; overflow: visible; }
.ch-grid { stroke: var(--ch-grid); stroke-width: 1; shape-rendering: crispEdges; }
.ch-base { stroke: var(--ch-axis); stroke-width: 1; shape-rendering: crispEdges; }
.ch-yt, .ch-xt { fill: var(--ch-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ch-end { fill: var(--ch-text); font-size: 11.5px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ch-vl { fill: var(--ch-text); font-size: 11px; font-weight: 600; font-family: var(--font); }
.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-line.dashed { stroke-dasharray: 4 4; opacity: .8; }
.ch-area { opacity: .1; }
.ch-dot { stroke: var(--ch-surface); stroke-width: 2; }
.ch-cross { stroke: var(--ch-axis); stroke-width: 1; transition: opacity .15s; }
.ch-hit { fill: transparent; cursor: crosshair; outline: none; }
.ch-bhit { fill: transparent; cursor: pointer; }
.ch-bar { transition: opacity .2s, transform .7s var(--ease); transform-box: fill-box; transform-origin: 50% 100%; }
.ch-bars.grow .ch-bar { transform: scaleY(0); }
.ch-bars.grow.in .ch-bar { transform: scaleY(1); }
.ch-bar.dim { opacity: .4; }
.ch-tip { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh); padding: 8px 10px; min-width: 140px; font-size: 12.5px; transition: transform .08s linear; }
.ch-tt { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; font-weight: 500; }
.ch-tr { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.ch-tr b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ch-tn { color: var(--text-3); }
.ch-list { display: grid; gap: 14px; }
.ch-li { outline: none; }
.ch-li-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 6px; }
.ch-li-l { color: var(--text); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-li-v { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.ch-li-track { height: 8px; border-radius: 0 4px 4px 0; background: transparent; }
.ch-li-bar { display: block; height: 100%; width: var(--w); border-radius: 0 4px 4px 0; transition: width .9s var(--ease); }
.ch-list.grow .ch-li-bar { width: 0; }
.ch-list.grow.in .ch-li-bar { width: var(--w); }
.ch-li:hover .ch-li-bar, .ch-li:focus .ch-li-bar { filter: brightness(1.1); }
.ch-donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ch-donut-fig { position: relative; flex: none; }
.ch-donut-fig svg { display: block; }
.ch-seg { fill: none; cursor: pointer; transition: opacity .2s; }
.ch-seg.dim { opacity: .35; }
.ch-donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.ch-donut-c b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.ch-donut-c span { font-size: 11.5px; color: var(--text-3); }
.ch-dl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; min-width: 160px; }
.ch-dl li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.ch-dl li.on { background: var(--surface-3); }
.ch-dl-l { flex: 1; color: var(--text-2); }
.ch-dl-v { font-variant-numeric: tabular-nums; }
.ch-dl-p { color: var(--text-3); font-size: 12px; width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.ch-cell { cursor: pointer; transition: opacity .15s; stroke: var(--ch-surface); stroke-width: 0; }
.ch-cell.on { stroke: var(--text); stroke-width: 1.5; }
.ch-scale { display: flex; align-items: center; gap: 3px; justify-content: flex-end; font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.ch-scale i { width: 16px; height: 10px; border-radius: 2px; display: inline-block; }
.ch-scale span { margin: 0 6px; }
.ch-funnel { display: grid; gap: 14px; }
.ch-fs-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.ch-fs-h b { font-variant-numeric: tabular-nums; }
.ch-fs-track { height: 22px; background: var(--surface-3); border-radius: 0 6px 6px 0; overflow: hidden; }
.ch-fs-track span { display: block; height: 100%; width: var(--w); border-radius: 0 6px 6px 0; transition: width 1s var(--ease); }
.ch-funnel.grow .ch-fs-track span { width: 0; }
.ch-funnel.grow.in .ch-fs-track span { width: var(--w); }
.ch-fs-m { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.ch-meter { height: 8px; border-radius: 99px; background: var(--info-bg); overflow: hidden; }
.ch-meter span { display: block; height: 100%; border-radius: 99px; background: var(--s1); }
.ch-meter.warn { background: var(--warn-bg); } .ch-meter.warn span { background: #e49b00; }
.ch-meter.danger { background: var(--bad-bg); } .ch-meter.danger span { background: #d03b3b; }
.ch-table-wrap { overflow: auto; max-height: 340px; border: 1px solid var(--line); border-radius: 12px; }
.ch-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ch-table th, .ch-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; font-variant-numeric: tabular-nums; }
.ch-table th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; color: var(--text-3); }
.ch-table .r { text-align: right; }
.view-toggle.on { background: var(--accent-soft); color: var(--accent); }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.cohort { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.cohort th { font-weight: 600; color: var(--text-3); padding: 4px 6px; text-align: center; }
.cohort th:first-child { text-align: left; }
.cohort td { text-align: center; padding: 8px 4px; border-radius: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.cohort td:first-child { text-align: left; font-weight: 500; color: var(--text-2); background: none !important; }

/* ---------- Misc page pieces ---------- */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.welcome h1 { font-size: 24px; letter-spacing: -.03em; }
.welcome p { color: var(--text-3); margin-top: 2px; }
.quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 13px; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.quick a:hover { transform: translateY(-3px); box-shadow: var(--sh); border-color: var(--line-2); }
.quick a .qi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.checklist { display: grid; gap: 8px; }
.checklist a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13.5px; transition: background .15s; }
.checklist a:hover { background: var(--surface-2); }
.checklist .cc { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; }
.checklist .done .cc { background: #16a34a; border-color: #16a34a; color: #fff; }
.checklist .done span { text-decoration: line-through; color: var(--text-3); }
.checklist .cc .ic { width: 13px; height: 13px; }
.slot-col { display: grid; gap: 8px; }
.slot-h { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 650; color: var(--text-2); padding: 0 2px; }
.mini-prod { display: flex; align-items: center; gap: 10px; }
.mini-prod img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; }
.mini-prod b { font-weight: 600; font-size: 13px; display: block; }
.mini-prod small { color: var(--text-3); font-size: 12px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; padding: 16px 18px; }
.pcard { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); transition: transform .2s var(--ease), box-shadow .2s; cursor: pointer; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.pcard .pi { aspect-ratio: 4/3.4; position: relative; background: var(--surface-3); }
.pcard .pi img { width: 100%; height: 100%; object-fit: cover; }
.pcard .pi .badge { position: absolute; left: 8px; top: 8px; }
.pcard .pb { padding: 10px 12px 12px; }
.pcard .pb b { font-weight: 600; display: block; font-size: 13.5px; }
.pcard .pb .row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.theme-tile { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.theme-tile .tt-frame { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.theme-tile .tt-frame iframe { position: absolute; top: 0; left: 0; width: 1440px; height: 900px; border: 0; transform-origin: 0 0; pointer-events: none; }
.theme-tile .tt-meta { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.theme-tile.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sw { display: flex; } .sw i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -5px; box-shadow: 0 0 0 1px var(--line); display: block; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.color-row button.on { box-shadow: 0 0 0 2px var(--text); }
.phone-prev { width: 300px; border-radius: 34px; background: #111; padding: 10px; margin: 0 auto; box-shadow: var(--sh-lg); }
.phone-prev .scr { border-radius: 26px; overflow: hidden; background: #ECE5DD; min-height: 480px; }
.wa-top { background: #075E54; color: #fff; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.wa-top i { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #075E54; display: grid; place-items: center; font-style: normal; font-weight: 700; }
.wa-b { padding: 12px; display: grid; gap: 8px; }
.wa-m { background: #fff; border-radius: 10px 10px 10px 2px; padding: 9px 10px; font-size: 12.5px; line-height: 1.5; color: #111; max-width: 92%; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); white-space: pre-wrap; }
.wa-m img { border-radius: 8px; margin-bottom: 6px; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.wa-m .wb { border-top: 1px solid #eee; margin-top: 8px; padding-top: 6px; text-align: center; color: #0B8A7A; font-weight: 600; }
.perm-tbl td, .perm-tbl th { text-align: center; }
.perm-tbl td:first-child, .perm-tbl th:first-child { text-align: left; }
.status-light { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.stat-mini { display: grid; gap: 2px; }
.stat-mini b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.stat-mini span { font-size: 12.5px; color: var(--text-3); }
.inline-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.inline-stats > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.inline-stats > div:last-child { border-right: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-3, .s-4, .s-5 { grid-column: span 6; } .s-7, .s-8, .s-9 { grid-column: span 12; }
  .s-4.keep { grid-column: span 4; }
}
@media (max-width: 1024px) {
  .pn-app { grid-template-columns: 1fr; }
  .pn-side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--sh-lg); }
  .pn-app.nav-open .pn-side { transform: none; }
  .pn-overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 8, 20, .4); opacity: 0; visibility: hidden; transition: .3s; }
  .pn-app.nav-open .pn-overlay { opacity: 1; visibility: visible; }
  .pn-top .burger { display: grid; }
  .pn-brand .collapse { display: none; }
  .pn-app.collapsed { --side-w: 280px; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-6 { grid-column: span 12; }
  .branch-sel, .me > div, .pn-search span, .pn-search .kbd { display: none; }
  .pn-search { flex: none; width: 40px; justify-content: center; padding: 0; }
}
@media (max-width: 720px) {
  .pn-content { padding: 18px 16px 40px; }
  .pn-top { padding: 0 12px; gap: 6px; }
  .g-4, .g-3, .g-2, .fr, .fr.c3, .fr.c4 { grid-template-columns: minmax(0, 1fr); }
  .g-4.keep2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-3, .s-4, .s-5, .s-6, .s-4.keep { grid-column: span 12; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph h1 { font-size: 21px; }
  .kpi .kv { font-size: 22px; }
  .notif { width: calc(100vw - 24px); right: -60px; }
  .inline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-stats > div:nth-child(2) { border-right: 0; }
  .tbl-tools .search { max-width: none; }
  .hide-sm { display: none !important; }
  .banner { flex-wrap: wrap; }
  .banner .acts { margin-left: 0; }
}

/* kanban overflow guards */
.kb-col { min-width: 0; }
.kb-list { grid-template-columns: minmax(0, 1fr); }
.kb-card { min-width: 0; overflow: hidden; }
.kb-card .t { min-width: 0; }
.kb-card .t > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-card .t .badge { flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
.kb-card .m span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Super admin: session-ended screen (admin/guard.js) and private sign-in page */
.sa-lock { position: fixed; inset: 0; z-index: 10050; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.sa-lock-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px; text-align: center; box-shadow: var(--sh-lg); }
.sa-lock-card h2 { font-size: 18px; margin-bottom: 6px; }
.sa-lock-card p { color: var(--text-2); font-size: 13.5px; margin: 0 0 18px; }
.sa-lock-i { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 12px; }
.sa-lock-i .ic { width: 20px; height: 20px; }
