/* ============================================================================
   Asku — main.css
   Mobile-first, single-file, no framework. Teesside aesthetic.
   Source of truth: Asku_OpenClaw_Master_Build_Brief v1.3, §6
   ============================================================================ */

/* ----------------------------------------------------------------------------
   Design tokens
---------------------------------------------------------------------------- */

:root {
  /* Colour */
  --c-primary:        #0F766E;   /* teal — main brand */
  --c-primary-dark:   #0B5C56;   /* hover/active */
  --c-primary-soft:   #CCFBF1;   /* tinted bg */
  --c-accent:         #F59E0B;   /* amber — STANDARD badge */
  --c-high:           #DC2626;   /* red    — HIGH badge */
  --c-low:            #10B981;   /* green  — LOW badge */
  --c-urgent:         #B91C1C;   /* deep red — expiring */
  --c-wa:             #25D366;   /* WhatsApp green — primary CTA */
  --c-wa-dark:        #1FB957;   /* WhatsApp green — hover/active */
  --c-text:           #1F2937;   /* near-black */
  --c-text-muted:     #6B7280;   /* grey */
  --c-text-soft:      #4B5563;   /* secondary copy */
  --c-bg:             #FAFAFA;   /* page background */
  --c-card:           #FFFFFF;   /* card surface */
  --c-border:         #E5E7EB;   /* hairlines */
  --c-border-strong:  #D1D5DB;
  --c-error:          #991B1B;   /* error badge text */
  --c-error-bg:       #FEE2E2;   /* error badge bg */

  /* Spacing (rem-friendly) */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-5:  1.25rem;
  --s-6:  1.5rem;
  --s-8:  2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* Layout */
  --content-max: 480px;    /* mobile-first single column */
  --tap-min: 48px;         /* accessible tap target */
}

/* ----------------------------------------------------------------------------
   Reset
---------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, ul, ol {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover, a:focus { color: var(--c-primary-dark); }

img, svg { display: block; max-width: 100%; height: auto; }

button { font-family: inherit; }

input, button, select, textarea { font-size: 1rem; }

/* ----------------------------------------------------------------------------
   Accessibility
---------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--c-primary);
  color: #fff;
  padding: var(--s-3) var(--s-4);
  z-index: 100;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ----------------------------------------------------------------------------
   Layout
---------------------------------------------------------------------------- */

.site-header,
.site-main,
.site-footer {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--s-4);
}

.site-header {
  padding-top: var(--s-4);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-card);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.site-main {
  padding-top: var(--s-6);
  padding-bottom: var(--s-8);
}

.site-footer {
  padding-top: var(--s-6);
  padding-bottom: var(--s-8);
  border-top: 1px solid var(--c-border);
  background: var(--c-card);
  color: var(--c-text-muted);
  font-size: 0.875rem;
}
.site-footer__inner { display: flex; flex-direction: column; gap: var(--s-3); }
.site-footer__tagline { color: var(--c-text); font-weight: 500; }
.site-footer__links {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.site-footer__links a {
  color: var(--c-text-muted);
  text-decoration: none;
}
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__legal { font-size: 0.8125rem; }

/* ----------------------------------------------------------------------------
   Brand
---------------------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
  color: var(--c-text);
  font-weight: 700;
  font-size: 1.125rem;
}
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--c-primary);
  color: #fff;
  font-weight: 800;
}
.brand__name { letter-spacing: -0.01em; }

.site-nav {
  display: flex;
  gap: var(--s-4);
  font-size: 0.9375rem;
}
.site-nav a {
  color: var(--c-text-soft);
  text-decoration: none;
}
.site-nav a:hover { color: var(--c-primary); }

/* ----------------------------------------------------------------------------
   Hero
---------------------------------------------------------------------------- */

.hero {
  padding: var(--s-8) 0 var(--s-10);
  text-align: center;
}
.hero__title {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
  color: var(--c-text);
  font-weight: 800;
}
.hero__lede {
  font-size: 1.125rem;
  color: var(--c-text-soft);
  margin-bottom: var(--s-8);
  line-height: 1.5;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}
.hero__hint {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin-top: var(--s-3);
  text-align: center;
  line-height: 1.5;
}

/* ----------------------------------------------------------------------------
   Sections
---------------------------------------------------------------------------- */

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--s-4);
  color: var(--c-text);
}
section + section { margin-top: var(--s-8); }

