/* ============================================================
   Repair CRM — Cupertino Design System
   Premium iOS-native styling
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg-primary: #F2F2F7;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #E5E5EA;
  --bg-grouped: #F2F2F7;

  --text-primary: #000000;
  --text-secondary: #3C3C43;
  --text-tertiary: #8E8E93;
  --text-quaternary: #AEAEB2;
  --text-on-accent: #FFFFFF;

  --accent: #007AFF;
  --accent-light: rgba(0, 122, 255, 0.12);
  --accent-hover: #0056CC;
  --error: #FF3B30;
  --error-light: rgba(255, 59, 48, 0.12);
  --success: #34C759;
  --success-light: rgba(52, 199, 89, 0.12);
  --warning: #FF9500;
  --warning-light: rgba(255, 149, 0, 0.12);
  --info: #5856D6;

  --separator: rgba(60, 60, 67, 0.08);
  --separator-opaque: #C6C6C8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);

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

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

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --font-xs: 11px;
  --font-sm: 13px;
  --font-base: 15px;
  --font-md: 17px;
  --font-lg: 20px;
  --font-xl: 24px;
  --font-2xl: 28px;
  --font-3xl: 34px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Layout */
  --nav-height: 56px;
  --bottom-nav-height: 83px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --content-max-width: 640px;
  --dashboard-max-width: 1024px;
}

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

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

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  line-height: 1.47;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

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

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

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

/* --- Utility Classes --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-accent { color: var(--accent) !important; }
.text-error { color: var(--error) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }

/* ============================================================
   LAYOUT
   ============================================================ */

/* --- App Container --- */
#app {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
}

.page-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-lg);
  padding-top: var(--space-xl);
  animation: fadeIn 0.25s ease;
}

.page-container--wide {
  max-width: var(--dashboard-max-width);
}

/* --- Page Header --- */
.page-header {
  margin-bottom: var(--space-2xl);
}

.page-title {
  font-size: var(--font-3xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.12;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: var(--font-base);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
  font-weight: 400;
}

/* ============================================================
   NAVIGATION — Bottom Bar (Mobile) / Top Bar (Desktop)
   ============================================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator-opaque);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--bottom-nav-height);
  padding-bottom: var(--safe-area-bottom);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-sm) var(--space-lg);
  min-width: 64px;
  min-height: 44px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: var(--font-xs);
  font-weight: 500;
  transition: color var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item:active {
  transform: scale(0.92);
}

.bottom-nav__item.active {
  color: var(--accent);
}

.bottom-nav__icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 1px;
}

.bottom-nav__label {
  font-size: var(--font-xs);
  letter-spacing: 0.01em;
}

/* Desktop top nav */
@media (min-width: 768px) {
  .bottom-nav {
    position: fixed;
    top: 0;
    bottom: auto;
    height: var(--nav-height);
    border-top: none;
    border-bottom: 0.5px solid var(--separator-opaque);
    padding-bottom: 0;
    justify-content: center;
    gap: var(--space-3xl);
  }

  .bottom-nav__item {
    flex-direction: row;
    gap: var(--space-sm);
    font-size: var(--font-sm);
  }

  .bottom-nav__icon {
    font-size: 18px;
    margin-bottom: 0;
  }

  #app {
    padding-bottom: 0;
    padding-top: calc(var(--nav-height) + var(--space-lg));
  }
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:active {
  transform: scale(0.985);
}

.card--interactive {
  cursor: pointer;
}

.card--interactive:hover {
  box-shadow: var(--shadow-lg);
}

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

.card + .card {
  margin-top: var(--space-md);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 50px;
  min-width: 44px;
  padding: var(--space-md) var(--space-2xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Primary */
.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  background: #004EA6;
}

/* Secondary */
.btn-secondary {
  background: var(--accent-light);
  color: var(--accent);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(0, 122, 255, 0.18);
}

/* Danger */
.btn-danger {
  background: var(--error);
  color: var(--text-on-accent);
}

.btn-danger:hover:not(:disabled) {
  background: #D63029;
}

/* Success */
.btn-success {
  background: var(--success);
  color: var(--text-on-accent);
}

.btn-success:hover:not(:disabled) {
  background: #248A3D;
}

/* Warning */
.btn-warning {
  background: var(--warning);
  color: var(--text-on-accent);
}

/* Ghost / Text */
.btn-ghost {
  background: transparent;
  color: var(--accent);
  min-height: 44px;
  padding: var(--space-sm) var(--space-lg);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent-light);
}

/* Full width */
.btn-block {
  width: 100%;
}

/* Large */
.btn-lg {
  min-height: 56px;
  font-size: 18px;
  border-radius: var(--radius-lg);
}

/* Small */
.btn-sm {
  min-height: 36px;
  font-size: var(--font-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
}

/* Icon button */
.btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 20px;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
  margin-bottom: var(--space-xl);
}

.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 50px;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1.5px solid var(--separator-opaque);
  border-radius: var(--radius-md);
  font-size: var(--font-md);
  color: var(--text-primary);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-light);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238E8E93' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-hint {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: var(--font-sm);
  color: var(--error);
  margin-top: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-xl);
  background: var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4xl) var(--space-2xl);
  animation: slideUp 0.4s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.login-logo__icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--accent), #5856D6);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 36px;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.25);
}

