/* ============================================================================
 * Zimac UI — the internal bootstrap.
 *
 * One stylesheet, shared by every internal front end (the proxy, metrics, auth,
 * payments, and whatever comes next) so they read as one product. Think of it
 * as our Bootstrap: design tokens + a small library of components, all using
 * plain semantic class names so a page is mostly markup.
 *
 * The visual language is lifted straight from the Axon/Stitcher desktop app
 * (apps/desktop/public/style.css): charcoal surfaces, the #6c63ff indigo
 * accent, the sage→indigo gradient wordmark, a faint "constellation" glow in
 * the canvas, glassy panels, and soft indigo glows on anything interactive —
 * tuned down to read as calm internal tooling rather than a chat surface.
 *
 * Before this file, metrics/ and auth/ each re-derived these tokens by hand and
 * drifted apart (bg #0f1117 vs #0e0f13, --text-muted vs --muted, …). This is
 * now the single source of truth; every token below is published under *both*
 * naming conventions those services used, so either spelling keeps working.
 *
 * Usage:  <link rel="stylesheet" href="/zimac-ui.css">
 *         (services serve it from zimac_common::ui::STYLESHEET)
 * ==========================================================================*/

/* ----------------------------------------------------------------------------
 * 1. Design tokens
 * --------------------------------------------------------------------------*/
:root {
  /* Surfaces — charcoal, layered darkest→lightest. */
  --zui-bg: #0f1117;
  --zui-surface: #1a1d27;
  --zui-surface-2: #232733;
  --zui-surface-3: #2b303d;
  --zui-border: #2a2e3a;
  --zui-border-strong: #3d4252;

  /* Ink. */
  --zui-text: #e6e8ee;
  --zui-text-muted: #8b8d98;
  --zui-text-faint: #5d616e;

  /* Brand + accent. The indigo is the spine; sage is its pink counterpoint. */
  --zui-accent: #6c63ff;
  --zui-accent-2: #8b84ff;
  --zui-accent-dim: #4f46e5;
  --zui-sage: #f472b6;

  /* Status. */
  --zui-ok: #34d399;
  --zui-warn: #fbbf24;
  --zui-danger: #f87171;
  --zui-info: #60a5fa;

  /* The Axon "agent" palette — the family's series colours, reused verbatim so
   * a chart or accent here is tinted the same as one in the desktop app. */
  --zui-c-sage: #f472b6;
  --zui-c-kai: #60a5fa;
  --zui-c-joy: #c084fc;
  --zui-c-cody: #2dd4bf;
  --zui-c-green: #34d399;
  --zui-c-amber: #fbbf24;

  /* Chart series cycle (read by JS that draws plots). */
  --zui-c1: #6c63ff;
  --zui-c2: #34d399;
  --zui-c3: #60a5fa;
  --zui-c4: #fbbf24;
  --zui-c5: #f472b6;
  --zui-c6: #2dd4bf;

  /* Type. */
  --zui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --zui-mono: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii. */
  --zui-radius-sm: 8px;
  --zui-radius: 10px;
  --zui-radius-lg: 14px;
  --zui-radius-pill: 999px;

  /* Elevation — deep, soft shadows with a 1px inner highlight (the app look). */
  --zui-shadow-1: 0 6px 16px -8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --zui-shadow-2: 0 10px 28px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --zui-shadow-3: 0 18px 48px -20px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(108, 99, 255, 0.06);
  --zui-glow: 0 0 0 3px rgba(108, 99, 255, 0.16);
  --zui-glow-strong: 0 6px 18px -6px rgba(108, 99, 255, 0.7);

  /* Signature gradients. */
  --zui-grad-accent: linear-gradient(150deg, var(--zui-accent), var(--zui-accent-dim));
  --zui-grad-wordmark: linear-gradient(90deg, var(--zui-sage), var(--zui-accent));
  /* The "constellation": pink top-right, indigo bottom-left — the same faint
   * ambience that makes the desktop canvas feel alive. Apply to .main / .app. */
  --zui-aurora:
    radial-gradient(ellipse 48% 36% at 92% -4%, rgba(244, 114, 182, 0.05), transparent),
    radial-gradient(ellipse 46% 40% at 4% 104%, rgba(108, 99, 255, 0.06), transparent);

  --zui-tap: 150ms ease;

  /* --- Bare-name aliases ---------------------------------------------------
   * So a page can write var(--accent) / var(--bg) / .btn without the prefix,
   * matching what metrics/ and auth/ already use. The prefixed names above are
   * the canonical ones; these forward to them. */
  --bg: var(--zui-bg);
  --surface: var(--zui-surface);
  --surface-2: var(--zui-surface-2);
  --surface-hover: var(--zui-surface-2);
  --surface-3: var(--zui-surface-3);
  --border: var(--zui-border);
  --text: var(--zui-text);
  --text-muted: var(--zui-text-muted);
  --muted: var(--zui-text-muted);
  --accent: var(--zui-accent);
  --accent-2: var(--zui-accent-2);
  --accent-dim: var(--zui-accent-dim);
  --sage: var(--zui-sage);
  --ok: var(--zui-ok);
  --green: var(--zui-ok);
  --warn: var(--zui-warn);
  --amber: var(--zui-warn);
  --danger: var(--zui-danger);
  --red: var(--zui-danger);
  --info: var(--zui-info);
  --c-kai: var(--zui-c-kai);
  --c-joy: var(--zui-c-joy);
  --c-cody: var(--zui-c-cody);
  --c1: var(--zui-c1);
  --c2: var(--zui-c2);
  --c3: var(--zui-c3);
  --c4: var(--zui-c4);
  --c5: var(--zui-c5);
  --c6: var(--zui-c6);
  --font: var(--zui-font);
  --mono: var(--zui-mono);
  --radius: var(--zui-radius);

  color-scheme: dark;
}

