/* Frill ERP: plain CSS, no build step, no external fonts or CDNs (works on an office LAN). */
:root {
  --bg: #f4f6f5;
  --panel: #ffffff;
  --ink: #1b2421;
  --muted: #66736e;
  --line: #dfe5e2;
  --accent: #1d6b57;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ec;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --radius: 8px;
  --side: 224px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131917; --panel: #1b2421; --ink: #e8eeeb; --muted: #93a39c; --line: #2b3733;
    --accent: #4fb596; --accent-ink: #08241b; --accent-soft: #1d3a31;
    --danger: #ff8a80; --danger-soft: #3b1f1c; --warn: #f2c35b; --warn-soft: #3a2f12;
  }
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 1.1rem; padding: .25rem .6rem 1rem; color: var(--accent); }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.nav-h { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .9rem .6rem .25rem; }
.side a.nav { display: block; padding: .38rem .6rem; border-radius: 6px; color: var(--ink); }
.side a.nav:hover { background: var(--accent-soft); text-decoration: none; }
.side a.nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .who { margin-top: 1.2rem; padding: .6rem; border-top: 1px solid var(--line); font-size: .85rem; }
.main { padding: 1.25rem 1.5rem 3rem; min-width: 0; }
.topbar { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; left: -260px; width: 240px; transition: left .15s; box-shadow: 2px 0 12px rgba(0,0,0,.15); }
  body.nav-open .side { left: 0; }
  .topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .main { padding: 1rem; }
}