/* ----------------------------------------------------------------------------
   "How it works" steps
---------------------------------------------------------------------------- */

.how__steps {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.how__steps li {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  position: relative;
  padding-left: calc(var(--s-4) + 32px + var(--s-3));
}
.how__step-num {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375rem;
}
.how__step-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--s-1);
  color: var(--c-text);
}
.how__steps p {
  font-size: 0.9375rem;
  color: var(--c-text-soft);
  line-height: 1.5;
}

/* ----------------------------------------------------------------------------
   Trust (bulleted list)
---------------------------------------------------------------------------- */

.trust__list {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
}
.trust__list li {
  position: relative;
  padding-left: var(--s-5);
  margin-bottom: var(--s-2);
  font-size: 0.9375rem;
  color: var(--c-text-soft);
  line-height: 1.5;
}
.trust__list li:last-child { margin-bottom: 0; }
.trust__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--c-primary);
  font-weight: 700;
}

/* ----------------------------------------------------------------------------
   CTA
---------------------------------------------------------------------------- */

.cta {
  margin-top: var(--s-8);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-6) 0;
  text-align: center;
}
.cta__hint {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  text-align: center;
  max-width: 36ch;
  line-height: 1.5;
}

/* ----------------------------------------------------------------------------
   Buttons
---------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-align: center;
  line-height: 1.2;
  gap: var(--s-2);
}
.btn--primary {
  background: var(--c-wa);
  color: #fff;
  box-shadow: 0 2px 0 var(--c-wa-dark);
}
.btn--primary:hover,
.btn--primary:focus {
  background: var(--c-wa-dark);
  color: #fff;
}
.btn--whatsapp {
  background: var(--c-wa);
  color: #fff;
  box-shadow: 0 2px 0 var(--c-wa-dark);
}
.btn--whatsapp:hover,
.btn--whatsapp:focus {
  background: var(--c-wa-dark);
  color: #fff;
}
.btn--outline {
  background: transparent;
  color: var(--c-primary);
  border-color: var(--c-primary);
  box-shadow: none;
}
.btn--outline:hover,
.btn--outline:focus {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.btn__icon {
  font-size: 1.25em;
  line-height: 1;
}
.btn--block {
  display: flex;
  width: 100%;
}
.btn--large {
  min-height: 60px;
  font-size: 1.125rem;
  padding: var(--s-4) var(--s-6);
  letter-spacing: 0.01em;
}

/* ----------------------------------------------------------------------------
   Lead card (the main thing on /c/<token>)
---------------------------------------------------------------------------- */

.lead-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
  box-shadow: var(--shadow-sm);
}
.lead-card--done     { border-color: var(--c-border-strong); }
.lead-card--expired  { background: #F9FAFB; }
.lead-card--notfound { background: #FEF2F2; border-color: #FECACA; }

.revisit-banner {
  background: #ECFDF5;
  border: 1px solid var(--c-primary);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-4);
  text-align: center;
}
.revisit-banner__text {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-primary);
  line-height: 1.4;
}

.lead-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
}
.lead-card__id {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--c-text-muted);
}
.lead-card__title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: var(--s-1);
  letter-spacing: -0.01em;
}
.lead-card__area {
  font-size: 0.9375rem;
  color: var(--c-text-soft);
  margin-bottom: var(--s-4);
}
.lead-card__summary {
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--c-text);
  margin-bottom: var(--s-4);
  padding: var(--s-3);
  background: var(--c-bg);
  border-radius: var(--r-md);
  border-left: 3px solid var(--c-primary);
}
.lead-card__expires {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  margin: 0;
}
.lead-card__expires--urgent {
  color: var(--c-urgent);
  font-weight: 600;
}
.lead-card__hint {
  font-size: 0.9375rem;
  color: var(--c-text-soft);
  line-height: 1.5;
  margin-top: var(--s-3);
}

