:root {
  --bg: #f5f6fa; --panel: #ffffff; --panel-2: #f9fafc; --text: #1b2033; --muted: #6a7188; --line: #e4e7f0;
  --brand: #4338ca; --brand-2: #6366f1; --brand-soft: #eef0ff;
  --ok: #15803d; --ok-soft: #e6f6ec; --warn: #b45309; --warn-soft: #fff4e0; --bad: #b91c1c; --bad-soft: #fde9e9;
  --info: #0e7490; --info-soft: #e2f4f8; --violet: #6d28d9; --violet-soft: #f0e9ff; --slate-soft: #eceef5;
  --shadow: 0 1px 2px rgba(20,24,50,.06), 0 4px 14px rgba(20,24,50,.05);
  --radius: 12px; --sidebar: 244px;
}
:root[data-theme="dark"] {
  --bg: #0f1220; --panel: #171b2e; --panel-2: #1c2136; --text: #e8eaf6; --muted: #9aa1bd; --line: #2a3050;
  --brand: #8b93ff; --brand-2: #a5abff; --brand-soft: #232a55;
  --ok: #4ade80; --ok-soft: #12301f; --warn: #fbbf24; --warn-soft: #3a2c0d; --bad: #f87171; --bad-soft: #3b1618;
  --info: #22d3ee; --info-soft: #0f2d36; --violet: #c4b5fd; --violet-soft: #2a2250; --slate-soft: #232842;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; letter-spacing: -.01em; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .tiny { font-size: 11px; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; } .bold { font-weight: 600; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.pre { white-space: pre-wrap; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; } .gap-sm { gap: 6px; } .gap-lg { gap: 18px; } .grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .mt-sm { margin-top: 6px; }

/* ---------- layout ---------- */
#app { min-height: 100%; }
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.02em; }
.brand b { font-size: 15px; letter-spacing: -.01em; } .brand span { display: block; font-size: 11px; color: var(--muted); }
.nav-group { margin-top: 12px; } .nav-group > .t { padding: 0 10px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--slate-soft); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav a .ico { width: 18px; text-align: center; opacity: .9; } .nav a .cnt { margin-left: auto; font-size: 11px; background: var(--bad); color: #fff; padding: 0 6px; border-radius: 9px; font-weight: 700; }
.usercard { margin-top: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.topbar .crumb { font-weight: 650; }
.view { padding: 20px 22px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 760px; }
.menu-btn { display: none; }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card > .bd { padding: 14px 16px; } .card > .bd.flush { padding: 0; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; } .g-1-2 { grid-template-columns: 1fr 2fr; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); display: block; color: inherit; }
a.tile:hover { text-decoration: none; border-color: var(--brand-2); }
.tile .k { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 24px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tile.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad-soft) 55%, var(--panel)); } .tile.bad .v { color: var(--bad); }
.tile.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 55%, var(--panel)); } .tile.warn .v { color: var(--warn); }
.tile.good .v { color: var(--ok); }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.note { padding: 10px 12px; border-radius: 9px; background: var(--info-soft); color: var(--info); font-size: 12.5px; }
.note.warn { background: var(--warn-soft); color: var(--warn); } .note.bad { background: var(--bad-soft); color: var(--bad); } .note.ok { background: var(--ok-soft); color: var(--ok); }
.note ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- controls ---------- */
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 7px 12px; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
button:hover, .btn:hover { border-color: var(--brand-2); text-decoration: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; } button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); } button.ghost { background: transparent; border-color: transparent; }
button.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; } button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; }
textarea { min-height: 70px; resize: vertical; } input[type=checkbox], input[type=radio] { width: auto; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.f.inline { flex-direction: row; align-items: center; gap: 8px; }
label.f small { font-weight: 400; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input, .filters select { width: auto; min-width: 130px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-2); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 9px 12px; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--panel-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.total td { font-weight: 700; background: var(--panel-2); }

/* ---------- badges / bars ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--slate-soft); color: var(--muted); white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-warn { background: var(--warn-soft); color: var(--warn); } .b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); } .b-brand { background: var(--brand-soft); color: var(--brand); } .b-violet { background: var(--violet-soft); color: var(--violet); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.high { background: var(--bad); } .dot.medium { background: var(--warn); } .dot.low { background: var(--info); } .dot.ok { background: var(--ok); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 750; color: #fff; flex: none; }
.avatar.lg { width: 38px; height: 38px; font-size: 14px; }
.pbar { height: 8px; border-radius: 99px; background: var(--slate-soft); overflow: hidden; min-width: 60px; position: relative; }
.pbar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand-2); }
.pbar.ok > i { background: var(--ok); } .pbar.warn > i { background: var(--warn); } .pbar.bad > i { background: var(--bad); }
.pbar-2 { position: relative; height: 10px; border-radius: 99px; background: var(--slate-soft); overflow: hidden; }
.pbar-2 > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-bottom: 3px; }
.stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--slate-soft); }
.stack > i { display: block; height: 100%; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); } .legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--muted)); margin-right: 5px; }
.ring { --p: 0; --c: var(--brand-2); width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--slate-soft) 0); position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 7px; background: var(--panel); border-radius: 50%; } .ring b { position: relative; font-size: 18px; }
.skill { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--violet-soft); color: var(--violet); margin: 1px 3px 1px 0; }
.skill.miss { background: var(--bad-soft); color: var(--bad); } .skill.ok { background: var(--ok-soft); color: var(--ok); }
.heat { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 5px; font-size: 11px; font-weight: 700; }

/* ---------- board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.bcol { background: var(--slate-soft); border-radius: var(--radius); padding: 8px; min-height: 120px; }
.bcol > .h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px; font-weight: 700; font-size: 12.5px; }
.bcol.over { outline: 2px dashed var(--brand-2); }
.tcard { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--line)); border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); }
.tcard:hover { border-color: var(--brand-2); border-left-color: var(--c, var(--brand-2)); }
.tcard .ttl { font-weight: 600; margin: 3px 0 6px; } .tcard .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.p-critical { --c: #dc2626; } .p-high { --c: #f97316; } .p-medium { --c: #6366f1; } .p-low { --c: #94a3b8; }
.tl { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; display: flex; flex-direction: column; gap: 12px; }
.tl > div { position: relative; } .tl > div::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-2); border: 2px solid var(--panel); }
.steps { display: flex; gap: 4px; flex-wrap: wrap; } .steps span { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--slate-soft); color: var(--muted); font-weight: 600; } .steps span.done { background: var(--ok-soft); color: var(--ok); } .steps span.cur { background: var(--brand); color: #fff; }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,12,25,.5); z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 4vh 14px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0,0,0,.35); border: 1px solid var(--line); }
.modal.wide { max-width: 1020px; } .modal.xl { max-width: 1180px; }
.modal > .hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal > .bd { padding: 16px 18px; } .modal > .ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 20px; line-height: 1; padding: 2px 8px; color: var(--muted); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 550; white-space: pre-wrap; }
.toast.bad { background: var(--bad); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
.err { color: var(--bad); font-size: 12.5px; white-space: pre-wrap; margin-top: 8px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 20% -10%, var(--brand-soft), transparent), var(--bg); }
.login .box { width: 100%; max-width: 440px; }
.login .quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.login .quick button { justify-content: flex-start; text-align: left; font-weight: 500; padding: 6px 9px; } .login .quick small { display: block; color: var(--muted); font-weight: 400; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; } .kv > :nth-child(odd) { color: var(--muted); }
.sec-t { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.quote { border-left: 3px solid var(--brand-2); background: var(--panel-2); padding: 8px 12px; border-radius: 0 8px 8px 0; }
.list-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line); } .list-item:last-child { border-bottom: 0; }
a.list-item { color: inherit; } a.list-item:hover { background: var(--panel-2); text-decoration: none; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); } .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .sidebar { position: fixed; left: -270px; z-index: 50; width: 250px; transition: left .2s; box-shadow: var(--shadow); } .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex; } .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; } .view { padding: 14px 12px 60px; } .kv { grid-template-columns: 90px 1fr; }
}
@media print { .sidebar, .topbar, .no-print { display: none !important; } .shell { display: block; } }

/* ---- timesheet week grid ---- */
.daygrid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px}
.daycol{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:8px;min-height:150px}
.daycol .h{display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:13px}
.daycol.today{outline:2px solid var(--brand)}
.daycol.wkend{opacity:.7}
.daycol .entry{position:relative;border:1px solid var(--line);border-radius:8px;padding:6px 8px;font-size:13px}
.daycol .entry .ghost{position:absolute;right:2px;bottom:2px;border:0;background:none;padding:2px 6px;opacity:.6}
@media(max-width:900px){.daygrid{grid-template-columns:1fr}}
/* ---- release stepper ---- */
.stepper{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0 14px}
.stepper>div{flex:1;min-width:90px;display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;font-size:13px;color:var(--muted)}
.stepper i{font-style:normal;width:22px;height:22px;border-radius:50%;display:inline-grid;place-items:center;background:var(--line);font-size:12px}
.stepper .done{color:var(--ok)}.stepper .done i{background:var(--ok);color:#fff}
.stepper .cur{border-color:var(--brand);color:var(--brand);font-weight:600}.stepper .cur i{background:var(--brand);color:#fff}
/* ---- skill matrix ---- */
.matrix th,.matrix td{text-align:center;padding:4px 6px}
.matrix td:first-child,.matrix th:first-child{text-align:left;position:sticky;left:0;background:var(--panel)}
.matrix .vert{writing-mode:vertical-rl;transform:rotate(180deg);white-space:nowrap;font-weight:500}
.matrix .lv{font-weight:600;font-size:12px}
.lv0{background:transparent}.lv1{background:#e0e7ff}.lv2{background:#c7d2fe}.lv3{background:#a5b4fc}.lv4{background:#818cf8;color:#fff}.lv5{background:#4f46e5;color:#fff}

/* ---- hierarchy / org tree ---- */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; } .tree ul { margin-left: 15px; padding-left: 16px; border-left: 2px solid var(--line); }
.tree li { margin: 3px 0; position: relative; } .tree ul > li::before { content: ''; position: absolute; left: -16px; top: 17px; width: 14px; border-top: 2px solid var(--line); }
.tree summary { list-style: none; cursor: pointer; } .tree summary::-webkit-details-marker { display: none; }
.tree details > summary::before { content: '▸'; position: absolute; left: -2px; top: 9px; font-size: 11px; color: var(--muted); transform: translateX(-12px); } .tree details[open] > summary::before { content: '▾'; }
.tnode { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--line)); background: var(--panel); max-width: 100%; }
.tnode.dim { opacity: .35; } .tnode .tname { font-weight: 650; } .tmet { display: inline-flex; gap: 8px; font-size: 11.5px; color: var(--muted); } .tmet .bad { color: var(--bad); font-weight: 650; } .tmet .warn { color: var(--warn); font-weight: 650; }
.treecard .bd { overflow-x: auto; padding: 14px 16px 14px 28px; }
.hdot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; flex: none; } .hdot.green { background: var(--ok); } .hdot.amber { background: var(--warn); } .hdot.red { background: var(--bad); }
.fdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.fcard { border-top: 4px solid var(--c); } .fstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; } .fstats > div { background: var(--panel-2); border-radius: 9px; padding: 8px 10px; } .fstats b { display: block; font-size: 20px; letter-spacing: -.02em; } .fstats b.bad { color: var(--bad); } .fstats span { font-size: 11.5px; color: var(--muted); }
.clientcard { display: block; color: inherit; border-left: 5px solid var(--line); } .clientcard:hover { text-decoration: none; border-color: var(--brand-2); } .clientcard.red { border-left-color: var(--bad); } .clientcard.amber { border-left-color: var(--warn); } .clientcard.green { border-left-color: var(--ok); }
.mchart { display: block; color: var(--text); } .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 6px; } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.tile.sel { outline: 2px solid var(--brand-2); }
.wide-tbl { overflow-x: auto; } .wide-tbl .tbl { min-width: 1280px; } .wide-tbl .tbl td { vertical-align: top; } .clip { max-width: 320px; }
.quick details { margin: 0; } details > summary.bold { cursor: pointer; padding: 4px 0; }
/* Kappa (CAPA) form – looks like the paper form */
.kappa { border: 1.5px solid var(--text); border-radius: 6px; padding: 14px; display: grid; gap: 10px; background: var(--panel); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.kfield { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; } .klabel { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; margin-bottom: 3px; }
@media print { .sidebar, .topbar, .no-print, .overlay > .modal > .hd .x { display: none !important; } .overlay { position: static; background: none; } .modal { box-shadow: none; border: 0; max-width: none; } }

.wide-tbl .tbl td:first-child, .wide-tbl .tbl td:nth-child(2) { white-space: nowrap; } .wide-tbl .tbl td:nth-child(n+5):not(:nth-child(11)):not(:nth-child(12)) { white-space: nowrap; }
.mlegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 6px; } .mlegend span { display: inline-flex; align-items: center; } .mlegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.stars { color: #f59e0b; letter-spacing: 1px; } .stars i { font-style: normal; color: var(--line); }
.gate { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; color: #fff; flex: none; } .gate.ok { background: var(--ok); } .gate.bad { background: var(--bad); }
.tbl tr.sel-row td { background: var(--brand-soft); font-weight: 650; }

/* ---- extras ---- */
.text-bad { color: var(--bad); font-weight: 600; } .text-ok { color: var(--ok); font-weight: 600; }
.tbl tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.tbl tr.row-now td { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.tbl tr[data-action] { cursor: pointer; } .tbl tr[data-action]:hover td { background: var(--panel-2); }
.list-item input[type=checkbox] { margin-top: 4px; }
.sec-t { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* ===== v5: WhatsApp send list, checklists, live report, mobile pass ===== */
.wa-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; position: sticky; top: 52px; z-index: 5; }
.wa-bar .grow { min-width: 200px; } .wa-next { font-size: 15px; padding: 11px 18px; }
.wa-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); } .wa-item:last-child { border-bottom: 0; }
.wa-item.sent { opacity: .6; } .wa-main { min-width: 0; flex: 1; } .wa-act { display: flex; gap: 6px; flex: none; align-items: center; }
.wa-prev summary { cursor: pointer; color: var(--muted); margin-top: 4px; } .wa-prev pre { white-space: pre-wrap; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12.5px; margin: 6px 0 0; }
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; }
a.btn.primary { background: #16a34a; border-color: #16a34a; color: #fff; } a.btn.sm { padding: 4px 10px; font-size: 12.5px; } a.btn:hover { text-decoration: none; filter: brightness(.96); }
.bad-t { color: var(--bad); }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px dashed var(--line); } .chk input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.chk.done > .grow, .chk.done > span.grow { color: var(--muted); text-decoration: line-through; } .chk.late { background: color-mix(in srgb, var(--bad) 7%, transparent); border-radius: 8px; }
.list-item.wide { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; border-radius: 0; cursor: pointer; } .list-item.wide.sel { background: var(--brand-soft); }
.pad { padding: 10px 14px; } .mono-t { font-family: ui-monospace, Menlo, monospace; font-size: 12px; width: 100%; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; } .live-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.live-tbl .tbl { min-width: 900px; } .live-tbl .tbl td:first-child { min-width: 210px; }
.fstats b.bad-t { color: var(--bad); }
.mbnav { display: none; }

