/* ============================================================
   Daallo Services — design tokens
   ============================================================ */
:root {
  --brand: #068a4b;
  --brand-light: #10b981;
  --brand-dark: #045c33;
  --brand-gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);

  --ink-900: #0b1220;
  --ink-700: #1e293b;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-100: #f1f5f9;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.16);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.22);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============================================================
   Shared bits
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }

/* ============================================================
   PUBLIC SITE (light, brand-forward)
   ============================================================ */
body.public {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(6, 138, 75, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(16, 185, 129, 0.08), transparent 55%),
    #f8fafc;
  color: var(--ink-700);
  line-height: 1.6;
  min-height: 100vh;
}
body.one-screen { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.hero-solo { flex: 1 1 0; min-height: 0; display: grid; padding: 0 28px; max-width: 1160px; margin: 0 auto; width: 100%; overflow: hidden; }
.hero-solo .eyebrow { margin-bottom: 16px; }
.hero-solo h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 12px; }
.hero-solo p.lead { margin-bottom: 20px; font-size: 15.5px; }
.hero-solo .orbit-wrap { height: min(280px, 32vh); }
.hero-solo .orbit-stage { width: min(230px, 28vh); height: min(230px, 28vh); }
.p-footer-solo { padding: 10px 0 14px; flex-shrink: 0; text-align: center; font-size: 12px; }

.p-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.p-nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-mark { display: flex; align-items: center; gap: 11px; flex-shrink: 0; white-space: nowrap; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 14px -4px rgba(6, 138, 75, 0.55);
}
.brand-logo-img { height: 26px; width: auto; display: block; }
.brand-name { font-weight: 800; font-size: 17px; color: var(--ink-900); letter-spacing: -0.01em; white-space: nowrap; }
.brand-name span { color: var(--brand); }

.p-nav-links { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.p-nav-links a { font-size: 14px; font-weight: 600; color: var(--ink-500); transition: color 0.15s; white-space: nowrap; }
.p-nav-links a:hover { color: var(--ink-900); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0;
  padding: 7px 14px; border-radius: 999px;
  background: var(--brand-gradient); color: white;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 12px -2px rgba(6, 138, 75, 0.45);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: white; animation: pulse 2s infinite; }
.status-pill.down { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 12px -2px rgba(220,38,38,0.45); }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.3); } }

.container { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding: 76px 0 56px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-gradient); color: white;
  padding: 6px 14px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  box-shadow: 0 6px 16px -4px rgba(6, 138, 75, 0.5);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 800; letter-spacing: -0.02em;
  color: var(--ink-900); line-height: 1.05; margin: 0 0 18px;
}
.hero h1 .grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lead { font-size: 17px; color: var(--ink-500); max-width: 480px; margin: 0 0 30px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px;
  font-weight: 700; font-size: 14px; border: none; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--brand-gradient); color: white; box-shadow: 0 10px 24px -8px rgba(6, 138, 75, 0.55); }
