/* ==========================================================================
   Good Game Network — ISP Job Order App
   Production stylesheet (dark/light themes, Inter font)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens — dark theme (default)
   -------------------------------------------------------------------------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;

  /* Brand & accent */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-soft: rgba(59, 130, 246, 0.14);
  --color-primary-ring: rgba(59, 130, 246, 0.45);
  --color-accent: #06b6d4;
  --color-accent-soft: rgba(6, 182, 212, 0.12);

  /* Surfaces */
  --color-bg: #0b0f17;
  --color-bg-elevated: #111827;
  --color-bg-subtle: #151c2c;
  --color-surface: #1a2235;
  --color-surface-hover: #1f2a40;
  --color-border: rgba(148, 163, 184, 0.14);
  --color-border-strong: rgba(148, 163, 184, 0.28);

  /* Text */
  --color-text: #e8edf5;
  --color-text-muted: #94a3b8;
  --color-text-subtle: #64748b;
  --color-heading: #f8fafc;

  /* Semantic */
  --color-success: #22c55e;
  --color-success-soft: rgba(34, 197, 94, 0.14);
  --color-success-text: #86efac;
  --color-warning: #f59e0b;
  --color-warning-soft: rgba(245, 158, 11, 0.14);
  --color-warning-text: #fcd34d;
  --color-danger: #ef4444;
  --color-danger-soft: rgba(239, 68, 68, 0.14);
  --color-danger-text: #fca5a5;
  --color-info: #38bdf8;
  --color-info-soft: rgba(56, 189, 248, 0.14);

  /* Header / glass */
  --header-bg: rgba(11, 15, 23, 0.82);
  --header-border: rgba(148, 163, 184, 0.1);
  --header-blur: 16px;
  --header-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);

  /* Shadows & radii */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 0 1px rgba(59, 130, 246, 0.25), 0 8px 32px rgba(59, 130, 246, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Layout */
  --content-max: 1120px;
  --content-wide: 1280px;
  --header-height: auto;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Focus */
  --focus-ring: 0 0 0 3px var(--color-primary-ring);

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 320ms ease;
}

/* --------------------------------------------------------------------------
   2. Design tokens — light theme
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  color-scheme: light;

  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: rgba(37, 99, 235, 0.1);
  --color-primary-ring: rgba(37, 99, 235, 0.35);
  --color-accent: #0891b2;
  --color-accent-soft: rgba(8, 145, 178, 0.1);

  --color-bg: #f1f5f9;
  --color-bg-elevated: #ffffff;
  --color-bg-subtle: #e2e8f0;
  --color-surface: #ffffff;
  --color-surface-hover: #f8fafc;
  --color-border: rgba(15, 23, 42, 0.1);
  --color-border-strong: rgba(15, 23, 42, 0.18);

  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-subtle: #64748b;
  --color-heading: #020617;

  --color-success-soft: rgba(34, 197, 94, 0.12);
  --color-success-text: #15803d;
  --color-warning-soft: rgba(245, 158, 11, 0.12);
  --color-warning-text: #b45309;
  --color-danger-soft: rgba(239, 68, 68, 0.1);
  --color-danger-text: #b91c1c;
  --color-info-soft: rgba(56, 189, 248, 0.12);

  --header-bg: rgba(255, 255, 255, 0.88);
  --header-border: rgba(15, 23, 42, 0.08);
  --header-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 0 1px rgba(37, 99, 235, 0.2), 0 8px 32px rgba(37, 99, 235, 0.08);
}

/* --------------------------------------------------------------------------
   3. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6, 182, 212, 0.06), transparent);
  background-attachment: fixed;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(8, 145, 178, 0.05), transparent);
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-sm);
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h3 { font-size: 1.125rem; }

p {
  margin: 0 0 var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

ul, ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.25rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-accent);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

.card-divider {
  margin: var(--space-lg) 0;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Utility text */
