/* BreMa ERP look and feel. One file for every page; the font is served from this site, no outside libraries. */

@font-face {
  font-family: "Jakarta";
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.13d1b429e990.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jakarta";
  src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.cc2090cafea0.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Themes: each person picks one (top-right menu) ---------- */
:root, [data-theme="royal"] {
  --brand: #5b5bd6; --brand-2: #9b5cf6; --brand-ink: #4338ca; --brand-soft: #eef0ff;
  --side-bg: linear-gradient(180deg, #1e1b4b 0%, #151332 55%, #0f0d24 100%);
  --side-glow: rgba(139, 92, 246, .35);
}
[data-theme="plum"] {
  --brand: #714b67; --brand-2: #017e84; --brand-ink: #5e3a55; --brand-soft: #f6eef4;
  --side-bg: linear-gradient(180deg, #5b3352 0%, #3f2239 60%, #2b1627 100%);
  --side-glow: rgba(1, 126, 132, .45);
}
[data-theme="ocean"] {
  --brand: #0369a1; --brand-2: #06b6d4; --brand-ink: #075985; --brand-soft: #e8f6fd;
  --side-bg: linear-gradient(180deg, #0c3b5e 0%, #082a45 60%, #061c30 100%);
  --side-glow: rgba(6, 182, 212, .4);
}
[data-theme="emerald"] {
  --brand: #059669; --brand-2: #0ea5a4; --brand-ink: #047857; --brand-soft: #e7f8f1;
  --side-bg: linear-gradient(180deg, #064e3b 0%, #053b2d 60%, #032a20 100%);
  --side-glow: rgba(20, 184, 166, .4);
}
[data-theme="sunset"] {
  --brand: #ea580c; --brand-2: #db2777; --brand-ink: #c2410c; --brand-soft: #fff1e8;
  --side-bg: linear-gradient(180deg, #4c0f2b 0%, #36091e 60%, #240614 100%);
  --side-glow: rgba(249, 115, 22, .4);
}
:root {
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --line: #e6e8f0; --line-2: #f1f3f9;
  --bg: #f4f6fb;
  --card: #ffffff; --card-2: #fafbff; --input: #ffffff;
  --side-ink: #e2e8f0; --side-muted: rgba(226, 232, 240, .5);
  --ok: #059669;   --ok-soft: #e8f8f1;
  --warn: #b45309; --warn-soft: #fff6e0;
  --bad: #dc2626;  --bad-soft: #fdeeee;
  --info: #0369a1; --info-soft: #e8f5fc;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .16);
  --side-w: 264px; --top-h: 68px;
  --font: "Jakarta", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mod: var(--brand); --mod-2: var(--brand-2);
}
[data-theme="graphite"] {
  --brand: #475569; --brand-2: #0ea5e9; --brand-ink: #334155; --brand-soft: #eef2f7;
  --side-bg: linear-gradient(180deg, #1f2937 0%, #161e2b 60%, #0f141d 100%);
  --side-glow: rgba(14, 165, 233, .3);
}
[data-theme="graphite"][data-mode="dark"] { --brand: #94a3b8; }

/* ---------- Light / dark: separate from the colours, each person picks (top bar) ---------- */
:root[data-mode="dark"] {
  --ink: #e6e9f2; --ink-2: #c3cad8; --muted: #8b95ab;
  --line: #232c45; --line-2: #1a2238;
  --bg: #0a0f1d; --card: #111829; --card-2: #141c31; --input: #0d1424;
  --brand-soft: color-mix(in srgb, var(--brand) 16%, transparent);
  --brand-ink: color-mix(in srgb, var(--brand) 55%, #fff);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .12);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .12);
  --info: #38bdf8; --info-soft: rgba(56, 189, 248, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .2); --shadow-lg: 0 20px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-mode="auto"] {
    --ink: #e6e9f2; --ink-2: #c3cad8; --muted: #8b95ab;
    --line: #232c45; --line-2: #1a2238;
    --bg: #0a0f1d; --card: #111829; --card-2: #141c31; --input: #0d1424;
    --brand-soft: color-mix(in srgb, var(--brand) 16%, transparent);
    --brand-ink: color-mix(in srgb, var(--brand) 55%, #fff);
    --ok: #34d399; --ok-soft: rgba(52, 211, 153, .12);
    --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
    --bad: #f87171; --bad-soft: rgba(248, 113, 113, .12);
    --info: #38bdf8; --info-soft: rgba(56, 189, 248, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .2); --shadow-lg: 0 20px 48px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* ---------- One colour per section, like Odoo's apps ---------- */
[data-mod="home"]     { --mod: #6366f1; --mod-2: #a855f7; }
[data-mod="store"]    { --mod: #f97316; --mod-2: #f59e0b; }
[data-mod="client"]   { --mod: #ec4899; --mod-2: #f43f5e; }
[data-mod="chart"]    { --mod: #0d9488; --mod-2: #22c55e; }
[data-mod="people"]   { --mod: #2563eb; --mod-2: #06b6d4; }
[data-mod="team"]     { --mod: #7c3aed; --mod-2: #c026d3; }
[data-mod="clock"]    { --mod: #16a34a; --mod-2: #84cc16; }
[data-mod="calendar"] { --mod: #0891b2; --mod-2: #3b82f6; }
[data-mod="inbox"]    { --mod: #d97706; --mod-2: #f97316; }
[data-mod="wallet"]   { --mod: #059669; --mod-2: #14b8a6; }
[data-mod="money"]    { --mod: #e11d48; --mod-2: #f97316; }
[data-mod="bank"]     { --mod: #0f766e; --mod-2: #d97706; }
[data-mod="shield"]   { --mod: #475569; --mod-2: #6366f1; }
[data-mod="settings"] { --mod: #334155; --mod-2: #64748b; }
[data-mod="chat"]     { --mod: #4f46e5; --mod-2: #0ea5e9; }
[data-mod="org"]      { --mod: #9333ea; --mod-2: #ec4899; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: radial-gradient(1200px 500px at 100% -10%, var(--brand-soft), transparent 70%) fixed, var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
b, strong { font-weight: 700; }

/* ---------- App shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40; overflow: hidden;
  background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; transition: width .2s ease, transform .25s ease;
}
.sidebar::before { content: ""; position: absolute; width: 320px; height: 320px; left: -120px; top: -140px; border-radius: 50%; background: radial-gradient(closest-side, var(--side-glow), transparent); pointer-events: none; }
.sidebar::after { content: ""; position: absolute; width: 260px; height: 260px; right: -150px; bottom: -80px; border-radius: 50%; background: radial-gradient(closest-side, var(--side-glow), transparent); opacity: .7; pointer-events: none; }
.brand { position: relative; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 20px; color: #fff; }
.brand:hover { text-decoration: none; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: -.5px; color: #fff;
  background: conic-gradient(from 210deg, #f97316, #ec4899, #8b5cf6, #3b82f6, #14b8a6, #f97316);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25), inset 0 0 0 2px rgba(255,255,255,.25);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.brand-text b { display: block; font-size: 17px; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; }
.brand-text span { font-size: 12px; color: var(--side-muted); }
.side-nav { position: relative; flex: 1; overflow-y: auto; padding: 4px 14px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-group { margin-top: 14px; }
.side-label { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0; padding: 4px 10px 6px; min-height: 0; border: 0; border-radius: 8px; background: none; box-shadow: none; font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--side-muted); white-space: nowrap; cursor: pointer; }
.side-label:hover { color: var(--side-ink); filter: none; box-shadow: none; }
.side-label svg { width: 14px; height: 14px; opacity: 0; transition: transform .2s, opacity .2s; }
.side-nav:hover .side-label svg, .side-group.shut .side-label svg { opacity: .7; }
.side-group.shut .side-label svg { transform: rotate(-90deg); }
.side-group.shut .side-link { display: none; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 6px 10px; margin: 2px 0; border-radius: 12px;
  color: var(--side-ink); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s;
}
.side-link .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(135deg, var(--mod), var(--mod-2)); box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.side-link .ic svg { width: 17px; height: 17px; stroke-width: 2; }
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.side-link.on { background: rgba(255,255,255,.13); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.side-link.on:not(:has(.count))::after { content: ""; position: absolute; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; }
.side-link .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: #f43f5e; color: #fff; font-size: 11px; font-weight: 800; text-align: center; line-height: 22px; box-shadow: 0 0 0 3px rgba(244, 63, 94, .25); }
.side-link .ext { margin-left: auto; width: 14px; height: 14px; opacity: .5; }
.side-foot { position: relative; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.collapse-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; margin: 0; min-height: 0; border: 0; border-radius: 10px; background: none; box-shadow: none; color: var(--side-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.collapse-btn:hover { background: rgba(255,255,255,.07); color: #fff; box-shadow: none; filter: none; }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 32px;
  background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; margin: 0 0 0 -8px; padding: 8px; min-height: 0; border: 0; background: none; box-shadow: none; border-radius: 10px; color: var(--ink-2); cursor: pointer; }
.menu-btn:hover { background: var(--line-2); color: var(--ink); box-shadow: none; filter: none; }
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; color: var(--muted); }
.crumbs .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, var(--mod), var(--mod-2)); }
.crumbs .ic svg { width: 16px; height: 16px; stroke-width: 2; }
.crumbs b { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.today { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.today svg { width: 16px; height: 16px; color: var(--brand); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; border: 1px solid transparent; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px color-mix(in srgb, var(--brand) 30%, transparent); }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.who { line-height: 1.25; }
.who b { display: block; font-size: 14px; }
.who span { font-size: 12px; color: var(--muted); }
.usermenu .drop { position: absolute; right: 0; top: calc(100% + 10px); width: 300px; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px; animation: pop .15s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.drop-head { display: flex; gap: 12px; align-items: center; padding: 16px 14px; margin: -10px -10px 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.drop-head .who span { color: rgba(255,255,255,.85); }
.drop-head .avatar { background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.drop a, .drop button.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin: 0; min-height: 0; border: 0; border-radius: 10px; background: none; box-shadow: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.drop a:hover, .drop button.item:hover { background: var(--line-2); color: var(--ink); text-decoration: none; filter: none; box-shadow: none; }
.drop button.out { color: var(--bad); }
.drop button.out:hover { color: var(--bad); }
.drop-label { padding: 10px 10px 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); margin-top: 6px; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 0 10px 10px; }
.swatches button { width: 100%; aspect-ratio: 1; margin: 0; padding: 0; min-height: 0; border-radius: 10px; border: 2px solid transparent; cursor: pointer; box-shadow: var(--shadow); }
.swatches button.on { border-color: var(--card); box-shadow: 0 0 0 2px var(--ink); }
.swatches button:hover { transform: scale(1.08); }
.sw-royal { background: linear-gradient(135deg, #5b5bd6, #9b5cf6) !important; }
.sw-plum { background: linear-gradient(135deg, #714b67, #017e84) !important; }
.sw-ocean { background: linear-gradient(135deg, #0369a1, #06b6d4) !important; }
.sw-emerald { background: linear-gradient(135deg, #059669, #0ea5a4) !important; }
.sw-sunset { background: linear-gradient(135deg, #ea580c, #db2777) !important; }
.sw-graphite { background: linear-gradient(135deg, #475569, #0ea5e9) !important; }

.content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 32px; flex: 1; }
.foot { padding: 16px 32px 24px; font-size: 12px; color: var(--muted); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.company-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.company-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; min-width: 36px; justify-content: center; padding: 0 10px; border-radius: 10px; color: var(--muted); border: 1px solid var(--line); background: var(--card); text-decoration: none !important; font-size: 13px; font-weight: 600; }
.company-links a:hover, .company-links a:focus-visible { color: var(--brand-ink); border-color: var(--brand); }
.company-links .i { width: 16px; height: 16px; }
.foot .company-links a { padding: 0; }
.auth-follow { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; justify-items: center; }
.scrim { display: none; }

/* Collapsed side menu (desktop): icons only. */
html.side-mini { --side-w: 84px; }
html.side-mini .side-group.shut .side-link { display: flex; }
html.side-mini .brand-text, html.side-mini .side-label, html.side-mini .side-link > span:not(.ic), html.side-mini .side-link .ext, html.side-mini .collapse-btn span { display: none; }
html.side-mini .side-link { justify-content: center; padding: 6px; }
html.side-mini .side-link.on::after { display: none; }
html.side-mini .side-link .count { position: absolute; top: -2px; right: 6px; min-width: 18px; line-height: 18px; font-size: 10px; padding: 0 5px; }
html.side-mini .brand { justify-content: center; padding: 0; }
html.side-mini .side-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.07); }
html.side-mini .side-group:first-child { border-top: 0; }
html.side-mini .collapse-btn { justify-content: center; }
html.side-mini .collapse-btn svg { transform: rotate(180deg); }

@media (max-width: 960px) {
  html.side-mini { --side-w: 264px; }
  html.side-mini .brand-text, html.side-mini .side-label, html.side-mini .side-link > span:not(.ic) { display: revert; }
  html.side-mini .side-link { justify-content: flex-start; padding: 6px 10px; }
  .sidebar { transform: translateX(-100%); width: 284px; box-shadow: var(--shadow-lg); }
  .side-foot { display: none; }
  body.side-open .sidebar { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px; }
  .today, .who { display: none; }
}

/* ---------- Headings and the coloured page banner ---------- */
h1 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 750; letter-spacing: -.01em; margin: 28px 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.page-head, .hello {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px; padding: 26px 30px; border-radius: 20px; color: #fff;
  background: linear-gradient(120deg, var(--mod) 0%, var(--mod-2) 100%);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--mod) 30%, transparent);
}
.page-head::before, .hello::before { content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; right: -90px; top: -170px; border-radius: 50%; background: rgba(255,255,255,.14); }
.page-head::after, .hello::after { content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; right: 180px; bottom: -150px; border-radius: 50%; background: rgba(255,255,255,.10); }
.page-head h1, .hello h1 { color: #fff; }
.page-head p, .hello p { margin: 4px 0 0; }
.page-head .muted, .hello .muted { color: rgba(255,255,255,.88); }
.page-head a:not(.btn), .hello a:not(.btn) { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.page-head .badge, .hello .badge { background: rgba(255,255,255,.94); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.page-head .avatar { background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.page-head .btn, .hello .btn, .page-head button, .hello button { background: #fff; color: var(--mod); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.page-head .btn:hover, .hello .btn:hover, .page-head button:hover { color: var(--mod); filter: brightness(.97); }
.page-head .btn.secondary, .hello .btn.secondary, .page-head button.secondary { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.5); box-shadow: none; }
.page-head .btn.secondary:hover, .hello .btn.secondary:hover, .page-head button.secondary:hover { background: rgba(255,255,255,.26); color: #fff; }
.page-head .month-nav { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); box-shadow: none; }
.page-head .month-nav a, .page-head .month-nav b { color: #fff; text-decoration: none; }
.page-head .month-nav a:hover { background: rgba(255,255,255,.2); }
.watermark { position: absolute; right: 30px; bottom: -22px; z-index: -1; width: 140px !important; height: 140px !important; opacity: .16; stroke-width: 1.3 !important; pointer-events: none; }
.page-head:has(.head-actions) .watermark, .page-head:has(.month-nav) .watermark { right: auto; left: 55%; }

/* ---------- Cards and stats ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }

.stat { position: relative; overflow: hidden; display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 24px; box-shadow: var(--shadow); color: inherit; transition: box-shadow .2s, transform .2s; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--c1, var(--brand)), var(--c2, var(--brand-2))); }
.grid > .stat:nth-child(4n+1) { --c1: #6366f1; --c2: #a855f7; }
.grid > .stat:nth-child(4n+2) { --c1: #ec4899; --c2: #f97316; }
.grid > .stat:nth-child(4n+3) { --c1: #0ea5e9; --c2: #14b8a6; }
.grid > .stat:nth-child(4n+4) { --c1: #f59e0b; --c2: #ef4444; }
.stat .muted { font-size: 13px; font-weight: 600; }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: 4px; }
a.stat:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat .tile { float: right; margin-left: 12px; color: var(--c1, var(--brand)); background: color-mix(in srgb, var(--c1, var(--brand)) 12%, var(--card)); }
.stat small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
/* Filled, colourful cards (dashboard). */
.stat.fill { border: 0; padding-left: 20px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 12px 28px color-mix(in srgb, var(--c1) 35%, transparent); }
.stat.fill::before { display: none; }
.stat.fill::after { content: ""; position: absolute; width: 160px; height: 160px; right: -50px; bottom: -80px; border-radius: 50%; background: rgba(255,255,255,.14); }
.stat.fill .muted, .stat.fill small { color: rgba(255,255,255,.9); }
.stat.fill .tile { background: rgba(255,255,255,.22); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }

.tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-ink); }
.tile.ok { background: var(--ok-soft); color: var(--ok); }
.tile.warn { background: var(--warn-soft); color: var(--warn); }
.tile.bad { background: var(--bad-soft); color: var(--bad); }
.tile.info { background: var(--info-soft); color: var(--info); }
.tile.violet { background: rgba(139, 92, 246, .12); color: color-mix(in srgb, #7c3aed 75%, var(--ink)); }
.tile.mod { color: #fff; background: linear-gradient(135deg, var(--mod), var(--mod-2)); box-shadow: 0 6px 14px color-mix(in srgb, var(--mod) 35%, transparent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
th { background: color-mix(in srgb, var(--mod) 8%, var(--card)); font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: color-mix(in srgb, var(--mod) 75%, var(--ink)); border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: color-mix(in srgb, var(--mod) 4%, var(--card)); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td a { font-weight: 650; }
.wrap { white-space: normal; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 18px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.grey { background: var(--line-2); color: var(--muted); }
.badge.client { background: color-mix(in srgb, #ec4899 12%, var(--card)); color: color-mix(in srgb, #be185d 70%, var(--ink)); }

/* ---------- Forms and buttons ---------- */
label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
input, select, textarea {
  width: 100%; padding: 10px 13px; min-height: 42px; border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--input); color: var(--ink); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand); }
textarea { min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
form p { margin: 0 0 4px; }
form p label { margin-top: 12px; }
.helptext { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
ul.errorlist { list-style: none; margin: 8px 0 0; padding: 0; color: var(--bad); font-size: 13px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; padding: 10px 18px; min-height: 42px; border: 1px solid transparent; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent); transition: filter .15s, box-shadow .15s, transform .1s;
}
button:hover, .btn:hover { filter: brightness(1.07); text-decoration: none; color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
button.secondary, .btn.secondary { background: var(--card); color: var(--ink-2); border-color: var(--line); box-shadow: var(--shadow); }
button.secondary:hover, .btn.secondary:hover { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
button.danger, .btn.danger { background: linear-gradient(135deg, #ef4444, #be123c); box-shadow: 0 6px 16px rgba(225, 29, 72, .3); }
button.big, .btn.big { font-size: 17px; padding: 14px 32px; min-height: 54px; border-radius: 14px; }
button.small, .actions button, .btn.small { margin: 0; padding: 6px 14px; min-height: 34px; font-size: 13px; border-radius: 9px; box-shadow: none; }
.actions button.big { padding: 14px 32px; min-height: 54px; font-size: 17px; border-radius: 14px; margin: 4px 0 8px; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 32%, transparent); }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.head-actions .btn, .head-actions button { margin: 0; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters select, .filters input { width: auto; flex: 1 1 130px; min-width: 0; max-width: 220px; font-size: 14px; }
.filters input[type=search] { flex: 2 1 180px; max-width: none; }
.filters input[type=date] { min-width: 0; }
.filters button { margin: 0; background: linear-gradient(135deg, var(--mod), var(--mod-2)); box-shadow: 0 6px 16px color-mix(in srgb, var(--mod) 30%, transparent); }
.filters > svg { color: var(--mod); }

/* ---------- Details, messages, paging ---------- */
dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; margin: 0; }
dt { color: var(--muted); font-size: 14px; }
dd { margin: 0; font-weight: 600; }
.msg { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 13px; margin-bottom: 20px; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); font-size: 14px; font-weight: 600; }
.msg.error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); }
.msg.warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }
.msg.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.pager { margin-top: 16px; display: flex; gap: 16px; align-items: center; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; }
.month-nav a { padding: 5px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; }
.month-nav a:hover { background: var(--line-2); text-decoration: none; }
.month-nav b { padding: 5px 12px; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); background: var(--card); border: 2px dashed var(--line); border-radius: var(--radius); }

/* ---------- Dashboard ---------- */
.hello { padding: 30px 34px; min-height: 150px; }
.hello h1 { font-size: 30px; }
.hello .date { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: 12.5px; font-weight: 700; }
.hello .date svg { width: 14px; height: 14px; }
.hello-art { position: absolute; right: 330px; top: 50%; transform: translateY(-50%); z-index: -1; }
@media (max-width: 1250px) { .hello-art { display: none; } }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px; margin-bottom: 26px; }
.apps-title { margin: 26px 0 14px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); font-size: 13px; font-weight: 700; text-align: center; transition: transform .2s, box-shadow .2s; }
.app:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 14px 28px color-mix(in srgb, var(--mod) 22%, transparent); }
.app .ic { position: relative; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--mod), var(--mod-2)); box-shadow: 0 8px 18px color-mix(in srgb, var(--mod) 40%, transparent), inset 0 -3px 0 rgba(0,0,0,.12); }
.app .ic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.3), transparent 55%); }
.app .ic svg { width: 26px; height: 26px; stroke-width: 1.9; }
.app .count { position: absolute; top: -7px; right: -7px; z-index: 1; min-width: 22px; padding: 0 6px; border-radius: 999px; background: #f43f5e; color: #fff; font-size: 11px; font-weight: 800; line-height: 22px; box-shadow: 0 0 0 3px var(--card); }

.bars { display: grid; gap: 16px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 110px; gap: 14px; align-items: center; font-size: 14px; font-weight: 600; }
.bar-track { height: 12px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.mp-ebay .bar-fill { background: linear-gradient(90deg, #e53238 0 25%, #0064d2 25% 50%, #f5af02 50% 75%, #86b817 75%); }
.mp-etsy .bar-fill { background: linear-gradient(90deg, #f1641e, #ff9a5a); }
.mp-tiktok-shop .bar-fill { background: linear-gradient(90deg, #25f4ee, #fe2c55); }
.mp-vinted .bar-fill { background: linear-gradient(90deg, #007782, #09b1ba); }
.bar-row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.mp-dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; background: var(--brand); }
.mp-ebay .mp-dot { background: #0064d2; } .mp-etsy .mp-dot { background: #f1641e; } .mp-tiktok-shop .mp-dot { background: #fe2c55; } .mp-vinted .mp-dot { background: #09b1ba; }

.donut-wrap { display: flex; align-items: center; gap: 22px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.donut { width: 110px; height: 110px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.donut span { width: 76px; height: 76px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-align: center; font-size: 21px; font-weight: 800; line-height: 1; }
.donut span small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.legend { display: grid; gap: 10px; font-size: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; }

.todo { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.todo:last-child { border-bottom: 0; }
a.todo:hover { text-decoration: none; }
a.todo:hover b { color: var(--brand-ink); }
.todo .grow { flex: 1; min-width: 0; }
.todo small { display: block; color: var(--muted); font-size: 13px; }
.todo .tile { width: 42px; height: 42px; }

/* ---------- Log in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--card); }
.auth-art {
  position: relative; overflow: hidden; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(700px 420px at 0% 0%, #8b5cf6 0%, transparent 60%), radial-gradient(600px 420px at 100% 100%, #ec4899 0%, transparent 60%), radial-gradient(500px 300px at 90% 10%, #0ea5e9 0%, transparent 60%), #1e1b4b;
}
.auth-art .brand { padding: 0; height: auto; }
.auth-art h2 { font-size: 38px; line-height: 1.15; letter-spacing: -.03em; font-weight: 800; margin: 0 0 16px; max-width: 480px; }
.auth-art p { color: rgba(255,255,255,.82); max-width: 460px; margin: 0; }
.auth-points { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; max-width: 540px; }
.auth-points div { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); font-size: 13.5px; font-weight: 600; backdrop-filter: blur(6px); }
.auth-points .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--mod), var(--mod-2)); }
.auth-points .ic svg { width: 18px; height: 18px; }
.mock { position: absolute; right: 44px; top: 40px; width: 250px; padding: 18px; border-radius: 20px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px); transform: rotate(5deg); box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.mock .bars-mini { display: flex; align-items: end; gap: 8px; height: 84px; margin-top: 14px; }
.mock .bars-mini i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #fff, rgba(255,255,255,.35)); }
.mock small { font-size: 12px; opacity: .85; }
.mock b { display: block; font-size: 24px; }
.mock .up { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(52, 211, 153, .3); font-size: 12px; font-weight: 700; }
@media (max-width: 1600px) { .mock { display: none; } }
.auth-form { display: grid; place-items: center; padding: 32px 24px; background: radial-gradient(800px 400px at 100% 0%, var(--brand-soft), transparent 70%), var(--card); }
.auth-form .box { width: 100%; max-width: 390px; }
.auth-form h1 { font-size: 30px; }
.auth-form button { width: 100%; margin-top: 24px; min-height: 50px; font-size: 15px; }
.auth-mobile-brand { display: none; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; font-weight: 800; font-size: 19px; }
}

/* ---------- Error pages ---------- */
.oops { max-width: 520px; margin: 64px auto; text-align: center; }
.oops .tile { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 20px; }
.oops .tile svg { width: 32px; height: 32px; }

/* ---------- Small page helpers ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--brand-ink); text-decoration: none; }
.person { display: inline-flex; align-items: center; gap: 10px; }
.person .avatar { width: 32px; height: 32px; font-size: 11px; box-shadow: none; }
.title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.title-row h1 { margin: 0; }
.card .table-wrap { box-shadow: none; }
.card + h2, .row2 + h2, .split + h2, .grid + h2 { margin-top: 32px; }
.table-input { width: 120px; min-height: 36px; padding: 6px 10px; font-size: 14px; text-align: right; border-radius: 9px; }
.table-input.text { width: 160px; text-align: left; }
.note-input { width: 150px; min-height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 9px; }
tr.total td { background: color-mix(in srgb, var(--mod) 9%, var(--card)); font-weight: 800; border-top: 1px solid var(--line); font-size: 15px; }
.sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 10px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, var(--mod), var(--mod-2)); font-size: 13px; font-weight: 800; }

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px 14px 14px 18px; }
  .stat b { font-size: 23px; }
  .stat .tile { width: 32px; height: 32px; border-radius: 9px; }
  .stat .tile svg { width: 16px; height: 16px; }
  .stat .muted { font-size: 12px; }
  h1 { font-size: 22px; }
  .hello h1 { font-size: 23px; }
  .page-head, .hello { padding: 20px; border-radius: 16px; margin-bottom: 18px; }
  .card { padding: 18px; }
  .bar-row { grid-template-columns: 84px 1fr 84px; font-size: 13px; }
  .apps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .app { padding: 8px 0; font-size: 11px; border: 0; background: none; box-shadow: none; }
  .app .ic { width: 52px; height: 52px; border-radius: 15px; }
  .app .ic svg { width: 23px; height: 23px; }
  .watermark { display: none; }
}

@media print {
  .sidebar, .topbar, .foot, .head-actions { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .page-head { color: #000; background: none; box-shadow: none; padding: 0; }
  .page-head h1, .page-head .muted { color: #000; }
  .card, .table-wrap { box-shadow: none; }
}

/* ---------- Queries ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.tabs a:hover { background: var(--line-2); text-decoration: none; }
.tabs a.on { color: #fff; background: linear-gradient(135deg, var(--mod), var(--mod-2)); }
.tabs a.pill { padding: 6px 12px; font-size: 13px; border: 1px solid var(--line); }
.tabs a.pill.on { border-color: transparent; }
.tabs a.pill.red:not(.on) { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.tabs-gap { flex: 1; }
.dot-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #f43f5e; color: #fff; font-size: 11px; line-height: 20px; text-align: center; }
tr.row-overdue td { background: color-mix(in srgb, var(--bad) 6%, var(--card)); }
tr.row-overdue td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
tr.row-unread td a { font-weight: 800; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 0 3px rgba(244, 63, 94, .2); }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-2 { grid-template-columns: 1fr; } }

/* ---------- Queries chat (like a phone chat app) ---------- */
.chat-app { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; height: calc(100vh - var(--top-h) - 64px); min-height: 520px; }
.chat-side { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 16px; }
.chat-side-head .btn { margin: 0; }
.chat-side-list { flex: 1; overflow-y: auto; }
.chat-side-all { padding: 12px 16px; border-top: 1px solid var(--line); font-weight: 700; font-size: 13.5px; }
.chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card-2); }
.chat-head-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-head-main b { font-size: 15.5px; }
.chat-head-main .muted { font-size: 12.5px; }
.chat-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chat-head-actions form { margin: 0; }
.chat-back { display: none; color: var(--ink-2); }
.chat-topic { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.chat-topic b { margin-right: 4px; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px;
  background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--mod) 9%, transparent) 1px, transparent 0) 0 0 / 22px 22px, var(--bg); }
.chat-day { text-align: center; margin: 10px 0 14px; }
.chat-day span { padding: 4px 12px; border-radius: 999px; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 700; box-shadow: var(--shadow); }
.chat-event { margin: 10px auto; width: fit-content; max-width: 90%; padding: 6px 14px; border-radius: 999px; background: var(--card); font-size: 13px; text-align: center; box-shadow: var(--shadow); }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; margin: 6px 0; }
.bubble-row .avatar { width: 30px; height: 30px; font-size: 10.5px; box-shadow: none; }
.bubble-row.mine { flex-direction: row-reverse; }
.bubble-row.mine .avatar { display: none; }
.bubble { position: relative; max-width: min(520px, 78%); padding: 7px 10px 5px 12px; border-radius: 4px 14px 14px 14px; background: var(--card); color: var(--ink);
  font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; box-shadow: 0 1px 1.5px rgba(15, 23, 42, .12); }
.bubble-row.mine .bubble { border-radius: 14px 4px 14px 14px; background: color-mix(in srgb, var(--mod) 16%, var(--card)); }
.bubble-name { font-size: 12.5px; font-weight: 800; color: var(--mod); margin-bottom: 2px; }
.bubble-foot { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 11px; color: var(--muted); }
.ticks { font-size: 12px; letter-spacing: -3px; padding-right: 3px; color: var(--muted); }
.ticks.seen { color: #0ea5e9; }
.bubble-files { display: grid; gap: 4px; margin: 2px -4px 4px; }
.bubble.only-files .bubble-files { margin-bottom: 2px; }
.bf-photo { display: block; border-radius: 10px; overflow: hidden; background: var(--line-2); }
.bf-photo img { display: block; width: 100%; max-width: 320px; max-height: 320px; object-fit: cover; }
.bf-video { display: block; width: 100%; max-width: 340px; max-height: 300px; border-radius: 10px; background: #000; }
.bf-audio { display: flex; align-items: center; gap: 6px; min-width: 240px; }
.bf-audio .i { color: var(--mod); flex: none; }
.bf-audio audio { width: 100%; height: 38px; }
.bf-doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); min-width: 220px; }
.bf-doc:hover { text-decoration: none; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.bf-ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--mod); color: #fff; flex: none; }
.bf-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bf-meta b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-meta span { font-size: 12px; color: var(--muted); }
.chat-closed { text-align: center; margin: 0; padding: 14px; border-top: 1px solid var(--line); }

/* Task and store-problem history uses the same bubbles in a simpler card. */
.chat-title { margin: 0; padding: 18px 22px 0; }
.chat:not([data-chat]) .chat-scroll { flex: none; max-height: 62vh; }
.bubble-head { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 2px; font-size: 12px; }
.bubble-head span { opacity: .7; }
.chat:not([data-chat]) .chat-box { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px; }
.chat:not([data-chat]) .chat-box textarea { min-height: 46px; resize: vertical; }
.chat:not([data-chat]) .chat-box button { margin: 0; flex: none; }

/* The message box */
.chat-box { padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card-2); margin: 0; }
.chat-box.boxed { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; }
.composer { display: flex; flex-direction: column; gap: 8px; }
.cp-row { display: flex; align-items: flex-end; gap: 8px; }
.cp-row textarea { flex: 1; min-height: 44px; max-height: 160px; margin: 0; padding: 11px 14px; border-radius: 22px; resize: none; line-height: 1.4; }
.cp-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; min-height: 0; flex: none; margin: 0; padding: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); border: 0; box-shadow: none; cursor: pointer; }
.cp-btn:hover { background: var(--line-2); color: var(--mod); }
.cp-btn input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 0; }
.cp-send { width: 46px; height: 46px; min-height: 0; flex: none; margin: 0; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mod), var(--mod-2)); color: #fff; }
.cp-send.busy { opacity: .6; }
.cp-files { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-chip { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); max-width: 260px; }
.cp-chip img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.cp-chip-ic { width: 42px; height: 42px; display: grid; place-items: center; font-size: 20px; border-radius: 8px; background: var(--line-2); }
.cp-chip-meta { display: flex; flex-direction: column; min-width: 0; }
.cp-chip-meta b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.cp-chip-meta span { font-size: 11.5px; color: var(--muted); }
.cp-chip-x { width: 26px; height: 26px; min-height: 0; margin: 0; padding: 0; border-radius: 50%; background: var(--line-2); color: var(--ink-2); box-shadow: none; font-size: 16px; line-height: 1; }
.cp-rec { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--bad); }
.cp-rec button { margin: 0; min-height: 32px; padding: 4px 12px; font-size: 13px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: rec 1s infinite; }
@keyframes rec { 50% { opacity: .2; } }
.cp-error { margin: 0; font-size: 13px; }

/* The chat list */
.convo-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.convo-search { position: relative; flex: 1; min-width: 220px; max-width: 420px; margin: 0; }
.convo-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.convo-search input { padding-left: 38px; margin: 0; border-radius: 12px; }
.convo-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.convo-filters .pill { display: inline-flex; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-weight: 700; font-size: 13px; }
.convo-filters .pill:hover { text-decoration: none; background: var(--line-2); }
.convo-filters .pill.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--mod), var(--mod-2)); }
.convo-filters .pill.red:not(.on) { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.convo-list { padding: 0; overflow: hidden; }
.convo { display: flex; gap: 12px; padding: 12px 16px; color: var(--ink); border-bottom: 1px solid var(--line); }
.convo:last-child { border-bottom: 0; }
.convo:hover { text-decoration: none; background: var(--line-2); }
.convo.on { background: color-mix(in srgb, var(--mod) 10%, var(--card)); }
.convo.late { box-shadow: inset 3px 0 0 var(--bad); }
.convo .avatar { width: 44px; height: 44px; font-size: 14px; box-shadow: none; }
.convo-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.convo-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.convo-who { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-time { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.convo.unread .convo-time { color: var(--mod); font-weight: 800; }
.dir { flex: none; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.dir.out { color: var(--info); background: var(--info-soft); }
.dir.in { color: var(--warn); background: var(--warn-soft); }
.convo-subject { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-last { display: flex; align-items: center; gap: 8px; }
.convo-preview { flex: 1; min-width: 0; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo.unread .convo-preview { color: var(--ink); font-weight: 600; }
.convo-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chat-side .convo { padding: 10px 14px; }
.chat-side .convo .avatar { width: 40px; height: 40px; font-size: 13px; }
.chat-side .dir { display: none; }

/* The chat pop-up on every page */
.qpop { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.qpop-btn { position: relative; width: 58px; height: 58px; min-height: 0; margin: 0; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow-lg); }
.qpop-btn .i { width: 26px; height: 26px; }
.qpop.open .qpop-btn { transform: scale(.92); }
.qpop-count { position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #f43f5e; color: #fff;
  font-size: 12px; line-height: 22px; text-align: center; box-shadow: 0 0 0 3px var(--card); }
.qpop-panel { position: absolute; right: 0; bottom: 72px; width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px)); padding: 0;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.qpop-panel[hidden] { display: none; }
.qpop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 16px; }
.qpop-x { width: 34px; height: 34px; min-height: 0; margin: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.15); box-shadow: none; color: #fff; }
.qpop-body { overflow-y: auto; }
.qp-tabs { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.qp-tabs button { flex: 1; margin: 0; min-height: 36px; padding: 6px; border-radius: 10px; background: transparent; color: var(--ink-2); box-shadow: none; font-size: 14px; }
.qp-tabs button.on { background: var(--brand-soft); color: var(--brand-ink); }
.qp-empty { padding: 18px 16px; margin: 0; text-align: center; }
.qp-all { display: block; padding: 12px 16px; font-weight: 700; font-size: 13.5px; }
.qp-form { padding: 12px 14px 4px; margin: 0; }
.qp-form p { margin: 0 0 10px; }
.qp-form .chat-box.boxed { margin-bottom: 8px; }
.qp-more { font-size: 12.5px; }
.qpop .convo { padding: 10px 14px; }
.qpop .convo .avatar { width: 40px; height: 40px; }
.qpop .dir { display: none; }

@media (max-width: 960px) {
  .chat-app { grid-template-columns: 1fr; height: calc(100vh - var(--top-h) - 32px); }
  .chat-side { display: none; }
  .chat-back { display: grid; }
}
@media (max-width: 600px) {
  .chat-head { flex-wrap: wrap; }
  .chat-head-actions { width: 100%; justify-content: flex-start; }
  .bubble { max-width: 86%; }
  .qpop { right: 14px; bottom: 14px; }
  .convo-tags { display: none; }
}
@media print { .qpop { display: none; } }

/* ---------- My organisation ---------- */
.org-branch { margin-bottom: 30px; }
.org-branch > h2 { display: flex; align-items: center; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.chip .avatar { width: 28px; height: 28px; font-size: 10.5px; box-shadow: none; }
.chip small { color: var(--muted); font-weight: 500; }
.chip.me { border-color: var(--brand); }
.team-card { margin-top: 16px; padding: 0; overflow: hidden; }
.team-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; background: linear-gradient(120deg, color-mix(in srgb, var(--mod) 10%, var(--card)), var(--card)); border-bottom: 1px solid var(--line); }
.team-top h3 { margin: 0; font-size: 16px; }
.team-body { padding: 14px 20px 18px; }
.team-card .table-wrap { border: 0; border-radius: 0; border-top: 1px solid var(--line); }
.lead { display: inline-flex; align-items: center; gap: 10px; }
.lead .avatar { width: 40px; height: 40px; }
.lead small { display: block; color: var(--muted); font-size: 12px; }
.mini-people { display: inline-flex; }
.mini-people .avatar { width: 26px; height: 26px; font-size: 10px; margin-left: -6px; box-shadow: 0 0 0 2px var(--card); }
.mini-people .avatar:first-child { margin-left: 0; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.flag.red { color: var(--bad); }
.flag.amber { color: var(--warn); }
.flag.green { color: var(--ok); }

/* ---------- Finance (CEO only) ---------- */
.lock-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,.92); background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; margin-top: 8px; }
.lock-note .i { width: 14px; height: 14px; }
.cur-lines { display: grid; gap: 2px; margin-top: 4px; }
.cur-lines b { font-size: 24px; }
.stat .cur-lines b { margin-top: 0; }
.share { display: flex; height: 8px; width: 120px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, #ec4899 22%, var(--card)); margin-top: 5px; }
.share i { display: block; background: linear-gradient(90deg, var(--mod), var(--mod-2)); }
.share-label { display: block; font-size: 12px; color: var(--muted); }
.share-label b { color: var(--ink); }
.client-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; background: linear-gradient(120deg, color-mix(in srgb, var(--mod) 10%, var(--card)), var(--card)); border-bottom: 1px solid var(--line); }
.client-head h3 { margin: 0; font-size: 17px; }
.client-head .figs { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.client-head .figs b { display: block; font-size: 16px; color: var(--ink); }
.client-card { margin-top: 18px; padding: 0; overflow: hidden; }
.client-card .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.state { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.state.PAID { background: var(--ok-soft); color: var(--ok); }
.state.PARTIAL { background: var(--warn-soft); color: var(--warn); }
.state.UNPAID { background: var(--line-2); color: var(--ink-2); }
.state.late { background: var(--bad-soft); color: var(--bad); }
.progress { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin: 10px 0 4px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #14b8a6); border-radius: 999px; }
.pay-inline { display: flex; gap: 6px; align-items: center; }
.pay-inline input { width: 110px; min-height: 34px; padding: 5px 9px; font-size: 13px; margin: 0; }
.pay-inline input[type=date] { width: 140px; }
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.att-list li:last-child { border-bottom: 0; }
.att-list small { display: block; color: var(--muted); font-size: 12px; }
.split > *, .row2 > * { min-width: 0; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
.att-list b { white-space: nowrap; }
.payout-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ---------- Targets & store requests ---------- */
.target-bar { position: relative; overflow: visible; }
.target-bar i { border-radius: 999px; }
.target-bar i.s-ACHIEVED { background: linear-gradient(90deg, #10b981, #14b8a6); }
.target-bar i.s-ON_TRACK { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.target-bar i.s-BEHIND { background: linear-gradient(90deg, #f59e0b, #f97316); }
.target-bar i.s-MISSED { background: linear-gradient(90deg, #ef4444, #e11d48); }
.target-bar em { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--ink); opacity: .55; border-radius: 2px; }
.mini-stat { padding: 12px 14px; border-radius: 12px; background: var(--line-2); }
.mini-stat .muted { font-size: 12.5px; font-weight: 600; display: block; }
.mini-stat b { font-size: 22px; display: block; }
.mini-stat small { font-size: 12px; color: var(--muted); }
.check-list { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.check-list label { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; margin: 0; }
.check-list input { width: auto; margin: 0; }
[data-mod="target"]   { --mod: #db2777; --mod-2: #f59e0b; }
[data-mod="hand"]     { --mod: #0891b2; --mod-2: #6366f1; }

/* ---------- Tasks ---------- */
[data-mod="task"]     { --mod: #7c3aed; --mod-2: #0ea5e9; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board-col { background: var(--line-2); border-radius: 16px; padding: 12px; display: grid; gap: 10px; }
.board-col h3 { margin: 2px 4px 4px; font-size: 14px; display: flex; gap: 6px; }
.board-empty { margin: 4px; font-size: 13px; }
.task-card { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); }
.task-card:hover { text-decoration: none; border-color: var(--mod); }
.task-card.late { box-shadow: inset 4px 0 0 var(--bad), var(--shadow); }
.task-card b { font-size: 14.5px; line-height: 1.35; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.task-meta .i { width: 14px; height: 14px; }
.task-meta .avatar { width: 22px; height: 22px; font-size: 9.5px; }
@media (max-width: 900px) { .board { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Notifications ---------- */
[data-mod="bell"]     { --mod: #ea580c; --mod-2: #e11d48; }
.mode-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; margin: 0; padding: 0; min-height: 0; border: 0; border-radius: 12px; background: var(--line-2); color: var(--ink-2); box-shadow: none; }
.mode-btn:hover { color: var(--brand); filter: none; box-shadow: none; }
.mode-btn .i { width: 20px; height: 20px; }
.mode-btn .sun { display: none; }
:root[data-mode="dark"] .mode-btn .sun { display: block; }
:root[data-mode="dark"] .mode-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root[data-mode="auto"] .mode-btn .sun { display: block; }
  :root[data-mode="auto"] .mode-btn .moon { display: none; }
}
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 10px 6px; }
.modes button { margin: 0; padding: 8px 4px; min-height: 0; flex-direction: column; gap: 4px; font-size: 12px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); box-shadow: none; border: 1.5px solid transparent; }
.modes button:hover { color: var(--ink); filter: none; }
.modes button.on { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.modes .i { width: 18px; height: 18px; }
.bell { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--line-2); color: var(--ink-2); }
.bell:hover { text-decoration: none; color: var(--brand); }
.bell .i { width: 20px; height: 20px; }
.bell b { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--card); }
.note-list { display: grid; gap: 0; }
.note-item { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
.note-item:last-child { border-bottom: 0; }
.note-item:hover { text-decoration: none; background: var(--line-2); }
.note-item .grow { flex: 1; min-width: 0; }
.note-item .grow b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.note-item small { color: var(--muted); font-size: 12.5px; }
.note-item.new { background: color-mix(in srgb, var(--mod) 6%, var(--card)); }
.note-item.new .grow b { font-weight: 800; }
.note-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mod); flex: none; }
.note-item .dot.off { background: transparent; }
.check-row { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 8px 0 0; }
.check-row input { width: auto; margin: 0; }

/* ---------- Reports ---------- */
[data-mod="report"]   { --mod: #1d4ed8; --mod-2: #0d9488; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-of-type { border-bottom: 0; }
.kv span:first-child { color: var(--ink-2); }
.kv b { text-align: right; white-space: nowrap; }
.kv.total { border-top: 2px solid var(--line); border-bottom: 0; margin-top: 4px; padding-top: 12px; font-size: 16px; }
.kv b.ok { color: var(--ok); }
tr.total-row td { background: var(--line-2); font-weight: 700; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .month-nav, .btn, button { display: none !important; }
  .row2 { grid-template-columns: 1fr 1fr; }
  tr { break-inside: avoid; }
  h2 { break-after: avoid; }
}

/* ---------- Store logins ---------- */
[data-mod="key"]      { --mod: #b45309; --mod-2: #7c3aed; }
.vault-lock { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.vault-lock .grow { flex: 1; min-width: 0; }
.vault-lock label { font-weight: 600; }
.vault-item { margin-bottom: 12px; padding: 14px 16px; }
.vault-item.open { border-color: var(--mod); }
.vault-row { display: flex; gap: 14px; align-items: center; }
.vault-row .grow { flex: 1; min-width: 0; }
.vault-row .grow b { display: block; }
.vault-row small { overflow-wrap: anywhere; }
dl.secret { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; margin: 14px 0 10px; align-items: center; }
dl.secret dt { color: var(--muted); font-weight: 600; font-size: 13px; }
dl.secret dd { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
dl.secret code { background: var(--line-2); padding: 4px 8px; border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; user-select: all; }

/* ---------- Products & research ---------- */
[data-mod="box"]      { --mod: #0e7490; --mod-2: #65a30d; }
[data-mod="bulb"]     { --mod: #ca8a04; --mod-2: #db2777; }
[data-mod="truck"]    { --mod: #4338ca; --mod-2: #0891b2; }
.ok-text { color: var(--ok); }

/* ---------- Who can use what (CEO) ---------- */
[data-mod="toggle"]   { --mod: #0f766e; --mod-2: #6366f1; }
.switch-row { display: flex; align-items: center; gap: 16px; margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line-2); font-weight: 500; cursor: pointer; }
.switch-row .grow { flex: 1; min-width: 0; }
.switch-row b { display: block; color: var(--ink); font-size: 14.5px; }
.switch-row small { display: block; color: var(--muted); font-size: 13px; }
input.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 46px; min-height: 0; height: 26px; padding: 0; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background .2s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
input.switch:checked { background: linear-gradient(135deg, var(--mod), var(--mod-2)); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mod) 25%, transparent); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }

/* ---------- Dashboard: waiting list and attendance today ---------- */
.stack { display: grid; gap: 20px; align-content: start; }
.stat b .of { font-size: 18px; font-weight: 700; opacity: .8; }
.big-count { min-width: 34px; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--mod) 14%, var(--card)); color: color-mix(in srgb, var(--mod) 70%, var(--ink)); font-weight: 800; font-size: 15px; text-align: center; }
.all-clear { display: flex; gap: 14px; align-items: center; padding: 6px 0; }
.all-clear small { display: block; color: var(--muted); font-size: 13px; }
.att-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 3px; background: var(--line-2); }
.att-bar i { display: block; min-width: 6px; }
.att-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.att-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.att-chip i { width: 9px; height: 9px; border-radius: 50%; }
.att-chip b { color: var(--ink); }
.t-ok { --t: #10b981; } .t-warn { --t: #f59e0b; } .t-info { --t: #0ea5e9; } .t-bad { --t: #ef4444; } .t-grey { --t: #94a3b8; }
.att-bar i, .att-chip i { background: var(--t); }

/* ---------- Trend charts (sales and profit by month) ---------- */
:root { --series-sales: #2a78d6; --series-profit: #eb6834; }
:root[data-mode="dark"] { --series-sales: #3987e5; --series-profit: #d95926; }
@media (prefers-color-scheme: dark) { :root[data-mode="auto"] { --series-sales: #3987e5; --series-profit: #d95926; } }
.k-sales { --k: var(--series-sales); } .k-profit { --k: var(--series-profit); }
.trend { margin: 0 0 22px; }
.trend:last-of-type { margin-bottom: 0; }
.trend figcaption { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trend-legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--k); }
.trend-legend .muted { font-weight: 500; margin-left: auto; font-size: 12px; }
.trend-plot { display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.trend-y { position: relative; height: 200px; }
.trend-y span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend-area { position: relative; height: 200px; margin-right: 76px; }
.trend-area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trend-area .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-area .grid.zero { stroke: color-mix(in srgb, var(--ink) 35%, transparent); }
.trend-area .ln { fill: none; stroke: var(--k); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trend-area .pt { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--k); box-shadow: 0 0 0 2px var(--card); }
.end-label { position: absolute; left: 100%; transform: translateY(-50%); padding-left: 10px; font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend-hover { position: absolute; inset: 0; display: grid; }
.trend-hover > div { outline: 0; cursor: crosshair; }
.trend-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--ink) 30%, transparent); pointer-events: none; }
.trend-tip { position: absolute; top: 4px; z-index: 2; margin-left: 12px; min-width: 150px; padding: 8px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 12.5px; pointer-events: none; display: grid; gap: 3px; }
.trend-tip[hidden], .trend-cross[hidden] { display: none; }
.trend-tip.left { transform: translateX(-100%); margin-left: -12px; }
.trend-tip span { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.trend-tip span b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.trend-tip i { width: 10px; height: 3px; border-radius: 2px; background: var(--k); }
.trend-tip small { color: var(--muted); }
.trend-x { display: grid; margin: 8px 76px 0 64px; font-size: 11.5px; color: var(--muted); text-align: center; }
.trend-x small { display: block; font-size: 10.5px; }
.trend-table { margin-top: 10px; font-size: 13px; }
.trend-table summary { cursor: pointer; color: var(--brand-ink); font-weight: 600; }
.trend-table .table-wrap { margin-top: 10px; }
@media (max-width: 600px) {
  .trend-plot { grid-template-columns: 52px minmax(0, 1fr); }
  .trend-area { margin-right: 8px; }
  .end-label { display: none; }
  .trend-x { margin: 8px 8px 0 52px; }
  .trend-x span:nth-child(even) { visibility: hidden; }
  .trend-y, .trend-area { height: 170px; }
}

/* ---------- Search (top bar, search page, find in list) ---------- */
.top-search { position: relative; display: flex; align-items: center; }
.top-search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.top-search input { width: 250px; min-height: 0; height: 36px; padding: 0 12px 0 34px; border-radius: 999px; font-size: 13.5px; background: var(--line-2); border-color: transparent; transition: width .2s, background .2s; }
.top-search input:focus { width: 320px; background: var(--card); border-color: var(--brand); }
.top-search-btn { display: none; width: 38px; height: 38px; border-radius: 10px; align-items: center; justify-content: center; color: var(--ink-2); }
@media (max-width: 1180px) { .top-search input { width: 190px; } .top-search input:focus { width: 240px; } }
@media (max-width: 960px) { .top-search { display: none; } .top-search-btn { display: inline-flex; } }
.big-search input[type=search] { font-size: 16px; min-height: 46px; }
.search-sec { margin-bottom: 16px; }
.search-sec h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.search-sec h2 .tile { width: 32px; height: 32px; border-radius: 9px; }
.search-sec h2 .tile svg { width: 17px; height: 17px; }
.find .find-count { font-size: 13px; white-space: nowrap; }

/* ---------- Store problems ---------- */
[data-mod="alert"]    { --mod: #dc2626; --mod-2: #f97316; }
.problem-list { display: grid; }
.problem { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 12px; color: var(--ink); border-left: 4px solid transparent; }
.problem + .problem { margin-top: 2px; }
.problem:hover { background: var(--line-2); text-decoration: none; }
.problem.u-urgent:not(.fixed) { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 60%, transparent); }
.problem.u-high:not(.fixed) { border-left-color: var(--warn); }
.problem .grow { flex: 1; min-width: 0; }
.problem .grow b { display: block; overflow-wrap: anywhere; }
.problem small { display: block; color: var(--muted); font-size: 13px; }
.problem .tile { width: 40px; height: 40px; }
.problem-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.prob-flag { display: flex; width: max-content; margin-top: 6px; }
fieldset.pick { border: 0; padding: 0; margin: 4px 0 6px; display: flex; gap: 8px; flex-wrap: wrap; }
fieldset.pick legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
fieldset.pick label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; margin: 0; }
fieldset.pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
fieldset.pick label.pick-urgent:has(input:checked) { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
fieldset.pick label.pick-high:has(input:checked) { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
@media (max-width: 600px) { .problem { flex-wrap: wrap; } .problem-badges { width: 100%; justify-content: flex-start; padding-left: 54px; } }

/* ---------- My planner ---------- */
[data-mod="note"]     { --mod: #7c3aed; --mod-2: #0ea5e9; }
.quick-add { margin-bottom: 18px; padding: 14px; }
.qa-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.qa-row > select { flex: 0 0 120px; width: auto; }
.qa-row > input[type=text] { flex: 1 1 240px; width: auto; }
.qa-row button { margin: 0; }
.qa-row label { flex: 1 1 160px; margin: 0; font-size: 13px; }
.qa-more { margin-top: 10px; }
.qa-more summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.plan-head { display: flex; align-items: center; gap: 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 20px 0 8px; }
.plan-head.bad { color: var(--bad); }
.plan-head.warn { color: var(--warn); }
.plan-list { padding: 4px 6px; }
.plan-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line-2); }
.plan-item:last-child { border-bottom: 0; }
.plan-item .grow { flex: 1; min-width: 0; color: var(--ink); }
.plan-item .grow:hover { text-decoration: none; }
.plan-item .grow > b { display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.plan-item small { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 4px; color: var(--muted); font-size: 13px; }
.plan-item small span { display: inline-flex; align-items: center; gap: 4px; }
.plan-item small svg { width: 14px; height: 14px; }
.plan-item .pin { width: 15px; height: 15px; color: var(--mod); }
.plan-item.done .grow > b { text-decoration: line-through; color: var(--muted); }
.plan-item.p-urgent:not(.done) { box-shadow: inset 3px 0 0 var(--bad); }
.plan-item.p-high:not(.done) { box-shadow: inset 3px 0 0 var(--warn); }
.plan-item form { margin: 0; }
.tick { width: 26px; height: 26px; min-height: 0; padding: 0; margin: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: transparent; box-shadow: none; display: grid; place-items: center; }
.tick svg { width: 15px; height: 15px; }
.tick:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.plan-item.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.note-body { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.note-grid .plan-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border-top: 4px solid var(--mod); }
.goal-bar { display: block; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.goal-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--mod), var(--mod-2)); }
.goal-pct { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.goal-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 40px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.goal-row:hover { text-decoration: none; }
.goal-row .grow b { display: block; overflow-wrap: anywhere; }
.goal-row small { display: block; color: var(--muted); font-size: 13px; }
.goal-row .goal-bar { margin: 0; }
.goal-row .goal-pct { text-align: right; }
.mini-add { display: flex; gap: 8px; margin-top: 12px; }
.mini-add input { flex: 1; min-width: 0; min-height: 38px; }
.mini-add button { margin: 0; padding: 0 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 8px 0 14px; }

/* ---------- People and the CEO's team card ---------- */
.role-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.role-chips a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-weight: 650; font-size: 13.5px; }
.role-chips a b { color: var(--ink); }
.role-chips a:hover { text-decoration: none; border-color: var(--brand); }
.role-chips a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.role-chips a.on b { color: #fff; }
a.bar-row { color: var(--ink); }
a.bar-row:hover { text-decoration: none; }
a.bar-row:hover .bar-fill { filter: brightness(1.1); }
.team-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
.team-split h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 4px; }
a.kv { color: var(--ink); }
a.kv:hover { text-decoration: none; color: var(--brand); }
@media (max-width: 600px) { .team-split { grid-template-columns: 1fr; } .bar-row { grid-template-columns: 110px 1fr 40px; } }
.crumbs { min-width: 0; overflow: hidden; white-space: nowrap; }
@media (max-width: 600px) { .crumbs > span:not(.ic), .crumbs > svg { display: none; } .crumbs b { overflow: hidden; text-overflow: ellipsis; } }

/* ---------- Month on month (always shown) with the graph on request ---------- */
.compare-wrap { display: grid; gap: 14px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare-cur { grid-column: 1 / -1; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--muted); margin-bottom: -4px; }
.cmp-tile { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.cmp-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.cmp-label i { width: 10px; height: 3px; border-radius: 2px; background: var(--series-sales); }
.cmp-label i.k-profit { background: var(--series-profit); }
.cmp-tile > b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cmp-tile > b.muted { font-size: 16px; font-weight: 650; }
.cmp-change { font-size: 13px; color: var(--muted); }
.chg { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; font-weight: 750; background: var(--line-2); color: var(--ink-2); }
.chg.up { background: var(--ok-soft); color: var(--ok); }
.chg.down { background: var(--bad-soft); color: var(--bad); }
.cmp-tile small { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 4px; }
details.trend-open { margin-top: 14px; }
details.trend-open > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--brand-ink); background: var(--brand-soft); }
details.trend-open > summary::-webkit-details-marker { display: none; }
details.trend-open > summary svg { width: 16px; height: 16px; }
details.trend-open > summary:hover { border-color: var(--brand); }
details.trend-open .when-open, details.trend-open[open] .when-shut { display: none; }
details.trend-open[open] .when-open { display: inline; }
details.trend-open[open] > summary { margin-bottom: 16px; }
@media (max-width: 600px) { .compare { grid-template-columns: minmax(0, 1fr); } }
.chg.sm { display: flex; width: max-content; margin: 3px 0 0 auto; font-size: 11.5px; padding: 0 6px; }

/* ---------- User manual ---------- */
[data-mod="book"]     { --mod: #0d9488; --mod-2: #4f46e5; }
.manual { display: grid; gap: 14px; max-width: 900px; }
.manual-role > summary { cursor: pointer; list-style: none; }
.manual-role > summary::-webkit-details-marker { display: none; }
.manual-role > summary h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.manual-role > summary h2::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 600; }
.manual-role[open] > summary h2::after { content: "−"; }
.manual-role > summary p { margin: 0; }
.manual-role h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--mod); margin: 20px 0 6px; }
.manual-role ul { margin: 0; padding-left: 20px; display: grid; gap: 7px; line-height: 1.55; }
@media print { .manual nav, .sidebar, .topbar, .foot { display: none !important; } .manual-role { break-inside: avoid; box-shadow: none; } }
.drop button.item[hidden] { display: none; }

/* Login security (2-step login) */
.auth.auth-single { grid-template-columns: 1fr; }
.auth-single .auth-mobile-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; margin-bottom: 18px; }
.code-input { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.msg.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.sec-state { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.sec-state > .i { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); flex: none; }
.sec-state.on > .i { background: var(--ok-soft); color: var(--ok); }
.sec-state b, .sec-state span { display: block; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.grid-2 h3 { margin: 0 0 4px; }
.setup-steps { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.setup-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.setup-steps .qr { text-align: center; }
.setup-steps .qr svg { display: block; width: 200px; height: 200px; border-radius: 12px; }
.setup-steps .key { display: inline-block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line); word-break: break-all; font-size: 14px; letter-spacing: .08em; }
.confirm-row { margin-top: 20px; max-width: 360px; }
.confirm-row .qa-row { display: flex; gap: 8px; }
.code-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 18px; padding-left: 22px; font-size: 16px; }
.recovery { border: 2px dashed var(--warn); margin-bottom: 20px; }
@media (max-width: 640px) { .setup-steps { grid-template-columns: 1fr; } .setup-steps .qr svg { margin: 0 auto; } }
@media print { .recovery { border: 0; } .recovery button { display: none; } }

/* Dashboard tile whose numbers stay hidden until the eye is pressed */
.secret .stretch { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.secret .peek { position: relative; z-index: 2; display: inline-flex; vertical-align: middle; margin: -4px 0 0 6px; padding: 4px; height: auto; min-height: 0; width: auto; box-shadow: none; font-size: 0; border: 0; border-radius: 8px; background: rgba(255,255,255,.2); color: inherit; cursor: pointer; }
.secret .peek:hover, .secret .peek:focus-visible { background: rgba(255,255,255,.35); }
.secret .peek .i { width: 16px; height: 16px; }
.secret .mask, .secret.is-hidden .shown, .secret .eye-off, .secret.is-hidden .eye-on { display: none; }
.secret.is-hidden .mask, .secret.is-hidden .eye-off { display: inline; }
.secret .mask[aria-hidden] { filter: blur(6px); user-select: none; }
.secret .peek { gap: 4px; padding: 3px 9px 3px 6px; }
.secret .peek-word { font-size: 12px; font-weight: 700; }
.secret small .mask[aria-hidden] { filter: blur(4px); }
.secret.is-hidden .mask.sr, .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Client page: who gets what from each store's profit */
.split-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.share-bar { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line); margin-bottom: 12px; }
.share-bar i { display: block; height: 100%; min-width: 2px; }
.sb-client { background: #94a3b8; }
.sb-ref { background: #f59e0b; }
.sb-staff { background: #0ea5e9; }
.sb-brema { background: var(--brand); }
.share-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.share-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.share-table td.in { padding-left: 18px; }
.share-table tr.total td { border-bottom: 0; border-top: 2px solid var(--line); }
.share-table .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.cp-rec[hidden], .cp-files[hidden], .cp-error[hidden], .cp-mic[hidden] { display: none; }

/* Each person's profit on a store */
.people-card { margin-bottom: 18px; }
.people-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.people-head h2 { margin: 0; }
.people-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.people-sum span { padding: 6px 12px; border-radius: 10px; background: var(--line-2); font-size: 13px; color: var(--muted); }
.people-sum b { color: var(--ink); margin-left: 4px; }
.people-card .form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
.people-card .form-actions button { margin: 0; }
.people-card .form-actions .muted { font-size: 13px; }
.people-table td.shares { min-width: 300px; }
.share-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 0; font-size: 13.5px; }

/* ---------- Pay plans ---------- */
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.choice { position: relative; display: block; margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body { display: grid; gap: 3px; height: 100%; padding: 12px 14px 12px 40px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); transition: border-color .15s, box-shadow .15s, background .15s; }
.choice-body::before { content: ""; position: absolute; left: 14px; top: 15px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); box-sizing: border-box; }
.choice-body b { font-size: 14px; }
.choice-body small { font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.4; }
.choice:hover .choice-body { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.choice input:checked + .choice-body { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--card)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.choice input:checked + .choice-body::before { border: 5px solid var(--brand); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--brand); outline-offset: 2px; }
.field-title { margin: 4px 0 0; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.plan-form [hidden] { display: none !important; }
.plan-form .form-actions, .plan-form-row .form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.plan-form .form-actions button { margin: 0; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 34px; }
.input-suffix i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 700; color: var(--muted); }
.plan-stack { display: grid; gap: 20px; }
.plan-stack .card-head, .plan-cols .card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.plan-stack .card-head h2 { margin: 0; }
.plan-stack .card-head .muted { font-size: 13px; }
.plan-stores { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; align-items: start; }
.plan-stores .plan-store { margin-top: 0; }
.plan-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }
.plan-cols .card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.plan-cols .card-head h2 { margin: 0; }
.plan-cols .card-head .muted { font-size: 13px; }
.plan-line { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.plan-line.ended { opacity: .7; }
.plan-what b { white-space: nowrap; }
.plan-what { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.plan-what small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.plan-amount { text-align: right; font-weight: 800; font-size: 16px; white-space: nowrap; }
.plan-amount small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.plan-store { margin-top: 10px; padding: 4px 14px 2px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--line-2) 45%, var(--card)); }
.plan-store-head { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.plan-store-head .tile { width: 34px; height: 34px; border-radius: 10px; }
.plan-store-head small { display: block; color: var(--muted); font-size: 12px; }
.plan-none { padding: 14px 0 4px; border-top: 1px solid var(--line); margin: 0; }
.line-actions { display: flex; gap: 6px; align-items: center; }
.line-actions form { margin: 0; }
.line-actions .btn, .line-actions button { margin: 0; }
.icon-btn { padding: 0 8px; }
.end-pop { position: relative; }
.end-pop summary { list-style: none; cursor: pointer; }
.end-pop summary::-webkit-details-marker { display: none; }
.end-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 250px; display: grid; gap: 8px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.end-form label { margin: 0; font-size: 13px; }
.end-form button { margin: 0; }
.plan-more summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.plan-more summary h2 { margin: 0; }
.plan-more summary::-webkit-details-marker { display: none; }
.plan-more[open] summary { margin-bottom: 6px; }
.share-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 640px) {
  .plan-stores, .plan-cols { grid-template-columns: 1fr; }
  .plan-line { grid-template-columns: 1fr auto; }
  .line-actions { grid-column: 1 / -1; }
}
/* A whole card can be "secret" too: its content stays blurred until Show is pressed. */
.card.secret { position: relative; }
.card.secret .peek { background: var(--line-2); color: var(--ink-2); margin-left: 8px; }
.card.secret .peek:hover, .card.secret .peek:focus-visible { background: var(--brand-soft); color: var(--brand-ink); }
.card.secret.is-hidden .secret-body { filter: blur(9px); user-select: none; pointer-events: none; }
.card.secret .secret-body { transition: filter .2s; }

/* ---------- Chat: groups, ticks, delete and forward ---------- */
.avatar.group { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.avatar.group .i { width: 18px; height: 18px; }
.dir.grp { color: var(--ok); background: var(--ok-soft); }
.ticks { font-size: 13px; }
.ticks.seen { color: #34b7f1; }
.ticks.some { color: var(--muted); }
.group-names { display: block; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-info { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--line-2) 50%, var(--card)); display: grid; gap: 10px; }
.group-info[hidden] { display: none; }
.group-info-head { display: flex; gap: 8px; align-items: center; }
.group-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.group-members li { display: flex; align-items: center; gap: 10px; }
.group-members .avatar { width: 32px; height: 32px; font-size: 11px; }
.group-members form { margin: 0 0 0 auto; }
.gm-who { display: grid; }
.gm-who small { color: var(--muted); font-size: 12px; }
.group-add summary { list-style: none; display: inline-flex; cursor: pointer; }
.group-add summary::-webkit-details-marker { display: none; }
.group-add .check-list { margin: 10px 0; }
.danger-link { background: none; border: 0; box-shadow: none; color: var(--bad); padding: 4px 0; min-height: 0; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin: 0; }
.danger-link:hover { background: none; text-decoration: underline; color: var(--bad); }
.bubble-menu { position: absolute; top: 4px; right: 6px; z-index: 3; opacity: 0; transition: opacity .15s; }
.bubble:hover .bubble-menu, .bubble-menu[open], .bubble-menu:focus-within { opacity: 1; }
@media (pointer: coarse) { .bubble-menu { opacity: .7; } }
.bubble-menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--muted); box-shadow: var(--shadow); }
.bubble-menu summary::-webkit-details-marker { display: none; }
.bubble-menu summary .i { width: 14px; height: 14px; }
.bubble-menu-list { position: absolute; right: 0; top: 28px; min-width: 190px; padding: 6px; display: grid; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.bubble-row:not(.mine) .bubble-menu-list { right: auto; left: 0; }
.bubble-menu-list a, .bubble-menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin: 0; min-height: 0; border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.bubble-menu-list a:hover, .bubble-menu-list button:hover { background: var(--line-2); text-decoration: none; }
.bubble-menu-list .danger-link { color: var(--bad); }
.bubble-menu-list form { margin: 0; }
.bubble-menu-list .i { width: 16px; height: 16px; }
.bubble-fwd { display: flex; align-items: center; gap: 4px; font-size: 12px; font-style: italic; color: var(--muted); margin-bottom: 2px; }
.bubble-fwd .i { width: 12px; height: 12px; }
.bubble-deleted { font-style: italic; color: var(--muted); }
.bubble-row.deleted .bubble { opacity: .85; }
.fwd-dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.fwd-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.fwd-dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.fwd-dialog [data-forward-body] { padding: 14px 18px 18px; }
.fwd-preview { display: grid; gap: 4px; margin-bottom: 12px; }
.fwd-quote { padding: 8px 12px; border-left: 3px solid var(--brand); border-radius: 8px; background: var(--line-2); font-size: 14px; }
.fwd-title { margin: 0 0 6px; font-weight: 700; font-size: 13.5px; }
.fwd-list { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; margin-bottom: 12px; }
.fwd-chat { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0; border-radius: 10px; cursor: pointer; font-weight: 500; }
.fwd-chat:hover { background: var(--line-2); }
.fwd-chat .avatar { width: 34px; height: 34px; font-size: 11px; }
.fwd-who { display: grid; min-width: 0; }
.fwd-who small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-actions { display: flex; gap: 10px; }
.fwd-actions button { margin: 0; }
.chat-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--card); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); transition: opacity .4s; }
.chat-toast.go { opacity: 0; }
.member-find { margin-bottom: 8px; }
.member-list { max-height: 240px; }
.member-list label[hidden] { display: none; }
