/* ==========================================================================
   WHIPFIX — "Garage Noir" Design System
   Automotive repair marketplace — dark premium aesthetic
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* --------------------------------------------------------------------------
   CSS Custom Properties — Dark Theme (default)
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-hover: #222238;

  /* Text */
  --text-primary: #e8e8ed;
  --text-secondary: #8888a0;
  --text-muted: #555570;

  /* Accent */
  --accent: #00d4aa;
  --accent-hover: #00f0c0;
  --accent-subtle: rgba(0, 212, 170, 0.1);
  --accent-glow: 0 0 20px rgba(0, 212, 170, 0.25);

  /* Semantic */
  --danger: #ff4757;
  --warning: #ffa502;
  --success: #2ed573;
  --info: #3b82f6;

  /* Surfaces */
  --border: #1e1e32;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 16px 50px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);

  /* Typography scale (1.25) */
  --fs-xs: 0.64rem;
  --fs-sm: 0.8rem;
  --fs-base: 1rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.563rem;
  --fs-xl: 1.953rem;
  --fs-2xl: 2.441rem;
  --fs-3xl: 3.052rem;

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

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Layout */
  --header-height: 64px;
  --max-width: 1200px;
  --sidebar-width: 320px;
}

/* --------------------------------------------------------------------------
   Light Theme Override
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0f4;
  --bg-hover: #e8e8ed;
  --text-primary: #0a0a0f;
  --text-secondary: #555570;
  --text-muted: #8888a0;
  --accent: #00a885;
  --accent-hover: #00c49a;
  --accent-subtle: rgba(0, 168, 133, 0.06);
  --accent-glow: 0 0 20px rgba(0, 168, 133, 0.15);
  --border: #e0e0e8;
  --shadow: rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 16px 50px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --danger: #e8364a;
  --warning: #e89500;
  --success: #1fb862;
  --info: #2563eb;
}

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

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

body {
  font-family: "DM Sans", sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--accent-hover);
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   Custom Scrollbar
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-primary);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

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

.mono {
  font-family: "Space Mono", monospace;
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

small, .text-sm {
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding-top: var(--header-height);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.app-container {
  padding: var(--space-lg);
}

.section {
  padding: var(--space-2xl) 0;
}

/* --------------------------------------------------------------------------
   Header / Navigation — Frosted Glass
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--accent-subtle), 0 4px 20px var(--shadow);
  transition: background var(--transition);
}

[data-theme="light"] .header {
  background: rgba(245, 245, 247, 0.9);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 4px 20px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.logo {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text-primary);
  letter-spacing: -0.5px;
  user-select: none;
}

.logo span {
  color: var(--accent);
}

.nav,
.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.nav-link .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-primary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
  z-index: 1010;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Header actions group */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Icon buttons (bell, theme toggle, hamburger) */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.icon-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  background: var(--danger);
  color: white;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
}

/* Mobile menu button — hidden on desktop */
.mobile-menu-btn {
  display: none;
}

.mobile-menu-btn .icon-close {
  display: none;
}

.mobile-menu-btn.open .icon-open {
  display: none;
}

.mobile-menu-btn.open .icon-close {
  display: block;
}

/* Theme toggle icon state */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* User dropdown */
.user-dropdown {
  position: relative;
}

.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.user-dropdown-trigger:hover {
  border-color: var(--accent);
}

.user-dropdown-trigger .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.user-dropdown-trigger .user-name {
  font-size: var(--fs-sm);
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-trigger .chevron {
  transition: transform var(--transition);
}

.user-dropdown.open .chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  min-width: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xs);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  animation: slideUp 0.2s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
}

.dropdown-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.dropdown-item--danger:hover {
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-xs) 0;
}

/* Auth buttons (guest) */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Mobile drawer menu */
.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  padding: var(--space-lg);
  z-index: 999;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 24px var(--shadow);
}