/* ---- mobile friendliness ---- */
html { -webkit-text-size-adjust: 100%; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; } .tabs button { flex: none; white-space: nowrap; }
@media (max-width: 860px) {
  .topbar { position: sticky; top: 0; z-index: 30; } .wa-bar { top: 48px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; } .page-head > .row { justify-content: flex-start; } .page-head h1 { font-size: 20px; }
  .g-1-2, .g-2-1, .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr) !important; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { gap: 6px; } .filters select, .filters input:not([type=checkbox]):not([type=date]) { flex: 1 1 140px; min-width: 0; } .filters input[type=date] { flex: 1 1 130px; }
  input, select, textarea { font-size: 16px; }
  button, .btn, a.btn, .chip { min-height: 40px; } button.sm, a.btn.sm { min-height: 34px; }
  .modal, .modal.wide { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .overlay { padding: 0; align-items: stretch; } .modal .bd { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .form-grid { grid-template-columns: 1fr; } .kv { grid-template-columns: 96px 1fr; }
  .wa-item { flex-direction: column; } .wa-act { width: 100%; } .wa-act .btn, .wa-act button { flex: 1; }
  .wa-next { width: 100%; } .stepper > div { min-width: 70px; font-size: 12px; padding: 6px 8px; }
  .card .hd { flex-wrap: wrap; gap: 6px; } .view { padding-bottom: 84px; }
  .mbnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--panel); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .mbnav a, .mbnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted); background: none; border: 0; padding: 4px 0; min-height: 46px; text-decoration: none; border-radius: 8px; }
  .mbnav a.on { color: var(--brand); font-weight: 650; } .mbnav span { font-size: 18px; line-height: 1; }
  .toasts { bottom: 66px; }
  .wide-tbl .tbl td { padding: 8px 9px; }
}
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr 1fr; } .tile .v { font-size: 20px; } .login .quick { grid-template-columns: 1fr; } }

