/* JoeWork — JoeDynamics brand: navy #005491, blue #497ac3, graphite #414042 */
:root {
  --brand: #005491; --brand-2: #497ac3; --brand-ink: #414042;
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f7;
  --border: #e3e8ef; --border-strong: #cbd3de;
  --text: #1c2331; --text-2: #4b5565; --muted: #6b7686;
  --accent: var(--brand); --accent-soft: #e6f0f8; --focus: rgba(0, 84, 145, .28);
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --bad: #c02646; --bad-soft: #fee2e2;
  --st-backlog: #64748b; --st-in_progress: #0284c7; --st-internal_uat: #7c3aed; --st-external_uat: #d97706; --st-done: #16a34a;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06); --shadow: 0 4px 16px rgba(16, 24, 40, .08); --shadow-lg: 0 18px 50px rgba(16, 24, 40, .18);
  --radius: 10px; --radius-sm: 7px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e131b; --surface: #151c26; --surface-2: #1a2230; --surface-3: #222c3b;
  --border: #283344; --border-strong: #37445a;
  --text: #e6ebf2; --text-2: #b4bfcd; --muted: #8592a5;
  --accent: #6d9be0; --accent-soft: #1b2c44; --focus: rgba(109, 155, 224, .35);
  --ok: #4ade80; --ok-soft: #133022; --warn: #fbbf24; --warn-soft: #34290f; --bad: #fb7185; --bad-soft: #3a1720;
  --st-backlog: #94a3b8; --st-in_progress: #38bdf8; --st-internal_uat: #a78bfa; --st-external_uat: #fbbf24; --st-done: #4ade80;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 4px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
kbd { font: 600 11px var(--font); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface); color: var(--text-2); }
.ic { width: 16px; height: 16px; flex: none; }
.muted { color: var(--muted); } .sm { font-size: 12.5px; } .xs { font-size: 11.5px; }
.grow { flex: 1; min-width: 0; } .pad { padding: 16px; } .mt { margin-top: 14px; }
.row { display: flex; align-items: center; } .gap-xs { gap: 4px; } .gap-sm { gap: 8px; }
.stack { display: flex; flex-direction: column; }
.invisible { visibility: hidden; }
.only-sm, .only-mobile { display: none !important; }
[hidden] { display: none !important; }
.boot { display: grid; place-items: center; height: 100vh; } .boot img { height: 40px; opacity: .7; animation: pulse 1.2s infinite alternate; }
@keyframes pulse { to { opacity: .25; } }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-3); }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus, .tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 29px; padding: 0 10px; font-size: 13px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #00467a; }
:root[data-theme="dark"] .btn-primary { background: #2a6cb6; border-color: #2a6cb6; }
.btn-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn-primary kbd { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); } .btn-ghost:hover { background: var(--surface-3); }
.btn-danger, .btn-danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--bad); } .btn-danger-ghost:hover { background: var(--bad-soft); }
.btn-block { width: 100%; justify-content: center; height: 40px; }
.btn-ok.on, .btn-ok:hover { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn-defer.on, .btn-defer:hover { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.btn-decline.on, .btn-decline:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); } .icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.sm { width: 26px; height: 26px; } .icon-btn.sm .ic { width: 14px; height: 14px; }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text); text-align: left; } .link-btn:hover { color: var(--accent); }
.input { width: 100%; min-height: 34px; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
textarea.input { resize: vertical; line-height: 1.45; }
.input:disabled { background: var(--surface-2); color: var(--text-2); }
.input-sm { min-height: 29px; padding: 4px 8px; font-size: 13px; width: auto; }
.input-lg { min-height: 46px; font-size: 16px; padding: 10px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 0; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .grid3 { display: grid; grid-template-columns: 1.6fr 1.2fr 1fr; gap: 0 12px; }
.hint { font-size: 12.5px; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { display: none; } .switch span { width: 32px; height: 18px; border-radius: 99px; background: var(--border-strong); position: relative; transition: .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--accent); } .switch input:checked + span::after { left: 16px; }

/* ---------- status colours */
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--st-backlog); }
.st-backlog { --st: var(--st-backlog); } .st-in_progress { --st: var(--st-in_progress); } .st-internal_uat { --st: var(--st-internal_uat); }
.st-external_uat { --st: var(--st-external_uat); } .st-done { --st: var(--st-done); }
.dot[class*="st-"] { background: var(--st); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--st, var(--muted)) 14%, transparent); color: var(--st, var(--text-2)); }
.pill-ok { --st: var(--ok); } .pill-open { --st: var(--warn); }
.st-bg-backlog { background: var(--st-backlog); } .st-bg-in_progress { background: var(--st-in_progress); } .st-bg-internal_uat { background: var(--st-internal_uat); }
.st-bg-external_uat { background: var(--st-external_uat); } .st-bg-done { background: var(--st-done); }
.badge { display: inline-flex; align-items: center; gap: 3px; height: 21px; padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.blk-amber { background: var(--warn-soft); color: var(--warn); } .blk-red { background: var(--bad-soft); color: var(--bad); } .blk-info { background: var(--surface-3); color: var(--muted); }
.tb-pass { background: var(--ok-soft); color: var(--ok); } .tb-fail { background: var(--bad-soft); color: var(--bad); } .tb-blocked { background: var(--warn-soft); color: var(--warn); }
.pr-high { background: var(--warn-soft); color: var(--warn); } .pr-critical { background: var(--bad-soft); color: var(--bad); } .pr-low { color: var(--muted); }
.overdue { background: var(--bad-soft); color: var(--bad); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; } .avatar.xs { width: 21px; height: 21px; font-size: 9.5px; } .avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 600; margin-left: 6px; }
.code-chip { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.code-chip.lg { height: 28px; padding: 0 10px; font-size: 12.5px; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.area-chip { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; padding: 2px 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-right: 6px; }
.sigma { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.card-title { font-size: 14px; margin-bottom: 12px; }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--brand) 18%, transparent), transparent), var(--bg); }
.login-card { width: 100%; max-width: 390px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 30px 28px; box-shadow: var(--shadow-lg); }
.brand-login { background: #fff; border-radius: 10px; padding: 10px 12px; display: inline-block; margin: -4px 0 14px -6px; }
.brand-login img { height: 40px; display: block; }
.login-title { font-size: 26px; font-weight: 700; color: var(--text); }
.login-card > .muted { margin: 2px 0 20px; }
.login-client { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; font-size: 13.5px; }
.login-msg { padding: 9px 12px; border-radius: 8px; background: var(--surface-3); margin-bottom: 14px; font-size: 13px; }
.login-err { margin-top: 12px; padding: 9px 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }

/* ---------- shell */
#app { height: 100%; }
body:has(.shell) { overflow: hidden; }
.tabs { scrollbar-width: thin; }
.topbar { height: 58px; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; flex: none; }
.logo-chip { display: inline-flex; align-items: center; background: #fff; border-radius: 7px; padding: 4px 6px; }
:root[data-theme="light"] .logo-chip { padding: 0; }
.logo-full { height: 26px; display: block; } .logo-small { height: 26px; display: block; }
.brand-app { font-weight: 700; font-size: 16px; padding-left: 10px; border-left: 1px solid var(--border-strong); color: var(--text); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 13.5px; }
.crumbs a { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; } .crumbs a:last-child { color: var(--text); font-weight: 600; }
.crumbs .sep { color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); width: 240px; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--text); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.avatar-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer; padding: 3px 6px 3px 3px; border-radius: 99px; }
.avatar-btn:hover { background: var(--surface-3); } .user-name { font-weight: 500; font-size: 13.5px; }
.usercard { display: flex; gap: 14px; align-items: center; }