/* ----------------------------------------------------------------------------
 * 2. Reset + base
 * --------------------------------------------------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--zui-bg);
  color: var(--zui-text);
  font: 14px/1.5 var(--zui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--zui-accent-2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code,
kbd,
pre,
.mono {
  font-family: var(--zui-mono);
}

::selection {
  background: rgba(108, 99, 255, 0.32);
  color: #fff;
}

/* Scrollbars, matched to the dark theme. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--zui-border) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--zui-border);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--zui-border-strong);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ----------------------------------------------------------------------------
 * 3. App shell — sidebar + main, the standard internal-tool layout
 * --------------------------------------------------------------------------*/
.app,
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--zui-surface);
  border-right: 1px solid var(--zui-border);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 14px;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* The constellation glow — the family's signature ambience. */
  background: var(--zui-aurora);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--zui-border);
}
.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* A scrollable content region. */
.view {
  flex: 1;
  padding: 22px 24px;
  overflow-y: auto;
  animation: zui-fade 0.4s ease;
}

/* ----------------------------------------------------------------------------
 * 4. Brand wordmark
 * --------------------------------------------------------------------------*/
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--zui-grad-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  box-shadow: 0 6px 16px -5px rgba(108, 99, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
}
.brand-sub {
  font-size: 12px;
  color: var(--zui-text-muted);
}

/* The gradient ink — sage→indigo. Reach for it on wordmarks and section heroes. */
.gradient-text,
.brand-name.gradient,
h1.gradient {
  background: var(--zui-grad-wordmark);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ----------------------------------------------------------------------------
 * 5. Navigation
 * --------------------------------------------------------------------------*/
.side-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-label,
.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--zui-text-muted);
}
.section-title {
  font-size: 13px;
  margin: 22px 0 12px;
}

.nav,
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  position: relative;
  display: block;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--zui-text-muted);
  padding: 9px 11px;
  border-radius: var(--zui-radius-sm);
  font: 13px var(--zui-font);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--zui-tap), color var(--zui-tap);
}
.nav-item:hover {
  background: var(--zui-surface-2);
  color: var(--zui-text);
  text-decoration: none;
}
.nav-item.active {
  background: rgba(108, 99, 255, 0.14);
  color: var(--zui-text);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(var(--zui-sage), var(--zui-accent));
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.6);
}
.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: var(--zui-danger);
  color: #1a0c0c;
  box-shadow: 0 0 8px -1px var(--zui-danger);
}

.side-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--zui-text-muted);
  word-break: break-all;
}

/* ----------------------------------------------------------------------------
 * 6. Buttons
 * --------------------------------------------------------------------------*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--zui-grad-accent);
  color: #fff;
  border: none;
  border-radius: var(--zui-radius-sm);
  padding: 8px 14px;
  font: 600 13px var(--zui-font);
  cursor: pointer;
  box-shadow: var(--zui-glow-strong), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: filter var(--zui-tap), transform 80ms ease;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--zui-glow), var(--zui-glow-strong);
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--zui-border);
  color: var(--zui-text-muted);
  font-weight: 500;
  box-shadow: none;
}
.btn.ghost:hover {
  color: var(--zui-text);
  border-color: var(--zui-accent);
  filter: none;
}

.btn.link {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--zui-accent-2);
  font-weight: 500;
  padding: 4px 6px;
}
.btn.link:hover {
  text-decoration: underline;
  filter: none;
}
.btn.danger {
  background: linear-gradient(150deg, var(--zui-danger), #b91c1c);
}
.btn.sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn.lg {
  padding: 11px 20px;
  font-size: 15px;
}

/* ----------------------------------------------------------------------------
 * 7. Forms
 * --------------------------------------------------------------------------*/
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label,
label.field {
  font-size: 12px;
  color: var(--zui-text-muted);
}

