/* ==========================================================================
   Access Link — Contract Staffing Portal
   Prototype stylesheet. Design tokens are sampled from the Access Link logo:
   blue #083888 and red #D83030.
   Layout: fixed sidebar + fluid content, collapsing to off-canvas under 1024px.
   ========================================================================== */

/* ---------------------------------------------------------------- 1. tokens */
:root {
  --brand: #083888;
  --brand-600: #0a44a0;
  --brand-700: #062b67;
  --brand-900: #041d47;
  --brand-50: #eef3fb;
  --accent: #d83030;
  --accent-50: #fdeceb;

  --ok: #12734a;      --ok-bg: #e7f5ee;
  --warn: #8a5a00;    --warn-bg: #fdf3e2;
  --danger: #b3261e;  --danger-bg: #fdecea;
  --info: #0a44a0;    --info-bg: #eaf1fd;
  --neutral: #4c5a6b; --neutral-bg: #eef1f5;

  --ink: #17212e;
  --ink-2: #4c5a6b;
  --ink-3: #7b8798;
  --line: #e2e7ee;
  --line-2: #eef1f6;
  --bg: #f4f6fa;
  --white: #fff;

  --sidebar-w: 258px;
  --topbar-h: 62px;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --sh-1: 0 1px 2px rgba(16, 32, 64, .06);
  --sh-2: 0 4px 14px rgba(16, 32, 64, .08);
  --sh-3: 0 14px 40px rgba(16, 32, 64, .16);

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs: 14px;
  --fs-lg: 16px;
  --fs-h3: 18px;
  --fs-h2: 22px;
  --fs-h1: 28px;

  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ----------------------------------------------------------------- 2. base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--brand-600); outline-offset: 2px; border-radius: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--brand);
  color: #fff; padding: 10px 16px; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

/* -------------------------------------------------------------- 3. the app */
.app { display: flex; min-height: 100vh; }

/* sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--brand-900);
  color: #cfdcf3;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  min-height: var(--topbar-h);
}
.sidebar__brand img { width: 30px; height: 30px; flex: none; }
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar__brand-text strong { color: #fff; font-size: 15px; letter-spacing: -.01em; }
.sidebar__brand-text span { font-size: 10.5px; color: #8fa8d4; text-transform: uppercase; letter-spacing: .08em; }

.sidebar__role {
  margin: 14px 14px 6px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, .07);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
}
.sidebar__role b { display: block; color: #fff; font-size: var(--fs-sm); }
.sidebar__role span { color: #9db4da; }

.nav { padding: 6px 10px 18px; flex: 1; }
.nav__group { margin-top: 14px; }
.nav__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: #9db4da; padding: 6px 12px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  color: #dbe6f7; font-size: 13.5px; font-weight: 500;
  border-radius: var(--r-sm); position: relative;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .13); color: #fff; }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: 1; }
.nav__count {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 7px;
}

.sidebar__foot {
  padding: 12px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12.5px; color: #9db4da; line-height: 1.5;
}

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

/* topbar */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.topbar__menu {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--r-sm); width: 38px; height: 38px; cursor: pointer;
  align-items: center; justify-content: center;
}
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--ink-3); min-width: 0; }
.breadcrumb b { color: var(--ink); font-weight: 600; }
.breadcrumb span { color: var(--line); }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }

/* role switcher */
.roleswitch {
  display: flex; align-items: center; gap: 8px;
  background: var(--brand-50); border: 1px solid #d6e0f2;
  border-radius: 999px; padding: 4px 6px 4px 12px;
}
.roleswitch label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); font-weight: 700; }
.roleswitch select {
  border: 0; background: #fff; border-radius: 999px; padding: 6px 10px;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  border: 1px solid #cdd9ee; cursor: pointer;
}
.iconbtn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn .dot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%; border: 2px solid #fff;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--brand-600); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .02em;
}
.avatar--lg { width: 56px; height: 56px; font-size: 19px; }
.who { line-height: 1.2; }
.who b { display: block; font-size: var(--fs-sm); }
.who span { font-size: var(--fs-xs); color: var(--ink-3); }

