@import url("https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@400;500;600;700;800;900&display=swap");

:root {
  color-scheme: dark;
  --bg: #151515;
  --panel: rgba(31, 31, 31, .86);
  --panel-2: rgba(43, 43, 43, .9);
  --text: #f8fafc;
  --muted: #a7b4c8;
  --line: rgba(148, 163, 184, .24);
  --blue: #38bdf8;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --card-gap: 14px;
  --section-gap: 14px;
  font-family: "Lexend Deca", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  background:
    radial-gradient(circle at 8% 5%, rgba(56, 189, 248, .13), transparent 30rem),
    radial-gradient(circle at 84% 0%, rgba(168, 85, 247, .1), transparent 34rem),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 12, 12, .92), transparent 28rem);
  z-index: -1;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(56, 189, 248, .12), transparent 24rem),
    rgba(12, 12, 12, .72);
  backdrop-filter: blur(10px);
  transition: opacity .22s ease, visibility .22s ease;
}
.page-loader.visible {
  opacity: 1;
  visibility: visible;
}
.loader-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(420px, calc(100vw - 40px));
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(36, 36, 36, .96), rgba(18, 18, 18, .92));
  box-shadow: 0 24px 70px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.06);
  padding: 16px;
  transform: translateY(6px) scale(.98);
  transition: transform .22s ease;
}
.page-loader.visible .loader-card {
  transform: translateY(0) scale(1);
}
.loader-card strong {
  display: block;
  color: #f8fafc;
  font-size: 14px;
  letter-spacing: -.01em;
}
.loader-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 4px 0 0;
}
.loader-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 999px;
  background: rgba(14, 165, 233, .08);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .18);
}
.loader-orbit::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  border: 2px solid rgba(148, 163, 184, .18);
  border-top-color: var(--blue);
  border-right-color: rgba(20, 184, 166, .75);
  animation: loader-spin 1s linear infinite;
}
.loader-orbit span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 18px rgba(56, 189, 248, .8);
  animation: loader-pulse 1.2s ease-in-out infinite;
}
.loader-orbit span:nth-child(1) { left: 21px; top: 3px; }
.loader-orbit span:nth-child(2) { right: 5px; bottom: 12px; animation-delay: .16s; background: #14b8a6; }
.loader-orbit span:nth-child(3) { left: 8px; bottom: 10px; animation-delay: .32s; background: #a855f7; }
.dashboard-view {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.dashboard-view.active-view {
  opacity: 1;
  transform: translateY(0);
}
body.route-loading .dashboard-view.active-view {
  opacity: .38;
  transform: translateY(4px);
}
@keyframes loader-spin {
  to { transform: rotate(360deg); }
}
@keyframes loader-pulse {
  0%, 100% { transform: scale(.72); opacity: .55; }
  50% { transform: scale(1.12); opacity: 1; }
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid rgba(148, 163, 184, .16);
  background: rgba(18, 18, 18, .86);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.brand strong, .brand span { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: 11px; margin-top: 1px; }

.nav { display: grid; gap: 7px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 11px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .7);
}

.nav a:hover, .nav a.active {
  color: #ffffff;
  border-color: rgba(56, 189, 248, .28);
  background: rgba(14, 165, 233, .12);
}

.nav a.active::before {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(56, 189, 248, .14);
}

.sidebar-foot {
  margin-top: auto;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: rgba(35, 35, 35, .78);
}

.sidebar-foot span, .sidebar-foot b { display: block; }
.sidebar-foot span { color: var(--muted); font-size: 12px; }
.sidebar-foot b { margin-top: 4px; color: #dbeafe; font-size: 14px; }

main { width: 100%; max-width: none; margin: 0; padding: 22px 28px 46px; }
.dashboard-view { display: none; }
.dashboard-view.active-view { display: block; }
.hero.dashboard-view.active-view { display: grid; }
.hero, .panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(34, 34, 34, .94), rgba(18, 18, 18, .9));
  box-shadow: 0 14px 42px rgba(0, 0, 0, .26);
}
.hero { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.eyebrow { color: var(--blue); margin: 0 0 6px; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(22px, 1.75vw, 28px); line-height: 1.12; letter-spacing: -.03em; white-space: nowrap; }
h2 { margin-bottom: 0; font-size: 17px; letter-spacing: -.02em; }
.lede { color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 780px; margin-bottom: 0; }
.section-copy { color: var(--muted); font-size: 12px; line-height: 1.45; max-width: 980px; margin: 6px 0 0; }
.hero-actions { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; align-items: center; }
.action-status {
  grid-column: 1 / -1;
  min-height: 0;
  color: #bfdbfe;
  font-size: 12px;
}
.action-status:not(:empty) {
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 10px;
  background: rgba(14, 165, 233, .1);
  padding: 8px 10px;
}
.action-status.error {
  color: #fecaca;
  border-color: rgba(239, 68, 68, .35);
  background: rgba(127, 29, 29, .25);
}
select,
input,
textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 10px;
  background: rgba(18, 18, 18, .58);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  min-height: 36px;
}
textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}
input[type="file"] {
  padding: 7px;
}
button {
  appearance: none;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
}
button.secondary { background: rgba(48, 48, 48, .92); }
button.danger { background: linear-gradient(135deg, #991b1b, #dc2626); }
button.success { background: linear-gradient(135deg, #166534, #16a34a); }
button:disabled { opacity: .55; cursor: wait; }

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
  margin-top: var(--section-gap);
}
.metric { border: 1px solid var(--line); border-radius: 14px; background: rgba(34, 34, 34, .78); padding: 12px; }
.metric span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.metric b { display: block; margin-top: 5px; font-size: 22px; }

.panel { padding: 16px; margin-bottom: var(--section-gap); }
.dashboard-view#sent-history {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: var(--section-gap); }
.import-card {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(520px, 1.25fr);
  gap: var(--card-gap);
  align-items: end;
  margin-top: var(--section-gap);
  padding: 13px;
  border: 1px solid rgba(56, 189, 248, .18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .08), rgba(46, 46, 46, .46));
}
.import-card h3 {
  margin: 0;
  font-size: 15px;
}
.import-controls {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) 90px minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.import-controls label {
  min-width: 0;
}
.import-controls span {
  display: block;
  margin-bottom: 5px;
  color: #93c5fd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(56, 189, 248, .35);
  color: #dbeafe;
  background: rgba(14, 165, 233, .12);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}
.flow-wrap { overflow-x: auto; border-radius: 14px; background: rgba(16,16,16,.52); border: 1px solid rgba(148,163,184,.12); margin-top: var(--section-gap); }
#flowSvg { width: 100%; min-width: 1420px; min-height: 900px; height: auto; display: block; }

.queue, .runs { display: grid; gap: var(--card-gap); }
#approvalQueue.queue { margin-top: var(--section-gap); }
.activity-view {
  background:
    linear-gradient(145deg, rgba(36, 36, 36, .96), rgba(18, 18, 18, .92)),
    radial-gradient(circle at 90% 10%, rgba(56, 189, 248, .12), transparent 26rem);
}
.activity-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
  margin: 0 0 var(--section-gap);
}
.activity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr);
  gap: var(--card-gap);
  align-items: start;
  margin-top: var(--section-gap);
}
.activity-column {
  display: grid;
  gap: var(--card-gap);
  align-content: start;
  min-width: 0;
}
.activity-block {
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(38, 38, 38, .78), rgba(20, 20, 20, .48));
  padding: 13px;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.activity-block.wide { grid-column: 1 / -1; }
