/* ============================================================
   app.css — TecnoLalas Taller Pro Layout & View-Specific Styles
   ============================================================ */

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.app-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr;
  height: 100dvh;
  overflow: hidden;
}

.main-area {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
}

.content {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
  background: var(--color-bg);
  min-width: 0;
}

/* ============================================================
   DASHBOARD VIEW
   ============================================================ */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
@media (max-width: 1300px) { .dashboard-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .dashboard-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.dashboard-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
@media (max-width: 900px) { .dashboard-charts-row { grid-template-columns: 1fr; } }

.dashboard-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 900px) { .dashboard-bottom-row { grid-template-columns: 1fr; } }

/* Leaderboard */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank {
  width: 1.5rem;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-faint);
  flex-shrink: 0;
}
.leaderboard-rank.top { color: var(--color-warning); }
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-size: var(--text-sm); font-weight: 600; }
.leaderboard-stats { font-size: var(--text-xs); color: var(--color-text-muted); }
.leaderboard-stars {
  display: flex;
  gap: 1px;
  font-size: 12px;
  color: var(--color-warning);
  flex-shrink: 0;
}

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.activity-icon svg { width: 14px; height: 14px; }
.activity-icon.green { background: var(--color-success-highlight); color: var(--color-success); }
.activity-icon.blue { background: var(--color-primary-highlight); color: var(--color-primary); }
.activity-icon.amber { background: var(--color-warning-highlight); color: var(--color-warning-hover); }
.activity-icon.red { background: var(--color-error-highlight); color: var(--color-error); }
.activity-text { flex: 1; min-width: 0; }
.activity-desc { font-size: var(--text-sm); color: var(--color-text); }
.activity-time { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 2px; }

/* ============================================================
   REPAIR WIZARD
   ============================================================ */
.wizard-container {
  max-width: 720px;
  margin: 0 auto;
}
.wizard-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.wizard-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 600px) { .wizard-form-grid { grid-template-columns: 1fr; } }
.wizard-form-grid .full-width { grid-column: 1 / -1; }

.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-2);
}

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

/* Ticket success modal */
.ticket-success {
  text-align: center;
  padding: var(--space-4) 0;
}
.ticket-number {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  margin: var(--space-4) 0;
  letter-spacing: -0.02em;
}
#qr-output {
  display: flex;
  justify-content: center;
  margin: var(--space-4) 0;
}
#qr-output canvas, #qr-output img { border-radius: var(--radius-md); border: 4px solid var(--color-border); }

/* ============================================================
   REPAIRS LIST VIEW
   ============================================================ */
.view-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.view-toggle-btn {
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-interactive);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: none;
}
.view-toggle-btn:first-child { border-right: 1px solid var(--color-border); }
.view-toggle-btn:hover { background: var(--color-surface-offset); color: var(--color-text); }
.view-toggle-btn.active { background: var(--color-primary); color: white; }
.view-toggle-btn svg { width: 14px; height: 14px; }

/* ============================================================
   REPAIR DETAIL
   ============================================================ */
.repair-detail-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 1024px) { .repair-detail-grid { grid-template-columns: 1fr; } }

.info-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 120px;
  flex-shrink: 0;
}
.info-value {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Parts table */
.parts-table-row td:first-child { font-weight: 500; }
.parts-table-row td:last-child { color: var(--color-text-muted); }

/* Cost summary */
.cost-summary {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}
.cost-row:last-child { border-bottom: none; font-weight: 700; font-size: var(--text-base); }
.cost-row .amount { font-variant-numeric: tabular-nums; }
.cost-total { background: var(--color-surface-offset); }

/* ============================================================
   CUSTOMER DETAIL
   ============================================================ */
.customer-header-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.customer-big-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-size: var(--text-xl);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   INVENTORY
   ============================================================ */
.low-stock-alerts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.stock-alert-card {
  background: var(--color-error-highlight);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}
.stock-alert-name { font-weight: 600; color: var(--color-error-hover); }
.stock-alert-qty  { color: var(--color-error); font-size: var(--text-xs); }

/* ============================================================
   KNOWLEDGE BASE
   ============================================================ */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.knowledge-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive), border-color var(--transition-interactive);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.knowledge-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-primary); }
