/* ============================================
   All My Rides - Modern UI
   ============================================ */

:root {
  --primary: #1a1a2e;
  --primary-light: #16213e;
  --accent: #0f3460;
  --accent-bright: #4361ee;
  --accent-hover: #3a56d4;
  --bg: #f5f6fa;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition: 0.2s ease;
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Login View
   ============================================ */

.login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow-y: auto;
}

.login-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo img {
  width: 160px;
  height: 160px;
}

.login-brand h1 {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-tagline {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-top: 4px;
}

.login-form-container {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.login-form-container h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.login-form-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg-card);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

.forgot-password-link {
  color: var(--accent-bright);
  font-size: 13px;
  text-decoration: none;
  text-align: right;
  display: block;
  margin-top: -8px;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 13px;
}

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

.social-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-login-buttons .btn-social {
  width: 100%;
}

.login-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.login-switch a {
  color: var(--accent-bright);
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
}

.login-switch a:hover {
  text-decoration: underline;
}

.login-language {
  text-align: center;
  margin-top: 20px;
}

.login-language select {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.login-language select option {
  color: var(--text);
  background: var(--bg-card);
}

.login-legal-links {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
}

.login-legal-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.login-legal-links a:hover {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
}

.login-legal-separator {
  color: rgba(255,255,255,0.4);
  margin: 0 8px;
}

/* ============================================
   Password Recovery Mode
   – Shows only the new-password form, hides
     all landing page sections and extras.
   ============================================ */

.login-view.password-recovery-mode .landing-nav,
.login-view.password-recovery-mode .landing-hero,
.login-view.password-recovery-mode .landing-features,
.login-view.password-recovery-mode .landing-mechanics,
.login-view.password-recovery-mode .landing-faq,
.login-view.password-recovery-mode .landing-footer {
  display: none !important;
}

.login-view.password-recovery-mode .landing-login-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-view.password-recovery-mode .login-brand {
  display: block;
}

.login-view.password-recovery-mode .login-brand h1,
.login-view.password-recovery-mode .login-brand .login-tagline {
  display: none;
}

.login-view.password-recovery-mode .login-divider,
.login-view.password-recovery-mode .social-login-buttons,
.login-view.password-recovery-mode .login-switch,
.login-view.password-recovery-mode .login-language,
.login-view.password-recovery-mode .login-legal-links {
  display: none !important;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent-bright);
  color: #fff;
}

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

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

.btn-social {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 13px;
  gap: 6px;
}

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

.btn-social svg {
  flex-shrink: 0;
}

/* Sign in with Apple — follows Apple HIG: black bg, white text, full-width,
   minimum 44pt tall and visually at least as prominent as other providers. */
.btn-apple,
.btn-social.btn-apple {
  background: #000;
  color: #fff;
  border: 1px solid #000;
  min-height: 44px;
  font-weight: 600;
  font-size: 14px;
}

.btn-apple:hover,
.btn-social.btn-apple:hover {
  background: #000;
  border-color: #000;
  opacity: 0.88;
}

.btn-apple svg {
  fill: #fff;
}

/* ============================================
   App Layout
   ============================================ */

.app-view {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition);
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.sidebar-close-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-item.active {
  background: var(--accent-bright);
  color: #fff;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-user-section {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-workshop {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
  margin-top: 1px;
}

.sidebar-user-section .btn-ghost {
  color: rgba(255,255,255,0.6);
  width: 100%;
  justify-content: flex-start;
  font-size: 13px;
}

.sidebar-user-section .btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  flex: 1;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.page-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* ============================================
   Page Components
   ============================================ */

.page-header {
  margin-bottom: 28px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
}

.stat-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.stat-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 4px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.stat-card .stat-change {
  font-size: 12px;
  margin-top: 4px;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--border-light);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

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

.data-table tr:hover td {
  background: var(--border-light);
}

.btn-delete-service {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-service:hover {
  opacity: 1;
  color: #e53e3e;
}

/* Service type multi-select checkboxes */
.service-type-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
}

.service-type-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
  user-select: none;
}

.service-type-checkbox-label:hover {
  background: var(--border-light);
}

.service-type-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Service tags (type + performed-by) */
.service-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  background: var(--primary);
  color: #fff;
  white-space: nowrap;
  line-height: 1.4;
}

