:root {
  --rd-primary: #13355c;
  --rd-primary-hover: #1d4c81;
  --rd-blue: #00a3cf;
  --rd-logo-blue: #7ecbfd;
  --rd-light-blue: #a7def2;
  --rd-secondary: #d6efff;
  --rd-secondary-light: #f6fbff;
  --rd-neutral: #f0f4f7;
  --rd-background: #ffffff;
  --rd-background-secondary: #e9f3fb;
  --rd-text: #13355c;
  --rd-text-secondary: #667784;
  --rd-border: #cfe5ff;
  --rd-success: #388e3c;
  --rd-success-soft: #dff2d5;
  --rd-warning: #f0a13d;
  --rd-danger: #d32f2f;
  --rd-danger-soft: #feebeb;
  --rd-disabled-soft: #e1e9ef;
  --rd-radius: 4px;
  --rd-shadow: 0 1px 3px rgb(19 53 92 / 14%);
  --rd-font: Roboto, Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--rd-text);
  background: var(--rd-background-secondary);
  font: 14px/1.43 var(--rd-font);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template: 64px 1fr / 224px 1fr;
}
.topbar {
  grid-column: 1 / -1;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: #fff;
  background: var(--rd-primary);
  box-shadow: 0 2px 8px rgb(5 28 52 / 20%);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand span { display: grid; line-height: 1.15; }
.brand strong { font-size: 17px; letter-spacing: .01em; }
.brand small { margin-top: 3px; color: rgb(255 255 255 / 66%); font-size: 11px; }
.current-user { display: flex; align-items: center; min-width: 0; gap: 10px; }
.current-user-avatar { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; color: var(--rd-primary); background: var(--rd-logo-blue); border-radius: 50%; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.current-user-identity { display: grid; min-width: 0; line-height: 1.15; }
.current-user-identity small { color: rgb(255 255 255 / 66%); font-size: 10px; }
.current-user-identity strong { max-width: min(260px, 24vw); margin-top: 3px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-logout { min-height: 32px; padding: 5px 11px; color: #fff; background: transparent; border: 1px solid rgb(255 255 255 / 70%); border-radius: var(--rd-radius); cursor: pointer; font-size: 12px; font-weight: 700; }
.topbar-logout:hover { background: rgb(255 255 255 / 12%); border-color: #fff; }
.topbar-logout:focus-visible { outline: 2px solid var(--rd-logo-blue); outline-offset: 2px; }
.topbar-logout:disabled { cursor: wait; opacity: .55; }

.sidebar { display: flex; flex-direction: column; padding: 22px 12px 16px; background: #fff; border-right: 1px solid var(--rd-border); }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a, .admin-nav-toggle { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 8px 12px; color: var(--rd-text-secondary); background: transparent; border: 0; border-radius: var(--rd-radius); text-align: left; text-decoration: none; font-weight: 600; cursor: pointer; }
.sidebar nav a:hover, .admin-nav-toggle:hover { color: var(--rd-primary); background: var(--rd-secondary-light); }
.sidebar nav a:focus-visible, .admin-nav-toggle:focus-visible { outline: 2px solid var(--rd-blue); outline-offset: -2px; }
.sidebar nav a.active { color: var(--rd-primary); background: var(--rd-secondary); box-shadow: inset 3px 0 var(--rd-blue); }
.admin-nav-group, .admin-nav-items { display: grid; gap: 4px; }
.admin-nav-items { padding-left: 12px; }
.admin-nav-items a { font-size: 13px; }
.nav-chevron { display: inline-flex; align-items: center; justify-content: center; align-self: center; width: 18px; height: 18px; margin-left: auto; font-size: 15px; line-height: 1; transform-origin: center; transition: transform .15s ease; }
.admin-nav-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.admin-nav-toggle.admin-active { color: var(--rd-primary); }
.nav-icon { display: grid; flex: 0 0 20px; place-items: center; width: 20px; height: 20px; color: var(--rd-blue); font-size: 20px; }
.nav-icon svg { width: 19px; height: 19px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon-function { padding: 0 1px 1px 0; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-style: italic; font-weight: 400; line-height: 20px; }
.sidebar-note { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px; color: var(--rd-text-secondary); font-size: 11px; border-top: 1px solid var(--rd-border); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rd-success); box-shadow: 0 0 0 3px var(--rd-success-soft); }
.status-dot.offline { background: var(--rd-warning); box-shadow: 0 0 0 3px #ffe8c6; }

.main-content { min-width: 0; padding: 28px clamp(20px, 3vw, 44px) 60px; }
.page { width: min(1240px, 100%); margin: 0 auto; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 4px; color: var(--rd-blue); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.18; letter-spacing: -.02em; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 0; font-size: 15px; }
.subtitle { max-width: 680px; margin: 7px 0 0; color: var(--rd-text-secondary); }
.heading-actions { display: flex; gap: 8px; flex-shrink: 0; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 15px; border: 2px solid transparent; border-radius: var(--rd-radius); cursor: pointer; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s, opacity .15s; }
.button.primary { color: white; background: var(--rd-primary); border-color: var(--rd-primary); }
.button.primary:hover { background: var(--rd-primary-hover); border-color: var(--rd-primary-hover); }
.button.outline { color: var(--rd-primary); background: #fff; border-color: var(--rd-primary); }
.button.outline:hover { background: var(--rd-secondary-light); }
.button.neutral { color: var(--rd-primary); background: var(--rd-neutral); border-color: var(--rd-neutral); }
.button.danger { color: var(--rd-danger); background: #fff; border-color: #f1b7b7; }
.button.small { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.button:disabled { cursor: not-allowed; opacity: .45; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; margin-bottom: 14px; background: #fff; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); box-shadow: var(--rd-shadow); }
.search { position: relative; flex: 1; min-width: 220px; }
.search input { width: 100%; padding-left: 36px; }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 8px; color: var(--rd-text-secondary); font-size: 18px; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 11px; color: var(--rd-text); background: #fff; border: 1px solid #90a4ae; border-radius: var(--rd-radius); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--rd-blue); box-shadow: 0 0 0 2px rgb(0 163 207 / 14%); }
.field { display: grid; align-content: start; gap: 5px; }
.field label, .field-label { color: var(--rd-text-secondary); font-size: 12px; font-weight: 600; }
.field-help { color: var(--rd-text-secondary); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: 1 / -1; }
.destination-entry { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); background: #fbfdff; }
.destination-entry + .destination-entry { margin-top: 14px; }
.destination-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--rd-primary); }

.panel { background: #fff; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); box-shadow: var(--rd-shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px; border-bottom: 1px solid var(--rd-border); }
.archived-alerts-panel { margin-top: 14px; }
.disclosure-header { cursor: pointer; list-style: none; }
.disclosure-header::-webkit-details-marker { display: none; }
.disclosure-header:hover { background: var(--rd-secondary-light); }
.disclosure-header:focus-visible { outline: 2px solid var(--rd-blue); outline-offset: -2px; }
.disclosure-header > span { display: flex; align-items: center; gap: 8px; color: var(--rd-text-secondary); }
.disclosure-icon { display: inline-flex; align-items: center; justify-content: center; align-self: center; width: 18px; height: 18px; color: var(--rd-primary); font-size: 15px; line-height: 1; transform-origin: center; transition: transform .15s ease; }
.archived-alerts-panel[open] .disclosure-icon { transform: rotate(180deg); }
.panel-body { padding: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--rd-border); vertical-align: middle; }
th { color: var(--rd-text-secondary); background: var(--rd-secondary-light); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover { background: #fbfdff; }
tbody tr:last-child td { border-bottom: 0; }
.primary-cell strong { display: block; color: var(--rd-primary); }
.primary-cell small { display: block; margin-top: 2px; color: var(--rd-text-secondary); }
.right { text-align: right; }
.alert-catalog-table th:not(:first-child):not(:last-child),
.alert-catalog-table td:not(:first-child):not(:last-child) { text-align: center; }
.alert-catalog-table .right { white-space: nowrap; }
.alert-catalog-table .button { white-space: nowrap; }
.subscription-counts { display: inline-grid; grid-template-columns: minmax(1.5ch, max-content) max-content; gap: 2px 6px; text-align: left; }
.subscription-counts strong { text-align: right; font-variant-numeric: tabular-nums; }
.compact-timestamp { white-space: nowrap; font-variant-numeric: tabular-nums; }

.statistics-controls { display: flex; align-items: end; gap: 10px; }
.statistics-controls .field { min-width: 145px; }
.statistics-group-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.statistics-group-tabs .button[aria-pressed="true"] { color: #fff; background: var(--rd-primary); border-color: var(--rd-primary); }
.statistics-table .rank { width: 48px; color: var(--rd-text-secondary); text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.statistics-table th:not(:nth-child(2)), .statistics-table td:not(:nth-child(2)) { text-align: center; }
.statistics-table th:nth-child(2), .statistics-table td:nth-child(2) { text-align: left; }
.statistics-table .primary-cell { min-width: 260px; }
.statistics-table .count { font-weight: 800; font-variant-numeric: tabular-nums; }
.statistics-bar { display: inline-flex; align-items: center; width: min(180px, 18vw); min-width: 90px; height: 8px; overflow: hidden; vertical-align: middle; background: var(--rd-neutral); border-radius: 999px; }
.statistics-bar span { display: block; min-width: 2px; height: 100%; background: var(--rd-blue); border-radius: inherit; }
.statistics-caption { margin: 12px 18px 0; color: var(--rd-text-secondary); font-size: 12px; }
.audit-history-panel .panel-header > span { color: var(--rd-text-secondary); white-space: nowrap; }
.audit-history-table th:first-child, .audit-history-table td:first-child { width: 130px; }
.audit-history-table th:nth-child(2), .audit-history-table td:nth-child(2) { width: 210px; }
.audit-history-table th:nth-child(3), .audit-history-table td:nth-child(3) { width: 230px; }
.audit-history-table td { vertical-align: top; }
.audit-details { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--rd-text-secondary); font-size: 11px; }
.audit-details span { overflow-wrap: anywhere; }
.audit-details strong { color: var(--rd-primary); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.chip.active, .chip.ready, .chip.confirmed { color: #245a27; background: var(--rd-success-soft); }
.chip.suspended, .chip.draft, .chip.unverified { color: #704500; background: #ffe8c6; }
.chip.archived, .chip.disabled { color: #5e6970; background: var(--rd-disabled-soft); }
.chip.connected { color: #245a27; background: var(--rd-success-soft); }
.chip.unhealthy { color: var(--rd-danger); background: var(--rd-danger-soft); }
.chip.email { color: #07597a; background: #dff5ff; }
.chip.whatsapp { color: #226632; background: #e1f4e4; }
.chip.teams { color: #5944a5; background: #ece8ff; }
.chip.invalid, .chip.revoked { color: var(--rd-danger); background: var(--rd-danger-soft); }
.chip.online, .chip.matched, .chip.processed, .chip.connected { color: #245a27; background: var(--rd-success-soft); }
.chip.offline, .chip.stale, .chip.unavailable, .chip.not_configured, .chip.unmatched { color: #704500; background: #ffe8c6; }
.chip.not_checked { color: #4b5f70; background: var(--rd-disabled-soft); }
.chip.error, .chip.rejected, .chip.failed { color: var(--rd-danger); background: var(--rd-danger-soft); }
.chip.firing { color: #8a2b21; background: #ffe0dc; }
.chip.resolved { color: #245a27; background: var(--rd-success-soft); }
.chip.matched, .chip.suppressed, .chip.unmatched { margin-right: 5px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.operations-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { padding: 16px; background: #fff; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); }
.metric span { display: block; color: var(--rd-text-secondary); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.metric strong { display: block; margin-top: 4px; font-size: 22px; }
.metric small { display: block; margin-top: 4px; color: var(--rd-text-secondary); font-size: 11px; }
.metric-status { display: flex; align-items: center; margin-top: 7px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 16px; }
.farm-subscriptions-panel { margin-top: 16px; }
.destination-list, .subscription-list { display: grid; gap: 10px; }
.destination-card, .subscription-card { padding: 14px; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); background: #fff; }
.destination-head, .subscription-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.destination-value { margin: 8px 0 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.token-output, .code-example code, td code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.token-output { resize: vertical; overflow-wrap: anywhere; }
.code-example { padding: 10px 12px; overflow-x: auto; color: var(--rd-text-secondary); background: var(--rd-secondary-light); border: 1px solid var(--rd-border); border-radius: var(--rd-radius); }
.target-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.target-pill { max-width: 100%; padding: 5px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rd-primary); background: var(--rd-secondary-light); border: 1px solid var(--rd-border); border-radius: var(--rd-radius); font-size: 11px; }
.subscription-recipients { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rd-border); color: var(--rd-text-secondary); font-size: 12px; }
.subscription-recipients > strong { color: var(--rd-primary); }
.meta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; color: var(--rd-text-secondary); font-size: 12px; }
.provider-status-detail { display: block; margin-top: 5px; color: var(--rd-text-secondary); text-transform: capitalize; }
.card-actions { display: flex; gap: 7px; margin-top: 13px; }
.card-actions.compact { margin-top: 0; }

.info-banner, .warning-banner, .error-banner { padding: 12px 14px; margin-bottom: 16px; border-left: 4px solid; border-radius: var(--rd-radius); }
.info-banner { background: var(--rd-secondary-light); border-color: var(--rd-blue); }
.warning-banner { background: #fff5e7; border-color: var(--rd-warning); }
.error-banner { color: #821d1d; background: var(--rd-danger-soft); border-color: var(--rd-danger); }
.empty-state { padding: 52px 24px; text-align: center; color: var(--rd-text-secondary); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--rd-primary); font-size: 16px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 240px; color: var(--rd-text-secondary); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--rd-border); border-top-color: var(--rd-blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 18px; background: rgb(8 31 54 / 58%); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: #fff; border-radius: 6px; box-shadow: 0 20px 60px rgb(4 20 37 / 30%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 15px; border-bottom: 1px solid var(--rd-border); }
.modal-header p { margin: 4px 0 0; color: var(--rd-text-secondary); font-size: 12px; }
.modal-body { display: grid; gap: 16px; padding: 20px 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px 20px; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; color: var(--rd-text-secondary); background: transparent; border: 0; border-radius: var(--rd-radius); cursor: pointer; font-size: 22px; }
.check-list { display: grid; gap: 8px; max-height: 230px; overflow: auto; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); cursor: pointer; }
.check-row:hover { background: var(--rd-secondary-light); }
.check-row input { width: 17px; min-height: 17px; margin-top: 2px; }
.check-row span { min-width: 0; }
.check-row strong, .check-row small { display: block; }
.check-row small { overflow: hidden; color: var(--rd-text-secondary); text-overflow: ellipsis; white-space: nowrap; }
.switches { display: flex; gap: 18px; }
.switch { display: flex; align-items: center; gap: 8px; }
.switch input { width: 17px; min-height: 17px; }
.change-section { padding: 12px 14px; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); }
.change-section h3 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.change-section h3 span { min-width: 24px; padding: 2px 7px; text-align: center; background: var(--rd-secondary); border-radius: 999px; font-size: 11px; }
.change-section p { margin: 3px 0 8px; color: var(--rd-text-secondary); font-size: 12px; }
.change-section ul { max-height: 170px; margin: 0; padding-left: 20px; overflow: auto; }
.change-section li + li { margin-top: 4px; }
.change-section small { color: var(--rd-text-secondary); }

.live-indicator { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; color: var(--rd-text-secondary); background: #fff; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); font-size: 11px; font-weight: 800; }
.live-indicator span { width: 8px; height: 8px; border-radius: 50%; background: var(--rd-warning); }
.live-indicator.online span { background: var(--rd-success); box-shadow: 0 0 0 3px var(--rd-success-soft); animation: pulse 1.8s ease-in-out infinite; }
.live-indicator.offline span { background: var(--rd-danger); }
@keyframes pulse { 50% { opacity: .45; } }
.operations-grid { display: grid; grid-template-columns: minmax(340px, .8fr) minmax(540px, 1.2fr); gap: 16px; margin-bottom: 16px; }
.queue-list { display: grid; gap: 12px; }
.queue-card { padding: 14px; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); background: #fbfdff; }
.queue-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.queue-card-heading div { min-width: 0; }
.queue-card-heading span, .queue-stat-grid span { display: block; color: var(--rd-text-secondary); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.queue-card-heading strong { display: block; overflow: hidden; margin-top: 2px; color: var(--rd-primary); text-overflow: ellipsis; white-space: nowrap; }
.queue-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.queue-stat-grid div { padding: 9px; background: #fff; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); }
.queue-stat-grid strong { display: block; margin-top: 2px; font-size: 18px; }
.queue-card p, .queue-unavailable { margin: 10px 0 0; color: var(--rd-text-secondary); font-size: 11px; }
.live-alert-panel, .activity-panel { margin-top: 16px; }
.routing-reason { display: block; margin-top: 4px; color: var(--rd-text-secondary); text-transform: capitalize; }
.activity-stream { max-height: 430px; overflow: auto; }
.activity-row { display: grid; grid-template-columns: 150px 70px minmax(0, 1fr); gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--rd-border); }
.activity-row:last-child { border-bottom: 0; }
.activity-row time, .activity-row small { color: var(--rd-text-secondary); font-size: 11px; }
.activity-row strong, .activity-row small { display: block; }
.activity-row.error { box-shadow: inset 3px 0 var(--rd-danger); }
.activity-row.warning { box-shadow: inset 3px 0 var(--rd-warning); }
.activity-level { align-self: start; font-size: 10px; font-weight: 800; }
.activity-details { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 6px; color: var(--rd-text-secondary); font-size: 10px; text-transform: capitalize; }
.activity-details span { white-space: nowrap; }
.auto-refresh-note { margin: 12px 0 0; color: var(--rd-text-secondary); text-align: right; font-size: 11px; }
.delivery-operations-grid { grid-template-columns: minmax(360px, .8fr) minmax(650px, 1.2fr); }
.provider-monitor-heading strong, .provider-monitor-heading small { display: block; }
.provider-monitor-heading strong { font-size: 16px; }
.provider-monitor-heading small { margin-top: 4px; color: var(--rd-text-secondary); }
.provider-monitor-message { margin: 14px 0; color: var(--rd-text-secondary); }
.readiness-list { display: grid; gap: 8px; }
.readiness-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; background: var(--rd-secondary-light); border-radius: var(--rd-radius); }

.readonly-field { display: flex; align-items: center; min-height: 40px; padding: 8px 11px; color: var(--rd-primary); background: var(--rd-secondary-light); border: 1px solid var(--rd-border); border-radius: var(--rd-radius); font-weight: 600; }
.test-sequence-preview { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr; align-items: center; gap: 8px; padding: 14px; background: var(--rd-secondary-light); border: 1px solid var(--rd-border); border-radius: var(--rd-radius); }
.test-sequence-preview div { display: grid; grid-template-columns: 24px 1fr; gap: 2px 8px; align-items: center; }
.test-sequence-preview div > span { grid-row: 1 / 3; display: grid; place-items: center; width: 24px; height: 24px; color: #fff; background: var(--rd-primary); border-radius: 50%; font-size: 11px; font-weight: 800; }
.test-sequence-preview strong, .test-sequence-preview small { display: block; }
.test-sequence-preview small { color: var(--rd-text-secondary); font-size: 10px; }
.test-sequence-preview i { height: 1px; background: var(--rd-blue); }
.delivery-test-history { margin-top: 16px; }
.delivery-test-runs { display: grid; gap: 12px; }
.delivery-test-run { border: 1px solid var(--rd-border); border-radius: var(--rd-radius); overflow: hidden; }
.delivery-test-run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 14px; background: #fbfdff; border-bottom: 1px solid var(--rd-border); }
.delivery-test-run-head strong, .delivery-test-run-head small { display: block; }
.delivery-test-run-head small, .test-stage small { margin-top: 3px; color: var(--rd-text-secondary); font-size: 10px; }
.test-stage-list { display: grid; }
.test-stage { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--rd-border); }
.test-stage:last-child { border-bottom: 0; }
.test-stage-number { display: grid; place-items: center; width: 24px; height: 24px; color: var(--rd-primary); background: var(--rd-secondary); border-radius: 50%; font-size: 11px; font-weight: 800; }
.test-stage strong, .test-stage small { display: block; }
.test-stage .test-error { color: var(--rd-danger); text-transform: capitalize; }
.confirmation-summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; }
.confirmation-summary span { color: var(--rd-text-secondary); }
.confirmation-summary strong { overflow-wrap: anywhere; }
.chip.pending, .chip.retry_scheduled, .chip.waiting_prior_firing, .chip.queued { color: #704500; background: #ffe8c6; }
.chip.processing { color: #07597a; background: #dff5ff; }
.chip.accepted, .chip.sent, .chip.delivered, .chip.completed { color: #245a27; background: var(--rd-success-soft); }
.chip.failed_permanent, .chip.failed_after_acceptance, .chip.unknown_outcome, .chip.partially_failed { color: var(--rd-danger); background: var(--rd-danger-soft); }

.toast-root { position: fixed; z-index: 30; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 420px; padding: 11px 14px; color: #fff; background: var(--rd-primary); border-radius: var(--rd-radius); box-shadow: 0 8px 24px rgb(8 31 54 / 25%); }
.toast.error { background: var(--rd-danger); }

.login-page { position: fixed; inset: 64px 0 0; display: grid; place-items: center; padding: 24px; background: linear-gradient(rgb(19 53 92 / 52%), rgb(19 53 92 / 70%)), url('/reference-assets/login_background_desktop.png') center / cover; }
.login-card { width: min(420px, 100%); padding: 34px; text-align: center; background: rgb(255 255 255 / 96%); border-radius: 6px; box-shadow: 0 20px 60px rgb(3 20 38 / 30%); }
.login-card img { width: 66px; height: 66px; object-fit: contain; }
.login-card h1 { margin-top: 15px; font-size: 25px; }
.login-card p { margin: 9px 0 22px; color: var(--rd-text-secondary); }

@media (max-width: 800px) {
  .app-shell { grid-template: 58px auto 1fr / 1fr; }
  .topbar { padding: 0 15px; }
  .sidebar { overflow-x: auto; padding: 0 12px; border-right: 0; border-bottom: 1px solid var(--rd-border); }
  .sidebar nav { display: flex; width: max-content; min-width: 100%; }
  .sidebar nav a, .admin-nav-toggle { flex: 0 0 auto; justify-content: center; white-space: nowrap; }
  .admin-nav-group { display: flex; align-items: flex-start; }
  .admin-nav-items { display: flex; padding-left: 0; }
  .sidebar-note { display: none; }
  .main-content { padding: 20px 14px 45px; }
  .detail-grid, .form-grid, .operations-grid { grid-template-columns: 1fr; }
  .statistics-controls { align-items: stretch; flex-direction: column; }
  .statistics-bar { width: 110px; }
  .span-2 { grid-column: auto; }
  .metric-grid, .operations-metrics { grid-template-columns: 1fr; }
  .login-page { inset: 58px 0 0; }
}

@media (max-width: 540px) {
  .brand small, .nav-icon, .current-user-avatar, .current-user-identity small { display: none; }
  .brand { gap: 7px; }
  .brand img { width: 32px; height: 32px; }
  .current-user { gap: 7px; }
  .current-user-identity strong { max-width: 27vw; font-size: 12px; }
  .topbar-logout { min-height: 30px; padding: 4px 8px; }
  .page-heading { display: grid; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 8px 8px 0 0; }
  .activity-row { grid-template-columns: 1fr; gap: 3px; }
  .queue-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .test-sequence-preview { grid-template-columns: 1fr; }
  .test-sequence-preview i { width: 1px; height: 14px; margin-left: 11px; }
}