.login-logo__title {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.login-logo__subtitle {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

.login-error {
  background: var(--error-light);
  color: var(--error);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-weight: 500;
  margin-bottom: var(--space-xl);
  display: none;
  animation: shake 0.4s ease;
}

.login-error.visible {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--created,
.badge--warning {
  background: var(--warning-light);
  color: #C77800;
}

.badge--in_progress,
.badge--info {
  background: var(--accent-light);
  color: var(--accent);
}

.badge--completed,
.badge--success {
  background: var(--success-light);
  color: #1B7D32;
}

.badge--error {
  background: var(--error-light);
  color: var(--error);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ============================================================
   TASK CARDS
   ============================================================ */

.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.task-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.task-card:active {
  transform: scale(0.985);
}

.task-card:hover {
  box-shadow: var(--shadow-lg);
}

.task-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.task-card__id {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}

.task-card__equipment {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.task-card__category {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.task-card__problem {
  font-size: var(--font-base);
  color: var(--text-secondary);
  margin: var(--space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.task-card__problem-icon {
  color: var(--warning);
  flex-shrink: 0;
}

.task-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--separator);
}

.task-card__time {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.task-card__views {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Side accent stripe */
.task-card--created {
  border-left: 3px solid var(--warning);
}

.task-card--in_progress {
  border-left: 3px solid var(--accent);
}

.task-card--completed {
  border-left: 3px solid var(--success);
}

/* ============================================================
   TASK DETAIL
   ============================================================ */

.task-detail {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.task-detail__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--accent);
  font-size: var(--font-md);
  font-weight: 500;
  margin-bottom: var(--space-xl);
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-sm) 0;
  min-height: 44px;
}

.task-detail__back:active {
  opacity: 0.6;
}

.task-detail__section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.task-detail__section-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-lg);
}

.task-detail__info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--separator);
}

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

.task-detail__info-label {
  font-size: var(--font-base);
  color: var(--text-tertiary);
}

.task-detail__info-value {
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
}

.task-detail__description {
  font-size: var(--font-base);
  color: var(--text-secondary);
  line-height: 1.6;
  padding: var(--space-lg);
  background: var(--bg-grouped);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
}

.task-detail__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* ============================================================
   VIEW TRACKING
   ============================================================ */

.view-tracking {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.view-tracking__title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-lg);
}

.view-tracking__group {
  margin-bottom: var(--space-xl);
}

.view-tracking__group:last-child {
  margin-bottom: 0;
}

.view-tracking__group-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-base);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.view-tracking__group-header--viewed {
  color: var(--success);
}

.view-tracking__group-header--pending {
  color: var(--warning);
}

.view-tracking__list {
  list-style: none;
}

.view-tracking__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-grouped);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: background var(--transition-fast);
}

.view-tracking__item:last-child {
  margin-bottom: 0;
}

