/* ── Fonetic Dashboard CSS ──────────────────────────────────────────────── */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/static/fonts/AtkinsonHyperlegibleNext-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/static/fonts/AtkinsonHyperlegibleNext-Light.otf') format('opentype');
  font-weight: 300; font-style: normal;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/static/fonts/AtkinsonHyperlegibleNext-SemiBold.otf') format('opentype');
  font-weight: 600; font-style: normal;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/static/fonts/AtkinsonHyperlegibleNext-SemiBoldItalic.otf') format('opentype');
  font-weight: 600; font-style: italic;
}

/* Self-hosted subset of Material Icons — only the 13 glyphs this dashboard
   actually uses (memory, hub, article, forum, people, gavel, warning,
   report, event, info, campaign, key, help). Avoids loading the full
   Google-hosted icon font (2,500+ glyphs) for 13 icons, and keeps the
   dashboard free of third-party requests, matching the self-hosted body
   font above. Subsetted from the classic ligature-based MaterialIcons-
   Regular.ttf (google/material-design-icons) via fonttools pyftsubset,
   keeping the 'rlig' feature — Flutter's bundled Material Symbols font is
   NOT a valid source for this: it uses '_baseline'-suffixed ligature names
   instead of bare ones, which silently produces a font with no matching
   ligatures at all if used here. */
@font-face {
  font-family: 'Material Icons';
  /* Bump ?v= whenever this font file's bytes change — this URL has no
     automatic cache-busting like dashboard.css does, so a stale cached
     copy silently keeps serving missing/wrong glyphs after a regeneration
     (this exact confusion cost real debugging time once already tonight). */
  src: url('/static/fonts/MaterialIcons-Subset.woff2?v=2') format('woff2');
  font-weight: 400; font-style: normal;
}
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}

:root {
  --navy:       #3D4F6B;
  --navy-soft:  #5C6D80;
  --steel:      #4A7FA5;
  --steel-light:#6A9AB8;
  --accent:     #E8522A;
  --splash:     #D9E4EC;
  --white:      #FFFFFF;
  --bg:         #F4F7FA;
  --border:     #D0DCE8;
  --red:        #C0392B;
  --green:      #27AE60;
  --yellow:     #E67E22;

  /* Tint backgrounds — light fills paired with the solid colors above, used
     for alerts, badges, event chips, and picker selection states. */
  --tint-success-bg:   #D5F0E0;
  --tint-success-text: #1E6B3C;
  --tint-error-bg:     #FAE0DC;
  --tint-error-text:   #7B1F1F;
  --tint-warning-bg:   #FEF0D9;
  --tint-warning-text: #7A4B00;
  --tint-accent-soft:  #FEF0E8;
  --tint-accent-bg:    #FBE7DE;
  --tint-steel-soft:   #EEF4FA;
  --tint-steel-soft-2: #E6F0F5;
  --tint-steel-soft-3: #E8EFF8;
  --tint-flag-bg:       #FFFBF0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Atkinson Hyperlegible Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--navy);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 200px;
  height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}
.sidebar-logo-icon { height: 28px; width: 28px; object-fit: contain; flex-shrink: 0; display: block; }
.sidebar-logo-name { color: var(--white); font-weight: 600; font-size: 15px; line-height: 1.2; }
.sidebar-logo-sub  { color: var(--steel-light); font-size: 11px; }

.sidebar-org-section {
  padding: 8px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--steel-light);
  margin-bottom: 6px;
}
.sidebar-org-select {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  appearance: auto;
}
.sidebar-org-select option { background: var(--navy); color: var(--white); }
.sidebar-org-select:focus { outline: none; border-color: var(--steel-light); }
.sidebar-org-name { color: var(--white); font-size: 13px; font-weight: 600; }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--splash);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.12s, color 0.12s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.sidebar-link-active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
  border-left-color: var(--accent);
  padding-left: 17px;
}
.sidebar-icon { font-size: 18px; opacity: 0.8; }
.sidebar-link-active .sidebar-icon { opacity: 1; }

/* Sub-items under a Groups/Content/Forum header — identical look to
   .sidebar-link, just indented, so they read as "part of the same list"
   rather than a separate lesser style. */
.sidebar-link-indent { padding-left: 40px; }
.sidebar-link-indent.sidebar-link-active { padding-left: 37px; }

.sidebar-nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 20px; }

