/* ==========================================================
   HYVLO — Not another AI-generated SaaS template.

   Design principles:
   - Command center, not marketing site
   - Data is the hero — not gradients, not illustrations
   - Sharp edges. No pill buttons. No rounded-3xl cards.
   - Monospace numbers everywhere — this is a diagnostic tool
   - Dark navy, not black. Teal highlights, not rainbow.
   - Dense. Professional. Every pixel earns its keep.
   ========================================================== */

:root {
  /* Core palette */
  --navy:       #0d1520;
  --navy-mid:   #131d2e;
  --navy-light: #1a2740;
  --navy-muted: #243352;
  --slate:      #4a5e7a;
  --slate-light:#8899b4;
  --text:       #c8d4e6;
  --text-bright:#e8eef6;
  --white:      #f0f4fa;

  /* Accent */
  --teal:       #00bfa6;
  --teal-dim:   #00bfa622;
  --teal-glow:  #00bfa644;

  /* Semantic */
  --green:      #22c55e;
  --green-dim:  #22c55e22;
  --amber:      #f59e0b;
  --amber-dim:  #f59e0b22;
  --red:        #ef4444;
  --red-dim:    #ef444422;

  /* Type — Archivo (technical grotesque) for UI, JetBrains Mono for data.
     Archivo Expanded gives titles a wide, instrument-panel character. */
  --font-sans:    'Archivo', system-ui, -apple-system, sans-serif;
  --font-display: 'Archivo Expanded', 'Archivo', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  --text-xs:    0.6875rem;  /* 11px */
  --text-sm:    0.75rem;    /* 12px */
  --text-base:  0.8125rem;  /* 13px */
  --text-md:    0.875rem;   /* 14px */
  --text-lg:    1rem;       /* 16px */
  --text-xl:    1.25rem;    /* 20px */
  --text-2xl:   1.75rem;    /* 28px */
  --text-3xl:   2.5rem;     /* 40px */

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 16px;
  --gap-xl: 24px;
  --gap-2xl: 32px;
  --gap-3xl: 48px;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text);
  background-color: var(--navy);
  /* Faint blueprint grid + top glow — atmosphere of an ops console, not a flat page. */
  background-image:
    radial-gradient(1200px 480px at 78% -10%, rgba(0,191,166,0.06), transparent 60%),
    linear-gradient(rgba(36,51,82,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36,51,82,0.16) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--teal-glow); color: var(--white); }

/* ---- SHELL ---- */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; padding: var(--gap-xl); max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---- NAV ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-md) var(--gap-xl);
  background: rgba(19, 29, 46, 0.82);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--navy-muted);
  box-shadow: 0 1px 0 rgba(0,191,166,0.08), 0 8px 24px -16px rgba(0,0,0,0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}
.brand-mark {
  color: var(--teal);
  font-size: var(--text-lg);
  font-weight: 800;
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-md);
  color: var(--white);
  letter-spacing: 0.18em;
}
.brand-env {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--navy);
  background: var(--teal);
  padding: 1px 6px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.nav-links {
  display: flex;
  gap: var(--gap-lg);
}
.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-light);
  letter-spacing: 0.02em;
  padding: var(--gap-xs) 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover, .nav-link.active {
  color: var(--white);
  border-bottom-color: var(--teal);
  text-decoration: none;
}
.nav-status {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}
.pulse {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.mono-sm {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--slate-light);
  letter-spacing: 0.06em;
}

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--gap-xl);
  padding-bottom: var(--gap-md);
  border-bottom: 1px solid var(--navy-light);
}
.page-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.page-sub {
  font-size: var(--text-sm);
  color: var(--slate-light);
}

/* ---- STATS ROW ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--navy-light);
  border: 1px solid var(--navy-light);
  margin-bottom: var(--gap-xl);
}
.stat {
  background: var(--navy-mid);
  padding: var(--gap-lg);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: var(--gap-xs);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}
.stat-value.teal { color: var(--teal); }
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-value.red { color: var(--red); }
.stat-sub {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--slate-light);
  margin-top: var(--gap-xs);
}

/* ---- TABLE ---- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--navy-muted);
  background: var(--navy-mid);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
/* Header is NOT sticky: a page-level sticky <thead> gets displaced down by its
   `top` offset even at scroll 0, overlapping the first row. These tables are
   short enough that a static header reads cleanly. */