.activity-block-head {
  display: flex;
  justify-content: space-between;
  gap: var(--card-gap);
  align-items: baseline;
  margin-bottom: 11px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}
.activity-block h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #e0f2fe;
}
.activity-block h3::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin-right: 8px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .12);
  vertical-align: 1px;
}
.activity-block-head span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-align: right;
}
.pipeline-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
}
.pipeline-card {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(48, 48, 48, .66), rgba(30, 30, 30, .88));
  padding: 12px;
  min-width: 0;
}
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.pipeline-grid span {
  display: block;
  min-width: 0;
  border-left: 2px solid rgba(56, 189, 248, .5);
  border-radius: 8px;
  background: rgba(18, 18, 18, .34);
  color: #dbeafe;
  font-size: 10.5px;
  line-height: 1.35;
  padding: 7px 8px;
  overflow-wrap: anywhere;
}
.pipeline-grid b {
  display: block;
  color: #93c5fd;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.inline-error {
  margin-top: 10px;
  border: 1px solid rgba(239, 68, 68, .35);
  border-radius: 10px;
  background: rgba(127, 29, 29, .22);
  color: #fecaca;
  font-size: 11px;
  line-height: 1.4;
  padding: 8px;
}
.compact-event .item-title {
  font-size: 13px;
}
.item {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(46, 46, 46, .74), rgba(38, 38, 38, .68));
  padding: 10px;
  min-width: 0;
  overflow: hidden;
}
.item-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.item-title { font-size: 13px; font-weight: 800; line-height: 1.28; overflow-wrap: anywhere; }
.item-meta { color: var(--muted); font-size: 11.5px; margin-top: 5px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.item-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.item-actions button { flex: 0 1 auto; }
.recipient-row {
  display: flex;
  align-items: center;
  gap: var(--card-gap);
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(56, 189, 248, .3);
  border-radius: 10px;
  background: rgba(14, 165, 233, .1);
}
.recipient-row span {
  color: #93c5fd;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.recipient-row strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}
.email-preview {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 11px;
  background: rgba(18, 18, 18, .48);
  padding: 10px;
}
.email-preview-label {
  color: #93c5fd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.email-preview-body {
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.email-preview-body a {
  color: #67e8f9;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.email-preview-body a:hover {
  color: #f8fafc;
}
.message-editor {
  margin-top: 10px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 12px;
  background: rgba(12, 31, 36, .45);
  padding: 10px;
}
.message-editor label {
  display: block;
  margin-top: 8px;
}
.message-editor label span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}
.editor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}
.editor-hint {
  color: var(--muted);
  font-size: 11px;
}
.approval-context {
  margin-top: 12px;
  border: 1px solid rgba(20, 184, 166, .24);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(20, 184, 166, .08), rgba(14, 165, 233, .05));
  padding: 11px;
}
.reason-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.reason-row {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  background: rgba(18, 18, 18, .38);
  padding: 8px 9px;
}
.reason-row span {
  display: block;
  margin-bottom: 4px;
  color: #67e8f9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.reason-row strong {
  display: block;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}