.grid > *, .col, .card { min-width: 0; } .view { overflow-x: hidden; } .wide-tbl, .tbl-wrap { max-width: 100%; }

/* ===== v6: reports ===== */
.rowgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
a.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; color: var(--text); }
a.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.print-only { display: none; }
.mini-bars { display: flex; gap: 12px; align-items: flex-end; overflow-x: auto; padding-bottom: 4px; }
.mini-bars .mb { text-align: center; min-width: 38px; } .mini-bars .bars { height: 70px; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.mini-bars .bars i { width: 11px; background: var(--brand-2, var(--brand)); border-radius: 3px 3px 0 0; min-height: 2px; } .mini-bars .bars i.ok { background: var(--ok); }
.cr-client .tbl td { vertical-align: top; }
@media print {
  body { background: #fff; color: #000; } .view { padding: 0; } .print-only { display: block; margin-bottom: 10px; } .report-head h1 { margin: 0; font-size: 20px; } .report-head p { margin: 2px 0 0; color: #444; }
  .card { box-shadow: none; break-inside: avoid; } .tbl { font-size: 10.5px; } .cr-client { break-inside: auto; } tr { break-inside: avoid; } .tabs, .page-head, .mbnav { display: none !important; }
  .ptop, .ptabs { display: none !important; }
}

/* ===== v6: client portal (one Jira-style section) ===== */
.pshell { min-height: 100vh; background: var(--bg); }
.ptop { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ptabs { display: flex; gap: 4px; } .ptabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; } .ptabs a em { font-style: normal; }
.ptabs a.on { background: var(--brand-soft); color: var(--brand); } .ptabs a:hover { text-decoration: none; background: var(--panel-2); }
.pview { max-width: 1000px; margin: 0 auto; padding: 22px 16px 70px; }
.pitem { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text); } .pitem:last-child { border-bottom: 0; } .pitem:hover { background: var(--panel-2); text-decoration: none; }
.pitem .pico { font-size: 18px; width: 26px; text-align: center; } .pitem .pt { font-weight: 600; overflow-wrap: anywhere; } .pitem .pst { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.pwait { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 40%, var(--panel)); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: grid; gap: 2px; font-size: 12px; } .step i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--slate-soft); font-size: 11px; font-weight: 700; }
.step.done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); } .step.done i { background: var(--ok); color: #fff; } .step span { color: var(--muted); }
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.pick { display: grid; gap: 4px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); } .pick:hover { text-decoration: none; border-color: var(--brand-2, var(--brand)); } .pick.on { border-color: var(--brand); background: var(--brand-soft); } .pick span { font-size: 12px; color: var(--muted); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.tl > div { padding: 0 0 10px 12px; border-left: 2px solid var(--line); margin-left: 4px; } .tl > .you { border-left-color: var(--violet); } .tl > .team { border-left-color: var(--brand); }
.flush-list .pitem:last-child { border-bottom: 0; }
@media (max-width: 640px) {
  .ptop { padding: 8px 12px; } .ptabs { order: 3; width: 100%; justify-content: space-between; } .ptabs a { flex-direction: column; gap: 1px; font-size: 11px; padding: 6px 8px; flex: 1; text-align: center; } .hide-sm { display: none; }
  .pitem { flex-wrap: wrap; } .pitem .pst { flex-direction: row; align-items: center; }
  .ptabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 4px; z-index: 30; }
}