.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 0; height: calc(100vh - 58px); transition: grid-template-columns .2s; }
body.drawer-open .shell { grid-template-columns: 260px minmax(0, 1fr) min(480px, 42vw); }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 10px 8px 24px; }
.nav-section { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px 6px; }
.nav-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px calc(10px + var(--d) * 16px); border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: 13.5px; }
.nav-row:hover { background: var(--surface-3); color: var(--text); }
.nav-row.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-row .ic { width: 15px; height: 15px; opacity: .8; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-code { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.nav-count { font-size: 11px; color: var(--muted); }
.nav-wish { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--warn); } .nav-wish .ic { width: 12px; height: 12px; }
.nav-add { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-size: 12.5px; padding: 4px 10px 4px calc(12px + var(--d, 0) * 16px); cursor: pointer; border-radius: 6px; width: 100%; }
.nav-add:hover { color: var(--accent); background: var(--surface-3); } .nav-add .ic { width: 13px; height: 13px; }
.nav-foot { margin: 14px 8px 0; padding: 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }
.nav-foot strong { color: var(--text); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; flex: none; }
.tab { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px; border: 0; background: none; color: var(--text-2); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); } .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge { background: var(--warn); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 0 6px; height: 17px; display: grid; place-items: center; }
.view { flex: 1; overflow: auto; padding: 18px 22px 60px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); } .legend > span { display: inline-flex; align-items: center; gap: 5px; }
.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-ic { width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty-ic .ic { width: 26px; height: 26px; } .empty h3 { margin-bottom: 6px; }

/* ---------- tree */
.project { margin-bottom: 22px; }
.project-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.project-name { border: 0; background: none; font-size: 17px; font-weight: 700; cursor: pointer; padding: 0; color: var(--text); }
.project-name:hover { color: var(--accent); }
.area { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.area-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.area.collapsed .area-head { border-bottom: 0; }
.area-head.drop-inside { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.area-name { border: 0; background: none; font-weight: 650; font-size: 14.5px; cursor: pointer; padding: 0; color: var(--text); text-align: left; }
.area-name:hover { color: var(--accent); }
.area-stats { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.area-actions { display: flex; gap: 2px; }
.progress { width: 90px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: inline-block; }
.progress span { display: block; height: 100%; background: var(--st-done); border-radius: 99px; }
.caret { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 5px; flex: none; padding: 0; }
.caret:hover { background: var(--surface-3); color: var(--text); }
.caret .ic { width: 14px; height: 14px; transition: transform .15s; } .caret.open .ic { transform: rotate(90deg); }
.trow { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 10px 4px calc(8px + var(--depth) * 26px); border-bottom: 1px solid var(--border); cursor: pointer; position: relative; outline: none; }
.trow:last-of-type { border-bottom-color: transparent; }
.trow:hover { background: var(--surface-2); }
.trow:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.trow.selected { background: var(--accent-soft); }
.trow.selected::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.trow.is-done .ttitle { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.trow.dragging { opacity: .4; }
.trow.drop-before { box-shadow: inset 0 2px 0 var(--accent); } .trow.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.trow.drop-inside { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.grip { color: var(--muted); opacity: 0; cursor: grab; display: inline-grid; place-items: center; width: 14px; }
.grip .ic { width: 14px; height: 14px; } .trow:hover .grip { opacity: .7; } .grip-sp { width: 0; }
.ttitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.kidcount { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 7px; }
.tbadges { display: flex; align-items: center; gap: 4px; flex: none; }
.teffort { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--text-2); min-width: 58px; line-height: 1.2; }
.tstatus { height: 26px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--st) 35%, transparent); background: color-mix(in srgb, var(--st) 11%, var(--surface)); color: var(--st);
  font-size: 12px; font-weight: 600; padding: 0 6px; cursor: pointer; width: 112px; }
.tactions { display: flex; opacity: 0; transition: opacity .1s; } .trow:hover .tactions, .trow:focus-within .tactions, .trow.selected .tactions { opacity: 1; }
.trow-empty { padding: 14px 16px; font-size: 13px; }
.add-row { display: flex; align-items: center; gap: 8px; padding: 4px 12px; }
.add-ic { color: var(--muted); display: inline-grid; } .add-input { border: 0; background: transparent; outline: none; height: 34px; flex: 1; color: var(--text); }
.add-input::placeholder { color: var(--muted); }

/* ---------- kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 300px; max-height: calc(100vh - 220px); }
.kcol.over { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px 2px; font-weight: 650; font-size: 13px; border-top: 3px solid var(--st); border-radius: var(--radius) var(--radius) 0 0; }
.st-line-backlog { --st: var(--st-backlog); } .st-line-in_progress { --st: var(--st-in_progress); } .st-line-internal_uat { --st: var(--st-internal_uat); }
.st-line-external_uat { --st: var(--st-external_uat); } .st-line-done { --st: var(--st-done); }
.kcol-sub { padding: 0 12px 8px 30px; }
.kcol-body { padding: 0 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; box-shadow: var(--shadow-sm); cursor: pointer; }
.kcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); } .kcard.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus); }
.kcard.dragging { opacity: .4; }
.kcard-ctx { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.kcard-title { font-weight: 550; margin-bottom: 8px; }
.kcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kcard-foot .tbadges { flex-wrap: wrap; }
.kempty { border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- drawer */
.drawer { background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; min-width: 0; }
.drawer-inner { padding: 14px 20px 30px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-kicker { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.drawer-crumbs { font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; }
.title-input { width: 100%; font-size: 19px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 6px 8px; margin: 2px -8px 12px; border-radius: 7px; color: var(--text); width: calc(100% + 16px); }
.title-input:hover:not(:disabled) { border-color: var(--border); } .title-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.title-input:disabled { color: var(--text); }
.status-select { font-weight: 600; color: var(--st); border-color: color-mix(in srgb, var(--st) 45%, var(--border-strong)); background: color-mix(in srgb, var(--st) 8%, var(--surface)); }
.rollup-box { min-height: 34px; display: flex; align-items: center; padding: 0 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 600; color: var(--accent); font-size: 13.5px; }
.dsec { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 8px; margin-bottom: 8px; }
.dsec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.dsec-head h3 { font-size: 13.5px; display: flex; align-items: center; }
.sublist { display: flex; flex-direction: column; gap: 2px; }
.subrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; } .subrow:hover { background: var(--surface-2); }
.deprow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); margin-bottom: 5px; font-size: 13px; }
.deprow.inherited { background: transparent; border: 1px dashed var(--border); }
.dep-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); width: 72px; flex: none; }
.dep-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.warn { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; font-weight: 500; }
.warn-amber { background: var(--warn-soft); color: var(--warn); } .warn-red { background: var(--bad-soft); color: var(--bad); }
.warn-text { color: var(--warn); font-size: 12.5px; }
.pass-rate { font-size: 12px; font-weight: 700; color: var(--accent); }
.tests { display: flex; flex-direction: column; gap: 10px; }
.test { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; border-left: 4px solid var(--border-strong); }
.tst-PASS { border-left-color: var(--ok); } .tst-FAIL { border-left-color: var(--bad); } .tst-BLOCKED { border-left-color: var(--warn); }
.test-n { font-weight: 700; color: var(--muted); width: 18px; flex: none; padding-top: 2px; }
.test-body { flex: 1; min-width: 0; } .test-body .field { margin-bottom: 8px; }
.test-exec { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; } .test-exec .icon-btn { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg-btn { border: 0; border-right: 1px solid var(--border); background: transparent; padding: 0 10px; height: 29px; font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.seg-btn:last-child { border-right: 0; } .seg-btn:hover:not(:disabled) { background: var(--surface-3); } .seg-btn:disabled { cursor: default; }
.seg-btn.on { background: var(--accent); color: #fff; }
.seg-btn.on.seg-PASS { background: var(--ok); } .seg-btn.on.seg-FAIL { background: var(--bad); } .seg-btn.on.seg-BLOCKED { background: var(--warn); } .seg-btn.on.seg-NOTRUN { background: var(--muted); }
:root[data-theme="dark"] .seg-btn.on { color: #0e131b; }
.seg-sm .seg-btn { height: 25px; padding: 0 8px; }
.att-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.att { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.att:hover { border-color: var(--accent); }
.att img { width: 100%; height: 90px; object-fit: cover; display: block; background: var(--surface-3); }
.att-file { height: 90px; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.att figcaption { padding: 5px 8px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att figcaption span { display: block; color: var(--muted); font-size: 10.5px; }
.lightbox-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 6px; }
.drawer-foot { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.drawer-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; width: 100%; }
.drawer-meta .ic { width: 13px; height: 13px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--surface-2); border-radius: 8px; padding: 9px 11px; } .kpi span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi strong { font-size: 17px; }
.statusbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin-bottom: 14px; }

/* ---------- wishlist */
.wish-intro h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; } .wish-intro h2 .ic { color: var(--warn); width: 20px; height: 20px; }
.wish-intro p { margin: 4px 0 16px; }
.wish-new { padding: 12px; } .wish-new-row { display: flex; gap: 8px; margin-bottom: 8px; } .wish-new-row select { width: auto; } .wish-new-row .input[name=title] { flex: 1; }
.seg-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.seg-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; }
.seg-tab:hover { border-color: var(--border-strong); } .seg-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.seg-tab.on .count { background: rgba(255,255,255,.22); color: #fff; }
.wish-list { display: flex; flex-direction: column; gap: 10px; }
.wish { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow-sm); }
.wish:hover { border-color: var(--border-strong); } .wish.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus); }
.wish-main { flex: 1; min-width: 0; }
.wish-top { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.wish-title { font-size: 15px; margin-bottom: 3px; } .wish-desc { margin: 0 0 8px; color: var(--text-2); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wish-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; } .wish-meta .ic { width: 12px; height: 12px; }
.wish-actions { display: flex; flex-direction: column; gap: 5px; flex: none; } .wish-actions .btn { justify-content: flex-start; }
.wpill { display: inline-flex; height: 22px; align-items: center; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.wp-pending { background: var(--accent-soft); color: var(--accent); } .wp-approved { background: var(--ok-soft); color: var(--ok); }
.wp-deferred { background: var(--warn-soft); color: var(--warn); } .wp-declined { background: var(--bad-soft); color: var(--bad); }
.wish-status-line { display: flex; gap: 8px; align-items: center; margin: -4px 0 12px; }
.review { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.decide-row { display: flex; flex-wrap: wrap; gap: 6px; }
.decision-note { padding: 10px 12px; background: var(--surface-2); border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.comment { display: flex; gap: 10px; } .comment-head { display: flex; align-items: center; gap: 8px; } .comment-head .icon-btn { margin-left: auto; }
.comment-body { margin-top: 2px; white-space: normal; word-wrap: break-word; }
.comment-new { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* ---------- UAT hub */
.metrics { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow-sm); border-top: 3px solid var(--border-strong); }
.metric span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--muted); }
.metric strong { font-size: 24px; font-weight: 700; }
.m-pass { border-top-color: var(--ok); } .m-fail { border-top-color: var(--bad); } .m-blocked { border-top-color: var(--warn); } .m-notrun { border-top-color: var(--muted); }
.metric-ring { flex-direction: row; align-items: center; gap: 12px; border-top-color: var(--accent); } .metric-ring small { display: block; }
.ring { width: 70px; height: 70px; flex: none; } .ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--ok); stroke-width: 8; stroke-linecap: round; } .ring text { font: 700 15px var(--font); fill: var(--text); }
.area-uat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.area-uat-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; font-size: 13px; }
.stackbar { display: flex; width: 40%; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.sb-PASS { background: var(--ok); } .sb-FAIL { background: var(--bad); } .sb-BLOCKED { background: var(--warn); } .sb-NOTRUN { background: var(--border-strong); }
.w-pr { width: 80px; text-align: right; }
.uat-list { display: flex; flex-direction: column; gap: 14px; }
.uat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.uat-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.uat-title { font-weight: 650; font-size: 14.5px; }
.uat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.uat-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 600; }
.uat-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.uat-table tr:last-child td { border-bottom: 0; }
.uat-table td.num { color: var(--muted); font-weight: 700; width: 30px; }
.uat-table td:nth-child(4) { width: 150px; } .uat-table td:nth-child(5) { width: 30%; } .uat-table textarea { width: 100%; }
.uat-table tr.tst-FAIL td:first-child { box-shadow: inset 3px 0 var(--bad); } .uat-table tr.tst-PASS td:first-child { box-shadow: inset 3px 0 var(--ok); } .uat-table tr.tst-BLOCKED td:first-child { box-shadow: inset 3px 0 var(--warn); }

