/* ============================================================
   Grayedify — Shared Design System
   A professional SaaS component library used across all
   three niche application concepts.
   ============================================================ */

:root {
  /* Brand accent — overridden per app via [data-accent] */
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-strong: #4338ca;

  /* Neutrals */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --border: #e6e8ef;
  --border-strong: #d3d7e3;

  /* Text */
  --text: #101322;
  --text-2: #4a5069;
  --text-3: #838aa3;

  /* Status */
  --green: #12a150;
  --green-soft: #e6f7ee;
  --amber: #c47f04;
  --amber-soft: #fdf4e3;
  --red: #d1293d;
  --red-soft: #fdeaec;
  --blue: #1666d6;
  --blue-soft: #e7f0fd;
  --purple: #7c3aed;
  --purple-soft: #f2ebfe;
  --slate: #64748b;
  --slate-soft: #f1f5f9;

  /* Shape */
  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(16, 19, 34, .06);
  --shadow: 0 4px 16px rgba(16, 19, 34, .07);
  --shadow-lg: 0 18px 50px rgba(16, 19, 34, .14);

  --sidebar-w: 256px;
  --topbar-h: 64px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0f1222;
  color: #c7cbe0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 18px;
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent);
}
.brand .name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand .tag { font-size: 11px; color: #7b81a3; margin-top: 1px; }

.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b7095;
  padding: 16px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: #c7cbe0;
  font-weight: 500;
  font-size: 13.5px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: color-mix(in srgb, var(--accent) 90%, #000 10%);
  color: #fff;
}
.nav-item.active svg { opacity: 1; }
.nav-item .count {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .avatar { width: 32px; height: 32px; }
.sidebar-footer .u-name { color: #fff; font-size: 13px; font-weight: 600; }
.sidebar-footer .u-role { color: #7b81a3; font-size: 11px; }

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

.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 18px; }
.topbar .crumb { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.topbar .spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--text-3);
  min-width: 240px;
}
.search input { border: none; background: transparent; outline: none; font-size: 13px; width: 100%; color: var(--text); }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--text-2);
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; border: 2px solid var(--surface); }

.content { padding: 26px 28px 48px; }

/* ---------- View switching ---------- */
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Typography helpers ---------- */
.page-title { font-size: 22px; margin-bottom: 2px; }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-bottom: 22px; max-width: 720px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--slate-soft); }
.btn.sm { padding: 6px 11px; font-size: 12px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14.5px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 820px)  { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

/* ---------- Stat / KPI cards ---------- */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .ico {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong);
}
.stat .ico svg { width: 19px; height: 19px; }
.stat .label { color: var(--text-2); font-size: 12.5px; font-weight: 500; margin-top: 14px; }
.stat .value { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat .delta { font-size: 12px; font-weight: 600; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--text-3); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  background: var(--slate-soft); color: var(--slate);
  white-space: nowrap;
}
.badge .dt { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red   { background: var(--red-soft);   color: var(--red); }
.badge.blue  { background: var(--blue-soft);  color: var(--blue); }
.badge.purple{ background: var(--purple-soft);color: var(--purple); }
.badge.accent{ background: var(--accent-soft);color: var(--accent-strong); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); font-weight: 600;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }
.table td .strong { color: var(--text); font-weight: 600; }
.table .id { font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 600; }

/* ---------- Progress ---------- */
.bar { height: 8px; background: var(--slate-soft); border-radius: 20px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 20px; background: var(--accent); }
.bar.green > span { background: var(--green); }
.bar.amber > span { background: var(--amber); }
.bar.red > span { background: var(--red); }
.bar.thin { height: 6px; }