.muted-inline {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.page-intro {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  max-width: 62ch;
  margin-bottom: var(--space-lg);
}

.empty {
  color: var(--color-text-muted);
  font-style: italic;
  margin: var(--space-md) 0;
}

.form-hint {
  color: var(--color-text-subtle);
  font-size: 0.875rem;
  margin: var(--space-xs) 0 0;
}

.sub {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   4. Site header — sticky, blurred, 3-column grid
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(var(--header-blur));
  -webkit-backdrop-filter: blur(var(--header-blur));
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);
}

.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
  min-height: 64px;
  padding: var(--space-sm) 0;
}

.header-top-spacer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.header-brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.header-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  min-width: 0;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--color-heading);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: opacity var(--transition-fast);
}

.brand:hover {
  color: var(--color-heading);
  text-decoration: none;
  opacity: 0.88;
}

.brand-centered {
  justify-content: center;
  text-align: center;
}

.brand-logo {
  height: 28px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* Guest nav (left column) */
.guest-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.guest-nav a {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.guest-nav a:hover {
  color: var(--color-text);
  background: var(--color-primary-soft);
  text-decoration: none;
}

/* User bar */
.user-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.user-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.user-profile-link:hover {
  background: var(--color-primary-soft);
  text-decoration: none;
  color: var(--color-text);
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border-strong);
  background: var(--color-bg-subtle);
}

.profile-avatar-lg {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border-strong);
  background: var(--color-bg-subtle);
  box-shadow: var(--shadow-sm);
}

.profile-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.theme-toggle-icon {
  font-size: 1.125rem;
  line-height: 1;
}

/* Main nav — pill links */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0 var(--space-sm);
  border-top: 1px solid var(--color-border);
  margin-top: 0;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition:
    color var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.main-nav a:hover {
  color: var(--color-text);
  background: var(--color-primary-soft);
  text-decoration: none;
}

.main-nav a.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-color: rgba(59, 130, 246, 0.25);
  font-weight: 600;
}

[data-theme="light"] .main-nav a.active {
  border-color: rgba(37, 99, 235, 0.2);
}

/* Nav section body modifiers */
body.nav-guest .main-content {
  max-width: var(--content-wide);
}

body.page-landing .site-header {
  background: var(--header-bg);
}

body.page-landing .main-content {
  padding-top: 0;
  max-width: none;
}

/* --------------------------------------------------------------------------
   5. Main content & footer
   -------------------------------------------------------------------------- */
.main-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
  min-height: calc(100vh - 180px);
}

.main-content > h1:first-child {
  margin-bottom: var(--space-lg);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.site-footer-guest {
  padding-top: var(--space-2xl);
}

.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto var(--space-xl);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
  text-align: left;
}

.footer-brand strong {
  display: block;
  font-size: 1.125rem;
  color: var(--color-heading);
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.footer-links h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-sm);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.footer-copy {
  color: var(--color-text-subtle);
  font-size: 0.8125rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn:hover {
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-xs), 0 2px 12px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover), #1e40af);
  color: #fff;
  box-shadow: var(--shadow-sm), 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn-success {
  background: var(--color-success);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
  background: #16a34a;
  color: #fff;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: #dc2626;
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-finish {
  min-width: 160px;
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  border-color: var(--color-border-strong);
}

.card h2 {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-size: 1.25rem;
}

.card h2 + .page-intro,
.card h2 + p {
  margin-top: calc(var(--space-sm) * -1);
}

.card-highlight {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, var(--color-surface), var(--color-primary-soft));
  box-shadow: var(--shadow-glow);
}

.form-card-wide {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.profile-card {
  text-align: center;
}

/* --------------------------------------------------------------------------
   8. Stats & report stats
   -------------------------------------------------------------------------- */
.stats,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat,
.report-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.stat:hover,
.report-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.stat .num,
.report-stat .num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-heading);
  letter-spacing: -0.03em;
}

.stat .label,
.report-stat .label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
}