.reviewer-qa {
  margin-top: 10px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 10px;
  background: rgba(14, 165, 233, .08);
  padding: 8px 9px;
}
.reviewer-qa b,
.reviewer-qa span {
  display: block;
  font-size: 11px;
  line-height: 1.45;
}
.reviewer-qa b {
  color: #93c5fd;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.reviewer-qa span {
  color: #dbeafe;
}
.link-check {
  display: grid;
  grid-template-columns: minmax(220px, .35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 10px;
  padding: 9px;
}
.link-check b,
.link-check span {
  display: block;
  font-size: 11px;
  line-height: 1.4;
}
.approval-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.approval-link-groups {
  display: grid;
  gap: 10px;
}
.approval-link-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.approval-link-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(56, 189, 248, .34);
  border-radius: 999px;
  background: rgba(14, 165, 233, .12);
  overflow: hidden;
}
.approval-links a {
  color: #bae6fd;
  font-size: 11px;
  line-height: 1;
  padding: 7px 9px;
  text-decoration: none;
}
.approval-link-pill:hover {
  border-color: rgba(103, 232, 249, .72);
}
.approval-links a:hover {
  color: #f8fafc;
}
.link-delete {
  border: 0;
  border-left: 1px solid rgba(56, 189, 248, .22);
  border-radius: 0;
  background: rgba(15, 23, 42, .34);
  color: #fca5a5;
  font-size: 10px;
  line-height: 1;
  padding: 7px 9px;
}
.link-delete:hover {
  background: rgba(127, 29, 29, .32);
  color: #fecaca;
}
.missing-link {
  color: #fecaca;
  font-size: 11px;
}
.cta-add-row {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(260px, 1.35fr) auto;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, .14);
}
.cta-add-row input {
  min-height: 32px;
  padding: 7px 9px;
}
.cta-add-row button {
  min-height: 32px;
  padding: 7px 10px;
}
.delivery-row {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}
.click-report {
  margin-top: 10px;
  border: 1px solid rgba(20, 184, 166, .24);
  border-radius: 10px;
  background: rgba(20, 184, 166, .08);
  padding: 9px 10px;
}
.muted-click-report {
  color: var(--muted);
  font-size: 11px;
}
.click-report-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #ccfbf1;
  font-size: 11px;
}
.click-report-head span {
  color: var(--muted);
}
.click-link-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.click-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(18, 18, 18, .32);
  padding: 7px 8px;
  font-size: 11px;
}
.click-link-row span {
  color: #dbeafe;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.click-link-row strong {
  color: #bbf7d0;
}
.click-link-row small {
  color: var(--muted);
}
.status-pending { border-color: rgba(245, 158, 11, .48); color: #fde68a; background: rgba(245, 158, 11, .12); }
.status-approved { border-color: rgba(34, 197, 94, .48); color: #bbf7d0; background: rgba(34, 197, 94, .12); }
.status-rejected, .status-failed { border-color: rgba(239, 68, 68, .48); color: #fecaca; background: rgba(239, 68, 68, .12); }
.status-completed, .status-success, .status-succeeded { border-color: rgba(34, 197, 94, .48); color: #bbf7d0; background: rgba(34, 197, 94, .12); }
.status-running, .status-claimed, .status-active { border-color: rgba(56, 189, 248, .48); color: #bae6fd; background: rgba(14, 165, 233, .12); }
.status-error, .status-failed { border-color: rgba(239, 68, 68, .48); color: #fecaca; background: rgba(239, 68, 68, .12); }

.about-view {
  background:
    linear-gradient(145deg, rgba(36, 36, 36, .96), rgba(18, 18, 18, .92)),
    radial-gradient(circle at 12% 0%, rgba(20, 184, 166, .12), transparent 26rem);
}
.about-flow,
.about-agents,
.about-rules {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 16px;
  background: rgba(18, 18, 18, .38);
  padding: 13px;
  margin-top: var(--section-gap);
}
.about-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .45fr);
  gap: var(--card-gap);
}
.about-card,
.about-route-card,
.about-agent-card,
.about-rule {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(48, 48, 48, .66), rgba(30, 30, 30, .88));
  padding: 12px;
}
.about-card.primary { border-color: rgba(20, 184, 166, .38); }
.about-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -.02em;
}
.about-card p,
.about-agent-card p {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 0;
}
.about-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.about-stat-row span {
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, .22);
  background: rgba(14, 165, 233, .1);
  padding: 10px;
  color: #bfdbfe;
  font-size: 11px;
  text-align: center;
}
.about-stat-row b {
  display: block;
  color: white;
  font-size: 20px;
  margin-bottom: 2px;
}
.system-chain {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.system-chain span {
  border: 1px solid rgba(20, 184, 166, .36);
  border-radius: 999px;
  background: rgba(20, 184, 166, .1);
  color: #ccfbf1;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 800;
}
.system-chain i {
  color: #93c5fd;
  font-size: 10px;
  font-style: normal;
}
.system-chain i::after {
  content: "→";
  color: var(--blue);
  margin-left: 8px;
}
.system-chain i:last-of-type::after { content: ""; margin-left: 0; }
.about-route-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--card-gap);
}
.about-agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap);
}
.about-agent-card { min-width: 0; }
.about-schedules {
  margin-top: var(--section-gap);
}
.about-schedule-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.schedule-card.compact .schedule-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.schedule-card.compact .item-title {
  font-size: 12px;
}
.schedule-card.compact .item-meta {
  font-size: 10.5px;
}
.about-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.about-detail-grid span {
  display: block;
  border-left: 2px solid rgba(20, 184, 166, .55);
  border-radius: 8px;
  background: rgba(18, 18, 18, .36);
  color: #dbeafe;
  font-size: 10.5px;
  line-height: 1.35;
  padding: 7px 8px;
  overflow-wrap: anywhere;
}
.about-detail-grid b,
.about-list-row b,
.about-data-flow b,
.about-rule b {
  display: block;
  color: #99f6e4;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.about-list-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap);
  margin-top: 10px;
}
.about-list-row div {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  background: rgba(18, 18, 18, .3);
  padding: 9px;
}
.about-list-row ul {
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.45;
  margin: 0;
  padding-left: 16px;
}
.about-data-flow {
  margin-top: 10px;
  border: 1px dashed rgba(56, 189, 248, .3);
  border-radius: 10px;
  padding: 8px;
  color: #bfdbfe;
  font-size: 11px;
}
.about-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}
.about-rule span {
  display: block;
  color: #cbd5e1;
  font-size: 11.5px;
  line-height: 1.45;
}