.sidebar-bottom {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-signout {
  color: var(--steel-light);
  text-decoration: none;
  font-size: 12px;
}
.sidebar-signout:hover { color: var(--white); }

.nav-role {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}
.role-superuser { background: var(--accent); color: var(--white); }
.role-fonetic   { background: var(--steel); color: var(--white); }
.role-org_user  { background: rgba(255,255,255,0.15); color: var(--splash); }
/* .role-org_user above is tuned for the dark sidebar nav (layout.html) —
   near-invisible on the light table background it's reused on in
   admin_users.html, so give it a readable variant there specifically. */
.table .role-org_user { background: var(--border); color: var(--navy-soft); }

/* ── Main ────────────────────────────────────────────────────────────────── */
.main { padding: 36px 40px; background: var(--bg); min-height: 100vh; }
.main-sidebar { margin-left: 200px; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}
.alert-success { background: var(--tint-success-bg); color: var(--tint-success-text); border-left: 4px solid var(--green); }
.alert-error   { background: var(--tint-error-bg); color: var(--tint-error-text); border-left: 4px solid var(--red); }
.alert-warning { background: var(--tint-warning-bg); color: var(--tint-warning-text); border-left: 4px solid var(--yellow); }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header-left { display: flex; align-items: center; gap: 16px; }
.page-header-right { display: flex; align-items: center; gap: 12px; }
/* Primary page actions (Add, Templates, etc.) — ~15-20% bigger than the
   base .btn size so they read as the main action, not just another button. */
.page-header-right .btn { font-size: 16px; padding: 10px 19px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--navy); }
.page-title-sub { color: var(--navy-soft); font-weight: 400; font-size: 20px; }
.page-subtitle { color: var(--navy-soft); font-size: 16px; margin-top: 4px; margin-bottom: 8px; }
.page-meta { color: var(--navy-soft); font-size: 13px; margin-bottom: 4px; }
.back-link { color: var(--steel); text-decoration: none; font-size: 14px; }
.back-link:hover { text-decoration: underline; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--steel); color: var(--white); }
.btn-ghost   { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-warning { background: var(--yellow); color: var(--white); }
.btn-success { background: var(--green); color: var(--white); }
.btn-danger  { background: var(--red); color: var(--white); }
.btn-full    { width: 100%; justify-content: center; }
.btn-sm      { padding: 4px 10px; font-size: 12px; }
.btn-outline { background: var(--white); color: var(--steel); border: 2px solid var(--steel); }
.btn-outline:hover { background: var(--steel); color: var(--white); }

.btn-copy {
  background: var(--splash);
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--navy);
  font-weight: 500;
  white-space: nowrap;
}
.btn-copy:hover { background: var(--border); }

/* ── Device card grid ────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.device-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: box-shadow 0.15s, border-color 0.15s;
  display: block;
}
.device-card:hover { box-shadow: 0 4px 16px rgba(61,79,107,0.12); border-color: var(--steel-light); }
.device-card--inactive { opacity: 0.6; }
.device-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.device-name { font-size: 16px; font-weight: 600; color: var(--navy); }
.device-location { font-size: 13px; color: var(--navy-soft); margin-bottom: 4px; }
.device-org { font-size: 12px; color: var(--steel); margin-bottom: 8px; }
.device-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 8px; }
.device-lastseen { font-size: 12px; color: var(--navy-soft); margin-top: 8px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.badge-active   { background: var(--tint-success-bg); color: var(--tint-success-text); }
.badge-inactive { background: var(--tint-error-bg); color: var(--tint-error-text); }
.badge-draft    { background: var(--border); color: var(--navy-soft); }

/* ── Chips ───────────────────────────────────────────────────────────────── */
.chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}
.chip-ov   { background: var(--steel); color: var(--white); }
.chip-hl   { background: var(--navy); color: var(--white); }
.chip-none { background: var(--border); color: var(--navy-soft); }
.chip-warn { background: #FEF3CD; color: #7A4800; }

/* ── Auth status (read-only, org_user view) ──────────────────────────────── */
.auth-status { display: flex; gap: 16px; margin-top: 6px; align-items: center; }
.auth-channel { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--navy-soft); }
.field-hint { margin-top: 8px; font-size: 12px; color: var(--navy-soft); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: 12px;
  padding: 28px;
  border: 1px solid var(--border);
  max-width: 680px;
  margin-bottom: 24px;
}
.field { margin-bottom: 18px; }
.field-indent { margin-left: 28px; margin-top: 8px; }
.field-check { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--navy-soft); margin-bottom: 6px; }
.label-inline { font-size: 14px; font-weight: 600; color: var(--navy); cursor: pointer; }
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--navy);
  background: var(--white);
  transition: border-color 0.15s;
}
.input:focus { outline: none; border-color: var(--steel); }
.checkbox { width: 16px; height: 16px; cursor: pointer; }
.image-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.content-thumb {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin: 10px 0;
  display: block;
}
.hint { font-size: 12px; color: var(--navy-soft); margin-top: 5px; }
.required { color: var(--accent); }
.section-divider {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--navy-soft);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
  margin-top: 4px;
}
.section-divider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
  margin-top: 4px;
}
.section-divider-row .section-divider { border-bottom: none; padding-bottom: 0; margin-bottom: 0; margin-top: 0; }
.muted-link { font-size: 12px; font-weight: 600; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; }
.inline-form .input { flex: 1; }