.mobile-drawer:not([hidden]) {
  transform: translateX(0);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  color: var(--text-secondary);
  font-size: var(--fs-base);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.mobile-nav-link.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.mobile-nav-link--danger:hover {
  color: var(--danger);
}

.mobile-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-sm) 0;
}

/* Legacy mobile-menu (keep for compatibility) */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  right: -100%;
  width: 280px;
  height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  padding: var(--space-lg);
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 999;
  transition: right var(--transition-slow);
  overflow-y: auto;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu .nav-link {
  width: 100%;
  padding: var(--space-md);
  font-size: var(--fs-base);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.mobile-overlay.open {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 0 var(--space-lg);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  line-height: 1;
}

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

/* Primary — hero accent */
.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 168, 133, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.4);
  color: #0a0a0f;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.97);
}

/* Secondary — outlined */
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-subtle);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #ff6b7a;
  border-color: #ff6b7a;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.25);
}

/* Ghost — minimal */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 0 var(--space-md);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Size variants */
.btn-sm {
  min-height: 36px;
  padding: 0 var(--space-md);
  font-size: var(--fs-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  min-height: 52px;
  padding: 0 var(--space-xl);
  font-size: var(--fs-base);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 36px;
  min-height: 36px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transform: perspective(1000px) rotateX(0) rotateY(0);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

/* Shine sweep effect on hover */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.7s ease;
  pointer-events: none;
  z-index: 1;
}
[data-theme="light"] .card::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.card:hover::after {
  left: 120%;
}

/* Desktop only 3D hover */
@media (hover: hover) {
  .card:hover {
    transform: perspective(1000px) translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--accent-subtle);
  }

  .card:active {
    transform: perspective(1000px) scale(0.98);
    transition-duration: 0.1s;
  }
}

/* Light mode card depth */
[data-theme="light"] .card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}
[data-theme="light"] .card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 16px 50px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,168,133,0.15);
}

/* Disable 3D effects on touch devices to preserve scrolling */
@media (hover: none) {
  .card {
    transform: none !important;
  }
  .card::after {
    display: none;
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.card-header h3,
.card-header h4 {
  font-size: var(--fs-base);
  font-weight: 600;
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}

/* Card without hover lift (static) */
.card-static:hover {
  transform: none;
}

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

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-base);
  transition: all var(--transition);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: #ffffff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle), 0 0 15px rgba(0, 212, 170, 0.1);
  outline: none;
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}

.form-textarea {
  height: auto;
  min-height: 120px;
  padding: var(--space-md);
  resize: vertical;
  line-height: 1.6;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  display: block;
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-top: var(--space-xs);
}

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  white-space: nowrap;
  line-height: 1.6;
}

.badge-success {
  background: rgba(46, 213, 115, 0.12);
  color: var(--success);
}

.badge-warning {
  background: rgba(255, 165, 2, 0.12);
  color: var(--warning);
}

.badge-danger {
  background: rgba(255, 71, 87, 0.12);
  color: var(--danger);
}

.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--info);
}

.badge-accent {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Job Status Badges
   -------------------------------------------------------------------------- */
.status-open {
  background: var(--accent-subtle);
  color: var(--accent);
}

.status-in_progress,
.status-in-progress {
  background: rgba(59, 130, 246, 0.12);
  color: var(--info);
}

.status-completed {
  background: rgba(46, 213, 115, 0.12);
  color: var(--success);
}

.status-cancelled {
  background: rgba(255, 71, 87, 0.12);
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   Stats Grid
   -------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Stat card glow effect */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-subtle);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-value {
  font-family: "Space Mono", monospace;
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

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

.stat-card[data-navigate] {
  cursor: pointer;
  user-select: none;
}

.stat-card[data-navigate]:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

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

.table th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

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

.table tbody tr:nth-child(even) {
  background: var(--bg-secondary);
}

.table tbody tr:nth-child(odd) {
  background: var(--bg-primary);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

/* --------------------------------------------------------------------------
   Notification Popup (replaces basic toast)
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  right: var(--space-md);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 400px;
  width: calc(100vw - var(--space-lg) * 2);
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-xl, 0 8px 32px var(--shadow));
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.toast:hover {
  transform: translateX(-4px);
  box-shadow: var(--shadow-xl, 0 8px 32px var(--shadow)), 0 0 0 1px var(--accent-subtle, rgba(0, 212, 170, 0.2));
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast.success::before { background: var(--success); }
.toast.error::before { background: var(--danger); }
.toast.warning::before { background: var(--warning); }
.toast.info::before { background: var(--accent); }

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.toast.success .toast-icon { background: rgba(45, 213, 115, 0.15); }
.toast.error .toast-icon { background: rgba(255, 71, 87, 0.15); }
.toast.warning .toast-icon { background: rgba(255, 165, 2, 0.15); }
.toast.info .toast-icon { background: rgba(0, 212, 170, 0.15); }

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.dismissing {
  animation: slideOut 0.3s ease forwards;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px var(--shadow);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-slow);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: var(--fs-md);
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}

/* Wide modal variant */
.modal-wide {
  max-width: 700px;
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  position: relative;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition);
}

.tab-btn::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background var(--transition);
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--accent);
}