.view-tracking__user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.view-tracking__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.view-tracking__avatar--viewed {
  background: var(--success);
}

.view-tracking__avatar--pending {
  background: var(--text-quaternary);
}

.view-tracking__name {
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--text-primary);
}

.view-tracking__role {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
}

.view-tracking__time {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  text-align: right;
  white-space: nowrap;
}

.view-tracking__empty {
  font-size: var(--font-sm);
  color: var(--text-quaternary);
  font-style: italic;
  padding: var(--space-md);
}

/* ============================================================
   FILTER TABS
   ============================================================ */

.filter-tabs {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xs);
}

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

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(142, 142, 147, 0.12);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

.filter-tab:active {
  transform: scale(0.95);
}

.filter-tab.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

.filter-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 0 6px;
}

.filter-tab.active .filter-tab__count {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   MULTI-STEP FORM
   ============================================================ */

.wizard {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* Progress breadcrumb */
.wizard__progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--space-xs);
}

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

.wizard__step-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  white-space: nowrap;
  font-size: var(--font-sm);
}

.wizard__step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 600;
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.wizard__step-indicator--completed .wizard__step-number {
  background: var(--success);
  color: white;
}

.wizard__step-indicator--active .wizard__step-number {
  background: var(--accent);
  color: white;
}

.wizard__step-indicator--upcoming .wizard__step-number {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

.wizard__step-label {
  font-weight: 500;
  color: var(--text-tertiary);
}

.wizard__step-indicator--active .wizard__step-label {
  color: var(--accent);
}

.wizard__step-indicator--completed .wizard__step-label {
  color: var(--success);
}

.wizard__step-divider {
  width: 24px;
  height: 1px;
  background: var(--separator-opaque);
  flex-shrink: 0;
}

/* Selection cards grid */
.wizard__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

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

.wizard__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 100px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.wizard__option:active {
  transform: scale(0.97);
}

.wizard__option:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-lg);
}

.wizard__option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.wizard__option-icon {
  font-size: 32px;
  line-height: 1;
}

.wizard__option-name {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text-primary);
}

.wizard__option-count {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
}

/* Breadcrumb / selection summary */
.wizard__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.wizard__breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}

.wizard__breadcrumb-item:hover {
  text-decoration: underline;
}

.wizard__breadcrumb-sep {
  color: var(--text-quaternary);
  font-size: var(--font-sm);
}

/* Wizard navigation */
.wizard__nav {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* Confirm step */
.wizard__summary {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.wizard__summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--separator);
}

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

.wizard__summary-label {
  font-size: var(--font-base);
  color: var(--text-tertiary);
}

.wizard__summary-value {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  max-width: 60%;
}

/* ============================================================
   DASHBOARD / STATISTICS
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  text-align: center;
  transition: transform var(--transition-fast);
}

.stat-card:active {
  transform: scale(0.97);
}

.stat-card__icon {
  font-size: 28px;
  margin-bottom: var(--space-sm);
}

.stat-card__value {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card__label {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
  font-weight: 500;
}

/* CSS Bar Chart */
.chart-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.chart-section__title {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: var(--space-xl);
}

.chart-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.chart-bar:last-child {
  margin-bottom: 0;
}

.chart-bar__label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  width: 120px;
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar__track {
  flex: 1;
  height: 28px;
  background: var(--bg-grouped);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.chart-bar__fill {
  height: 100%;
  background: linear-gradient(135deg, var(--accent), #5856D6);
  border-radius: var(--radius-sm);
  transition: width 0.6s ease;
  min-width: 2px;
  display: flex;
  align-items: center;
  padding-left: var(--space-sm);
}

.chart-bar__value {
  font-size: var(--font-xs);
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.chart-bar__value--outside {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: var(--space-sm);
  white-space: nowrap;
}

/* Dashboard Filters */
.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.dashboard-filters .form-input,
.dashboard-filters .form-select {
  min-height: 44px;
  font-size: var(--font-sm);
}

@media (max-width: 767px) {
  .dashboard-filters {
    flex-direction: column;
  }
}

@media (min-width: 768px) {
  .dashboard-filters .form-input,
  .dashboard-filters .form-select {
    width: auto;
    min-width: 160px;
  }
}

/* ============================================================
   ADMIN — USER MANAGEMENT
   ============================================================ */

.user-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  gap: var(--space-md);
  transition: transform var(--transition-fast);
}

.user-item:active {
  transform: scale(0.985);
}

.user-item__info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
  flex: 1;
}

.user-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5856D6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--font-md);
  flex-shrink: 0;
}

