/* ============================================================
   Krakens — Saffron & India Design System
   Light mode: warm cream + saffron orange
   Dark mode: navy + orange
   Toggle via data-theme="dark" on <html>
   ============================================================ */

/* ── Local fonts (no Google Fonts dependency) ─────────────── */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/static/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/static/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-serif-display-normal-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-serif-display-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-serif-display-italic-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-serif-display-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Custom Properties ───────────────────────────────────── */

:root {
  --bg-page:          #fef9f0;
  --bg-card:          #ffffff;
  --bg-card-hover:    #ffffff;
  --border-card:      #fff3e0;
  --border-card-2:    #fed7aa;
  --border-card-hover:#ff6b00;
  --accent:           #ff6b00;
  --accent-2:         #ff9500;
  --accent-hover:     #e55a00;
  --accent-bg:        #fff3e0;
  --accent-bg-2:      #fef3e2;
  --text-primary:     #1a0a00;
  --text-secondary:   #78350f;
  --text-muted:       #92400e;
  --text-label:       #d97706;
  --nav-bg:           #ffffff;
  --nav-border:       #fff3e0;
  --nav-tab-bg:       #fef3e2;
  --nav-tab-color:    #92400e;
  --input-bg:         #ffffff;
  --input-border:     #fed7aa;
  --input-focus:      #ff6b00;
  --status-unpaid:    #f59e0b;
  --status-pending:   #3b82f6;
  --status-assigned:  #8b5cf6;
  --status-completed: #f59e0b;
  --status-confirmed: #22c55e;
  --error-bg:         rgba(239,68,68,0.1);
  --error-text:       #dc2626;
  --success-bg:       rgba(34,197,94,0.1);
  --success-text:     #16a34a;
  --shadow-card:      0 2px 8px rgba(255,107,0,0.06);
  --shadow-card-hover:0 16px 48px rgba(255,107,0,0.15);
  --shadow-badge:     0 4px 12px rgba(255,107,0,0.35);
  --shadow-btn:       0 4px 12px rgba(255,107,0,0.4);
  --radius-card:      22px;
  --radius-badge:     6px;
  --transition:       0.2s ease;
}

[data-theme="dark"] {
  --bg-page:          #0a0f1e;
  --bg-card:          rgba(255,255,255,0.04);
  --bg-card-hover:    rgba(255,255,255,0.06);
  --border-card:      rgba(255,255,255,0.07);
  --border-card-2:    rgba(255,255,255,0.1);
  --border-card-hover:rgba(255,107,0,0.5);
  --accent:           #ff7a20;
  --accent-2:         #ffaa40;
  --accent-hover:     #ff9040;
  --accent-bg:        rgba(255,107,0,0.12);
  --accent-bg-2:      rgba(255,107,0,0.08);
  --text-primary:     #ffffff;
  --text-secondary:   rgba(255,255,255,0.65);
  --text-muted:       rgba(255,255,255,0.4);
  --text-label:       rgba(255,180,80,0.8);
  --nav-bg:           rgba(10,15,30,0.97);
  --nav-border:       rgba(255,107,0,0.15);
  --nav-tab-bg:       rgba(255,107,0,0.08);
  --nav-tab-color:    rgba(255,180,80,0.9);
  --input-bg:         rgba(255,255,255,0.06);
  --input-border:     rgba(255,255,255,0.12);
  --shadow-card:      none;
  --shadow-card-hover:0 16px 48px rgba(255,107,0,0.12);
}

/* ── Reset ───────────────────────────────────────────────── */

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

/* ── Base ────────────────────────────────────────────────── */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

main { flex: 1; }

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

/* ── Nav ─────────────────────────────────────────────────── */

.nav {
  background: var(--nav-bg);
  border-bottom: 2px solid var(--nav-border);
  padding: 0 28px;
  height: 80px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.brand-badge {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #ff6b00, #ff9500);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 17px; color: #fff;
  box-shadow: var(--shadow-badge);
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Rajdhani', 'Arial Black', sans-serif;
  font-size: 20px; font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
}

.brand-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-muted); line-height: 1;
  margin-top: 2px;
}