.tab-btn.active::after {
  background: var(--accent);
}

.tab-content {
  display: none;
  padding: var(--space-lg) 0;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* --------------------------------------------------------------------------
   Empty States
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-lg);
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: var(--fs-md);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--text-muted);
  max-width: 360px;
  margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Loading Spinner
   -------------------------------------------------------------------------- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.spinner-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
}

/* Inline spinner inside buttons */
.btn .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  font-family: "Space Mono", monospace;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-sm .avatar-initials {
  font-size: var(--fs-xs);
}

.avatar-lg {
  width: 56px;
  height: 56px;
}

.avatar-lg .avatar-initials {
  font-size: var(--fs-md);
}

.avatar-xl {
  width: 80px;
  height: 80px;
}

.avatar-xl .avatar-initials {
  font-size: var(--fs-lg);
}

/* --------------------------------------------------------------------------
   Message Bubbles
   -------------------------------------------------------------------------- */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.message-received {
  align-self: flex-start;
}

.message-sent {
  align-self: flex-end;
}

.message-bubble {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  line-height: 1.5;
  word-break: break-word;
}

.message-received .message-bubble {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

.message-sent .message-bubble {
  background: var(--accent);
  color: #0a0a0f;
  border-bottom-right-radius: var(--radius-sm);
}

.message-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
  padding: 0 var(--space-xs);
}

.message-sent .message-meta {
  text-align: right;
}

/* --------------------------------------------------------------------------
   Bid Cards
   -------------------------------------------------------------------------- */
.bid-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition);
}

.bid-card:hover {
  border-color: var(--accent);
}

.bid-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.bid-amount {
  font-family: "Space Mono", monospace;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--accent);
}

.bid-mechanic {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.bid-mechanic-info {
  flex: 1;
}

.bid-mechanic-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--fs-sm);
}

