/* =====================================================================
   SysMon in the ATS Engine marketing-site style (17 October 2026)
   =====================================================================
   Loaded after assets/style.css on every page that uses the shared
   shell. It only restates tokens and dresses the shared components, so
   every page picks it up without its own markup changing:

     - light by default, the site's paper (#f4f7fb) and navy ink
     - the site's navy rail for the sidebar
     - cards as the site draws them: 20px corners, a faint tint of the
       card's colour, a coloured top edge, colours cycling blue / green /
       purple / orange along a row
     - no stretched empty space: a card is as tall as what is in it
     - the dark divider band and the "back to the menu" link from the
       site, for pages split into sections (see admin_layout_band())

   Dark mode still works: every tint is mixed into --paper-raised rather
   than into white, so the same rules read correctly in both modes.
   ===================================================================== */

:root[data-theme='light'] {
  --brand-font-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --brand-font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --brand-font-data: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --brand-ink: #0b1a30;
  --brand-neutral: #5b6b82;
  --brand-border: #dde6f1;
  --brand-primary: #2563eb;
  --brand-success: #16a34a;
  --brand-warning: #ea580c;
  --brand-danger: #e11d48;
  --brand-secondary: #7c3aed;
  --paper: #f4f7fb;

  --brand-sidebar: #0b1a30;
  --brand-sidebar-accent: #3b82f6;
}

:root {
  --sk-blue: #2563eb;
  --sk-green: #16a34a;
  --sk-purple: #7c3aed;
  --sk-orange: #ea580c;
  --sk-rose: #e11d48;
  --sk-navy: #0b1a30;
  --radius: 18px;
}
:root:not([data-theme='light']) {
  --sk-blue: #60a5fa;
  --sk-green: #4ade80;
  --sk-purple: #a78bfa;
  --sk-orange: #fb923c;
  --sk-rose: #fb7185;
}

/* ---- headings in the site's display face ---------------------------- */
.pageheader h1 { font-weight: 800; letter-spacing: -0.02em; }
.card h2, .card-head h2 { font-weight: 800; letter-spacing: -0.01em; }

/* ---- the page: tighter, so cards sit closer ------------------------- */
.content { gap: var(--space-5); padding: var(--space-6) var(--space-8) var(--space-8); }
@media (max-width: 900px) { .content { padding: var(--space-5); } }

/* ---- cards ----------------------------------------------------------- */
.card, .tile, .stat-tile {
  --a: var(--sk-blue);
  background: linear-gradient(160deg, color-mix(in srgb, var(--a) 7%, var(--paper-raised)), var(--paper-raised) 60%);
  border: 1px solid color-mix(in srgb, var(--a) 18%, var(--line));
  border-radius: var(--radius);
  box-shadow: inset 0 3px 0 var(--a), 0 12px 28px -24px rgb(15 33 57 / 0.55);
  padding: var(--space-5);
}
/* Colours cycle along a row of cards, like the site's card rows. */
:is(.grid, .two-col, .grid.two, .grid.four) > :is(.card, .tile, .stat-tile):nth-child(4n+2) { --a: var(--sk-green); }
:is(.grid, .two-col, .grid.two, .grid.four) > :is(.card, .tile, .stat-tile):nth-child(4n+3) { --a: var(--sk-purple); }
:is(.grid, .two-col, .grid.two, .grid.four) > :is(.card, .tile, .stat-tile):nth-child(4n+4) { --a: var(--sk-orange); }
.card--green { --a: var(--sk-green) !important; }
.card--purple { --a: var(--sk-purple) !important; }
.card--orange { --a: var(--sk-orange) !important; }
.card--rose { --a: var(--sk-rose) !important; }

/* No stretched empty space: cards in a row are as tall as their own
   content, not as tall as the tallest neighbour. */
.grid, .grid.two, .grid.four, .two-col { align-items: start; gap: var(--space-4); }
.card h2 { margin-bottom: var(--space-3); }
.card > :last-child { margin-bottom: 0; }
.card p { margin: 0 0 var(--space-2); }
.card .notice:last-child, .card p.notice:last-of-type { margin-bottom: 0; }

/* Stat tiles: the number in the card's own colour, label underneath. */
.tile, .stat-tile { padding: var(--space-4) var(--space-5); gap: 2px; }
.tile .value, .stat-tile .value { color: var(--a); font-size: 30px; font-weight: 800; }
.grid > .stat-tile, .grid > .tile { min-height: 0; }