.table { overflow-x: auto; margin-top: var(--section-gap); }
table { width: 100%; border-collapse: collapse; }
caption { caption-side: top; color: #aab6c7; font-size: 11.5px; line-height: 1.45; margin-bottom: 10px; text-align: left; }
th, td { padding: 9px 10px; border-bottom: 1px solid rgba(148, 163, 184, .14); text-align: left; vertical-align: top; }
th { color: #dbeafe; background: rgba(48, 48, 48, .58); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td { color: #e2e8f0; font-size: 12px; }
.table-hint { color: #94a3b8; font-size: 10.5px; line-height: 1.35; margin-top: 5px; max-width: 220px; }
.mini-link { display: inline-flex; margin-left: 8px; color: #67e8f9; font-size: 11px; text-decoration: none; }
.mini-link:hover { text-decoration: underline; }
.report-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 180px) minmax(150px, 180px) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: rgba(18, 18, 18, .34);
  padding: 12px;
  margin-bottom: var(--section-gap);
}
.report-filters label {
  display: grid;
  gap: 6px;
}
.report-filters span {
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.schedule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap);
  margin-top: var(--section-gap);
}
.schedule-card {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(48, 48, 48, .66), rgba(30, 30, 30, .88));
  padding: 13px;
}
.schedule-card p {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
  margin: 9px 0 0;
}
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}
.schedule-grid span {
  display: block;
  min-width: 0;
  border-left: 2px solid rgba(56, 189, 248, .5);
  border-radius: 8px;
  background: rgba(18, 18, 18, .36);
  color: #dbeafe;
  font-size: 10.5px;
  line-height: 1.35;
  padding: 7px 8px;
  overflow-wrap: anywhere;
}
.schedule-grid b {
  display: block;
  color: #99f6e4;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.schedule-grid i {
  display: inline-block;
  font-style: normal;
}
.blockers ul { color: #cbd5e1; font-size: 13px; line-height: 1.6; margin-bottom: 0; }

@media (max-width: 980px) {
  body { display: block; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
  }
  .nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .nav a { white-space: nowrap; }
  .sidebar-foot { display: none; }
  main { padding: 18px 14px 38px; }
  .hero.dashboard-view.active-view, .panel-head { display: block; }
  h1 { white-space: normal; }
  .hero-actions { justify-content: flex-start; margin-top: 18px; }
  .hero-actions { flex-wrap: wrap; }
  .status-strip, .activity-summary, .activity-layout, .pipeline-grid, .schedule-list, .schedule-grid, .about-hero-grid, .about-route-grid, .about-agent-grid, .about-detail-grid, .about-list-row, .about-rule-grid, .grid.two, .import-card, .import-controls, .cta-add-row { grid-template-columns: 1fr; }
  .activity-block.wide { grid-column: auto; }
}

/* FTWLF workspace treatment: branded dark rail, calm light review surface. */
:root { color-scheme: light; --bg: #f4f1eb; --panel: #ffffff; --panel-2: #f8fafb; --text: #203039; --muted: #66747a; --line: #d8e0e2; --blue: #0f766e; --green: #15803d; --amber: #b45309; --red: #b91c1c; }
body { background: #f4f1eb; color: var(--text); }
body::before { display: none; }
main { background: #f4f1eb; }
.sidebar { background: #123d3a; border-right-color: #123d3a; }
.brand strong { color: #ffffff; }
.brand span, .sidebar-foot span { color: #b7d1cc; }
.nav a { color: #d8ebe7; }
.nav a:hover, .nav a.active { color: #ffffff; border-color: #f0c875; background: rgba(240, 200, 117, .16); }
.nav a.active::before { background: #f0c875; box-shadow: 0 0 0 5px rgba(240, 200, 117, .16); }
.sidebar-foot { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.sidebar-foot b { color: #f0c875; }
.hero, .panel { background: #ffffff; border-color: #d8e0e2; box-shadow: 0 12px 30px rgba(32,48,57,.07); }
.dashboard-view#sent-history { background: transparent; box-shadow: none; }
.lede, .section-copy, .item-meta, .activity-block-head span { color: #66747a; }
.eyebrow { color: #c83d70; }
select, input, textarea { background: #ffffff; color: var(--text); border-color: #cbd6d9; }
button.secondary { background: #eef2f3; color: #203039; border-color: #cbd6d9; }
.metric, .item, .activity-block, .pipeline-card, .schedule-card, .about-card, .about-route-card, .about-agent-card, .about-rule { background: #ffffff; border-color: #d8e0e2; color: var(--text); }
.metric span, .table-hint, .schedule-card p, .about-card p, .about-agent-card p, .item-meta { color: #66747a; }
.import-card { background: #f7fbfa; border-color: #cfe3df; }
.import-controls span, .recipient-row span, .pipeline-grid b { color: #0f766e; }
.pill { color: #0f5f5a; background: #e4f2ef; border-color: #b9d9d3; }
.flow-wrap { background: #eef4f3; border-color: #d1dfdd; }
#flowSvg { min-width: 900px; min-height: 620px; }
.activity-view { background: #ffffff; }
.activity-block h3 { color: #203039; }
.pipeline-grid span, .schedule-grid span { background: #f5f8f8; color: #405157; }
.recipient-row { background: #e8f4f2; border-color: #b9d9d3; }
