/* MedAudit KZ — design tokens + base */

:root {
  /* Warm off-white base */
  --bg:       oklch(0.985 0.004 90);
  --bg-2:     oklch(0.975 0.006 85);
  --surface:  #ffffff;
  --surface-2: oklch(0.98 0.005 85);
  --line:     oklch(0.92 0.006 85);
  --line-2:   oklch(0.88 0.008 85);

  --ink:      oklch(0.22 0.012 240);
  --ink-2:    oklch(0.38 0.012 240);
  --ink-3:    oklch(0.55 0.010 240);
  --ink-4:    oklch(0.72 0.008 240);

  /* Teal accent (#0F7B8A-ish, in oklch) */
  --accent:        oklch(0.55 0.09 205);
  --accent-ink:    oklch(0.42 0.09 205);
  --accent-soft:   oklch(0.94 0.03 205);
  --accent-soft-2: oklch(0.88 0.045 205);

  /* Status */
  --ok:        oklch(0.62 0.12 155);
  --ok-soft:   oklch(0.95 0.04 155);
  --warn:      oklch(0.76 0.14 80);
  --warn-soft: oklch(0.96 0.05 80);
  --crit:      oklch(0.70 0.16 45);
  --crit-soft: oklch(0.96 0.06 45);
  --bad:       oklch(0.58 0.17 25);
  --bad-soft:  oklch(0.95 0.05 25);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;

  --pad: 20px;
  --gap: 16px;

  --shadow-sm: 0 1px 2px rgba(16, 36, 56, 0.04), 0 1px 0 rgba(16, 36, 56, 0.02);
  --shadow-md: 0 4px 20px -8px rgba(16, 36, 56, 0.10), 0 1px 2px rgba(16, 36, 56, 0.04);
  --shadow-lg: 0 16px 40px -20px rgba(16, 36, 56, 0.22), 0 2px 6px rgba(16, 36, 56, 0.05);

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* tweakable density */
body[data-density="compact"] { --pad: 14px; --gap: 10px; }
body[data-density="spacious"] { --pad: 26px; --gap: 22px; }

body[data-radius="sharp"] { --radius: 6px; --radius-sm: 4px; --radius-lg: 10px; }
body[data-radius="round"] { --radius: 20px; --radius-sm: 14px; --radius-lg: 28px; }

/* Reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }

.mono { font-family: var(--mono); font-feature-settings: 'zero'; }

/* Layout */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  transition: grid-template-columns .2s ease;
}
.app--collapsed { grid-template-columns: 72px 1fr; }

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 18px;
  cursor: pointer;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 14px;
}
.brand-mark { flex: 0 0 auto; display: grid; place-items: center; }
.brand-text { line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-name span { color: var(--accent-ink); }
.brand-sub { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  text-align: left;
  transition: all .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item--active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}
.nav-item--active .nav-item__icon { color: var(--accent); }
.nav-item__icon { display: grid; place-items: center; color: var(--ink-3); }
.nav-item--active .nav-item__icon { color: var(--accent); }
.nav-item__label { flex: 1; }
.nav-item__badge {
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.sidebar__collapse {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-3);
  border-radius: var(--radius-sm);
}
.sidebar__collapse:hover { background: var(--surface-2); color: var(--ink); }
.sidebar--collapsed .sidebar__collapse svg { transform: rotate(180deg); }
.sidebar--collapsed .sidebar__brand { justify-content: center; }

/* Main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 30;
}
.header__crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); flex: 0 0 auto; }
.crumb-home { color: var(--ink-2); font-weight: 600; }
.crumb { color: var(--ink); font-weight: 500; }
.header__search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  flex: 1;
  max-width: 560px;
  margin-left: auto;
  color: var(--ink-3);
}
.header__search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--ink); }
.header__search kbd {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-3);
}
.header__right { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-soft-2); }
.icon-btn__badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--bad);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 5px; border-radius: 999px; min-width: 16px; text-align: center;
  border: 2px solid var(--bg);
}

.avatar-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  position: relative;
  cursor: pointer;
}
.avatar-wrap:hover { border-color: var(--line-2); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), oklch(0.60 0.09 190));
  color: #fff; font-weight: 600;
  display: grid; place-items: center;
  font-size: 12px;
}
.avatar-meta { line-height: 1.15; font-size: 12px; }
.avatar-name { font-weight: 600; color: var(--ink); }
.avatar-role { color: var(--ink-3); font-size: 11px; }
.avatar-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 40;
}
.avatar-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
}
.avatar-menu button:hover { background: var(--surface-2); color: var(--ink); }

/* Page */
.page {
  padding: 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.page__head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page__title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.page__subtitle { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.page__actions { display: flex; gap: 8px; align-items: center; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow-sm);
}
.card--flat { box-shadow: none; }
.card__title { font-size: 13px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; margin: 0 0 14px; }
.card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all .12s;
  white-space: nowrap;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); }