/* ---- sidebar: the site's navy rail ---------------------------------- */
.sidebar { background: var(--sk-navy); border-right: 0; }
.nav-link.active { background: rgb(59 130 246 / 0.16); box-shadow: inset 3px 0 0 #3b82f6; }
.nav-label { font-family: var(--brand-font-data); letter-spacing: 0.14em; }

/* ---- buttons: the site's blue, slightly rounder --------------------- */
.btn { border-radius: 11px; font-weight: 700; }

/* ---- pills inside cards --------------------------------------------- */
.sm-pill {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 4px 10px; border-radius: 999px;
  background: var(--paper-raised); border: 1px solid color-mix(in srgb, var(--a, var(--sk-blue)) 25%, var(--line));
  color: var(--a, var(--sk-blue));
  font: 700 10.5px/1 var(--brand-font-data); letter-spacing: 0.14em; text-transform: uppercase;
}

/* =====================================================================
   PAGE MENU, DARK DIVIDER BANDS AND "BACK TO THE MENU"
   ===================================================================== */
.sm-menu { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.sm-menu a {
  --a: var(--sk-blue);
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text);
  padding: var(--space-4); border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--a) 8%, var(--paper-raised)), var(--paper-raised) 65%);
  border: 1px solid color-mix(in srgb, var(--a) 20%, var(--line));
  transition: transform var(--transition), border-color var(--transition);
}
.sm-menu a:nth-child(4n+2) { --a: var(--sk-green); }
.sm-menu a:nth-child(4n+3) { --a: var(--sk-purple); }
.sm-menu a:nth-child(4n+4) { --a: var(--sk-orange); }
.sm-menu a:hover { transform: translateY(-1px); border-color: var(--a); }
.sm-menu b { font-family: var(--brand-font-display); font-weight: 800; font-size: 15.5px; }
.sm-menu b em { font-style: normal; color: var(--a); }
.sm-menu small { color: var(--text-muted); font-size: 13px; line-height: 1.35; }
.sm-menu .go { margin-top: 4px; font: 600 11px var(--brand-font-data); color: var(--a); letter-spacing: 0.06em; }

.sm-section { display: flex; flex-direction: column; gap: var(--space-4); scroll-margin-top: 96px; }

/* The dark divider: the site's navy band, full width of the content
   column, edge to edge - but with no trial button, this is the CRM. */
.sm-band {
  margin: var(--space-2) calc(var(--space-8) * -1);
  padding: var(--space-5) var(--space-8);
  background: #0b1a30; color: #b9cbe6;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-4);
}
.sm-band b { color: #fff; font-family: var(--brand-font-display); font-weight: 800; font-size: 17px; }
.sm-band span { font-size: 14.5px; }
.sm-band .tag { font: 600 10.5px var(--brand-font-data); letter-spacing: 0.16em; color: #7fa6dd; text-transform: uppercase; width: 100%; }
@media (max-width: 900px) {
  .sm-band { margin-inline: calc(var(--space-5) * -1); padding-inline: var(--space-5); }
}

.content a.up, a.up {
  align-self: flex-start; display: inline-block;
  font: 500 11px var(--brand-font-data); letter-spacing: 0.06em;
  color: var(--text-muted); text-decoration: none;
}
a.up:hover { color: var(--signal); text-decoration: underline; }

/* =====================================================================
   VAT CARD
   ===================================================================== */
.vat--ok { --a: var(--sk-green) !important; }
.vat--warn { --a: var(--sk-orange) !important; }
.vat--bad { --a: var(--sk-rose) !important; }
.vat .sm-card-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.vat h2 { margin: 0; }
.vat h2 b { color: var(--a); }
.vat-line { color: var(--text-muted); font-size: 14.5px; line-height: 1.5; margin: 2px 0 12px; }
.vat-meter { position: relative; height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.vat-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--a) 60%, var(--paper-raised)), var(--a)); }
.vat-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--paper-raised); }
.vat-mark--75 { left: 75%; } .vat-mark--90 { left: 90%; }
.vat-scale { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 7px 0 12px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.vat-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.vat-stat { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--paper-raised); border: 1px solid var(--line); }
.vat-stat small { font-size: 11.5px; color: var(--text-muted); font-weight: 600; line-height: 1.3; }
.vat-stat b { font: 800 18px/1.15 var(--brand-font-display); color: var(--text); }
.vat-stat b small { display: block; font: 600 11.5px/1.3 var(--brand-font-body); color: var(--text-muted); margin-top: 2px; }
.vat-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; height: 64px; margin: 12px 0 4px; align-items: end; }
.vat-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; }
.vat-bar i { display: block; width: 100%; min-height: 2px; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--a) 55%, var(--paper-raised)); }
.vat-bar em { font-style: normal; font-size: 10px; color: var(--text-muted); font-weight: 700; }
.vat-note { margin: 8px 0 0 !important; font-size: 12px; line-height: 1.5; color: var(--text-muted); }

/* The plan colours index.php has always asked for but nothing defined -
   which is why the plan donut drew an empty ring. Built from the
   validated series tokens in style.css. */
:root {
  --level-free: #94a3b8;
  --level-demo: var(--series-1);
  --level-basic: var(--series-2);
  --level-professional: var(--series-3);
  --level-recruiter: var(--series-4);
  --level-administrator: var(--series-5);
}

/* Phone: two small cards a row rather than one tall one. */
@media (max-width: 600px) {
  .sm-menu, .grid:not(.two):not(.four) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-menu small { display: none; }
  .tile .value, .stat-tile .value { font-size: 24px; }
}
.main { overflow-x: clip; }

/* The legacy .section margin stacked on top of .content's gap, leaving a
   double gap between cards on the older pages. The gap alone is enough. */
