/* ============================================================
   Bid Chakra — Demo Prototype
   Shared application styles
   Prepared by Cloud84 for Power Star (discussion prototype)
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Navy / text */
  --navy-900: #0b1729;
  --navy-800: #12203a;
  --navy-700: #1c2e4a;
  --ink: #17263f;
  --ink-soft: #43536b;
  --ink-muted: #7286a0;

  /* Surfaces */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #f9fbfe;
  --line: #e3e9f2;
  --line-strong: #cfd8e6;

  /* Brand / action */
  --blue-600: #1b64d9;
  --blue-700: #1450b0;
  --blue-100: #e8f0fe;
  --blue-50: #f2f7ff;

  /* Semantic */
  --green-600: #1a8f5b;
  --green-100: #e3f6ec;
  --amber-600: #b5730b;
  --amber-100: #fdf2dc;
  --red-600: #c33a34;
  --red-100: #fdeceb;
  --violet-600: #6b4bd6;
  --violet-100: #f0ebfd;
  --slate-600: #5a6b85;
  --slate-100: #eef2f8;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 33, 61, .06);
  --shadow: 0 2px 8px rgba(15, 33, 61, .08);
  --shadow-lg: 0 12px 32px rgba(15, 33, 61, .16);

  --sidebar-w: 244px;
  --topbar-h: 62px;

  --font: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; color: var(--navy-900); line-height: 1.25; }
p { margin: 0 0 8px; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
[hidden] { display: none !important; }
[x-cloak] { display: none !important; }

/* ---------- App layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--navy-900);
  color: #cfd9e8;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(140deg, #2f7bf0, #1b4fd9);
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 15px;
  flex: 0 0 auto;
  box-shadow: 0 3px 10px rgba(27,100,217,.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: #fff; font-size: 15px; letter-spacing: .2px; }
.brand-text span { font-size: 10.5px; color: #8ea3c0; letter-spacing: .5px; text-transform: uppercase; }

.sidebar__nav { padding: 10px 10px 20px; flex: 1; }
.nav-section {
  font-size: 10px; letter-spacing: .9px; text-transform: uppercase;
  color: #6f86a6; padding: 14px 10px 6px; font-weight: 700;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #c3d0e2; font-weight: 500; font-size: 13.5px;
  text-decoration: none;
  transition: background .13s, color .13s;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-link.is-active { background: var(--blue-600); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(27,100,217,.35); }
.nav-link__icon { width: 18px; text-align: center; font-size: 15px; flex: 0 0 auto; }
.nav-link__badge {
  margin-left: auto; background: var(--red-600); color: #fff;
  font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 6px;
}
.nav-link.is-active .nav-link__badge { background: rgba(255,255,255,.25); }

.sidebar__footer {
  padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 10.5px; color: #7d92b0; line-height: 1.45;
}

/* Main column */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.topbar__burger {
  display: none;
  background: none; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); width: 36px; height: 34px;
  font-size: 17px; color: var(--navy-800);
}
.topbar__titles { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.topbar__titles h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__titles span { font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__spacer { flex: 0 1 auto; }
.topbar__search {
  position: relative;
  flex: 0 1 260px;
  min-width: 130px;
}
.topbar__search input {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1px solid var(--line-strong); border-radius: 20px;
  background: var(--surface-alt); font-size: 13px; color: var(--ink);
}
.topbar__search input:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-600); background: #fff; }
.topbar__search::before {
  content: "\1F50D"; position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%); font-size: 12px; opacity: .55;
}
.period-select {
  padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface-alt);
  font-size: 12.5px; color: var(--ink-soft);
}
.topbar__user {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 6px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--surface-alt);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy-700); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  flex: 0 0 auto;
}
.topbar__user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.topbar__user-meta strong { font-size: 12.5px; }
.topbar__user-meta span { font-size: 10.5px; color: var(--ink-muted); }

.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--amber-100); color: var(--amber-600);
  border: 1px solid #f0dcae;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  padding: 5px 10px; border-radius: 20px; white-space: nowrap;
}
.demo-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber-600); }

/* Content */
.content { padding: 20px 22px 40px; flex: 1; min-width: 0; }

/* Breadcrumbs */
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-muted); margin-bottom: 12px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-soft); }
.crumbs span.sep { opacity: .5; }