.brand-tagline {
  font-size: 10px; font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1;
}

/* Pill nav tabs */
.nav-center {
  display: flex;
  background: var(--nav-tab-bg);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

.nav-tab {
  text-decoration: none;
  padding: 7px 20px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  color: var(--nav-tab-color);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-tab:hover { text-decoration: none; opacity: 0.85; }

.nav-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,0,0.4);
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  justify-self: end;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-card-2);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  transition: all var(--transition);
  display: flex; align-items: center;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.icon-sun  { display: none; }
.icon-moon { display: inline; }
[data-theme="dark"] .icon-sun  { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }

/* Hamburger button — hidden on desktop */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border-card-2);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
}
.nav-hamburger:hover { border-color: var(--accent); color: var(--accent); }

/* Desktop-only elements */
.nav-desktop-link {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-card-2);
  transition: all var(--transition);
}
.nav-desktop-link:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  text-decoration: none;
}

/* Mobile dropdown menu */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--nav-bg);
  border-bottom: 2px solid var(--nav-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.75rem 1rem 1rem;
  flex-direction: column;
  gap: 2px;
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-link {
  display: block;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--transition);
}
.nav-mobile-link:hover { background: var(--bg-card); text-decoration: none; }
.nav-mobile-link.active { color: var(--accent); }

.nav-mobile-divider {
  height: 1px;
  background: var(--border-card);
  margin: 0.5rem 0;
}
.nav-mobile-logout { color: var(--text-muted); font-size: 0.9rem; }
.nav-mobile-signin {
  margin-top: 0.25rem;
  background: var(--accent);
  color: #fff;
  text-align: center;
  border-radius: 999px;
}
.nav-mobile-signin:hover { background: var(--accent-hover); }

.logout-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-card-2);
  cursor: pointer;
  padding: 8px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  transition: color var(--transition), border-color var(--transition);
}
.logout-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ── Page layout ─────────────────────────────────────────── */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 28px 4rem;
}

.page-title {
  font-size: 1.75rem; font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.375rem;
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
  padding: 52px 28px 48px;
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 40px;
}
.hero-left { flex: 1; }

.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-bg);
  border: 1.5px solid var(--border-card-2);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px; font-weight: 700; color: #c2410c;
  margin-bottom: 18px;
}
[data-theme="dark"] .hero-pill { color: var(--accent); }

.hero h1 {
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.8px;
  color: var(--text-primary);
}
.hero h1 .accent { color: var(--accent); }

.hero-desc {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 15px; font-weight: 500;
  line-height: 1.6;
}

.trust-badges {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 28px;
}
.trust-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-card-2);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
}

.hero-visual {
  width: 220px; height: 200px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hero-visual img { width: 100%; height: 100%; object-fit: contain; }

/* ── Search ──────────────────────────────────────────────── */

.search-section {
  padding: 0 28px;
  max-width: 1280px; margin: 0 auto 36px;
}
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute; left: 18px; top: 50%;
  transform: translateY(-50%); color: var(--text-label);
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 16px;
  padding: 16px 16px 16px 52px;
  color: var(--text-primary);
  font-size: 14px; font-family: 'Inter', sans-serif; font-weight: 600;
  outline: none;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.search-input::placeholder { color: var(--text-label); font-weight: 500; }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,107,0,0.1);
}

/* ── Cards section ───────────────────────────────────────── */

.cards-section {
  max-width: 1280px; margin: 0 auto;
  padding: 0 28px 80px;
}

.cards-label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Category card */
.card {
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 22px 20px 18px;
  cursor: pointer;
  transition: all 0.25s;
  min-height: 205px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  overflow: hidden;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.card:focus, .card:focus-visible { outline: none; }
.card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.card-dot {
  position: absolute; top: 16px; right: 16px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
}

.card-count {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent);
}