.btn--ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn--subtle { background: var(--accent-soft); color: var(--accent-ink); }
.btn--subtle:hover { background: var(--accent-soft-2); }
.btn--sm { padding: 6px 10px; font-size: 12px; }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
.pill__dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: 0 0 6px; }
.pill--ok   { background: var(--ok-soft);   color: oklch(0.42 0.12 155); }
.pill--warn { background: var(--warn-soft); color: oklch(0.45 0.12 70); }
.pill--crit { background: var(--crit-soft); color: oklch(0.45 0.14 40); }
.pill--bad  { background: var(--bad-soft);  color: oklch(0.42 0.17 25); }
.pill--sm   { font-size: 11px; padding: 2px 7px 2px 6px; }
.pill--lg   { font-size: 13px; padding: 5px 11px 5px 10px; }

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-hero {
  padding: 48px;
  background: linear-gradient(155deg, var(--accent) 0%, oklch(0.42 0.09 210) 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,.10), transparent 40%);
}
.login-hero > * { position: relative; }
.login-hero h1 { font-size: 42px; line-height: 1.1; margin: 0 0 16px; font-weight: 700; letter-spacing: -0.02em; }
.login-hero p { font-size: 16px; opacity: 0.85; max-width: 420px; }
.login-hero .hero-logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.login-hero .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 32px; border-top: 1px solid rgba(255,255,255,.15); }
.login-hero .hero-stat-v { font-size: 28px; font-weight: 700; font-family: var(--mono); }
.login-hero .hero-stat-l { font-size: 12px; opacity: 0.75; }

.login-form {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}
.login-form h2 { font-size: 26px; margin: 0 0 8px; letter-spacing: -0.02em; }
.login-form p { color: var(--ink-3); margin: 0 0 32px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--ink-4); }
.textarea { min-height: 80px; resize: vertical; }

/* Dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--gap);
  align-items: start;
}
.readiness-card {
  padding: 28px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.readiness-hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: center;
}
.radial {
  width: 200px; height: 200px;
  position: relative;
}
.radial__num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.radial__num span { font-size: 16px; color: var(--ink-3); }
.readiness-meta h2 { font-size: 14px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
.readiness-meta .ring-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; }
.readiness-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.readiness-dates > div { font-size: 12px; color: var(--ink-3); }
.readiness-dates b { display: block; font-family: var(--mono); color: var(--ink); font-size: 15px; font-weight: 500; margin-top: 2px; }

.widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.widget {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.widget__icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--ink-2);
  margin-bottom: 6px;
}
.widget__val { font-family: var(--mono); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.widget__label { font-size: 12px; color: var(--ink-3); }
.widget__foot { margin-top: auto; padding-top: 10px; font-size: 12px; color: var(--accent-ink); display: flex; align-items: center; gap: 4px; }
.widget--crit .widget__icon { background: var(--bad-soft); color: var(--bad); }
.widget--warn .widget__icon { background: var(--crit-soft); color: var(--crit); }
.widget--ok   .widget__icon { background: var(--ok-soft);   color: var(--ok); }
.widget--info .widget__icon { background: var(--accent-soft); color: var(--accent-ink); }

.widget--crit::before, .widget--warn::before, .widget--ok::before, .widget--info::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.widget--crit::before { background: var(--bad); }
.widget--warn::before { background: var(--crit); }
.widget--ok::before   { background: var(--ok); }
.widget--info::before { background: var(--accent); }

.cat-progress-list { display: flex; flex-direction: column; gap: 12px; }
.cat-progress {
  display: grid;
  grid-template-columns: 1fr auto 140px;
  gap: 14px;
  align-items: center;
  font-size: 13px;
}
.cat-progress__bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.cat-progress__bar > div {
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease;
}
.cat-progress__val { font-family: var(--mono); font-weight: 500; color: var(--ink-2); }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.timeline__row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  padding: 12px 0;
  align-items: center;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.timeline__row:last-child { border-bottom: 0; }
.timeline__date { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.timeline__date b { display: block; color: var(--ink); font-size: 14px; }
.timeline__title { font-weight: 500; }
.timeline__meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.timeline__days {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--ink-2);
}
.timeline__days.crit { background: var(--bad-soft); color: oklch(0.42 0.17 25); }
.timeline__days.warn { background: var(--crit-soft); color: oklch(0.45 0.14 40); }

/* Trend chart */
.trend-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  padding-top: 8px;
  align-items: end;
  height: 140px;
}
.trend-bar {
  position: relative;
  background: var(--accent-soft);
  border-radius: 6px 6px 0 0;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 6px 0;
  align-items: center;
  transition: height .3s;
}
.trend-bar:last-child { background: var(--accent); }
.trend-bar:last-child .trend-val { color: #fff; }
.trend-val { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); font-weight: 500; }
.trend-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 6px;
}