/* sample-data banner */
.samplebar {
  background: var(--warn-bg); border-bottom: 1px solid #f0dfc0; color: #6d4700;
  font-size: var(--fs-xs); padding: 8px 22px; display: flex; align-items: center; gap: 9px;
}
.samplebar b { color: #563800; }

/* content */
.content { padding: 22px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-2); font-size: var(--fs-sm); margin: 3px 0 0; }
.page-head__actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent); font-weight: 700; margin: 0 0 4px;
}
.scope-note {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--info-bg); color: var(--info);
  font-size: var(--fs-xs); padding: 4px 10px; border-radius: 999px; font-weight: 600;
}

/* --------------------------------------------------------------- 4. layout */
.grid { display: grid; gap: 16px; }
/* Grid and flex children default to min-width:auto, which lets a wide table push
   the whole page sideways instead of scrolling inside its wrapper. */
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.between { justify-content: space-between; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.right { text-align: right; }

/* ---------------------------------------------------------------- 5. cards */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  min-width: 0;
}
.card__head {
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card__head h2, .card__head h3 { margin: 0; font-size: var(--fs-lg); }
.card__head p { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--ink-3); }
.card__head .right { margin-left: auto; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 13px 18px; border-top: 1px solid var(--line-2);
  background: #fbfcfe; border-radius: 0 0 var(--r-lg) var(--r-lg);
  font-size: var(--fs-sm); color: var(--ink-2);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* KPI */
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 16px; box-shadow: var(--sh-1); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand); }
.kpi--accent::before { background: var(--accent); }
.kpi--ok::before { background: var(--ok); }
.kpi--warn::before { background: var(--warn); }
.kpi__label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }
.kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 5px 0 2px; font-variant-numeric: tabular-nums; }
.kpi__meta {
  font-size: var(--fs-xs); color: var(--ink-2); display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; min-height: 22px;
}
.kpi__spark { position: absolute; right: 10px; bottom: 8px; opacity: .5; }

/* ---------------------------------------------------------------- 6. tables */
.tablewrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
table.tbl thead th {
  background: #f7f9fc; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-2); font-weight: 700; white-space: nowrap;
  position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line);
}
table.tbl tbody tr:hover { background: #fafbfe; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl tfoot td { font-weight: 700; background: #f7f9fc; border-top: 2px solid var(--line); }
table.tbl .cell-main { font-weight: 600; }
table.tbl .cell-sub { font-size: var(--fs-xs); color: var(--ink-3); }
.tbl--compact th, .tbl--compact td { padding: 8px 11px; }

.toolbar {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--line-2); background: #fdfdff;
}
.toolbar .search { flex: 1 1 240px; min-width: 180px; position: relative; }
.toolbar .search input { width: 100%; padding-left: 34px; }
.toolbar .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 16px; height: 16px; }