.card-name {
  font-size: 19px; font-weight: 900;
  color: var(--text-primary);
  margin-top: 6px; line-height: 1.1;
}

.card-sub {
  font-size: 10px; font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  text-transform: uppercase; letter-spacing: 1px;
  margin-top: 5px;
}

.card-price-chip {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent-bg), var(--bg-page));
  border: 1px solid var(--border-card-2);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px; font-weight: 800; color: var(--accent);
  margin-top: 10px;
}


.card-bottom {
  display: flex; align-items: flex-end; justify-content: space-between;
}

.card-emoji {
  font-size: 50px; line-height: 1;
  transform: rotate(-6deg);
  filter: none;
}

.go-btn {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #ff6b00, #ff9500);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-btn);
  flex-shrink: 0;
}

/* Service list card (inside category drill-down) */
.service-card {
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 22px 20px;
  transition: all 0.25s;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
}
.service-card:focus, .service-card:focus-visible { outline: none; }
.service-card:hover {
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-card-hover);
}

.grid-2 {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ── Back button ─────────────────────────────────────────── */

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  padding: 4px 0; margin-bottom: 20px;
  transition: color var(--transition);
  font-family: inherit;
}
.back-btn:focus, .back-btn:focus-visible { outline: none; }
.back-btn:hover { color: var(--accent); }

/* ── Status badges ───────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-badge);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-unpaid    { background: rgba(245,158,11,0.15);  color: var(--status-unpaid);   }
.badge-pending   { background: rgba(59,130,246,0.15);  color: var(--status-pending);  }
.badge-assigned  { background: rgba(139,92,246,0.15);  color: var(--status-assigned); }
.badge-completed { background: rgba(251,191,36,0.15);  color: var(--status-completed);}
.badge-confirmed { background: rgba(34,197,94,0.15);   color: var(--status-confirmed);}
.badge-expired   { background: rgba(107,114,128,0.15); color: var(--text-muted);      }
.badge-reopened  { background: rgba(249,115,22,0.15);  color: #f97316;                 }

/* ── Tables ──────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 2px solid var(--border-card);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead { background: var(--accent-bg); }
th {
  text-align: left; padding: 0.75rem 1rem;
  font-size: 0.75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-label);
  border-bottom: 2px solid var(--border-card);
  white-space: nowrap;
}
td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border-card); color: var(--text-primary); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--accent-bg); }

/* ── Detail card ─────────────────────────────────────────── */

.detail-card {
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}
.detail-row {
  display: flex; gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-card);
  align-items: flex-start;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  font-size: 0.75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-label); min-width: 140px; padding-top: 0.125rem;
}
.detail-value { font-size: 0.925rem; color: var(--text-primary); flex: 1; }

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.25rem; border-radius: 10px;
  font-size: 0.875rem; font-weight: 700;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none; font-family: inherit;
}
.btn:focus, .btn:focus-visible { outline: none; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: linear-gradient(135deg, #ff6b00, #ff9500); color: #fff; box-shadow: 0 4px 12px rgba(255,107,0,0.35); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(255,107,0,0.45); opacity: 0.95; }

.btn-ghost { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--border-card-2); }
.btn-ghost:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }

.btn-danger { background: var(--error-bg); color: var(--error-text); }
.btn-danger:hover:not(:disabled) { background: var(--error-text); color: #fff; }

.btn-dark { background: var(--text-primary); color: #fff; }
.btn-dark:hover:not(:disabled) { opacity: 0.85; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }

/* ── Forms ───────────────────────────────────────────────── */

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.375rem; }
.form-input, .form-select {
  width: 100%;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 12px;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem; font-family: inherit;
  color: var(--text-primary);
  transition: all var(--transition); outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,107,0,0.1);
}
.form-input::placeholder { color: var(--text-label); font-weight: 500; }

/* ── Alerts ──────────────────────────────────────────────── */