.knowledge-card-title { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); line-height: 1.4; }
.knowledge-card-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.knowledge-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}
.knowledge-stat { display: flex; align-items: center; gap: var(--space-1); }

/* Knowledge detail */
.knowledge-detail-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
}
.knowledge-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}
.knowledge-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}
.knowledge-body {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.7;
  white-space: pre-wrap;
  max-width: 72ch;
}

/* AI assist box */
.ai-assist-box {
  background: var(--color-primary-muted);
  border: 1px solid var(--color-primary-highlight);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-top: var(--space-4);
}
.ai-assist-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* ============================================================
   REPORTS
   ============================================================ */
.reports-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
@media (max-width: 700px) { .reports-summary-row { grid-template-columns: 1fr; } }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 768px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  position: sticky;
  top: var(--space-4);
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-interactive);
  text-decoration: none;
}
.settings-nav-item:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.settings-nav-item.active { background: var(--color-primary-highlight); color: var(--color-primary); }
.settings-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
}
.settings-section-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
}
.settings-section-title { font-size: var(--text-base); font-weight: 600; }
.settings-section-desc { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }
.settings-section-body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Settings tab panels */
.settings-panels {
  min-width: 0;
}
.settings-tab-panel {
  display: block;
}
.settings-tab-panel.hidden {
  display: none;
}
.settings-nav-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}
.settings-nav-item.active {
  font-weight: 600;
}

/* Logo upload area */
.logo-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  cursor: pointer;
  min-height: 120px;
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
  background: var(--color-surface-raised);
}
.logo-upload-area:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-muted);
}
.logo-preview-img {
  max-height: 80px;
  max-width: 260px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.logo-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}

/* Template row */
.template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-raised);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  gap: var(--space-3);
  transition: border-color var(--transition-interactive);
}
.template-row:hover {
  border-color: var(--color-primary);
}

/* Staff table */
.staff-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.staff-row:last-child { border-bottom: none; }

/* ============================================================
   PUBLIC TRACKING (#track)
   ============================================================ */
.track-layout {
  min-height: 100dvh;
  background: var(--color-bg);
  padding: var(--space-6) var(--space-4);
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.track-header {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}
.track-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}
.track-shop-name { font-size: var(--text-xl); font-weight: 700; color: var(--color-text); }
.track-ticket { font-size: var(--text-3xl); font-weight: 700; color: var(--color-primary); font-variant-numeric: tabular-nums; }
.track-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}
.track-footer {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  padding: var(--space-4) 0;
}

/* Survey */
.survey-form { display: flex; flex-direction: column; gap: var(--space-5); }
.survey-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.survey-label { font-size: var(--text-sm); font-weight: 500; }