thead th {
  background: var(--navy);
  box-shadow: inset 0 -1px 0 var(--navy-muted);
}
th {
  text-align: left;
  padding: var(--gap-sm) var(--gap-lg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--slate-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: none;
  white-space: nowrap;
  user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--teal); }
td {
  padding: var(--gap-md) var(--gap-lg);
  border-bottom: 1px solid var(--navy-light);
  vertical-align: top;
}
/* Subtle zebra + a teal scan-line on hover — reads like selecting a row in a console. */
tbody tr:nth-child(even) td { background: rgba(26,39,64,0.28); }
tbody tr { position: relative; transition: background 0.12s; }
tbody tr:hover td { background: var(--navy-light); }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.cell-name {
  color: var(--text-bright);
  font-weight: 500;
}
.cell-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.cell-dim { color: var(--slate); }
.cell-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-ok     { color: var(--green); background: var(--green-dim); border-color: var(--green-dim); }
.badge-warn   { color: var(--amber); background: var(--amber-dim); border-color: var(--amber-dim); }
.badge-bad    { color: var(--red);   background: var(--red-dim);   border-color: var(--red-dim); }
.badge-neutral { color: var(--slate-light); background: var(--navy-light); border-color: var(--navy-muted); }

/* ---- REASON CHIPS (why a lead scored / survived) ---- */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid var(--teal-glow);
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.5;
}
.chip-dim { color: var(--slate-light); background: var(--navy-light); border-color: var(--navy-light); }

/* Killed rows in the kill-transparency view read as muted/struck. */
.row-killed td { color: var(--slate); opacity: 0.85; }
.row-killed .cell-name { color: var(--slate-light); }

/* ---- MARKETING HEALTH SCORECARD ---- */
.mktg-grade {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid currentColor;
}
.mktg-grade-a, .mktg-grade-b { color: var(--green); background: var(--green-dim); }
.mktg-grade-c { color: var(--amber); background: var(--amber-dim); }
.mktg-grade-d, .mktg-grade-f { color: var(--red); background: var(--red-dim); }
.mktg-dim { padding: var(--gap-sm) 0; border-bottom: 1px solid var(--navy-light); }
.mktg-dim:last-child { border-bottom: none; }
.chip-gap { color: var(--amber); background: var(--amber-dim); border-color: var(--amber-dim); }

/* ---- DEMO PREVIEW ---- */
.demo-frame-wrap {
  border: 1px solid var(--navy-muted);
  background: var(--navy);
  overflow: hidden;
  /* phone-ish aspect so the mobile-first demo reads true */
  height: 520px;
}
.demo-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.demo-issues { margin: var(--gap-xs) 0 0 var(--gap-lg); color: var(--slate-light); }
.demo-issues li { font-size: var(--text-sm); margin-bottom: 4px; }

/* ---- PHOTO STRIP (GBP photos on the lead page) ---- */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap-sm);
}
.photo-strip img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--navy-muted);
  display: block;
  transition: border-color 0.15s, transform 0.15s;
}
.photo-strip a:hover img { border-color: var(--teal); transform: scale(1.01); }

/* ---- SCORE BAR ---- */
.score-bar {
  width: 100%;
  min-width: 56px;
  height: 5px;
  background: var(--navy);
  border: 1px solid var(--navy-muted);
  overflow: hidden;
  margin-top: var(--gap-xs);
}
.score-fill {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.score-teal { background: var(--teal); box-shadow: 0 0 8px var(--teal-glow); }
.score-amber { background: var(--amber); box-shadow: 0 0 8px var(--amber-dim); }
.score-red { background: var(--red); box-shadow: 0 0 8px var(--red-dim); }
.score-label {
  display: none; /* value shown inline above the bar instead */
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: var(--gap-sm) var(--gap-lg);
  border: 1px solid var(--navy-muted);
  background: var(--navy-mid);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover {
  border-color: var(--teal);
  color: var(--white);
  text-decoration: none;
}
.btn-primary {
  background: var(--teal);
  color: var(--navy);
  border-color: var(--teal);
}
.btn-primary:hover {
  background: #00d4b8;
  border-color: #00d4b8;
  color: var(--navy);
}

/* ---- CARDS (sparse use) ---- */
.card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-light);
  padding: var(--gap-xl);
}
.card-title {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--gap-md);
}