/* ── Credentials box ─────────────────────────────────────────────────────── */
.cred-box {
  background: var(--navy);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  max-width: 680px;
}
.cred-box-title { font-size: 12px; font-weight: 700; color: var(--splash); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 16px; }
.cred-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.cred-label { font-size: 12px; color: var(--steel-light); min-width: 100px; font-family: monospace; }
.cred-value { font-family: monospace; font-size: 13px; color: var(--white); flex: 1; word-break: break-all; }

/* ── Destructive actions — subtle red edge, no label needed ────────────────── */
.danger-zone {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 680px;
  margin-top: 8px;
}
.danger-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy-soft); padding: 8px 12px; border-bottom: 2px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table tr:last-child td { border-bottom: none; }

/* ── Org section grouping ────────────────────────────────────────────────── */
.org-section { margin-bottom: 32px; }
.org-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--navy-soft);
  padding: 10px 0 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}

/* ── Action cards (create forms, distinct from overview) ─────────────────── */
.action-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--navy-soft);
  margin-bottom: 12px;
}
.action-card {
  background: var(--white);
  border-radius: 12px;
  padding: 28px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  max-width: 680px;
  margin-bottom: 16px;
}

/* ── Misc ────────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--navy-soft); }
.empty-state p { margin-bottom: 20px; font-size: 16px; }
.muted { color: var(--navy-soft); font-size: 12px; }
.select-inline { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--navy); background: var(--white); cursor: pointer; }

/* ── Help article body — larger and full-contrast, this is content people
   actually read and act on, not a caption or a hint. ─────────────────────── */
.help-body { color: var(--navy); font-size: 15px; line-height: 1.7; }
.help-heading {
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.help-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 28px;
}
.help-jump a {
  display: block;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--splash);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.help-jump a:hover { background: var(--steel-light); color: var(--white); }

.help-example {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--steel);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 12px;
}
.help-example-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--steel);
  margin-bottom: 6px;
}
.help-example p.help-body { margin-top: 0; }

.help-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0 20px;
}
@media (max-width: 640px) {
  .help-feature-grid { grid-template-columns: 1fr; }
}
.help-feature {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--steel);
  border-radius: 10px;
  padding: 16px 18px;
}
.help-feature-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.help-feature p {
  font-size: 13.5px;
  color: var(--navy-soft);
  line-height: 1.6;
}

.help-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-soft);
  margin-top: 12px;
}
.help-action a {
  color: var(--steel);
  font-weight: 700;
  text-decoration: none;
}
.help-action a:hover { text-decoration: underline; }