/* ---------- Avatars ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  flex: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font-weight: 700; font-size: 13px; }
.kcol-head .n { margin-left: auto; color: var(--text-3); font-weight: 600; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 13px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.kcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.kcard .kc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kcard .kc-title { font-weight: 600; color: var(--text); font-size: 13.5px; margin-bottom: 4px; }
.kcard .kc-meta { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 11.5px; margin-top: 10px; }
.kcard .kc-meta .spacer { flex: 1; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.tl-item.done::before { background: var(--green); border-color: var(--green); }
.tl-item.active::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-item .tl-title { font-weight: 600; color: var(--text); font-size: 13.5px; }
.tl-item .tl-time { color: var(--text-3); font-size: 11.5px; }

/* ---------- Charts ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.chart-bars .cb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bars .cb .stack { width: 100%; max-width: 34px; border-radius: 6px 6px 0 0; background: var(--accent); position: relative; transition: height .4s; }
.chart-bars .cb .stack.two { background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
.chart-bars .cb .lbl { font-size: 11px; color: var(--text-3); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend .li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; }

.donut { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; }
.donut .hole { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.donut .hole .big { font-size: 22px; font-weight: 800; }
.donut .hole .sm { font-size: 11px; color: var(--text-3); }

/* ---------- Alerts / callouts ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface);
}
.alert .ai { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.alert .ai svg { width: 17px; height: 17px; }
.alert .at { font-weight: 600; color: var(--text); font-size: 13.5px; }
.alert .ad { color: var(--text-2); font-size: 12.5px; margin-top: 1px; }
.alert.red { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert.red .ai { background: #fff; color: var(--red); }
.alert.amber { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.alert.amber .ai { background: #fff; color: var(--amber); }
.alert.blue { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.alert.blue .ai { background: #fff; color: var(--blue); }
.alert.green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert.green .ai { background: #fff; color: var(--green); }

/* ---------- Problem → Solution ribbon ---------- */
.ps {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.ps .cell .h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 5px; }
.ps .cell.prob .h { color: var(--red); }
.ps .cell.sol .h { color: var(--green); }
.ps .cell p { margin: 0; font-size: 12.5px; color: var(--text-2); }
.ps .arrow { display: grid; place-items: center; color: var(--accent); }
.ps .arrow svg { width: 26px; height: 26px; }
@media (max-width: 820px) { .ps { grid-template-columns: 1fr; } .ps .arrow { transform: rotate(90deg); } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--text-3);
  border: none; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--text-2);
}
.chip.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-strong); }
.chip svg { width: 15px; height: 15px; }