/* ---- SECTIONS ---- */
.section { margin-bottom: var(--gap-2xl); }
.section-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--gap-md);
}

/* ---- CLIENT THEME ---- */
.client .nav { border-bottom-color: var(--teal-dim); }
.client .page-title { font-size: var(--text-2xl); }

/* ---- EMPTY STATE ---- */
.empty {
  text-align: center;
  padding: var(--gap-3xl);
  color: var(--slate);
}
.empty-title {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--slate-light);
  margin-bottom: var(--gap-sm);
}

/* ---- FUNNEL ROW ---- */
.funnel-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--navy-light);
  border: 1px solid var(--navy-light);
  margin-bottom: var(--gap-xl);
}
.funnel-step {
  flex: 1;
  background: var(--navy-mid);
  padding: var(--gap-lg);
  position: relative;
  transition: background 0.15s;
}
.funnel-step::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal-glow), transparent);
  opacity: 0.5;
}
.funnel-step:hover { background: var(--navy-light); }
.funnel-step + .funnel-step { margin-left: 1px; }
.funnel-arrow {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--slate);
  z-index: 1;
}
.funnel-pct {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--slate);
  margin-top: var(--gap-xs);
}

/* ---- SEARCH INPUT ---- */
.search-input {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--gap-sm) var(--gap-lg);
  background: var(--navy-mid);
  border: 1px solid var(--navy-muted);
  color: var(--white);
  letter-spacing: 0.02em;
  width: 280px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--slate); }
.search-input:focus { border-color: var(--teal); }

/* ---- ACTION BAR (sticky bottom) ---- */
.action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  padding: var(--gap-md) var(--gap-xl);
  background: var(--navy-mid);
  border-top: 1px solid var(--navy-light);
  z-index: 50;
}

/* ---- FINDING ITEM (audit/report) ---- */
.finding {
  display: flex;
  gap: var(--gap-md);
  align-items: flex-start;
  padding: var(--gap-md) 0;
}
.finding + .finding { border-top: 1px solid var(--navy-light); }
.finding-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
}
.finding-icon.critical { color: var(--red); }
.finding-icon.warning  { color: var(--amber); }
.finding-icon.good     { color: var(--green); }
.finding-title {
  color: var(--white);
  font-weight: 600;
  font-size: var(--text-md);
  margin-bottom: 2px;
}
.finding-detail {
  color: var(--slate-light);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ---- SUMMARY BANNER ---- */
.summary-banner {
  background: var(--navy-mid);
  border: 1px solid var(--navy-light);
  border-left: 3px solid var(--teal);
  padding: var(--gap-md) var(--gap-lg);
  margin-bottom: var(--gap-xl);
  font-size: var(--text-md);
  color: var(--text-bright);
  line-height: 1.6;
}

/* ---- GAP INDICATOR (competitor comparison) ---- */
.gap-indicator {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--red);
}
.gap-indicator.positive { color: var(--green); }

/* ---- COST CARD (client report) ---- */
.cost-card {
  background: var(--red-dim);
  border: 1px solid var(--red);
  padding: var(--gap-xl);
  margin-bottom: var(--gap-xl);
}
.cost-card .card-title { color: var(--red); }
.cost-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--white);
  margin: var(--gap-md) 0;
}

/* ---- CTA SECTION (client report) ---- */
.cta-section {
  background: var(--navy-mid);
  border: 2px solid var(--teal);
  padding: var(--gap-2xl);
  text-align: center;
  margin-bottom: var(--gap-2xl);
}
.cta-section .card-title {
  font-size: var(--text-xl);
  margin-bottom: var(--gap-lg);
}
.cta-price {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--slate-light);
  margin-top: var(--gap-md);
}
.cta-phone {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--teal);
  font-weight: 600;
  margin-top: var(--gap-lg);
  display: block;
}

