/* Zero Trust Tracker — Grafana Edition */
/* ---------- Design tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #111217;
  --card: #1f2128;
  --text: #CCCCDC;
  --muted: rgba(204,204,220,.55);
  --border: rgba(204,204,220,.09);
  --shadow: 0 1px 3px rgba(0,0,0,.5), 0 4px 24px rgba(0,0,0,.28);

  --primary: #3871DC;
  --primary2: #6B9EFF;
  --accent: #FF780A;
  --success: #388E3C;
  --warning: #F9A825;
  --danger: #D32F2F;

  --ns: #546E7A;
  --ip: #F9A825;
  --cp: #388E3C;

  --topbar: #0B0C0F;
  --radius: 3px;
  --radius2: 4px;
}

[data-theme="light"] {
  --bg: #F2F3F8;
  --card: #FFFFFF;
  --text: #1B1C25;
  --muted: #767890;
  --border: rgba(30,30,55,.10);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);

  --ns: #78909C;
  --ip: #F9A825;
  --cp: #388E3C;
  --success: #388E3C;
  --topbar: #1B1C25;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  height: 48px;
  background: var(--topbar);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand {
  display: flex; gap: 8px; align-items: center;
  color: #fff; font-weight: 700; font-size: .95rem; letter-spacing: .2px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }

.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.btn {
  appearance: none; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.85);
  padding: 5px 10px; border-radius: var(--radius);
  font-size: .8rem; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background .12s, border-color .12s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); text-decoration: none; }
.btn:active { background: rgba(255,255,255,.08); }
.btn.danger { border-color: rgba(211,47,47,.4); background: rgba(211,47,47,.12); }
.btn.danger:hover { background: rgba(211,47,47,.22); }
.btn.link { cursor: pointer; }

.footer {
  padding: 12px 16px; color: var(--muted); text-align: center; font-size: .8rem;
  border-top: 1px solid var(--border);
}

/* ---------- Hero / page header ---------- */
.hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius2);
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid; gap: 14px;
}
.hero h1 { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: -.1px; }
.hero p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.6; }

/* ---------- Dashboard layout ---------- */
.dashboard { display: grid; grid-template-columns: 1.35fr .9fr; gap: 12px; align-items: stretch; }
@media (max-width: 980px) { .dashboard { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius2); box-shadow: var(--shadow);
  padding: 14px; transition: border-color .15s, box-shadow .15s; cursor: pointer;
}
.card:hover { border-color: rgba(204,204,220,.22); box-shadow: 0 2px 8px rgba(0,0,0,.5), 0 8px 32px rgba(0,0,0,.3); }
.card.soft { cursor: default; }
.card.soft:hover { border-color: var(--border); box-shadow: var(--shadow); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.grid > :last-child:nth-child(3n+1) { grid-column: 2; }

/* ---------- Stats row ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr; } }

.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 14px; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
}
.stat .left { display: grid; gap: 2px; }
.stat .label { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; }
.stat .value { font-weight: 700; font-size: 1.25rem; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Badge / pill ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: var(--radius);
  font-weight: 600; font-size: .78rem; border: 1px solid var(--border);
  background: rgba(204,204,220,.06);
}
.badge.code { font-variant-numeric: tabular-nums; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* ---------- Toolbar / filters ---------- */
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px 12px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius2); box-shadow: var(--shadow);
}