/* ── Event log ───────────────────────────────────────────────────────────── */
.event-log {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 680px;
  margin-bottom: 24px;
}
.event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.event-row:last-child { border-bottom: none; }
.event-type {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  min-width: 90px;
  text-align: center;
}
.event-heartbeat  .event-type { background: var(--tint-success-bg); color: var(--tint-success-text); }
.event-stt_ok     .event-type { background: var(--splash); color: var(--navy); }
.event-stt_error  .event-type { background: var(--tint-error-bg); color: var(--tint-error-text); }
.event-subscribe  .event-type { background: var(--tint-steel-soft-3); color: var(--steel); }
.event-auth_failed .event-type { background: var(--tint-error-bg); color: var(--tint-error-text); }
.event-detail { flex: 1; color: var(--navy-soft); font-family: monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-time   { font-size: 11px; color: var(--navy-soft); white-space: nowrap; }
.empty-hint   { color: var(--navy-soft); font-size: 13px; padding: 16px 0; }

.event-summary { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; max-width: 680px; padding: 8px 0; }
.event-summary-item { font-size: 12px; color: var(--navy-soft); }
.event-summary-item strong { color: var(--navy); }
.event-summary-label { font-size: 11px; color: var(--navy-soft); font-style: italic; }

/* ── Schedule timeline ──────────────────────────────────────────────────── */
.schedule-timeline { display: flex; flex-direction: column; gap: 8px; }
.schedule-row { display: flex; align-items: center; gap: 12px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.schedule-row:last-child { border-bottom: none; }
.schedule-title { flex: 1; color: var(--navy); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-dates { display: flex; gap: 6px; }

/* ── Icon picker ────────────────────────────────────────────────────────── */
.icon-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.icon-pick {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--navy-soft);
}
.icon-pick:hover { border-color: var(--steel); color: var(--navy); }
.icon-pick-selected { border-color: var(--accent); background: var(--tint-accent-soft); color: var(--accent); }
.icon-pick .material-icons { font-size: 20px; }

/* ── Log filters ────────────────────────────────────────────────────────── */
.log-filters {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.log-filter-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.log-count { font-size: 12px; color: var(--navy-soft); margin-bottom: 12px; }
.table-link { color: var(--steel); text-decoration: none; }
.table-link:hover { text-decoration: underline; }

/* ── Service summary rows ───────────────────────────────────────────────── */
.svc-summary-list { display: flex; flex-direction: column; gap: 0; }
.svc-summary-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.svc-summary-row:last-child { border-bottom: none; }


/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin: 24px 0 0;
}
.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--navy); }
.tab-active { color: var(--steel); border-bottom-color: var(--steel); }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ── Content types ───────────────────────────────────────────────────────── */
.type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
/* Brand palette, not traffic-light red/yellow/green — severity reads as an
   escalation from calm navy/steel tones up to the brand accent orange
   (matches the disruption/warning/rest sort priority in get_publications_for_group). */
.type-announcement, .type-info, .type-event { background: var(--splash); color: var(--navy); }
.type-warning      { background: var(--tint-accent-bg); color: var(--accent); }
.type-disruption   { background: var(--tint-accent-bg); color: var(--accent); border: 1.5px solid var(--accent); }

/* ── Type picker (radio card grid) ───────────────────────────────────────── */
.type-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.type-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 10px; border: 2px solid var(--border);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
/* Visually hidden but still focusable/tabbable — plain display:none on a
   required radio makes Chrome silently refuse to submit the form (it can't
   focus an invalid control to show the validation bubble), with nothing
   but a console warning to explain why nothing happened. */
.type-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.type-card:has(input:focus-visible) { outline: 2px solid var(--steel); outline-offset: 2px; }
.type-card:hover { border-color: var(--steel-light); }
.type-card--selected { border-color: var(--steel); background: var(--tint-steel-soft); }
.type-card-icon { font-size: 22px; color: var(--navy-soft); }
.type-card--selected .type-card-icon { color: var(--steel); }
.type-card-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.type-card-hint  { font-size: 11px; color: var(--navy-soft); line-height: 1.3; }
.type-card--warning.type-card--selected   { border-color: var(--accent); background: var(--tint-accent-bg); }
.type-card--warning.type-card--selected .type-card-icon { color: var(--accent); }
.type-card--disruption.type-card--selected { border-color: var(--accent); border-width: 3px; background: var(--tint-accent-bg); }
.type-card--disruption.type-card--selected .type-card-icon { color: var(--accent); }
.type-card--event.type-card--selected { border-color: var(--steel); background: var(--tint-steel-soft-2); }
.type-card--event.type-card--selected .type-card-icon { color: var(--steel); }

/* ── Group chip picker (checkbox multi-select) ───────────────────────────── */
.group-chip-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.group-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; border: 2px solid var(--border);
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy-soft);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.group-chip input[type="checkbox"] { display: none; }
.group-chip:hover { border-color: var(--steel-light); color: var(--navy); }
.group-chip:has(input:checked) {
  border-color: var(--steel); background: var(--steel); color: var(--white);
}

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--splash); }
.login-card { background: var(--white); border-radius: 16px; padding: 40px; width: 380px; box-shadow: 0 8px 32px rgba(61,79,107,0.15); }
.login-header { text-align: center; margin-bottom: 28px; }
.login-logo { width: 56px; height: 56px; background: var(--accent); border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: var(--white); margin-bottom: 12px; }
.login-title { font-size: 20px; font-weight: 700; color: var(--navy); }