/* ============================================================
   PHOTO CAROUSEL (for public tracking)
   ============================================================ */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-surface-offset);
}
.carousel-inner {
  display: flex;
  transition: transform var(--transition-slow);
}
.carousel-slide {
  flex-shrink: 0;
  width: 100%;
}
.carousel-slide img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3);
}
.carousel-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
}
.carousel-btn:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.carousel-dots { display: flex; gap: var(--space-2); }
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background var(--transition-interactive);
  cursor: pointer;
}
.carousel-dot.active { background: var(--color-primary); }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  /* Sidebar off-canvas on mobile */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100dvh;
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: var(--shadow-xl);
  }
  .sidebar.mobile-open { transform: translateX(0); }

  /* Sidebar overlay */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-interactive);
  }
  .sidebar-overlay.active { opacity: 1; pointer-events: all; }

  .app-layout { grid-template-columns: 1fr; }
  .hamburger-btn { display: flex !important; }
  .sidebar-collapse-btn { display: none !important; }
  .top-bar { padding: 0 var(--space-4); }
  .content { padding: var(--space-4); }
  .hidden-mobile { display: none !important; }

  .wizard-card { padding: var(--space-5); }
  .repair-detail-grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
  .hamburger-btn { display: none !important; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  html, body { overflow: visible !important; height: auto !important; }
  .app-layout { display: block; }
  .sidebar, .top-bar, .no-print { display: none !important; }
  .main-area { display: block; }
  .content { padding: 0; overflow: visible; }
  
  #print-receipt {
    display: block;
    padding: 2cm;
    font-family: 'Inter', sans-serif;
  }
  .receipt-shop { font-size: 18pt; font-weight: bold; margin-bottom: 8pt; }
  .receipt-ticket { font-size: 32pt; font-weight: bold; color: #2563EB; }
  .receipt-row { display: flex; justify-content: space-between; border-bottom: 1px solid #ccc; padding: 4pt 0; font-size: 11pt; }
  .receipt-qr { margin: 16pt 0; }
}

/* ============================================================
   BLOQUE A: QUOTES, PAYMENTS & PIN SCREEN
   ============================================================ */

/* Quote status badges */
.badge-red {
  --badge-bg: var(--color-error-highlight, rgba(239,68,68,0.1));
  --badge-dot-bg: var(--color-error, #EF4444);
  --badge-color: var(--color-error-hover, #DC2626);
  background: var(--badge-bg);
  color: var(--badge-color);
}
.badge-purple {
  --badge-bg: rgba(139,92,246,0.1);
  --badge-dot-bg: #8B5CF6;
  --badge-color: #7C3AED;
  background: var(--badge-bg);
  color: var(--badge-color);
}

/* Quote items table editable inputs */
.input-sm {
  height: 2rem;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

/* Payment history rows */
.payment-history-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  margin-bottom: var(--space-2);
  background: var(--color-surface);
}
.payment-method-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.payment-amount { font-weight: 700; font-size: var(--text-base); color: var(--color-text); }
.payment-meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.payment-date { font-size: var(--text-xs); color: var(--color-text-faint); flex-shrink: 0; }

/* ============================================================
   PIN SCREEN
   ============================================================ */
.pin-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.pin-screen-overlay.hidden { display: none; }

.pin-screen-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-8);
  text-align: center;
  color: white;
}

.pin-screen-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  color: white;
}
.pin-screen-brand {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.pin-screen-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: white;
}
.pin-screen-subtitle {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-6);
}

/* User grid */
.pin-users-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-6);
}
.pin-user-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.15s ease;
  color: white;
  min-width: 110px;
  max-width: 130px;
  font-family: inherit;
}
.pin-user-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-2px);
}
.pin-user-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-lg);
  color: white;
}
.pin-user-name {
  font-size: var(--text-sm);
  font-weight: 600;
}
.pin-user-role {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
}

/* PIN entry */
.pin-entry { text-align: center; }
.pin-selected-user { margin-bottom: var(--space-4); text-align: center; }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  transition: all 0.1s;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: transparent;
  display: block;
  transition: all 0.15s ease;
}
.pin-dot.filled {
  background: white;
  border-color: white;
  transform: scale(1.15);
}

.pin-error {
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.4);
  color: #fca5a5;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

@keyframes pinShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.pin-shake { animation: pinShake 0.4s ease; }

/* Number pad */
.pin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  max-width: 260px;
  margin: 0 auto;
}
.pin-key {
  width: 100%;
  aspect-ratio: 1;
  max-height: 72px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: var(--text-xl);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-key:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}
.pin-key:active {
  transform: scale(0.95);
  background: rgba(255,255,255,0.35);
}
.pin-key-back, .pin-key-cancel {
  background: transparent;
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: var(--text-base);
}
.pin-key-back:hover, .pin-key-cancel:hover {
  background: rgba(255,255,255,0.1);
}