/* ---- NOTES / TEXTAREA ---- */
.notes-area {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  padding: var(--gap-md);
  background: var(--navy);
  border: 1px solid var(--navy-muted);
  color: var(--text);
  width: 100%;
  min-height: 80px;
  resize: vertical;
  outline: none;
}
.notes-area:focus { border-color: var(--teal); }

/* ---- FORMS (CRM add/edit) ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-md);
}
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-light);
}
.form-input {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  padding: var(--gap-sm) var(--gap-md);
  background: var(--navy);
  border: 1px solid var(--navy-muted);
  border-radius: 8px;
  color: var(--white);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.form-input::placeholder { color: var(--slate); }
.form-input:focus { border-color: var(--teal); }
/* native date/select widgets render dark */
.form-input[type="date"] { color-scheme: dark; }
select.form-input { appearance: none; -webkit-appearance: none; cursor: pointer; }
.form-group label input[type="checkbox"] { accent-color: var(--teal); margin-right: 6px; }

/* ---- TIMESTAMP ---- */
.timestamp {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}
.timestamp::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--slate);
  display: inline-block;
}

/* ---- CHECKBOX (bulk select) ---- */
.row-check {
  width: 14px;
  height: 14px;
  accent-color: var(--teal);
  cursor: pointer;
}

/* ---- TWO-COL LAYOUT ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-xl);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .main { padding: var(--gap-md); }
  .nav { padding: var(--gap-sm) var(--gap-md); }
  .nav-links { display: none; }
  .nav-status .mono-sm { display: none; }

  .page-header {
    flex-direction: column;
    gap: var(--gap-md);
    align-items: flex-start;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .funnel-row {
    flex-direction: column;
    gap: 1px;
  }
  .funnel-step + .funnel-step { margin-left: 0; }
  .funnel-arrow { display: none; }

  .two-col {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    margin-left: calc(-1 * var(--gap-md));
    margin-right: calc(-1 * var(--gap-md));
    border-left: none;
    border-right: none;
  }

  .search-input { width: 100%; }

  .action-bar {
    flex-wrap: wrap;
    padding: var(--gap-md);
  }
  .action-bar .btn { flex: 1; justify-content: center; }

  /* Client report mobile */
  .client .main { padding: var(--gap-md); }

  .cta-section {
    padding: var(--gap-xl) var(--gap-md);
  }
  .cta-section .btn-primary {
    width: 100%;
    justify-content: center;
    font-size: var(--text-md);
    padding: var(--gap-lg);
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
  .stat-value { font-size: var(--text-xl); }
}

/* ---- MOBILE NAV TOGGLE ---- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: var(--text-lg);
    cursor: pointer;
    background: none;
    border: 1px solid var(--navy-muted);
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-mid);
    border-bottom: 1px solid var(--navy-light);
    padding: var(--gap-md) var(--gap-xl);
    gap: var(--gap-md);
  }
}
@media (min-width: 769px) {
  .nav-toggle { display: none; }
}

/* ---- HTMX LOADING INDICATOR ---- */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--navy-muted);
  border-top-color: var(--teal);
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- FOCUS INDICATORS (WCAG 2.4.7) ---- */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

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

/* ---- UTILITIES ---- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--gap-xs); }
.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }
.gap-lg { gap: var(--gap-lg); }
.gap-xl { gap: var(--gap-xl); }
.mt-sm { margin-top: var(--gap-sm); }
.mt-md { margin-top: var(--gap-md); }
.mt-lg { margin-top: var(--gap-lg); }
.mt-xl { margin-top: var(--gap-xl); }
.mb-md { margin-bottom: var(--gap-md); }
.mb-lg { margin-bottom: var(--gap-lg); }
.mb-xl { margin-bottom: var(--gap-xl); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-teal { color: var(--teal); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.text-white { color: var(--white); }
.text-dim { color: var(--slate); }
.text-right { text-align: right; }
.mono { font-family: var(--font-mono); }
.uppercase { text-transform: uppercase; letter-spacing: 0.06em; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ==========================================================
   CUSTOMER PORTAL (/app) — warmer than the admin console
   ========================================================== */
body.portal { background-color: var(--navy); }
.portal-nav { background: rgba(19,29,46,.9); }
.portal-main { max-width: 980px; }