/* Checklist */
.checklist-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  align-items: center;
}
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--surface);
}
.chip:hover { border-color: var(--line-2); }
.chip--on { background: var(--accent); color: #fff; border-color: var(--accent); }

.accordion { display: flex; flex-direction: column; gap: 12px; }
.acc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.acc__head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
}
.acc__icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 10px;
  font-size: 16px;
}
.acc__title { font-weight: 600; font-size: 15px; }
.acc__sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.acc__counts { display: flex; gap: 8px; align-items: center; }
.acc__body { border-top: 1px solid var(--line); padding: 4px 0; }

.req {
  display: grid;
  grid-template-columns: 24px 1fr 220px 180px 160px 40px;
  gap: 14px;
  padding: 12px 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.req:last-child { border-bottom: 0; }
.req:hover { background: var(--surface-2); }
.req__check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  color: var(--accent);
}
.req__check.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.req__title { font-weight: 500; }
.req__meta { font-size: 11px; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; }
.req__term { color: var(--ink-3); font-size: 12px; }
.req__resp { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.mini-avatar {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 10px; font-weight: 600;
}
.req__file {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-3);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
}
.req__file.has { color: var(--accent-ink); background: var(--accent-soft); }
.req__action { color: var(--ink-3); display: grid; place-items: center; }
.req__action:hover { color: var(--accent); }

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl__strip { width: 3px; padding: 0 !important; }
.tbl__strip.ok   { background: var(--ok); }
.tbl__strip.warn { background: var(--warn); }
.tbl__strip.crit { background: var(--crit); }
.tbl__strip.bad  { background: var(--bad); }

.tbl__title { font-weight: 500; }
.tbl__meta  { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

.days-cell {
  font-family: var(--mono);
  font-weight: 500;
}
.days-cell.ok   { color: var(--ok); }
.days-cell.warn { color: oklch(0.50 0.12 70); }
.days-cell.crit { color: oklch(0.50 0.16 40); }
.days-cell.bad  { color: var(--bad); }

.toolbar {
  display: flex; gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar + .table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }

/* Staff */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--gap);
}
.staff-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.staff-card__head {
  display: flex; gap: 12px; align-items: center;
}
.staff-card__avatar {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft-2));
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 600; font-size: 16px;
  flex: 0 0 auto;
}
.staff-card__name { font-weight: 600; font-size: 14px; }
.staff-card__role { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.staff-card__group {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-ink);
  letter-spacing: 0.04em;
}
.staff-card__docs {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
}
.staff-card__doc {
  display: grid; grid-template-columns: 20px 1fr auto; gap: 8px;
  align-items: center;
  color: var(--ink-2);
}
.staff-card__doc.ok   { color: var(--ink-2); }
.staff-card__doc.warn { color: var(--ink-2); }
.staff-card__doc.bad  { color: var(--ink-2); }
.doc-icon {
  width: 14px; height: 14px; border-radius: 4px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700;
}
.doc-icon.ok   { background: var(--ok); }
.doc-icon.warn { background: var(--crit); }
.doc-icon.bad  { background: var(--bad); }
.doc-icon.info { background: var(--accent); }
.staff-card__date { font-family: var(--mono); color: var(--ink-3); font-size: 11px; }
.staff-card__foot { display: flex; justify-content: space-between; align-items: center; }