/* Cards and grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.card > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .g2, .g4 { grid-template-columns: 1fr; } }
.stat { display: block; color: inherit; }
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat .n { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat.bad .n { color: var(--danger); }
.dl { display: grid; grid-template-columns: 9.5rem 1fr; gap: .3rem .75rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } .dl dt { margin-top: .4rem; } }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--danger); font-weight: 600; }
.pos { color: var(--accent); }
.empty { padding: 1.5rem; text-align: center; color: var(--muted); }

/* Buttons and forms */
.btn { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: .42rem .85rem; border-radius: 6px; cursor: pointer; font: inherit; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: .2rem .55rem; font-size: .85rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .55rem; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=checkbox] { width: 1.05rem; height: 1.05rem; padding: 0; accent-color: var(--accent); }
textarea { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.2rem; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .2rem; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.field.wide { grid-column: 1 / -1; }
.field.check label { display: inline; font-weight: 500; margin-left: .4rem; }
.help { color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.errorlist { list-style: none; margin: .2rem 0 0; padding: 0; color: var(--danger); font-size: .85rem; }
.form-actions { margin-top: 1.2rem; display: flex; gap: .6rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; align-items: center; }
.filters input[type=search] { min-width: 14rem; }
.inline-form { display: inline; }
.fs-table input:not([type=checkbox]), .fs-table select { width: 100%; min-width: 6rem; }

/* Messages */
.msgs { list-style: none; padding: 0; margin: 0 0 1rem; }
.msgs li { padding: .6rem .9rem; border-radius: 6px; margin-bottom: .4rem; border: 1px solid var(--line); background: var(--panel); }
.msgs .success { border-color: var(--accent); background: var(--accent-soft); }
.msgs .error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.msgs .warning { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }

/* Badges */
.badge { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #e7ebe9; color: #38443f; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .badge { background: #2b3733; color: #c9d6d0; } }
.b-CONFIRMED, .b-IN_PROGRESS, .b-PICKED_UP, .b-IN_TRANSIT, .b-PREPARING, .b-HIGH2 { background: #dbeafe; color: #1d4ed8; }
.b-PROCUREMENT, .b-REVIEW, .b-QC, .b-FEEDBACK, .b-HIGH { background: #fef3c7; color: #92400e; }
.b-PRODUCTION { background: #ede9fe; color: #5b21b6; }
.b-READY, .b-OUT_FOR_DELIVERY, .b-DISPATCHED { background: #cffafe; color: #0e7490; }
.b-DELIVERED, .b-DONE, .b-COMPLETED, .b-APPROVED, .b-CONVERTED { background: #d1fae5; color: #065f46; }
.b-BLOCKED, .b-EXCEPTION, .b-REJECTED, .b-CANCELLED, .b-URGENT, .b-RETURNED { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .b-CONFIRMED, .b-IN_PROGRESS, .b-PICKED_UP, .b-IN_TRANSIT, .b-PREPARING { background: #1e3a5f; color: #9cc3ff; }
  .b-PROCUREMENT, .b-REVIEW, .b-QC, .b-FEEDBACK, .b-HIGH { background: #4a3a12; color: #f2c35b; }
  .b-PRODUCTION { background: #34265c; color: #c4b5fd; }
  .b-READY, .b-OUT_FOR_DELIVERY, .b-DISPATCHED { background: #123f4a; color: #7dd3e8; }
  .b-DELIVERED, .b-DONE, .b-COMPLETED, .b-APPROVED, .b-CONVERTED { background: #123d2f; color: #7ee0b5; }
  .b-BLOCKED, .b-EXCEPTION, .b-REJECTED, .b-CANCELLED, .b-URGENT, .b-RETURNED { background: #4a1f1c; color: #ffb3ab; }
}
.b-NORMAL, .b-LOW { background: transparent; color: var(--muted); padding-left: 0; font-weight: 500; }

/* Progress */
.bar { background: var(--line); border-radius: 999px; height: .5rem; overflow: hidden; min-width: 5rem; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.prog { display: flex; align-items: center; gap: .5rem; }
.prog span { font-size: .8rem; color: var(--muted); min-width: 2.3rem; }

/* Tasks */
.task { display: grid; grid-template-columns: 8rem minmax(0, 1.4fr) 7.5rem 6rem auto; gap: .35rem .5rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.task.sub { margin-left: 1.6rem; }
.task select, .task input { padding: .2rem .3rem; font-size: .85rem; width: 100%; }
.task .title { grid-column: 1 / -1; order: -1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.task.sub .title { font-weight: 500; }
.task.is-done .title { text-decoration: line-through; color: var(--muted); }
.task.is-overdue input[type=date] { color: var(--danger); border-color: var(--danger); }
.task .acts { display: flex; gap: .3rem; align-items: center; }
/* compact one-line variant used on "My tasks" */
.task.flat { grid-template-columns: 8.5rem minmax(0, 1fr) 8rem 6.5rem; }
.task.flat .title { grid-column: auto; order: 0; font-weight: 400; }
@media (max-width: 700px) { .task, .task.flat { grid-template-columns: 1fr 1fr; } .task .title { grid-column: 1 / -1; order: -1; } }
details.add > summary { cursor: pointer; color: var(--accent); font-size: .85rem; padding: .35rem 0; list-style: none; }
details.add[open] > summary { margin-bottom: .4rem; }
.add-form { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; gap: .5rem; align-items: end; }
@media (max-width: 900px) { .add-form { grid-template-columns: 1fr 1fr; } }

/* Kanban */
.kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.kb-col { flex: 0 0 250px; background: color-mix(in srgb, var(--line) 45%, var(--bg)); border-radius: var(--radius); padding: .5rem; min-height: 8rem; }
.kb-col h3 { display: flex; justify-content: space-between; padding: .2rem .35rem .5rem; margin: 0; }
.kb-col.drop { outline: 2px dashed var(--accent); }
.kb-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .55rem .65rem; margin-bottom: .5rem; cursor: grab; }
.kb-card.dragging { opacity: .4; }
.kb-card .t { font-weight: 600; display: block; }
.kb-card .m { color: var(--muted); font-size: .82rem; }
.kb-card.overdue { border-left: 3px solid var(--danger); }
.kb-card .row { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin-top: .3rem; }
.avatar { display: inline-flex; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .7rem; font-weight: 700; align-items: center; justify-content: center; }

/* Misc */
.pipeline .row { display: grid; grid-template-columns: 9rem 1fr 2rem; gap: .6rem; align-items: center; margin: .3rem 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .5rem 0 .5rem .9rem; border-left: 2px solid var(--line); margin-left: .3rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -.38rem; top: .85rem; width: .65rem; height: .65rem; border-radius: 50%; background: var(--accent); }
.comment { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.comment p { margin: .2rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1rem; }
.tabs a { margin-right: .6rem; }
.tabs a.on { font-weight: 700; text-decoration: underline; }
.login-box { max-width: 360px; margin: 12vh auto; }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: .5rem .8rem; margin-bottom: .6rem; }
.toast { position: fixed; bottom: 1rem; right: 1rem; background: var(--danger); color: #fff; padding: .6rem 1rem; border-radius: 6px; z-index: 50; }
@media print { .side, .topbar, .no-print { display: none !important; } .shell { display: block; } .main { padding: 0; } body { background: #fff; } }

/* ---- Order stages: one colour each (keep in sync with Order.STAGE_COLOURS) ---- */
.b-ORDER { --c: #64748b; }
.b-FOR_DESIGNING { --c: #c026d3; }
.b-UNDER_PRINTING { --c: #9333ea; }
.b-SHORT_MATERIAL { --c: #dc2626; }
.b-UNDER_PRODUCTION { --c: #ea580c; }
.b-IN_PRODUCTION { --c: #d97706; }
.b-IN_STOCK { --c: #65a30d; }
.b-READY_TO_DISPATCH { --c: #16a34a; }
.b-FINAL_PI { --c: #0d9488; }
.b-PAYMENT_AWAITED { --c: #ca8a04; }
.b-BILLING_REQUEST { --c: #2563eb; }
.b-READY_FOR_DISPATCH { --c: #0891b2; }
.b-DISPATCHED { --c: #4f46e5; }
.b-COMPLETE { --c: #15803d; }
.b-CANCELLED { --c: #991b1b; }
.badge.b-ORDER,.badge.b-FOR_DESIGNING,.badge.b-UNDER_PRINTING,.badge.b-SHORT_MATERIAL,.badge.b-UNDER_PRODUCTION,.badge.b-IN_PRODUCTION,.badge.b-IN_STOCK,.badge.b-READY_TO_DISPATCH,.badge.b-FINAL_PI,.badge.b-PAYMENT_AWAITED,.badge.b-BILLING_REQUEST,.badge.b-READY_FOR_DISPATCH,.badge.b-DISPATCHED,.badge.b-COMPLETE,.badge.b-CANCELLED { background: color-mix(in srgb, var(--c) 16%, var(--panel)); color: color-mix(in srgb, var(--c) 78%, var(--ink)); }

/* Stage stepper on the order page */
.stepper-card { padding: .8rem 1rem; }
.stepper { display: flex; gap: 3px; overflow-x: auto; }
.step { flex: 1 0 74px; text-align: center; font-size: .68rem; color: var(--muted); }
.step i { display: block; height: 8px; border-radius: 4px; background: var(--line); margin-bottom: .3rem; }
.step.done i { background: var(--c); opacity: .55; }
.step.now i { background: var(--c); }
.step.now { color: var(--ink); font-weight: 700; }
.step.todo span { opacity: .8; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; }
.task[style*="--c"] { border-left: 3px solid var(--c); }

/* Colour-coded pickers */
.stage-pick { border-color: var(--c, var(--line)); background: color-mix(in srgb, var(--c, transparent) 12%, var(--panel)); font-weight: 600; width: auto; min-width: 9.5rem; }
.stage-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .8rem; }
.chip { padding: .2rem .65rem; border-radius: 999px; border: 1px solid var(--c, var(--line)); color: var(--ink); font-size: .8rem; background: color-mix(in srgb, var(--c, transparent) 10%, var(--panel)); }
.chip b { margin-left: .25rem; }
.chip.on { background: var(--c, var(--accent)); color: #fff; text-decoration: none; }
.chip:hover { text-decoration: none; }
.kb-col[style*="--c"] { border-top: 4px solid var(--c); }
.kanban .kb-col { flex-basis: 232px; }

/* Order view switcher */
.view-tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin: -.2rem 0 .9rem; border-bottom: 1px solid var(--line); }
.view-tabs a { padding: .45rem .8rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.view-tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.view-tabs a:hover { text-decoration: none; color: var(--ink); }

/* Excel view */
.grid-wrap { padding: 0; overflow: auto; max-height: 70vh; }
.sheet { border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.sheet th { position: sticky; top: 0; z-index: 2; background: var(--panel); border-bottom: 2px solid var(--line); white-space: nowrap; }
.sheet td, .sheet th { border-right: 1px solid var(--line); padding: .25rem .4rem; }
.sheet td { border-bottom: 1px solid var(--line); white-space: nowrap; }
.sheet .sticky { position: sticky; left: 0; z-index: 3; background: var(--panel); }
.sheet tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 60%, var(--panel)); }
.cell { border: 1px solid transparent; background: transparent; padding: .2rem .3rem; width: 100%; min-width: 7rem; font: inherit; }
.cell.wide { min-width: 16rem; }
.cell:focus { border-color: var(--accent); background: var(--panel); outline: none; }
.cell.saved { background: var(--accent-soft); }
.cell.err { border-color: var(--danger); }
tr.hidden-row { display: none; }

/* Calendar */
.cal { padding: .5rem; overflow-x: auto; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 3px; }
.cal-head div { text-align: center; font-size: .75rem; color: var(--muted); padding: .2rem; }
.cal-day { min-height: 6.2rem; background: color-mix(in srgb, var(--line) 25%, var(--panel)); border-radius: 6px; padding: .25rem; margin-bottom: 3px; }
.cal-day.out { opacity: .45; }
.cal-day.today { outline: 2px solid var(--accent); }
.cal-day .dn { font-size: .75rem; color: var(--muted); }
.cal-chip { display: block; font-size: .72rem; padding: .1rem .35rem; margin-top: 2px; border-radius: 4px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--panel)); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { text-decoration: none; filter: brightness(.95); }
.legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .75rem; color: var(--muted); margin: .6rem 0; }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; background: var(--c); margin-right: .3rem; }

/* Timeline */
.gantt { padding: 0; overflow-x: auto; }
.g-row { display: grid; grid-template-columns: 170px minmax(640px, 1fr); border-bottom: 1px solid var(--line); min-height: 2.6rem; }
.g-head { position: sticky; top: 0; background: var(--panel); z-index: 2; min-height: 2rem; }
.g-name { padding: .3rem .6rem; position: sticky; left: 0; background: var(--panel); z-index: 1; border-right: 1px solid var(--line); }
.g-track { position: relative; }
.g-track .tick { position: absolute; top: .4rem; font-size: .68rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 3px; height: 1.2rem; }
.g-bar { position: absolute; top: .55rem; height: 1.5rem; border-radius: 5px; background: var(--c); color: #fff; font-size: .72rem; padding: 0 .4rem; line-height: 1.5rem; overflow: hidden; white-space: nowrap; }
.g-bar:hover { text-decoration: none; filter: brightness(1.08); }
.g-bar.late { outline: 2px solid var(--danger); }
.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .7; z-index: 1; }

.b-IN { --c: #15803d; } .b-OUT { --c: #c2410c; }
.badge.b-IN, .badge.b-OUT { background: color-mix(in srgb, var(--c) 16%, var(--panel)); color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.print-doc .doc-head { margin-bottom: .6rem; }
.print-doc .sign { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3.2rem; font-size: .85rem; }
.print-doc .sign div { border-top: 1px solid var(--ink); padding-top: .3rem; flex: 1; text-align: center; }
tfoot td { border-top: 2px solid var(--line); }

/* ---------- Dashboard widgets ---------- */
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.widget { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; min-width: 0; }
.widget.w2 { grid-column: 1 / -1; }
.widget > header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.widget > header h2 { margin: 0; font-size: 1rem; }
.dash.edit .widget { outline: 2px dashed var(--line); cursor: grab; }
.widget.dragging { opacity: .45; }
.widget.over { outline-color: var(--accent); }
.wtools .btn { padding: .1rem .45rem; }
.wrow { display: flex; justify-content: space-between; gap: .6rem; padding: .3rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.wrow:last-child { border-bottom: 0; }
.wmenu { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
.wopt { width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; cursor: pointer; display: flex; flex-direction: column; gap: .15rem; font: inherit; color: var(--ink); }
.wopt:hover { border-color: var(--accent); background: var(--accent-soft); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; }
.kpi { background: var(--bg); border-radius: 8px; padding: .6rem .8rem; display: block; color: var(--ink); }
.kpi:hover { text-decoration: none; background: var(--accent-soft); }
.kpi b { display: block; font-size: 1.6rem; line-height: 1.1; }
.kpi span { font-size: .8rem; color: var(--muted); }
.bars { display: grid; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: .5rem; align-items: center; font-size: .85rem; }
.bar-row .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bt { background: var(--bg); border-radius: 99px; height: .7rem; overflow: hidden; }
.bt i { display: block; height: 100%; border-radius: 99px; min-width: 2px; }
.donut-wrap { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; transform: rotate(-90deg); flex: none; }
.donut text { transform: rotate(90deg); transform-origin: 21px 21px; fill: var(--ink); }
.donut .dc { font-size: 7px; font-weight: 700; }
.donut .ds { font-size: 2.6px; fill: var(--muted); }
.dl-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .85rem; flex: 1; min-width: 150px; }
.dl-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .4rem; }
@media (max-width: 800px) { .dash { grid-template-columns: 1fr; } }

/* ---------- Chat ---------- */
.nav-badge { background: var(--danger); color: #fff; border-radius: 99px; font-size: .68rem; padding: 0 .4rem; margin-left: .3rem; }
.chat { display: grid; grid-template-columns: 250px 1fr; gap: 1rem; height: calc(100vh - 150px); min-height: 420px; }
.chat-side { overflow-y: auto; padding: .6rem; }
.chat-h { display: flex; justify-content: space-between; align-items: center; padding: .2rem .4rem; }
.chat-item { display: flex; justify-content: space-between; align-items: center; padding: .4rem .5rem; border-radius: 6px; color: var(--ink); }
.chat-item:hover, .chat-item.on { background: var(--accent-soft); text-decoration: none; }
.chat-item.on { font-weight: 600; }
.hash { color: var(--muted); margin-right: .3rem; }
.avatar.sm { width: 1.2rem; height: 1.2rem; font-size: .62rem; margin-right: .4rem; }
.people a { display: block; padding: .25rem .5rem; border-radius: 6px; color: var(--ink); font-size: .9rem; }
.people a:hover { background: var(--accent-soft); text-decoration: none; }
.chat-main { display: flex; flex-direction: column; padding: 0; min-width: 0; }
.chat-title { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--line); position: relative; }
.chat-title h2 { margin: 0; font-size: 1.05rem; }
.members .mlist { position: absolute; right: 1rem; top: 2.6rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .6rem; z-index: 5; min-width: 220px; box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.members .mlist > div { display: flex; justify-content: space-between; gap: .5rem; padding: .15rem 0; }
.msgs-box { flex: 1; overflow-y: auto; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .55rem; }
.msg { max-width: 75%; background: var(--bg); border-radius: 10px; padding: .4rem .7rem; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); }
.msg.sys { align-self: center; background: none; color: var(--muted); font-size: .8rem; }
.mhead { font-size: .82rem; display: flex; gap: .4rem; align-items: center; }
.mbody { white-space: normal; overflow-wrap: anywhere; }
.composer { display: flex; gap: .5rem; padding: .6rem 1rem; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; }
.chat-empty { margin: auto; text-align: center; padding: 2rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .3rem; }
@media (max-width: 800px) { .chat { grid-template-columns: 1fr; height: auto; } .msgs-box { max-height: 55vh; } }
th.sect { background: var(--accent-soft); color: var(--accent); text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
td .badge + .badge { margin-left: .2rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; }

/* ---------- Notifications ---------- */
.notif { display: flex; gap: .7rem; align-items: center; padding: .55rem .4rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--accent-soft); text-decoration: none; }
.notif .nt { flex: 1; }
.notif.unread .nt { font-weight: 600; }
.notif .nk { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); flex: none; }
.notif.unread .nk { background: var(--accent); }
.notif.unread .nk-assigned { background: #dc2626; }

/* =====================================================================
   Glass theme (Apple-inspired): frosted translucent panels over a soft
   gradient, a dark glass sidebar carrying the Frill logo, gold accent.
   Always light, whatever the OS setting, so the logo and charts stay legible.
   ===================================================================== */
:root, :root * { color-scheme: light; }
:root {
  --bg: rgba(110, 116, 140, .09);          /* recessed areas inside glass */
  --panel: rgba(255, 255, 255, .62);       /* frosted panel */
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, .14);
  --accent: #8a6a1f;
  --accent-ink: #1b1405;
  --accent-soft: rgba(201, 162, 77, .20);
  --danger: #c0271c; --danger-soft: rgba(255, 69, 58, .12);
  --warn: #8a5a00; --warn-soft: rgba(255, 204, 0, .20);
  --radius: 16px;
  --gold: #c9a24d;
  --glass-blur: blur(22px) saturate(180%);
  --shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 10px 30px rgba(30, 36, 60, .08);
}
html { background: #e9ebf1; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: transparent; color: var(--ink); letter-spacing: -.003em;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60vw 50vh at 8% 6%, rgba(214, 178, 96, .38), transparent 60%),
    radial-gradient(55vw 55vh at 92% 12%, rgba(120, 160, 255, .30), transparent 62%),
    radial-gradient(60vw 60vh at 78% 98%, rgba(90, 200, 180, .28), transparent 60%),
    radial-gradient(50vw 50vh at 4% 92%, rgba(190, 140, 255, .20), transparent 60%),
    linear-gradient(160deg, #eef0f6, #e6e9f1);
}
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-weight: 650; letter-spacing: -.01em; }
a { color: var(--accent); }

/* frosted surfaces */
.card, .widget, .chat-side, .chat-main, .members .mlist, .msg, .wopt, .kpi, .login-box .card,
.filters.card, .toast {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.card, .widget, .chat-side, .chat-main {
  background: var(--panel); border: 1px solid rgba(255, 255, 255, .75); border-radius: var(--radius); box-shadow: var(--shadow);
}
.widget { border-radius: 18px; }
.kpi, .wopt { background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.7); border-radius: 14px; }
.kpi:hover, .wopt:hover { background: rgba(255,255,255,.8); border-color: var(--gold); }
.stat { transition: transform .15s ease, box-shadow .15s ease; }
.stat:hover { transform: translateY(-2px); border-color: rgba(201,162,77,.6); }
.members .mlist { background: rgba(255,255,255,.88); border-radius: 14px; }

/* sidebar: dark glass with the logo */
.side {
  background: linear-gradient(180deg, rgba(16,16,18,.82), rgba(24,22,18,.78));
  -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
  border-right: 1px solid rgba(255,255,255,.08); color: #e8e4da;
  margin: .6rem 0 .6rem .6rem; height: calc(100vh - 1.2rem); top: .6rem; border-radius: 22px;
  box-shadow: 0 20px 50px rgba(10,10,20,.25), 0 1px 0 rgba(255,255,255,.08) inset;
}
.brand { padding: .4rem .4rem .6rem; text-align: center; }
.brand img { width: 84px; height: auto; display: block; margin: 0 auto .35rem; filter: drop-shadow(0 4px 14px rgba(201,162,77,.25)); }
.brand .brand-name { display: block; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.brand small { color: #8e8a80; }
.nav-h { color: #8e8a80; }
.side a.nav { color: #e8e4da; border-radius: 10px; transition: background .15s ease; }
.side a.nav:hover { background: rgba(255,255,255,.09); }
.side a.nav.on { background: linear-gradient(180deg, rgba(214,178,96,.30), rgba(201,162,77,.18)); color: #f4dca0; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset; }
.side .who { border-top-color: rgba(255,255,255,.1); color: #bdb8ac; }
.side .who a { color: #e0c27a; }
.side .btn { background: rgba(255,255,255,.08); color: #e8e4da; border-color: rgba(255,255,255,.14); }
.side::-webkit-scrollbar { width: 0; }
.topbar { background: rgba(255,255,255,.7); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .side { margin: 0; height: 100vh; top: 0; border-radius: 0 22px 22px 0; } }

/* controls */
.btn {
  border: 1px solid rgba(255,255,255,.8); background: rgba(255,255,255,.65); border-radius: 11px;
  box-shadow: 0 1px 2px rgba(30,36,60,.08); transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn:hover { background: rgba(255,255,255,.9); border-color: var(--gold); box-shadow: 0 4px 12px rgba(30,36,60,.1); }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, #e2c27f, #c19a43); border-color: #b8913f; color: #1b1405; font-weight: 600; box-shadow: 0 2px 8px rgba(177,139,56,.35), 0 1px 0 rgba(255,255,255,.5) inset; }
.btn.primary:hover { background: linear-gradient(180deg, #e8cb90, #c9a24d); }
.btn.danger { color: var(--danger); }
input, select, textarea { background: rgba(255,255,255,.7); border: 1px solid rgba(60,60,67,.16); border-radius: 10px; padding: .45rem .65rem; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(201,162,77,.35); outline-offset: 0; border-color: var(--gold); background: #fff; }
input[type=checkbox] { accent-color: #b8913f; }
input::placeholder, textarea::placeholder { color: #9b9ba3; }

/* tables sit directly on glass */
th { color: var(--muted); border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid rgba(60,60,67,.08); }
tbody tr:hover td { background: rgba(201,162,77,.07); }
th.sect { background: rgba(201,162,77,.16); color: var(--accent); border-radius: 0; }
.badge { background: rgba(60,60,67,.09); color: #3a3a3f; }

/* charts & bits */
.bt { background: rgba(60,60,67,.08); }
.bt i { box-shadow: 0 1px 0 rgba(255,255,255,.35) inset; }
.donut circle:first-child { stroke: rgba(60,60,67,.09); }
.dash.edit .widget { outline: 2px dashed rgba(201,162,77,.55); }
.msg { background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.8); border-radius: 16px; }
.msg.mine { background: linear-gradient(180deg, rgba(226,194,127,.55), rgba(201,162,77,.35)); }
.msg.sys { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.chat-item.on, .chat-item:hover { background: var(--accent-soft); }
.chat-title { border-bottom-color: var(--line); }
.composer { border-top-color: var(--line); }
.avatar { background: rgba(201,162,77,.25); color: var(--accent); }
.nav-badge { background: #ff453a; }
.warnbox { border-radius: 12px; }
.toast { background: rgba(30,30,32,.85); color: #fff; border-radius: 14px; }

/* login */
.login-box { max-width: 380px; text-align: center; }
.login-box .card { text-align: left; padding: 1.4rem; background: rgba(18,18,20,.55); border-color: rgba(255,255,255,.14); color: #f1eee6; }
.login-box .card label { color: #e8e4da; }
.login-box .card .muted { color: #a8a498; }
.login-logo { width: 120px; margin: 0 auto 1rem; display: block; filter: drop-shadow(0 6px 20px rgba(201,162,77,.3)); }
body.login-page::before { background: radial-gradient(60vw 60vh at 50% 30%, rgba(201,162,77,.22), transparent 65%), linear-gradient(160deg, #0b0b0d, #17151a 60%, #0d0d10); }
body.login-page { color: #f1eee6; }
.side { background: linear-gradient(180deg, rgba(14,14,16,.92), rgba(20,19,17,.9)); }
.login-box .card input { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.22); }
.login-box .card input:focus { background: rgba(255,255,255,.16); border-color: var(--gold); }

/* ---------- Priority flags ---------- */
.flag { font-size: 1.05em; line-height: 1; }
.flag-LOW { color: #8e8e93; } .flag-NORMAL { color: #0a84ff; } .flag-HIGH { color: #ff9f0a; } .flag-URGENT { color: #ff3b30; text-shadow: 0 0 8px rgba(255,59,48,.45); }
.badge.b-LOW::before, .badge.b-NORMAL::before, .badge.b-HIGH::before, .badge.b-URGENT::before { content: "⚑"; margin-right: .3em; }
.badge.b-LOW::before { color: #8e8e93; } .badge.b-NORMAL::before { color: #0a84ff; } .badge.b-HIGH::before { color: #ff9f0a; } .badge.b-URGENT::before { color: #ff3b30; }
.badge.b-LOW { background: rgba(142,142,147,.16); color: #48484a; }
.badge.b-NORMAL { background: rgba(10,132,255,.14); color: #0a58b5; }
.badge.b-HIGH { background: rgba(255,159,10,.18); color: #8a5300; }
.badge.b-URGENT { background: rgba(255,59,48,.16); color: #a3170f; }
.assignee-line { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; }
.avatar.ghost { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.drange { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- Order drawer, sub-task expander, comments ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.dr-back { position: absolute; inset: 0; background: rgba(20, 20, 30, .28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dr-panel { position: absolute; top: .6rem; right: .6rem; bottom: .6rem; width: min(520px, calc(100vw - 1.2rem)); overflow-y: auto; padding: 1rem 1.1rem;
  background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255,255,255,.8); border-radius: 22px; box-shadow: 0 30px 80px rgba(20,20,40,.3); animation: drIn .18s ease-out; }
@keyframes drIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.dr-head { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; margin-bottom: .7rem; }
.dr-title { font-size: 1.15rem; font-weight: 700; }
.dr-sec { border-top: 1px solid var(--line); padding: .6rem 0; }
.dr-sec > summary { cursor: pointer; font-weight: 650; padding: .15rem 0; }
.comments-sec h3 { margin: 0 0 .5rem; }
.composer-box textarea { width: 100%; }
.cm-row { display: flex; gap: .5rem; margin-top: .35rem; } .cm-row select { flex: 1; min-width: 0; }
.cm { background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8); border-radius: 14px; padding: .55rem .7rem; margin-top: .6rem; }
.cm.reply { margin-left: 1.2rem; background: rgba(110,116,140,.07); }
.cm.resolved { opacity: .7; }
.cm-h { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cm-b { margin: .3rem 0; overflow-wrap: anywhere; }
.cm-a { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.cm-a select { padding: .15rem .4rem; font-size: .8rem; max-width: 9rem; }
.reply-box summary, .react-add summary { cursor: pointer; font-size: .85rem; color: var(--accent); list-style: none; padding: .1rem .4rem; border-radius: 8px; }
.reply-box[open] { flex-basis: 100%; }
.react { border: 1px solid var(--line); background: rgba(255,255,255,.6); border-radius: 999px; padding: .05rem .45rem; cursor: pointer; font: inherit; font-size: .82rem; }
.react.mine { background: rgba(201,162,77,.3); border-color: var(--gold); }
.react-pop { display: flex; gap: .2rem; padding: .25rem; }
.mention { background: rgba(10,132,255,.14); color: #0a58b5; border-radius: 6px; padding: 0 .25rem; }
.chip-assign { background: rgba(10,132,255,.14); color: #0a58b5; border-radius: 999px; padding: .02rem .5rem; font-size: .75rem; font-weight: 600; }
.chip-ok { background: rgba(52,199,89,.18); color: #1a7f37; border-radius: 999px; padding: .02rem .5rem; font-size: .75rem; font-weight: 600; }
.cbtn, .expander { border: 1px solid var(--line); background: rgba(255,255,255,.65); border-radius: 999px; cursor: pointer; font: inherit; font-size: .8rem; padding: .08rem .55rem; color: var(--ink); }
.cbtn:hover, .expander:hover { border-color: var(--gold); background: #fff; }
.expander { padding: .05rem .45rem; margin-right: .25rem; }
.card-actions { display: flex; gap: .35rem; margin: .4rem 0 0; }
tr.expansion > td { background: rgba(201,162,77,.07); padding: .4rem .8rem .7rem 2.2rem; }
.kb-card .expansion { margin-top: .4rem; border-top: 1px dashed var(--line); padding-top: .4rem; }
.subtasks { display: grid; gap: .15rem; font-size: .87rem; }
.st { display: grid; grid-template-columns: auto 1fr auto auto; gap: .5rem; align-items: center; padding: .15rem .3rem; border-radius: 8px; }
.st:not(.stage) { grid-template-columns: 1fr auto auto; }
.st.sub { margin-left: 1.3rem; }
.st.current { background: rgba(201,162,77,.18); font-weight: 600; }
.st.done .st-t { text-decoration: line-through; color: var(--muted); }
.st select { padding: .1rem .3rem; font-size: .78rem; border-radius: 8px; }
.st .dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.st-m { display: inline-flex; gap: .3rem; align-items: center; }
.st-h { margin-top: .4rem; }
.avatar.sm { width: 1.25rem; height: 1.25rem; font-size: .6rem; }
.rem-form { display: grid; gap: .35rem; margin-top: .4rem; }
.rem-row { display: flex; gap: .4rem; } .rem-row select { flex: 1; min-width: 0; }
body.drawer-open { overflow: hidden; }

/* ---------- Personal tasks ---------- */
.todo-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.todo-add .ta-title { flex: 1 1 18rem; }
.ptask { display: flex; align-items: center; gap: .8rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.ptask:last-child { border-bottom: 0; }
.ptask.is-done .pt-title { text-decoration: line-through; color: var(--muted); }
.pt-main { flex: 1; min-width: 0; } .pt-title { font-weight: 600; }
.pt-who { min-width: 9rem; } .pt-due { min-width: 7rem; text-align: right; font-size: .88rem; }
.tick { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--gold); background: rgba(255,255,255,.7); cursor: pointer; color: #1b1405; font-weight: 700; line-height: 1; padding: 0; }
.is-done .tick { background: linear-gradient(180deg, #e2c27f, #c19a43); }
.pt-more { position: relative; } .pt-more summary { list-style: none; cursor: pointer; }
.pt-pop { position: absolute; right: 0; top: 2rem; z-index: 20; width: 300px; padding: .7rem; display: grid; gap: .4rem;
  background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.9); border-radius: 16px; box-shadow: 0 18px 50px rgba(20,20,40,.22); }
.pt-pop form { display: grid; gap: .35rem; } .pt-pop input, .pt-pop select, .pt-pop textarea { width: 100%; }
@media (max-width: 760px) { .ptask { flex-wrap: wrap; } .pt-who, .pt-due { min-width: 0; text-align: left; } }

/* ---------- Notification settings ---------- */
.switches { display: grid; gap: 0; }
.switches h3 { margin: 1rem 0 .2rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.sw { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sw input { appearance: none; -webkit-appearance: none; width: 2.9rem; height: 1.75rem; border-radius: 999px; background: rgba(120,120,128,.32); position: relative; cursor: pointer; transition: background .2s; flex: none; border: 0; padding: 0; }
.sw input::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.28); transition: transform .2s; }
.sw input:checked { background: #34c759; }
.sw input:checked::after { transform: translateX(1.15rem); }

/* ---------- Machinery ---------- */
.mcount { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.mchip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.85); }
.mchip i { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.mcard { border-top: 4px solid var(--mc); display: grid; gap: .35rem; }
.mcard header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.mname { font-weight: 700; font-size: 1.05rem; }
.mstate { background: color-mix(in srgb, var(--mc) 18%, white); color: #222; border: 1px solid var(--mc); border-radius: 999px; padding: .02rem .6rem; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.msince { font-size: .9rem; }
.mbtns { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.mbtn { border: 1px solid var(--line); background: rgba(255,255,255,.7); border-radius: 999px; padding: .2rem .65rem; font: inherit; font-size: .8rem; cursor: pointer; }
.mbtn:hover { background: #fff; border-color: var(--gold); }
.mbtn.s-RUNNING { border-color: #34c759; } .mbtn.s-DOWN { border-color: #ff3b30; } .mbtn.s-REPAIR { border-color: #ff9500; } .mbtn.s-MAINTENANCE { border-color: #0a84ff; }
.mextra { display: grid; grid-template-columns: 1fr 8rem; gap: .35rem; margin-top: .35rem; } .mextra input { min-width: 0; font-size: .85rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; }
.kpi { background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.85); border-radius: 16px; padding: .7rem .9rem; display: grid; }
.kpi b { font-size: 1.4rem; } .kpi span { color: var(--muted); font-size: .8rem; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }

/* ---------- Global search ---------- */
.side-search { display: flex; align-items: center; gap: .5rem; width: calc(100% - 1.2rem); margin: .6rem; padding: .45rem .7rem; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); font: inherit; font-size: .88rem; cursor: pointer; }
.side-search span { flex: 1; text-align: left; } .side-search kbd { font: inherit; font-size: .7rem; opacity: .7; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 0 .3rem; }
.side-search:hover { background: rgba(255,255,255,.18); }
.gs-box { position: absolute; top: 9vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 1.5rem)); max-height: 78vh; display: flex; flex-direction: column; overflow: hidden;
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(34px) saturate(190%); backdrop-filter: blur(34px) saturate(190%); border: 1px solid rgba(255,255,255,.85); border-radius: 22px; box-shadow: 0 30px 90px rgba(20,20,40,.35); }
#gs-input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 1rem 1.2rem; font-size: 1.1rem; outline: none; width: 100%; }
.gs-out { overflow-y: auto; padding: .3rem .5rem; }
.gs-g { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .6rem .6rem .2rem; }
.gs-r { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .7rem; border-radius: 10px; color: var(--ink); text-decoration: none; }
.gs-r span { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-r.on, .gs-r:hover { background: rgba(201,162,77,.25); text-decoration: none; }
.gs-foot { padding: .5rem 1rem; border-top: 1px solid var(--line); }

/* =====================================================================
   Liquid glass: thicker, brighter glass with a specular rim, an inner
   refraction glow, floating colour behind it, and springy controls.
   Applies to every screen because it restyles the shared components.
   ===================================================================== */
:root {
  --glass-blur: blur(26px) saturate(200%) brightness(1.04);
  --rim: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 0 rgba(255,255,255,.35), inset 1px 0 0 rgba(255,255,255,.5), inset -1px 0 0 rgba(255,255,255,.3);
  --shadow: var(--rim), 0 1px 2px rgba(30,36,60,.06), 0 14px 38px rgba(30,36,60,.12);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
body::before {
  background:
    radial-gradient(42vw 38vh at 10% 8%, rgba(236, 190, 96, .55), transparent 65%),
    radial-gradient(40vw 40vh at 90% 10%, rgba(110, 160, 255, .45), transparent 65%),
    radial-gradient(46vw 44vh at 80% 96%, rgba(70, 210, 185, .42), transparent 65%),
    radial-gradient(38vw 38vh at 6% 90%, rgba(196, 130, 255, .34), transparent 65%),
    radial-gradient(30vw 30vh at 50% 48%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(160deg, #f1f2f8, #e4e8f2);
}
.card, .widget, .chat-side, .chat-main, .filters.card, .kpi, .wopt, .mcard, .mchip, .cm, .gs-box, .dr-panel, .login-box .card {
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.42) 55%, rgba(255,255,255,.58));
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  position: relative;
}
.card::before, .widget::before, .mcard::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 70% at 10% -10%, rgba(255,255,255,.65), transparent 55%);
  opacity: .55;
}
.card > *, .widget > *, .mcard > * { position: relative; }
.btn, .mbtn, .cbtn, .expander, .react {
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.5));
  border: 1px solid rgba(255,255,255,.85); box-shadow: var(--rim), 0 2px 6px rgba(30,36,60,.1);
  transition: transform .25s var(--spring), box-shadow .2s ease, background .2s ease;
}
.btn:hover, .mbtn:hover, .cbtn:hover { transform: translateY(-1px) scale(1.02); }
.btn:active, .mbtn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #f0d594, #c9a24d 70%, #b8913f); box-shadow: var(--rim), 0 6px 16px rgba(177,139,56,.4); }
input, select, textarea { background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.8)); box-shadow: inset 0 1px 2px rgba(30,36,60,.08); border: 1px solid rgba(60,60,67,.14); }
.side { box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,255,255,.06), 0 24px 60px rgba(10,10,20,.35);
  background: linear-gradient(180deg, rgba(34,32,40,.74), rgba(18,17,22,.8)); -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%); }
.side a.nav { transition: background .2s ease, transform .25s var(--spring); }
.side a.nav:hover { transform: translateX(2px); }
.side a.nav.on { box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 4px 14px rgba(201,162,77,.2); }
.topbar { background: rgba(255,255,255,.55); }
.badge, .chip-assign, .chip-ok { box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.msgs li { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--rim); border-radius: 14px; }
.table-wrap { background: linear-gradient(135deg, rgba(255,255,255,.66), rgba(255,255,255,.4)); }
.dr-panel, .gs-box { animation: glassIn .28s var(--spring); }
@keyframes glassIn { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.dr-back { background: rgba(30,32,50,.22); -webkit-backdrop-filter: blur(6px) saturate(140%); backdrop-filter: blur(6px) saturate(140%); }
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; animation: none !important; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .widget, .dr-panel, .gs-box, .mcard { background: rgba(255,255,255,.92); }
}
.dr-panel { position: absolute; }
.gs-box { position: absolute; }
.side-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Items dropdown, tags, payment ---------- */
.items-drop { display: grid; gap: .1rem; min-width: 22rem; }
.items-drop .sub-h { margin-top: .5rem; padding: .25rem .5rem; border-radius: 10px; background: rgba(201,162,77,.18); }
.items-drop .sub-h:first-child { margin-top: 0; }
.items-drop .it { display: grid; grid-template-columns: 1fr auto auto; gap: .7rem; align-items: center; padding: .25rem .5rem .25rem 1rem; border-bottom: 1px dashed var(--line); }
.items-drop .it-q { white-space: nowrap; }
.items-drop select { font-size: .78rem; padding: .1rem .3rem; min-width: 8rem; }
.tagchip { display: inline-block; margin: 0 .2rem .2rem 0; padding: 0 .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600; color: #222; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 16%, white); }
.chip-pay { display: inline-block; padding: 0 .55rem; border-radius: 999px; font-size: .76rem; font-weight: 650; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 14%, white); }
.pay-pick { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--panel)); font-weight: 600; width: auto; min-width: 8.5rem; }
.sub-block { margin-top: .8rem; }
.sub-block > h3 { margin: 0 0 .3rem; font-size: .95rem; }
table.pack th.boxh { min-width: 7.5rem; } table.pack input.qin { width: 5.5rem; text-align: right; }
table.pack tr.sub input { width: 100%; margin-bottom: .2rem; font-size: .8rem; } table.pack .grp td, .grp td { background: rgba(201,162,77,.16); }
table.pack .pos { color: #1a7f37; font-weight: 600; }
.cf-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-bottom: .6rem; } .cf-row input[name=name] { flex: 1 1 14rem; } .cf-row textarea { flex: 2 1 14rem; }

/* ---------- My Tasks hub ---------- */
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-top: .8rem; }
.hub-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: .2rem .6rem; padding: .9rem 1rem; border-radius: 20px; color: var(--ink); text-decoration: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, white), rgba(255,255,255,.55)); border: 1px solid rgba(255,255,255,.8); box-shadow: var(--shadow, 0 6px 20px rgba(0,0,0,.08)); transition: transform .25s var(--spring, ease); }
.hub-tile:hover { transform: translateY(-2px); text-decoration: none; } .hub-tile.on { outline: 2px solid var(--c); }
.hub-ic { grid-row: 1 / 3; width: 2.5rem; height: 2.5rem; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 1.2rem; }
.hub-tile b { font-size: 1.6rem; text-align: right; line-height: 1; } .hub-tile.hot b { color: #c0271c; } .hub-l { grid-column: 1 / 3; font-weight: 600; margin-top: .3rem; }
.hub-tile { grid-template-columns: auto 1fr; } .hub-l { grid-column: 1 / 3; grid-row: 3; }
.hub-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.hub-row:hover { background: rgba(201,162,77,.1); text-decoration: none; } .hub-t { flex: 1; min-width: 0; display: grid; } .hub-d { white-space: nowrap; font-size: .85rem; }
.hub-kind { font-size: .7rem; padding: .05rem .5rem; border-radius: 999px; background: rgba(60,60,67,.1); } .k-Task { background: rgba(22,119,255,.15); } .k-Personal { background: rgba(109,74,255,.15); }
.k-Reminder { background: rgba(11,179,155,.18); } .k-Comment { background: rgba(46,158,91,.18); }

/* ---------- Posts wall ---------- */
.wall { max-width: 760px; display: grid; gap: 1rem; margin-top: 1rem; }
.kinds { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.kchip { display: inline-flex; gap: .3rem; align-items: center; padding: .2rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.65); font-size: .88rem; color: var(--ink); text-decoration: none; cursor: pointer; }
.kchip.on, .kchip.pick:has(input:checked) { background: var(--gold, #c9a24d); border-color: #b8913f; color: #1b1405; font-weight: 600; } .kchip.pick input { position: absolute; opacity: 0; pointer-events: none; }
.kchip.kind { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, white); margin-left: auto; }
.post-composer { display: grid; gap: .5rem; } .post-composer input, .post-composer textarea { width: 100%; }
.post header { display: flex; gap: .6rem; align-items: center; } .post h3 { margin: .6rem 0 .2rem; } .post-body { margin: .4rem 0 .6rem; overflow-wrap: anywhere; }
.post { border-left: 4px solid var(--c); } .post-comments { margin-top: .5rem; }

/* ---------- Notes (Keep-like) & Docs ---------- */
.keep-new summary { cursor: pointer; font-weight: 600; } .keep-new form { display: grid; gap: .5rem; margin-top: .6rem; } .keep-new input, .keep-new textarea { width: 100%; }
.keep { columns: 240px; column-gap: 1rem; margin-top: 1rem; }
.note { break-inside: avoid; margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--bg) 85%, white), var(--bg)); border: 1px solid rgba(255,255,255,.8);
  box-shadow: var(--shadow, 0 4px 14px rgba(0,0,0,.08)); position: relative; } .note h3 { margin: 0 0 .3rem; } .note .pin { position: absolute; right: .6rem; top: .4rem; }
.note .nb { overflow-wrap: anywhere; } .note .chk label { display: block; padding: .1rem 0; } .note .chk label.done { text-decoration: line-through; color: var(--muted); }
.note footer { display: flex; gap: .3rem; align-items: center; margin-top: .6rem; opacity: .35; transition: opacity .2s; flex-wrap: wrap; } .note:hover footer, .note:focus-within footer { opacity: 1; }
.mini { border: 0; background: transparent; cursor: pointer; font-size: 1rem; padding: .1rem .3rem; border-radius: 8px; text-decoration: none; color: inherit; } .mini:hover { background: rgba(0,0,0,.08); }
.sw { display: inline-flex; gap: .15rem; } .dotc { width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); cursor: pointer; padding: 0; }
.swatches { display: inline-flex; gap: .25rem; } .swatches label { cursor: pointer; } .swatches input { position: absolute; opacity: 0; } .swatches i { display: block; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); } .swatches input:checked + i { outline: 2px solid #8a6a1f; outline-offset: 1px; }
.doc-body { max-width: 820px; } .doc-body .md-h { margin: 1.1rem 0 .3rem; } .md-ul { padding-left: 1.3rem; margin: .2rem 0 .6rem; } .md-check { list-style: none; padding-left: .2rem; } .md-check li.done { text-decoration: line-through; color: var(--muted); }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; width: 100%; }
@media print { .side, .topbar, .page-head .actions, .view-tabs { display: none !important; } .shell { display: block; } .card { box-shadow: none; background: #fff; } }

/* ---------- Dynamic Island ---------- */
.island { position: fixed; top: 10px; left: 50%; z-index: 200; transform: translateX(-50%) scale(.35); transform-origin: top center; opacity: 0; display: flex; align-items: center; gap: .6rem;
  min-width: 120px; max-width: min(92vw, 460px); padding: .65rem 1rem; border-radius: 999px; color: #fff; cursor: pointer;
  background: rgba(8,8,10,.92); backdrop-filter: blur(18px) saturate(1.6); box-shadow: 0 12px 34px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.14);
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .25s, min-width .5s cubic-bezier(.34,1.56,.64,1); }
.island.open { transform: translateX(-50%) scale(1); opacity: 1; min-width: 300px; }
.island .isl-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #30d158; box-shadow: 0 0 10px #30d158; flex: none; animation: islpulse 1.4s infinite; }
.island .isl-text { font-size: .9rem; line-height: 1.25; flex: 1; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.island .isl-x { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 1.4rem; height: 1.4rem; border-radius: 50%; cursor: pointer; font-size: .7rem; flex: none; }
@keyframes islpulse { 50% { opacity: .4; } }
.island[hidden], .calc[hidden] { display: none; }
/* ---------- Calculator ---------- */
.calc { position: fixed; right: 18px; bottom: 18px; z-index: 150; width: 280px; padding: .8rem; border-radius: 22px; background: rgba(255,255,255,.78); backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.9); box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.calc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; } .calc-head button { border: 0; background: transparent; cursor: pointer; }
.calc-in { width: 100%; font-size: 1.1rem; padding: .45rem .6rem; border-radius: 12px; border: 1px solid rgba(0,0,0,.15); } .calc-out { text-align: right; font-size: 1.9rem; font-weight: 600; padding: .3rem .2rem; overflow-x: auto; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; } .calc-keys button { padding: .6rem 0; font-size: 1.05rem; border: 0; border-radius: 14px; background: rgba(0,0,0,.07); cursor: pointer; } .calc-keys button:active { transform: scale(.94); }
.calc-keys button.eq { grid-column: span 2; background: #b8891f; color: #fff; }
.calc-lit { margin-top: .6rem; font-size: .8rem; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; } .calc-lit input { width: 4.5rem; padding: .2rem .3rem; } 
@media (max-width: 700px) { .calc { right: 8px; left: 8px; width: auto; bottom: 8px; } }

/* ---------- ClickUp-style pills & compact order page ---------- */
select.enh { display: none !important; }
.pillbtn { border: 0; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: #fff; background: var(--c, #64748b);
  padding: .28rem .65rem; border-radius: 7px; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; max-width: 100%; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.pillbtn:hover { filter: brightness(1.08); } .pillbtn.ro { cursor: default; filter: none; } .pillbtn.err { outline: 2px solid #dc2626; }
.pillbtn b { font-size: .7rem; opacity: .8; }
.pillbtn.pb-pay { border-radius: 999px; text-transform: none; font-weight: 600; }
.pillbtn.pb-task { background: transparent; color: var(--text, #222); box-shadow: none; text-transform: none; font-weight: 500; padding: .15rem .3rem; }
.pillbtn.pb-task span { font-size: .78rem; color: var(--muted); }
.pillbtn.pb-prio { background: transparent; box-shadow: none; color: var(--c); padding: .1rem .2rem; font-size: 1.05rem; text-transform: none; }
.pillbtn.pb-who { background: transparent; box-shadow: none; padding: 0; }
.pillbtn .av, .pillpop .av { width: 1.6rem; height: 1.6rem; border-radius: 50%; color: #fff; font-size: .62rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.pillbtn .av.none { background: transparent; color: var(--muted); border: 1.5px dashed var(--muted); box-shadow: none; }
.ring { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--c); display: inline-block; flex: none; background: transparent; }
.ring.IN_PROGRESS { background: conic-gradient(var(--c) 0 50%, transparent 0); } .ring.REVIEW { background: conic-gradient(var(--c) 0 75%, transparent 0); } .ring.DONE { background: var(--c); box-shadow: inset 0 0 0 2px #fff; } .ring.BLOCKED { background: repeating-linear-gradient(45deg, var(--c) 0 3px, transparent 3px 6px); }
.pillpop { position: fixed; z-index: 220; width: 240px; max-height: 320px; display: flex; flex-direction: column; padding: .4rem; border-radius: 14px; background: rgba(255,255,255,.92); backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.9); box-shadow: 0 14px 40px rgba(0,0,0,.25); animation: ppin .16s cubic-bezier(.34,1.56,.64,1); transform-origin: top left; }
@keyframes ppin { from { opacity: 0; transform: scale(.92); } }
.pillpop input { width: 100%; margin-bottom: .3rem; padding: .35rem .5rem; border-radius: 9px; border: 1.5px solid #3b82f6; } .pp-list { overflow: auto; }
.pp-row { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; background: transparent; text-align: left; padding: .4rem .5rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .9rem; }
.pp-row:hover, .pp-row.on { background: rgba(59,130,246,.12); } .pp-dot { width: .8rem; height: .8rem; border-radius: 50%; flex: none; }
/* order page: stage groups + one-line tasks */
.stg { border-top: 1px solid var(--line); } .stg > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: .55rem .2rem; font-weight: 600; } .stg > summary::-webkit-details-marker { display: none; }
.stg > summary::before { content: "▸"; color: var(--muted); transition: transform .2s; } .stg[open] > summary::before { transform: rotate(90deg); }
.stg .cnt { margin-left: auto; font-weight: 400; font-size: .8rem; color: var(--muted); } .stg.cur > summary { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, transparent), transparent); border-radius: 10px; }
.task { grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; padding: .35rem .2rem; } .task .title { grid-column: auto; order: 0; font-weight: 500; }
.task > .js-task[type=date] { width: 8.2rem; border: 0; background: transparent; } .task .acts { opacity: 0; transition: opacity .15s; } .task:hover .acts { opacity: 1; }
.stg > summary .task { flex: 1; min-width: 0; padding: 0; border: 0; } .stg > summary .task .title { font-weight: 600; }
@media (max-width: 700px) { .task { grid-template-columns: auto minmax(0, 1fr) auto auto; } .task > .js-task[type=date] { display: none; } .task .acts { opacity: 1; } }

/* Dashboard: masonry so short widgets never leave empty gaps under them */
.dash { grid-auto-rows: 8px; row-gap: 0; column-gap: 1rem; grid-auto-flow: row dense; align-items: start; }
.dash > .widget, .dash > .card { margin-bottom: 0; }
@media (max-width: 800px) { .dash { grid-auto-rows: auto; row-gap: 1rem; } }

/* Key-number tiles: colour = meaning (red needs attention, green all clear, blue/purple/teal info) */
.kpi { --k: #2563eb; position: relative; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--k) 16%, white), rgba(255,255,255,.6)) !important; border: 1px solid color-mix(in srgb, var(--k) 35%, white) !important; }
.kpi::after { content: ""; position: absolute; left: 0; top: 12%; bottom: 12%; width: 4px; border-radius: 0 4px 4px 0; background: var(--k); }
.kpi .n { font-size: 1.9rem; font-weight: 700; line-height: 1.05; color: var(--k); } .kpi .l { font-size: .82rem; color: var(--ink); opacity: .75; }
.kpi.tone-blue { --k: #2563eb; } .kpi.tone-purple { --k: #7c3aed; } .kpi.tone-teal { --k: #0891b2; } .kpi.tone-green { --k: #16a34a; } .kpi.tone-red { --k: #dc2626; }
.kpi.tone-red { animation: kpipulse 2.4s ease-in-out infinite; } @keyframes kpipulse { 50% { box-shadow: 0 0 0 4px rgba(220,38,38,.12); } }
@media (prefers-reduced-motion: reduce) { .kpi.tone-red { animation: none; } }

/* Open orders by stage: liquid-glass colour chips */
.stagechips { display: flex; flex-wrap: wrap; gap: .55rem; }
.schip { display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .45rem .4rem .8rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .88rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, rgba(255,255,255,.85)), color-mix(in srgb, var(--c) 8%, rgba(255,255,255,.55)));
  border: 1px solid color-mix(in srgb, var(--c) 45%, rgba(255,255,255,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 0 rgba(255,255,255,.35), 0 4px 12px color-mix(in srgb, var(--c) 22%, transparent);
  transition: transform .25s var(--spring, cubic-bezier(.34,1.56,.64,1)), box-shadow .2s; }
.schip b { min-width: 1.6rem; text-align: center; padding: .05rem .5rem; border-radius: 999px; color: #fff; font-size: .9rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, white), var(--c)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 3px rgba(0,0,0,.2); }
.schip:hover { transform: translateY(-2px) scale(1.03); text-decoration: none; }
.schip.z { opacity: .5; background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.4)); border-color: rgba(60,60,67,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.schip.z b { background: rgba(60,60,67,.25); box-shadow: none; } .schip.z:hover { opacity: .9; }
.tasks-fold > summary { cursor: pointer; list-style: none; margin-bottom: .4rem; } .tasks-fold > summary::-webkit-details-marker { display: none; }
.tasks-fold > summary::before { content: "▸"; margin-right: .4rem; color: var(--muted); display: inline-block; transition: transform .2s; } .tasks-fold[open] > summary::before { transform: rotate(90deg); }

/* v5.6 bulk select + nested subtasks */
.task { grid-template-columns: 1.4rem auto minmax(0, 1fr) auto auto auto auto; margin-left: calc(var(--d, 0) * 1.4rem); }
.task.sub { margin-left: calc(var(--d, 0) * 1.4rem); }
.task .bsel, .ball, td > .bsel { width: auto; accent-color: var(--accent, #4f8cff); cursor: pointer; }
.task .js-subadd { opacity: .75; } .subadd { margin: .2rem 0 .4rem; }
.subadd[hidden], .bulkbar[hidden] { display: none; }
.bulkbar { position: sticky; bottom: 1rem; z-index: 40; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .8rem auto 0; width: fit-content; max-width: 100%;
  padding: .5rem .7rem; border-radius: 14px; background: rgba(20, 24, 38, .86); color: #fff; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .18); }
.bulkbar select, .bulkbar input[type=date], .bulkbar button { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .2); border-radius: 9px; padding: .3rem .5rem; font-size: .85rem; width: auto; cursor: pointer; }
.bulkbar select option { color: #111; } .bulkbar button:hover, .bulkbar select:hover { background: rgba(255, 255, 255, .22); }
.bulkbar button.danger { color: #ff8b8b; } .bulkbar .bcount { padding: 0 .4rem; white-space: nowrap; } .bulkbar .bclear { border: 0; background: none; padding: 0 .2rem; }
.bulkbar .bdate { display: inline-flex; gap: .3rem; align-items: center; font-size: .85rem; }
tr.bsel-on, .task.bsel-on { background: rgba(79, 140, 255, .14); }
@media (max-width: 700px) { .task { grid-template-columns: 1.4rem auto minmax(0, 1fr) auto; } }

.cf-in { width: 100%; max-width: 22rem; padding: .25rem .4rem; font-size: .9rem; background: transparent; border: 1px solid transparent; border-radius: 8px; }
.cf-in:hover, .cf-in:focus { border-color: var(--line); background: rgba(255,255,255,.5); }

/* v5.8 board cards, ClickUp style */
.kanban .kb-col { flex-basis: 285px; }
.kb-card { border-radius: 14px; padding: .7rem .8rem; box-shadow: 0 2px 10px rgba(30,30,60,.06); }
.kb-card .t { font-size: .98rem; line-height: 1.3; overflow-wrap: anywhere; }
.kb-card .t .no { color: var(--gold, #a8832f); }
.kb-card .kb-sum { margin-top: .15rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem; align-items: center; }
.kbc { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--line); background: rgba(255,255,255,.7); border-radius: 9px; padding: .12rem .45rem; font-size: .8rem; min-height: 1.7rem; }
.kbc.late { color: var(--danger); border-color: var(--danger); } .kbc.who, .kbc.flag { padding: .12rem .35rem; }
.kbc .chip-pay { border: 0; background: none; padding: 0; }
.kb-prog { margin-top: .5rem; display: flex; align-items: center; gap: .4rem; } .kb-prog .bar { flex: 1; height: 5px; } .kb-prog span { font-size: .75rem; color: var(--muted); }
.kb-card .items-drop { min-width: 0; }
.kb-card .items-drop .it { grid-template-columns: 1fr auto; gap: .2rem .5rem; padding: .4rem .2rem; }
.kb-card .items-drop .it-n { grid-column: 1 / -1; font-weight: 500; line-height: 1.3; }
.kb-card .items-drop .it select { min-width: 0; width: 100%; }
.kb-card .items-drop .it-q { font-size: .85rem; }

/* v5.9 Sheets */
.sheet-head { align-items: center; gap: .6rem; }
#sheet-title { font-size: 1.25rem; font-weight: 700; border: 1px solid transparent; background: transparent; padding: .2rem .5rem; border-radius: 8px; min-width: 14rem; max-width: 40vw; }
#sheet-title:hover, #sheet-title:focus { border-color: var(--line); background: rgba(255,255,255,.55); }
#sheet-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .4rem; overflow: hidden; box-shadow: 0 6px 24px rgba(30,30,60,.08); }
#sheet-wrap .jss_container, #sheet-wrap .jss_content { max-width: 100%; }

/* v5.10 add-new links, popup mode, wide Posts wall */
.addnew { display: inline-block; margin-top: .25rem; font-size: .78rem; color: var(--gold, #a8832f); text-decoration: none; white-space: nowrap; }
.addnew:hover { text-decoration: underline; }
td .addnew { margin-left: .3rem; }
body.is-popup .side, body.is-popup .topbar { display: none !important; }
body.is-popup .shell { grid-template-columns: minmax(0, 1fr); } body.is-popup .main { padding: 1rem; }
.wall { max-width: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); align-items: start; }
.wall > .post-composer, .wall > :not(.post) { grid-column: 1 / -1; }
.wall > .post-composer { max-width: 900px; }
.post-composer .cm-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.post-composer .cm-row .check { display: inline-flex; flex-direction: row; align-items: center; gap: .4rem; width: auto; margin: 0; }
.post-composer .cm-row .check input { width: auto; margin: 0; }

/* v5.12 quick notes popup */
.qn[hidden] { display: none; }
.qn { position: fixed; right: 18px; bottom: 18px; z-index: 149; width: 340px; max-height: min(78vh, 640px); display: flex; flex-direction: column; padding: .8rem; border-radius: 22px; background: rgba(255,255,255,.82);
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); box-shadow: 0 18px 50px rgba(30,30,60,.28); border: 1px solid rgba(255,255,255,.8); }
.calc:not([hidden]) ~ .qn, .qn.shift { right: 316px; }
.qn-body { overflow-y: auto; display: grid; gap: .6rem; padding-right: .1rem; }
.qn-new { display: grid; gap: .35rem; } .qn-new input, .qn-new textarea { font-size: .9rem; } .qn-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: space-between; }
.qn-list { display: grid; gap: .5rem; }
.qn-note { background: var(--bg, #fff); border: 1px solid rgba(0,0,0,.08); border-radius: 14px; padding: .5rem .7rem; font-size: .9rem; }
.qn-top { display: flex; justify-content: space-between; gap: .4rem; } .qn-acts { opacity: .35; white-space: nowrap; } .qn-note:hover .qn-acts { opacity: 1; }
.qn-acts button, .qn-acts a { border: 0; background: none; cursor: pointer; padding: 0 .15rem; font-size: .85rem; text-decoration: none; }
.qn .nb { overflow-wrap: anywhere; } .qn .chk label { display: block; padding: .05rem 0; } .qn .chk label.done { text-decoration: line-through; color: var(--muted); }
@media (max-width: 700px) { .qn { right: 8px; left: 8px; width: auto; bottom: 8px; } .calc:not([hidden]) ~ .qn { right: 8px; } }
.swatches label { position: relative; } .swatches input { width: 1.3rem; height: 1.3rem; left: 0; top: 0; }
body:has(#calc:not([hidden])) .qn { right: 316px; } @media (max-width: 700px) { body:has(#calc:not([hidden])) .qn { right: 8px; } }
.qn-new input[type=text], .qn-new input:not([type]), .qn-new textarea { width: 100%; }
.qn-new input[type=checkbox] { width: auto; margin: 0; }
.qn-row .check { display: inline-flex; flex-direction: row; align-items: center; gap: .3rem; width: auto; margin: 0; }

/* v5.13 help */
.help-fab { position: fixed; top: .9rem; right: 1.1rem; z-index: 90; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.8); cursor: pointer; font-weight: 800; font-size: 1.05rem; color: #7a5a14;
  background: linear-gradient(135deg, #fff6d8, #f1d98f); box-shadow: 0 4px 14px rgba(120,90,20,.28); }
.help-fab:hover { transform: scale(1.08); }
.main .page-head { padding-right: 3rem; }
.help-panel[hidden] { display: none; }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); z-index: 160; display: flex; flex-direction: column; background: rgba(255,255,255,.88); backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5); box-shadow: -14px 0 50px rgba(30,30,60,.25); border-left: 1px solid rgba(255,255,255,.9); }
.help-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--line); } .help-head button { border: 0; background: none; cursor: pointer; font-size: 1.1rem; }
.help-bodyp { overflow-y: auto; padding: .8rem 1.1rem 2rem; } .hp-art { margin-bottom: 1.4rem; } .hp-art h3 { margin: 0 0 .2rem; }
.hp-art ol, .help-steps { padding-left: 1.2rem; display: grid; gap: .5rem; } .help-steps { font-size: 1rem; line-height: 1.5; }
.hp-tips { margin-top: .8rem; padding: .6rem .8rem; border-radius: 12px; background: rgba(201,162,77,.15); } .hp-tips ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.hp-search { display: flex; gap: .4rem; margin: 1rem 0 .6rem; } .hp-search input { flex: 1; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; }
.help-tile { display: grid; gap: .25rem; padding: .8rem .9rem; border-radius: 14px; background: rgba(255,255,255,.7); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.help-tile:hover { border-color: var(--gold, #c9a24d); background: #fff; text-decoration: none; } .help-body { max-width: 860px; }
body.is-popup .help-fab, body.is-popup .help-panel { display: none !important; }
@media print { .help-fab, .help-panel { display: none !important; } }

/* ---- v5.15 Messaging dock ---- */
.dock[hidden] { display: none; }
.dock { position: fixed; right: 18px; bottom: 0; z-index: 140; display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.dock > * { pointer-events: auto; }
.dock-wins { display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 10px; }
.dock-bar { width: 290px; position: relative; border-radius: 16px 16px 0 0; background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.85); border-bottom: 0;
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); box-shadow: 0 -6px 30px rgba(30,30,60,.2); }
.dock-head { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .6rem .8rem; border: 0; background: transparent; cursor: pointer; font: inherit; text-align: left; }
.dock-head b { flex: 1; } .dock-chev { opacity: .6; }
.dock-ava { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: rgba(0,0,0,.07); font-size: .85rem; font-weight: 700; flex: none; }
.dock-badge { background: #e5484d; color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: .08rem .42rem; min-width: 1.2rem; text-align: center; }
.dock-badge[hidden] { display: none; }
.dock-panel { display: flex; flex-direction: column; max-height: min(70vh, 520px); border-top: 1px solid rgba(0,0,0,.08); }
.dock-panel[hidden] { display: none; }
.dock-tools { display: flex; gap: .4rem; align-items: center; padding: .5rem .6rem; } .dock-tools input { flex: 1; min-width: 0; font-size: .85rem; }
.dock-rows { overflow-y: auto; padding: 0 .3rem .4rem; }
.dock-row { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; background: transparent; padding: .4rem .45rem; border-radius: 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; text-decoration: none; }
.dock-row:hover { background: rgba(0,0,0,.05); } .dock-row.unread b { color: #000; } .dock-row.unread small { font-weight: 600; }
.dock-rt { flex: 1; min-width: 0; display: grid; } .dock-rt b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-rt small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-sub { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .5rem .5rem .1rem; }
.dock-foot { display: block; text-align: center; padding: .45rem; border-top: 1px solid rgba(0,0,0,.08); } .dock-empty { padding: .4rem .6rem; }
.dock-form { display: grid; gap: .35rem; padding: 0 .7rem .7rem; overflow-y: auto; } .dock-form input:not([type=checkbox]) { font-size: .88rem; }
.dock-people { max-height: 150px; overflow-y: auto; display: grid; gap: .15rem; font-size: .88rem; }
.dock-err { color: #c0262d; }
.dock-ores { display: grid; max-height: 150px; overflow-y: auto; } .dock-ores button { border: 0; background: transparent; text-align: left; padding: .3rem .4rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .85rem; } .dock-ores button:hover { background: rgba(0,0,0,.06); }
.dock-win { width: 320px; height: 420px; display: flex; flex-direction: column; border-radius: 16px 16px 0 0; background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.85); border-bottom: 0;
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); box-shadow: 0 -6px 30px rgba(30,30,60,.2); }
.dock-win.min { height: auto; } .dock-win.min .dock-msgs, .dock-win.min .dock-comp { display: none; }
.dock-win header { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .5rem .7rem; border-bottom: 1px solid rgba(0,0,0,.08); cursor: pointer; }
.dock-wt { min-width: 0; display: grid; } .dock-wt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; } .dock-wt small { font-size: .74rem; } .dock-wt small:empty { display: none; }
.dock-win header span { display: flex; gap: .15rem; flex: none; } .dock-win header button, .dock-win header a { border: 0; background: none; cursor: pointer; padding: .1rem .3rem; border-radius: 6px; color: inherit; text-decoration: none; font-size: .9rem; }
.dock-win header button:hover, .dock-win header a:hover { background: rgba(0,0,0,.08); }
.dock-msgs { flex: 1; overflow-y: auto; padding: .5rem .6rem; display: grid; align-content: start; gap: .4rem; font-size: .86rem; }
.dock-msgs .msg { max-width: 92%; padding: .3rem .55rem; border-radius: 14px; background: rgba(0,0,0,.06); } .dock-msgs .msg.mine { justify-self: end; background: rgba(10,132,255,.16); }
.dock-msgs .msg.sys { justify-self: center; background: none; font-size: .75rem; color: var(--muted); } .dock-msgs .mhead { font-size: .72rem; display: flex; gap: .3rem; align-items: center; } .dock-msgs .avatar { display: none; }
.dock-msgs .mbody { overflow-wrap: anywhere; }
.dock-comp { border-top: 1px solid rgba(0,0,0,.08); padding: .4rem .5rem; display: grid; gap: .3rem; }
.dock-line { display: flex; gap: .3rem; align-items: flex-end; } .dock-line textarea { flex: 1; resize: none; font-size: .86rem; max-height: 90px; min-width: 0; }
.dock-tagbtn { border: 0; background: rgba(0,0,0,.06); border-radius: 10px; padding: .35rem .45rem; cursor: pointer; }
.dock-tagpick input { width: 100%; font-size: .85rem; } .dock-tagpick[hidden], .dock-tagrow[hidden] { display: none; }
.otag { display: inline-flex; align-items: center; gap: .3rem; background: rgba(255,170,0,.18); color: #7a5a14; border: 1px solid rgba(255,170,0,.35); border-radius: 999px; padding: .05rem .5rem; font-size: .76rem; text-decoration: none; cursor: pointer; font-family: inherit; }
.otag button { border: 0; background: none; cursor: pointer; padding: 0; color: inherit; }
/* keep the other bottom-right tools above the bar */
body.has-dock .calc, body.has-dock .qn { bottom: 56px; }
body.is-popup .dock { display: none !important; }
@media (max-width: 900px) { .dock-wins { display: none; } .dock-bar { width: 220px; } }
@media print { .dock { display: none !important; } }

/* ---- v5.16 column picker + frozen board headers */
.colpick-th { width: 2.2rem; text-align: center; }
.colpick-btn { border: 1px dashed var(--line); background: rgba(255,255,255,.7); border-radius: 8px; width: 1.8rem; height: 1.8rem; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.colpick-btn:hover { background: #fff; border-style: solid; }
.colpick[hidden] { display: none; }
.colpick { position: fixed; z-index: 160; width: 270px; max-height: 70vh; display: flex; flex-direction: column; padding: .7rem; border-radius: 18px; background: rgba(255,255,255,.9);
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); box-shadow: 0 18px 50px rgba(30,30,60,.28); border: 1px solid rgba(255,255,255,.85); }
.colpick-h, .colpick-f { display: flex; justify-content: space-between; align-items: center; gap: .4rem; } .colpick-h button { border: 0; background: none; cursor: pointer; }
.colpick-list { overflow-y: auto; display: grid; gap: .1rem; padding: .4rem 0; } .colpick-list label { display: flex; align-items: center; gap: .45rem; padding: .22rem .3rem; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.colpick-list label:hover { background: rgba(0,0,0,.05); } .colpick-list .cfcol { color: #7a5a14; }
/* Order board: column headers stay put while the cards scroll */
.kanban { max-height: calc(100vh - 235px); overflow: auto; align-items: flex-start; }
.kanban .kb-col { overflow: visible; }
.kanban .kb-col > h3 { position: sticky; top: 0; z-index: 5; margin: -.5rem -.5rem .4rem; padding: .6rem .85rem .5rem; border-radius: var(--radius) var(--radius) 0 0;
  background: color-mix(in srgb, var(--line) 55%, #fff); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.colpick-th { position: sticky; right: 0; background: rgba(255,255,255,.85); z-index: 2; }

/* ---- v5.17 money box, payments, proofs, reports */
.money-box { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; justify-content: flex-end; align-items: center; padding: .6rem .2rem 0; font-size: .92rem; }
.money-box > div { display: flex; gap: .4rem; align-items: baseline; } .money-box span { color: var(--muted); }
.money-box .tot b { font-size: 1.05rem; } .money-box .due b { color: #c0262d; } .money-box .links { margin-left: auto; }
.stat-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: .6rem 0 1rem; }
.stat { flex: 1 1 150px; padding: .7rem .9rem; border-radius: 16px; background: rgba(255,255,255,.7); border: 1px solid var(--line); }
.stat small { color: var(--muted); display: block; } .stat b { font-size: 1.35rem; } .stat.bad b { color: #c0262d; }
.hbar { display: grid; grid-template-columns: minmax(7rem, 14rem) 1fr auto; gap: .6rem; align-items: center; margin: .25rem 0; font-size: .9rem; }
.hbar i { display: block; height: .7rem; border-radius: 999px; background: linear-gradient(90deg, #c9a24a, #8a6a1f); min-width: 2px; }
.hbar .trk { background: rgba(0,0,0,.06); border-radius: 999px; }
.age { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.age.a0 { background: #e6f6ea; color: #17652e; } .age.a1 { background: #fff4d6; color: #8a6a00; } .age.a2 { background: #ffe3d1; color: #a24a00; } .age.a3 { background: #fde0e0; color: #b02323; }
.proof-row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.pst { padding: .05rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; } .pst.PENDING { background: #fff4d6; color: #8a6a00; } .pst.APPROVED { background: #e6f6ea; color: #17652e; } .pst.CHANGES { background: #fde0e0; color: #b02323; }

/* ---- v5.18 next-order pop-up + grouped sidebar */
.noa[hidden] { display: none; }
.noa { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 1rem; background: rgba(20,16,8,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.noa-card { width: min(520px, 100%); background: rgba(255,255,255,.96); border-radius: 24px; padding: 1.4rem 1.5rem; box-shadow: 0 30px 90px rgba(0,0,0,.45); border: 2px solid #c9a24a; animation: noapop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes noapop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.noa-ring { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: #fff4d6; animation: noapulse 1.6s infinite; }
@keyframes noapulse { 0% { box-shadow: 0 0 0 0 rgba(201,162,74,.6); } 70% { box-shadow: 0 0 0 16px rgba(201,162,74,0); } 100% { box-shadow: 0 0 0 0 rgba(201,162,74,0); } }
.noa-card h2 { margin: .7rem 0 .2rem; font-size: 1.25rem; } .noa-sub { margin: 0 0 .4rem; color: var(--muted); } .noa-late { color: #c0262d; }
.noa-note { background: #fff9e8; border-radius: 12px; padding: .5rem .7rem; margin: .4rem 0; font-style: italic; } .noa-meta { font-size: .9rem; margin: .3rem 0 .6rem; }
.noa-card textarea { width: 100%; font-size: .92rem; } .noa-next { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); margin: .4rem 0; }
.noa-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; } .noa-btns button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .55rem .9rem; font: inherit; cursor: pointer; }
.noa-btns button:hover { background: #f6f0e1; } .noa-btns .noa-done { background: linear-gradient(180deg, #d9b45a, #b98f33); color: #fff; border-color: #b98f33; font-weight: 700; }
.noa-count { margin: .7rem 0 0; font-size: .82rem; color: var(--muted); } body.noa-open { overflow: hidden; }
/* sidebar groups */
.side details.nav-g { margin: .1rem 0; } .side details.nav-g > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .42rem .6rem; border-radius: 10px; color: #cfc9ba; font-size: .82rem; font-weight: 700; letter-spacing: .03em; user-select: none; }
.side details.nav-g > summary::-webkit-details-marker { display: none; }
.side details.nav-g > summary::after { content: "▸"; margin-left: auto; opacity: .55; transition: transform .15s ease; font-size: .8rem; }
.side details.nav-g[open] > summary::after { transform: rotate(90deg); }
.side details.nav-g > summary:hover { background: rgba(255,255,255,.07); }
.side details.nav-g.has-on > summary { color: #f4dca0; }
.side details.nav-g > .nav-items { margin: .05rem 0 .35rem .85rem; padding-left: .45rem; border-left: 1px solid rgba(255,255,255,.12); }
.side details.nav-g a.nav { padding: .3rem .55rem; font-size: .92rem; }
.nav-sep { height: 1px; background: rgba(255,255,255,.1); margin: .5rem .4rem; }
