/* ============================================================
   AI Diagnose Assistent — Werkplaats Theme
   Primary: #0A1F3C (navy) — Accent: #E2231A (red)
   Font: Inter + Barlow Condensed (Google Fonts)
   ============================================================ */

/* ─── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Palette */
  --clr-primary:        #0A1F3C;
  --clr-primary-dark:   #0A1F3C;
  --clr-primary-light:  #16305B;

  --clr-yellow:         #E2231A;
  --clr-yellow-dark:    #B81C15;
  --clr-yellow-light:   #ED4B43;

  --clr-secondary:      #E2231A;
  --clr-secondary-dark: #B81C15;
  --clr-secondary-light:#ED4B43;
  --clr-accent:         #E2231A;

  --clr-bg:             #F2F2F2;
  --clr-surface:        #FFFFFF;
  --clr-surface-alt:    #F7F7F7;
  --clr-surface-hover:  #EFEFEF;

  --clr-text:           #111111;
  --clr-text-muted:     #666666;
  --clr-text-light:     #999999;
  --clr-text-inverse:   #FFFFFF;

  --clr-border:         #DDDDDD;
  --clr-border-focus:   #0A1F3C;

  --clr-success:        #16a34a;
  --clr-success-bg:     #dcfce7;
  --clr-success-border: #bbf7d0;
  --clr-warning:        #E2231A;
  --clr-warning-bg:     #FEE2E2;
  --clr-warning-border: #FECACA;
  --clr-error:          #E2231A;
  --clr-error-bg:       #fee2e2;
  --clr-error-border:   #fecaca;
  --clr-info:           #0284c7;
  --clr-info-bg:        #e0f2fe;
  --clr-info-border:    #bae6fd;

  /* Typography */
  --font-body:          'Inter', system-ui, -apple-system, sans-serif;
  --font-heading:       'Barlow Condensed', 'Inter', system-ui, sans-serif;
  --font-mono:          ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  --font-size-base:     15px;
  --font-size-sm:       13px;
  --font-size-xs:       11.5px;
  --font-size-lg:       17px;
  --font-size-xl:       20px;
  --font-size-2xl:      24px;
  --font-size-3xl:      32px;
  --line-height:        1.65;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii — sharper corners */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   10px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-xs:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.13), 0 3px 10px rgba(0,0,0,0.07);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.18), 0 6px 16px rgba(0,0,0,0.08);
  --shadow-yellow: 0 4px 14px rgba(226,35,26,0.35);

  /* Transitions */
  --transition-fast:   120ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   320ms ease;

  /* Layout */
  --max-width:    1240px;
  --nav-height:   64px;

  /* ── Bootstrap 5 theme token overrides ── */
  --bs-primary:              #E2231A;
  --bs-primary-rgb:          226, 35, 26;
  --bs-secondary:            #0A1F3C;
  --bs-secondary-rgb:        10, 31, 60;
  --bs-warning:              #E2231A;
  --bs-warning-rgb:          226, 35, 26;
  --bs-dark:                 #0A1F3C;
  --bs-dark-rgb:             10, 31, 60;
  --bs-link-color:           #0A1F3C;
  --bs-link-color-rgb:       226, 35, 26;
  --bs-link-hover-color:     #666666;
  --bs-body-font-family:     'Inter', system-ui, -apple-system, sans-serif;
  --bs-body-font-size:       15px;
  --bs-body-color:           #111111;
  --bs-body-bg:              #F2F2F2;
}

/* ─── Bootstrap 5 Button Variable Overrides ─────────────── */
/* Must be set per .btn-* class so Bootstrap's .btn picks them up */
.btn-primary {
  --bs-btn-color:             #ffffff;
  --bs-btn-bg:                #E2231A;
  --bs-btn-border-color:      #B81C15;
  --bs-btn-hover-color:       #ffffff;
  --bs-btn-hover-bg:          #B81C15;
  --bs-btn-hover-border-color:#B81C15;
  --bs-btn-focus-shadow-rgb:  226, 35, 26;
  --bs-btn-active-color:      #ffffff;
  --bs-btn-active-bg:         #B81C15;
  --bs-btn-active-border-color:#B81C15;
  --bs-btn-disabled-color:    #ffffff;
  --bs-btn-disabled-bg:       #E2231A;
  --bs-btn-disabled-border-color:#B81C15;
}