.stat-cancelled .num {
  color: var(--color-danger-text);
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="search"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="month"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group select,
.form-group textarea,
.toolbar-search input[type="search"],
.toolbar input[type="search"],
.payment-history-filters input,
.report-month-form input,
.customer-search input {
  width: 100%;
  max-width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.toolbar-search input:focus,
.payment-history-filters input:focus,
.report-month-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
  background: var(--color-surface);
}

.form-group input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: var(--color-bg-subtle);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* Password toggle (injected by app.js) */
.password-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.password-wrap input {
  flex: 1;
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.password-toggle:hover {
  color: var(--color-text);
  background: var(--color-primary-soft);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Material lines (tech job form) */
.material-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.material-item-select {
  flex: 1 1 200px;
  min-width: 160px;
}

.material-qty-input {
  flex: 0 1 100px;
  min-width: 80px;
}

/* Payment proof forms */
.payment-proof-form {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.payment-proof-form--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.payment-proof-form--inline input[type="file"] {
  flex: 1 1 140px;
  min-width: 120px;
  font-size: 0.8125rem;
  padding: 0.35rem;
}

.payment-proof-thumb {
  display: block;
  max-width: 80px;
  max-height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-sm);
}

.report-month-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.report-month-form .form-group {
  margin-bottom: 0;
  min-width: 180px;
}

.payment-history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.payment-history-filters .form-group {
  flex: 1 1 180px;
  margin-bottom: 0;
}

.account-number-display code {
  font-size: 1.0625rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   10. Toolbar & search
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.toolbar-search,
.search-bar,
.customer-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  flex: 1 1 auto;
}

.toolbar-search input[type="search"],
.search-bar input[type="search"],
.customer-search input[type="search"] {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 360px;
}

.toolbar label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.toolbar select {
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.toolbar select:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--color-primary);
}

.dashboard-section-toolbar {
  margin-bottom: var(--space-md);
}

.dashboard-section-toolbar h2 {
  margin: 0;
}

.dashboard-section {
  margin-bottom: var(--space-xl);
}

.dashboard-section > h2 {
  margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   11. Grid layouts
   -------------------------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-lg);
}

/* --------------------------------------------------------------------------
   12. Tables
   -------------------------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

thead {
  background: var(--color-bg-subtle);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
  border-bottom: 1px solid var(--color-border-strong);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  color: var(--color-text);
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--color-primary-soft);
}

tbody tr:last-child td {
  border-bottom: none;
}

td a {
  font-weight: 500;
}

td form {
  display: inline;
}

/* --------------------------------------------------------------------------
   13. Alerts
   -------------------------------------------------------------------------- */
.alert {
  padding: 0.875rem 1.125rem;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  border: 1px solid transparent;
  line-height: 1.5;
}

.alert-success {
  background: var(--color-success-soft);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--color-success-text);
}

.alert-error {
  background: var(--color-danger-soft);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-danger-text);
}

.alert-warning {
  background: var(--color-warning-soft);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--color-warning-text);
}

.landing-flash {
  max-width: var(--content-wide);
  margin: var(--space-md) auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* --------------------------------------------------------------------------
   14. Badges & pills
   -------------------------------------------------------------------------- */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-pill);
  text-transform: capitalize;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* Role badges */
.role-admin {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}

[data-theme="light"] .role-admin {
  color: #6d28d9;
}

.role-technician {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.3);
}

[data-theme="light"] .role-technician {
  color: #0e7490;
}