.bid-mechanic-detail {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.bid-message {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.bid-actions {
  display: flex;
  gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Star Rating
   -------------------------------------------------------------------------- */
.star-rating {
  display: inline-flex;
  gap: 2px;
}

.star-rating .star {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.star-rating .star.filled {
  color: var(--warning);
}

/* Interactive rating (for input) */
.star-rating-input {
  display: inline-flex;
  gap: 2px;
  cursor: pointer;
}

.star-rating-input .star {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  transition: color var(--transition), transform var(--transition);
}

.star-rating-input .star:hover,
.star-rating-input .star.active {
  color: var(--warning);
  transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   Page-Specific Layouts
   -------------------------------------------------------------------------- */

/* Page Header — title bar with actions */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: var(--fs-xl);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Page Grid — card grid for listings */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}

/* Split View — messaging layout */
.split-view {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

.split-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.split-sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.split-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.split-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.split-main-body {
  flex: 1;
  overflow-y: auto;
}

.split-main-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

/* Conversation list item */
.conversation-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.conversation-item:hover {
  background: var(--bg-hover);
}

.conversation-item.active {
  background: var(--accent-subtle);
  border-left: 3px solid var(--accent);
}

.conversation-item-info {
  flex: 1;
  min-width: 0;
}

.conversation-item-name {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

.conversation-item-preview {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item-time {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: "Space Mono", monospace;
  flex-shrink: 0;
}

.conversation-unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Message composer */
.message-composer {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
}

.message-composer .form-textarea {
  min-height: 44px;
  max-height: 120px;
  resize: none;
}

/* --------------------------------------------------------------------------
   Search Bar
   -------------------------------------------------------------------------- */
.search-bar {
  position: relative;
}

.search-bar .form-input {
  padding-left: 44px;
}

.search-bar-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Dropdown
   -------------------------------------------------------------------------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px var(--shadow);
  padding: var(--space-xs);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-xs) 0;
}

/* --------------------------------------------------------------------------
   Progress Bar
   -------------------------------------------------------------------------- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-bar-fill.danger { background: var(--danger); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.success { background: var(--success); }

/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: var(--space-lg) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --------------------------------------------------------------------------
   Tag / Chip
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--fs-xs);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.tag-remove {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}

.tag-remove:hover {
  background: var(--danger);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpBounce {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

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

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --------------------------------------------------------------------------
   Pull to Refresh
   -------------------------------------------------------------------------- */
.pull-refresh-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.pull-refresh-indicator span {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.pull-refresh-spinner {
  transition: transform 0.1s linear;
}

/* --------------------------------------------------------------------------
   Page Transition
   -------------------------------------------------------------------------- */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.page-transition.active {
  opacity: 1;
}
.transition-content {
  text-align: center;
  animation: fadeIn 0.2s ease;
}
.transition-icon {
  margin-bottom: var(--space-sm);
  animation: spin 1s linear infinite;
}
.transition-page-name {
  font-family: 'Space Mono', monospace;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   Skeleton Loading
   -------------------------------------------------------------------------- */
.skeleton {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 60%; }
.skeleton-title {
  height: 20px;
  margin-bottom: 12px;
  width: 60%;
}
.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.skeleton-card {
  height: 160px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}

/* Staggered page-load animation */
.animate-in {
  animation: slideUpBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
}

/* Page sections fade in on load */
.section {
  animation: fadeIn 0.4s ease;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.10s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.20s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.30s; }
.animate-in:nth-child(7) { animation-delay: 0.35s; }
.animate-in:nth-child(8) { animation-delay: 0.40s; }
.animate-in:nth-child(9) { animation-delay: 0.45s; }
.animate-in:nth-child(10) { animation-delay: 0.50s; }
.animate-in:nth-child(11) { animation-delay: 0.55s; }
.animate-in:nth-child(12) { animation-delay: 0.60s; }

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Responsive — Mobile First
   -------------------------------------------------------------------------- */

/* Small phones (480px) */
/* Landing page responsive grids */
@media (max-width: 768px) {
  .landing-features-grid {
    grid-template-columns: 1fr !important;
  }
  .landing-steps-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .landing-steps-grid {
    grid-template-columns: 1fr !important;
  }

  :root {
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
  }

  h1 { font-size: var(--fs-xl); }
  h2 { font-size: var(--fs-lg); }
  h3 { font-size: var(--fs-md); }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header-actions {
    width: 100%;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card .stat-value {
    font-size: var(--fs-lg);
  }

  .toast-container {
    right: var(--space-sm);
    left: var(--space-sm);
    max-width: none;
    width: auto;
  }

  .bid-amount {
    font-size: var(--fs-lg);
  }

  .bid-actions {
    flex-direction: column;
  }

  .bid-actions .btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Bottom Navigation Bar (Mobile/App)
   -------------------------------------------------------------------------- */
.bottom-nav {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px var(--shadow);
  z-index: 998;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0); /* iPhone notch */
}

.bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  padding: 8px 0;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
  transition: all var(--transition);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item.active svg {
  filter: drop-shadow(0 0 6px var(--accent));
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

/* Centre action button (Post Job) */
.bottom-nav-action {
  position: relative;
}

.bottom-nav-action-btn {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-primary);
  margin-top: -20px;
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.35);
  transition: all var(--transition);
}

.bottom-nav-action:hover .bottom-nav-action-btn {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.5);
  transform: scale(1.05);
}

.bottom-nav-action span {
  color: var(--accent);
  font-weight: 600;
}

/* Badge on bottom nav item */
.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  background: var(--danger);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}


/* Tablets and below (768px) */
@media (max-width: 768px) {
  .nav,
  .primary-nav {
    display: none !important;
  }

  /* Show bottom nav on mobile when logged in */
  .bottom-nav:not([hidden]) {
    display: flex;
  }

  /* Add padding to main content so it's not hidden behind bottom nav */
  .app-container {
    padding-bottom: 80px !important;
  }

  .hamburger,
  .mobile-menu-btn {
    display: flex !important;
  }

  .mobile-menu {
    display: flex;
  }

  /* Hide user dropdown and auth buttons on mobile — they're in the mobile menu */
  .user-dropdown,
  .auth-buttons {
    display: none !important;
  }

  /* Keep only notification bell + theme toggle + hamburger in header on mobile */
  .header-actions {
    gap: var(--space-xs);
  }

  .split-view {
    grid-template-columns: 1fr;
  }

  .split-sidebar {
    display: none;
  }

  .split-sidebar.mobile-visible {
    display: flex;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
  }

  .table th,
  .table td {
    padding: var(--space-sm) var(--space-md);
  }

  .modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .message {
    max-width: 85%;
  }
}

/* Desktop (1024px) */
@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-xl);
  }

  .page-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  }
}

/* Hide non-essential elements on mobile */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-mobile-only {
    display: none !important;
  }

  /* Show sidebar on desktop when logged in */
  .sidebar:not([hidden]) {
    display: flex;
  }

  /* Push main content right when sidebar is visible (sidebar is sibling before .app-container) */
  .sidebar:not([hidden]) ~ .app-container {
    margin-left: 240px;
  }

  /* Hide the primary-nav in header since sidebar handles navigation */
  .primary-nav {
    display: none !important;
  }
}