.btn-primary:hover { box-shadow: 0 14px 28px -6px rgba(6, 138, 75, 0.6); }
.btn-ghost { background: white; color: var(--ink-700); border: 1.5px solid rgba(15, 23, 42, 0.10); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.orbit-wrap { display: flex; align-items: center; justify-content: center; height: 320px; }
.orbit-stage { position: relative; width: 230px; height: 230px; }
.orbit-ring { position: absolute; border-radius: 50%; border: 3px solid rgba(6, 138, 75, 0.16); }
.orbit-ring.r1 { inset: 0; animation: spin 9s linear infinite; border-top-color: var(--brand); }
.orbit-ring.r2 { inset: 22px; animation: spin 14s linear infinite reverse; border-top-color: var(--brand-light); }
.orbit-ring.r3 { inset: 44px; animation: spin 20s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit-core {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%;
  background: var(--brand-gradient); box-shadow: 0 0 0 10px rgba(6, 138, 75, 0.08), 0 12px 30px -6px rgba(6, 138, 75, 0.6);
  display: flex; align-items: center; justify-content: center;
}
.orbit-core .icon { color: white; width: 26px; height: 26px; }

.stats-strip { display: flex; gap: 10px; margin-top: 26px; }
.stat-chip {
  background: white; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 11px;
  padding: 9px 14px; font-size: 12px; font-weight: 700; color: var(--ink-500);
  display: flex; align-items: center; gap: 7px; box-shadow: var(--shadow-sm);
}
.stat-chip b { color: var(--ink-900); font-size: 13px; }

.section-title { font-size: 26px; font-weight: 800; color: var(--ink-900); letter-spacing: -0.01em; margin: 0 0 4px; }
.section-sub { color: var(--ink-500); font-size: 14.5px; margin: 0 0 26px; }

.card-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-bottom: 26px; }
.p-card {
  background: white; border-radius: var(--radius-md); padding: 30px;
  border: 1px solid rgba(15, 23, 42, 0.07); box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
}
.p-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.p-card h3 { margin: 0 0 20px; font-size: 17px; font-weight: 800; color: var(--brand); display: flex; align-items: center; gap: 9px; }

.integration-row {
  display: flex; align-items: center; gap: 16px; padding: 15px 16px;
  border-radius: 14px; border: 1px solid rgba(6, 138, 75, 0.12);
  background: linear-gradient(135deg, rgba(6, 138, 75, 0.04), rgba(6, 138, 75, 0.01));
  margin-bottom: 12px; transition: transform 0.15s;
}
.integration-row:last-child { margin-bottom: 0; }
.integration-row:hover { transform: translateX(4px); }
.integration-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0;
  box-shadow: 0 6px 14px -4px rgba(6, 138, 75, 0.5);
}
.integration-icon.muted { background: linear-gradient(135deg, #94a3b8, #cbd5e1); box-shadow: none; }
.integration-body { flex: 1; min-width: 0; }
.integration-body .name { font-weight: 700; font-size: 14.5px; color: var(--ink-900); }
.integration-body .desc { font-size: 12.5px; color: var(--ink-500); margin-top: 1px; }
.integration-vars { font-size: 11px; color: var(--ink-500); margin-top: 4px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.security-item { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid rgba(15,23,42,0.06); }
.security-item:first-child { border-top: none; padding-top: 0; }
.security-item .ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(6,138,75,0.10); color: var(--brand); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.security-item h4 { margin: 0 0 3px; font-size: 14px; font-weight: 700; color: var(--ink-900); }
.security-item p { margin: 0; font-size: 12.5px; color: var(--ink-500); line-height: 1.55; }

.cta-band {
  background: var(--brand-gradient); border-radius: var(--radius-md);
  padding: 52px 40px; text-align: center; color: white; margin: 34px 0 60px;
  box-shadow: 0 24px 48px -16px rgba(6, 138, 75, 0.5);
}
.cta-band h2 { margin: 0 0 10px; font-size: 24px; font-weight: 800; }
.cta-band p { margin: 0 0 24px; opacity: 0.92; font-size: 14.5px; }
.cta-band .btn-ghost { background: white; color: var(--brand); border: none; }

footer.p-footer { text-align: center; padding: 30px 0 46px; color: var(--ink-500); font-size: 13px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .orbit-wrap { height: 200px; }
  .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .p-nav-links a { display: none; }
  .status-pill { font-size: 12px; padding: 6px 11px; }
}
@media (max-width: 420px) {
  .status-pill span:last-child { display: none; }
}

/* ============================================================
   ADMIN CONSOLE — dark "mission control" theme
   (tokens/patterns adapted from the SLAIVOps design system)
   ============================================================ */
:root {
  --a-bg: #121212;
  --a-bg-2: #171717;
  --a-panel: #1e1e1e;
  --a-panel-2: #262626;
  --a-border: #2f2f2f;
  --a-border-subtle: #232323;
  --a-text: #e8e8e8;
  --a-text-dim: #a3a3a3;
  --a-text-faint: #737373;
  --a-accent: #10b981;
  --a-accent-hover: #34d399;
  --a-green: #34d399;
  --a-red: #f87171;
  --a-amber: #fbbf24;
  --a-blue: #60a5fa;
  --a-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --a-radius: 3px;
}

body.admin-shell {
  margin: 0; background: var(--a-bg); color: var(--a-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  height: 100vh; overflow: hidden;
}
.mono { font-family: var(--a-mono); }

/* -- decorative background: line grid + glow spheres --
   This is the ONLY scrollable region in the admin shell — the sidebar and page
   header stay pinned; a tall page scrolls in its own box, the browser window doesn't. */
/* ---- Zone 3: the layout outlet. The only scrollable region. ---- */
.a-content {
  position: relative; overflow-y: auto; overflow-x: hidden; flex: 1 1 0; min-height: 0;
  padding: 18px 30px 20px;
}
.a-content > * { position: relative; z-index: 1; }
.a-content > *:first-child { margin-top: 0; }

/* Fill mode: rows stretch to consume the viewport instead of leaving a dead band
   at the bottom. Cards flex internally so charts/tables absorb the extra height. */
.a-content.fill { display: flex; flex-direction: column; gap: 12px; }
.a-content.fill > .a-daterange, .a-content.fill > .a-kpi-grid { margin-bottom: 0; flex-shrink: 0; }
.a-content.fill > .a-split, .a-content.fill > .a-split-3 { flex: 1 1 0; min-height: 0; margin-bottom: 0; }
.a-content.fill .a-split > .a-card, .a-content.fill .a-split-3 > .a-card {
  height: 100%; display: flex; flex-direction: column; min-height: 0;
}
.a-content.fill .a-card > .a-panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* Table fills the card and scrolls internally. Columns size to their content
   (auto, not fixed) so values sit next to their headers instead of being spread
   across equal-width columns in a wide card. */
.a-content.fill .a-card > table.a-table { display: block; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.a-content.fill .a-card > table.a-table thead,
.a-content.fill .a-card > table.a-table tbody { display: table; width: 100%; table-layout: auto; }
.a-content.fill .a-card > table.a-table thead { position: sticky; top: 0; z-index: 1; }
/* First column takes the slack; numeric columns stay tight and right-aligned. */
.a-content.fill .a-card > table.a-table th:first-child,
.a-content.fill .a-card > table.a-table td:first-child { width: 100%; }
.a-content.fill .a-card > table.a-table th:not(:first-child),
.a-content.fill .a-card > table.a-table td:not(:first-child) { white-space: nowrap; text-align: right; }
.a-content.fill .a-chart-wrap { height: 100%; min-height: 90px; }

/* Multi-column content splits — use the full width instead of stacking */
.a-split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 12px; align-items: start; }
.a-split-3 { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr; gap: 12px; align-items: start; }
@media (max-width: 1180px) {
  .a-split, .a-split-3 { grid-template-columns: 1fr; }
}

/* -- shell / sidebar -- */
.a-shell { display: flex; height: 100vh; overflow: hidden; }

/* ---- Zone 1: sidebar. Collapsed to an icon rail by default; expands on hover.
   Width is animated, and the rail overlays rather than pushing content so the
   layout underneath never reflows. ---- */
.a-sidebar {
  width: 64px; flex-shrink: 0; background: var(--a-panel);
  border-right: 1px solid var(--a-border); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 2px;
  height: 100vh; position: relative; z-index: 30;
  transition: width 0.18s ease;
  overflow: hidden; white-space: nowrap;
}
.a-sidebar:hover { width: 232px; box-shadow: 12px 0 32px -12px rgba(0,0,0,0.6); }
/* Everything that is text-only fades out when collapsed */
.a-sidebar .a-label,
.a-sidebar .brand-sub,
.a-sidebar .a-user-chip span:not(.dot),
.a-sidebar .a-user-chip b,
.a-sidebar .a-logout-btn span { opacity: 0; transition: opacity 0.12s; }
.a-sidebar:hover .a-label,
.a-sidebar:hover .brand-sub,
.a-sidebar:hover .a-user-chip span:not(.dot),
.a-sidebar:hover .a-user-chip b,
.a-sidebar:hover .a-logout-btn span { opacity: 1; }
.a-sidebar .brand-mark { padding: 4px 6px 20px; height: 30px; align-items: center; }
/* Icon-only mark while collapsed, full wordmark once expanded */
.brand-icon-only { height: 26px; width: auto; display: block; }
.brand-wordmark { height: 20px; width: auto; display: none; }
.a-sidebar:hover .brand-icon-only { display: none; }
.a-sidebar:hover .brand-wordmark { display: block; }
.a-sidebar .brand-name { color: var(--a-text); font-size: 15px; }
.a-sidebar .brand-name span { color: var(--a-accent); }
.a-sidebar .brand-sub { font-size: 11px; color: var(--a-text-faint); margin-top: 2px; padding: 0 10px 18px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

.a-nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--a-radius);
  font-size: 13.5px; font-weight: 600; color: var(--a-text-dim);
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, transform 0.15s, border-color 0.15s;
}
.a-nav-link .icon { width: 17px; height: 17px; flex-shrink: 0; }
.a-nav-link:hover { background: color-mix(in srgb, var(--a-accent) 12%, transparent); color: var(--a-accent-hover); transform: translateX(3px); }
.a-nav-link.active { background: var(--a-accent); color: #ffffff; border-left-color: rgba(255,255,255,0.6); box-shadow: var(--shadow-sm); font-weight: 700; }
.a-nav-link.active .icon { transform: scale(1.08); }

.a-sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--a-border); }
.a-user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 12.5px; color: var(--a-text-dim); }
.a-user-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a-green); box-shadow: 0 0 0 3px rgba(52,211,153,0.18); }
.a-logout-btn {
  width: 100%; margin-top: 8px; padding: 9px 10px; border-radius: var(--a-radius); border: 1px solid var(--a-border);
  background: transparent; color: var(--a-text-dim); font-size: 12.5px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 8px; transition: all 0.12s;
}
.a-logout-btn:hover { border-color: var(--a-red); color: var(--a-red); }