.btn-secondary {
  --bs-btn-color:             #ffffff;
  --bs-btn-bg:                #0A1F3C;
  --bs-btn-border-color:      #333333;
  --bs-btn-hover-color:       #ffffff;
  --bs-btn-hover-bg:          #16305B;
  --bs-btn-hover-border-color:#0A1F3C;
  --bs-btn-focus-shadow-rgb:  0, 0, 0;
  --bs-btn-active-color:      #ffffff;
  --bs-btn-active-bg:         #16305B;
  --bs-btn-active-border-color:#0A1F3C;
}

.btn-outline-primary {
  --bs-btn-color:             #0A1F3C;
  --bs-btn-border-color:      #0A1F3C;
  --bs-btn-hover-color:       #ffffff;
  --bs-btn-hover-bg:          #0A1F3C;
  --bs-btn-hover-border-color:#0A1F3C;
  --bs-btn-active-color:      #ffffff;
  --bs-btn-active-bg:         #0A1F3C;
  --bs-btn-active-border-color:#0A1F3C;
}

.btn-outline-secondary {
  --bs-btn-color:             #E2231A;
  --bs-btn-border-color:      #E2231A;
  --bs-btn-hover-color:       #ffffff;
  --bs-btn-hover-bg:          #E2231A;
  --bs-btn-hover-border-color:#E2231A;
}

.btn-success {
  --bs-btn-color:             #ffffff;
  --bs-btn-bg:                #16a34a;
  --bs-btn-border-color:      #15803d;
  --bs-btn-hover-color:       #ffffff;
  --bs-btn-hover-bg:          #15803d;
  --bs-btn-hover-border-color:#15803d;
}

.btn-danger {
  --bs-btn-color:             #ffffff;
  --bs-btn-bg:                #E2231A;
  --bs-btn-border-color:      #B81C15;
  --bs-btn-hover-color:       #ffffff;
  --bs-btn-hover-bg:          #B81C15;
  --bs-btn-hover-border-color:#B81C15;
}

/* ─── Bootstrap Navbar Override ─────────────────────────── */
nav.navbar,
.navbar {
  --bs-navbar-color:                 rgba(255,255,255,0.72);
  --bs-navbar-hover-color:           #ffffff;
  --bs-navbar-disabled-color:        rgba(255,255,255,0.35);
  --bs-navbar-active-color:          #E2231A;
  --bs-navbar-brand-color:           #ffffff;
  --bs-navbar-brand-hover-color:     #E2231A;
  --bs-navbar-toggler-border-color:  rgba(255,255,255,0.25);
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2c255%2c255%2c0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ─── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: var(--line-height);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--clr-text);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

h1 { font-size: 2.4rem; font-weight: 800; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; font-weight: 700; }
h5 { font-size: 1rem; font-weight: 700; text-transform: none; }
h6 { font-size: 0.85rem; font-weight: 700; text-transform: none; }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--clr-text-muted); }

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

ul, ol { padding-left: var(--space-5); }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: var(--clr-surface-alt);
  color: var(--clr-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--clr-border);
}

pre {
  background: #111;
  color: #e0e0e0;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

hr {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: var(--space-6) 0;
}

/* ─── Layout ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-sm  { max-width: 720px; }
.container-md  { max-width: 960px; }
.container-lg  { max-width: var(--max-width); }
.container-fluid { max-width: 100%; }

.main-content {
  padding-top: var(--space-8);
  padding-bottom: var(--space-16);
  min-height: calc(100vh - var(--nav-height));
}

/* ─── Navigation / Header ───────────────────────────────── */
.nav,
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background-color: #0A1F3C !important;
  background: #0A1F3C !important;
  border-bottom: 4px solid #E2231A !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.35);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--space-2);
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Brand */
.nav-brand,
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-text-inverse) !important;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: var(--space-5);
}

.nav-brand .brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--clr-yellow);
  border-radius: var(--radius-md);
  color: #0A1F3C;
  font-size: 20px;
  flex-shrink: 0;
}