/* ===== v7: view-as banner ===== */
.vabar { position: sticky; top: 0; z-index: 90; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 7px 12px; background: #7c2d12; color: #fff; font-size: 13px; }
.vabar b { text-decoration: underline; } .vabar button { background: #fff; color: #7c2d12; border-color: #fff; font-weight: 700; }
.vabtn { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; color: var(--text); } .vabtn small { display: block; color: var(--muted); font-size: 11.5px; } .vabtn:hover { border-color: var(--brand); }
@media print { .vabar { display: none; } }

/* ToDos */
.todo { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line, #e7e9ee); }
.todo:first-child { border-top: 0; }
.todo input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex: none; cursor: pointer; }
.todo.is-done .tt { text-decoration: line-through; color: var(--muted); }
.todo.is-late { background: var(--bad-soft); } .todo.is-today { background: var(--warn-soft); }
.todo .tt { font-weight: 560; } .todo .grow { min-width: 0; }
.todo-sec { padding: 8px 14px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.todo-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line, #e7e9ee); }
.todo-add input[name=title] { flex: 1 1 220px; min-width: 0; }
[hidden] { display: none !important; }
.todo-add input[type=date] { flex: 0 0 auto; width: auto; }

/* issue flow */
.flowchart { width: 100%; height: auto; display: block; }
.flowchart .bn { fill: var(--brand-2); } .flowchart .bc { fill: var(--ok); } .flowchart text { fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
