/* Inlrn notification admin.
   Visual language aligned with the analytics dashboard at
   analytics.dev.inlrn.com (24 Oct 2026): dark canvas, IBM Plex, 6px radii,
   a left sidebar and flat panels. Self-contained apart from the font files. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg-canvas: #12151a;
  --bg-panel: #1a1e25;
  --bg-panel-raised: #232830;
  --bg-input: #1a1e25;
  --border: #2c333d;
  --border-soft: #232830;
  --text-primary: #e9e7e2;
  --text-muted: #8b93a1;
  --text-faint: #565f6d;
  --accent: #5b8cff;
  --accent-dim: #2c3a5e;
  --good: #4fae7d;
  --good-dim: #1c3327;
  --mid: #d9a441;
  --mid-dim: #3a2f18;
  --poor: #e0685f;
  --poor-dim: #3a201d;
  --danger: #e0685f;
  --radius: 6px;
  --font-ui: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-data: 'IBM Plex Mono', ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Names used by the page scripts and by older markup. */
  --bg: var(--bg-canvas);
  --card: var(--bg-panel);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --blue: var(--accent);
  --blue-soft: var(--accent-dim);
  --green: var(--good);
  --amber: var(--mid);
  --navy: #0e1116;
  --sched: var(--accent);
  --ok: var(--good);
  --warn: var(--mid);
  --bad: var(--poor);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }

h1 { font-size: 20px; font-weight: 600; margin: 0; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
h3 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 20px 0 8px;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a.brand:hover, a.nav-item:hover { text-decoration: none; }

.hidden { display: none !important; }
.hint { color: var(--text-muted); font-size: 12.5px; line-height: 1.55; }
.error { color: var(--poor); font-size: 13px; min-height: 18px; }
.success { color: var(--good); font-weight: 600; }
.message { min-height: 20px; font-size: 13px; color: var(--text-muted); }
.message.ok { color: var(--good); }
.message.bad { color: var(--poor); }

/* ── Login ─────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card { width: 100%; max-width: 380px; padding: 32px 28px; }
.login-card .brand-mark {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.login-card h1 { font-size: 20px; margin: 0 0 8px; }
.login-card .sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 20px;
  line-height: 1.55;
}

/* ── App shell and sidebar ─────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar-toggle-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.sidebar-toggle-btn:hover { border-color: var(--text-muted); }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 64px 14px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: margin-left 0.22s ease;
}
.sidebar.collapsed { margin-left: -220px; }

.sidebar .brand {
  display: block;
  font-family: var(--font-data);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 22px;
  padding: 0 6px;
  text-decoration: none;
}
.sidebar .brand span { color: var(--accent); }

.nav-group-label {
  font-size: 11px;
  color: var(--text-faint);
  padding: 0 6px;
  margin: 18px 0 6px;
}
.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2px;
  font-size: 13px;
}
.nav-item:hover { background: var(--bg-panel-raised); color: var(--text-primary); }
.nav-item[aria-current="page"] {
  background: var(--accent-dim);
  color: var(--text-primary);
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px 6px 0;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-foot .badge { align-self: flex-start; }
.sidebar-foot .btn { width: 100%; padding: 7px 10px; font-size: 12px; }
.who { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.who strong { display: block; color: var(--text-primary); font-weight: 500; }

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 24px 28px 60px;
  transition: padding-left 0.22s ease;
}
.main.sidebar-collapsed { padding-left: 70px; }

/* ── Page frame ────────────────────────────────────────────────────────── */
.page {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.main-header, .page-head, .head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.main-header h1, .main-header h2,
.page-head h1, .page-head h2,
.head-row h1, .head-row h2 { font-size: 20px; margin: 0; }
.subhead {
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 0 0 18px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 18px;
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
}
.side { display: flex; flex-direction: column; gap: 18px; }

/* ── Panels and forms ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 15px; margin: 0; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--text-muted); font-weight: 500; }

input, textarea, select {
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 10px;
  width: 100%;
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input[type="file"] { padding: 7px; color: var(--text-muted); }
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  background: var(--bg-panel-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  margin-right: 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover { color: var(--text-primary); }
textarea { resize: vertical; }

.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row > select { flex: 1 1 220px; }
.row > input[type="number"] { width: 130px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid2 .span2 { grid-column: span 2; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 12px 4px 0;
}
.check input { width: auto; margin: 0; }
.check.strong { color: var(--text-primary); font-weight: 500; margin-top: 10px; display: flex; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.divider { height: 1px; background: var(--border-soft); margin: 18px 0; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--text-muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0e1116; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--text-primary); }
.btn.secondary:hover { border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn.ghost:hover { color: var(--text-primary); border-color: var(--border); }
.btn.danger { background: transparent; border-color: var(--poor); color: var(--poor); }
.btn.danger:hover { background: var(--poor-dim); }
.btn.danger.ghost { background: transparent; border-color: transparent; color: var(--poor); }
.btn.wide, .btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Badges and small data blocks ──────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary div {
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 9px 11px;
}
.summary span { display: block; font-size: 11px; color: var(--text-faint); }
.summary strong { font-family: var(--font-data); font-size: 13px; font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stats > p { grid-column: 1 / -1; margin: 0; }
.stat {
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 9px;
  text-align: center;
}
.stat strong { display: block; font-family: var(--font-data); font-size: 17px; font-weight: 600; }
.stat span { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }

.readonly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.readonly-grid div {
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.readonly-grid span { display: block; font-size: 11px; color: var(--text-faint); }
.readonly-grid strong { font-size: 13px; font-weight: 500; }

/* ── Preview phone ─────────────────────────────────────────────────────── */
.phone {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--bg-panel-raised);
  max-width: 360px;
  margin: 0 auto;
}
.phone-img {
  height: 150px;
  border-radius: 4px;
  background: var(--accent-dim);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}
.phone-img img { width: 100%; height: 100%; object-fit: cover; }
.phone-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.phone-body { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.phone-foot { font-size: 10px; color: var(--text-faint); margin-top: 10px; }

/* ── Daily-limit callout ───────────────────────────────────────────────── */
.rule-callout {
  border: 1px solid var(--accent-dim);
  border-left: 3px solid var(--accent);
  background: var(--bg-panel-raised);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin: 12px 0 16px;
}
.rule-callout-title { font-weight: 600; font-size: 14px; color: var(--accent); }
.rule-callout-detail { font-size: 13px; line-height: 1.55; margin-top: 4px; color: var(--text-muted); }
.rule-callout-detail strong { font-family: var(--font-data); font-size: 15px; color: var(--text-primary); }
.rule-callout.warn { border-color: var(--poor); border-left-color: var(--poor); }
.rule-callout.warn .rule-callout-title { color: var(--poor); }

.group-note { margin: 0 0 12px; }
.inline-note { margin-top: 10px; }

.slot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-row { display: flex; align-items: center; gap: 6px; }
.slot-row input { width: 128px; }
.slot-row .btn { padding: 7px 10px; }
.save-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.kill { border-color: var(--poor); }

/* ── Advanced disclosure ───────────────────────────────────────────────── */
details.advanced {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 10px 0;
  background: var(--bg-panel-raised);
}
details.advanced summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
details.advanced[open] summary { margin-bottom: 8px; }

/* ── Tables and campaign status ────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; margin: 0; }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.select-col { width: 36px; }
.select-cell { width: 36px; }
.select-cell input { width: auto; }
.actions-cell { white-space: nowrap; }
.copy-btn { padding: 5px 9px; font-size: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-panel-raised); }
tbody tr.scheduled { background: var(--bg-panel-raised); }
.title-cell { max-width: 300px; }
.title-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { color: var(--text-faint); font-size: 11.5px; }
.due { color: var(--mid); font-weight: 600; }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

.pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.p-scheduled { background: var(--accent-dim); color: var(--accent); }
.p-sending { background: var(--mid-dim); color: var(--mid); }
.p-sent { background: var(--good-dim); color: var(--good); }
.p-cancelled, .p-draft { background: var(--bg-panel-raised); color: var(--text-muted); }
.p-failed { background: var(--poor-dim); color: var(--poor); }

.timing { margin: 12px 0 4px; font-size: 14px; line-height: 1.6; }
.timing b { color: var(--accent); }
.timing ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-muted); }
.timing li { margin: 3px 0; }
.legend { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ── Modal and toast ───────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 13, 0.65);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}
.modal-card { width: min(480px, 100%); background: var(--bg-panel); }
.modal-card h3 { margin-top: 0; font-size: 14px; color: var(--text-primary); letter-spacing: 0; text-transform: none; }
.modal-card p { font-size: 13px; line-height: 1.6; color: var(--text-muted); white-space: pre-line; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(440px, calc(100vw - 40px));
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.toast.ok { border-color: var(--good); }
.toast.bad { border-color: var(--poor); color: var(--poor); }

/* ── Glossary ──────────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 860px; margin: 0 auto; }
.hero { padding: 4px 0 26px; border-bottom: 1px solid var(--border); }
.eyebrow {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.hero h1 {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 10px 0;
  text-wrap: balance;
}
.lede { margin: 0; max-width: 70ch; color: var(--text-muted); font-size: 14.5px; line-height: 1.6; }

.wrap section { padding: 26px 0 6px; border-bottom: 1px solid var(--border-soft); }
.wrap section:last-of-type { border-bottom: 0; }
.wrap section > h2 { font-size: 19px; margin: 0 0 6px; }
.section-note { margin: 0 0 14px; color: var(--text-muted); font-size: 13px; max-width: 70ch; }

.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 18px 0 6px; }
.flow .step {
  flex: 1 1 130px;
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.flow .step b { display: block; font-size: 13px; font-weight: 600; }
.flow .step span { color: var(--text-muted); font-size: 12px; }
.flow .arrow { align-self: center; color: var(--accent); font-weight: 700; flex: 0 0 auto; }
.flow-caption { color: var(--text-muted); font-size: 13px; margin: 8px 0 0; }

dl { margin: 0; }
.term {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 4px 22px;
  padding: 12px 0;
  border-top: 1px dashed var(--border);
}
.term:first-of-type { border-top: 0; }
.term dt { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.term dt small {
  display: block;
  font-weight: 400;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.term dd { margin: 0; color: var(--text-primary); font-size: 13.5px; min-width: 0; }
.term dd p { margin: 0 0 6px; }
.term dd p:last-child { margin-bottom: 0; }
.term dd .aside { color: var(--text-muted); font-size: 12.5px; }

code {
  font-family: var(--font-data);
  font-size: 0.88em;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

.channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 4px; }
.channel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
}
.channel h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.channel p { margin: 0; font-size: 13px; color: var(--text-muted); }
.channel .tag {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-data);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 4px;
  padding: 2px 7px;
}

.wrap .tbl-wrap { margin: 12px 0 0; }
.wrap table { font-size: 13px; }
.status { font-family: var(--font-data); font-size: 11px; font-weight: 500; }
.s-good { color: var(--good); }
.s-warn { color: var(--mid); }
.s-plain { color: var(--text-primary); }

.callout {
  background: var(--bg-panel-raised);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 15px;
  margin: 16px 0;
  font-size: 13.5px;
  color: var(--text-primary);
}
.callout b { color: var(--text-primary); }

.wrap footer { padding-top: 26px; color: var(--text-faint); font-size: 12.5px; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.9fr); }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  }
  .main { padding: 64px 18px 48px; }
  .main.sidebar-collapsed { padding-left: 18px; }
  .page { max-width: none; }
}
@media (max-width: 620px) {
  .grid2 { grid-template-columns: 1fr; }
  .grid2 .span2 { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .readonly-grid { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
  .term { grid-template-columns: 1fr; gap: 2px; }
  .channels { grid-template-columns: 1fr; }
  .flow .step { flex-basis: 100%; }
  .flow .arrow { display: none; }
  .row { flex-wrap: wrap; }
}