/* The page backdrop lives on the main column so the grid/glow sits behind BOTH the
   pinned header and the scrolling content — otherwise the two read as misaligned layers. */
.a-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden;
  position: relative;
  background-color: var(--a-bg-2);
  background-image:
    linear-gradient(var(--a-border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--a-border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
}
.a-main::before, .a-main::after {
  content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%;
  filter: blur(120px); z-index: 0; pointer-events: none;
}
.a-main::before { top: -12%; left: -8%; background: rgba(16, 185, 129, 0.14); }
.a-main::after { bottom: -12%; right: -8%; background: rgba(52, 211, 153, 0.09); }

/* -- PageHeader: solid accent gradient banner -- */
/* ---- Zone 2: page header. Flush to the top of the main column, inset on the sides
   so it lines up with the content outlet below. When a tab strip follows, the header
   keeps square bottom corners and the strip owns them — the two read as one card. ---- */
.a-pageheader {
  position: relative; z-index: 1; overflow: hidden; margin: 0 0 0; flex-shrink: 0;
  background: linear-gradient(135deg, var(--a-accent) 0%, color-mix(in srgb, var(--a-accent) 68%, #000) 100%);
  border-radius: var(--a-radius); box-shadow: var(--shadow-md);
  padding: 26px 30px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow-md), inset 0 -24px 40px -24px rgba(0,0,0,0.35);
  border-radius: 0;
}
.a-pageheader::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.16) 1px, transparent 1px);
  background-size: 16px 16px; opacity: 0.5;
}
.a-pageheader::after {
  content: ''; position: absolute; top: -60%; right: -8%; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, transparent 65%); pointer-events: none;
}
.a-pageheader-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.a-pageheader .a-kicker {
  font-family: var(--a-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.75); margin-bottom: 5px;
}
.a-pageheader h1 { font-size: 28px; font-weight: 800; margin: 0; color: white; letter-spacing: -0.02em; line-height: 1.1; }
.a-pageheader .a-sub { font-size: 13px; color: rgba(255,255,255,0.88); margin-top: 5px; }
.a-pageheader-icon { width: 38px; height: 38px; border-radius: var(--a-radius); background: #ffffff; border: 1px solid rgba(255,255,255,0.5); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; color: var(--brand); flex-shrink: 0; }
.a-pageheader-icon .icon { width: 19px; height: 19px; }
.a-pageheader-logo-badge {
  display: inline-flex; align-items: center; flex-shrink: 0;
  background: #ffffff; border-radius: var(--a-radius); padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.5); box-shadow: var(--shadow-sm);
}
.a-pageheader-logo-badge img { height: 20px; width: auto; display: block; }

/* Header action buttons — inverted, because the backdrop here is solid accent, not neutral */
.a-pageheader-actions { display: flex; gap: 10px; flex-shrink: 0; }
.a-hbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--a-radius); border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; font-family: inherit;
  background: #ffffff; color: var(--brand); box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.a-hbtn:hover { transform: translateY(-1px); }