.content > .section, .content > form > .section { margin-bottom: 0; }

/* Sign-in card in the same style. */
.login-card { border-radius: 20px; box-shadow: inset 0 3px 0 var(--sk-blue), 0 18px 40px -28px rgb(15 33 57 / 0.55); }

/* =====================================================================
   TABLE PAGING (assets/table-pager.js) - 25 rows a page
   ===================================================================== */
tr.pg-off { display: none !important; }
.pg { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: var(--space-3); }
.pg[hidden] { display: none; }
.pg-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pg-btn {
  min-width: 34px; padding: 6px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--paper-raised); color: var(--text);
  font: 600 13px var(--brand-font-body); cursor: pointer;
}
.pg-btn:hover:not([disabled]) { border-color: var(--signal); color: var(--signal); }
.pg-btn.is-on { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.pg-btn[disabled] { opacity: .4; cursor: default; }
.pg-gap { padding: 0 4px; color: var(--text-muted); }
.pg-count { font: 500 12px var(--brand-font-data); color: var(--text-muted); }

/* =====================================================================
   BAR CHARTS THAT DREW NOTHING (fixed 17 Oct 2026)
   - .hbar-fill is a <span>, so it was inline and its width and height
     were ignored: every horizontal bar chart showed empty tracks.
   - The funnel bars asked for var(--green), which was never defined,
     so they were transparent.
   - Long source names (syndicatedsearch.google...) ran into the bar;
     they now cut off with an ellipsis and show in full on hover.
   ===================================================================== */
:root { --green: var(--sk-green); --card-border: var(--line); }
.hbar-fill { display: block; }
.hbar-row { grid-template-columns: minmax(0, 190px) minmax(0, 1fr) auto; }
.hbar-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-val { min-width: 40px; }
@media (max-width: 600px) { .hbar-row { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto; } }
.level-row { grid-template-columns: minmax(0, 240px) minmax(0, 1fr) auto; }
@media (max-width: 700px) { .level-row { grid-template-columns: minmax(0, 130px) minmax(0, 1fr) auto; } }

/* Pills never wrap onto two lines ("Automated likely"). */
.pill, .status-pill, .mkt-badge { white-space: nowrap; }

/* =====================================================================
   EMAIL AUDIENCE (audience.php)
   ===================================================================== */
.aud-points { margin: var(--space-3) 0 0; padding-left: 1.1em; display: grid; gap: 6px; line-height: 1.5; }
.aud-points li::marker { color: var(--a, var(--sk-blue)); }
a.aud-tile { text-decoration: none; }
a.aud-tile:hover { transform: translateY(-1px); border-color: var(--a); }
.aud-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); }
.aud-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-raised); color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; }
.aud-chip span { font: 600 11px var(--brand-font-data); color: var(--text-muted); }
.aud-chip.is-on { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.aud-chip.is-on span { color: inherit; opacity: .8; }
.aud-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.aud-checks li { position: relative; padding-left: 30px; line-height: 1.5; }
.aud-checks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--sk-green) center/12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.aud-checks li.no::before { background-color: var(--sk-rose);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }

/* =====================================================================
   SOCIAL PUBLISHING OVERVIEW (marketing-social.php)
   ===================================================================== */
.soc-steps { margin: var(--space-3) 0 var(--space-2); padding-left: 1.3em; display: grid; gap: 8px; line-height: 1.5; }
.soc-steps li::marker { font-weight: 800; color: var(--a, var(--sk-blue)); }
.soc-steps--setup li { padding-left: 4px; }
.soc-steps--setup li b, .soc-steps--setup li span, .soc-steps--setup li small { display: block; }
.soc-steps--setup li span { color: var(--text-muted); font-size: 14px; }
.soc-steps--setup li small { font: 500 11.5px var(--brand-font-data); color: var(--text-muted); letter-spacing: .03em; }
.soc-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.soc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.soc-head h2 { margin: 0 !important; }
.soc-meta { margin: 6px 0 8px !important; font-size: 13.5px; color: var(--text-muted); }
.soc-meta b { color: var(--text); }
.soc-purpose { font-size: 14px; line-height: 1.5; }
.soc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.soc-chips span { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--a) 10%, var(--paper-raised)); color: var(--a); border: 1px solid color-mix(in srgb, var(--a) 22%, var(--line)); }
.soc-more { margin-top: 8px; font-size: 13.5px; }
.soc-more summary { cursor: pointer; font-weight: 600; color: var(--signal); }
.soc-more p, .soc-more ul { color: var(--text-muted); line-height: 1.5; margin: 6px 0; }

/* Demo users / Organisation 1 cards (index.php #people) */
.house-head h2 b { color: var(--a); margin-left: 4px; }
.house-add { margin-top: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.house-add summary { cursor: pointer; font-weight: 700; color: var(--a); }
.house-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; margin-top: var(--space-3); align-items: end; }
.house-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.house-form input, .house-form select { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--text); font: inherit; font-size: 14px; }
.house-form .btn { grid-column: 1 / -1; justify-self: start; }