/* Page head */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head__text { flex: 1; min-width: 220px; }
.page-head h2 { font-size: 22px; }
.page-head p { color: var(--ink-muted); font-size: 13.5px; margin: 4px 0 0; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards & panels ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card__head h3 { font-size: 14.5px; }
.card__head .sub { font-size: 11.5px; color: var(--ink-muted); }
.card__head .spacer { flex: 1; }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.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--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ---------- KPI cards ---------- */
.kpi {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: transform .13s, box-shadow .13s, border-color .13s;
  overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--blue-600));
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); text-decoration: none; }
.kpi__label { font-size: 11.5px; color: var(--ink-muted); font-weight: 600; letter-spacing: .2px; text-transform: uppercase; }
.kpi__value { font-size: 25px; font-weight: 700; color: var(--navy-900); margin-top: 5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__foot { font-size: 11.5px; color: var(--ink-muted); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.kpi--amber { --accent: var(--amber-600); }
.kpi--red { --accent: var(--red-600); }
.kpi--green { --accent: var(--green-600); }
.kpi--violet { --accent: var(--violet-600); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .1px;
  padding: 3px 9px; border-radius: 20px;
  background: var(--slate-100); color: var(--slate-600);
  border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--green { background: var(--green-100); color: var(--green-600); }
.badge--amber { background: var(--amber-100); color: var(--amber-600); }
.badge--red { background: var(--red-100); color: var(--red-600); }
.badge--blue { background: var(--blue-100); color: var(--blue-700); }
.badge--violet { background: var(--violet-100); color: var(--violet-600); }
.badge--slate { background: var(--slate-100); color: var(--slate-600); }
.badge--outline { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-weight: 600; font-size: 13px;
  text-decoration: none; transition: all .13s; white-space: nowrap;
}
.btn:hover { background: var(--surface-alt); border-color: var(--ink-muted); text-decoration: none; }
.btn--primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn--primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--blue-600); }
.btn--ghost:hover { background: var(--blue-50); }
.btn--danger { color: var(--red-600); border-color: #f0cecc; background: #fff; }
.btn--danger:hover { background: var(--red-100); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 720px;
}
table.data thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ink-muted); font-weight: 700;
  padding: 10px 14px; background: var(--surface-alt);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle; color: var(--ink);
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--blue-50); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .row-title { font-weight: 600; color: var(--navy-900); }
table.data .row-sub { font-size: 11.5px; color: var(--ink-muted); }

/* ---------- Progress ---------- */
.progress { height: 7px; border-radius: 20px; background: var(--slate-100); overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; border-radius: 20px; background: var(--blue-600); transition: width .3s; }
.progress--green > span { background: var(--green-600); }
.progress--amber > span { background: var(--amber-600); }
.progress--red > span { background: var(--red-600); }
.progress-row { display: flex; align-items: center; gap: 9px; }
.progress-row .pct { font-size: 12px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }

/* ---------- Attention panel ---------- */
.attention { border-color: #f0d9b4; }
.attention .card__head { background: #fffaf0; border-bottom-color: #f3e3c8; }
.attention .card__head h3 { color: var(--amber-600); }
.attn-item {
  display: flex; gap: 13px; padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.attn-item:last-child { border-bottom: none; }
.attn-item__sev {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 15px;
  background: var(--amber-100); color: var(--amber-600);
}
.attn-item__sev--high { background: var(--red-100); color: var(--red-600); }
.attn-item__body { flex: 1; min-width: 0; }
.attn-item__title { font-weight: 650; color: var(--navy-900); font-size: 13.5px; }
.attn-item__reason { color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }
.attn-item__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 7px; font-size: 11.5px; color: var(--ink-muted); }
.attn-item__meta b { color: var(--ink-soft); font-weight: 600; }
.attn-item__action { align-self: center; flex: 0 0 auto; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding: 4px 0; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 4px; }
.tl-item__rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; width: 26px; }
.tl-item__node {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--surface); border: 2px solid var(--line-strong);
  color: var(--ink-muted); z-index: 1; flex: 0 0 auto;
}
.tl-item__line { flex: 1; width: 2px; background: var(--line); min-height: 12px; }
.tl-item:last-child .tl-item__line { display: none; }
.tl-item__card {
  flex: 1; min-width: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; margin-bottom: 12px;
  transition: box-shadow .13s, border-color .13s;
}
.tl-item__card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.tl-item__top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tl-item__seq { font-size: 11px; font-weight: 700; color: var(--ink-muted); }
.tl-item__name { font-weight: 650; color: var(--navy-900); font-size: 13.5px; }
.tl-item__meta { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 7px; font-size: 11.5px; color: var(--ink-muted); }
.tl-item__meta b { color: var(--ink-soft); font-weight: 600; }
.tl-item__bar { margin-top: 9px; display: flex; align-items: center; gap: 10px; }