/* Service type more badge */
.service-more-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--border);
  color: var(--text-secondary);
  margin-left: 4px;
  vertical-align: middle;
  cursor: pointer;
}

/* Clickable service rows */
.data-table tbody tr[style*="cursor:pointer"]:hover {
  background: var(--hover, rgba(0,0,0,0.03));
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-neutral {
  background: var(--border-light);
  color: var(--text-secondary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-light);
}

/* Form Sections */
.form-section {
  margin-bottom: 32px;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

/* Form Row */
.form-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
}

.toggle-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 24px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-bright);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}

.toast-success {
  background: var(--success);
  color: #fff;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast-info {
  background: var(--info);
  color: #fff;
}

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

/* Vehicle Card Grid */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.vehicle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.vehicle-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.vehicle-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.vehicle-card-title {
  font-size: 16px;
  font-weight: 600;
}

.vehicle-card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.vehicle-card-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.vehicle-detail-label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vehicle-detail-value {
  font-size: 14px;
  font-weight: 500;
  margin-top: 2px;
}

.vehicle-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.transfer-pending-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  margin-top: 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
}

.transfer-pending-badge button {
  flex-shrink: 0;
  color: #92400e;
  font-size: 14px;
}

/* Vehicle Parts Section */
.vehicle-parts-section {
  border-top: 1px solid var(--border-light);
  margin-top: 12px;
  padding-top: 12px;
}

.vehicle-parts-toggle {
  width: 100%;
  text-align: left;
  font-weight: 500;
}

.parts-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  margin-left: 4px;
}

.vehicle-parts-list {
  padding-top: 10px;
}

.parts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.parts-empty {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 8px 0;
  margin: 0;
}

.part-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 6px;
  font-size: 13px;
}

.part-name {
  font-weight: 500;
  color: var(--text-primary);
  min-width: 0;
  flex: 1;
}

.part-value {
  color: var(--text-secondary);
  flex: 1;
  text-align: right;
}

.part-delete-btn {
  flex-shrink: 0;
  padding: 2px 4px !important;
  min-width: auto !important;
  font-size: 12px;
}

.part-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.part-add-form input {
  flex: 1 1 80px;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  min-width: 0;
}

.part-add-form .btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 13px;
  width: 100%;
  min-width: auto;
}

/* Danger Zone */
.danger-zone {
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 32px;
}