.alert { border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.875rem; font-weight: 600; margin-bottom: 1rem; }
.alert-error   { background: var(--error-bg);   color: var(--error-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }

/* ── Spinner ─────────────────────────────────────────────── */

.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2.5px solid var(--border-card);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator  { display: inline-block; }

/* ── Empty state ─────────────────────────────────────────── */

.empty { text-align: center; padding: 4rem 2rem; color: var(--text-label); }
.empty-icon  { font-size: 3rem; margin-bottom: 1rem; }
.empty-text  { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-secondary); font-weight: 700; }
.empty-sub   { font-size: 0.875rem; color: var(--text-muted); }

/* ── Login page ──────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  background: var(--bg-page);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 40px rgba(255,107,0,0.1);
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand-badge {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #ff6b00, #ff9500);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 24px rgba(255,107,0,0.35);
  margin: 0 auto 14px;
}
.login-brand-name { font-size: 1.75rem; font-weight: 900; color: var(--text-primary); letter-spacing: -0.04em; }
.login-brand-tagline { font-size: 0.85rem; color: var(--text-label); font-weight: 600; margin-top: 4px; }

/* Login tabs */
.login-tabs {
  display: flex;
  background: var(--nav-tab-bg);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.5rem;
}
.login-tab {
  flex: 1; padding: 8px; border-radius: 8px;
  font-size: 13px; font-weight: 700; font-family: inherit;
  cursor: pointer; border: none;
  background: none; color: var(--nav-tab-color);
  transition: all var(--transition);
}
.login-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,0,0.35);
}

/* Dev credentials hint */
.login-hint {
  margin-top: 1.25rem;
  background: var(--accent-bg);
  border: 1.5px solid var(--border-card-2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
}
.login-hint-title {
  font-weight: 800; font-size: 10px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-label); margin-bottom: 8px;
}
.login-hint-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 4px 0; color: var(--text-secondary); font-weight: 600;
}
.login-hint-row:not(:last-child) { border-bottom: 1px solid var(--border-card); }
.login-hint-row code {
  font-family: monospace; font-size: 11px;
  color: var(--text-muted); background: var(--bg-card);
  padding: 2px 6px; border-radius: 4px;
}

#recaptcha-container { margin: 1rem 0; }

/* ── Admin stats ─────────────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: 18px; padding: 1.25rem; text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 900; color: var(--accent); letter-spacing: -0.04em; }
.stat-label  { font-size: 0.7rem; color: var(--text-label); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; font-weight: 700; }

/* ── Section ─────────────────────────────────────────────── */

.section { margin-bottom: 2.5rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-title { font-size: 1.1rem; font-weight: 900; color: var(--text-primary); }

/* ── Tabs ────────────────────────────────────────────────── */

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tab {
  padding: 6px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  background: var(--nav-tab-bg);
  border: 1.5px solid var(--border-card-2);
  color: var(--nav-tab-color);
  font-family: inherit;
  transition: all var(--transition);
}
.tab:hover, .tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,0,0.35);
}

/* ── Polling ─────────────────────────────────────────────── */

.status-poll { transition: opacity 0.3s ease; }

/* ── Utilities ───────────────────────────────────────────── */

