/* Uga Escapes IT Helpdesk
   Layout: portal = canopy header band + centred working column; console = forest sidebar + scrolling workspace (Planner-like board).
   Palette: canopy olive, forest floor, thatch gold, mist neutrals biased to green. */
:root {
  --bg: #EDEFE6;
  --surface: #FFFFFF;
  --surface-2: #F6F7F1;
  --surface-3: #E6E9DD;
  --ink: #1C2116;
  --ink-2: #464E3C;
  --muted: #747C69;
  --line: #D9DDCD;
  --line-2: #C9CFBA;
  --brand: #4E5D24;
  --brand-2: #3D4A1B;
  --brand-ink: #FFFFFF;
  --brand-soft: #E2E8CC;
  --forest: #1B2719;
  --forest-2: #253423;
  --forest-ink: #DCE3CC;
  --forest-muted: #93A086;
  --thatch: #B9822F;
  --thatch-soft: #F5E7CC;
  --st-new: #5A6782;
  --st-new-soft: #E4E8F0;
  --st-prog: #B26F07;
  --st-prog-soft: #FBEBCB;
  --st-done: #2E7A4C;
  --st-done-soft: #D9EEDF;
  --danger: #B0352E;
  --danger-soft: #F7DEDB;
  --c-recv: #C27A1E;
  --c-done: #1F6E9A;
  --shadow: 0 1px 2px rgba(28, 33, 22, .06), 0 4px 14px rgba(28, 33, 22, .06);
  --shadow-lg: 0 10px 40px rgba(20, 26, 14, .18);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 10px;
  --r-sm: 7px;
  --side: 236px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10150E; --surface: #182016; --surface-2: #1E271B; --surface-3: #263122; --ink: #E8ECDE; --ink-2: #BAC2AB; --muted: #8C957E;
    --line: #2D3828; --line-2: #3A4733; --brand: #A9BE68; --brand-2: #BED37A; --brand-ink: #141A0D; --brand-soft: #2B361E;
    --forest: #0B100A; --forest-2: #162014; --forest-ink: #DCE3CC; --forest-muted: #8A977C; --thatch: #D9A75B; --thatch-soft: #3A2E18;
    --st-new: #A2B0CC; --st-new-soft: #252C3A; --st-prog: #E8AE4A; --st-prog-soft: #3B2E14; --st-done: #6FC48F; --st-done-soft: #183022;
    --danger: #F08077; --danger-soft: #3D1E1B; --c-recv: #C27A1E; --c-done: #3E95D0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10150E; --surface: #182016; --surface-2: #1E271B; --surface-3: #263122; --ink: #E8ECDE; --ink-2: #BAC2AB; --muted: #8C957E;
  --line: #2D3828; --line-2: #3A4733; --brand: #A9BE68; --brand-2: #BED37A; --brand-ink: #141A0D; --brand-soft: #2B361E;
  --forest: #0B100A; --forest-2: #162014; --forest-ink: #DCE3CC; --forest-muted: #8A977C; --thatch: #D9A75B; --thatch-soft: #3A2E18;
  --st-new: #A2B0CC; --st-new-soft: #252C3A; --st-prog: #E8AE4A; --st-prog-soft: #3B2E14; --st-done: #6FC48F; --st-done-soft: #183022;
  --danger: #F08077; --danger-soft: #3D1E1B; --c-recv: #C27A1E; --c-done: #3E95D0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--thatch); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-size: .86em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 14px; }
.hide { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.gold { background: var(--thatch); color: #fff; border-color: var(--thatch); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 5px 10px; font-size: .84rem; }
.btn.lg { padding: 12px 22px; font-size: 1rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.btn svg, .icon-btn svg { width: 17px; height: 17px; flex: none; }

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .lbl { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--muted); }
.req::after { content: " *"; color: var(--danger); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: 9px 11px; min-height: 40px; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.input.bad { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.chip svg { width: 13px; height: 13px; }
.st-0 { background: var(--st-new-soft); color: var(--st-new); }
.st-1 { background: var(--st-prog-soft); color: var(--st-prog); }
.st-2 { background: var(--st-done-soft); color: var(--st-done); }
.chip.due { background: var(--surface-3); color: var(--ink-2); }
.chip.late { background: var(--danger); color: #fff; }
.chip.label { color: #fff; }
.chip.soft { background: var(--surface-3); color: var(--ink-2); }
.pri { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600; }
.pri i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pri-0 { color: var(--danger); } .pri-0 i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.pri-1 { color: var(--st-prog); } .pri-1 i { background: var(--st-prog); }
.pri-2 { color: var(--brand); } .pri-2 i { background: var(--brand); }
.pri-3 { color: var(--muted); } .pri-3 i { background: transparent; border: 2px solid var(--muted); width: 8px; height: 8px; }

.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 700; flex: none; border: 2px solid var(--surface); letter-spacing: .02em; }
.av.lg { width: 44px; height: 44px; font-size: .95rem; }
.av.xl { width: 58px; height: 58px; font-size: 1.15rem; }
.avs { display: inline-flex; }
.avs .av + .av { margin-left: -8px; }
.av.more { background: var(--surface-3); color: var(--ink-2); }

/* ---------- toast / modal ---------- */
#toasts { position: fixed; z-index: 90; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); right: calc(18px + env(safe-area-inset-right, 0px)); display: grid; gap: 8px; }
.toast { background: var(--forest); color: var(--forest-ink); padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 360px; animation: pop .2s ease; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.overlay { position: fixed; inset: 0; background: rgba(12, 16, 9, .5); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100% - 20px); overflow: auto; }
.modal.wide { width: min(1080px, 100%); }
.modal-h { padding: 18px 22px 0; display: flex; align-items: center; gap: 10px; }
.modal-b { padding: 18px 22px 22px; display: grid; gap: 14px; }
.modal-f { padding: 0 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ================= PORTAL ================= */
.p-nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--forest) 92%, transparent); backdrop-filter: blur(8px); color: var(--forest-ink); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--forest); }
.p-nav-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand b { font-family: var(--f-display); font-size: 1.08rem; letter-spacing: -.01em; display: block; line-height: 1.1; }
.brand small { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--forest-muted); }
.p-nav a.nl, .p-nav button.nl { color: var(--forest-ink); text-decoration: none; padding: 7px 11px; border-radius: 7px; font-weight: 600; font-size: .9rem; background: none; border: 0; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.p-nav .nl:hover, .p-nav .nl.on { background: rgba(255,255,255,.1); }
.p-nav .nl svg { width: 16px; height: 16px; }
@media (max-width: 600px) { .p-nav .nl span { display: none; } .p-nav .nl { padding: 8px; } .p-nav-in { flex-wrap: nowrap; } .brand small { display: none; } }

.hero { position: relative; overflow: hidden; color: #F2F4EA; background:
  radial-gradient(120% 140% at 85% -20%, rgba(185,130,47,.45), transparent 55%),
  radial-gradient(90% 120% at 0% 120%, rgba(110,140,60,.55), transparent 60%),
  linear-gradient(160deg, #2C3D22 0%, #1B2719 60%, #141D12 100%); }
.hero.has-photo { background-size: cover; background-position: center; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.hero-in { position: relative; max-width: 1120px; margin: 0 auto; padding-block: 44px 76px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.hero h1 { color: #fff; max-width: 18ch; }
.hero p { color: #D7DEC8; max-width: 56ch; font-size: 1.04rem; margin: 10px 0 0; }
.hero .eyebrow { color: #E2C48D; }
.p-main { max-width: 1120px; margin: -48px auto 40px; position: relative; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 20px; }
.p-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .p-cols { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card-b { padding: 22px; }
.form-sec { padding: 22px 24px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.form-sec:first-child { border-top: 0; }
.sec-h { display: flex; gap: 12px; align-items: baseline; }
.sec-h .n { font-family: var(--f-display); font-weight: 700; color: var(--thatch); font-size: 1.05rem; }
.who-card { display: flex; gap: 14px; align-items: center; background: var(--brand-soft); border-radius: 12px; padding: 14px 16px; flex-wrap: wrap; }
.who-card .meta { flex: 1; min-width: 200px; }
.who-card .meta b { display: block; font-size: 1.02rem; }
.cat-groups { display: grid; gap: 14px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.cat { display: flex; gap: 9px; align-items: center; text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 9px 11px; cursor: pointer; font-size: .86rem; font-weight: 600; line-height: 1.25; color: var(--ink-2); transition: all .12s; min-height: 50px; }
.cat svg { width: 22px; height: 22px; flex: none; color: var(--brand); }
.cat:hover { border-color: var(--brand); background: var(--surface-2); }
.cat.on { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.cat.on svg { color: var(--brand-ink); }
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.on { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.side-card { padding: 20px; display: grid; gap: 12px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.steps li span:first-child { width: 26px; height: 26px; border-radius: 50%; background: var(--thatch-soft); color: var(--thatch); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.success { text-align: center; padding: 40px 22px; display: grid; gap: 14px; justify-items: center; }
.success .big { font-family: var(--f-mono); font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 8px 18px; border-radius: 12px; letter-spacing: -.02em; }
.tick-ill { width: 76px; height: 76px; }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 6px 0; }
.stepper div { text-align: center; position: relative; font-size: .82rem; font-weight: 600; color: var(--muted); padding-top: 30px; }
.stepper div::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--line-2); z-index: 1; }
.stepper div::after { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 3px; background: var(--line-2); }
.stepper div:first-child::after { display: none; }
.stepper div.on { color: var(--ink); }
.stepper div.on::before { background: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.stepper div.on::after { background: var(--brand); }
.thread { display: grid; gap: 12px; }
.msg { display: grid; grid-template-columns: 32px 1fr; gap: 10px; }
.msg .bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 10px 13px; min-width: 0; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--brand-soft); border-color: transparent; }
.msg.internal .bubble { background: var(--thatch-soft); border-color: transparent; }
.msg .who { font-size: .8rem; color: var(--muted); margin-bottom: 3px; }
.msg .who b { color: var(--ink); }
.list-t { display: grid; gap: 10px; }
.tcard { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-decoration: none; color: inherit; }
.tcard:hover { border-color: var(--brand); }
.tcard .t { font-weight: 650; }
.p-foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 10px 16px 30px; }
.auth-wrap { max-width: 440px; margin: 0 auto; width: 100%; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }

/* ================= CONSOLE ================= */
.c-shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100%; }
.c-side { background: var(--forest); color: var(--forest-ink); display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; overflow-y: auto; padding-left: max(12px, env(safe-area-inset-left, 0px)); }
.c-side .brand { margin: 2px 6px 18px; }
.c-side a.nav { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--forest-ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.c-side a.nav svg { width: 18px; height: 18px; color: var(--forest-muted); }
.c-side a.nav:hover { background: var(--forest-2); }
.c-side a.nav.on { background: var(--forest-2); color: #fff; box-shadow: inset 3px 0 0 var(--thatch); }
.c-side a.nav.on svg { color: var(--thatch); }
.c-side .count { margin-left: auto; font-size: .75rem; background: rgba(255,255,255,.1); padding: 0 8px; border-radius: 99px; }
.c-side .sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 6px; }
.c-side .me { margin-top: auto; display: flex; gap: 6px; align-items: center; padding: 10px 4px; border-radius: 10px; }
.c-side .me b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-side .me .icon-btn { width: 30px; height: 30px; flex: none; }
.c-side .me .av { border-color: var(--forest); }
.c-side .me small { display: block; color: var(--forest-muted); font-size: .75rem; }
.c-main { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }
.c-top { display: flex; align-items: center; gap: 12px; padding-block: 12px; padding-left: 22px; padding-right: max(22px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.c-top h2 { font-size: 1.25rem; }
.c-search { position: relative; flex: 0 1 340px; min-width: 180px; }
.c-search input { padding-left: 34px; min-height: 38px; background: var(--surface-2); }
.c-search svg { position: absolute; left: 10px; top: 10px; width: 17px; height: 17px; color: var(--muted); }
.c-body { flex: 1; overflow: auto; padding-block: 20px 40px; padding-left: 22px; padding-right: max(22px, env(safe-area-inset-right, 0px)); }
.c-body.board-body { padding-bottom: 12px; display: flex; flex-direction: column; overflow: hidden; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .c-shell { grid-template-columns: 1fr; }
  .c-side { position: fixed; z-index: 70; inset: 0 auto 0 0; width: 260px; transform: translateX(-105%); transition: transform .2s; padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .c-side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .c-body, .c-top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select.input, .toolbar input.input { min-height: 36px; padding: 6px 10px; width: auto; max-width: 220px; font-size: .88rem; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; cursor: default; position: relative; overflow: hidden; }
.kpi[data-go] { cursor: pointer; }
.kpi[data-go]:hover { border-color: var(--brand); }
.kpi .v { font-family: var(--f-display); font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: .82rem; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.kpi .k i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kpi .s { font-size: .78rem; color: var(--muted); }
.kpi.alert .v { color: var(--danger); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0; }
.panel-h { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
@media (max-width: 1100px) { .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } }

/* team workload */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tw { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--surface); cursor: pointer; transition: border-color .15s, transform .15s; }
.tw:hover { border-color: var(--brand); transform: translateY(-1px); }
.tw-h { display: flex; gap: 10px; align-items: center; min-width: 0; }
.tw-h div { min-width: 0; }
.tw-h b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-h small { color: var(--muted); font-size: .78rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-n { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.tw-n div { background: var(--surface-2); border-radius: 8px; padding: 6px 2px; }
.tw-n b { font-family: var(--f-display); font-size: 1.25rem; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tw-n small { font-size: .7rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.tw-n .late b { color: var(--danger); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); display: flex; overflow: hidden; gap: 2px; }
.bar span { display: block; height: 100%; border-radius: 99px; }

/* horizontal bar lists */
.hbars { display: grid; gap: 9px; }
.hb { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 54px; gap: 10px; align-items: center; font-size: .86rem; cursor: default; }
.hb[data-go] { cursor: pointer; }
.hb .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hb .t { height: 14px; background: var(--surface-2); border-radius: 0 4px 4px 0; position: relative; }
.hb .t span { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 2px; }
.hb .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hb:hover .t span { background: var(--thatch); }

/* svg chart */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart-wrap { position: relative; }
.tip { position: absolute; pointer-events: none; background: var(--forest); color: var(--forest-ink); padding: 7px 10px; border-radius: 8px; font-size: .8rem; box-shadow: var(--shadow-lg); white-space: nowrap; z-index: 5; transform: translate(-50%, -110%); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* lists */
.mini { display: grid; }
.mini-r { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.mini-r:first-child { border-top: 0; }
.mini-r:hover { background: var(--surface-2); }
.mini-r .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mini-r small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* board */
.board { display: flex; gap: 14px; overflow-x: auto; flex: 1; padding-bottom: 10px; align-items: flex-start; min-height: 0; }
.col { flex: 0 0 300px; background: var(--surface-3); border-radius: 12px; display: flex; flex-direction: column; max-height: 100%; min-height: 0; }
.col-h { display: flex; gap: 9px; align-items: center; padding: 12px 12px 8px; }
.col-h b { font-family: var(--f-display); font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.col-h .cnt { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--surface); border-radius: 99px; padding: 1px 9px; }
.col-add { margin: 0 10px 8px; border: 1px dashed var(--line-2); background: transparent; border-radius: 8px; padding: 7px; color: var(--muted); font-weight: 600; cursor: pointer; display: flex; gap: 6px; align-items: center; justify-content: center; }
.col-add:hover { color: var(--ink); border-color: var(--brand); background: var(--surface); }
.col-b { overflow-y: auto; padding: 0 10px 12px; display: grid; gap: 8px; align-content: start; min-height: 60px; flex: 1; }
.col.drag-over { box-shadow: inset 0 0 0 2px var(--brand); }
.kcard { background: var(--surface); border-radius: 10px; padding: 11px 12px; display: grid; gap: 8px; cursor: pointer; box-shadow: var(--shadow); border: 1px solid transparent; }
.kcard:hover { border-color: var(--line-2); }
.kcard.dragging { opacity: .4; }
.kcard .k-t { font-weight: 600; line-height: 1.35; font-size: .9rem; overflow-wrap: anywhere; }
.kcard .k-t .done { text-decoration: line-through; color: var(--muted); }
.kcard .k-s { font-size: .78rem; color: var(--muted); }
.kcard .k-f { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kcard .labels { display: flex; gap: 4px; flex-wrap: wrap; }
.kcard .labels .chip { font-size: .7rem; padding: 0 7px; }
.kmeta { display: inline-flex; gap: 3px; align-items: center; font-size: .76rem; color: var(--muted); }
.kmeta svg { width: 13px; height: 13px; }
.round-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--muted); display: inline-grid; place-items: center; flex: none; background: none; padding: 0; cursor: pointer; }
.round-check:hover { border-color: var(--st-done); background: var(--st-done-soft); }
.round-check.on { background: var(--st-done); border-color: var(--st-done); color: #fff; }
.round-check svg { width: 11px; height: 11px; }
.col-more { text-align: center; font-size: .8rem; color: var(--muted); padding: 4px; }

/* table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.tbl { border-collapse: collapse; width: 100%; font-size: .87rem; }
.tbl th { text-align: left; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; cursor: pointer; user-select: none; }
.tbl th.sorted { color: var(--ink); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .ell { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface-2); padding: 8px; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cal .day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.out { background: var(--surface-2); }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--thatch); }
.cal .dn { font-size: .78rem; font-weight: 700; color: var(--muted); }
.cal .ev { font-size: .74rem; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid; }
.cal .ev.s0 { background: var(--st-new-soft); border-color: var(--st-new); }
.cal .ev.s1 { background: var(--st-prog-soft); border-color: var(--st-prog); }
.cal .ev.s2 { background: var(--st-done-soft); border-color: var(--st-done); opacity: .75; }
.cal .ev.late { background: var(--danger-soft); border-color: var(--danger); }
.cal .more { font-size: .72rem; color: var(--muted); padding-left: 4px; cursor: pointer; }
@media (max-width: 700px) { .cal .day { min-height: 70px; } .cal .ev { font-size: 0; height: 6px; padding: 0; } }

/* ticket detail */
.td { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 860px) { .td { grid-template-columns: 1fr; } }
.td-main { padding: 20px 24px 24px; display: grid; gap: 16px; align-content: start; border-right: 1px solid var(--line); min-width: 0; }
.td-side { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); min-width: 0; }
.td-title { font-family: var(--f-display); font-size: 1.3rem; font-weight: 650; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin-left: -7px; width: calc(100% + 7px); background: transparent; resize: none; line-height: 1.3; }
.td-title:hover { border-color: var(--line); }
.td-title:focus { border-color: var(--brand); outline: none; background: var(--surface); }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 520px) { .meta-grid { grid-template-columns: 1fr; } }
.meta-grid .field > label { font-size: .78rem; color: var(--muted); }
.req-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .88rem; background: var(--surface-2); }
.req-card dt { color: var(--muted); }
.req-card dd { margin: 0; overflow-wrap: anywhere; }
.cl-item { display: flex; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 6px; }
.cl-item:hover { background: var(--surface-2); }
.cl-item span { flex: 1; }
.cl-item.done span { text-decoration: line-through; color: var(--muted); }
.cl-item .x { opacity: 0; }
.cl-item:hover .x { opacity: 1; }
.files { display: grid; gap: 6px; }
.file { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .86rem; min-width: 0; }
.file a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker { position: absolute; z-index: 80; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); width: 290px; max-height: 360px; overflow: auto; padding: 6px; }
.picker input.input { margin-bottom: 6px; min-height: 34px; }
.pick { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick .ck { margin-left: auto; color: var(--brand); width: 16px; height: 16px; }
.activity { font-size: .8rem; color: var(--muted); display: grid; gap: 6px; }
.activity b { color: var(--ink-2); font-weight: 600; }

/* team page */
.ucard { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.ucard:first-child { border-top: 0; }
.ucard .m { min-width: 0; }
.ucard .m b { display: block; }
.ucard .m small { color: var(--muted); }
.role { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); }
.role.admin { background: var(--thatch-soft); color: var(--thatch); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }
.prop-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.lk-row { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--line); }
.lk-row:first-child { border-top: 0; }
.lk-row .nm { flex: 1; min-width: 0; }
.lk-row.off .nm { color: var(--muted); text-decoration: line-through; }
.dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty svg { width: 44px; height: 44px; color: var(--line-2); }
.loading { display: grid; place-items: center; height: 100%; min-height: 50vh; color: var(--muted); gap: 12px; }
.spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-bar { background: var(--thatch); color: #fff; font-size: .82rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-block: 6px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.demo-bar select { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 6px; padding: 3px 6px; }
.demo-bar select option { color: #000; }
.app-root { height: 100%; display: flex; flex-direction: column; }
.app-root > .view { flex: 1; min-height: 0; overflow: auto; }
.app-root > .view.console { overflow: hidden; }

@media print {
  .c-side, .c-top, .toolbar, .no-print, .demo-bar, #toasts { display: none !important; }
  .c-shell { display: block; } .c-main, .c-body, .app-root > .view { overflow: visible !important; height: auto; }
  .panel { break-inside: avoid; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