.input,
.select,
.textarea,
input[type="text"].input,
input[type="password"].input,
input[type="email"].input,
input[type="number"].input,
input[type="search"].input {
  width: 100%;
  background: var(--zui-bg);
  color: var(--zui-text);
  border: 1px solid var(--zui-border);
  border-radius: var(--zui-radius-sm);
  padding: 8px 10px;
  font: 13px var(--zui-font);
  outline: none;
  transition: border-color var(--zui-tap), box-shadow var(--zui-tap);
}
.textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--zui-accent);
  box-shadow: var(--zui-glow);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--zui-text-faint);
}
.select.compact {
  width: auto;
  min-width: 150px;
  padding: 6px 9px;
  font-size: 12px;
}
.hint {
  font-size: 12px;
  color: var(--zui-text-muted);
  margin: 8px 0 0;
}

/* Toggle switch — the app's pill switch. */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--zui-surface-3);
  border: 1px solid var(--zui-border);
  border-radius: var(--zui-radius-pill);
  transition: background var(--zui-tap);
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--zui-tap);
}
.switch input:checked + .slider {
  background: var(--zui-grad-accent);
  border-color: transparent;
}
.switch input:checked + .slider::before {
  transform: translateX(18px);
}

/* ----------------------------------------------------------------------------
 * 8. Cards
 * --------------------------------------------------------------------------*/
.card {
  background: var(--zui-surface);
  border: 1px solid var(--zui-border);
  border-radius: var(--zui-radius-lg);
  padding: 18px;
  box-shadow: var(--zui-shadow-2);
}
.card.interactive {
  transition: border-color var(--zui-tap), transform 120ms ease;
}
.card.interactive:hover {
  border-color: var(--zui-accent-dim);
  transform: translateY(-1px);
}
.card h2 {
  font-size: 15px;
  margin: 0 0 14px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h2 {
  margin: 0;
}

/* Stat grid + stat cards. */
.cards,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.card-label,
.stat-label {
  font-size: 12px;
  color: var(--zui-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card-value,
.stat-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.card-value .unit,
.stat-value .unit {
  font-size: 15px;
  color: var(--zui-text-muted);
  margin-left: 2px;
}

/* ----------------------------------------------------------------------------
 * 9. Tables
 * --------------------------------------------------------------------------*/
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--zui-surface);
  border: 1px solid var(--zui-border);
  border-radius: var(--zui-radius);
  overflow: hidden;
  box-shadow: var(--zui-shadow-2);
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--zui-border);
  vertical-align: top;
}
.data-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--zui-text-muted);
  background: var(--zui-bg);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: var(--zui-surface-2);
}
.data-table .mono,
.data-table code {
  font-family: var(--zui-mono);
  font-size: 12px;
  color: var(--zui-text-muted);
}
.data-table .sub {
  font-size: 12px;
  color: var(--zui-text-muted);
  margin-top: 2px;
}

/* ----------------------------------------------------------------------------
 * 10. Badges, pills, status dots
 * --------------------------------------------------------------------------*/
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--zui-radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--zui-surface-2);
  color: var(--zui-text-muted);
}
.badge.ok,
.badge.active {
  background: rgba(52, 211, 153, 0.16);
  color: var(--zui-ok);
}
.badge.pending,
.badge.warn {
  background: rgba(251, 191, 36, 0.16);
  color: var(--zui-warn);
}
.badge.firing,
.badge.danger,
.badge.revoked {
  background: rgba(248, 113, 113, 0.18);
  color: var(--zui-danger);
}
.badge.info {
  background: rgba(96, 165, 250, 0.16);
  color: var(--zui-info);
}
.badge.accent {
  background: rgba(108, 99, 255, 0.18);
  color: var(--zui-accent-2);
}