.a-hbtn.ghost { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.4); }

/* ---- Tab strip: sits directly under the page header, same width, owns the
   bottom edge. Active tab gets a 2px accent underline. ---- */
.a-tabs {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0; position: relative; z-index: 1;
  background: var(--a-bg);
  border-bottom: 1px solid var(--a-border);
  padding: 0 30px;
}
.a-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 16px; font-size: 13.5px; font-weight: 600;
  color: var(--a-text-dim); border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.a-tab .icon { width: 16px; height: 16px; }
.a-tab:hover { color: var(--a-text); text-decoration: none; }
.a-tab.active { color: var(--a-text); border-bottom-color: var(--a-accent); font-weight: 700; }
.a-tab-badge {
  background: var(--a-panel-2); color: var(--a-text-dim);
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 9999px;
  font-family: var(--a-mono);
}
.a-tab.active .a-tab-badge { background: color-mix(in srgb, var(--a-accent) 18%, transparent); color: var(--a-accent); }

/* Section heading — lives INSIDE its card so each block reads as one contained unit */
.a-section-kicker {
  font-family: var(--a-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--a-accent);
  margin: 0 0 3px;
}
.a-section-title { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; margin: 0; color: var(--a-text); }
.a-section-title em { font-style: italic; font-weight: 500; color: var(--a-text-dim); }