/* ----------------------------------------------------------------------------
   Badges (urgency tags)
---------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--s-1) var(--s-3);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  line-height: 1.5;
}
.badge--high {
  background: var(--c-high);
  color: #fff;
}
.badge--standard {
  background: var(--c-accent);
  color: #fff;
}
.badge--low {
  background: var(--c-low);
  color: #fff;
}
.badge--done {
  background: var(--c-card);
  color: var(--c-text-soft);
  border-color: var(--c-border-strong);
}
.badge--expired {
  background: var(--c-card);
  color: var(--c-text-soft);
  border-color: var(--c-border-strong);
}
.badge--error {
  background: var(--c-error-bg);
  color: var(--c-error);
  border-color: var(--c-error);
}

/* Pricing table uses raw badges so the colour names match urgency:
   .badge--high (red), .badge--standard (amber), .badge--low (green). */

/* ----------------------------------------------------------------------------
   Status message (unlock-count social proof / scarcity)
---------------------------------------------------------------------------- */

.status-message {
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-4);
  border: 1px solid;
}
.status-message--fresh {
  background: #ECFDF5;       /* mint */
  border-color: #10B981;
  color:      #047857;
}
.status-message--partial {
  background: #FEF3C7;       /* amber */
  border-color: #F59E0B;
  color:      #92400E;
}
.status-message--final {
  background: #FEE2E2;       /* red */
  border-color: #DC2626;
  color:      #991B1B;
}
.status-message__title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: var(--s-1);
  letter-spacing: -0.01em;
}
.status-message__body {
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ----------------------------------------------------------------------------
   Cost box
---------------------------------------------------------------------------- */

.cost-box {
  background: var(--c-primary-soft);
  border: 1px solid var(--c-primary);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
  text-align: center;
}
.cost-box__label {
  font-size: 0.875rem;
  color: var(--c-text-soft);
  margin-bottom: var(--s-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.cost-box__amount {
  margin-bottom: var(--s-2);
}
.cost-box__free {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: -0.02em;
}
.cost-box__pounds {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.02em;
}
.cost-box__sub {
  display: block;
  font-size: 0.875rem;
  color: var(--c-text-soft);
  margin-top: var(--s-1);
}
.cost-box__balance {
  font-size: 0.875rem;
  color: var(--c-text-soft);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid rgba(15, 118, 110, 0.2);
}

/* ----------------------------------------------------------------------------
   Claim form
---------------------------------------------------------------------------- */

.claim-form {
  margin-bottom: var(--s-4);
}
.claim-form__hint {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  text-align: center;
  margin-top: var(--s-2);
  line-height: 1.4;
}

.claim-form__disclaimer {
  background: #F1F5F9;          /* soft neutral slate */
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-primary);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-top: var(--s-3);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--c-text-soft);
  text-align: left;
}

/* ----------------------------------------------------------------------------
   Phone reveal (post-claim)
---------------------------------------------------------------------------- */

.phone-box {
  background: var(--c-card);
  border: 2px solid var(--c-primary);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
  text-align: center;
}
.phone-box__label {
  font-size: 0.875rem;
  color: var(--c-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.phone-box__number {
  margin-bottom: var(--s-2);
}
.phone-box__call {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--c-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}
.phone-box__call:hover { text-decoration: underline; }
.phone-box__claim {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  margin: 0;
}
.claim-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin-top: var(--s-2);
}
.claim-actions__btn {
  width: 100%;
}

/* ----------------------------------------------------------------------------
   FAQ accordion
---------------------------------------------------------------------------- */

.faq {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--c-text);
  list-style: none;
  position: relative;
  padding-right: var(--s-5);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--c-text-muted);
}
.faq[open] summary::after { content: "−"; }
.faq ol {
  margin-top: var(--s-3);
  padding-left: var(--s-5);
  list-style: decimal;
}
.faq ol li {
  font-size: 0.9375rem;
  color: var(--c-text-soft);
  margin-bottom: var(--s-2);
  line-height: 1.5;
}