/* --------------------------------------------------------------- 7. controls */
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="tel"], select, textarea {
  font: inherit; font-size: var(--fs-sm); color: var(--ink);
  background: #fff; border: 1px solid #cdd6e2; border-radius: var(--r-sm);
  padding: 8px 11px; width: 100%; max-width: 100%;
}
select { cursor: pointer; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); outline: 2px solid #cddff8; outline-offset: 0; }
textarea { min-height: 92px; resize: vertical; }
label.fl { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.hint { font-size: var(--fs-xs); color: var(--ink-3); margin: 5px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: var(--fs-sm); font-weight: 600;
  padding: 9px 15px; border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; background: var(--brand); color: #fff; white-space: nowrap;
}
.btn:hover { background: var(--brand-700); text-decoration: none; }
.btn--ghost { background: #fff; color: var(--ink); border-color: #cdd6e2; }
.btn--ghost:hover { background: #f6f8fc; }
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: #b62525; }
.btn--danger { background: #fff; color: var(--danger); border-color: #eec3bf; }
.btn--danger:hover { background: var(--danger-bg); }
.btn--sm { padding: 6px 11px; font-size: var(--fs-xs); }
.btn--block { width: 100%; }
.btn--facebook { background: #1877f2; }
.btn--facebook:hover { background: #0f65d6; }
.btn--google { background: #fff; color: #3c4043; border-color: #d5dae2; }
.btn--google:hover { background: #f6f8fc; }
.btn--lg { padding: 12px 20px; font-size: var(--fs); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--fs-sm); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px; height: 24px; border-radius: 99px; background: #c9d2e0;
  position: relative; transition: background .18s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: var(--sh-1);
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--brand-600); outline-offset: 2px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 11px 14px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabpanel[hidden] { display: none; }

/* --------------------------------------------------------------- 8. badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; border-radius: 999px;
  padding: 3px 9px; line-height: 1.5; white-space: nowrap;
}
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge--brand { background: var(--brand-50); color: var(--brand); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-block; font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--r-sm);
  background: #f0f3f8; color: var(--ink-2); border: 1px solid var(--line);
}

/* alert row */
.alert {
  display: flex; gap: 11px; padding: 11px 13px; border-radius: var(--r);
  border: 1px solid var(--line); background: #fff; align-items: flex-start;
}
.alert__icon {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.alert--danger { border-color: #f2cfcc; background: #fffafa; }
.alert--danger .alert__icon { background: var(--danger-bg); color: var(--danger); }
.alert--warn { border-color: #f0e0c2; background: #fffdf8; }
.alert--warn .alert__icon { background: var(--warn-bg); color: var(--warn); }
.alert--info .alert__icon { background: var(--info-bg); color: var(--info); }
.alert b { display: block; font-size: var(--fs-sm); }
.alert p { margin: 1px 0 0; font-size: var(--fs-xs); color: var(--ink-2); }

/* progress */
.bar { height: 7px; border-radius: 99px; background: #e8edf5; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar--ok > span { background: var(--ok); }
.bar--warn > span { background: var(--warn); }
.bar--danger > span { background: var(--accent); }

/* list rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--line-2);
}
.rows li:last-child { border-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .grow b { display: block; font-size: var(--fs-sm); }
.rows .grow span { font-size: var(--fs-xs); color: var(--ink-3); }

/* definition rows */
.dl { display: grid; grid-template-columns: minmax(140px, 42%) 1fr; gap: 0; font-size: var(--fs-sm); }
.dl dt { padding: 9px 0; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.dl dd { padding: 9px 0; margin: 0; border-bottom: 1px solid var(--line-2); font-weight: 500; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

/* avatar + who */
.person { display: flex; align-items: center; gap: 10px; }
.person__meta { line-height: 1.25; min-width: 0; }
.person__meta b { display: block; font-size: var(--fs-sm); }
.person__meta span { font-size: var(--fs-xs); color: var(--ink-3); }

/* attendance calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; max-width: 460px; }
.cal__d {
  aspect-ratio: 1; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.cal__d--P { background: var(--ok-bg); color: var(--ok); border-color: #cbe8db; }
.cal__d--A { background: var(--danger-bg); color: var(--danger); border-color: #f2cfcc; }
.cal__d--L { background: var(--info-bg); color: var(--info); border-color: #cfe0f8; }
.cal__d--S { background: var(--warn-bg); color: var(--warn); border-color: #f0e0c2; }
.cal__d--H { background: #f3eafd; color: #5b2aa5; border-color: #e3d5f7; }
.cal__d--O { background: #eef1f5; color: var(--ink-3); }
.cal__d--empty { background: transparent; border-color: transparent; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-2); }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* month grid (attendance register) */
.attgrid { border-collapse: separate; border-spacing: 2px; font-size: 11px; }
.attgrid th { font-size: 10px; color: var(--ink-3); font-weight: 700; text-align: center; padding: 2px; }
.attgrid td { width: 22px; height: 22px; text-align: center; border-radius: 4px; font-weight: 700; }
.attgrid td.c-P { background: var(--ok-bg); color: var(--ok); }
.attgrid td.c-A { background: var(--danger-bg); color: var(--danger); }
.attgrid td.c-L { background: var(--info-bg); color: var(--info); }
.attgrid td.c-S { background: var(--warn-bg); color: var(--warn); }
.attgrid td.c-H { background: #f3eafd; color: #5b2aa5; }
.attgrid td.c-O { background: #eef1f5; color: var(--ink-3); }
.attgrid .who { text-align: left; white-space: nowrap; padding-right: 10px; font-size: var(--fs-xs); }
.attgrid tbody tr:hover { background: #fafbfe; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--line); margin-left: 7px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; border: 3px solid var(--brand);
}
.timeline li.done::before { border-color: var(--ok); background: var(--ok); }
.timeline b { display: block; font-size: var(--fs-sm); }
.timeline span { font-size: var(--fs-xs); color: var(--ink-3); }

/* modal */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 16px 16px; background: rgba(10, 22, 44, .5);
  overflow-y: auto;
}
.modal__box {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3);
  width: 100%; max-width: 620px;
}
.modal__head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.modal__head h2 { margin: 0; font-size: var(--fs-h3); }
.modal__head .x { margin-left: auto; background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-3); }
.modal__body { padding: 20px; max-height: 66vh; overflow-y: auto; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; background: #fbfcfe; border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* toast */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r);
  box-shadow: var(--sh-3); font-size: var(--fs-sm); max-width: 340px;
}
.toast[hidden] { display: none; }

/* empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty svg { opacity: .35; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); font-size: var(--fs); }

/* login */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
}
.login__art {
  background: linear-gradient(150deg, var(--brand-900), var(--brand) 55%, var(--brand-600));
  color: #fff; padding: 46px; display: flex; flex-direction: column; gap: 22px; position: relative;
  overflow: hidden;
}
.login__art::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 380px; height: 380px; border-radius: 50%;
  border: 60px solid rgba(255, 255, 255, .07);
}
.login__brand { display: flex; align-items: center; gap: 12px; }
.login__brand img { width: 42px; height: 42px; background: #fff; border-radius: 10px; padding: 4px; }
.login__brand b { font-size: 17px; display: block; line-height: 1.2; }
.login__brand span { font-size: 11px; color: #b9cdee; text-transform: uppercase; letter-spacing: .09em; }
.login__art h1 { font-size: 32px; margin-top: auto; max-width: 420px; }
.login__art p { color: #cfe0f8; max-width: 430px; }
.login__points { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.login__points li { display: flex; gap: 9px; align-items: flex-start; font-size: var(--fs-sm); color: #dbe7f9; }
.login__points svg { flex: none; margin-top: 2px; color: #8fd3ac; }
.login__panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login__form { width: 100%; max-width: 400px; }
.login__form h2 { font-size: 24px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: var(--fs-xs); margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.socials { display: grid; gap: 10px; }
.demo-roles { border: 1px dashed #cdd6e2; border-radius: var(--r); padding: 12px; background: #fbfcfe; }
.demo-roles b { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.demo-roles ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
.demo-roles li { display: flex; gap: 8px; align-items: center; }
.demo-roles code { font-size: 11.5px; }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login__art { padding: 28px; order: 2; }
  .login__art h1 { font-size: 24px; margin-top: 12px; }
  .login__art::after { display: none; }
}

/* ------------------------------------------------------------- 9. charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .gridline { stroke: var(--line-2); stroke-width: 1; }
.chart text { font-size: 12px; fill: var(--ink-2); font-family: var(--font); }
.chart .bar { fill: var(--brand); }
.chart .bar--accent { fill: var(--accent); }
.chart .bar--muted { fill: #b9c6da; }
.chart .label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.donut__track { stroke: #e8edf5; }
.legend-list { display: grid; gap: 7px; font-size: var(--fs-sm); }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-list .v { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* permissions matrix */
.matrix { font-size: var(--fs-xs); }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; font-weight: 600; }
.matrix thead th { background: #f7f9fc; position: sticky; top: 0; }
.matrix .yes { color: var(--ok); font-weight: 700; }
.matrix .no { color: #c3ccda; }
.matrix .part { color: var(--warn); font-weight: 700; font-size: 11px; }

/* ------------------------------------------------------- 10. responsive */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--sh-3);
  }
  .sidebar.is-open { transform: none; }
  .topbar__menu { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(10, 22, 44, .45); z-index: 35; }
  .scrim[hidden] { display: none; }
  .who__text { display: none; }
}
@media (max-width: 720px) {
  .content { padding: 16px; }
  .topbar { padding: 0 14px; gap: 10px; }
  /* Not enough room for a breadcrumb, the role switcher, notifications and the
     user block on a phone — the active role is already shown in the sidebar. */
  .breadcrumb { display: none; }
  .roleswitch select { max-width: 132px; }
  .roleswitch label { display: none; }
  .samplebar { padding: 8px 14px; align-items: flex-start; }
  .page-head__actions { margin-left: 0; width: 100%; }
  .kpi__value { font-size: 22px; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { padding-bottom: 0; border-bottom: 0; }
  .dl dd { padding-top: 2px; }
}
@media print {
  .sidebar, .topbar, .samplebar, .page-head__actions, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