.user-item__name {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text-primary);
}

.user-item__meta {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.user-item__actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* ============================================================
   MODAL / OVERLAY — Glassmorphism
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
  padding: 0;
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    padding: var(--space-xl);
  }
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  max-height: 90dvh;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.3s ease;
}

@media (min-width: 768px) {
  .modal {
    border-radius: var(--radius-xl);
  }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-2xl);
  border-bottom: 1px solid var(--separator);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.modal__title {
  font-size: var(--font-md);
  font-weight: 600;
}

.modal__close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
  min-width: 30px;
  min-height: 30px;
}

.modal__close:hover {
  background: var(--separator-opaque);
}

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

.modal__footer {
  padding: var(--space-lg) var(--space-2xl) var(--space-2xl);
  display: flex;
  gap: var(--space-md);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
  position: fixed;
  top: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  width: calc(100% - var(--space-2xl) * 2);
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-xl);
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
  font-size: var(--font-base);
  font-weight: 500;
}

.toast--success {
  border-left: 4px solid var(--success);
}

.toast--error {
  border-left: 4px solid var(--error);
}

.toast--warning {
  border-left: 4px solid var(--warning);
}

.toast--info {
  border-left: 4px solid var(--accent);
}

.toast__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast__message {
  flex: 1;
  color: var(--text-primary);
}

/* ============================================================
   LOADING / SPINNER
   ============================================================ */

.spinner-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(242, 242, 247, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--inline {
  width: 20px;
  height: 20px;
  border-width: 2px;
  display: inline-block;
  vertical-align: middle;
}

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

.loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl);
  gap: var(--space-lg);
  color: var(--text-tertiary);
}

.loading-placeholder__text {
  font-size: var(--font-base);
  font-weight: 500;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, #E8E8ED 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 16px;
  margin-bottom: var(--space-sm);
}

.skeleton--text:last-child {
  width: 70%;
}

.skeleton--card {
  height: 120px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}

/* ============================================================
   EMPTY STATES
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) var(--space-xl);
  text-align: center;
}

.empty-state__icon {
  font-size: 64px;
  margin-bottom: var(--space-xl);
  opacity: 0.6;
}

.empty-state__title {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.empty-state__text {
  font-size: var(--font-base);
  color: var(--text-tertiary);
  max-width: 280px;
  line-height: 1.5;
}

/* ============================================================
   COMPLETE FORM (Mechanic)
   ============================================================ */

.complete-form {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  margin-top: var(--space-lg);
}

.complete-form__title {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.time-input-group {
  display: flex;
  gap: var(--space-md);
  align-items: flex-end;
}

.time-input-group .form-group {
  flex: 1;
}

/* ============================================================
   PULL TO REFRESH
   ============================================================ */

.pull-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.pull-indicator.visible {
  opacity: 1;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 374px) {
  :root {
    --font-3xl: 28px;
    --font-2xl: 24px;
  }

  .page-container {
    padding: var(--space-md);
  }

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

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

@media (min-width: 768px) {
  .page-container {
    padding: var(--space-2xl) var(--space-3xl);
    padding-top: var(--space-3xl);
  }
}

/* ============================================================
   SAFE AREA (Notch devices)
   ============================================================ */

@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  }

  #app {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  }

  @media (min-width: 768px) {
    #app {
      padding-bottom: 0;
    }
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  .bottom-nav,
  .toast-container,
  .spinner-overlay {
    display: none !important;
  }

  #app {
    padding: 0 !important;
  }

  .card, .task-card, .stat-card {
    box-shadow: none !important;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