/* ----------------------------------------------------------------------------
   Pricing table (For tradespeople page)
---------------------------------------------------------------------------- */

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--s-3);
}
.pricing-table__caption {
  caption-side: top;
  text-align: left;
  font-size: 0.875rem;
  color: var(--c-text-muted);
  padding-bottom: var(--s-2);
}
.pricing-table th,
.pricing-table td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border);
  font-size: 0.9375rem;
}
.pricing-table tbody tr:last-child th,
.pricing-table tbody tr:last-child td {
  border-bottom: 0;
}
.pricing-table thead th {
  background: var(--c-bg);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-soft);
}
.pricing-table td {
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--c-text);
}
.pricing-table tbody th {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 500;
}
.pricing__note {
  font-size: 0.875rem;
  color: var(--c-text-soft);
  margin-top: var(--s-2);
}

/* ----------------------------------------------------------------------------
   Legal pages (Privacy / Terms / Business Terms)
---------------------------------------------------------------------------- */

.legal {
  color: var(--c-text);
}

.legal__header {
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border);
}

.legal__title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin-bottom: var(--s-2);
}

.legal__updated {
  font-size: 0.875rem;
  color: var(--c-text-muted);
}

.legal__section {
  margin-bottom: var(--s-6);
}

.legal__section:last-child {
  margin-bottom: 0;
}

.legal__section h2 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin-bottom: var(--s-3);
}

.legal__section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--s-2);
  margin-top: var(--s-4);
}

.legal__section h3:first-child {
  margin-top: 0;
}

.legal__section p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--c-text-soft);
  margin-bottom: var(--s-3);
}

.legal__section p:last-child {
  margin-bottom: 0;
}

.legal__section ul {
  list-style: disc;
  padding-left: var(--s-5);
  margin-bottom: var(--s-3);
}

.legal__section ul:last-child {
  margin-bottom: 0;
}

.legal__section ul li {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--c-text-soft);
  margin-bottom: var(--s-2);
}

.legal__section ul li:last-child {
  margin-bottom: 0;
}

.legal__section strong {
  color: var(--c-text);
  font-weight: 700;
}

.legal__section a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal__section a:hover,
.legal__section a:focus {
  color: var(--c-primary-dark);
}

@media (min-width: 600px) {
  .legal__title {
    font-size: 2rem;
  }
}

/* ----------------------------------------------------------------------------
   Wider viewports — keep single column, just add breathing room
---------------------------------------------------------------------------- */

@media (min-width: 600px) {
  .hero__title { font-size: 2rem; }
  .lead-card__title { font-size: 1.5rem; }
  :root { --content-max: 560px; }
}

@media (min-width: 900px) {
  :root { --content-max: 640px; }
  body { background: linear-gradient(180deg, var(--c-bg) 0%, #F3F4F6 100%); }
  .site-header,
  .site-footer {
    max-width: 720px;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
  }
}

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

/* ============================================================================
   Admin pages — wider layout, stats grid, filter bar, data tables
   Read-only admin UI added at Stephen 2026-08-08 20:14 UTC (msg 6145).
   7 locks: remove broken routes / UTC day / simple filters / read-only /
   require_admin / £ balances / outward postcode_area on leads.
   ============================================================================ */

/* Wider content for admin pages — base.html caps .site-main at
   --content-max (480–640px) which is too narrow for tables/stats. */
[class*="page--admin"] .site-main {
  max-width: 1024px;
}

/* ---- Admin nav bar (Dashboard / Providers / Leads / Channels / Logout) ---- */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-border);
  align-items: center;
}
.admin-nav__link {
  display: inline-block;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  text-decoration: none;
  color: var(--c-text-soft);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  min-height: 36px;
  line-height: 1.2;
}
.admin-nav__link:hover,
.admin-nav__link:focus {
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
}
.admin-nav__link--active {
  background: var(--c-primary);
  color: #fff;
}
.admin-nav__link--active:hover,
.admin-nav__link--active:focus {
  background: var(--c-primary-dark);
  color: #fff;
}
.admin-nav__link--logout {
  margin-left: auto;
  color: var(--c-error);
}
.admin-nav__link--logout:hover,
.admin-nav__link--logout:focus {
  background: var(--c-error-bg);
  color: var(--c-error);
}