/* ---------- tables, deps, admin */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tr.inactive { opacity: .55; }
.dep-ent { display: inline-flex; align-items: center; gap: 7px; } .dep-ent a { color: var(--text); font-weight: 500; }
.dep-type { font-size: 12px; color: var(--muted); font-style: italic; }
.graph-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 6px; }
.graph { display: block; }
.graph .edge { fill: none; stroke: var(--border-strong); stroke-width: 2; } .graph .edge.relates_to { stroke-dasharray: 5 5; }
.graph .edge.open { stroke: var(--warn); }
.graph .arrowhead { fill: var(--border-strong); } .graph .arrowhead.open { fill: var(--warn); }
.graph .node { cursor: pointer; } .graph .node rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.graph .node:hover rect { stroke: var(--accent); }
.graph .nd-kind { font: 700 9.5px var(--font); letter-spacing: .07em; fill: var(--muted); } .graph .nd-label { font: 600 12.5px var(--font); fill: var(--text); }
.graph .nd-backlog rect { stroke: var(--st-backlog); } .graph .nd-in_progress rect { stroke: var(--st-in_progress); } .graph .nd-internal_uat rect { stroke: var(--st-internal_uat); }
.graph .nd-external_uat rect { stroke: var(--st-external_uat); } .graph .nd-done rect { stroke: var(--st-done); fill: color-mix(in srgb, var(--st-done) 10%, var(--surface)); }
.graph .nd-area rect { stroke: var(--accent); stroke-dasharray: 4 3; } .graph .nd-restricted rect { stroke-dasharray: 2 3; }
.graph .lvl-red rect { stroke: var(--bad); stroke-width: 3; } .graph .lvl-amber rect { stroke: var(--warn); stroke-width: 3; }
.graph-legend { margin-top: 8px; }
.role { font-weight: 600; font-size: 12.5px; } .role-admin { color: var(--brand-2); } :root[data-theme="light"] .role-admin { color: var(--brand); }
.scopes-cell { max-width: 320px; }
.scope-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--surface-3); border-radius: 6px; padding: 2px 8px; margin: 2px 4px 2px 0; }
.scope-chip.lg { font-size: 13px; padding: 4px 4px 4px 10px; }
.scope-add { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; margin-top: 10px; }
.sub-h { font-size: 14px; margin: 8px 0 4px; } .role-help { margin: -4px 0 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 7px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.client-card h3 { font-size: 15px; } .client-card p { margin: 8px 0; }
.reveal { text-align: center; padding: 10px; } .reveal code { font-size: 20px; padding: 8px 14px; }

/* ---------- picker / quick capture */
.pick-list { max-height: 330px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 8px 12px; cursor: pointer; text-align: left; }
.pick:hover { background: var(--surface-2); } .pick.on { background: var(--accent-soft); }
.pick-label { display: flex; align-items: center; gap: 7px; font-weight: 550; } .pick-sub { font-size: 11.5px; color: var(--muted); }
.qc-added { list-style: none; padding: 0; margin: 4px 0 0; max-height: 160px; overflow-y: auto; }
.qc-added li { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; color: var(--ok); } .qc-added li.failed { color: var(--bad); text-decoration: line-through; }
.quick-capture .input-lg { margin-bottom: 14px; }

/* ---------- modal + toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 16, 26, .5); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .14s; }
.modal-wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; } .modal-head h2 { font-size: 17px; }
.modal-body { padding: 8px 18px 14px; overflow-y: auto; } .modal-body p { margin-top: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 11px 14px; border-radius: 9px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .15s; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-success { background: var(--ok); color: #fff; } .toast-error { background: var(--bad); color: #fff; } .toast-warn { background: var(--warn); color: #fff; }
:root[data-theme="dark"] .toast-success, :root[data-theme="dark"] .toast-error, :root[data-theme="dark"] .toast-warn { color: #0e131b; }

/* ---------- markup studio */
.markup { position: fixed; inset: 0; z-index: 200; background: #0b0f16; color: #e6ebf2; display: flex; flex-direction: column; --surface: #151c26; --surface-3: #222c3b; --border: #283344; --border-strong: #37445a; --text: #e6ebf2; --text-2: #b4bfcd; --muted: #8592a5; --accent: #6d9be0; }
.mk-top, .mk-tools, .mk-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #121924; border-bottom: 1px solid #222c3b; flex-wrap: wrap; }
.mk-foot { border-top: 1px solid #222c3b; border-bottom: 0; } .mk-foot .input { width: 280px; }
.mk-title { font-weight: 650; display: flex; align-items: center; gap: 8px; } .mk-src { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.markup .btn { background: #1a2230; border-color: #37445a; color: #e6ebf2; } .markup .btn:hover { background: #222c3b; }
.markup .btn-primary { background: #2a6cb6; border-color: #2a6cb6; }
.markup kbd { background: #1a2230; color: #b4bfcd; border-color: #37445a; }
.mk-colors { display: flex; gap: 5px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #37445a; background: var(--sw); cursor: pointer; }
.swatch.on { outline: 2px solid #fff; outline-offset: 2px; }
.mk-width { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #8592a5; }
.mk-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px; overflow: auto; position: relative;
  background-image: linear-gradient(45deg, #121822 25%, transparent 25%), linear-gradient(-45deg, #121822 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #121822 75%), linear-gradient(-45deg, transparent 75%, #121822 75%);
  background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0; }
.mk-canvas-wrap { position: relative; display: none; line-height: 0; }
.markup.has-image .mk-canvas-wrap { display: block; } .markup.has-image .mk-empty { display: none; }
.mk-canvas-wrap canvas { max-width: calc(100vw - 32px); max-height: calc(100vh - 210px); box-shadow: 0 10px 40px rgba(0,0,0,.6); touch-action: none; display: block; }
.mk-empty { text-align: center; max-width: 420px; color: #b4bfcd; } .mk-empty > .ic { width: 40px; height: 40px; color: #6d9be0; } .mk-empty h3 { margin: 10px 0 6px; color: #fff; }
.mk-text { position: absolute; min-width: 160px; background: rgba(0,0,0,.35); border: 1px dashed #fff; outline: 0; font-weight: 600; font-family: var(--font); line-height: 1.2; padding: 0 2px; resize: none; transform: translateY(-2px); }
.markup .seg { background: #1a2230; border-color: #37445a; } .markup .seg-btn { color: #b4bfcd; border-color: #283344; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(3, 1fr); } .metric-ring { grid-column: span 3; }
  body.drawer-open .shell { grid-template-columns: 240px minmax(0, 1fr) 0; }
  body.drawer-open .drawer { position: fixed; right: 0; top: 58px; bottom: 0; width: min(480px, 100vw); z-index: 40; box-shadow: var(--shadow-lg); }
  .shell { grid-template-columns: 240px minmax(0, 1fr) 0; }
}
@media (max-width: 760px) {
  .only-sm, .only-mobile { display: inline-flex !important; } .hide-sm { display: none !important; }
  .topbar { gap: 8px; padding: 0 10px; } .crumbs { display: none; } .search { width: 140px; }
  .brand-app { display: none; }
  .shell, body.drawer-open .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 58px; bottom: 0; left: 0; width: 280px; z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .view { padding: 14px 16px 60px; } .tabs { padding: 0 8px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .tstatus { width: 92px; } .teffort, .area-stats .progress { display: none; }
  .tbadges .badge:not(.blk-red):not(.blk-amber) { display: none; }
  .trow { padding-left: calc(6px + var(--depth) * 16px); }
  .kanban { grid-template-columns: repeat(5, 82vw); }
  .wish { flex-direction: column; } .wish-actions { flex-direction: row; } .wish-new-row { flex-wrap: wrap; }
  .scope-add { grid-template-columns: 1fr; } .metrics { grid-template-columns: 1fr 1fr; } .metric-ring { grid-column: span 2; }
  .uat-table thead { display: none; } .uat-table tr { display: grid; grid-template-columns: 30px 1fr; } .uat-table td { border: 0; } .uat-table td:nth-child(n+3) { grid-column: 2; }
  .uat-table td:nth-child(4), .uat-table td:nth-child(5) { width: auto; }
}
@media print { .topbar, .sidebar, .tabs, .drawer { display: none; } }

/* ---------- today */
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.today-head h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; } .today-head h2 .ic { color: var(--warn); width: 22px; height: 22px; }
.today-kpis { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 8px; }
.today-client { margin-top: 18px; }
.today-client-h { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 8px; }
.today-project { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.today-project-h { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-weight: 600; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.today-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); transition: opacity .25s; }
.today-row:last-child { border-bottom: 0; } .today-row.completing { opacity: .35; }
.today-main { cursor: pointer; } .today-main:hover .today-title { color: var(--accent); }
.today-title { font-weight: 550; }
.today-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; flex: none; padding: 0; }
.today-check .ic { width: 14px; height: 14px; } .today-check:hover { border-color: var(--ok); color: var(--ok); }
.today-check.on { background: var(--ok); border-color: var(--ok); color: #fff; cursor: default; }
.carried { font-size: 10.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 1px 6px; margin-left: 8px; }
.today-done { margin-top: 20px; } .today-done h3 { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ok); margin-bottom: 6px; }
.today-row.done { background: transparent; } .today-row.done .grow { color: var(--muted); text-decoration: line-through; cursor: pointer; }
.today-suggest { margin-top: 22px; }
.suggest-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); } .suggest-row:last-child { border-bottom: 0; }
.suggest-row .grow { cursor: pointer; }
.today-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; flex: none; }
.trow:hover .today-btn, .today-btn.on { opacity: 1; } .today-btn:hover { background: var(--surface-3); color: var(--warn); }
.today-btn.on { color: var(--warn); } .today-btn .ic { width: 15px; height: 15px; }
.focus-btn { opacity: 0; } .trow:hover .focus-btn, .trow.selected .focus-btn { opacity: 1; }
.btn-on { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.tab-badge.tb-neutral { background: var(--surface-3); color: var(--text-2); }

/* ---------- focus, drag & structure */
.focus-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.new-area-zone { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); font-size: 13px; transition: .15s; }
.new-area-zone .link-btn { color: var(--accent); }
body.is-dragging .new-area-zone { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
.new-area-zone.drop-inside { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
body.is-dragging .nav-row[data-drop-nav] { outline: 1px dashed var(--border-strong); outline-offset: -1px; }
.nav-row.drop-inside { background: var(--accent-soft); color: var(--accent); outline: 2px solid var(--accent) !important; }
.drawer-quick { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.mv-new { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.mv-new select { flex: 1; min-width: 160px; }

/* ---------- discuss / agenda */
.badge.discuss { background: color-mix(in srgb, var(--brand-2) 18%, transparent); color: var(--accent); }
.discuss-box { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.discuss-box.on { background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); border-color: color-mix(in srgb, var(--brand-2) 45%, transparent); }
.discuss-box textarea { margin-top: 6px; }
.agenda-head { margin-bottom: 8px; } .agenda-head h3 { font-size: 16px; }
.agenda-project h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.agenda-item { padding: 10px 0; border-bottom: 1px solid var(--border); } .agenda-item:last-child { border-bottom: 0; }
.agenda-title { font-weight: 600; } .agenda-path { margin: 2px 0 6px 18px; } .agenda-note { width: 100%; }
.agenda-wishes { margin-top: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.agenda-wish { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; } .agenda-wish .ic { color: var(--warn); width: 14px; height: 14px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* ---------- grants */
.grant-add { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr auto; gap: 6px; margin-top: 10px; }
.grant-list { margin-top: 12px; }
.wrap { flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
.scope-chip.role-workspace_admin, .scope-chip.role-project_admin { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--accent); font-weight: 600; }
.scope-chip.role-stakeholder { background: var(--warn-soft); color: var(--warn); }
.scope-chip.role-tester { background: color-mix(in srgb, var(--st-external_uat) 14%, transparent); }
@media (max-width: 760px) {
  .grant-add { grid-template-columns: 1fr; } .today-kpis { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .today-row .teffort, .today-row .tbadges { display: none; }
  .today-btn, .focus-btn { opacity: 1; }
}

/* ---------- work area reordering */
.area-head[draggable="true"] { cursor: grab; }
.area-grip { opacity: .45; } .area-head:hover .area-grip { opacity: .9; }
.area.dragging { opacity: .45; }
section.area.drop-area-before { box-shadow: 0 -3px 0 var(--accent), var(--shadow-sm); }
section.area.drop-area-after { box-shadow: 0 3px 0 var(--accent), var(--shadow-sm); }
.nav-row.drop-area-before { box-shadow: inset 0 2px 0 var(--accent); }
.nav-row.drop-area-after { box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- forgot / reset password */
.login-forgot { display: block; margin: 14px auto 0; color: var(--accent); font-size: 13.5px; }
.login-help { margin: 16px 0 0; text-align: center; }
.login-card .sm { line-height: 1.55; }

/* ---------- sidebar: collapse, counts, reorder, hide */
.nav-caret { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: -4px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 4px; padding: 0; flex: none; }
.nav-caret:hover { background: var(--border); color: var(--text); }
.nav-caret .ic { width: 13px; height: 13px; transition: transform .15s; } .nav-caret.open .ic { transform: rotate(90deg); }
.nav-caret-sp { width: 14px; flex: none; }
.nav-row .nav-count { min-width: 22px; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-row.active .nav-count { color: var(--accent); }
.nav-hide { display: none; place-items: center; width: 22px; height: 22px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 5px; padding: 0; flex: none; margin-right: -4px; }
.nav-hide .ic { width: 14px; height: 14px; } .nav-hide:hover { background: var(--border); color: var(--text); }
.nav-row:hover .nav-hide, .nav-row.is-hidden .nav-hide { display: inline-grid; }
.nav-row:hover .nav-count { display: none; }
.nav-row.is-hidden { opacity: .5; font-style: italic; } .nav-row.is-hidden .nav-hide { color: var(--accent); }
.nav-row[draggable="true"] { cursor: grab; }
.nav-row.dragging { opacity: .4; }
.nav-hidden-bar { display: flex; align-items: center; gap: 8px; margin: 14px 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 12.5px; color: var(--muted); }
.nav-hidden-bar > span { display: inline-flex; align-items: center; gap: 5px; flex: 1; } .nav-hidden-bar .ic { width: 14px; height: 14px; }
.nav-hidden-bar .link-btn { color: var(--accent); font-size: 12.5px; }
@media (max-width: 760px) { .nav-hide { display: inline-grid; } .nav-row:hover .nav-count { display: inline; } }
/* sidebar density: room for carets, counts and hide buttons */
.shell { grid-template-columns: 284px minmax(0, 1fr) 0; }
body.drawer-open .shell { grid-template-columns: 284px minmax(0, 1fr) min(480px, 42vw); }
.nav-row { gap: 6px; padding-left: calc(8px + var(--d) * 14px); }
.nav-row .ic { width: 14px; height: 14px; }
.nav-hidden-bar { flex-wrap: nowrap; white-space: nowrap; }
.nav-hidden-bar .btn { padding: 0 8px; }
@media (max-width: 1100px) { .shell, body.drawer-open .shell { grid-template-columns: 260px minmax(0, 1fr) 0; } }
@media (max-width: 760px) { .shell, body.drawer-open .shell { grid-template-columns: minmax(0, 1fr); } }

/* ---------- quick capture attachments */
.qc-attach { margin-bottom: 10px; }
.qc-attach-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qc-pending { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qc-pending:empty { display: none; }
.qc-chip { display: flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 4px 4px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.qc-chip img { width: 44px; height: 32px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); flex: none; }
.qc-file-ic { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 32px; border-radius: 4px; background: var(--surface-3); color: var(--muted); flex: none; }
.qc-file-ic .ic { width: 12px; height: 12px; } .qc-file-ic b { font-size: 9px; letter-spacing: .04em; }
.qc-chip-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.qc-save-row { display: flex; justify-content: flex-end; margin: 4px 0 6px; }
.qc-clip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); } .qc-clip .ic { width: 12px; height: 12px; }
.qc-added li.partial { color: var(--warn); }
.modal.qc-drop { box-shadow: 0 0 0 3px var(--accent), var(--shadow-lg); }

/* ---------- work area owner */
.area-owner { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); background: var(--surface-3); border-radius: 99px; padding: 1px 8px 1px 2px; }
.field-help { display: block; margin-top: 4px; line-height: 1.4; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- markup studio: crop */
.mk-crop-bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 10px; background: #121924; border: 1px solid #37445a; box-shadow: 0 8px 24px rgba(0,0,0,.5); color: #e6ebf2; font-size: 13px; white-space: nowrap; }
.mk-crop-bar > span { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; } .mk-crop-bar b { font-variant-numeric: tabular-nums; }

/* ---------- teams */
.badge.team-badge { background: color-mix(in srgb, var(--brand-2) 16%, transparent); color: var(--accent); max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.team-members { display: flex; flex-wrap: wrap; gap: 2px; margin: 8px 0 4px; }
.team-members .scope-chip { gap: 5px; padding-left: 2px; }
.member-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }

/* ---------- external drops (emails / files) */
section.area.drop-external { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
section.area.drop-external .area-head { background: var(--accent-soft); }
.drop-diag { white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; font: 12px/1.45 ui-monospace, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.discuss-notes { margin: 8px 0 4px; }
.desc-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -6px 0 12px; font-size: 13px; }
.desc-links a { display: inline-flex; align-items: center; gap: 5px; } .desc-links .ic { width: 14px; height: 14px; }
.agenda-scope { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.agenda-level { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 5px; padding: 2px 7px; }

/* ---------- tester feedback */
.fb-open { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 1px 8px; }
.fb-list { display: flex; flex-direction: column; gap: 8px; }
.fb { border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 9px; padding: 9px 11px; background: var(--surface); }
.fb.fb-issue { border-left-color: var(--bad); } .fb.fb-idea { border-left-color: var(--warn); } .fb.fb-test { border-left-color: var(--accent); }
.fb:not(.fbs-open) { opacity: .75; }
.fb-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-right: 4px; } .fb-kind .ic { width: 13px; height: 13px; }
.fb-status { font-size: 11.5px; color: var(--muted); }
.fbs-open .fb-status { color: var(--warn); font-weight: 600; }
.fb-body { margin: 6px 0 2px; white-space: normal; word-wrap: break-word; }
.fb-step { margin: 6px 0; padding: 6px 9px; background: var(--surface-2); border-radius: 6px; font-size: 13px; }
.fb-shots { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.fb-shots img { width: 96px; height: 64px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); cursor: zoom-in; background: var(--surface-3); }
.fb-review { margin-top: 6px; font-size: 12.5px; color: var(--text-2); display: flex; gap: 5px; align-items: baseline; } .fb-review .ic { width: 12px; height: 12px; }
.fb-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.fb-actions:empty { display: none; }
.fb-kinds { flex-wrap: wrap; margin-bottom: 12px; } .fb-kinds .seg-btn { height: 32px; }
.badge.fb-badge { background: var(--warn-soft); color: var(--warn); }
.uat-fb { padding: 10px 14px 12px; border-top: 1px solid var(--border); }
.uat-fb .dsec-head { margin-bottom: 8px; } .uat-fb .dsec-head h3 { font-size: 13px; }
.uat-nosteps { padding: 10px 14px; margin: 0; }
button.metric { text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.metric:hover { border-color: var(--accent); }
.m-fb { border-top-color: var(--warn); }
.metrics { grid-template-columns: 1.4fr repeat(6, 1fr); }
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(3, 1fr); } }
.mail-ok { color: var(--ok); font-weight: 600; }
.mail-bad { color: var(--bad); font-weight: 600; }