/* ── Sidebar (Desktop) ───────────────────────────────── */
.sidebar {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px var(--shadow);
  z-index: 100;
  overflow-y: auto;
  padding: var(--space-md) 0;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-sm);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.sidebar-link svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0 var(--space-sm);
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .header,
  .toast-container,
  .modal-overlay,
  .hamburger,
  .mobile-menu {
    display: none !important;
  }

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

  body {
    background: #fff;
    color: #000;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* --------------------------------------------------------------------------
   Splash Screen
   -------------------------------------------------------------------------- */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-content {
  text-align: center;
  animation: fadeIn 0.8s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.splash-icon {
  margin-bottom: 16px;
}
.splash-title {
  font-family: 'Space Mono', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
}
.splash-tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Vehicle Health Score
   -------------------------------------------------------------------------- */
.health-score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color) calc(var(--score) * 3.6deg),
    var(--bg-tertiary) calc(var(--score) * 3.6deg)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.health-score-circle::before {
  content: '';
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg-secondary);
  position: absolute;
}
.health-score-value {
  position: relative;
  z-index: 1;
  font-family: 'Space Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color);
}
.health-score-circle.sm { width: 64px; height: 64px; }
.health-score-circle.sm::before { width: 48px; height: 48px; }
.health-score-circle.sm .health-score-value { font-size: 1rem; }