.danger-zone h3 {
  color: var(--danger);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.danger-zone p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============================================
   Service Planner
   ============================================ */

/* Filter bar */
.sp-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.sp-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.sp-filter-select {
  padding: 7px 30px 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  width: 100%;
  max-width: 320px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sp-filter-select:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.sp-clear-filter {
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--accent-bright);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.sp-clear-filter:hover {
  background: #dbeafe;
}

.sp-empty-card {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.sp-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.sp-empty-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.sp-empty-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Vehicle Card */
.sp-vehicle-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.sp-vehicle-card:hover {
  box-shadow: var(--shadow-md);
}

.sp-vehicle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.sp-vehicle-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sp-vehicle-emoji {
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.sp-vehicle-info {
  min-width: 0;
}

.sp-vehicle-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-vehicle-year {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 13px;
}

.sp-vehicle-details {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.sp-vehicle-plate {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-bright);
  background: #eef2ff;
  padding: 1px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.sp-vehicle-make {
  font-size: 12px;
  color: var(--text-secondary);
}

.sp-vehicle-stats {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.sp-vehicle-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  min-width: 56px;
}

.sp-vehicle-stat.overdue {
  background: #fef2f2;
  border-color: #fecaca;
}

.sp-vehicle-stat-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.sp-vehicle-stat.overdue .sp-vehicle-stat-value {
  color: #dc2626;
}

.sp-vehicle-stat-label {
  font-size: 9px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.sp-vehicle-body {
  padding: 0;
}

.sp-no-services {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Service table inside vehicle cards */
.sp-service-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sp-service-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.sp-service-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.sp-service-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-service-table tbody tr {
  cursor: pointer;
  transition: background var(--transition);
}

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

.sp-service-table tbody tr:hover {
  background: #f8fafc;
}

.sp-row-overdue {
  background: #fef8f8;
}

.sp-row-overdue:hover {
  background: #fef2f2 !important;
}

.sp-td-type {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sp-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.sp-type-dot.latest {
  background: var(--accent-bright);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.sp-type-dot.overdue {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.sp-type-label {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-mechanic-tag {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--border-light);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.sp-td-date {
  white-space: nowrap;
  color: var(--text);
}

.sp-td-performed {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-td-performed .service-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-text-danger {
  color: #dc2626 !important;
  font-weight: 600;
}

.sp-td-reading {
  white-space: nowrap;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.sp-td-days {
  white-space: nowrap;
}

.sp-days-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.sp-days-badge.recent {
  background: #f0fdf4;
  color: #15803d;
}

.sp-days-badge.overdue {
  background: #fef2f2;
  color: #dc2626;
}

.sp-th-days,
.sp-td-days {
  text-align: right;
}

.sp-th-reading,
.sp-td-reading {
  text-align: right;
}

/* Unified table wrap */
.sp-unified-table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sp-unified-table {
  font-size: 13px;
  table-layout: fixed;
  width: 100%;
  min-width: 700px;
}

.sp-unified-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Fixed column widths for consistent alignment */
.sp-unified-table .sp-col-vehicle  { width: 22%; }
.sp-unified-table .sp-col-type     { width: 18%; }
.sp-unified-table .sp-col-date     { width: 11%; }
.sp-unified-table .sp-col-reading  { width: 12%; }
.sp-unified-table .sp-col-performed { width: 17%; }
.sp-unified-table .sp-col-notes    { width: 16%; }
.sp-unified-table .sp-col-actions  { width: 4%; }

/* Vehicle column in unified table */
.sp-td-vehicle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.sp-vehicle-emoji-sm {
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sp-vehicle-name-sm {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-vehicle-plate-sm {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-bright);
  background: #eef2ff;
  padding: 0px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  margin-left: 4px;
}

/* Results count */
.sp-results-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 2px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.filter-bar select:focus {
  outline: none;
  border-color: var(--accent-bright);
}

/* Message */
.message {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ============================================
   Mobile Bottom Navigation
   ============================================ */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 101;
  padding: 4px 0;
  padding-bottom: max(env(safe-area-inset-bottom, 4px), 4px);
  /* Prevent the row itself from overflowing on long labels / large system text */
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.bottom-nav-item {
  /* Equal-width tabs that share available space, never push siblings off-screen */
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.bottom-nav-item span {
  /* Allow long words to wrap to max 2 lines instead of overflowing the bar */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

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

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

.bottom-nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    padding-bottom: 80px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: block;
  }

  .mobile-menu-btn {
    display: block;
  }

  .bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
  }

  .page-content {
    padding: 20px 16px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    padding: 0 16px;
  }

  .page-title {
    font-size: 17px;
  }

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

  .stat-card {
    padding: 14px 16px;
  }

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

  .stat-icon-badge {
    width: 30px;
    height: 30px;
    font-size: 14px;
    margin-bottom: 8px;
    border-radius: 8px;
  }

  .vehicle-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .vehicle-card {
    padding: 14px 16px;
  }

  .vehicle-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .vehicle-card-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .vehicle-card-title {
    font-size: 15px;
  }

  .vehicle-card-actions {
    padding-top: 12px;
  }

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

  .social-login-buttons {
    flex-direction: column;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  /* Service planner — mobile */
  .sp-filter-bar {
    padding: 8px 12px;
  }

  .sp-filter-select {
    max-width: 100%;
  }

  .sp-vehicle-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }

  .sp-vehicle-stats {
    width: 100%;
    justify-content: flex-start;
  }

  .sp-vehicle-stat {
    flex: 1;
  }

  .sp-vehicle-emoji {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .sp-vehicle-name {
    font-size: 14px;
  }

  .sp-service-table {
    font-size: 12px;
  }

  .sp-service-table th {
    padding: 8px 10px;
    font-size: 10px;
  }

  .sp-service-table td {
    padding: 11px 10px;
  }

  /* Hide mechanic tag on mobile to save space */
  .sp-mechanic-tag {
    display: none;
  }

  .sp-days-badge {
    font-size: 11px;
    padding: 1px 6px;
  }

  /* Hide vehicle plate badge on mobile to save space */
  .sp-vehicle-plate-sm {
    display: none;
  }

  .sp-vehicle-emoji-sm {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  /* Hide reading column on tablets — keep Age (more useful for planning) */
  .sp-th-reading,
  .sp-td-reading {
    display: none;
  }

  /* Hide performed-by & notes columns on mobile to prevent table overflow */
  .sp-col-performed,
  .sp-td-performed,
  .sp-unified-table th:nth-child(5) {
    display: none;
  }

  .sp-unified-table {
    min-width: 0;
    table-layout: auto;
  }

  /* Fix filter bar select overflow on mobile */
  .filter-bar select {
    min-width: 0 !important;
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .service-tag {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Parts add form: full-width button on mobile */
  .part-add-form {
    flex-wrap: wrap;
  }

  .part-add-form .btn {
    width: 100%;
    text-align: center;
  }

  .card-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .card-body {
    padding: 16px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .service-type-checkboxes {
    grid-template-columns: 1fr;
  }

  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }

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

  .danger-zone {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 10px 12px;
    text-align: center;
  }

  .stat-icon-badge {
    width: 26px;
    height: 26px;
    font-size: 12px;
    margin: 0 auto 4px;
    border-radius: 7px;
  }

  .stat-card .stat-label {
    font-size: 10px;
    margin-bottom: 2px;
  }

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

  /* Also hide age/days column on very small screens */
  .sp-th-days,
  .sp-td-days {
    display: none;
  }

  /* Hide notes and actions columns on very narrow screens */
  .sp-td-notes,
  .sp-th-notes,
  .sp-col-notes {
    display: none;
  }

  .sp-col-actions,
  .sp-unified-table th:last-child,
  .sp-unified-table td:last-child {
    display: none;
  }

  .sp-service-table th {
    padding: 6px 8px;
    font-size: 9px;
  }

  .sp-service-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  /* More compact vehicle name in table */
  .sp-vehicle-name-sm {
    font-size: 12px;
    max-width: 100px;
  }

  .login-container {
    max-width: 100%;
  }

  .login-form-container {
    padding: 24px;
    border-radius: var(--radius-lg);
  }

  .login-brand h1 {
    font-size: 24px;
  }

  .vehicle-card {
    padding: 12px;
  }

  .vehicle-card-header {
    margin-bottom: 10px;
  }

  .vehicle-card-details {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .vehicle-detail-label {
    font-size: 11px;
  }

  .vehicle-detail-value {
    font-size: 13px;
  }

  .form-row {
    flex-direction: column;
  }

  .top-bar-actions {
    display: none;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .sp-filter-bar {
    padding: 8px 10px;
    gap: 8px;
  }

  .sp-filter-select {
    font-size: 13px;
    padding: 8px 28px 8px 10px;
  }

  .sp-results-count {
    font-size: 12px;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================
   Modal / Dialog
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal-content .form-group {
  margin-bottom: 16px;
}

.modal-content .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.modal-content .form-group input,
.modal-content .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

/* ============================================
   File Upload & Attachment Preview
   ============================================ */

.file-upload-area {
  border: 2px dashed #d0d5dd;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fafbfc;
}

.file-upload-area:hover {
  border-color: var(--accent-bright);
  background: rgba(67, 97, 238, 0.04);
}

.file-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

.file-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f7f8fa;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 13px;
}

.file-preview-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.file-preview-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef0f4;
  border-radius: 6px;
  font-size: 20px;
  flex-shrink: 0;
  text-decoration: none;
}

.file-preview-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  text-decoration: none;
}

.file-preview-name:hover {
  text-decoration: underline;
}

.file-preview-size {
  color: var(--text-secondary);
  font-size: 11px;
  flex-shrink: 0;
}

.file-preview-remove {
  color: #e74c3c;
  font-size: 14px;
  padding: 2px 6px;
  flex-shrink: 0;
}

/* ============================================
   Landing Page
   ============================================ */

/* Navigation */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(26, 26, 46, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.landing-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
}

.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.landing-nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-lang-select {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
}

.landing-lang-select option {
  color: var(--text);
  background: var(--bg-card);
}

/* Hero Section */
.landing-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--accent-bright) 100%);
  padding: 80px 32px 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  max-width: 100%;
  overflow: hidden;
}

.landing-hero-content {
  max-width: 520px;
  flex-shrink: 0;
}

.landing-hero-content h1 {
  color: #fff;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.landing-hero-content h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero-content > p {
  color: rgba(255,255,255,0.78);
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 32px;
}

.landing-hero-actions {
  margin-bottom: 28px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.landing-trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
}

.landing-trust-bar span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hero Mockup */
.landing-hero-visual {
  flex-shrink: 0;
}

.landing-hero-mockup {
  width: 360px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
  overflow: hidden;
  transform: perspective(800px) rotateY(-5deg) rotateX(2deg);
  transition: transform 0.4s;
}

.landing-hero-mockup:hover {
  transform: perspective(800px) rotateY(0deg) rotateX(0deg);
}

.mockup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
}

.mockup-dot.red { background: #ef4444; }
.mockup-dot.yellow { background: #f59e0b; }
.mockup-dot.green { background: #10b981; }

.mockup-title {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mockup-body {
  padding: 8px 0;
}

.mockup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  transition: background 0.15s;
}

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

.mockup-row:hover {
  background: #f8fafc;
}

.mockup-emoji {
  font-size: 18px;
  width: 28px;
  text-align: center;
}

.mockup-name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.mockup-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.mockup-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.mockup-badge.good {
  background: #f0fdf4;
  color: #15803d;
}

.mockup-badge.warn {
  background: #fffbeb;
  color: #92400e;
}

.mockup-badge.bad {
  background: #fef2f2;
  color: #dc2626;
}

/* Section Common */
.landing-section-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px;
}

.landing-section-inner > h2 {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--text);
}

.landing-section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

/* Features Section */
.landing-features {
  padding: 80px 0;
  background: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-icon {
  font-size: 32px;
  margin-bottom: 14px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Mechanics Section */
.landing-mechanics {
  padding: 80px 0;
  background: var(--bg);
}

.mechanics-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.mechanic-step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-bright);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.step-illustration {
  margin-bottom: 20px;
}

.step-scene {
  display: flex;
  justify-content: center;
}

.step-screen {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 220px;
}

.step-screen-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}

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

.mechanic-step h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.mechanic-step p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* FAQ Section */
.landing-faq {
  padding: 80px 0;
  background: #fff;
}

.faq-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 22px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
}

.faq-question:hover {
  background: rgba(0,0,0,0.02);
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.3s;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 22px;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 22px 18px;
}

.faq-answer p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Login Section */
.landing-login-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--accent-bright) 100%);
  padding: 60px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Landing Footer */
.landing-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 24px 32px;
  font-size: 13px;
}

.landing-footer a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}

.landing-footer a:hover {
  text-decoration: underline;
}

.landing-footer p + p {
  margin-top: 4px;
}

/* Service Schedule Notes Column */
.sp-td-notes {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================
   Landing Page Responsive
   ============================================ */

@media (max-width: 900px) {
  .landing-hero {
    flex-direction: column;
    padding: 60px 24px 60px;
    text-align: center;
  }

  .landing-hero-content h1 {
    font-size: 32px;
  }

  .landing-hero-content > p {
    font-size: 15px;
  }

  .landing-trust-bar {
    justify-content: center;
  }

  .landing-hero-mockup {
    width: 300px;
    transform: none;
  }

  .landing-hero-mockup:hover {
    transform: none;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .mechanics-steps {
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 400px;
    margin: 0 auto;
  }

  .landing-section-inner > h2 {
    font-size: 26px;
  }
}

@media (max-width: 600px) {
  .landing-nav-inner {
    padding: 12px 16px;
  }

  .landing-hero {
    padding: 40px 16px 50px;
  }

  .landing-hero-content h1 {
    font-size: 26px;
  }

  .landing-hero-visual {
    display: none;
  }

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

  .landing-features,
  .landing-mechanics,
  .landing-faq {
    padding: 48px 0;
  }

  .landing-section-inner {
    padding: 0 16px;
  }

  .landing-section-inner > h2 {
    font-size: 22px;
  }

  .landing-section-subtitle {
    font-size: 14px;
  }

  .faq-question {
    font-size: 14px;
    padding: 14px 16px;
  }

  .faq-answer {
    padding: 0 16px;
  }

  .faq-item.open .faq-answer {
    padding: 0 16px 14px;
  }

  .landing-login-section {
    padding: 40px 16px 28px;
  }

  /* Hide notes column on small screens for service schedule */
  .sp-td-notes,
  .sp-th-notes {
    display: none;
  }
}

/* ============================================
   Mechanic View Styles
   ============================================ */

.mechanic-add-form-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.mechanic-form-row {
  display: flex;
  gap: 16px;
}

.mechanic-form-row .form-group {
  flex: 1;
}

.mechanic-plate-badge {
  display: inline-block;
  background: #1e3a5f;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
}

.mechanic-order-badge {
  display: inline-block;
  background: #f0f4ff;
  color: #1e3a5f;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  border: 1px solid #c7d2e8;
}

.mechanic-synced-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.mechanic-pending-badge {
  display: inline-block;
  color: #9ca3af;
  font-size: 12px;
}

/* Mechanic service cards */
.mechanic-services-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mechanic-service-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.mechanic-service-card.expanded {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.mechanic-service-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  gap: 12px;
  user-select: none;
}

.mechanic-service-card-header:hover {
  background: var(--bg-secondary);
}

.mechanic-service-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mechanic-service-card-vehicle {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mechanic-service-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mechanic-service-card-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.mechanic-service-expand-icon {
  font-size: 14px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.mechanic-service-card.expanded .mechanic-service-expand-icon {
  transform: rotate(90deg);
}

.mechanic-attach-badge {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 999px;
}

.mechanic-service-card-detail {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-color);
}

.mechanic-service-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 12px;
}

.mechanic-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mechanic-detail-item.mechanic-detail-full {
  grid-column: 1 / -1;
}

.mechanic-detail-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mechanic-detail-value {
  font-size: 14px;
  color: var(--text-primary);
}

.mechanic-service-detail-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* Mechanic attachments grid */
.mechanic-attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mechanic-attachment-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 80px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s;
}

.mechanic-attachment-item:hover {
  background: var(--bg-secondary);
}

.mechanic-attachment-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.mechanic-attachment-file-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.mechanic-attachment-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 640px) {
  .mechanic-form-row {
    flex-direction: column;
    gap: 0;
  }
  .mechanic-service-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .mechanic-service-card-right {
    flex-wrap: wrap;
  }
  .mechanic-service-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Spinner for loading overlays */
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #4361ee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Audience Path Cards (Homepage)
   ============================================ */
.audience-paths {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 900px;
}

.audience-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.audience-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.audience-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.audience-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.audience-card p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.audience-card-arrow {
  margin-left: auto;
  font-size: 1.25rem;
  opacity: 0.6;
  flex-shrink: 0;
}

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

  .audience-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .audience-card-arrow {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* ============================================
   Audience Landing Pages
   ============================================ */
.audience-page .landing-hero {
  display: flex;
}

.audience-page .landing-hero-content {
  max-width: 600px;
}

.audience-page .features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .audience-page .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .audience-page .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   Mobile App Wrapper (iOS / Android WebView)
   – Show the login form at the top, no scroll
     needed to reach it. Marketing content
     stays available below for users who scroll.
   ============================================ */
html.in-mobile-app #login-view {
  display: flex;
  flex-direction: column;
}

/* Hide the sticky landing nav inside the wrapper – the login form
   appears immediately, so the "Sign In" button in the nav is redundant
   and the brand bar just adds height before the form. */
html.in-mobile-app #login-view > .landing-nav {
  display: none;
}

/* Pull the login section to the top of the flex column. Everything
   else keeps default order (0) and follows in document order below. */
html.in-mobile-app #login-view > .landing-login-section {
  order: -1;
  /* Cancel the large vertical padding the desktop layout uses so the
     form lands right under the status bar. */
  padding-top: 24px;
}

/* App Store Guideline 3.2.0 — inside the iOS/Android wrapper, hide any
   marketing CTA that hints at a paid Premium upgrade outside of the
   platform's in-app purchase system. The web users still see all of
   this; only the native wrapper hides it. */
html.in-mobile-app .premium-cta,
html.in-mobile-app .premium-upsell,
html.in-mobile-app #workshops-hero-cta,
html.in-mobile-app [data-premium-cta] {
  display: none !important;
}

/* The trust-bar item that mentions "Premium services for workshops"
   is rebuilt in JS — see updateLandingTexts() which checks
   document.documentElement.classList.contains('in-mobile-app'). */