/* Staff detail */
.staff-detail {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--gap);
  align-items: start;
}
.profile-card {
  padding: 22px;
  text-align: left;
}
.profile-card__avatar-lg {
  width: 88px; height: 88px; border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), oklch(0.58 0.09 190));
  color: #fff; display: grid; place-items: center;
  font-size: 28px; font-weight: 600;
  margin-bottom: 14px;
}
.profile-card__name { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.profile-card__role { font-size: 13px; color: var(--ink-3); margin: 4px 0 16px; }
.profile-card__fields { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.profile-card__field { display: flex; justify-content: space-between; font-size: 12px; }
.profile-card__field label { color: var(--ink-3); }
.profile-card__field span { color: var(--ink); font-family: var(--mono); }

/* Notifications */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif {
  display: grid;
  grid-template-columns: 4px 40px 1fr auto;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  align-items: center;
}
.notif::before { content: ''; grid-column: 1 / 2; align-self: stretch; border-radius: 3px; }
.notif--critical::before, .notif--bad::before { background: var(--bad); }
.notif--warning::before { background: var(--crit); }
.notif--info::before { background: var(--accent); }
.notif__ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
}
.notif--critical .notif__ico, .notif--bad .notif__ico { background: var(--bad-soft); color: var(--bad); }
.notif--warning .notif__ico { background: var(--crit-soft); color: var(--crit); }
.notif--info .notif__ico { background: var(--accent-soft); color: var(--accent-ink); }
.notif__title { font-weight: 500; font-size: 14px; }
.notif__body  { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.notif__date  { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: auto; margin-right: 12px; }
.notif__actions { display: flex; gap: 6px; }

/* Laws */
.law {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 20px;
  margin-bottom: 10px;
}
.law__date { font-family: var(--mono); color: var(--ink-2); font-size: 13px; }
.law__date b { display: block; color: var(--accent-ink); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.law__title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; margin: 0 0 6px; }
.law__summary { font-size: 13px; color: var(--ink-2); margin: 0 0 10px; }
.law__affects { display: flex; flex-wrap: wrap; gap: 6px; }
.law__affects .tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.law__actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* Reports */
.reports-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--gap);
}
.report-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}
.report-head {
  padding: 24px 28px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
}
.report-head h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.report-head p { margin: 0; color: var(--ink-3); font-size: 13px; }
.report-body { padding: 24px 28px; font-size: 13px; }
.report-section { margin-bottom: 22px; }
.report-section h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.report-stat-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.report-stat-row:last-child { border-bottom: 0; }
.report-stat-row b { font-family: var(--mono); font-weight: 500; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(16, 36, 56, 0.35);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: grid; place-items: center;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(560px, 92vw);
  max-height: 90vh;
  overflow: auto;
  padding: 28px;
}
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal__title { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.modal__sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.modal__close { color: var(--ink-3); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.modal__close:hover { background: var(--surface-2); color: var(--ink); }
.modal__body { display: grid; gap: 14px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

.upload-zone {
  border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--ink-3);
  background: var(--surface-2);
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--gap);
}
.settings-tabs {
  display: flex; flex-direction: column; gap: 4px;
}
.settings-tab {
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-2);
}
.settings-tab:hover { background: var(--surface-2); }
.settings-tab--on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* Toast */
.toasts {
  position: fixed; bottom: 24px; right: 24px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  min-width: 240px;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* Tweaks panel */
.tweaks-panel {
  position: fixed; bottom: 20px; right: 20px; z-index: 70;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.tweaks-panel__head { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tweaks-panel__head h4 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-2); }
.tweaks-panel__body { padding: 16px; display: grid; gap: 14px; }
.tweak-group label { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.tweak-row { display: flex; gap: 6px; }
.swatch {
  width: 24px; height: 24px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  cursor: pointer;
}
.swatch.on { outline: 2px solid var(--ink); outline-offset: 2px; border-color: transparent; }
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 8px; }
.seg button {
  flex: 1; padding: 6px 10px;
  font-size: 11px; font-weight: 500;
  border-radius: 6px;
  color: var(--ink-3);
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Reports stripe */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.stat-strip .widget { padding: 16px; }

/* Divider row */
.sep { height: 1px; background: var(--line); margin: 14px 0; }

/* Subtle empty hints */
.empty {
  padding: 40px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