/* Milestone status colours */
.tl--completed .tl-item__node { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.tl--inprogress .tl-item__node { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.tl--awaiting .tl-item__node { background: var(--amber-100); border-color: var(--amber-600); color: var(--amber-600); }
.tl--delayed .tl-item__node, .tl--blocked .tl-item__node { background: var(--red-100); border-color: var(--red-600); color: var(--red-600); }
.tl--skipped .tl-item__node { background: var(--slate-100); border-color: var(--line-strong); color: var(--ink-muted); }
.tl--delayed .tl-item__card { border-color: #f0cecc; background: #fffbfb; }
.tl--blocked .tl-item__card { border-color: #f0cecc; background: #fffbfb; }
.tl--awaiting .tl-item__card { border-color: #f0e0bd; background: #fffdf7; }

/* ---------- Activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed__item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.feed__item:last-child { border-bottom: none; }
.feed__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); margin-top: 7px; flex: 0 0 auto; }
.feed__body { flex: 1; min-width: 0; }
.feed__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed__title { font-weight: 650; color: var(--navy-900); font-size: 13.5px; }
.feed__text { color: var(--ink-soft); font-size: 12.5px; margin-top: 3px; }
.feed__meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 5px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 10px 15px; font-size: 13px; font-weight: 600; color: var(--ink-muted);
  border: none; background: none; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--blue-600); border-bottom-color: var(--blue-600); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type="text"], .filters input[type="search"], .filters input[type="date"], .filters select {
  padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; font-size: 12.5px; color: var(--ink); font-family: inherit;
}
.filters input:focus, .filters select:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-600); }
.chip {
  padding: 6px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
}
.chip:hover { border-color: var(--ink-muted); }
.chip.is-active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kanban__col { flex: 0 0 230px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; }
.kanban__head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 7px; }
.kanban__head h4 { font-size: 12.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; }
.kanban__count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ink-muted); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px; }
.kanban__list { padding: 9px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kanban__card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 11px; box-shadow: var(--shadow-sm);
  display: block; color: inherit; text-decoration: none;
}
.kanban__card:hover { border-color: var(--blue-600); box-shadow: var(--shadow); text-decoration: none; }
.kanban__card strong { display: block; font-size: 12.5px; color: var(--navy-900); line-height: 1.3; }
.kanban__card .mini { font-size: 11px; color: var(--ink-muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.field label .req { color: var(--red-600); }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; color: var(--ink); background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-600); }
.field textarea { resize: vertical; min-height: 74px; }
.field .hint { font-size: 11px; color: var(--ink-muted); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.check-row input { width: auto; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 9px; max-width: 330px;
}
.toast {
  background: var(--navy-900); color: #fff; padding: 11px 14px;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
  border-left: 3px solid var(--blue-600);
  animation: toast-in .2s ease-out;
}
.toast--success { border-left-color: var(--green-600); }
.toast--warn { border-left-color: var(--amber-600); }
.toast small { display: block; color: #9fb2cc; font-size: 11px; margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11,23,41,.5); z-index: 90;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); margin: auto 0;
}
.modal__head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal__head h3 { font-size: 15px; flex: 1; }
.modal__close { background: none; border: none; font-size: 20px; line-height: 1; color: var(--ink-muted); }
.modal__body { padding: 18px; }
.modal__foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }

/* ---------- Summary strip ---------- */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.strip__cell { padding: 12px 14px; border-right: 1px solid var(--line); }
.strip__cell:last-child { border-right: none; }
.strip__cell .lbl { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.strip__cell .val { font-size: 18px; font-weight: 700; color: var(--navy-900); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ---------- Document cards ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.doc-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; background: #fff; }
.doc-card__top { display: flex; align-items: flex-start; gap: 10px; }
.doc-card__icon { width: 34px; height: 34px; border-radius: 8px; background: var(--blue-100); color: var(--blue-700); display: grid; place-items: center; font-size: 15px; flex: 0 0 auto; }
.doc-card__name { font-weight: 650; font-size: 13px; color: var(--navy-900); line-height: 1.3; }
.doc-card__meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }

/* ---------- Bar chart (CSS only) ---------- */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 52px; align-items: center; gap: 11px; font-size: 12.5px; }
.bar-row .lbl { color: var(--ink-soft); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .val { text-align: right; font-weight: 700; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.bar-track { height: 10px; background: var(--slate-100); border-radius: 20px; overflow: hidden; }
.bar-track > span { display: block; height: 100%; border-radius: 20px; background: var(--blue-600); }

/* ---------- Empty / loading states ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-muted); }
.empty__icon { font-size: 30px; opacity: .5; }
.empty h4 { margin: 10px 0 5px; font-size: 15px; color: var(--ink-soft); }
.empty p { font-size: 13px; }
.skeleton { background: linear-gradient(90deg, #eef2f8 25%, #e3e9f2 50%, #eef2f8 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius-sm); height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Demo disclaimer ---------- */
.demo-note {
  margin-top: 26px; padding: 13px 16px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-alt); color: var(--ink-muted); font-size: 12px;
  display: flex; gap: 10px; align-items: flex-start;
}
.demo-note strong { color: var(--ink-soft); }

/* ---------- Utility ---------- */
.muted { color: var(--ink-muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 22px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 14px; } .mb-3 { margin-bottom: 22px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: 8px; } .gap-2 { gap: 14px; }
.wrap { flex-wrap: wrap; } .spacer { flex: 1; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- Search results dropdown ---------- */
.search-results {
  position: absolute; top: 52px; left: 0;
  background: #fff; border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 300px; max-width: 380px; z-index: 60; overflow: hidden;
}
.search-results__group {
  padding: 8px 14px; font-size: 10.5px; letter-spacing: .6px;
  text-transform: uppercase; color: var(--ink-muted); font-weight: 700;
  background: var(--surface-alt); border-bottom: 1px solid var(--line);
}
.search-results__item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 13px;
}
.search-results__item:last-child { border-bottom: none; }
.search-results__item:hover { background: var(--blue-50); text-decoration: none; }
.search-results__item strong { font-weight: 600; }
.search-results__item small { color: var(--ink-muted); font-size: 11px; }

/* Mobile scrim */
.scrim { position: fixed; inset: 0; background: rgba(11,23,41,.45); z-index: 35; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .topbar__burger { display: inline-grid; place-items: center; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar__search { flex-basis: 150px; }
  .content { padding: 16px 14px 34px; }
}
@media (max-width: 700px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar__user-meta { display: none; }
  .topbar__user { padding: 4px; border-radius: 50%; }
  .topbar__user .btn { display: none; }
  .period-select { display: none; }
  .topbar__search { flex: 1 1 auto; min-width: 0; }
  .demo-badge .demo-text { display: none; }
  .page-head h2 { font-size: 19px; }
  .kpi__value { font-size: 22px; }
  table.data { min-width: 0; }
  /* Convert tables to stacked cards on small screens */
  table.data.stack thead { display: none; }
  table.data.stack tbody tr {
    display: block; border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 10px; padding: 4px 0; background: #fff;
  }
  table.data.stack tbody td {
    display: flex; justify-content: space-between; gap: 12px;
    border-bottom: 1px dashed var(--line); padding: 7px 12px;
    text-align: right;
  }
  table.data.stack tbody td:last-child { border-bottom: none; }
  table.data.stack tbody td::before {
    content: attr(data-label);
    font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
    color: var(--ink-muted); font-weight: 700; text-align: left; flex: 0 0 auto;
  }
  table.data.stack tbody td.num { text-align: right; }
  .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

@media print {
  .sidebar, .topbar, .toast-stack { display: none; }
  .main { margin-left: 0; }
}