.health-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}
.health-bar-label {
  width: 100px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.health-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.health-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.health-bar-score {
  width: 40px;
  text-align: right;
  font-family: 'Space Mono', monospace;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.health-alerts {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.health-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 165, 2, 0.08);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.health-alert.critical {
  background: rgba(255, 71, 87, 0.08);
  border-left-color: var(--danger);
}

/* --------------------------------------------------------------------------
   Video Jobs, Tracking, Plans, Streams
   -------------------------------------------------------------------------- */
.video-container {
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-tertiary);
  margin-bottom: var(--space-lg);
}
.video-container video {
  width: 100%;
  display: block;
}

#tracking-map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--danger);
  font-weight: 600;
  font-size: var(--fs-sm);
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.5s infinite;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
  margin: var(--space-md) 0;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-left: var(--space-lg);
  border-left: 2px solid var(--border);
}
.timeline-item {
  position: relative;
  padding: var(--space-sm) var(--space-md);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-lg) - 5px);
  top: var(--space-sm);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}
.timeline-time {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}

/* --------------------------------------------------------------------------
   Notification Panel
   -------------------------------------------------------------------------- */
.notif-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  animation: fadeIn 0.2s ease;
}

.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 30px var(--shadow);
}

.notif-panel:not([hidden]) {
  transform: translateX(0);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notif-header h3 {
  font-size: var(--fs-md);
  font-weight: 700;
  margin: 0;
}

.notif-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.notif-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.notif-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.notif-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  border-bottom: 1px solid var(--border);
}

.notif-item:hover {
  background: var(--bg-hover);
}

.notif-item.unread {
  background: var(--accent-subtle);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.notif-icon.bid { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.notif-icon.booking { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.notif-icon.message { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.notif-icon.payment { background: rgba(45, 213, 115, 0.15); color: var(--success); }
.notif-icon.system { background: rgba(136, 136, 160, 0.15); color: var(--text-secondary); }
.notif-icon.report { background: rgba(255, 71, 87, 0.15); color: var(--danger); }

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-text {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  margin-top: 4px;
}

.notif-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Cookie Consent
   -------------------------------------------------------------------------- */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-md) var(--space-lg);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease;
}
.cookie-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}
.cookie-content p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin: 0;
}
.cookie-content a {
  color: var(--accent);
  text-decoration: underline;
}
.cookie-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  /* Push cookie banner above bottom nav */
  .cookie-consent {
    bottom: 64px;
  }
}

/* --------------------------------------------------------------------------
   Price Display
   -------------------------------------------------------------------------- */
.client-price {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: var(--text-primary);
}

.price-breakdown {
  font-size: 0.75em;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
}

.mech-price {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: var(--accent);
}