/* Card header block: kicker + title on the left, meta on the right */
.a-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 13px; border-bottom: 1px solid var(--a-border-subtle);
}
.a-panel-body { padding: 12px 13px; }
.a-panel-body.tight { padding: 10px 13px; }
.a-panel-meta { font-size: 10.5px; color: var(--a-text-faint); font-family: var(--a-mono); flex-shrink: 0; }
.a-pageheader-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

/* -- KPI cards: dark hero stat tiles with category accent rail -- */
/* Solid-colour KPI tiles — the whole card carries the status colour, white text on top. */
.a-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.a-kpi {
  border: none; border-radius: var(--a-radius);
  padding: 12px 14px; position: relative;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px;
  color: #fff;
}
.a-kpi.accent-green { background: linear-gradient(135deg, #10b981, #059669); }
.a-kpi.accent-red    { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.a-kpi.accent-blue   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.a-kpi.accent-amber  { background: linear-gradient(135deg, #f59e0b, #b45309); }
.a-kpi.accent-slate  { background: linear-gradient(135deg, #475569, #1e293b); }
.a-kpi-icon {
  width: 30px; height: 30px; border-radius: var(--a-radius);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.20); color: #fff;
}
.a-kpi-icon .icon { width: 15px; height: 15px; }
.a-kpi .label { color: rgba(255,255,255,0.82); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.a-kpi .value { font-size: 22px; font-weight: 800; margin-top: 1px; letter-spacing: -0.02em; font-family: var(--a-mono); color: #fff; line-height: 1.1; }

/* Scope picker: service > resource > action tree */
.a-scope-service { border: 1px solid var(--a-border); border-radius: var(--a-radius); margin-bottom: 10px; overflow: hidden; }
.a-scope-service > header {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  background: var(--a-panel-2); border-bottom: 1px solid var(--a-border);
}
.a-scope-service > header .name { font-weight: 700; font-size: 13px; }
.a-scope-service > header .desc { font-size: 11px; color: var(--a-text-faint); }
.a-scope-group { padding: 11px 13px; border-top: 1px solid var(--a-border-subtle); }
.a-scope-group:first-of-type { border-top: none; }
.a-scope-group h5 { margin: 0 0 2px; font-size: 11.5px; font-weight: 700; color: var(--a-text); }
.a-scope-group p { margin: 0 0 9px; font-size: 11px; color: var(--a-text-faint); line-height: 1.45; }
.a-scope-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 7px; }
.a-scope-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--a-border); border-radius: var(--a-radius);
  background: var(--a-bg-2); cursor: pointer; transition: border-color 0.12s;
}
.a-scope-item:hover { border-color: color-mix(in srgb, var(--a-accent) 45%, var(--a-border)); }
.a-scope-item input { margin-top: 2px; flex-shrink: 0; }
.a-scope-item .t { font-size: 12px; color: var(--a-text); line-height: 1.3; }
.a-scope-item .h { font-family: var(--a-mono); font-size: 10px; color: var(--a-text-faint); margin-top: 2px; }
.a-scope-chip {
  display: inline-block; font-family: var(--a-mono); font-size: 10px;
  background: color-mix(in srgb, var(--a-accent) 14%, transparent); color: var(--a-accent-hover);
  border: 1px solid color-mix(in srgb, var(--a-accent) 32%, transparent);
  padding: 1px 6px; border-radius: 3px; margin: 2px 3px 0 0;
}

/* -- glass-card: the one elevated-surface pattern -- */
.a-card {
  background: color-mix(in srgb, var(--a-panel) 92%, transparent);
  backdrop-filter: blur(16px);
  border: 1px solid var(--a-border); border-radius: var(--a-radius);
  box-shadow: var(--shadow-sm);
  padding: 0; margin-bottom: 12px; overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.a-split .a-card, .a-split-3 .a-card { margin-bottom: 0; }
.a-card:hover { border-color: color-mix(in srgb, var(--a-accent) 35%, var(--a-border)); box-shadow: var(--shadow-md); }
.a-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.a-card-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.a-card-head .muted { font-size: 11.5px; color: var(--a-text-faint); }

.a-chart-wrap { display: flex; align-items: stretch; gap: 3px; height: 104px; }
.a-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; min-width: 0; }
/* Bars size as a % of the column's flexible track, so the chart grows with the card. */
.a-bar-col > .a-bar { flex: 0 0 auto; }
.a-bar-track { flex: 1 1 auto; display: flex; align-items: flex-end; width: 100%; justify-content: center; min-height: 0; }
.a-bar {
  width: 100%; max-width: 26px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--a-accent-hover), var(--a-accent));
  min-height: 2px; transition: opacity 0.15s;
}
.a-bar:hover { opacity: 0.8; }
/* min-height keeps every column's baseline aligned even when the value is blank,
   without each empty label reserving a full line of dead space above the bars. */
.a-bar-value { font-size: 9.5px; color: var(--a-text-dim); font-weight: 700; font-family: var(--a-mono); line-height: 1; min-height: 10px; }
.a-bar-label { font-size: 9px; color: var(--a-text-faint); white-space: nowrap; font-family: var(--a-mono); }

/* Date-range filter bar */
.a-daterange {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.a-daterange input[type="date"], .a-daterange select {
  padding: 6px 9px; border-radius: var(--a-radius); border: 1px solid var(--a-border);
  background: var(--a-panel-2); color: var(--a-text); font-size: 11.5px;
  font-family: var(--a-mono); color-scheme: dark;
}
.a-daterange .sep { color: var(--a-text-faint); font-size: 12px; }
.a-quickrange { display: flex; gap: 4px; margin-left: auto; }
.a-quickrange a {
  padding: 7px 12px; border-radius: var(--a-radius); border: 1px solid var(--a-border);
  font-size: 11.5px; font-weight: 600; color: var(--a-text-dim); font-family: var(--a-mono);
}
.a-quickrange a:hover { border-color: var(--a-accent); color: var(--a-accent-hover); }
.a-quickrange a.active { background: var(--a-accent); color: #fff; border-color: var(--a-accent); }

/* Horizontal ranked bars — used for by-template / by-client / by-path breakdowns */
.a-hbar-row { padding: 5px 0; }
.a-hbar-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.a-hbar-name {
  font-size: 11.5px; color: var(--a-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.a-hbar-track { height: 5px; background: var(--a-panel-2); border-radius: 999px; overflow: hidden; margin-top: 5px; }
.a-hbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--a-accent), var(--a-accent-hover)); }
.a-hbar-fill.warn { background: linear-gradient(90deg, var(--a-amber), #fcd34d); }
.a-hbar-fill.bad { background: linear-gradient(90deg, var(--a-red), #fca5a5); }
.a-hbar-count { font-family: var(--a-mono); font-size: 12px; color: var(--a-text-dim); font-weight: 700; white-space: nowrap; }

/* Donut chart (pure CSS conic-gradient) */
/* Centred in its card, and capped so the legend values sit beside their labels
   rather than being pushed to the far edge of a wide card. */
.a-donut-wrap {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  height: 100%; max-width: 340px; margin: 0 auto;
}
.a-donut { width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; position: relative; }
.a-donut::after {
  content: ''; position: absolute; inset: 22%; border-radius: 50%; background: var(--a-panel);
}
.a-donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; z-index: 1;
}
.a-donut-center .n { font-family: var(--a-mono); font-size: 16px; font-weight: 800; color: #fff; line-height: 1; }
.a-donut-center .l { font-size: 8px; color: var(--a-text-faint); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.a-legend { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.a-legend-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.a-legend-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.a-legend-name { color: var(--a-text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-legend-val { font-family: var(--a-mono); color: var(--a-text); font-weight: 700; margin-left: auto; }

/* Credential reveal panel — shown once after creating a client */
.a-reveal {
  border: 1px solid color-mix(in srgb, var(--a-accent) 45%, transparent);
  background: color-mix(in srgb, var(--a-accent) 10%, transparent);
  border-radius: var(--a-radius); padding: 16px; margin-bottom: 16px;
}
.a-reveal h4 { margin: 0 0 4px; font-size: 13.5px; color: var(--a-accent-hover); }
.a-reveal .warn { font-size: 11.5px; color: var(--a-amber); margin: 0 0 12px; }
.a-cred-grid { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; align-items: center; }
.a-cred-grid dt { font-size: 11px; color: var(--a-text-faint); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.a-cred-grid dd { margin: 0; }
.a-cred-value {
  font-family: var(--a-mono); font-size: 12.5px; color: #fff;
  background: #0a0c10; border: 1px solid var(--a-border); border-radius: var(--a-radius);
  padding: 7px 10px; word-break: break-all; user-select: all;
}

/* ---- Modal: every create/edit dialog ----
   Backdrop owns overflow:hidden; the dialog's own overflow:auto is the only
   thing that scrolls. Closes on Escape and on backdrop click. */
.a-modal-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 24px;
}
.a-modal-backdrop[hidden] { display: none; }
.a-modal {
  width: min(880px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--a-panel); border: 1px solid var(--a-border);
  border-radius: var(--a-radius); box-shadow: 0 30px 70px -20px rgba(0,0,0,0.75);
  animation: a-modal-in 0.18s cubic-bezier(0, 0, 0.2, 1);
}
@keyframes a-modal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .a-modal { animation: none; } }
.a-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-bottom: 1px solid var(--a-border);
  position: sticky; top: 0; background: var(--a-panel); z-index: 1;
}
.a-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.a-modal-head p { margin: 3px 0 0; font-size: 12px; color: var(--a-text-faint); }
.a-modal-close {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--a-radius);
  border: 1px solid var(--a-border); background: transparent; color: var(--a-text-dim);
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.a-modal-close:hover { border-color: var(--a-red); color: var(--a-red); }
.a-modal-body { padding: 18px; }
.a-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 18px; border-top: 1px solid var(--a-border);
  position: sticky; bottom: 0; background: var(--a-panel);
}

/* Inline create form */
.a-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-items: end; }
.a-field label { display: block; font-size: 10.5px; font-weight: 700; color: var(--a-text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
.a-field input {
  width: 100%; padding: 9px 11px; border-radius: var(--a-radius); border: 1px solid var(--a-border);
  background: var(--a-panel-2); color: var(--a-text); font-size: 12.5px;
}
.a-field input:focus { outline: none; border-color: var(--a-accent); }

/* Stat rows / usage breakdown inside a card */
.a-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.a-stat-label { color: var(--a-text-faint); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.a-stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; color: #fff; line-height: 1.15; }
.a-note { color: var(--a-text-faint); font-size: 11px; margin: 0 0 12px; line-height: 1.5; }
.a-usage-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 12px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--a-border-subtle); font-size: 12px;
}
.a-usage-name { color: var(--a-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* -- DataTable pattern --
   A long table scrolls inside its own card (sticky header stays put) rather than
   growing the page — this is what keeps the shell at exactly one viewport. */
.a-table-scroll { max-height: calc(100vh - 400px); min-height: 180px; overflow-y: auto; }
table.a-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.a-table th {
  position: sticky; top: 0; background: var(--a-bg-2);
  text-align: left; padding: 10px 14px; color: var(--a-text-faint); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; border-bottom: 1px solid var(--a-border);
}
table.a-table td { padding: 13px 14px; border-bottom: 1px solid var(--a-border-subtle); height: 20px; }
table.a-table tr:last-child td { border-bottom: none; }
table.a-table tr:hover td { background: rgba(255,255,255,0.025); }
table.a-table .ctx { color: var(--a-text-faint); font-size: 11px; margin-top: 2px; }

/* -- status pill: mono, pill radius, color-mix, pulse for in-progress -- */
.a-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 9999px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  font-family: var(--a-mono);
}
.a-pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.a-pill.ok, .a-pill.sent, .a-pill.delivered, .a-pill.approved {
  background: color-mix(in srgb, var(--a-green) 14%, transparent); color: var(--a-green);
  border: 1px solid color-mix(in srgb, var(--a-green) 40%, transparent);
}
.a-pill.failed, .a-pill.undelivered {
  background: color-mix(in srgb, var(--a-red) 14%, transparent); color: var(--a-red);
  border: 1px solid color-mix(in srgb, var(--a-red) 40%, transparent);
}
.a-pill.pending, .a-pill.queued, .a-pill.accepted {
  background: color-mix(in srgb, var(--a-amber) 14%, transparent); color: var(--a-amber);
  border: 1px solid color-mix(in srgb, var(--a-amber) 40%, transparent);
}
.a-pill.pending .pdot, .a-pill.queued .pdot, .a-pill.accepted .pdot { animation: a-pulse-dot 2s infinite; }
@keyframes a-pulse-dot { 0%,100% { opacity:1; transform:scale(1); box-shadow:0 0 0 0 currentColor; } 50% { opacity:.75; transform:scale(1.25); } }

.a-code, code.a-code { font-family: var(--a-mono); background: rgba(255,255,255,0.06); border-radius: 3px; padding: 2px 7px; font-size: 11.5px; color: var(--a-accent-hover); }
pre.a-pre { font-family: var(--a-mono); background: #0a0c10; border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 16px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-size: 12px; color: var(--a-text); }

.a-filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.a-filters select, .a-filters input {
  padding: 9px 12px; border-radius: var(--a-radius); border: 1px solid var(--a-border);
  background: var(--a-panel-2); color: var(--a-text); font-size: 12.5px;
}
.a-btn { padding: 9px 16px; border-radius: var(--a-radius); border: none; background: var(--a-accent); color: #ffffff; font-weight: 700; font-size: 12.5px; cursor: pointer; transition: background 0.15s; }
.a-btn:hover { background: var(--a-accent-hover); }
.a-btn.secondary { background: transparent; border: 1px solid var(--a-border); color: var(--a-text); }
.a-btn.secondary:hover { border-color: var(--a-accent); color: var(--a-accent-hover); }

.a-detail-grid { display: grid; grid-template-columns: 160px 1fr; gap: 12px 20px; font-size: 13px; }
.a-detail-grid dt { color: var(--a-text-faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.a-detail-grid dd { margin: 0; }

.a-back { display: inline-flex; align-items: center; gap: 6px; color: var(--a-text-dim); font-size: 13px; margin-bottom: 16px; font-weight: 600; }
.a-back:hover { color: var(--a-accent-hover); }

.a-empty {
  text-align: center; padding: 56px 20px; color: var(--a-text-faint); font-size: 13px;
  border: 1px dashed var(--a-border); border-radius: var(--a-radius); background: var(--a-bg-2);
}
.a-empty .icon { width: 30px; height: 30px; margin-bottom: 10px; opacity: 0.6; }

/* Login page */
body.admin-login {
  margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(700px 400px at 20% 10%, rgba(16,185,129,0.14), transparent 60%),
    radial-gradient(700px 400px at 85% 90%, rgba(16,185,129,0.08), transparent 55%),
    var(--a-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--a-panel); border: 1px solid var(--a-border);
  border-radius: var(--a-radius); padding: 38px 34px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}
.login-card .brand-mark { justify-content: center; margin-bottom: 22px; }
.login-card h2 { text-align: center; margin: 0 0 3px; font-size: 19px; font-weight: 800; color: var(--a-text); }
.login-card .sub { text-align: center; color: var(--a-text-dim); font-size: 12.5px; margin-bottom: 26px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--a-text-dim); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 11px 13px; border-radius: var(--a-radius); border: 1px solid var(--a-border);
  background: var(--a-panel-2); color: var(--a-text); font-size: 14px;
}
.login-field input:focus { outline: none; border-color: var(--a-accent); }
.login-submit {
  width: 100%; padding: 12px; border-radius: var(--a-radius); border: none; margin-top: 6px;
  background: var(--a-accent); color: #ffffff; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background 0.15s;
}
.login-submit:hover { background: var(--a-accent-hover); }
.login-error {
  background: rgba(248,113,113,0.12); color: #fca5a5; border: 1px solid rgba(248,113,113,0.25);
  border-radius: var(--a-radius); padding: 10px 13px; font-size: 12.5px; margin-bottom: 16px;
}

@media (max-width: 860px) {
  .a-sidebar { display: none; }
  .a-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Standalone public status page — reuses admin console tokens, no sidebar/login */
.status-page {
  min-height: 100vh; max-width: 760px; margin: 0 auto; padding: 40px 24px 60px;
  position: relative; overflow: hidden;
  background-color: var(--a-bg-2);
  background-image:
    linear-gradient(var(--a-border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--a-border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
}
.status-page::before, .status-page::after {
  content: ''; position: fixed; width: 380px; height: 380px; border-radius: 50%;
  filter: blur(120px); z-index: 0; pointer-events: none;
}
.status-page::before { top: -10%; left: -10%; background: rgba(16, 185, 129, 0.14); }
.status-page::after { bottom: -10%; right: -10%; background: rgba(52, 211, 153, 0.09); }
.status-page > * { position: relative; z-index: 1; }