.portal-hero { margin-bottom: var(--gap-2xl); }
.portal-greeting {
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl);
  color: var(--white); letter-spacing: .01em;
}
.portal-sub { color: var(--slate-light); font-size: var(--text-md); margin-top: 4px; }

.portal-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap-lg); margin-bottom: var(--gap-2xl); }
@media (max-width: 720px){ .portal-cards { grid-template-columns: 1fr; } }
.pcard {
  background: var(--navy-mid); border: 1px solid var(--navy-light);
  border-radius: var(--r, 14px); padding: var(--gap-xl); position: relative; overflow: hidden;
}
.pcard::before { content:""; position:absolute; top:0; left:0; right:0; height:2px;
  background: linear-gradient(90deg, var(--teal-glow), transparent); opacity:.6; }
.pcard-wide { grid-column: 1 / -1; }
.pcard-label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .1em;
  text-transform: uppercase; color: var(--slate); margin-bottom: var(--gap-sm); }
.pcard-big { font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl); color: var(--white); line-height: 1; }
.pcard-note { color: var(--slate-light); font-size: var(--text-sm); margin-top: 6px; }
.pcard-link { display: inline-block; margin-top: var(--gap-md); color: var(--teal); font-size: var(--text-sm); font-weight: 600; }

.portal-section { margin-bottom: var(--gap-2xl); }
.portal-section-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom: var(--gap-md); }
.portal-section h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--white); }
.portal-more { color: var(--teal); font-size: var(--text-sm); }

.portal-list { border: 1px solid var(--navy-light); border-radius: var(--r,14px); overflow: hidden; }
.portal-row { display:flex; justify-content:space-between; align-items:center; padding: var(--gap-md) var(--gap-lg);
  background: var(--navy-mid); border-bottom: 1px solid var(--navy-light); }
.portal-row:last-child { border-bottom: none; }
.pr-title { color: var(--text-bright); font-weight: 500; }
.pr-sub { color: var(--slate); font-size: var(--text-sm); }
.pr-status { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px; }
.pr-completed { color: var(--green); background: var(--green-dim); }
.pr-scheduled { color: var(--slate-light); background: var(--navy-light); }
.pr-in_progress { color: var(--amber); background: var(--amber-dim); }
.pr-cancelled { color: var(--red); background: var(--red-dim); }

.portal-empty { color: var(--slate); padding: var(--gap-xl); text-align: center;
  border: 1px dashed var(--navy-muted); border-radius: var(--r,14px); }

.portal-banner { display:flex; justify-content:space-between; align-items:center; gap: var(--gap-lg);
  background: linear-gradient(160deg, var(--navy-mid), var(--navy)); border: 1px solid var(--teal-glow);
  border-radius: var(--r,14px); padding: var(--gap-xl); flex-wrap: wrap; }
.pb-title { font-family: var(--font-display); font-weight: 700; color: var(--white); font-size: var(--text-lg); }
.pb-sub { color: var(--slate-light); font-size: var(--text-sm); margin-top: 4px; }

.portal-tiles { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap-lg); }
@media (max-width: 720px){ .portal-tiles { grid-template-columns: 1fr; } }
.ptile { display:block; background: var(--navy-mid); border: 1px solid var(--navy-light);
  border-radius: var(--r,14px); padding: var(--gap-xl); transition: border-color .15s, transform .15s; }
.ptile:hover { border-color: var(--teal); transform: translateY(-3px); text-decoration: none; }
.ptile-title { font-family: var(--font-display); font-weight: 700; color: var(--white); }
.ptile-sub { color: var(--slate-light); font-size: var(--text-sm); margin-top: 4px; }

.portal-table { width: 100%; }
.portal-table td { padding: var(--gap-sm) 0; border-bottom: 1px solid var(--navy-light); }
.portal-table td:first-child { color: var(--slate); width: 40%; }
.portal-table td:last-child { color: var(--text-bright); }
.portal-p { color: var(--text); margin: var(--gap-sm) 0 var(--gap-lg); }

.recovery-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--gap-sm); }
.recovery-code { font-family: var(--font-mono); font-size: var(--text-md); color: var(--teal);
  background: var(--navy); border: 1px solid var(--navy-muted); padding: 10px; text-align: center; border-radius: 8px; }