@media (max-width: 480px) {
  .pin-screen-card { padding: var(--space-6); }
  .pin-numpad { max-width: 220px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade { animation: fadeIn 0.25s ease; }
.animate-slide-up { animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-stagger > * { animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
.animate-stagger > *:nth-child(1) { animation-delay: 0ms; }
.animate-stagger > *:nth-child(2) { animation-delay: 40ms; }
.animate-stagger > *:nth-child(3) { animation-delay: 80ms; }
.animate-stagger > *:nth-child(4) { animation-delay: 120ms; }
.animate-stagger > *:nth-child(5) { animation-delay: 160ms; }
.animate-stagger > *:nth-child(n+6) { animation-delay: 200ms; }

/* ============================================================
   FEATURE 1: TECHNICIANS PANEL
   ============================================================ */
.tech-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
@media (max-width: 900px) { .tech-cards-grid { grid-template-columns: 1fr; } }

.tech-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive), border-color var(--transition-interactive);
}
.tech-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); }

.tech-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.tech-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
}
.tech-stat { text-align: center; }
.tech-stat-value { font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.tech-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

.tech-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-sm);
}
.tech-metric {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ============================================================
   FEATURE 2: INTAKE WIDGET
   ============================================================ */
.intake-day-row {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  overflow: hidden;
}
.intake-day-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  cursor: pointer;
  transition: background var(--transition-interactive);
}
.intake-day-toggle:hover { background: var(--color-surface-offset); }
.intake-day-devices {
  display: none;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-3) var(--space-3);
}
.intake-day-row.expanded .intake-day-devices { display: flex; }
.intake-day-row.expanded .intake-day-toggle i { transform: rotate(180deg); }

/* ============================================================
   FEATURE 8: ALERTS DROPDOWN
   ============================================================ */
.alerts-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}
.alerts-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.alerts-dropdown-body {
  overflow-y: auto;
  max-height: 340px;
}
.alert-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  cursor: pointer;
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition-interactive);
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--color-surface-offset); }
.alert-item-warning i { color: var(--color-warning); }
.alert-item-error i { color: var(--color-error); }

.notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--color-error);
  color: white;
  border-radius: 50%;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  pointer-events: none;
}

/* ============================================================
   FEATURE 3: VISUAL REFINEMENTS
   ============================================================ */

/* DM Sans for headings */
.page-title, .card-title, .modal-title, .brand-name,
.kpi-card-value, .wizard-step-label,
.section-card-title, .settings-section-title {
  font-family: var(--font-display);
}

/* KPI cards gradient border effect */
.kpi-card {
  border: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
  padding: var(--space-5);
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--color-primary-highlight), var(--color-divider), var(--color-success-highlight));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Softer card radius & shadows */
.card, .section-card, .wizard-card, .kpi-card, .tech-card, .knowledge-card {
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
}

/* Sidebar blur effect */
.sidebar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="light"] .sidebar {
  background: rgba(255,255,255,0.85);
}
[data-theme="dark"] .sidebar {
  background: rgba(22,27,39,0.88);
}

/* Faster fade-in animation */

.animate-fade { animation: fadeIn 0.2s ease; }

/* WhatsApp button style */
.btn-whatsapp {
  background: #25D366 !important;
  color: white !important;
  border-color: #25D366 !important;
}
.btn-whatsapp:hover {
  background: #1EB353 !important;
}

/* Notification bell relative positioning */
#notifications-btn {
  position: relative;
}

@media (max-width: 768px) {
  .alerts-dropdown { width: calc(100vw - 32px); right: -60px; }
}

/* ============================================================
   FEATURE 9: RECEIPT / RECIBO
   ============================================================ */