.nav-brand .brand-name {
  color: var(--clr-text-inverse);
}

.nav-brand .brand-name span {
  color: var(--clr-yellow);
}

/* App badge in navbar */
.nav-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--clr-yellow);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-left: var(--space-2);
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.nav-link,
.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72) !important;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.nav-link:hover,
.navbar-nav .nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08);
  border-bottom-color: var(--clr-yellow);
}

.nav-link.active,
.navbar-nav .nav-link.active {
  color: var(--clr-yellow) !important;
  background: rgba(226, 35, 26, 0.10);
  border-bottom-color: var(--clr-yellow);
  font-weight: 700;
}

/* Nav right user area */
.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.nav-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--clr-yellow);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border: 2px solid rgba(255,255,255,0.15);
}

/* Bootstrap 5 navbar overrides */
.navbar-dark .navbar-toggler {
  border-color: rgba(255,255,255,0.25);
}
.navbar-dark .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2c255%2c255%2c0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ─── Flash / Alert Messages ────────────────────────────── */
.flash-container {
  padding: var(--space-3) 0;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  border-left-width: 5px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.alert-info {
  background: var(--clr-info-bg);
  border-color: var(--clr-info-border);
  border-left-color: var(--clr-info);
  color: #0c4a6e;
}

.alert-success {
  background: var(--clr-success-bg);
  border-color: var(--clr-success-border);
  border-left-color: var(--clr-success);
  color: #14532d;
}

.alert-warning {
  background: #FEF2F2;
  border-color: #FECACA;
  border-left-color: var(--clr-yellow-dark);
  color: #7F1D1D;
}

.alert-danger,
.alert-error {
  background: var(--clr-error-bg);
  border-color: var(--clr-error-border);
  border-left-color: var(--clr-error);
  color: #7f1d1d;
}

.alert-kb-match {
  background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
  border-color: #FECACA;
  border-left-color: var(--clr-yellow-dark);
  color: #7F1D1D;
  font-weight: 500;
}

.alert-kb-match .alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* ─── Page Header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 3px solid var(--clr-yellow);
}

.page-header-left {}

.page-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--clr-primary);
  margin-bottom: var(--space-1);
}

/* Yellow accent bar above page title */
.page-title::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--clr-yellow);
  margin-bottom: var(--space-2);
  border-radius: 2px;
}

.page-subtitle {
  font-size: var(--font-size-base);
  color: var(--clr-text-muted);
  font-weight: 400;
  margin-bottom: 0;
  text-transform: none;
  font-family: var(--font-body);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Breadcrumb */
.breadcrumb-nav {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-2);
}

.breadcrumb-nav a {
  color: var(--clr-text-muted);
  font-weight: 500;
}

.breadcrumb-nav a:hover {
  color: var(--clr-yellow-dark);
}

.breadcrumb-nav span {
  margin: 0 var(--space-1);
  opacity: 0.5;
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #AAAAAA;
}

.card-flat {
  box-shadow: none;
  border: 1px solid var(--clr-border);
}

.card-flat:hover {
  transform: none;
  box-shadow: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--clr-yellow);
}

.card-header-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clr-primary);
  margin-bottom: 0;
}

.card-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Stat / KPI cards */
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-top: 4px solid var(--clr-yellow);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--clr-yellow);
  color: #fff;
  font-size: 20px;
  margin-bottom: var(--space-4);
}

.stat-card-icon.orange,
.stat-card-icon.green,
.stat-card-icon.amber {
  background: var(--clr-yellow);
  color: #fff;
}

.stat-card-value {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--clr-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
  text-transform: none;
}