.role-customer {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .role-customer {
  color: #1d4ed8;
}

/* Bill status badges (used as badge + status-* class) */
.badge.status-completed,
.status-completed {
  background: var(--color-success-soft);
  color: var(--color-success-text);
  border-color: rgba(34, 197, 94, 0.3);
}

.badge.status-assigned,
.status-assigned {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .badge.status-assigned,
[data-theme="light"] .status-assigned {
  color: #1d4ed8;
}

.badge.status-pending,
.status-pending {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
  border-color: rgba(245, 158, 11, 0.35);
}

/* Job status pills */
.pill-pending {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.pill-assigned {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

[data-theme="light"] .pill-assigned {
  color: #1d4ed8;
}

.pill-in_progress {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
}

[data-theme="light"] .pill-in_progress {
  color: #0e7490;
}

.pill-completed {
  background: var(--color-success-soft);
  color: var(--color-success-text);
}

.pill-cancelled {
  background: var(--color-danger-soft);
  color: var(--color-danger-text);
}

/* Priority pills */
.pill-commercial {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

[data-theme="light"] .pill-commercial {
  color: #c2410c;
}

.pill-residential {
  background: var(--color-info-soft);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

[data-theme="light"] .pill-residential {
  color: #0369a1;
}

/* --------------------------------------------------------------------------
   15. Lists
   -------------------------------------------------------------------------- */
.plain-list {
  list-style: none;
  padding-left: 0;
  margin: var(--space-md) 0;
}

.plain-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-border);
}

.plain-list li:last-child {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   16. Job actions (tech)
   -------------------------------------------------------------------------- */
.job-finish-actions {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--color-border);
}

.job-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.job-cancel-note {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--color-danger-soft);
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.tech-assigned-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: var(--space-sm);
}

/* --------------------------------------------------------------------------
   17. Live tech panel (admin dashboard)
   -------------------------------------------------------------------------- */
.live-tech-panel {
  border-color: rgba(34, 197, 94, 0.2);
  background: linear-gradient(
    180deg,
    var(--color-surface) 0%,
    rgba(34, 197, 94, 0.04) 100%
  );
}

.live-tech-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.live-tech-panel-head h2 {
  margin: 0;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-success-text);
  background: var(--color-success-soft);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-pill);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    opacity: 0.85;
  }
}

.live-tech-subhead {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: var(--space-lg) 0 var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-tech-subhead:first-of-type {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   18. Login & register
   -------------------------------------------------------------------------- */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: var(--space-xl) var(--space-md);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.login-card-wide {
  max-width: 520px;
}

.login-card h1 {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.login-logo {
  display: block;
  max-height: 48px;
  width: auto;
  max-width: 100%;
  margin: 0 auto var(--space-lg);
  object-fit: contain;
}

.login-footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-lg);
  margin-bottom: 0;
}

.login-footer a {
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   19. Landing page
   -------------------------------------------------------------------------- */
.landing-page {
  width: 100%;
}

.landing-hero-panel {
  position: relative;
  padding: var(--space-2xl) var(--space-md) calc(var(--space-2xl) + 1rem);
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(59, 130, 246, 0.18), transparent 70%),
    linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
}

[data-theme="light"] .landing-hero-panel {
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(37, 99, 235, 0.1), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--color-bg) 100%);
}

.landing-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.landing-hero-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(820px, 90vw);
  margin: 0 auto var(--space-lg);
  object-fit: contain;
}

.landing-eyebrow {
  display: inline-block;
  margin: 0 0 var(--space-sm);
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.landing-hero-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--color-heading) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero-lead {
  font-size: clamp(1rem, 2.5vw, 1.1875rem);
  color: var(--color-text-muted);
  max-width: 56ch;
  margin: 0 auto var(--space-xl);
  line-height: 1.65;
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.landing-section {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.landing-features {
  padding-top: var(--space-xl);
}

.page-hero-compact {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-md);
  text-align: center;
}

.page-hero-compact h1 {
  margin-bottom: var(--space-sm);
}

.page-hero-compact .page-intro {
  margin-left: auto;
  margin-right: auto;
}

/* Section headings */
.section-heading {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-heading h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: var(--space-sm);
}

.section-heading p {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  max-width: 52ch;
  margin: 0 auto;
}

.section-heading-left {
  text-align: left;
}

.section-heading-left p {
  margin-left: 0;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
  background: var(--color-primary-soft);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.125rem;
}

.feature-card p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

/* Plan grid */
.landing-plans-section {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-xl);
  margin-left: auto;
  margin-right: auto;
  max-width: 920px;
  padding: var(--space-2xl) var(--space-xl);
}