.text-muted   { color: var(--text-muted); }
.text-label   { color: var(--text-label); }
.text-accent  { color: var(--accent); }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.75rem; }
.text-secondary { color: var(--text-secondary); }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.fw-900       { font-weight: 900; }
.mt-1  { margin-top: 0.25rem; }
.mt-2  { margin-top: 0.5rem; }
.mt-3  { margin-top: 0.75rem; }
.mt-4  { margin-top: 1rem; }
.mb-1  { margin-bottom: 0.25rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-3  { margin-bottom: 0.75rem; }
.mb-4  { margin-bottom: 1rem; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  /* Switch to hamburger menu */
  .nav { padding: 0 16px; }
  .nav-center { display: none !important; }
  .nav-desktop-only { display: none !important; }
  .nav-desktop-link { display: none !important; }
  .nav-hamburger { display: flex; }
  /* Keep nav-actions pinned to the right column even when nav-center is hidden */
  .nav-actions { grid-column: 3; }
}

@media (max-width: 680px) {
  .hero { flex-direction: column; padding: 32px 16px 28px; gap: 24px; }
  .hero-visual { width: 160px; height: 145px; align-self: center; }
  .hero h1 { font-size: 28px; }

  .search-section, .cards-section { padding-left: 16px; padding-right: 16px; }
  .page { padding: 1.25rem 16px 3rem; }

  .detail-row { flex-direction: column; gap: 0.25rem; }
  .detail-label { min-width: unset; }

  .login-card { padding: 2rem 1.25rem; }

  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Prevent iOS from zooming in when tapping an input */
  .form-input, .form-select, .search-input { font-size: 16px; }

}

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-card);
  padding: 2rem 5%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.site-footer-brand {
  margin-bottom: 1.5rem;
}

.site-footer-brand-name {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.site-footer-brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.site-footer-trust {
  display: flex;
  align-items: center;
  gap: 0.5rem 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.site-footer-trust a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer-trust a:hover { color: var(--accent); }

.site-footer-bottom {
  border-top: 1px solid var(--border-card);
  padding-top: 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.site-footer-copy {
  grid-column: 1;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: left;
}

.site-footer-links {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition);
}

.site-footer-links a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 680px) {
  .site-footer-bottom { grid-template-columns: 1fr; gap: 0.75rem; text-align: center; }
  .site-footer-copy { grid-column: 1; white-space: normal; }
  .site-footer-links { grid-column: 1; justify-content: center; flex-wrap: wrap; }
}

/* ── Cookie consent modal ────────────────────────────────────────────────────── */

.cm-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9998;
}
.cm-modal {
  display: none;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: min(420px, 92vw);
  border-radius: 20px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  /* solid backgrounds so both themes are readable */
  background: #ffffff;
  border: 1px solid #e5e7eb;
}
[data-theme="dark"] .cm-modal {
  background: #1a2035;
  border-color: rgba(255,255,255,0.12);
}
.cm-backdrop.cm-visible,
.cm-modal.cm-visible { display: block; }

.cm-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none;
  font-size: 1.3rem; line-height: 1;
  cursor: pointer; color: #6b7280;
}
[data-theme="dark"] .cm-close { color: rgba(255,255,255,0.4); }

.cm-title {
  font-size: 1.05rem; font-weight: 800;
  color: #111827; margin-bottom: 0.9rem;
}
[data-theme="dark"] .cm-title { color: #ffffff; }

.cm-body {
  font-size: 0.82rem; color: #4b5563;
  line-height: 1.65; margin-bottom: 0.75rem;
}
[data-theme="dark"] .cm-body { color: rgba(255,255,255,0.6); }

.cm-link {
  display: block; margin-bottom: 1.5rem;
  font-size: 0.82rem; color: var(--accent);
  text-decoration: underline;
}

.cm-actions { display: flex; flex-direction: column; gap: 0.65rem; }

.cm-btn {
  width: 100%; padding: 0.8rem;
  border-radius: 10px;
  border: 1.5px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 0.88rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.cm-btn:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .cm-btn {
  background: #232d45;
  border-color: rgba(255,255,255,0.15);
  color: #ffffff;
}
[data-theme="dark"] .cm-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Platform notice (services page) ─────────────────────────────────────────── */

.platform-notice {
  margin: 0 1.5rem 0;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card-2);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.platform-notice a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 0.35rem;
}

/* ── Static pages (About, Contact) ───────────────────────────────────────────── */

.static-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.static-hero {
  margin-bottom: 2.5rem;
}

.static-hero h1 {
  color: var(--text-primary);
}

.static-body { display: flex; flex-direction: column; gap: 2rem; }

.static-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 0.75rem;
}

.static-section p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.static-list {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.static-notice {
  background: var(--bg-card);
  border: 1px solid var(--border-card-2);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.static-notice p {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

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