.input, .select {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px; background: var(--bg); color: var(--text);
  min-width: 220px; outline: none; font-size: .85rem; font-family: inherit;
}
.input:focus, .select:focus {
  border-color: rgba(56,113,220,.6);
  box-shadow: 0 0 0 2px rgba(56,113,220,.18);
}
.select { min-width: 160px; }
select option, select optgroup { background: var(--card); color: var(--text); }
.toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; font-size: .85rem; }
.toggle input { width: 14px; height: 14px; accent-color: var(--accent); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  color: var(--muted); font-size: .82rem; margin: 8px 0 12px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { opacity: .5; }

/* ---------- Progress bar ---------- */
.progress { width: 100%; height: 5px; background: rgba(204,204,220,.08); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; border-radius: 999px; transition: width .35s ease; }
.progress .bar.low { background: linear-gradient(90deg, var(--primary), var(--primary2)); }
.progress .bar.mid { background: linear-gradient(90deg, var(--warning), #FDD835); }
.progress .bar.high { background: linear-gradient(90deg, var(--success), #66BB6A); }

/* ---------- Donut chart ---------- */
.donut { width: 56px; height: 56px; display: inline-block; }
.donut text { font-weight: 700; font-size: 11px; fill: var(--text); font-family: 'Inter', sans-serif; }
.donut .track { stroke: rgba(204,204,220,.1); }
.donut .value { stroke-linecap: butt; }

/* ---------- Stack bar ---------- */
.stack { height: 5px; width: 100%; border-radius: 999px; overflow: hidden; display: flex; background: rgba(204,204,220,.06); }
.stack .ns { background: var(--ns); }
.stack .ip { background: var(--ip); }
.stack .cp { background: var(--cp); }
.stack .bl { background: var(--danger); }

/* ---------- Pillar cards ---------- */
.pillar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pillar-meta { display: grid; gap: 4px; }
.pillar-title { margin: 6px 0 2px; font-size: 1rem; font-weight: 700; letter-spacing: -.1px; }
.kpi-counts { margin-top: 6px; font-size: .82rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: rgba(204,204,220,.05); font-weight: 600; font-size: .75rem; cursor: pointer;
}
.chip:hover { background: rgba(204,204,220,.12); border-color: rgba(204,204,220,.2); }

.star { color: var(--accent); font-weight: 700; }

/* ---------- Table ---------- */
.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius2); overflow: hidden; box-shadow: var(--shadow);
}
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th {
  font-size: .72rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .7px;
  background: rgba(204,204,220,.04);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(204,204,220,.04); cursor: pointer; }

/* ---------- Note textarea ---------- */
.note {
  width: 100%; min-height: 80px; resize: vertical; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius2);
  font-family: ui-monospace, 'Cascadia Code', monospace; font-size: .83rem;
  background: var(--bg); color: var(--text);
}
.note:focus { outline: none; border-color: rgba(56,113,220,.55); box-shadow: 0 0 0 2px rgba(56,113,220,.15); }

/* ---------- KPI cards ---------- */
.kpi-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--ns);
  border-radius: var(--radius2); padding: 12px; display: grid; gap: 8px;
}
.kpi-card.status-not-started { border-left-color: var(--ns); }
.kpi-card.status-in-progress { border-left-color: var(--ip); }
.kpi-card.status-complete    { border-left-color: var(--cp); }
.kpi-card.status-blocked     { border-left-color: var(--danger); }
.kpi-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.kpi-id {
  display: inline-flex; align-items: center; padding: 2px 7px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: rgba(204,204,220,.06); font-weight: 600; font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Segment control ---------- */
.segment {
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: rgba(204,204,220,.04);
}
.segment button {
  border: none; background: transparent; color: var(--muted);
  padding: 5px 10px; cursor: pointer; font-weight: 600; font-size: .75rem; font-family: inherit;
}
.segment button + button { border-left: 1px solid var(--border); }
.segment button:hover { background: rgba(204,204,220,.07); }
.segment button.active { color: var(--text); }
.segment button.active.ns { background: rgba(204,204,220,.13); }
.segment button.active.ip { background: rgba(249,168,37,.18); }
.segment button.active.cp { background: rgba(56,142,60,.14); }
.segment button.active.bl { background: rgba(211,47,47,.18); color: var(--danger); }

/* ---------- Quote / callout ---------- */
.quote {
  border-left: 3px solid var(--accent); margin: 8px 0; padding: 8px 12px;
  background: rgba(255,120,10,.06); border-radius: 0 var(--radius2) var(--radius2) 0;
}
.inline-note { font-size: .82rem; color: var(--muted); }

/* ---------- Legend ---------- */
.legend { margin-top: 12px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .82rem; }
.legend .dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; margin-right: 5px; }
.dot.ns { background: var(--ns); }
.dot.ip { background: var(--ip); }
.dot.cp { background: var(--cp); }
.dot.bl { background: var(--danger); }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: var(--radius);
  border: 1px solid var(--border); background: rgba(204,204,220,.06);
  font-size: .75rem; font-weight: 600; color: var(--muted);
}
.pill.info { background: rgba(56,113,220,.15); color: #7AABFF; border-color: rgba(56,113,220,.3); }
.pill.good { background: rgba(56,142,60,.12); color: var(--success); border-color: rgba(56,142,60,.3); }
.pill.warn { background: rgba(249,168,37,.12); color: var(--warning); border-color: rgba(249,168,37,.3); }
.pill.bad { background: rgba(211,47,47,.12); color: var(--danger); border-color: rgba(211,47,47,.3); }

.hr { height: 1px; background: var(--border); margin: 12px 0; }

/* ---------- Mapping form ---------- */
.form { display: grid; grid-template-columns: repeat(12,1fr); gap: 10px; align-items: start; }
.form .field { grid-column: span 6; display: grid; gap: 5px; }
.form .field.full { grid-column: 1 / -1; }
.label { font-weight: 600; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.help { font-size: .78rem; color: var(--muted); }

.multi { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(204,204,220,.06); font-weight: 600; font-size: .75rem;
}
.tag button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; }

/* ---------- Pillar mini tiles ---------- */
.pillar-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.pillar-mini {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; background: rgba(204,204,220,.03); cursor: pointer;
  transition: background .12s, border-color .12s;
}
.pillar-mini:hover { background: rgba(204,204,220,.08); border-color: rgba(204,204,220,.18); }
.pillar-mini .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pillar-mini .name { font-weight: 600; font-size: .82rem; }
.pillar-mini .pct { font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; }
.pillar-mini .sub { color: var(--muted); font-size: .75rem; margin-top: 2px; }
.pillar-mini .bars { margin-top: 6px; display: grid; gap: 5px; }
.pillar-mini .stack { height: 4px; }
.pillar-mini .progress { height: 4px; }
@media (max-width: 980px) { .pillar-mini-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .pillar-mini-grid { grid-template-columns: 1fr; } }

/* ---------- Readiness bulk editor ---------- */
.readiness-table td { vertical-align: top; }
.readiness-table td:first-child { white-space: nowrap; width: 1%; }
.readiness-table .kpi-text { max-width: 560px; }
.readiness-table .kpi-text .muted { display: block; margin-top: 3px; }
.readiness-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.save-indicator { margin-left: auto; color: var(--muted); font-size: .82rem; }
.readiness-table .tool-col { min-width: 320px; width: 38%; }
.readiness-table .kpi-text  { width: 36%; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; min-height: 4px; }
.tool-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(56,113,220,.10); color: var(--primary2); border: 1px solid rgba(56,113,220,.22); border-radius: var(--radius); padding: 2px 4px 2px 7px; font-size: .75rem; white-space: nowrap; }
.tool-chip.rc-in-production  { background: rgba(8,127,91,.14);   color: #087f5b; border-color: rgba(8,127,91,.30);   }
.tool-chip.rc-being-deployed { background: rgba(12,133,153,.13); color: #0c8599; border-color: rgba(12,133,153,.28); }
.tool-chip.rc-available      { background: rgba(47,158,68,.13);  color: #2f9e44; border-color: rgba(47,158,68,.28);  }
.tool-chip.rc-preview        { background: rgba(240,196,25,.13); color: #b08700; border-color: rgba(240,196,25,.30); }
.tool-chip.rc-planned        { background: rgba(255,138,0,.13);  color: #c96a00; border-color: rgba(255,138,0,.28);  }
.tool-chip.rc-not-available  { background: rgba(224,49,49,.11);  color: #c92a2a; border-color: rgba(224,49,49,.25);  }
.tool-chip.rc-third-party    { background: rgba(130,80,220,.12); color: #7048e8; border-color: rgba(130,80,220,.25); }
.tool-chip.rc-tbd            { background: rgba(100,100,120,.08); color: var(--muted); border-color: rgba(100,100,120,.2); }
.tool-chip-name { font-weight: 500; }
.tool-chip-rdsel { background: transparent; border: none; outline: none; cursor: pointer; color: inherit; font-size: .72rem; padding: 0 2px; max-width: 124px; -webkit-appearance: none; appearance: none; }
.tool-chip-rdsel option { background: var(--card); color: var(--text); }
.tool-chip-rm { background: none; border: none; cursor: pointer; color: inherit; padding: 0 0 1px; line-height: 1; font-size: .9rem; opacity: .55; margin-left: 1px; }
.tool-chip-rm:hover { opacity: 1; }
.rdot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.rdot.tbd           { background: var(--muted); }
.rdot.in-production  { background: #087f5b; }
.rdot.being-deployed { background: #0c8599; }
.rdot.available      { background: var(--success); }
.rdot.preview        { background: var(--warning); }
.rdot.planned        { background: rgba(249,168,37,.55); }
.rdot.not-available  { background: var(--danger); }
.rdot.third-party    { background: var(--primary2); }

/* ---------- Tool Roster ---------- */
.tool-roster-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.section-label { font-weight: 700; font-size: .95rem; color: var(--text); white-space: nowrap; }
.roster-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.roster-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  border: 1px solid transparent; background: var(--card);
  cursor: pointer; font-family: inherit; font-size: .8rem;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s, opacity .12s;
  white-space: nowrap; user-select: none;
}
.roster-pill:hover { box-shadow: 0 1px 6px rgba(0,0,0,.2); }
.roster-pill-label { font-weight: 500; }
.roster-pill-count {
  font-weight: 700; font-size: .8rem;
  background: rgba(0,0,0,.10); border-radius: 999px;
  padding: 1px 7px; min-width: 22px; text-align: center;
}
/* per-status idle → hover → active */
.roster-pill.rc-tbd            { color: var(--muted);  border-color: rgba(150,150,170,.25); }
.roster-pill.rc-tbd:hover      { background: rgba(150,150,170,.12); }
.roster-pill.rc-tbd.active     { background: rgba(150,150,170,.22); border-color: rgba(150,150,170,.5); color: var(--text); }

.roster-pill.rc-in-production  { color: #087f5b; border-color: rgba(8,127,91,.3); }
.roster-pill.rc-in-production:hover  { background: rgba(8,127,91,.1); }
.roster-pill.rc-in-production.active { background: #087f5b; color: #fff; border-color: #087f5b; }

.roster-pill.rc-being-deployed  { color: #0c8599; border-color: rgba(12,133,153,.3); }
.roster-pill.rc-being-deployed:hover  { background: rgba(12,133,153,.1); }
.roster-pill.rc-being-deployed.active { background: #0c8599; color: #fff; border-color: #0c8599; }

.roster-pill.rc-available  { color: #2f9e44; border-color: rgba(47,158,68,.3); }
.roster-pill.rc-available:hover  { background: rgba(47,158,68,.1); }
.roster-pill.rc-available.active { background: #2f9e44; color: #fff; border-color: #2f9e44; }

.roster-pill.rc-preview  { color: #b08700; border-color: rgba(176,135,0,.3); }
.roster-pill.rc-preview:hover  { background: rgba(176,135,0,.1); }
.roster-pill.rc-preview.active { background: #b08700; color: #fff; border-color: #b08700; }

.roster-pill.rc-planned  { color: #c96a00; border-color: rgba(201,106,0,.3); }
.roster-pill.rc-planned:hover  { background: rgba(201,106,0,.1); }
.roster-pill.rc-planned.active { background: #c96a00; color: #fff; border-color: #c96a00; }

.roster-pill.rc-not-available  { color: #c92a2a; border-color: rgba(201,42,42,.3); }
.roster-pill.rc-not-available:hover  { background: rgba(201,42,42,.1); }
.roster-pill.rc-not-available.active { background: #c92a2a; color: #fff; border-color: #c92a2a; }

.roster-pill.rc-third-party  { color: #7048e8; border-color: rgba(112,72,232,.3); }
.roster-pill.rc-third-party:hover  { background: rgba(112,72,232,.1); }
.roster-pill.rc-third-party.active { background: #7048e8; color: #fff; border-color: #7048e8; }
.tool-roster { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tool-card {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 180px; max-width: 240px; flex: 0 1 auto; padding: 9px 11px 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius2); cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.tool-card:hover { border-color: rgba(56,113,220,.45); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.tool-card.tc-in-production  { border-left: 3px solid #087f5b; }
.tool-card.tc-being-deployed { border-left: 3px solid #0c8599; }
.tool-card.tc-available      { border-left: 3px solid #2f9e44; }
.tool-card.tc-preview        { border-left: 3px solid #e8c000; }
.tool-card.tc-planned        { border-left: 3px solid #e07800; }
.tool-card.tc-not-available  { border-left: 3px solid #c92a2a; }
.tool-card.tc-third-party    { border-left: 3px solid #7048e8; }
.tool-card.tc-tbd            { border-left: 3px solid rgba(100,100,120,.3); }
.tool-card.tc-dim            { opacity: .3; filter: grayscale(.4); }
.tool-card-top { display: flex; align-items: flex-start; gap: 6px; }
.tool-card-name { font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.tool-card-bottom { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.tool-card-count { font-size: .7rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.tool-card-meta { font-size: .7rem; color: var(--muted); }
.tool-card-rdsel {
  flex: 1; font-size: .72rem; padding: 2px 4px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; outline: none; min-width: 0;
}
.tool-card-rdsel:focus { border-color: rgba(56,113,220,.5); }

/* ---------- Admin page ---------- */
.adm-tab-active { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px; border-bottom: 2px solid var(--border); text-align: left; white-space: nowrap; }
.adm-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.adm-table tr:last-child > td { border-bottom: none; }
.adm-table tbody tr:hover > td { background: rgba(204,204,220,.04); }
.adm-form-row td, .adm-form-row:hover td { background: var(--card) !important; }
.adm-id { font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.adm-text { max-width: 320px; font-size: .85rem; }
.adm-actions { white-space: nowrap; }
.adm-actions .btn { padding: 3px 9px; font-size: .78rem; margin-right: 4px; }
.adm-form-card { border: 1px solid var(--border); border-radius: var(--radius2); background: var(--card); padding: 4px; margin-bottom: 12px; }
.adm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.adm-form-wide { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .adm-form-grid { grid-template-columns: 1fr; } }
.adm-rpt-grid { display: flex; flex-direction: column; gap: 14px; }
.adm-rpt-card { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius2); padding: 18px; background: var(--card); }
.adm-rpt-icon { font-size: 1.8rem; flex-shrink: 0; width: 40px; text-align: center; margin-top: 2px; }
.adm-rpt-body { flex: 1; min-width: 0; }
.adm-rpt-title { font-weight: 700; font-size: .95rem; margin-bottom: 5px; }
.adm-rpt-desc { font-size: .82rem; color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
.adm-rpt-list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; }
.adm-rpt-list li { font-size: .77rem; color: var(--muted); }
.adm-rpt-list li::before { content: '✓ '; color: var(--success); font-weight: 700; }
.adm-rpt-action { flex-shrink: 0; display: flex; align-items: center; }
@media (max-width: 640px) { .adm-rpt-card { flex-direction: column; } .adm-rpt-action { width: 100%; } .adm-rpt-btn { width: 100%; } }
.adm-how { border: 1px solid var(--border); border-radius: var(--radius2); margin-bottom: 16px; background: var(--card); }
.adm-how summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: .88rem; list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; }
.adm-how summary::before { content: '▶'; font-size: .65rem; color: var(--muted); transition: transform .15s; }
.adm-how[open] summary::before { transform: rotate(90deg); }
.adm-how summary::-webkit-details-marker { display: none; }
.adm-how-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0 16px 16px; }
.adm-how-head { font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 8px; }
.adm-how-col ol, .adm-how-col ul { margin: 0; padding-left: 18px; }
.adm-how-col li { font-size: .84rem; color: var(--text); line-height: 1.6; margin-bottom: 4px; }
.adm-how-col code { background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-size: .82rem; }
@media (max-width: 800px) { .adm-how-body { grid-template-columns: 1fr; } }

/* ---------- Landing page ---------- */
.landing-hero {
  text-align: center;
  padding: 56px 0 44px;
}
.landing-hero-icon { font-size: 3rem; line-height: 1; margin-bottom: 12px; }
.landing-hero-title {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}
.landing-hero-sub { margin: 0; color: var(--muted); font-size: 1rem; }

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
}
.landing-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.landing-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 32px rgba(56,113,220,.18);
  text-decoration: none;
  color: var(--text);
}
.landing-card-icon { font-size: 2.4rem; line-height: 1; }
.landing-card-title { font-size: 1.2rem; font-weight: 700; }
.landing-card-desc { color: var(--muted); font-size: .88rem; line-height: 1.65; flex: 1; }
.landing-card-cta { color: var(--primary2); font-size: .83rem; font-weight: 600; margin-top: 4px; }

/* ---------- Blocked callout ---------- */
.blocked-callout {
  background: rgba(211,47,47,.07);
  border: 1px solid rgba(211,47,47,.3);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius2);
  padding: 14px 16px;
  margin-top: 14px;
}
.blocked-callout-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: .88rem;
}
.blocked-callout-icon { color: var(--danger); font-size: 1rem; }
.blocked-callout-hint { margin-left: auto; color: var(--muted); font-size: .78rem; }
.blocked-callout-rows { display: flex; flex-direction: column; gap: 5px; }
.blocked-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: .84rem;
  transition: border-color .12s;
}
.blocked-row:hover { border-color: var(--danger); text-decoration: none; color: var(--text); }
.blocked-row-name { flex: 1; }
.blocked-row-count {
  font-size: .76rem;
  font-weight: 700;
  color: var(--danger);
  white-space: nowrap;
}
/* ---------- Backup tab ---------- */
.adm-backup-how {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 18px 20px;
  margin-bottom: 16px;
  font-size: .85rem;
  line-height: 1.6;
}
.adm-backup-how p { margin: 0 0 14px; color: var(--muted); }
.adm-backup-how ol { margin: 0; padding-left: 18px; color: var(--muted); }
.adm-backup-how li { margin-bottom: 4px; }
.adm-backup-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius2);
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.adm-backup-status.ok   { background: rgba(56,142,60,.12);  color: var(--success); border: 1px solid rgba(56,142,60,.25); }
.adm-backup-status.warn { background: rgba(249,168,37,.10); color: var(--warning); border: 1px solid rgba(249,168,37,.25); }
.adm-backup-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Reference pages (Inventories / Policies) ---------- */
.ref-header {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.ref-header-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.ref-back { font-size: .8rem; padding: 4px 8px; flex-shrink: 0; margin-top: 4px; }
.ref-header h1 { margin: 0 0 4px; font-size: 1.4rem; }
.ref-header p  { margin: 0; color: var(--muted); font-size: .85rem; }

.ref-sections { display: flex; flex-direction: column; gap: 32px; padding-bottom: 48px; }

.ref-pillar-section {}

.ref-pillar-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ref-pillar-code {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  background: rgba(59,130,246,.15);
  color: var(--primary2);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.ref-pillar-name { font-weight: 700; font-size: .98rem; flex: 1; }
.ref-pillar-count { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.ref-count-critical { color: var(--danger); font-weight: 600; }

.ref-item-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
}

.ref-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color .12s;
}
.ref-item:hover { border-color: rgba(59,130,246,.35); }

.ref-item-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.ref-item-name {
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.35;
  flex: 1;
}

.ref-priority {
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
  margin-top: 2px;
}
.ref-pri-critical { background: rgba(211,47,47,.12);  color: #f87171; border-color: rgba(211,47,47,.3); }
.ref-pri-high     { background: rgba(249,168,37,.10); color: #fbbf24; border-color: rgba(249,168,37,.3); }
.ref-pri-medium   { background: rgba(56,113,220,.10); color: var(--primary2); border-color: rgba(56,113,220,.25); }

.ref-item-desc {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
}

.ref-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.ref-item-owner {
  font-size: .75rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.ref-item-id {
  font-size: .7rem;
  color: var(--muted);
  font-family: monospace;
  opacity: .6;
}
.ref-framework-tag {
  font-size: .68rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(204,204,220,.06);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 700px) {
  .ref-item-list { grid-template-columns: 1fr; }
}

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fadeInUp .2s ease both; }
  @keyframes fadeInUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) { .form .field { grid-column: 1 / -1; } }
@media (max-width: 520px) {
  .actions { gap: 4px; }
  .btn { padding: 5px 8px; font-size: .78rem; }
  .input { min-width: 140px; flex: 1; }
  .donut { width: 48px; height: 48px; }
}

/* org context + demo-data banner */
.org-context{max-width:820px;margin:10px auto 16px;padding:10px 14px;border:1px solid var(--border, #2c3238);border-radius:8px;font-size:13px;line-height:1.55;text-align:left;}
.hero .org-context{margin:10px 0 0;}
.org-context p{margin:0;}
.org-context-who{color:var(--text, inherit);}
.org-context-who a{color:inherit;text-decoration:underline;}
.org-context-demo{margin-top:6px !important;font-size:12px;opacity:.8;display:flex;align-items:center;gap:7px;flex-wrap:wrap;}
.org-context-demo b{color:#c6a56a;}
.demo-dot{width:7px;height:7px;border-radius:50%;background:#c6a56a;display:inline-block;}