.stat-card-label {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.stat-card-delta {
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin-top: var(--space-2);
}

.stat-card-delta.up   { color: var(--clr-success); }
.stat-card-delta.down { color: var(--clr-error); }

/* Accent-bordered card */
.card-primary {
  border-top: 4px solid var(--clr-primary);
}

.card-orange,
.card-yellow {
  border-top: 4px solid var(--clr-yellow);
}

.card-success {
  border-top: 4px solid var(--clr-success);
}

/* Dark card variant */
.card-dark {
  background: var(--clr-primary);
  border-color: #333;
  color: var(--clr-text-inverse);
}

.card-dark .card-header-title,
.card-dark h1,
.card-dark h2,
.card-dark h3,
.card-dark h4 {
  color: var(--clr-text-inverse);
}

.card-dark .text-muted {
  color: rgba(255,255,255,0.6) !important;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
}

.btn:focus-visible {
  outline: 2px solid var(--clr-yellow);
  outline-offset: 3px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — red CTA */
.btn-primary {
  background: var(--clr-yellow);
  border-color: var(--clr-yellow-dark);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(226,35,26,0.25);
}

.btn-primary:hover {
  background: var(--clr-yellow-dark);
  border-color: var(--clr-yellow-dark);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(226,35,26,0.40);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(226,35,26,0.20);
}

/* Secondary — black */
.btn-secondary {
  background: var(--clr-primary);
  border-color: #333;
  color: var(--clr-text-inverse);
}

.btn-secondary:hover {
  background: #16305B;
  border-color: #0A1F3C;
  color: var(--clr-text-inverse);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Outline Primary */
.btn-outline-primary {
  background: transparent;
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

.btn-outline-primary:hover {
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Outline Secondary = outline red */
.btn-outline-secondary {
  background: transparent;
  border-color: var(--clr-yellow);
  color: var(--clr-yellow);
}

.btn-outline-secondary:hover {
  background: var(--clr-yellow);
  color: #fff;
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  border-color: var(--clr-border);
  color: var(--clr-text-muted);
}

.btn-ghost:hover {
  background: var(--clr-surface-alt);
  border-color: var(--clr-text-muted);
  color: var(--clr-text);
}

/* Danger */
.btn-danger {
  background: var(--clr-error);
  border-color: #B81C15;
  color: var(--clr-text-inverse);
}

.btn-danger:hover {
  background: #B81C15;
  color: var(--clr-text-inverse);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(226, 35, 26, 0.30);
}

.btn-danger:active { transform: translateY(0); }

/* Success */
.btn-success {
  background: var(--clr-success);
  border-color: #15803d;
  color: var(--clr-text-inverse);
}

.btn-success:hover {
  background: #15803d;
  color: var(--clr-text-inverse);
  transform: translateY(-1px);
}

/* Light */
.btn-light {
  background: var(--clr-surface);
  border-color: var(--clr-border);
  color: var(--clr-text);
  box-shadow: var(--shadow-xs);
}

.btn-light:hover {
  background: var(--clr-surface-alt);
  border-color: var(--clr-text-light);
  color: var(--clr-text);
}

/* Sizes */
.btn-xs {
  padding: 5px var(--space-3);
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 7px var(--space-4);
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-8);
  font-size: var(--font-size-base);
  border-radius: var(--radius-lg);
}

.btn-xl {
  padding: var(--space-4) var(--space-10);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
  font-weight: 800;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
  padding: 5px;
}

/* ─── Forms ──────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label,
label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-label-required::after {
  content: ' *';
  color: var(--clr-error);
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
  margin-top: var(--space-1);
  display: block;
  text-transform: none;
  font-weight: 400;
}

.form-input,
.form-textarea,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
textarea,
select {
  display: block;
  width: 100%;
  padding: 10px var(--space-4);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 1.5;
  color: var(--clr-text);
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
textarea:hover,
select:hover {
  border-color: #999;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(226,35,26,0.25);
  background: var(--clr-surface);
}

.form-input::placeholder,
.form-textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--clr-text-light);
  font-weight: 400;
}

.form-textarea,
textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select,
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

/* Input states */
.form-input.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--clr-error);
  box-shadow: 0 0 0 3px rgba(226, 35, 26, 0.12);
}

.form-input.is-valid,
input.is-valid,
select.is-valid,
textarea.is-valid {
  border-color: var(--clr-success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.invalid-feedback {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--clr-error);
  font-weight: 500;
  margin-top: var(--space-1);
}

.valid-feedback {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--clr-success);
  font-weight: 500;
  margin-top: var(--space-1);
}

/* Input group */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-input,
.input-group input {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  flex: 1;
}

.input-group .btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: none;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 10px var(--space-3);
  background: var(--clr-surface-alt);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  white-space: nowrap;
  border-right: none;
}

/* License plate input — Dutch yellow plate styling */
.input-kenteken {
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  background: #FEE2E2;
  border: 3px solid var(--clr-yellow-dark);
  color: #111;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
}

.input-kenteken:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(226,35,26,0.30);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.form-check-input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
  cursor: pointer;
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-sm);
  background: var(--clr-surface);
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-check-input[type="radio"] {
  border-radius: var(--radius-pill);
}