/* Severity text. */
.sev {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sev.critical {
  color: var(--zui-danger);
}
.sev.warning {
  color: var(--zui-warn);
}
.sev.info {
  color: var(--zui-info);
}

/* Stat pills (counts). */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--zui-surface);
  border: 1px solid var(--zui-border);
  border-radius: var(--zui-radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--zui-text-muted);
}
.pill b {
  font-size: 18px;
  color: var(--zui-text);
  font-variant-numeric: tabular-nums;
}
.pill.firing b {
  color: var(--zui-danger);
}
.pill.pending b {
  color: var(--zui-warn);
}
.pill.ok b {
  color: var(--zui-ok);
}

/* Status dots — a glowing presence indicator. */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--zui-text-muted);
}
.dot.ok {
  background: var(--zui-ok);
  box-shadow: 0 0 7px var(--zui-ok);
}
.dot.bad {
  background: var(--zui-danger);
  box-shadow: 0 0 7px var(--zui-danger);
}
.dot.warn {
  background: var(--zui-warn);
  box-shadow: 0 0 7px var(--zui-warn);
}
.dot.live {
  background: var(--zui-ok);
  box-shadow: 0 0 7px var(--zui-ok);
  animation: zui-pulse 1.8s ease-in-out infinite;
}

/* ----------------------------------------------------------------------------
 * 11. Misc components
 * --------------------------------------------------------------------------*/

/* The empty / zero-state panel. */
.empty {
  color: var(--zui-text-muted);
  background: var(--zui-surface);
  border: 1px dashed var(--zui-border);
  border-radius: var(--zui-radius-lg);
  padding: 48px;
  text-align: center;
}

/* A secret / token reveal block. */
.secret {
  display: block;
  background: #000;
  color: var(--zui-accent-2);
  padding: 12px;
  border-radius: var(--zui-radius-sm);
  font-family: var(--zui-mono);
  font-size: 13px;
  word-break: break-all;
}

/* Keyboard hint. */
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--zui-border-strong);
  background: var(--zui-surface-2);
  font: 600 11px var(--zui-mono);
  color: var(--zui-text-muted);
}

/* Glassy floating panel (modals, popovers). */
.glass {
  background: radial-gradient(circle at 50% 0%, rgba(36, 39, 51, 0.92), rgba(15, 17, 23, 0.92));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid var(--zui-border);
  border-radius: var(--zui-radius-lg);
  box-shadow: var(--zui-shadow-3);
}

/* Toast. */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--zui-surface-2);
  border: 1px solid var(--zui-border);
  border-radius: var(--zui-radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: zui-toast-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 50;
}
.toast.err {
  border-color: var(--zui-danger);
  color: var(--zui-danger);
}
.toast.ok {
  border-color: var(--zui-ok);
  color: var(--zui-ok);
}

/* Banner (e.g. a degraded-upstream notice). */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  font-size: 13px;
  background: rgba(251, 191, 36, 0.12);
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--zui-warn);
}
.banner.danger {
  background: rgba(248, 113, 113, 0.12);
  border-bottom-color: rgba(248, 113, 113, 0.3);
  color: var(--zui-danger);
}

/* A thin gradient hairline divider. */
.hr {
  height: 1px;
  border: 0;
  margin: 18px 0;
  background: linear-gradient(90deg, transparent, var(--zui-border) 15%, var(--zui-border) 85%, transparent);
}

/* ----------------------------------------------------------------------------
 * 12. Utilities
 * --------------------------------------------------------------------------*/
.hidden,
[hidden] {
  display: none !important;
}
.muted {
  color: var(--zui-text-muted);
}
.faint {
  color: var(--zui-text-faint);
}
.nums {
  font-variant-numeric: tabular-nums;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.row.wrap {
  flex-wrap: wrap;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.grow {
  flex: 1;
}
.spacer {
  margin-left: auto;
}
.workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 960px;
}
.glow {
  box-shadow: var(--zui-glow-strong);
}

/* ----------------------------------------------------------------------------
 * 13. Keyframes
 * --------------------------------------------------------------------------*/
@keyframes zui-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes zui-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes zui-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes zui-toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes zui-shimmer {
  to { background-position: 200% 0; }
}

/* A skeleton shimmer for loading states. */
.skeleton {
  border-radius: var(--zui-radius-sm);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: zui-shimmer 1.3s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ----------------------------------------------------------------------------
 * 14. Responsive — collapse the sidebar to a rail on narrow viewports
 * --------------------------------------------------------------------------*/
@media (max-width: 720px) {
  .sidebar {
    width: 64px;
    padding: 14px 8px;
  }
  .brand-text,
  .side-label,
  .nav-item,
  .side-foot .status-text {
    display: none;
  }
}
