/* AxlFlo Admin — shared visual language.
 *
 * The single canonical source of the look every page under admin.axlflo.ai
 * shares — extracted faithfully from AskGRADUS's admin console (the one
 * console that's actually been through months of live refinement: the
 * gradient-rule accent, the .card treatment, the tab-bar underline, the
 * floating Help button — none of this is invented for the portal, it's
 * the already-proven pattern, named and centralized so it stops living as
 * one accelerator's private inline <style> block.
 *
 * MOUNTED accelerator consoles (built under this portal from day one —
 * SETU, PRAMAAN): `<link rel="stylesheet" href="/shared/theme.css">` and
 * use these classes/variables directly. One fix here fixes every mounted
 * console at once — the entire point of centralizing it.
 *
 * GRADUS specifically: still lives on its own domain (admin.gradus.axlflo.ai)
 * and is NOT wired to fetch this file cross-origin — that would make a
 * live, currently-working, revenue-relevant console depend at runtime on
 * this portal's uptime, for a cosmetic-only benefit, before it's actually
 * migrated in. Its own inline styles are already visually identical to
 * this file (this file was extracted FROM them) — treat this file as the
 * spec GRADUS's own CSS should keep matching by hand until the day it
 * actually migrates into this portal, at which point it switches to
 * linking this file directly like every other mounted console.
 */

:root {
  /* Brand gradient stops — Indigo Blue -> Purple -> Fiery Coral, 50/40/10.
     AxlFlo Visual Language v1.2 canonical order; never reversed. */
  --ax-indigo: #4626BD;
  --ax-purple: #B124F6;
  --ax-coral: #EA4E43;

  /* Ink / text scale */
  --ax-ink: #0D1137;
  --ax-body: #3a3e57;
  --ax-muted: #5a5e73;
  --ax-label: #8a8d9e;

  /* Structure */
  --ax-hairline: #f0eefc;
  --ax-border: #d8daf7;
  --ax-border-hover: #c7bcf0;
  --ax-tint: #f7f4fc;
  --ax-tint-soft: #f5f3fd;

  /* Semantic (status chips, pass/fail, badges) */
  --ax-good-bg: #e8f7ef;
  --ax-good-fg: #157a52;
  --ax-bad-bg: #fdeaee;
  --ax-bad-fg: #b3223f;
  --ax-warn-bg: #fdf3e0;
  --ax-warn-fg: #96660a;

  --ax-font-body: Figtree, -apple-system, sans-serif;
  --ax-font-editorial: 'Spectral', Georgia, serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--ax-font-body); background: #fff; color: var(--ax-ink); }
button { font-family: var(--ax-font-body); cursor: pointer; }
input:focus, button:focus-visible { outline: 2px solid var(--ax-indigo); outline-offset: 1px; }

/* The one signature accent — used once per page (a header rule, a tab
   underline, a divider), never as a full-bleed wash. */
.ax-gradient-rule {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ax-indigo) 0%, var(--ax-purple) 50%, var(--ax-coral) 100%);
}

/* A brand wordmark accent — the gradient clipped to text, for a product
   name embedded in a heading (e.g. "Ask<span class="ax-wordmark">GRADUS</span>"). */
.ax-wordmark {
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(105deg, var(--ax-indigo) 0%, var(--ax-purple) 50%, var(--ax-coral) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ax-lede { font-family: var(--ax-font-editorial); font-style: italic; color: var(--ax-muted); }

.ax-pill-btn { padding: 10px 24px; border-radius: 9999px; border: none; font-size: 14px; font-weight: 500; }
.ax-pill-btn:disabled { opacity: .4; cursor: not-allowed; }

.ax-card {
  background: #fff;
  border: 1px solid var(--ax-border);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: 0 24px 80px rgba(70,38,189,.08);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ax-card:hover { border-color: var(--ax-border-hover); box-shadow: 0 8px 28px rgba(70,38,189,.12); }
.ax-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ax-card-icon {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--ax-tint-soft); color: var(--ax-indigo);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Page shell every console (mounted or not) should match: a centered
   column, a header row (title + wordmark + signed-in-as/sign-out
   cluster), the gradient rule as a divider, then content. */
.ax-shell { max-width: 880px; margin: 24px auto 48px; padding: 0 32px; }
.ax-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ax-header-title { font-size: 20px; font-weight: 800; margin: 0; }
.ax-header-actions { display: flex; align-items: center; gap: 12px; }
.ax-signed-in-as { font-size: 12px; color: var(--ax-label); }
.ax-signout-btn {
  padding: 8px 16px; border-radius: 9999px; border: 1px solid var(--ax-border);
  background: #fff; font-size: 12px; font-weight: 600; color: var(--ax-muted);
  white-space: nowrap; flex-shrink: 0;
}

.loading-mark { animation: ax-pulse 1.2s ease-in-out infinite; }
@keyframes ax-pulse {
  0%, 100% { transform: scale(0.92); opacity: .55; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* Tab bar — active tab marked with the gradient rule, not a flat underline. */
.ax-tabs { display: flex; gap: 4px; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.ax-tab-btn {
  flex: 1; padding: 10px 8px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ax-label); font-family: inherit;
  position: relative;
}
.ax-tab-btn.is-active { color: var(--ax-indigo); }
.ax-tab-btn.is-active::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ax-indigo) 0%, var(--ax-purple) 50%, var(--ax-coral) 100%);
}

/* Floating Help affordance — fixed bottom-right, survives scroll on a
   long tab, opens in a new tab so it never interrupts the current task. */
.ax-help-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  display: flex; align-items: center; gap: 7px; padding: 12px 18px; border-radius: 9999px;
  background: var(--ax-indigo); color: #fff; font-size: 14px; font-weight: 700;
  text-decoration: none; box-shadow: 0 4px 14px rgba(70,38,189,0.35);
}
.ax-help-fab .dot {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 9999px; background: rgba(255,255,255,0.25);
  font-size: 12px; flex-shrink: 0;
}

@media (max-width: 768px) {
  .ax-field-grid, .ax-stat-grid { grid-template-columns: 1fr; }
}