.form-check-input:checked {
  background: var(--clr-yellow);
  border-color: var(--clr-yellow-dark);
}

.form-check-input:checked::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: #0A1F3C;
}

.form-check-input[type="radio"]:checked::after {
  border-radius: var(--radius-pill);
}

.form-check-label {
  font-size: var(--font-size-sm);
  color: var(--clr-text);
  cursor: pointer;
  font-weight: 400;
  margin-bottom: 0;
  text-transform: none;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-xs);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  background: var(--clr-surface);
}

.table thead {
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
}

.table thead th {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border: none;
  color: rgba(255,255,255,0.90);
}

/* Yellow accent strip under thead */
.table thead tr {
  border-bottom: 3px solid var(--clr-yellow);
}

.table thead th:first-child { border-radius: var(--radius-xl) 0 0 0; }
.table thead th:last-child  { border-radius: 0 var(--radius-xl) 0 0; }

.table tbody tr {
  border-bottom: 1px solid var(--clr-border);
  transition: background var(--transition-fast);
}

.table tbody tr:last-child {
  border-bottom: none;
}

.table tbody tr:nth-child(even) {
  background: var(--clr-surface-alt);
}

.table tbody tr:hover {
  background: #FEE2E2;
}

.table tbody td {
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
  color: var(--clr-text);
}

.table tfoot {
  background: #FEE2E2;
  font-weight: 700;
  border-top: 2px solid var(--clr-yellow);
}

.table tfoot td {
  padding: var(--space-3) var(--space-4);
}

.table-sm thead th,
.table-sm tbody td {
  padding: var(--space-2) var(--space-3);
}

