/* =====================================================================
   TASKIFY — design system
   Warm neutrals + a single confident orange. Inter for UI, Plex Mono for figures.
   ===================================================================== */
:root {
  --brand: #FF6600; --brand-600: #E85A00; --brand-700: #C24A00;
  --brand-50: #FFF5EE; --brand-100: #FFE8D6; --brand-200: #FFD2B0;
  --bg: #F6F4F1; --surface: #FFFFFF; --surface-2: #FBFAF8; --sunken: #F1EEEA;
  --line: #ECE7E1; --line-2: #E0D9D1; --line-3: #CFC6BC;
  --text: #1C1917; --text-2: #4A4541; --muted: #857C74; --faint: #B3AAA2;
  --red: #DC2626; --red-50: #FEF2F2; --green: #15803D; --green-50: #EEF8F1;
  --r-sm: 6px; --r: 9px; --r-lg: 14px;
  --sh-1: 0 1px 2px rgba(28, 25, 23, .05);
  --sh-2: 0 1px 2px rgba(28, 25, 23, .04), 0 4px 14px rgba(28, 25, 23, .06);
  --sh-3: 0 12px 40px rgba(28, 25, 23, .16), 0 2px 6px rgba(28, 25, 23, .06);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --side: 252px;
  /* tones */
  --t-slate: #64748B; --t-slate-bg: #F1F3F6;
  --t-blue: #1D63D8; --t-blue-bg: #EBF2FE;
  --t-amber: #B45309; --t-amber-bg: #FEF5E6;
  --t-violet: #7034D6; --t-violet-bg: #F3EEFE;
  --t-teal: #0F766E; --t-teal-bg: #E7F6F4;
  --t-green: #15803D; --t-green-bg: #EAF7EE;
  --t-red: #C81E1E; --t-red-bg: #FDEDED;
  --t-orange: #D45200; --t-orange-bg: #FFF1E6;
  --t-muted: #8A817A; --t-muted-bg: #F3F1EE;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.015em; }
.ic { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .01em; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.muted-p { color: var(--text-2); margin: 0; line-height: 1.6; }
::selection { background: var(--brand-200); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #DDD5CC; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #CBC1B6; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px 12px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #FF7A1A, #FF5500 60%, #E84A00); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 12px rgba(255, 102, 0, .35), inset 0 1px 0 rgba(255,255,255,.25); }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.03em; }
.brand-firm { font-size: 11px; color: var(--muted); margin-top: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.side .btn-new { width: 100%; justify-content: center; margin-bottom: 14px; }
.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none; position: relative; transition: background .12s, color .12s; }
.nav a .ic { color: var(--muted); transition: color .12s; }
.nav a:hover { background: var(--sunken); color: var(--text); }
.nav a.on { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.nav a.on .ic { color: var(--brand); }
.nav a.on::before { content: ''; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; display: grid; place-items: center; background: var(--sunken); color: var(--text-2); font-variant-numeric: tabular-nums; }
.nav .count.hot { background: var(--brand); color: #fff; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--line); background: var(--surface-2); width: 100%; text-align: left; }
.me-card:hover { border-color: var(--line-2); background: var(--sunken); }
.me-card .meta { min-width: 0; flex: 1; }
.me-card .nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .rl { font-size: 11.5px; color: var(--muted); }
.demo-flag { margin: 8px 2px 0; padding: 8px 10px; border-radius: 8px; background: repeating-linear-gradient(-45deg, var(--brand-50), var(--brand-50) 8px, #FFF0E4 8px, #FFF0E4 16px); border: 1px dashed var(--brand-200); font-size: 11.5px; color: var(--brand-700); line-height: 1.4; }
.demo-flag b { display: block; font-size: 12px; }
.demo-flag button { color: var(--brand-700); text-decoration: underline; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(246, 244, 241, .82); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { font-size: 21px; font-weight: 750; letter-spacing: -0.025em; }
.top .crumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.top .crumb a { color: var(--muted); }
.top .spacer { flex: 1; }
.searchbox { display: flex; align-items: center; gap: 8px; width: 300px; height: 36px; padding: 0 10px 0 12px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); box-shadow: var(--sh-1); }
.searchbox:hover { border-color: var(--line-3); }
.searchbox span { flex: 1; text-align: left; }
kbd { font: 600 10.5px var(--font); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.page { padding: 6px 28px 48px; flex: 1; animation: fade .22s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; white-space: nowrap; border: 1px solid transparent; transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; position: relative; user-select: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(200, 70, 0, .3), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { background: var(--brand-600); }
.btn-dark { background: var(--text); color: #fff; } .btn-dark:hover { background: #33302D; }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--sunken); color: var(--text); }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--text-2); box-shadow: var(--sh-1); }
.btn-outline:hover { border-color: var(--line-3); color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; } .btn-danger:hover { background: #B91C1C; }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 1px 2px rgba(21,128,61,.3); } .btn-success:hover { background: #116A33; }
.btn-soft { background: var(--brand-50); color: var(--brand-700); } .btn-soft:hover { background: var(--brand-100); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.is-busy { color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-outline.is-busy::after, .btn-ghost.is-busy::after, .btn-soft.is-busy::after { border-color: var(--line-2); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 32px; height: 32px; display: inline-grid; vertical-align: middle; place-items: center; border-radius: 8px; color: var(--muted); transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--sunken); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 6px; }
.btn-group { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); gap: 2px; }
.btn-group button { height: 28px; padding: 0 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.btn-group button:hover { color: var(--text); }
.btn-group button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* ---------- Forms ---------- */
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.fld > span em { color: var(--brand); font-style: normal; margin-left: 2px; }
.fld small { font-size: 11.5px; color: var(--muted); }
.inp, .fld input:not([type=checkbox]):not([type=radio]), .fld select, .fld textarea, .combo {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .12s, box-shadow .12s; outline: none; }
.fld textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; line-height: 1.5; }
.inp:hover, .fld input:hover, .fld select:hover, .fld textarea:hover, .combo:hover { border-color: var(--line-3); }
.inp:focus, .fld input:focus, .fld select:focus, .fld textarea:focus, .combo.open, .combo:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 102, 0, .14); outline: none; }
.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important; }
input[type=date] { font-variant-numeric: tabular-nums; }
.combo { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.combo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo .ph { color: var(--faint); }
.combo .ic { color: var(--muted); }
.combo.sm { height: 32px; font-size: 13px; padding: 0 10px; }
.combo-pop { position: fixed; z-index: 1000; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--sh-3); max-width: 380px; overflow: hidden; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.combo-search { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.combo-search input { border: 0; outline: 0; flex: 1; background: transparent; height: 26px; color: var(--text); }
.combo-list { max-height: 280px; overflow-y: auto; padding: 4px; }
.combo-opt { padding: 7px 10px; border-radius: 7px; cursor: pointer; display: flex; flex-direction: column; }
.combo-opt small { color: var(--muted); font-size: 11.5px; }
.combo-opt.hi { background: var(--sunken); }
.combo-opt.sel { color: var(--brand-700); font-weight: 600; }
.combo-opt.none { color: var(--muted); }
.combo-empty { padding: 14px; color: var(--muted); text-align: center; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.form-sec { margin-top: 22px; }
.form-sec:first-child { margin-top: 0; }
.form-sec > h4 { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.form-sec > h4::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-3); display: grid; place-items: center; background: var(--surface); transition: all .12s; flex: none; }
.check .box .ic { opacity: 0; color: #fff; transform: scale(.6); transition: all .12s; }
.check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .box .ic { opacity: 1; transform: none; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(255,102,0,.2); }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-pick { position: relative; }
.chip-pick input { position: absolute; opacity: 0; }
.chip-pick span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all .12s; background: var(--surface); }
.chip-pick span:hover { border-color: var(--line-3); }
.chip-pick input:checked + span { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); font-weight: 600; }
.svc-group { margin-bottom: 12px; }
.svc-group > b { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

/* ---------- Cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.card-head h3 { font-size: 14.5px; font-weight: 650; white-space: nowrap; }
.card-head .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 0 18px 18px; }
.card-body.flush { padding: 0 8px 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

/* ---------- Pills, badges, chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-slate { color: var(--t-slate); background: var(--t-slate-bg); } .pill-blue { color: var(--t-blue); background: var(--t-blue-bg); }
.pill-amber { color: var(--t-amber); background: var(--t-amber-bg); } .pill-violet { color: var(--t-violet); background: var(--t-violet-bg); }
.pill-teal { color: var(--t-teal); background: var(--t-teal-bg); } .pill-green { color: var(--t-green); background: var(--t-green-bg); }
.pill-red { color: var(--t-red); background: var(--t-red-bg); } .pill-orange { color: var(--t-orange); background: var(--t-orange-bg); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
.badge-orange { color: var(--t-orange); background: var(--t-orange-bg); } .badge-teal { color: var(--t-teal); background: var(--t-teal-bg); }
.badge-violet { color: var(--t-violet); background: var(--t-violet-bg); } .badge-blue { color: var(--t-blue); background: var(--t-blue-bg); }
.badge-slate { color: var(--t-slate); background: var(--t-slate-bg); } .badge-green { color: var(--t-green); background: var(--t-green-bg); }
.badge-red { color: var(--t-red); background: var(--t-red-bg); } .badge-amber { color: var(--t-amber); background: var(--t-amber-bg); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--sunken); white-space: nowrap; }
.prio { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.prio-red { color: var(--t-red); } .prio-orange { color: var(--t-orange); } .prio-muted { color: var(--faint); } .prio-slate { color: var(--t-slate); }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due .ic { color: var(--faint); }
.due-overdue { color: var(--t-red); font-weight: 650; } .due-overdue .ic { color: var(--t-red); }
.due-today { color: var(--t-orange); font-weight: 650; } .due-today .ic { color: var(--t-orange); }
.due-soon { color: var(--text); } .due-done, .due-none { color: var(--faint); }
.bill { font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.bill-unbilled { color: var(--t-amber); background: var(--t-amber-bg); } .bill-billed { color: var(--t-green); background: var(--t-green-bg); }
.prog { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.prog-bar { width: 42px; height: 5px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.prog-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }

/* ---------- Avatars ---------- */
.av { --s: 26px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: calc(var(--s) * .38); font-weight: 700; letter-spacing: .02em; color: hsl(var(--h) 55% 32%); background: hsl(var(--h) 80% 92%); box-shadow: inset 0 0 0 1px hsl(var(--h) 50% 84%); }
.av-empty { color: var(--faint); background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line-2); }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.who > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who.none { color: var(--faint); }

/* ---------- Dashboard ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 0 20px; }
.hero h2 { font-size: 26px; font-weight: 750; letter-spacing: -0.03em; }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.hero p b { color: var(--text-2); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { position: relative; padding: 14px 16px 15px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: left; box-shadow: var(--sh-1); transition: transform .12s, box-shadow .12s, border-color .12s; overflow: hidden; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi .k-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--sunken); color: var(--muted); }
.kpi .k-num { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.k-red .k-num { color: var(--t-red); } .kpi.k-red .k-ic { background: var(--t-red-bg); color: var(--t-red); }
.kpi.k-orange .k-num { color: var(--brand-600); } .kpi.k-orange .k-ic { background: var(--brand-50); color: var(--brand); }
.kpi.k-teal .k-ic { background: var(--t-teal-bg); color: var(--t-teal); }
.kpi.k-violet .k-ic { background: var(--t-violet-bg); color: var(--t-violet); }
.kpi.k-blue .k-ic { background: var(--t-blue-bg); color: var(--t-blue); }
.kpi.k-amber .k-ic { background: var(--t-amber-bg); color: var(--t-amber); }
.kpi.k-feature { background: linear-gradient(150deg, #FF7A1A 0%, #FF6600 45%, #EF5A00 100%); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(255, 102, 0, .28); }
.kpi.k-feature .k-top, .kpi.k-feature .k-sub { color: rgba(255,255,255,.85); }
.kpi.k-feature .k-ic { background: rgba(255,255,255,.18); color: #fff; }
.kpi.k-feature::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.08); }
.tline { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 9px; text-align: left; transition: background .1s; }
.tline:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.tline-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tline-title { font-weight: 550; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tline-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tline-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.list-sep { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 12px 10px 4px; display: flex; align-items: center; gap: 8px; }
.list-sep.red { color: var(--t-red); }
.list-sep .n { color: var(--muted); }
.load { display: flex; flex-direction: column; gap: 12px; }
.load-row { display: grid; grid-template-columns: 160px 1fr 112px; align-items: center; gap: 12px; padding: 2px 0; text-align: left; border-radius: 8px; }
.load-row:hover .load-bar { box-shadow: 0 0 0 3px var(--sunken); }
.load-bar { height: 10px; border-radius: 6px; background: var(--sunken); overflow: hidden; display: flex; transition: box-shadow .12s; }
.load-bar i { display: block; height: 100%; }
.load-bar .b-over { background: #EF4444; } .load-bar .b-open { background: #FF8A3D; } .load-bar .b-rev { background: #A78BFA; }
.load-n { white-space: nowrap; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.load-n b { color: var(--text); }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.cat-bars { display: flex; flex-direction: column; gap: 10px; }
.cat-row { display: grid; grid-template-columns: 96px 1fr 30px; align-items: center; gap: 10px; font-size: 12.5px; }
.cat-row .bar { height: 8px; border-radius: 5px; background: var(--sunken); overflow: hidden; }
.cat-row .bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #FFB37A, #FF6600); }
.cat-row b { text-align: right; font-variant-numeric: tabular-nums; }
.cal { display: flex; flex-direction: column; }
.cal-day { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 8px 4px; border-top: 1px solid var(--line); }
.cal-day:first-child { border-top: 0; }
.cal-date { text-align: center; line-height: 1.1; padding-top: 2px; }
.cal-date b { display: block; font-size: 20px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cal-date small { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.cal-date.today b { color: var(--brand); }
.cal-items { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; padding-top: 3px; }
.cal-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 550; }
.cal-chip:hover { border-color: var(--brand-200); background: var(--brand-50); }
.cal-chip .n { color: var(--brand-700); font-weight: 700; }
.dsc-mini { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; width: 100%; text-align: left; }
.dsc-mini:hover { background: var(--surface-2); }
.dsc-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.dsc-ic.red { background: var(--t-red-bg); color: var(--t-red); }
.dsc-mini .m { flex: 1; min-width: 0; }
.dsc-mini .m b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsc-mini .m span { font-size: 12px; color: var(--muted); }

/* ---------- Toolbars & tables ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.tsearch { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); min-width: 220px; flex: 0 1 280px; color: var(--muted); box-shadow: var(--sh-1); }
.tsearch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,102,0,.12); }
.tsearch input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--text); height: 100%; }
.fchip { position: relative; }
.fchip > select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fchip > span { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-weight: 550; font-size: 13px; white-space: nowrap; box-shadow: var(--sh-1); }
.fchip > span .ic { color: var(--muted); }
.fchip.on > span { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-700); }
.fchip.on > span .ic { color: var(--brand); }
.qtabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.qtab { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.qtab:hover { color: var(--text); background: var(--sunken); }
.qtab.on { color: var(--text); background: var(--surface); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.qtab .n { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--sunken); padding: 1px 7px; border-radius: 9px; font-variant-numeric: tabular-nums; }
.qtab.on .n { background: var(--brand-50); color: var(--brand-700); }
.qtab.red .n { background: var(--t-red-bg); color: var(--t-red); }
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .08s; }
.tbl tbody tr:hover { background: #FDFBF9; }
.tbl tbody tr.sel { background: var(--brand-50); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl .w-check { width: 40px; padding-right: 0; }
.tbl .t-title { font-weight: 600; color: var(--text); max-width: 420px; }
.tbl .t-title .s { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl .t-title .t { display: flex; align-items: center; gap: 8px; }
.tbl .t-title .t > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .grp td { background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text-2); padding: 8px 12px; }
.tbl .grp td .n { color: var(--muted); font-weight: 600; margin-left: 6px; }
.tbl-foot { padding: 10px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface-2); display: flex; justify-content: space-between; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-status { appearance: none; border: 0; background: transparent; cursor: pointer; padding: 0; }
.bulkbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(calc(100% + 40px)); visibility: hidden; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; background: #1C1917; color: #fff; box-shadow: var(--sh-3); z-index: 60; transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.bulkbar.in { transform: translateX(-50%) translateY(0); visibility: visible; }
.bulkbar .n { font-weight: 700; margin-right: 6px; font-size: 13px; white-space: nowrap; }
.bulkbar .btn-ghost { color: #E7E2DD; } .bulkbar .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.bulkbar .sep { width: 1px; height: 20px; background: rgba(255,255,255,.15); }

/* ---------- Board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--sunken); border-radius: 12px; padding: 8px; min-height: 160px; transition: background .12s, box-shadow .12s; }
.col.drop { background: var(--brand-50); box-shadow: inset 0 0 0 2px var(--brand-200); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 650; font-size: 13px; }
.col-head .n { color: var(--muted); font-weight: 600; font-size: 12px; }
.col-cards { display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--surface); border-radius: 10px; padding: 11px 12px; border: 1px solid var(--line); box-shadow: var(--sh-1); cursor: grab; transition: box-shadow .12s, transform .12s; text-align: left; width: 100%; }
.kcard:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.kcard.dragging { opacity: .5; transform: rotate(1.5deg); }
.kcard .kt { font-weight: 600; font-size: 13px; line-height: 1.35; }
.kcard .kc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kcard .kf { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.kcard .kf .grow { flex: 1; }

/* ---------- Drawer ---------- */
.drawer-root { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(28, 25, 23, .28); opacity: 0; transition: opacity .2s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); box-shadow: var(--sh-3); transform: translateX(104%); transition: transform .26s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.drawer.wide { width: min(760px, 100vw); }
.drawer-root.in { pointer-events: auto; }
.drawer-root.in .drawer-scrim { opacity: 1; }
.drawer-root.in .drawer { transform: none; }
.dr-head { padding: 16px 20px 14px; border-bottom: 1px solid var(--line); }
.dr-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 12.5px; }
.dr-top .grow { flex: 1; }
.dr-title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; outline: none; border-radius: 6px; padding: 2px 4px; margin: 0 -4px; }
.dr-title[contenteditable=true]:hover { background: var(--sunken); }
.dr-title[contenteditable=true]:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--brand-200); }
.dr-client { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--text-2); font-weight: 550; font-size: 13px; }
.dr-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); align-items: center; }
.dr-actions .hint { font-size: 12px; color: var(--muted); margin-right: auto; display: flex; align-items: center; gap: 6px; }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.props { display: grid; grid-template-columns: 116px 1fr; gap: 4px 12px; align-items: center; margin-bottom: 22px; }
.props > dt { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 7px; height: 34px; }
.props > dt .ic { color: var(--faint); }
.props > dd { margin: 0; min-width: 0; }
.props .combo, .props input, .props select { height: 34px; border-color: transparent; background: transparent; box-shadow: none; padding: 0 8px; margin-left: -8px; width: calc(100% + 8px); }
.props .combo:hover, .props input:hover { background: var(--sunken); border-color: transparent; }
.props input:focus, .props .combo.open { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,102,0,.12); }
.props .static { padding: 0; height: 34px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin: 6px 0 10px; }
.sec-title .n { color: var(--muted); font-weight: 600; }
.sec-title .grow { flex: 1; }
.desc { width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; margin: 0 -10px 18px; min-height: 44px; resize: vertical; background: transparent; line-height: 1.55; color: var(--text-2); outline: none; }
.desc:hover { background: var(--sunken); }
.desc:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,102,0,.12); }
.subs { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; margin-bottom: 22px; }
.subrow { display: grid; grid-template-columns: 26px 1fr auto auto 28px; gap: 10px; align-items: center; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.subrow:last-child { border-bottom: 0; }
.subrow:hover { background: var(--surface-2); }
.subrow .st { font-size: 13px; }
.subrow.done .st { color: var(--faint); text-decoration: line-through; }
.subrow input[type=date] { height: 28px; border: 1px solid transparent; background: transparent; border-radius: 6px; font-size: 12px; padding: 0 4px; width: 128px; color: var(--text-2); }
.subrow input[type=date]:hover { background: var(--sunken); }
.subrow .del { opacity: 0; }
.subrow:hover .del { opacity: 1; }
.sub-add { display: flex; gap: 8px; padding: 8px 10px; background: var(--surface-2); }
.sub-add input { flex: 1; height: 32px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 10px; background: var(--surface); outline: none; }
.sub-add input:focus { border-color: var(--brand); }
.tick { width: 20px; height: 20px; border-radius: 6px; border: 1.6px solid var(--line-3); display: grid; place-items: center; color: transparent; transition: all .12s; background: var(--surface); }
.tick:hover { border-color: var(--green); }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.feed { display: flex; flex-direction: column; gap: 2px; }
.ev { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 7px 0; }
.ev .dot { width: 28px; display: grid; place-items: center; }
.ev .dot span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-3); }
.ev .txt { font-size: 12.5px; color: var(--muted); padding-top: 4px; }
.ev .txt b { color: var(--text-2); font-weight: 600; }
.ev.comment .bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 9px 12px; margin-top: 4px; color: var(--text); font-size: 13px; white-space: pre-wrap; line-height: 1.5; }
.composer { display: flex; gap: 10px; margin-top: 10px; align-items: flex-start; }
.composer textarea { flex: 1; min-height: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); padding: 9px 12px; resize: none; outline: none; transition: height .15s; }
.composer textarea:focus { height: 78px; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,102,0,.12); }
.flow { display: flex; align-items: center; gap: 0; margin: 2px 0 18px; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.flow-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; position: relative; font-size: 11px; font-weight: 600; color: var(--faint); text-align: center; }
.flow-step .o { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-3); background: var(--surface); display: grid; place-items: center; z-index: 1; }
.flow-step.done .o { background: var(--green); border-color: var(--green); color: #fff; }
.flow-step.now .o { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.flow-step.now { color: var(--brand-700); } .flow-step.done { color: var(--text-2); }
.flow-step:not(:last-child)::after { content: ''; position: absolute; top: 10px; left: calc(50% + 14px); right: calc(-50% + 14px); height: 2px; background: var(--line-2); }
.flow-step.done:not(:last-child)::after { background: var(--green); }

/* ---------- Client page ---------- */
.client-head { display: flex; gap: 18px; align-items: flex-start; padding: 22px; }
.client-logo { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; flex: none; color: hsl(var(--h) 60% 30%); background: hsl(var(--h) 85% 92%); }
.client-head h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.025em; }
.client-head .sub { color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 22px; padding: 0 22px 22px; }
.kv div span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.kv div b { font-weight: 550; font-size: 13.5px; word-break: break-word; }
.timeline { position: relative; padding-left: 4px; }
.tl-year { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 14px 0 6px; }
.tl-item { display: grid; grid-template-columns: 92px 18px 1fr auto; gap: 10px; align-items: center; padding: 7px 6px; border-radius: 8px; width: 100%; text-align: left; }
.tl-item:hover { background: var(--surface-2); }
.tl-item .d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-item .o { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--t-green-bg); justify-self: center; }
.tl-item .t { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-item .t small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.contact { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.contact:first-child { border-top: 0; }
.contact .m { flex: 1; min-width: 0; }
.contact .m b { display: block; font-size: 13px; }
.contact .m span { font-size: 12px; color: var(--muted); }
.svc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.client-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ccard { padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .12s, transform .12s, border-color .12s; }
.ccard:hover { box-shadow: var(--sh-2); transform: translateY(-1px); border-color: var(--line-2); }
.ccard .top-row { display: flex; gap: 12px; align-items: center; }
.ccard .client-logo { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; }
.ccard h4 { font-size: 14px; font-weight: 650; line-height: 1.3; }
.ccard .meta { font-size: 12px; color: var(--muted); }
.ccard .stats { display: flex; gap: 16px; font-size: 12px; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line); }
.ccard .stats b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ccard .stats .red b { color: var(--t-red); }

/* ---------- DSC ---------- */
.dsc-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.custody { min-width: 150px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; }
.custody .d { width: 8px; height: 8px; border-radius: 50%; }
.custody.office .d { background: var(--green); } .custody.client .d { background: var(--t-slate); } .custody.staff .d { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.custody small { color: var(--muted); font-weight: 400; display: block; font-size: 11.5px; }

/* ---------- Templates & settings ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.tpl { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; text-align: left; transition: box-shadow .12s, border-color .12s; }
.tpl:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.tpl h4 { font-size: 14px; font-weight: 650; }
.tpl p { margin: 0; font-size: 12.5px; color: var(--muted); }
.tpl ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.tpl li { font-size: 12.5px; color: var(--text-2); display: grid; grid-template-columns: 58px 1fr; gap: 8px; }
.tpl li span { font-variant-numeric: tabular-nums; color: var(--brand-700); font-weight: 600; font-size: 11.5px; }
.rep { display: flex; flex-direction: column; gap: 8px; }
.rep-row { display: grid; gap: 8px; align-items: center; }
.rep-row input, .rep-row select { height: 34px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 10px; background: var(--surface); outline: none; min-width: 0; }
.rep-row input:focus { border-color: var(--brand); }
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; text-decoration: none; display: flex; align-items: center; gap: 9px; }
.settings-nav a:hover { background: var(--sunken); }
.settings-nav a.on { background: var(--surface); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); color: var(--text); }
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row .m { flex: 1; }
.set-row .m b { display: block; font-weight: 600; font-size: 13.5px; }
.set-row .m span { font-size: 12.5px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(28, 25, 23, .38); backdrop-filter: blur(2px); opacity: 0; transition: opacity .18s; }
.modal { position: relative; background: var(--surface); border-radius: 16px; box-shadow: var(--sh-3); width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; transform: translateY(10px) scale(.985); opacity: 0; transition: transform .2s cubic-bezier(.2,.8,.2,1), opacity .18s; }
.modal-root.in .modal-scrim { opacity: 1; } .modal-root.in .modal { transform: none; opacity: 1; }
.modal-sm { max-width: 440px; } .modal-md { max-width: 620px; } .modal-lg { max-width: 820px; } .modal-xl { max-width: 1000px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 10px 22px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.modal-foot .left { margin-right: auto; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 18px; }
.tpl-opt { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); text-align: left; transition: all .12s; background: var(--surface); }
.tpl-opt:hover { border-color: var(--brand-200); background: var(--brand-50); }
.tpl-opt.on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.tpl-opt b { display: block; font-size: 12.5px; font-weight: 650; line-height: 1.3; }
.tpl-opt span { font-size: 11.5px; color: var(--muted); }
.note { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); color: #7A3300; font-size: 12.5px; line-height: 1.5; }
.note .ic { color: var(--brand); margin-top: 1px; }
.note.info { background: var(--t-blue-bg); border-color: #D6E4FB; color: #173E85; } .note.info .ic { color: var(--t-blue); }

/* ---------- Popovers, toasts, palette ---------- */
.menu-pop { position: fixed; z-index: 1000; background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px; box-shadow: var(--sh-3); padding: 5px; min-width: 190px; animation: pop .12s ease-out; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); text-align: left; }
.menu-item:hover { background: var(--sunken); color: var(--text); }
.menu-item .ic { color: var(--muted); }
.menu-item.danger { color: var(--red); } .menu-item.danger .ic { color: var(--red); }
.menu-item kbd { margin-left: auto; }
.menu-item[disabled] { opacity: .45; pointer-events: none; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px; background: #1C1917; color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--sh-3); transform: translateY(10px); opacity: 0; transition: all .22s cubic-bezier(.2,.8,.2,1); max-width: 420px; }
.toast.in { transform: none; opacity: 1; }
.toast-ok .ic { color: #4ADE80; } .toast-err .ic { color: #F87171; } .toast-info .ic { color: #FDBA74; }
.palette .modal-head { display: none; }
.palette .modal-body { padding: 0; }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-input input { flex: 1; border: 0; outline: 0; font-size: 16px; background: transparent; color: var(--text); }
.pal-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.pal-grp { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 10px 12px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.pal-item .ic { color: var(--muted); }
.pal-item .m { flex: 1; min-width: 0; }
.pal-item .m b { display: block; font-weight: 550; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .m span { font-size: 12px; color: var(--muted); }
.pal-item.hi { background: var(--brand-50); } .pal-item.hi .ic { color: var(--brand); }
.pal-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); background: var(--surface-2); }

/* ---------- Empty, loading ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { color: var(--line-3); margin: 0 auto 10px; }
.empty h3 { font-size: 15px; color: var(--text-2); font-weight: 650; }
.empty p { margin: 4px auto 14px; max-width: 360px; font-size: 13px; line-height: 1.55; }
.empty.sm { padding: 26px 16px; }
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.splash .brand-mark { width: 48px; height: 48px; border-radius: 14px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); box-shadow: 0 2px 8px rgba(255,102,0,.25); } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #FF8A3D 0%, #FF6600 38%, #E14F00 75%, #B83F00 100%); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; }
.login-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(80% 70% at 30% 40%, #000, transparent); }
.login-art .brand-mark { background: #fff; color: var(--brand); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.login-art .brand-name { color: #fff; font-size: 22px; }
.login-art h1 { font-size: 44px; line-height: 1.08; font-weight: 800; letter-spacing: -0.04em; margin-top: auto; max-width: 520px; position: relative; }
.login-art p { font-size: 16px; color: rgba(255,255,255,.85); max-width: 460px; line-height: 1.6; margin: 16px 0 34px; position: relative; }
.login-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; position: relative; }
.login-feats div { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(4px); font-size: 13px; line-height: 1.4; }
.login-feats .ic { margin-top: 1px; }
.login-form { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-form form, .login-form .demo-pick { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 26px; font-weight: 750; letter-spacing: -0.03em; }
.login-form .lead { color: var(--muted); margin: 6px 0 26px; }
.login-form .fld { margin-bottom: 14px; }
.login-form .btn { width: 100%; justify-content: center; height: 42px; font-size: 14px; margin-top: 6px; }
.login-form .fine { font-size: 12px; color: var(--muted); margin-top: 18px; text-align: center; }
.demo-person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 8px; text-align: left; transition: all .12s; background: var(--surface); }
.demo-person:hover { border-color: var(--brand-200); background: var(--brand-50); transform: translateX(2px); }
.demo-person .m { flex: 1; }
.demo-person .m b { display: block; font-size: 14px; }
.demo-person .m span { font-size: 12px; color: var(--muted); }
.demo-person > .ic { color: var(--faint); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, 1fr); } .c4, .c5 { grid-column: span 6; } .c7, .c8 { grid-column: span 12; } .dsc-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) {
  .c3 { grid-column: span 6; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-102%); transition: transform .24s cubic-bezier(.2,.8,.2,1); box-shadow: var(--sh-3); }
  .app.nav-open .side { transform: none; }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(28,25,23,.3); z-index: 25; }
  .menu-toggle { display: grid; }
  .top { padding: 12px 16px; } .page { padding: 4px 16px 40px; }
  .searchbox { width: auto; } .searchbox span, .searchbox kbd { display: none; }
  .c4, .c5, .c6 { grid-column: span 12; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .settings-grid { grid-template-columns: 1fr; } .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, 1fr); } .dsc-stats { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .hero { flex-direction: column; align-items: flex-start; }
  .tsearch { min-width: 0; flex: 1; }
  .props { grid-template-columns: 96px 1fr; }
  .load-row { grid-template-columns: 100px 1fr 60px; }
  .top h1 { font-size: 18px; }
}
@media print { .side, .top, .bulkbar, .toolbar { display: none !important; } .app { display: block; } }
.kcard .kf { flex-wrap: wrap; row-gap: 6px; }
.kcard .prog-bar { width: 28px; }
