/* Demo dashboards: a static copy of the app shell (platform/src/app/styles.css) filled with
   sample data. No inline styles anywhere: the site CSP has no 'unsafe-inline'. */
:root {
  --ground: #f7f6f2;
  --surface: #ffffff;
  --ink: #171a1f;
  --ink-2: #3a4350;
  --muted: #5b6470;
  --line: #e3e1da;
  --accent: #0f8b8d;
  --accent-hover: #0b6a6c;
  --accent-soft: #e2f1f1;
  --ok: #0f7b4f;
  --ok-soft: #e1f3ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --crit: #b42318;
  --crit-soft: #fde8e6;
  --info: #3f51b5;
  --info-soft: #e8eaf8;
  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #15181d;
    --surface: #1f232a;
    --ink: #f3f2ee;
    --ink-2: #c9ced6;
    --muted: #9aa3ae;
    --line: #343941;
    --accent-hover: #13a5a8;
    --accent-soft: #163a3b;
    --ok: #4cc38a;
    --ok-soft: #173326;
    --warn: #f0b45a;
    --warn-soft: #3a2c14;
    --crit: #f97066;
    --crit-soft: #3d1c1a;
    --info: #9aa6f5;
    --info-soft: #23284a;
    color-scheme: dark;
  }
  .mark-lobe { stroke: #f3f2ee; }
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15px/1.5 var(--font-body); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- demo bar ---------- */
.demo-bar { position: sticky; top: 0; z-index: 10; background: var(--ink); color: var(--ground); font-size: 14px; }
.demo-bar .in { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 20px; }
.demo-bar b { font-family: var(--font-head); font-weight: 600; }
.demo-bar a { color: inherit; }
.demo-bar .links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.demo-bar .go { background: var(--accent); color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.demo-bar .go:hover { background: var(--accent-hover); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 42px); }
.sidebar { border-right: 1px solid var(--line); background: var(--surface); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; }
.lockup { display: flex; align-items: center; gap: 9px; padding: 0 8px; color: inherit; text-decoration: none; }
.lockup span { display: flex; flex-direction: column; gap: 3px; }
.lockup b { font-family: var(--font-head); font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: -0.02em; }
.lockup small { font-size: 7.5px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink); font: 500 15px var(--font-body); background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.side-nav button:hover { background: var(--ground); }
.side-nav button[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.side-nav .count { font-size: 12px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; font-size: 13px; color: var(--muted); padding: 0 8px; display: flex; flex-direction: column; gap: 2px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.content { padding: 28px; display: flex; flex-direction: column; gap: 22px; max-width: 1180px; width: 100%; }
.view { display: flex; flex-direction: column; gap: 22px; }
.view[hidden] { display: none; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head > div { display: flex; flex-direction: column; gap: 4px; }
.page-head > .legend { flex-direction: row; gap: 6px; }

/* ---------- building blocks ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.cols > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.kpi .v { font-family: var(--font-head); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 13px; color: var(--muted); }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--crit); font-weight: 600; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--ground); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill-crit { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.pill-info { background: var(--info-soft); color: var(--info); border-color: transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px var(--font-body); padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* rows: a generic list item */
.rows { display: flex; flex-direction: column; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.row .time { flex: none; width: 64px; font-weight: 600; font-variant-numeric: tabular-nums; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--font-head); background: var(--accent-soft); color: var(--accent); }
.ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ground); border: 1px solid var(--line); font-size: 16px; }

/* approval queue */
.approve { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--ground); }
.approve .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.approve .draft { font-size: 14px; color: var(--ink-2); border-left: 3px solid var(--accent); padding-left: 10px; }
.approve .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.approve.done { opacity: .72; }
.approve.done .actions { display: none; }

/* ask the brain */
.ask { display: flex; flex-direction: column; gap: 10px; }
.bubble { border-radius: 12px; padding: 10px 13px; font-size: 14px; max-width: 92%; }
.bubble.q { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.a { align-self: flex-start; background: var(--ground); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.a .src { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.ask-input { display: flex; gap: 8px; }
.ask-input input { flex: 1; min-width: 0; font: 500 15px var(--font-body); padding: 9px 12px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 6px 8px 6px 0; white-space: nowrap; }
td { padding: 9px 8px 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td .sub { display: block; font-size: 12.5px; color: var(--muted); }

/* bars: widths come from .w-N classes, never inline styles */
.bar { height: 8px; border-radius: 99px; background: var(--ground); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.warn i { background: var(--warn); }
.bar.crit i { background: var(--crit); }
.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}
.h-10{height:10%}.h-20{height:20%}.h-30{height:30%}.h-40{height:40%}.h-50{height:50%}.h-55{height:55%}.h-60{height:60%}.h-65{height:65%}.h-70{height:70%}.h-75{height:75%}.h-80{height:80%}.h-85{height:85%}.h-90{height:90%}.h-95{height:95%}.h-100{height:100%}

/* column chart */
.cchart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; height: 150px; padding-top: 8px; }
.cchart .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; font-size: 12px; color: var(--muted); }
.cchart .col i { display: block; width: 100%; max-width: 38px; background: var(--accent); border-radius: 6px 6px 2px 2px; }
.cchart .col.now i { background: var(--ink-2); }
.cchart .col b { font-weight: 600; color: var(--ink); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* kanban */
.board { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: start; }
.lane { background: var(--ground); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lane-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; }
.lane-head span { color: var(--muted); font-weight: 500; font-size: 13px; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.ticket b { font-weight: 600; }
.ticket .meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

/* week calendar */
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.day { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day h3 { font-size: 13px; color: var(--muted); font-family: var(--font-body); font-weight: 600; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.day h3.today { color: var(--accent); }
.slot { border-radius: 8px; padding: 7px 9px; font-size: 13px; background: var(--accent-soft); border-left: 3px solid var(--accent); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.slot b { font-weight: 600; overflow-wrap: anywhere; }
.slot span { color: var(--muted); font-size: 12px; }
.slot.alt { background: var(--info-soft); border-left-color: var(--info); }
.slot.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.slot.open { background: transparent; border: 1px dashed var(--line); border-left: 3px dashed var(--line); color: var(--muted); }

/* sms / message preview */
.sms { background: var(--ground); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 9px 12px; font-size: 14px; color: var(--ink-2); }
.sms.out { border-radius: 12px 12px 4px 12px; background: var(--accent-soft); border-color: transparent; }
.thread { display: flex; flex-direction: column; gap: 6px; }
.thread .sms.out { align-self: flex-end; max-width: 88%; }
.thread .sms.in { align-self: flex-start; max-width: 88%; }

/* social post */
.post { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--ground); }
.post .img { height: 110px; border-radius: 8px; background: linear-gradient(135deg, var(--accent-soft), var(--info-soft)); display: grid; place-items: center; font: 600 15px var(--font-head); color: var(--ink-2); text-align: center; padding: 12px; }
.post p { font-size: 14px; color: var(--ink-2); }

/* toggles (notification rules) */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.toggle:first-child { border-top: 0; padding-top: 0; }
.toggle > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch { flex: none; width: 40px; height: 23px; border-radius: 99px; border: 0; background: var(--line); position: relative; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(17px); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.notice { border-radius: 10px; padding: 12px 14px; background: var(--accent-soft); font-size: 14px; }
.foot-cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px dashed var(--accent); border-radius: 14px; padding: 18px; }

@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .week { grid-template-columns: repeat(5, minmax(150px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .side-nav button { width: auto; white-space: nowrap; padding: 7px 11px; }
  .sidebar-foot { display: none; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .content { padding-top: 20px; }
  .demo-bar .in { padding: 8px 16px; }
  .kpi .v { font-size: 22px; }
}