.table-responsive {
  overflow-x: auto;
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary {
  background: var(--clr-primary);
  color: var(--clr-yellow);
  border: 1px solid #333;
}

.badge-secondary,
.badge-orange,
.badge-yellow {
  background: var(--clr-yellow);
  color: #fff;
  border: 1px solid var(--clr-yellow-dark);
}

.badge-success {
  background: var(--clr-success-bg);
  color: #15803d;
  border: 1px solid var(--clr-success-border);
}

.badge-warning {
  background: var(--clr-warning-bg);
  color: #92400e;
  border: 1px solid var(--clr-warning-border);
}

.badge-danger {
  background: var(--clr-error-bg);
  color: #991b1b;
  border: 1px solid var(--clr-error-border);
}

.badge-info {
  background: var(--clr-info-bg);
  color: #0c4a6e;
  border: 1px solid var(--clr-info-border);
}

.badge-dark {
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  border: 1px solid #333;
}

.badge-light {
  background: var(--clr-surface-alt);
  color: var(--clr-text-muted);
  border: 1px solid var(--clr-border);
}

/* ─── Session Status Badges ──────────────────────────────── */
.status-open         { background: var(--clr-info-bg);    color: #0c4a6e; border: 1px solid var(--clr-info-border); }
.status-in_progress  { background: #FEE2E2; color: #7F1D1D; border: 1px solid var(--clr-yellow); }
.status-resolved     { background: var(--clr-success-bg); color: #14532d; border: 1px solid var(--clr-success-border); }
.status-referred     { background: var(--clr-error-bg);   color: #7f1d1d; border: 1px solid var(--clr-error-border); }
.status-closed       { background: var(--clr-surface-alt);color: var(--clr-text-muted); border: 1px solid var(--clr-border); }

/* ─── Subscription Tier Badges ───────────────────────────── */
.tier-monteur {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.tier-vakman {
  background: #FEE2E2;
  color: #7F1D1D;
  border: 1px solid var(--clr-yellow);
}

.tier-werkplaatsmeester {
  background: var(--clr-primary);
  color: var(--clr-yellow);
  border: 1px solid #333;
}

/* ─── Diagnostic Step Wizard ─────────────────────────────── */
.step-wizard {
  position: relative;
}

.step-progress {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-8);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  min-width: 80px;
}

.step-item::before {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(-50% + 18px);
  right: calc(50% + 18px);
  height: 2px;
  background: var(--clr-border);
  z-index: 0;
}

.step-item:first-child::before { display: none; }

.step-item.completed::before { background: var(--clr-success); }
.step-item.active::before    { background: var(--clr-yellow); }

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 700;
  border: 2px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text-muted);
  z-index: 1;
  transition: all var(--transition-base);
  position: relative;
}

.step-item.completed .step-dot {
  background: var(--clr-success);
  border-color: var(--clr-success);
  color: #fff;
}

.step-item.active .step-dot {
  background: var(--clr-yellow);
  border-color: var(--clr-yellow-dark);
  color: #0A1F3C;
  box-shadow: 0 0 0 4px rgba(226,35,26,0.25);
}

.step-item.failed .step-dot {
  background: var(--clr-error);
  border-color: var(--clr-error);
  color: #fff;
}

.step-item.skipped .step-dot {
  background: var(--clr-surface-alt);
  border-color: var(--clr-border);
  color: var(--clr-text-light);
}

.step-label {
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--clr-text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-item.active .step-label {
  color: var(--clr-primary);
  font-weight: 700;
}

/* Step card */
.step-card {
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  transition: all var(--transition-base);
  position: relative;
}

.step-card.step-active {
  border-color: var(--clr-yellow);
  box-shadow: 0 0 0 3px rgba(226,35,26,0.15), var(--shadow-md);
}

.step-card.step-pass  { border-left: 5px solid var(--clr-success); }
.step-card.step-fail  { border-left: 5px solid var(--clr-error); }
.step-card.step-pending { border-left: 5px solid var(--clr-yellow); }

.step-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--clr-yellow);
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: 800;
  margin-right: var(--space-3);
  flex-shrink: 0;
}

.step-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--clr-surface-alt);
  color: var(--clr-text-muted);
  border: 1px solid var(--clr-border);
}

.step-instruction {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: var(--space-3);
}

.step-reasoning {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  background: #FEE2E2;
  border-left: 4px solid var(--clr-yellow);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-4);
  font-style: italic;
}

.step-expected {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-4);
}

.step-expected strong {
  color: var(--clr-text);
}

/* ─── AI Root Cause Cards ────────────────────────────────── */
.root-cause-card {
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  transition: all var(--transition-base);
  cursor: pointer;
}

.root-cause-card:hover {
  border-color: var(--clr-yellow);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.root-cause-card.selected {
  border-color: var(--clr-yellow);
  background: linear-gradient(135deg, var(--clr-surface) 0%, #FEF2F2 100%);
  box-shadow: 0 0 0 3px rgba(226,35,26,0.20), var(--shadow-sm);
}

.root-cause-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.root-cause-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--clr-yellow);
  color: #fff;
  font-weight: 800;
  font-size: var(--font-size-sm);
  flex-shrink: 0;
}

.root-cause-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-primary);
  flex: 1;
  margin: 0 var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.root-cause-description {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

/* Confidence bar */
.confidence-bar-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.confidence-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clr-text-muted);
  white-space: nowrap;
  min-width: 80px;
}

