/* TechDesk — layout: fixed ink sidebar + light working canvas; dense tables, state shown as pills */
:root {
  --ink: #0f2138;
  --ink-2: #183253;
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --line: #e1e6ee;
  --text: #1b2533;
  --muted: #637087;
  --accent: #1d5fd1;
  --accent-soft: #e6eefc;
  --mark: #f0a43a;
  --good: #1f8a5b;
  --warn: #c27a0e;
  --bad: #c8372d;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Archivo", "IBM Plex Sans", system-ui, sans-serif;
  --bs-primary: #1d5fd1;
  --bs-primary-rgb: 29, 95, 209;
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--text);
  --bs-link-color: #1d5fd1;
  --bs-link-color-rgb: 29, 95, 209;
}

html, body { height: 100%; }
body { background: var(--canvas); color: var(--text); font-family: var(--font-body); font-size: 14px; }
h1, h2, h3, h4, .display { font-family: var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.55rem; font-weight: 800; margin: 0; }
h2 { font-size: 1.1rem; font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: #174fb0; --bs-btn-hover-border-color: #174fb0; }
.tabular, table, .kpi .val { font-variant-numeric: tabular-nums; }
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100%; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--ink); color: #c9d4e5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 1030; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--mark); color: var(--ink); font-family: var(--font-display); font-weight: 800; display: grid; place-items: center; }
.brand strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.brand small { display: block; color: #8fa1bd; font-size: .75rem; }
.sidebar nav { display: flex; flex-direction: column; padding: 8px 10px; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a { color: #c9d4e5; padding: 9px 12px; border-radius: 6px; display: flex; gap: 10px; align-items: center; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: var(--ink-2); color: #fff; }
.sidebar nav a.active { background: var(--ink-2); color: #fff; border-left-color: var(--mark); font-weight: 600; }
.sidebar nav i { font-size: 1.05rem; opacity: .85; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot strong { display: block; color: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot small { color: #8fa1bd; font-size: .72rem; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.crumb { color: var(--muted); font-weight: 500; }
.search { position: relative; width: min(320px, 50vw); }
.search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 30px; }
.content { padding: 24px 28px; flex: 1; }
.foot { padding: 14px 28px; color: var(--muted); font-size: .78rem; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -260px; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* ---------- page parts ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-body { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1199.98px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-21 { grid-template-columns: 1fr; } }
@media (max-width: 767.98px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.kpi.k-good::before { background: var(--good); }
.kpi.k-warn::before { background: var(--warn); }
.kpi.k-bad::before { background: var(--bad); }
.kpi.k-accent::before { background: var(--accent); }
.kpi .lbl { color: var(--muted); font-size: .78rem; font-weight: 500; }
.kpi .val { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.kpi .note { color: var(--muted); font-size: .75rem; }
a.kpi:hover { border-color: var(--accent); }
a.kpi { color: inherit; }

.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .6rem .75rem; border-bottom-color: var(--line); vertical-align: middle; }
.table thead th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; white-space: nowrap; }
.table-hover tbody tr:hover { background: #f7f9fd; }
.table-wrap { overflow-x: auto; }
.t-title { font-weight: 600; color: var(--text); }
.t-title:hover { color: var(--accent); }
.t-meta { color: var(--muted); font-size: .76rem; }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.row-blocked td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* pills & chips */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.st-notstarted { background: #eef1f5; color: #4b5870; }
.st-progress { background: #e6eefc; color: #1a4fae; }
.st-review { background: #efe9fb; color: #5b3aa6; }
.st-waiting { background: #fdf1de; color: #8f5a06; }
.st-hold { background: #fbe7e2; color: #9c3b26; }
.st-done { background: #e2f4ea; color: #17714a; }
.st-cancel { background: #f1f1f1; color: #888; text-decoration: line-through; }
.prio { font-size: .74rem; font-weight: 600; white-space: nowrap; }
.prio::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.prio-critical { color: var(--bad); } .prio-critical::before { background: var(--bad); }
.prio-high { color: #c25a0e; } .prio-high::before { background: #e07b22; }
.prio-medium { color: #44608c; } .prio-medium::before { background: #7f9cc8; }
.prio-low { color: #7a8597; } .prio-low::before { background: #c3cad6; }
.impact { font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.impact-high { border-color: #b9d3c5; color: var(--good); background: #f1f9f4; }
.text-late { color: var(--bad); } .text-ok { color: var(--good); } .text-warn { color: var(--warn); }
.stars { color: #e3a21a; letter-spacing: 1px; } .stars .off { color: #d9dee6; }
.score { display: inline-grid; place-items: center; min-width: 42px; height: 28px; padding: 0 8px; border-radius: 6px; font-weight: 700; font-family: var(--font-display); }
.score-good { background: #e2f4ea; color: #17714a; } .score-ok { background: #fdf1de; color: #8f5a06; } .score-low { background: #fbe7e2; color: #9c3b26; }
.progress-thin { height: 6px; background: #e8edf4; min-width: 70px; }
.progress-thin .progress-bar { background: var(--accent); }
.avatar { --h: 210; display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 45% 28%); font-weight: 700; font-size: .75rem; }
.avatar.lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.15rem; }
.person { display: flex; gap: 8px; align-items: center; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe; border-radius: 10px 10px 0 0; }
.filters .form-label { font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.filters .form-select, .filters .form-control { min-width: 130px; }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li:last-child { border-left-color: transparent; }
.callout { border-radius: 8px; padding: 12px 14px; border: 1px solid; }
.callout-warn { background: #fdf6ea; border-color: #f1d9ad; }
.callout-bad { background: #fdf0ee; border-color: #f2c9c2; }
.section-title { font-family: var(--font-display); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.form-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
.form-label { font-weight: 500; }
.req::after { content: " *"; color: var(--bad); }
.chart-box { position: relative; height: 260px; }
.bar-mini { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: #eef1f5; min-width: 120px; }
.bar-mini span { display: block; height: 100%; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.age-0 { color: var(--muted); } .age-1 { color: var(--warn); font-weight: 600; } .age-2 { color: var(--bad); font-weight: 700; }

/* login */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--ink) 0 45%, var(--canvas) 45%); }
.login-card { width: min(420px, 100%); background: var(--surface); border-radius: 12px; padding: 32px; box-shadow: 0 20px 50px rgba(15,33,56,.18); }

/* report / print */
.report-member { break-inside: avoid; }
@media print {
  .sidebar, .no-print, .topbar, .foot { display: none !important; }
  body { background: #fff; font-size: 11px; }
  .content { padding: 0; }
  .panel, .kpi { border-color: #ccc; }
  .page-break { break-before: page; }
  a { color: inherit; }
}
.bar-bad .progress-bar { background: var(--bad); }
.bar-good .progress-bar { background: var(--good); }