/* ---- Admin hero (replaces .hero on admin pages) ------------------------ */
.admin-hero {
  padding: var(--s-4) 0 var(--s-6);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--s-6);
}
.admin-hero__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--c-text);
  margin: 0 0 var(--s-2);
  letter-spacing: -0.01em;
}
.admin-hero__lede {
  color: var(--c-text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: none;
  margin: 0;
  text-align: left;
}
.admin-hero__lede code {
  background: var(--c-bg);
  padding: 0 var(--s-1);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ---- Stats grid (dashboard counts) ------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}
.stat-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
}
.stat-card__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--s-2);
}
.stat-card__value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--c-primary);
  line-height: 1;
  margin-bottom: var(--s-2);
  font-variant-numeric: tabular-nums;
}
.stat-card__sub {
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

/* ---- Quick links ------------------------------------------------------- */
.admin-quicklinks {
  margin-top: var(--s-6);
}
.admin-quicklinks__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* ---- Filter bar -------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: flex-end;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  margin-bottom: var(--s-6);
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  flex: 1 1 180px;
  min-width: 140px;
}
.filter-field__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-text-muted);
}
.filter-field__input {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--c-card);
  color: var(--c-text);
  min-height: 40px;
}
.filter-bar__actions {
  display: flex;
  gap: var(--s-2);
  align-items: flex-end;
}
.btn--small {
  min-height: 40px;
  padding: var(--s-2) var(--s-4);
  font-size: 0.9rem;
}
.btn--ghost {
  background: transparent;
  color: var(--c-text-muted);
  border-color: var(--c-border-strong);
  box-shadow: none;
}
.btn--ghost:hover,
.btn--ghost:focus {
  background: var(--c-bg);
  color: var(--c-text);
}

/* ---- Admin data table -------------------------------------------------- */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-card);
  box-shadow: var(--shadow-sm);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table thead {
  background: var(--c-bg);
  border-bottom: 2px solid var(--c-border-strong);
}
.admin-table th {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  font-weight: 700;
  color: var(--c-text-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.admin-table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}
.admin-table tbody tr:hover {
  background: var(--c-bg);
}
.admin-table code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--c-bg);
  padding: 0 var(--s-1);
  border-radius: var(--r-sm);
}
.admin-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Status badges ----------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 0.15em var(--s-2);
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge--ok {
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
}
.badge--off {
  background: var(--c-bg);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border-strong);
}
.badge--warn {
  background: var(--c-error-bg);
  color: var(--c-error);
}

/* ---- Empty state + back link ------------------------------------------ */
.admin-empty {
  padding: var(--s-8);
  text-align: center;
  color: var(--c-text-muted);
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-6);
}
.admin-back {
  margin-top: var(--s-6);
  font-size: 0.9rem;
  color: var(--c-text-muted);
}

/* ---- Mobile tweaks ---------------------------------------------------- */
@media (max-width: 600px) {
  .admin-hero__title { font-size: 1.5rem; }
  .stat-card__value { font-size: 1.75rem; }
  .stat-card { padding: var(--s-4); }
  .filter-bar { padding: var(--s-3); gap: var(--s-3); }
  .filter-field { flex-basis: 100%; min-width: 0; }
  .filter-bar__actions { flex-basis: 100%; }
  .admin-table { font-size: 0.82rem; }
  .admin-table th,
  .admin-table td { padding: var(--s-2) var(--s-3); }
  .admin-nav__link--logout { margin-left: 0; }
}