.confidence-bar {
  flex: 1;
  height: 8px;
  background: var(--clr-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width var(--transition-slow);
}

.confidence-fill.high   { background: linear-gradient(90deg, #16a34a, #4ade80); }
.confidence-fill.medium { background: linear-gradient(90deg, var(--clr-yellow-dark), var(--clr-yellow)); }
.confidence-fill.low    { background: linear-gradient(90deg, #E2231A, #F4453C); }

.confidence-pct {
  font-size: 11px;
  font-weight: 800;
  min-width: 36px;
  text-align: right;
}

.confidence-pct.high   { color: var(--clr-success); }
.confidence-pct.medium { color: var(--clr-yellow-dark); }
.confidence-pct.low    { color: var(--clr-error); }

/* ─── Cost Estimate Table ────────────────────────────────── */
.cost-estimate-card {
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cost-estimate-header {
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  padding: var(--space-5) var(--space-6);
  border-bottom: 4px solid var(--clr-yellow);
}

.cost-estimate-header h3 {
  color: var(--clr-text-inverse);
  margin: 0;
}

.cost-estimate-body {
  padding: var(--space-6);
}

.cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--clr-border);
  font-size: var(--font-size-sm);
}

.cost-row:last-child {
  border-bottom: none;
}

.cost-row.subtotal {
  font-weight: 600;
  color: var(--clr-text);
}

.cost-row.total {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--clr-primary);
  padding-top: var(--space-4);
  border-top: 3px solid var(--clr-yellow);
  border-bottom: none;
}

.cost-range {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--clr-text);
}

.cost-range.total-range {
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--clr-primary);
}

/* ─── Session Usage / Quota Bar ──────────────────────────── */
.quota-bar-wrapper {
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.quota-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.quota-label strong {
  color: var(--clr-text);
}

.quota-bar {
  height: 10px;
  background: var(--clr-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width var(--transition-slow);
  background: linear-gradient(90deg, var(--clr-yellow-dark), var(--clr-yellow));
}

.quota-fill.warning {
  background: linear-gradient(90deg, #E2231A, #E2231A);
}

.quota-fill.danger {
  background: linear-gradient(90deg, #F4453C, var(--clr-error));
}

/* ─── Knowledge Base ─────────────────────────────────────── */
.kb-match-banner {
  background: #FEF2F2;
  border: 2px solid var(--clr-yellow);
  border-left: 5px solid var(--clr-yellow-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.kb-match-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.kb-match-content {}

.kb-match-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #5a3f00;
  margin-bottom: var(--space-1);
}

.kb-match-desc {
  font-size: var(--font-size-sm);
  color: #7F1D1D;
  margin-bottom: 0;
}

/* KB search result items */
.kb-result-item {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-left: 4px solid var(--clr-yellow);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  transition: all var(--transition-base);
}

.kb-result-item:hover {
  border-color: var(--clr-yellow);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

/* ─── OBD2 / Fault Code chips ────────────────────────────── */
.fault-code-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  background: var(--clr-primary);
  color: var(--clr-yellow);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid #333;
}

.fault-code-chip.apk {
  background: var(--clr-yellow);
  color: #fff;
  border-color: var(--clr-yellow-dark);
}

/* ─── Vehicle Info Card ───────────────────────────────────── */
.vehicle-card-mini {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.vehicle-card-mini-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--clr-yellow);
  font-size: 24px;
  flex-shrink: 0;
}

.vehicle-plate {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--font-size-base);
  background: #FEE2E2;
  color: #111;
  border: 2px solid var(--clr-yellow-dark);
  border-radius: var(--radius-sm);
  padding: 3px 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Login / Auth Pages ─────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-primary);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

/* Diagonal stripe accent behind auth card */
.auth-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(226,35,26,0.04) 0px,
    rgba(226,35,26,0.04) 10px,
    transparent 10px,
    transparent 30px
  );
  pointer-events: none;
}

.auth-card {
  background: var(--clr-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-10);
  width: 100%;
  max-width: 420px;
  border-top: 6px solid var(--clr-yellow);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--clr-yellow);
  border-radius: var(--radius-xl);
  font-size: 32px;
  margin-bottom: var(--space-3);
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-primary);
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  text-align: center;
}

/* ─── Dashboard Quick Actions ─────────────────────────────── */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-top: 4px solid var(--clr-yellow);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  color: var(--clr-text);
}

.quick-action-card:hover {
  border-color: var(--clr-yellow);
  background: #FEF2F2;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: var(--clr-primary);
}

.quick-action-card.orange:hover {
  border-color: var(--clr-primary);
  background: #f5f5f5;
}

.quick-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  background: var(--clr-yellow);
  color: #fff;
  font-size: 24px;
  transition: all var(--transition-base);
}