[data-theme="light"] .landing-plans-section {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-border);
}

.plan-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  max-width: 860px;
  margin: 0 auto var(--space-xl);
}

.plan-card {
  flex: 0 0 158px;
  width: 158px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: var(--space-lg) var(--space-md);
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.plan-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.plan-card.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.plan-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.plan-speed {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--color-heading);
  letter-spacing: -0.02em;
}

.plan-price {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.plan-period {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.plan-cta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
}

.plan-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.plan-inline-form input[type="number"] {
  width: 8.5rem;
  max-width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
}

.plan-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  max-width: 640px;
  margin-top: 0.5rem;
}

.plan-add-form .form-actions {
  grid-column: 1 / -1;
}

.plans-admin-table td:last-child {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .plan-add-form {
    grid-template-columns: 1fr;
  }
}

.landing-plan-actions {
  text-align: center;
}

.plan-selected-note {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
}

/* Steps list */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step-counter;
  display: grid;
  gap: var(--space-md);
}

.steps-list li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  counter-increment: step-counter;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.steps-list li:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.steps-list li::before {
  content: counter(step-counter);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.steps-list li strong {
  color: var(--color-heading);
}

/* Contact card */
.landing-contact-card {
  max-width: 640px;
  margin: 0 auto;
}

.landing-contact-list {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0 0;
}

.landing-contact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.landing-contact-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.landing-contact-list strong {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
}

.landing-contact-list a {
  font-size: 1.0625rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   20. Settings — logo preview
   -------------------------------------------------------------------------- */
.logo-preview-wrap {
  margin: var(--space-md) 0 var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-bg-subtle);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  text-align: center;
}

.company-logo-preview {
  display: inline-block;
  max-height: 80px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   21. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .header-top {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: var(--space-sm);
  }

  .header-top-spacer {
    grid-column: 1 / -1;
    order: 2;
    justify-content: center;
  }

  .header-brand-center {
    grid-column: 1;
    order: 1;
    justify-content: flex-start;
  }

  .header-top-actions {
    grid-column: 2;
    order: 1;
  }

  .guest-nav {
    justify-content: center;
    width: 100%;
  }

  .user-bar {
    justify-content: flex-end;
  }

  .user-name {
    display: none;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    flex-shrink: 0;
  }

  .stats,
  .stats-grid,
  .report-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-plans-section {
    margin-left: auto;
    margin-right: auto;
    padding: var(--space-xl) var(--space-md);
    border-radius: var(--radius-lg);
  }

  .plan-grid {
    max-width: 100%;
    gap: var(--space-sm);
  }

  .plan-card {
    flex: 0 0 calc(50% - var(--space-sm));
    width: calc(50% - var(--space-sm));
    max-width: 180px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .job-action-buttons {
    flex-direction: column;
  }

  .btn-finish {
    width: 100%;
  }

  .payment-history-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-search,
  .search-bar {
    width: 100%;
  }

  .toolbar-search input[type="search"],
  .search-bar input[type="search"] {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: var(--space-lg) var(--space-sm) var(--space-xl);
  }

  .card {
    padding: var(--space-md);
  }

  .login-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .stats,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .plan-grid {
    gap: var(--space-sm);
  }

  .plan-card {
    flex: 0 0 100%;
    width: 100%;
    max-width: 280px;
  }

  .landing-hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .landing-hero-actions .btn {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   22. Print
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .theme-toggle,
  .toolbar,
  .form-actions,
  .btn {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .main-content {
    max-width: none;
    padding: 0;
  }
}

/* --------------------------------------------------------------------------
   23. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .live-dot {
    animation: none;
  }
}