/* ---------- List row ---------- */
.lrow { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.lrow:last-child { border-bottom: none; }
.lrow .spacer { flex: 1; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.flex1 { flex: 1; }
.right { margin-left: auto; }
.gap-lg { gap: 18px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   AI LAYER — shared visual language for AI-powered features.
   Distinct gradient identity so "AI" reads instantly, without
   feeling like a bolted-on chatbot.
   ============================================================ */
:root {
  --ai-1: #7c3aed; --ai-2: #4f46e5; --ai-3: #0ea5e9;
  --ai-grad: linear-gradient(120deg, #7c3aed, #4f46e5 55%, #0ea5e9);
  --ai-soft: #f3f1fe;
  --ai-ink: #5b3bd6;
}

/* AI badges / chips */
.badge.ai, .chip.ai { background: var(--ai-soft); color: var(--ai-ink); border-color: transparent; }
.chip.ai.active { background: var(--ai-soft); color: var(--ai-ink); border-color: color-mix(in srgb, var(--ai-2) 40%, transparent); }
.badge.ai-solid { color: #fff; background: var(--ai-grad); }

/* Sparkle helper */
.spark { display: inline-grid; place-items: center; }
.spark svg { width: 16px; height: 16px; }

/* AI card — gradient border to separate from normal cards */
.ai-card {
  border: 1px solid transparent;
  border-radius: var(--r);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--ai-grad) border-box;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ai-card .ai-head {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--ai-soft), transparent);
}
.ai-card .ai-head .ai-ico {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; background: var(--ai-grad); flex: none;
}
.ai-card .ai-head .ai-ico svg { width: 18px; height: 18px; }
.ai-card .ai-head h3 { font-size: 14.5px; }
.ai-card .ai-head .sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.ai-card .ai-head .pill {
  margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  padding: 4px 10px; border-radius: 20px; color: #fff; background: var(--ai-grad);
  display: inline-flex; align-items: center; gap: 5px; text-transform: uppercase;
}
.ai-card .ai-body { padding: 18px; }

/* AI insight rows */
.insight { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.insight:last-child { border-bottom: none; padding-bottom: 0; }
.insight .ii { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--ai-soft); color: var(--ai-ink); }
.insight .ii svg { width: 17px; height: 17px; }
.insight .ii.red { background: var(--red-soft); color: var(--red); }
.insight .ii.amber { background: var(--amber-soft); color: var(--amber); }
.insight .ii.green { background: var(--green-soft); color: var(--green); }
.insight .it { font-weight: 600; color: var(--text); font-size: 13.5px; }
.insight .idc { color: var(--text-2); font-size: 12.5px; margin-top: 2px; line-height: 1.5; }
.insight .iact { margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* AI button */
.btn.ai { background: var(--ai-grad); border: none; color: #fff; box-shadow: 0 3px 10px rgba(79, 70, 229, .3); }
.btn.ai:hover { filter: brightness(1.06); }

/* Confidence meter */
.conf { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.conf .bar { width: 84px; height: 6px; }
.conf .bar > span { background: var(--ai-grad); }

/* Pain -> AI -> Workflow -> Benefit flow */
.aiflow { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 22px; }
.aiflow .st { padding: 16px 16px; border-right: 1px solid var(--border); background: var(--surface); }
.aiflow .st:last-child { border-right: none; }
.aiflow .st .k { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.aiflow .st .k svg { width: 14px; height: 14px; }
.aiflow .st.pain .k { color: var(--red); }
.aiflow .st.aistep .k { color: var(--ai-ink); }
.aiflow .st.flow .k { color: var(--blue); }
.aiflow .st.benefit .k { color: var(--green); }
.aiflow .st p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.aiflow .st.aistep { background: linear-gradient(180deg, var(--ai-soft), var(--surface)); }
@media (max-width: 900px) { .aiflow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .aiflow { grid-template-columns: 1fr; } .aiflow .st { border-right: none; border-bottom: 1px solid var(--border); } }

/* AI prompt / copilot input bar */
.ai-prompt {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--ai-grad) border-box;
}
.ai-prompt .sk { color: var(--ai-ink); flex: none; }
.ai-prompt input { flex: 1; border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--text); }
.ai-prompt input::placeholder { color: var(--text-3); }

/* Suggestion chips (AI proposed actions) */
.suggests { display: flex; gap: 8px; flex-wrap: wrap; }
.suggest {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 20px;
  background: var(--ai-soft); color: var(--ai-ink); font-size: 12.5px; font-weight: 600; border: 1px solid transparent;
}
.suggest:hover { border-color: color-mix(in srgb, var(--ai-2) 35%, transparent); }
.suggest svg { width: 14px; height: 14px; }

/* Doc extraction: field mapping row */
.xrow { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.xrow:last-child { border-bottom: none; }
.xrow .xk { font-size: 12px; color: var(--text-3); font-weight: 600; }
.xrow .xv { font-size: 13px; color: var(--text); font-weight: 600; }

/* AI nav item accent */
.nav-item.ai-nav svg { color: #b9a7f7; opacity: 1; }
.nav-item.ai-nav .count { background: var(--ai-grad); }

/* ============================================================
   RESPONSIVE — tablet & mobile (app shell)
   ============================================================ */
.menu-btn {
  display: none;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface);
  place-items: center; color: var(--text-2); flex: none;
}
.menu-btn:hover { background: var(--surface-2); }
.nav-backdrop { display: none; }

@media (max-width: 1024px) {
  .search { min-width: 160px; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 268px; height: 100vh; z-index: 70;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.2,.7,.2,1);
  }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 22px 60px rgba(0,0,0,.45); }
  .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(16,19,34,.5);
    opacity: 0; visibility: hidden; transition: opacity .26s;
  }
  .app.nav-open .nav-backdrop { opacity: 1; visibility: visible; }

  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar h1 { font-size: 16px; }
  .topbar .crumb { display: none; }
  .search { display: none; }
  .content { padding: 18px 16px 42px; }

  /* keep wide tables usable — scroll within their card */
  .card, .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 540px; }
}

@media (max-width: 520px) {
  .page-title { font-size: 19px; }
  .page-sub { font-size: 12.5px; }
  .stat .value { font-size: 22px; }
  .xrow { grid-template-columns: 1fr auto; row-gap: 2px; }
  .xrow .xk { grid-column: 1 / -1; }
  .toolbar { gap: 8px; }
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd4e2; border-radius: 20px; border: 2px solid var(--bg); }
.sidebar::-webkit-scrollbar-thumb { background: #2a2f4a; border-color: #0f1222; }