.price-note {
  font-size: 0.75em;
  font-weight: 400;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Social Proof Ticker
   -------------------------------------------------------------------------- */
.social-proof-ticker {
  background: var(--accent);
  color: #0a0a0f;
  overflow: hidden;
  padding: var(--space-sm) 0;
  position: relative;
}

.ticker-track {
  display: flex;
  gap: var(--space-3xl);
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
  width: max-content;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0 var(--space-md);
  flex-shrink: 0;
}

.ticker-item svg {
  flex-shrink: 0;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0a0a0f;
  opacity: 0.3;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Trust Bar ─────────────────────────────────────────────────────────── */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  padding: var(--space-xl) var(--space-lg);
  flex-wrap: wrap;
}
.trust-item {
  text-align: center;
}
.trust-number {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}
.trust-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* ── Price Comparison ──────────────────────────────────────────────────── */
.price-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
@media (max-width: 600px) {
  .price-compare-grid {
    grid-template-columns: 1fr;
  }
}
.price-compare-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
}
.price-compare-card h4 {
  margin-bottom: var(--space-md);
  font-size: var(--fs-base);
}
.price-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}
.price-dealer {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.price-dealer s {
  color: var(--danger);
}
.price-whipfix {
  font-family: 'Space Mono', monospace;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--accent);
}
.price-whipfix small {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-secondary);
  display: block;
}
.price-save {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ── Review Cards ──────────────────────────────────────────────────────── */
.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
@media (max-width: 768px) {
  .review-grid {
    grid-template-columns: 1fr;
  }
}
.review-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}
.review-stars {
  color: #f59e0b;
  font-size: var(--fs-md);
  margin-bottom: var(--space-md);
  letter-spacing: 2px;
}
.review-card p {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: var(--space-md);
}
.review-author {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== App Download Banner ===== */
.app-banner {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 996;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
  padding: var(--space-sm) var(--space-lg);
  animation: slideUp 0.3s ease;
}

.app-banner-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.app-banner-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-banner-text {
  flex: 1;
  min-width: 0;
}

.app-banner-text strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

.app-banner-text span {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.app-banner-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.app-banner-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Only show on mobile web, not in APK */
@media (min-width: 769px) {
  .app-banner { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mechanic Card
   ═══════════════════════════════════════════════════════════════════════════ */

.mechanic-card {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  align-items: flex-start;
}

.mechanic-card .avatar-xl {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.mechanic-info {
  flex: 1;
  min-width: 0;
}

.mechanic-name {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mechanic-location {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.mechanic-distance {
  font-family: 'Space Mono', monospace;
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: 600;
}

.specialty-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-sm) 0;
}

.specialty-pill {
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mechanic Profile
   ═══════════════════════════════════════════════════════════════════════════ */

.profile-header-card {
  text-align: center;
  padding: var(--space-2xl);
}

.profile-header-card .avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 32px;
  margin: 0 auto var(--space-md);
}

.profile-badges {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
}

.avail-day {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  font-size: var(--fs-sm);
}

.avail-day.available {
  border: 1px solid var(--accent);
  background: var(--accent-subtle);
}

.avail-day-name {
  font-weight: 700;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.avail-day-time {
  font-family: 'Space Mono', monospace;
  font-size: var(--fs-xs);
  color: var(--text-primary);
}

.review-item {
  border-bottom: 1px solid var(--border);
  padding: var(--space-lg) 0;
}

.review-item:last-child {
  border-bottom: none;
}

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

.review-comment {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Filter Bar
   ═══════════════════════════════════════════════════════════════════════════ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  align-items: flex-end;
}

.filter-bar .form-group {
  flex: 1;
  min-width: 150px;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .filter-bar {
    flex-direction: column;
  }
  .filter-bar .form-group {
    width: 100%;
  }
  .mechanic-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Chatbot Widget
   -------------------------------------------------------------------------- */
#chatbot { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }
#chatbot-toggle {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
#chatbot-toggle:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(0,0,0,0.3); }
#chatbot-panel {
  position: absolute; bottom: 70px; right: 0; width: 340px; max-height: 480px;
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); display: flex; flex-direction: column; overflow: hidden;
}
#chatbot-panel[hidden] { display: none !important; }
#chatbot-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-md) var(--space-lg); background: var(--accent); color: #fff; font-size: var(--fs-sm);
}
#chatbot-header button { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
#chatbot-messages {
  flex: 1; overflow-y: auto; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm);
  min-height: 200px; max-height: 320px;
}
.cb-msg { max-width: 85%; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); font-size: var(--fs-sm); line-height: 1.5; word-wrap: break-word; }
.cb-msg.bot { align-self: flex-start; background: var(--bg-secondary); color: var(--text-primary); border-bottom-left-radius: 4px; }
.cb-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.cb-msg a { color: inherit; text-decoration: underline; }
#chatbot-input-wrap {
  display: flex; border-top: 1px solid var(--border); padding: var(--space-sm);
}
#chatbot-input {
  flex: 1; border: none; background: transparent; padding: var(--space-sm); font-size: var(--fs-sm);
  color: var(--text-primary); outline: none;
}
#chatbot-send {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
@media (max-width: 480px) {
  #chatbot-panel { width: calc(100vw - 32px); right: -8px; }
  #chatbot { bottom: 16px; right: 16px; }
}
@media (max-width: 768px) {
  #chatbot { bottom: 80px; }
  #chatbot-panel { bottom: 70px; }
}

/* --------------------------------------------------------------------------
   Accessibility: Skip Link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute; top: -40px; left: 0; background: var(--accent); color: #fff;
  padding: var(--space-sm) var(--space-lg); z-index: 10000; font-size: var(--fs-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Focus visible for keyboard nav */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
