/* ================= Command Center core styles =================
   Tokens on :root; a module may set its own palette in modules/<id>/theme.css.
   Fonts: Poppins (bundled, offline). 700-800 headings + numbers, 600 buttons. No serif. */
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(fonts/poppins-400.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 500; font-display: swap; src: url(fonts/poppins-500.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(fonts/poppins-600.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(fonts/poppins-700.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 800; font-display: swap; src: url(fonts/poppins-800.woff2) format("woff2"); }

:root {
  --bg: #F6F2EA; --surface: #FFFFFF; --surface2: #FBF8F2; --line: #E7E0D3; --ink: #2B3033; --ink2: #5D6468; --ink3: #8B9195;
  --accent: #6F8F76; --accent-d: #4F6E57; --accent-l: #E4ECE3; --accent-ink: #FFFFFF;
  --charcoal: #2F3437; --beige: #EADFCB; --gold: #C9A66B;
  --good: #3F8E5A; --good-l: #E2F1E6; --warn: #B7791F; --warn-l: #FBF0DC; --bad: #C0533F; --bad-l: #F8E3DE; --info: #4E7A9A; --info-l: #E3EDF4;
  --c1: #6F8F76; --c2: #C9A66B; --c3: #4E7A9A; --c4: #C0533F; --c5: #8E7AB5; --c6: #2F3437;
  --r: 18px; --r-s: 12px; --shadow: 0 1px 2px rgb(43 48 51 / .05), 0 6px 20px rgb(43 48 51 / .06);
  --side: 248px; --font: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="linen"] { --bg: #EFE6D6; --surface2: #F7F0E4; --line: #DDD0B9; --accent: #8A7454; --accent-d: #6B5939; --accent-l: #EFE5D3; --c1: #8A7454; }
:root[data-theme="charcoal"] {
  --bg: #1E2123; --surface: #2A2E31; --surface2: #24282A; --line: #3A3F43; --ink: #F1EEE8; --ink2: #C3C0B9; --ink3: #8F948F;
  --accent: #93B39A; --accent-d: #B7D1BC; --accent-l: #33403A; --accent-ink: #15201A; --good-l: #23382A; --warn-l: #3D3221; --bad-l: #422823; --info-l: #23323D;
  --c6: #E9E4DA; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .num, .kpi-v, .brand-name { font-family: var(--font); font-weight: 800; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 20px; } h3 { font-size: 16px; font-weight: 700; } h4 { font-size: 14px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-d); }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.hide { display: none !important; }
.muted { color: var(--ink2); } .small { font-size: 13px; } .tiny { font-size: 12px; color: var(--ink3); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .right { margin-left: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout: sidebar + main ---------- */
.app { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--charcoal); color: #EDE9E1; display: flex; flex-direction: column; padding: 18px 12px calc(14px + env(safe-area-inset-bottom)); z-index: 30; transition: transform .25s ease; }
:root[data-theme="charcoal"] .side { background: #161819; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border: 0; background: none; color: inherit; text-align: left; }
.brand img, .brand .logo-ph { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: var(--accent); flex: none; display: grid; place-items: center; }
.brand-name { font-size: 15px; line-height: 1.2; font-weight: 800; }
.brand-sub { font-size: 11px; color: #A9ACA6; font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: #CFCBC2; font-weight: 600; font-size: 14px; text-align: left; }
.nav button:hover { background: rgb(255 255 255 / .06); color: #fff; }
.nav button.on { background: var(--accent); color: var(--accent-ink); }
.nav .badge { margin-left: auto; }
.side-foot { display: flex; gap: 6px; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / .08); }
.side-foot button { flex: 1; border: 1px solid rgb(255 255 255 / .14); background: none; color: #E5E1D8; border-radius: 10px; padding: 7px; font-weight: 600; font-size: 13px; }
.side-foot button.on { background: rgb(255 255 255 / .12); }
.main { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 28px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.top h1 { font-size: 24px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .menu { display: none; }
.iconbtn { position: relative; width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink); }
.iconbtn:hover { border-color: var(--accent); }
.iconbtn .dot { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.page { padding: 8px 28px 40px; flex: 1; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bottom { display: none; }
.demo-bar { background: var(--charcoal); color: #fff; padding: 8px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.demo-bar a { background: var(--gold); color: #2B2B2B; padding: 5px 12px; border-radius: 999px; text-decoration: none; font-weight: 700; }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn.dark { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: none; border-color: transparent; }
.btn.sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn .ico { width: 18px; height: 18px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--ink2); border: 1px solid var(--line); white-space: nowrap; }
.chip.good { background: var(--good-l); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-l); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-l); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--info-l); color: var(--info); border-color: transparent; }
.chip.acc { background: var(--accent-l); color: var(--accent-d); border-color: transparent; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.tabs { display: flex; gap: 6px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; margin: 4px 0 18px; scrollbar-width: none; width: fit-content; max-width: 100%; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink2); white-space: nowrap; }
.tabs button.on { background: var(--charcoal); color: #fff; }
:root[data-theme="charcoal"] .tabs button.on { background: var(--accent); color: var(--accent-ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 8px 12px; font-weight: 600; font-size: 13px; color: var(--ink2); }
.seg button.on { background: var(--accent-l); color: var(--accent-d); }

/* ---------- cards + dashboard ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.wide { grid-column: span 2; }
.card.full { grid-column: 1 / -1; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h3 { flex: 1; }
.kpi { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: transform .15s, border-color .15s; font: inherit; color: inherit; }
.kpi:hover { transform: translateY(-2px); border-color: var(--accent); }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 13px; font-weight: 600; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-l); color: var(--accent-d); display: grid; place-items: center; }
.kpi-v { font-size: 28px; line-height: 1.15; margin-top: 6px; }
.kpi-s { font-size: 12.5px; color: var(--ink3); font-weight: 500; }
.up { color: var(--good); } .down { color: var(--bad); }
.hello { display: flex; align-items: center; gap: 18px; background: var(--charcoal); color: #fff; border-radius: 22px; padding: 22px 24px; margin-bottom: 18px; overflow: hidden; position: relative; }
.hello h2 { font-size: 24px; } .hello p { margin: 4px 0 0; color: #D6D2C9; }
.hello .art { margin-left: auto; width: 150px; height: 110px; flex: none; }
.hello .art img { width: 100%; height: 100%; object-fit: contain; }
.setup { border: 1.5px dashed var(--accent); background: var(--accent-l); }
.setup ol { margin: 8px 0 12px; padding-left: 20px; } .setup li { margin: 3px 0; }
.setup li.done { color: var(--ink3); text-decoration: line-through; }
.items { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; width: 100%; color: inherit; font: inherit; }
.item:first-child { border-top: 0; }
button.item:hover { background: var(--surface2); }
.item .grow { min-width: 0; } .item b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .num { font-size: 15px; font-weight: 700; }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.empty { text-align: center; padding: 34px 16px; color: var(--ink2); }
.empty .ico { width: 42px; height: 42px; color: var(--accent); margin-bottom: 8px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty p { margin: 0 auto 14px; max-width: 380px; font-size: 14px; }
.alert { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); margin-bottom: 8px; }
.alert.high { background: var(--bad-l); border-color: transparent; } .alert.high .ico { color: var(--bad); }
.alert.med { background: var(--warn-l); border-color: transparent; } .alert.med .ico { color: var(--warn); }
.alert.info .ico { color: var(--info); }
.alert .grow { font-size: 14px; font-weight: 500; }
.progress { height: 8px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stat .num { font-size: 20px; font-weight: 800; display: block; }
.stat span { font-size: 12px; color: var(--ink2); font-weight: 600; }

/* ---------- list / table ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink3); width: 18px; height: 18px; }
.search input { width: 100%; padding-left: 38px; }
.toolbar select { width: auto; min-width: 130px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); background: var(--surface2); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: 4px; align-items: center; }
.tbl th.sorted { color: var(--accent-d); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface2); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td b { font-weight: 600; }
.tbl .num { font-weight: 700; font-size: 14px; }
.count { font-size: 13px; color: var(--ink3); font-weight: 600; }

/* ---------- forms ---------- */
.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink2); min-width: 0; }
.f.req > span::after { content: " *"; color: var(--bad); }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 500; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-l); }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input[type=color] { padding: 4px; width: 60px; }
.invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 3px var(--bad-l) !important; }
.ferr { color: var(--bad); font-size: 12px; font-weight: 600; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fgrid .full { grid-column: 1 / -1; }
.fsec { grid-column: 1 / -1; font-weight: 800; font-size: 14px; color: var(--ink); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--ink); }
.chips input { display: none; }
.chips label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; grid-template-columns: 1fr 70px 100px 36px; gap: 8px; align-items: center; }
.stars { display: inline-flex; gap: 2px; color: var(--gold); }
.stars button { border: 0; background: none; padding: 2px; color: var(--line); }
.stars button.on { color: var(--gold); }
.stars .ico { fill: currentColor; stroke: none; }
.tip { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--line); color: var(--ink2); font-size: 11px; font-weight: 700; cursor: help; vertical-align: middle; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; background: var(--charcoal); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 500; line-height: 1.4; z-index: 90; white-space: normal; text-align: left; }

/* ---------- modal (pop-up) ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgb(30 33 35 / .5); animation: fadeIn .18s ease; overflow-y: auto; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { background: var(--surface); color: var(--ink); width: 100%; max-width: 560px; border-radius: 22px; box-shadow: 0 24px 70px rgb(0 0 0 / .3); display: flex; flex-direction: column; max-height: calc(100vh - 40px); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.sheet.wide { max-width: 860px; } .sheet.xwide { max-width: 1100px; }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { flex: 1; font-size: 19px; }
.sheet-b { padding: 16px 20px; overflow-y: auto; flex: 1; }
.sheet-f { display: flex; gap: 10px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet-f .btn.primary { margin-left: auto; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 14px; margin-bottom: 14px; }
.kv dt { color: var(--ink2); font-weight: 600; } .kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--charcoal); color: #fff; padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .25); display: flex; gap: 8px; align-items: center; animation: pop .25s ease; pointer-events: auto; }
.toast.err { background: var(--bad); }
.toast .ico { color: var(--accent-l); } .toast.err .ico { color: #fff; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 600 11px var(--font); fill: var(--ink3); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart rect.bar { transition: opacity .15s; }
.chart rect.bar:hover { opacity: .75; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; color: var(--ink2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.donut-wrap .legend { flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.donut-wrap .legend span { justify-content: space-between; gap: 10px; } .donut-wrap .legend b { color: var(--ink); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; }
.hbar .tr { height: 12px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }

/* ---------- calendar ---------- */
.cal-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.cal-bar h3 { font-size: 18px; font-weight: 800; min-width: 170px; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.month .dow { padding: 8px; font-size: 12px; font-weight: 700; color: var(--ink2); background: var(--surface2); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.month .day { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; background: none; border-top: 0; border-left: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.month .day:nth-child(7n) { border-right: 0; }
.month .day.out { background: var(--surface2); color: var(--ink3); }
.month .day.today .dn { background: var(--accent); color: var(--accent-ink); }
.month .dn { font-weight: 700; font-size: 13px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.pill { display: block; font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 7px; background: var(--accent-l); color: var(--ink); border-left: 3px solid var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; font-family: inherit; cursor: pointer; }
.pill.st-Completed { opacity: .65; } .pill.st-Cancelled, .pill.st-NoShow { text-decoration: line-through; opacity: .5; }
.more { font-size: 11px; color: var(--ink2); font-weight: 600; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.wcol { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; min-height: 260px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wcol h4 { font-size: 13px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); }
.wcol.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-l); }
.appt { display: block; text-align: left; width: 100%; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface2); border-radius: 10px; padding: 7px 9px; font: inherit; color: inherit; cursor: pointer; }
.appt b { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt span { display: block; font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt.st-Cancelled, .appt.st-NoShow { opacity: .55; } .appt.st-Cancelled b, .appt.st-NoShow b { text-decoration: line-through; }
.appt.st-Completed { background: var(--good-l); }
.tasks label { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-weight: 500; font-size: 14px; cursor: pointer; }
.tasks label:first-child { border-top: 0; }
.tasks input:checked + span { text-decoration: line-through; color: var(--ink3); }
.calc { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.total-box { position: sticky; top: 90px; background: var(--charcoal); color: #fff; border-radius: var(--r); padding: 20px; }
.total-box .ln { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; color: #D8D4CC; }
.total-box .ln b { color: #fff; font-weight: 700; }
.total-box .tot { border-top: 1px solid rgb(255 255 255 / .15); margin-top: 8px; padding-top: 12px; font-size: 16px; }
.total-box .tot b { font-size: 30px; font-weight: 800; color: #fff; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--surface2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.kcol h4 { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 4px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.kcard b { display: block; font-weight: 700; font-size: 14px; }
.kcard span { display: block; font-size: 12px; color: var(--ink2); }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; display: grid; place-items: center; padding: 0; }
.qty b { min-width: 34px; text-align: center; font-weight: 800; }
.doc { background: #fff; color: #222; padding: 28px; border-radius: 12px; border: 1px solid var(--line); }
.doc h1 { font-size: 26px; } .doc table { width: 100%; border-collapse: collapse; margin: 14px 0; } .doc td, .doc th { padding: 8px; border-bottom: 1px solid #e3e3e3; text-align: left; font-size: 14px; }
.doc .r { text-align: right; }

/* ---------- welcome / add to home screen ---------- */
.a2hs { position: fixed; inset: 0; z-index: 99; background: linear-gradient(160deg, rgb(111 143 118 / .55), rgb(47 52 55 / .8)); display: grid; place-items: center; padding: 20px 16px; overflow-y: auto; }
.a2hs-card { background: var(--surface); color: var(--ink); width: 100%; max-width: 440px; border-radius: 28px; padding: 26px 22px 20px; text-align: center; box-shadow: 0 24px 60px rgb(0 0 0 / .35); }
.a2hs-icon { width: 92px; height: 92px; border-radius: 22px; box-shadow: 0 10px 24px rgb(47 52 55 / .25); }
.a2hs-card h2 { margin: 14px 0 6px; font-size: 22px; }
.a2hs-card p { margin: 0 0 12px; color: var(--ink2); font-size: 14.5px; }
.a2hs-steps { text-align: left; margin: 10px 0 14px; padding-left: 22px; font-size: 14.5px; } .a2hs-steps li { margin: 6px 0; }
.a2hs-steps svg { vertical-align: -3px; }
.a2hs-card .btn { width: 100%; margin-top: 6px; }

/* ---------- print ---------- */
@media print {
  .side, .top, .bottom, .toasts, .demo-bar, .page { display: none !important; }
  .main { margin: 0; }
  .modal { position: static; background: none; padding: 0; display: block; }
  .modal.under { display: none; }
  .sheet { box-shadow: none; max-height: none; max-width: none; border-radius: 0; }
  .sheet-h .iconbtn, .sheet-f, .noprint { display: none !important; }
  body { background: #fff; }
}

/* ---------- tablet + phone ---------- */
@media (max-width: 1100px) { .card.wide { grid-column: span 1; } .calc { grid-template-columns: 1fr; } .total-box { position: static; } }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); box-shadow: 10px 0 40px rgb(0 0 0 / .3); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 25; }
  .main { margin-left: 0; }
  .top { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .top h1 { font-size: 20px; }
  .top .menu { display: grid; }
  .page { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 28; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink3); padding: 4px 0; }
  .bottom button.on { color: var(--accent-d); }
  .bottom .ico { width: 23px; height: 23px; }
  .week { grid-template-columns: 1fr; } .wcol { min-height: 0; }
  .month .day { min-height: 74px; padding: 4px; } .month .pill { font-size: 10px; padding: 2px 4px; }
  .kanban { grid-template-columns: repeat(5, 230px); }
}
@media (max-width: 640px) {
  .grid, .grid.kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid > .card:not(.kpi) { grid-column: 1 / -1; }
  .kpi { padding: 14px; } .kpi-v { font-size: 22px; } .kpi-ic { width: 30px; height: 30px; }
  .hello { padding: 18px; } .hello .art { width: 90px; height: 70px; } .hello h2 { font-size: 20px; }
  .fgrid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0 0; } .kv dd { margin-bottom: 8px; }
  .modal { padding: 0; place-items: end stretch; }
  .sheet, .sheet.wide, .sheet.xwide { max-width: none; border-radius: 22px 22px 0 0; max-height: 94vh; }
  .search { max-width: none; min-width: 100%; }
  .toolbar select { flex: 1; }
  table.tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  table.tbl { background: none; border: 0; box-shadow: none; }
  .tbl thead { display: none; }
  .tbl tr { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 8px 12px; box-shadow: var(--shadow); }
  .tbl td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl td::before { content: attr(data-l); font-size: 12px; color: var(--ink3); font-weight: 600; text-align: left; }
  .tbl td:first-child { font-size: 15px; } .tbl td:first-child::before { display: none; } .tbl td:first-child { justify-content: flex-start; text-align: left; }
  .line { grid-template-columns: 1fr 56px 84px 32px; }
  .hbar { grid-template-columns: 90px 1fr auto; }
  .month .dow { padding: 6px 2px; font-size: 10px; text-align: center; }
  .month .pill { display: none; } .month .day .more { display: none; }
  .month .day .dots { display: flex; }
}
.dots { display: none; gap: 3px; flex-wrap: wrap; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 640px) { .qa-l { display: none; } }
.modal { grid-template-columns: minmax(0, 1fr); }
.sheet, .sheet-b { min-width: 0; }
.empty .btn .ico { width: 18px; height: 18px; color: inherit; margin: 0; }
.stat { min-width: 0; }
.stat span { display: block; overflow-wrap: anywhere; hyphens: auto; }
.card .row > span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .grid.one-col { grid-template-columns: 1fr; } }
/* module art (ChatGPT pictures) */
.ico-art { width: 24px; height: 24px; object-fit: contain; flex: none; }
.kpi-ic .ico-art { width: 26px; height: 26px; }
.empty .empty-art { width: 96px; height: 96px; object-fit: contain; display: block; margin: 0 auto 8px; }
.hello .art.pic { width: 210px; height: 150px; margin: -14px -16px -22px auto; align-self: flex-end; }
.hello .art.pic img { object-fit: contain; object-position: right bottom; }
@media (max-width: 640px) { .hello .art.pic { width: 120px; height: 100px; margin: -8px -10px -18px auto; } }