.quick-action-card:hover .quick-action-icon {
  background: var(--clr-yellow);
  transform: scale(1.1);
}

.quick-action-card.orange:hover .quick-action-icon {
  background: var(--clr-primary);
  color: white;
}

.quick-action-label {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Utilities ──────────────────────────────────────────── */
.text-primary   { color: var(--clr-primary) !important; }
.text-secondary { color: var(--clr-yellow-dark) !important; }
.text-success   { color: var(--clr-success) !important; }
.text-warning   { color: var(--clr-warning) !important; }
.text-danger    { color: var(--clr-error) !important; }
.text-muted     { color: var(--clr-text-muted) !important; }
.text-light     { color: var(--clr-text-light) !important; }

.bg-primary  { background-color: var(--clr-primary) !important; }
.bg-surface  { background-color: var(--clr-surface) !important; }
.bg-alt      { background-color: var(--clr-surface-alt) !important; }
.bg-yellow   { background-color: var(--clr-yellow) !important; }

.fw-light    { font-weight: 300; }
.fw-normal   { font-weight: 400; }
.fw-medium   { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold     { font-weight: 700; }
.fw-extrabold{ font-weight: 800; }

.font-mono   { font-family: var(--font-mono); }
.font-heading{ font-family: var(--font-heading); }

.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-pill{ border-radius: var(--radius-pill); }

.shadow-sm   { box-shadow: var(--shadow-sm); }
.shadow-md   { box-shadow: var(--shadow-md); }
.shadow-lg   { box-shadow: var(--shadow-lg); }

.divider {
  border: none;
  border-top: 2px solid var(--clr-yellow);
  margin: var(--space-6) 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 3px;
  background: var(--clr-yellow);
  border-radius: 2px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  text-align: center;
  color: var(--clr-text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--clr-text);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  font-size: var(--font-size-sm);
  max-width: 340px;
  margin-bottom: var(--space-6);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #0A1F3C;
  border-radius: var(--radius-pill);
  animation: spin 0.7s linear infinite;
}

.spinner.white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: #fff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tooltip */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--clr-primary);
  color: var(--clr-yellow);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
  border: 1px solid var(--clr-yellow);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--clr-primary);
  border-top: 4px solid var(--clr-yellow);
  padding: var(--space-5) 0;
  margin-top: var(--space-16);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.55);
}

.site-footer-inner .footer-brand {
  color: var(--clr-yellow);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --font-size-base: 14px;
    --nav-height: 56px;
  }

  .container {
    padding-inline: var(--space-4);
  }

  .main-content {
    padding-top: var(--space-6);
    padding-bottom: var(--space-10);
  }

  h1, .page-title { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .page-actions .btn {
    flex: 1;
  }

  .card {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
  }

  .auth-card {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }

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

  .stat-card-value {
    font-size: 28px;
  }

  .nav-links {
    display: none;
  }

  .table thead th:nth-child(n+4),
  .table tbody td:nth-child(n+4) {
    display: none;
  }

  .btn-lg {
    padding: var(--space-3) var(--space-6);
  }

  .step-progress {
    gap: 0;
  }

  .step-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .quick-action-grid {
    grid-template-columns: 1fr;
  }

  .cost-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .cost-row.total {
    flex-direction: row;
    align-items: center;
  }
}

/* ─── Print Media Queries ────────────────────────────────── */
@media print {
  .nav,
  .navbar,
  .site-footer,
  .no-print,
  .btn,
  .page-actions,
  .flash-container {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  .main-content {
    padding-top: 0;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card:hover {
    transform: none !important;
  }

  .table {
    border-collapse: collapse;
    font-size: 11pt;
  }

  .table thead {
    background: #000 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table tbody tr:nth-child(even) {
    background: #f5f5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cost-estimate-header {
    background: #000 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page-title {
    font-size: 20pt;
  }

  a { color: #000 !important; text-decoration: none !important; }

  .badge,
  .fault-code-chip,
  .vehicle-plate {
    border: 1px solid #999 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cost-estimate-card {
    border: 1px solid #999;
    break-inside: avoid;
  }

  .document-print-wrapper {
    max-width: 100%;
    padding: 0;
  }
}