.receipt {
  font-family: 'Inter', 'Courier New', monospace;
  max-width: 80mm;
  margin: 0 auto;
  padding: var(--space-6);
  color: #000;
  background: #fff;
  font-size: 12px;
  line-height: 1.5;
}
.receipt-header { text-align: center; margin-bottom: 12px; }
.receipt-shop-name { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.receipt-shop-info { font-size: 10px; color: #666; margin-top: 2px; }
.receipt-divider { border-top: 2px dashed #ccc; margin: 10px 0; }
.receipt-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.receipt-meta { margin-bottom: 10px; }
.receipt-meta-row { display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0; border-bottom: 1px dotted #ddd; }
.receipt-meta-row:last-child { border-bottom: none; }
.receipt-section { margin-bottom: 10px; }
.receipt-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #555; border-bottom: 1px solid #000; margin-bottom: 4px; padding-bottom: 2px; }
.receipt-table { width: 100%; font-size: 10px; border-collapse: collapse; }
.receipt-table th { text-align: left; font-weight: 600; border-bottom: 1px solid #000; padding: 3px 4px; font-size: 9px; text-transform: uppercase; }
.receipt-table td { padding: 3px 4px; border-bottom: 1px dotted #ddd; }
.receipt-table td:last-child, .receipt-table th:last-child { text-align: right; }
.receipt-totals { border-top: 2px solid #000; margin-top: 8px; padding-top: 6px; }
.receipt-totals .receipt-meta-row { font-weight: 500; }
.receipt-balance { font-size: 14px; font-weight: 800; border-top: 2px solid #000; margin-top: 4px; padding-top: 4px; }
.receipt-signatures { display: flex; gap: 24px; margin-top: 24px; }
.receipt-sig-block { flex: 1; text-align: center; font-size: 10px; color: #666; }
.receipt-sig-line { border-top: 1px solid #000; margin-bottom: 4px; height: 40px; }
.receipt-qr-area { display: flex; justify-content: center; margin: 12px 0 4px; }
.receipt-qr-area canvas, .receipt-qr-area img { border-radius: 4px; }
.receipt-tracking { text-align: center; font-size: 8px; color: #888; word-break: break-all; }
.receipt-footer { text-align: center; font-size: 8px; color: #aaa; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #ddd; }

/* A4 print receipt adaptation */
@media print {
  .receipt { max-width: 100%; padding: 2cm; font-size: 11pt; }
  .receipt-shop-name { font-size: 18pt; }
  .receipt-title { font-size: 14pt; }
  .receipt-meta-row { font-size: 11pt; }
  .receipt-section-title { font-size: 10pt; }
  .receipt-table { font-size: 10pt; }
  .receipt-table th { font-size: 9pt; }
  .receipt-balance { font-size: 14pt; }
  .receipt-signatures { margin-top: 40pt; }
  .receipt-sig-line { height: 60px; }
}

/* ============================================================
   FEATURE 11: CALENDAR VIEW
   ============================================================ */
.cal-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.cal-table th {
  padding: var(--space-2) var(--space-3);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-border);
}
.cal-table td {
  border: 1px solid var(--color-divider);
  vertical-align: top;
  padding: var(--space-2);
  min-height: 80px;
  height: 80px;
  cursor: pointer;
  transition: background var(--transition-interactive);
}
.cal-table td:hover:not(.cal-empty) { background: var(--color-surface-offset); }
.cal-empty { background: var(--color-surface-offset); opacity: 0.4; cursor: default !important; }
.cal-today { background: var(--color-primary-highlight) !important; }
.cal-today .cal-day-num { color: var(--color-primary); font-weight: 700; }
.cal-has-events { font-weight: 500; }
.cal-day-num {
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.cal-day-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.cal-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0 4px;
}
.cal-dot-intake { background: var(--color-primary-highlight); color: var(--color-primary); }
.cal-dot-delivery { background: var(--color-success-highlight); color: var(--color-success); }

@media (max-width: 768px) {
  .cal-table td { height: 60px; padding: var(--space-1); }
  .cal-day-num { font-size: var(--text-xs); }
}


/* ============================================================
   FEATURE 4: CHECKLIST DIAGNOSTICO VISUAL
   ============================================================ */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
@media (max-width: 900px) { .checklist-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .checklist-grid { grid-template-columns: 1fr; } }

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.checklist-item-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex: 1;
  min-width: 0;
}
.checklist-toggle-group {
  display: flex;
  gap: 2px;
}
.cl-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  color: var(--color-text-muted);
}
.cl-btn:hover { border-color: var(--color-text-muted); }
.cl-ok  { background: #D1FAE5 !important; border-color: #10B981 !important; color: #065F46 !important; font-weight: 700; }
.cl-fail { background: #FEE2E2 !important; border-color: #EF4444 !important; color: #991B1B !important; font-weight: 700; }
.cl-na  { background: #F3F4F6 !important; border-color: #9CA3AF !important; color: #374151 !important; }

/* ============================================================
   FEATURE 5: GARANTIAS
   ============================================================ */
.warranty-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
}
.warranty-active {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}
.warranty-expired {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

/* ============================================================
   FEATURE 6: PUNTO DE VENTA (POS)
   ============================================================ */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-5);
  min-height: 600px;
}
@media (max-width: 1100px) { .pos-layout { grid-template-columns: 1fr 320px; } }
@media (max-width: 800px) { .pos-layout { grid-template-columns: 1fr; } }

.pos-products {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
}
.pos-search-bar { margin-bottom: var(--space-2); }
.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-3);
  overflow-y: auto;
  max-height: 520px;
}
.pos-product-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  cursor: pointer;
  transition: all 0.15s;
}
.pos-product-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
  transform: translateY(-1px);
}
.pos-product-name { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.pos-product-meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.pos-product-price { font-size: var(--text-base); font-weight: 700; color: var(--color-primary); margin-top: var(--space-2); }
.pos-product-stock { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.pos-product-stock.low { color: var(--color-warning-hover); font-weight: 600; }

.pos-cart {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.pos-cart-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  font-weight: 700;
  font-size: var(--text-base);
}
#pos-cart-items { flex: 1; overflow-y: auto; padding: var(--space-2); min-height: 200px; }
.pos-cart-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-8); color: var(--color-text-muted); font-size: var(--text-sm); }
.pos-cart-item { padding: var(--space-3); border-bottom: 1px solid var(--color-divider); }
.pos-cart-item-name { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-2); }
.pos-cart-item-controls { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pos-cart-totals { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--color-divider); background: var(--color-bg); }
.pos-total-row { display: flex; justify-content: space-between; align-items: center; padding: var(--space-1) 0; font-size: var(--text-sm); }
.pos-total-grand { font-size: var(--text-lg); font-weight: 800; border-top: 2px solid var(--color-border); margin-top: var(--space-2); padding-top: var(--space-2); }
.pos-cart-actions { padding: var(--space-4); border-top: 1px solid var(--color-divider); }

/* ============================================================
   FEATURE 9: TV DISPLAY (SALA DE ESPERA)
   ============================================================ */
.display-queue-page {
  min-height: 100vh;
  background: #0f172a;
  color: #f1f5f9;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  flex-direction: column;
  padding: 2rem;
}
.dq-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.dq-logo { font-size: 2.5rem; margin-bottom: 0.5rem; color: #60a5fa; }
.dq-shop-name { font-size: 2.5rem; font-weight: 800; color: #f8fafc; margin-bottom: 0.25rem; }
.dq-tagline { font-size: 1.1rem; color: #94a3b8; }
.dq-time { position: absolute; top: 0; right: 0; font-size: 2rem; font-weight: 700; color: #60a5fa; font-variant-numeric: tabular-nums; }
.dq-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  align-content: start;
  margin-bottom: 2rem;
}
.dq-repair-card {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}
.dq-ticket { font-size: 1.4rem; font-weight: 800; color: #60a5fa; font-variant-numeric: tabular-nums; margin-bottom: 0.5rem; }
.dq-device { font-size: 1rem; font-weight: 600; color: #f1f5f9; margin-bottom: 0.25rem; }
.dq-customer { font-size: 0.9rem; color: #94a3b8; margin-bottom: 0.75rem; }
.dq-status { display: flex; justify-content: center; }
.dq-empty { grid-column: 1/-1; text-align: center; color: #64748b; font-size: 1.25rem; padding: 4rem 0; }
.dq-ticker {
  background: #1e293b;
  border-radius: 12px;
  padding: 1rem 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.dq-ticker strong { color: #f1f5f9; }

/* ============================================================
   COMMISSION SECTION
   ============================================================ */
.commission-earned-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: #D1FAE5;
  color: #065F46;
}

/* ============================================================
   CUSTOMER MAP CARDS
   ============================================================ */
.customer-map-city-card:hover,
.customer-map-neigh-card:hover {
  border-color: var(--color-primary) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Selected customer card in wizard */
.selected-customer-card {
  animation: fadeIn 0.2s ease;
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
}
.tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-bottom: -1px;
}
.tab:hover { color: var(--color-text); }
.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab i { width: 16px; height: 16px; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  margin-bottom: var(--space-3);
}
.breadcrumbs ol {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--text-xs);
}
.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.breadcrumbs a:hover {
  color: var(--color-primary);
}
.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

/* ============================================================
   ENHANCED ALERTS
   ============================================================ */
.alerts-group-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-offset);
}

/* ============================================================
   SEARCH GROUPS
   ============================================================ */
.search-group-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3) var(--space-1);
  border-top: 1px solid var(--color-divider);
}
.search-group-label:first-child {
  border-top: none;
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */

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

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  border: none;
  background: none;
  transition: all var(--transition-interactive);
}
.btn-back:hover {
  color: var(--color-primary);
  background: var(--color-primary-highlight, rgba(37,99,235,0.08));
}

/* ===========================================================================
   Super Admin Panel — Dark Futuristic Glassmorphism Theme (.sa-*)
   =========================================================================== */

.sa-shell {
  min-height: 100vh;
  background: #050a14;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(0,212,255,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0,229,160,0.04) 0%, transparent 50%);
  padding: 24px;
  font-family: inherit;
}

.sa-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 60vh;
}

.sa-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0,212,255,0.15);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Header */
.sa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 16px;
  padding: 20px 28px;
  margin-bottom: 24px;
}

.sa-header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sa-logo {
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px #00d4ff);
}

.sa-header-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sa-header-sub {
  color: #00d4ff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Tool buttons */
.sa-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid rgba(0,212,255,0.25);
  background: rgba(0,212,255,0.08);
  color: #00d4ff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.15s;
}
.sa-tool-btn:hover {
  background: rgba(0,212,255,0.18);
  transform: translateY(-1px);
}
.sa-btn-primary {
  background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(0,229,160,0.12));
  border-color: rgba(0,229,160,0.3);
  color: #00e5a0;
}
.sa-btn-primary:hover {
  background: linear-gradient(135deg, rgba(0,212,255,0.3), rgba(0,229,160,0.2));
}
.sa-btn-danger {
  background: rgba(255,68,102,0.08);
  border-color: rgba(255,68,102,0.25);
  color: #ff6680;
}
.sa-btn-danger:hover {
  background: rgba(255,68,102,0.15);
}

/* KPI Grid */
.sa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.sa-kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.sa-kpi-card:hover {
  border-color: rgba(0,212,255,0.2);
  transform: translateY(-2px);
}

.sa-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sa-kpi-icon svg {
  width: 22px;
  height: 22px;
}

.sa-kpi-value {
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.sa-kpi-label {
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  margin-top: 4px;
}
.sa-kpi-sub {
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  margin-top: 2px;
}

/* Section */
.sa-section {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}

.sa-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sa-section-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
}
.sa-section-sub {
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  margin-top: 2px;
}

/* Table */
.sa-table {
  width: 100%;
  border-collapse: collapse;
}
.sa-table th {
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sa-table td {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sa-shop-row:hover td {
  background: rgba(0,212,255,0.04);
}
.sa-shop-row:last-child td {
  border-bottom: none;
}

/* Kill-Switch Toggle */
.sa-toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.sa-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.sa-toggle-slider {
  display: block;
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  transition: background 0.2s;
  position: relative;
}
.sa-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.sa-toggle input:checked + .sa-toggle-slider {
  background: rgba(0,229,160,0.35);
}
.sa-toggle input:checked + .sa-toggle-slider::after {
  transform: translateX(20px);
  background: #00e5a0;
}

/* Plan select */
.sa-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  outline: none;
}
.sa-select option {
  background: #0d1b2a;
  color: #fff;
}

/* PWA install prompt */
.pwa-install-banner {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: 1000;
  animation: fadeSlideIn 0.3s ease;
}
