/* ═══════════════════════════════════════════════════════════════════════════
   MOTOLINK GARANTÍA+ — Premium Design System
   Inspired by Tesla · BMW Motorrad · Harley-Davidson
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ─── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --red:          #E30613;
  --red-dark:     #B8000D;
  --red-deep:     #8B0000;
  --red-glow:     rgba(227, 6, 19, 0.35);
  --red-mist:     rgba(227, 6, 19, 0.10);
  --red-ultra:    rgba(227, 6, 19, 0.05);

  /* Neutrals */
  --black:        #0A0A0A;
  --surface-0:    #0F0F0F;
  --surface-1:    #161616;
  --surface-2:    #1E1E1E;
  --surface-3:    #252525;
  --surface-4:    #2E2E2E;
  --surface-5:    #383838;
  --border-subtle:#1F1F1F;
  --border:       #2A2A2A;
  --border-bright:#3D3D3D;

  /* Text */
  --text-primary:   #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted:     #606060;
  --text-dim:       #404040;

  /* Accent colours */
  --green:        #16C784;
  --green-mist:   rgba(22, 199, 132, 0.12);
  --amber:        #F59E0B;
  --amber-mist:   rgba(245, 158, 11, 0.12);
  --blue:         #3B82F6;
  --blue-mist:    rgba(59, 130, 246, 0.12);
  --purple:       #8B5CF6;

  /* Layout */
  --sidebar-w:    264px;
  --topbar-h:     60px;
  --bottom-h:     72px;

  /* Radii */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-2xl: 32px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-red:  0 4px 24px rgba(227,6,19,0.4), 0 0 48px rgba(227,6,19,0.15);
  --shadow-card: 0 0 0 1px rgba(255,255,255,0.04), 0 4px 24px rgba(0,0,0,0.6);

  /* Glass */
  --glass-bg:    rgba(255,255,255,0.03);
  --glass-border:rgba(255,255,255,0.07);

  /* Typography */
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display:'Rajdhani', 'Inter', sans-serif;

  /* Transitions */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration:    220ms;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--surface-0);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
ul { list-style: none; }

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-5); }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */
#auth-screen {
  min-height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 75% 40%, rgba(227,6,19,0.22) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 15% 70%, rgba(139,0,0,0.18) 0%, transparent 55%),
    linear-gradient(160deg, #0A0A0A 0%, #110508 50%, #0A0A0A 100%);
}

.auth-bg-moto {
  position: absolute;
  right: -5%;
  bottom: 0;
  width: 62%;
  max-width: 760px;
  opacity: 0.09;
  pointer-events: none;
  filter: blur(0px);
}

.auth-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 70% 50%, black 30%, transparent 100%);
}

.auth-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 3rem;
  width: 460px;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(15,15,15,0.96) 0%, rgba(10,10,10,0.98) 100%);
  border-right: 1px solid var(--border);
}

.auth-logo-wrap {
  margin-bottom: 3rem;
}

.auth-logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-red);
  margin-bottom: 1.25rem;
}

.auth-brand-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1;
}

.auth-brand-name span { color: var(--red); }

.auth-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.auth-subheading {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Auth Tabs */
.auth-tab-row {
  display: flex;
  gap: 0;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 3px;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 0.55rem;
  border-radius: calc(var(--r-sm) - 1px);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--duration) var(--ease);
  letter-spacing: 0.02em;
}

.auth-tab.active {
  background: var(--surface-4);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Form elements */
.field { margin-bottom: 1rem; }

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.field-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.field-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-mist);
}

.field-input::placeholder { color: var(--text-dim); }

select.field-input { appearance: none; cursor: pointer; }
textarea.field-input { resize: vertical; min-height: 90px; line-height: 1.55; }

.btn-red {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  letter-spacing: 0.03em;
  box-shadow: var(--shadow-red);
  transition: all var(--duration) var(--ease);
  margin-top: 0.25rem;
}

.btn-red:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(227,6,19,0.55), 0 0 60px rgba(227,6,19,0.2);
}

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

.auth-foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-foot a {
  color: var(--red);
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--duration) var(--ease);
}

.auth-foot a:hover { opacity: 0.75; }

/* QR pill */
.qr-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.5rem 0.85rem;
  margin-top: 1.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.qr-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════════════════ */
#app { display: none; min-height: 100vh; }
#app.visible { display: flex; }

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border-right: 1px solid var(--border-subtle);
  transition: transform 0.3s var(--ease);
  overflow: hidden;
}

/* Sidebar ambient glow */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: radial-gradient(ellipse 100% 100% at 50% 0%, rgba(227,6,19,0.10) 0%, transparent 100%);
  pointer-events: none;
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  position: relative;
  z-index: 1;
}

.sb-logo-mark {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(227,6,19,0.4);
}

.sb-brand { display: flex; flex-direction: column; line-height: 1; }
.sb-brand strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.sb-brand span {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sb-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0 1rem;
}

.sb-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 0.9rem 1.25rem 0.3rem;
}

.sb-nav { flex: 1; overflow-y: auto; padding: 0.5rem 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  margin: 1px 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.845rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
  letter-spacing: 0.01em;
}

.nav-item .nav-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration) var(--ease);
}

.nav-item svg { opacity: 0.6; transition: opacity var(--duration) var(--ease); }

.nav-item:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}
.nav-item:hover svg { opacity: 1; }
.nav-item:hover .nav-icon { background: var(--surface-3); }

.nav-item.active {
  background: linear-gradient(90deg, var(--red-mist), transparent);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--red);
}

.nav-item.active .nav-icon {
  background: var(--red-mist);
}

.nav-item.active svg { opacity: 1; color: var(--red); }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 0 8px rgba(227,6,19,0.5);
}

.sb-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1rem 1.25rem;
  position: relative;
  z-index: 1;
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.sb-user:hover { background: var(--surface-3); }

.sb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #ff2940);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.1);
}

.sb-user-info .u-name { font-size: 0.8rem; font-weight: 600; }
.sb-user-info .u-role { font-size: 0.68rem; color: var(--text-muted); }

/* ─── Main area ──────────────────────────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(15,15,15,0.85);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
  position: relative;
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--surface-0);
  box-shadow: 0 0 6px var(--red);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px var(--red); }
  50% { box-shadow: 0 0 12px var(--red), 0 0 20px rgba(227,6,19,0.4); }
}

.hamburger { display: none; background: none !important; border: none !important; }

/* ─── Page area ──────────────────────────────────────────────────────────────── */
.page-area {
  flex: 1;
  padding: 1.75rem;
  overflow-y: auto;
  background: var(--surface-0);
}

.page { display: none; animation: fadeUp 0.28s var(--ease) both; }
.page.active { display: block; }

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

/* ─── Bottom nav ─────────────────────────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: rgba(15,15,15,0.95);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
}

.bn-inner {
  display: flex;
  height: 100%;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
}

.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--duration) var(--ease);
  position: relative;
}

.bn-item svg { transition: all var(--duration) var(--ease); }

.bn-item.active { color: var(--red); }

.bn-item.active svg {
  filter: drop-shadow(0 0 4px rgba(227,6,19,0.7));
  transform: translateY(-1px);
}

.bn-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 24px; height: 2px;
  background: var(--red);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 8px var(--red);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENT LIBRARY
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration) var(--ease);
}

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

.card-glass {
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.card-red {
  background: linear-gradient(135deg, #1A0608 0%, #200A0A 50%, #160406 100%);
  border-color: rgba(227,6,19,0.25);
}

.card-red::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 80% 20%, rgba(227,6,19,0.20) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Section headings ───────────────────────────────────────────────────────── */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sec-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sec-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.link-all {
  font-size: 0.78rem;
  color: var(--red);
  font-weight: 500;
  transition: opacity var(--duration) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.link-all:hover { opacity: 0.7; }

/* ─── Status badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.22rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-green   { background: var(--green-mist); color: var(--green); }
.badge-red     { background: var(--red-mist); color: var(--red); }
.badge-amber   { background: var(--amber-mist); color: var(--amber); }
.badge-blue    { background: var(--blue-mist); color: var(--blue); }
.badge-muted   { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: var(--shadow-red);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(227,6,19,0.55);
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-4);
  border-color: var(--border-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); }

.btn-outline-red {
  background: var(--red-ultra);
  color: var(--red);
  border: 1px solid rgba(227,6,19,0.3);
}
.btn-outline-red:hover { background: var(--red-mist); border-color: var(--red); }

.btn-full { width: 100%; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.78rem; }

/* ─── Progress bars ──────────────────────────────────────────────────────────── */
.pbar {
  height: 5px;
  background: var(--surface-4);
  border-radius: 100px;
  overflow: hidden;
}
.pbar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1s var(--ease);
}
.pbar-red   { background: linear-gradient(90deg, var(--red-dark), var(--red)); box-shadow: 0 0 6px rgba(227,6,19,0.5); }
.pbar-green { background: linear-gradient(90deg, #10a573, var(--green)); box-shadow: 0 0 6px rgba(22,199,132,0.4); }
.pbar-amber { background: linear-gradient(90deg, #d97706, var(--amber)); box-shadow: 0 0 6px rgba(245,158,11,0.4); }

/* ─── Circular progress ──────────────────────────────────────────────────────── */
.circ-gauge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.circ-gauge svg { transform: rotate(-90deg); }
.circ-gauge .gauge-track { fill: none; stroke: var(--surface-4); }
.circ-gauge .gauge-fill  { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }

.circ-gauge .gauge-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ─── Quick action grid ──────────────────────────────────────────────────────── */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.qa-btn {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 1.1rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.qa-btn:hover {
  border-color: rgba(227,6,19,0.35);
  background: var(--red-ultra);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.qa-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  background: var(--red-mist);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  transition: all var(--duration) var(--ease);
}

.qa-btn:hover .qa-icon {
  background: rgba(227,6,19,0.2);
  box-shadow: 0 0 12px rgba(227,6,19,0.25);
}

.qa-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  transition: color var(--duration) var(--ease);
}

.qa-btn:hover .qa-label { color: var(--text-primary); }

/* ─── Solicitud items ────────────────────────────────────────────────────────── */
.sol-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  margin-bottom: 0.5rem;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.sol-item:hover {
  border-color: var(--border);
  background: var(--surface-2);
  transform: translateX(2px);
}

.sol-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.sol-body { flex: 1; min-width: 0; }
.sol-id   { font-size: 0.68rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.04em; }
.sol-desc { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 1px 0; }
.sol-meta { font-size: 0.72rem; color: var(--text-secondary); }

/* ─── Moto hero card ─────────────────────────────────────────────────────────── */
.moto-card {
  background:
    radial-gradient(ellipse 60% 80% at 90% 50%, rgba(227,6,19,0.12) 0%, transparent 70%),
    linear-gradient(135deg, #130608 0%, #1A0A0C 40%, #120406 100%);
  border: 1px solid rgba(227,6,19,0.18);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03), var(--shadow-lg);
}

.moto-card-grid {
  display: grid;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 28px 28px;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.moto-card-content { position: relative; z-index: 1; }

.moto-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.moto-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--red-mist);
  border: 1px solid rgba(227,6,19,0.25);
  border-radius: 100px;
  padding: 0.2rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.moto-model {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.moto-year { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.25rem; }

.moto-svg-wrap {
  flex-shrink: 0;
  width: 120px;
}

.moto-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  margin-top: 1rem;
}

.moto-stat {
  padding: 0.85rem;
  background: rgba(0,0,0,0.3);
  text-align: center;
}

.moto-stat .ms-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.moto-stat .ms-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}

/* ─── KPI cards ──────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.1rem 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration) var(--ease);
}

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

.kpi-card .kc-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.kpi-card .kc-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}

.kpi-card .kc-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.kpi-card .kc-bar { margin-top: 0.75rem; }

.kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.kpi-card.kpi-green::after { background: var(--green); box-shadow: 0 0 8px var(--green); }
.kpi-card.kpi-amber::after { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.kpi-card.kpi-red::after   { background: var(--red); box-shadow: 0 0 8px var(--red); }
.kpi-card.kpi-blue::after  { background: var(--blue); box-shadow: 0 0 8px var(--blue); }

/* ─── Garantía hero ──────────────────────────────────────────────────────────── */
.gar-hero {
  border-radius: var(--r-xl);
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--red-dark) 0%, #8B0000 100%);
  box-shadow: var(--shadow-red);
}

.gar-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.gar-hero::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}

.gar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.gar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.gar-days {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.gar-days-unit { font-size: 1.2rem; font-weight: 500; opacity: 0.7; margin-left: 4px; }

.gar-dates {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 0.4rem;
}

.gar-shield-icon {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.gar-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gar-coverage {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.tab-row {
  display: flex;
  gap: 1px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-row::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 0.48rem 1.1rem;
  border-radius: calc(var(--r-sm) - 2px);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.tab.active {
  background: var(--surface-4);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ─── Timeline ───────────────────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 1.5rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--red) 0%, var(--border) 60%, transparent 100%);
}

.tl-item { position: relative; margin-bottom: 1.5rem; }

.tl-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 5px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--surface-0);
  border: 2px solid var(--border);
  transition: all var(--duration) var(--ease);
}

.tl-item.done::before {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

.tl-date { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.3rem; letter-spacing: 0.03em; }
.tl-title { font-size: 0.9rem; font-weight: 600; }
.tl-desc  { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.2rem; line-height: 1.5; }

/* ─── Notif items ────────────────────────────────────────────────────────────── */
.notif-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  margin-bottom: 0.5rem;
  transition: all var(--duration) var(--ease);
}

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

.notif-item.unread {
  border-color: rgba(227,6,19,0.2);
  background: rgba(227,6,19,0.03);
}

.notif-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.ni-green  { background: var(--green-mist); }
.ni-amber  { background: var(--amber-mist); }
.ni-red    { background: var(--red-mist); }
.ni-blue   { background: var(--blue-mist); }

.notif-title { font-size: 0.84rem; font-weight: 600; }
.notif-body  { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.15rem; line-height: 1.45; }
.notif-date  { font-size: 0.68rem; color: var(--text-dim); margin-top: 0.3rem; }

/* ─── Stars / Ratings ────────────────────────────────────────────────────────── */
.stars { color: #FBBF24; letter-spacing: 1px; }

.opinion-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.1rem 0.9rem;
  margin-bottom: 0.6rem;
  transition: border-color var(--duration) var(--ease);
}
.opinion-card:hover { border-color: var(--border); }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-block {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}

.form-block-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  background: var(--surface-2);
}

.upload-zone:hover {
  border-color: var(--red);
  background: var(--red-ultra);
}

.upload-zone .upload-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.upload-zone p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* ─── Category grid ──────────────────────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.cat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.9rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-align: center;
}

.cat-card:hover, .cat-card.active {
  border-color: var(--red);
  background: var(--red-ultra);
}

.cat-card .cat-emoji { font-size: 1.4rem; }
.cat-card span { font-size: 0.72rem; font-weight: 500; color: var(--text-secondary); }
.cat-card:hover span, .cat-card.active span { color: var(--text-primary); }

/* ─── Map placeholder ────────────────────────────────────────────────────────── */
.map-box {
  height: 240px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

.map-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 36px 36px;
}

.map-roads {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.map-pin-wrap {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

/* ─── Info rows ──────────────────────────────────────────────────────────────── */
.info-table { display: flex; flex-direction: column; }

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row:first-child { padding-top: 0; }

.ir-key {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.ir-val {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
}

/* ─── Toggle switch ──────────────────────────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.toggle-wrap:last-child { border-bottom: none; }

.toggle {
  position: relative;
  width: 40px; height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-4);
  border-radius: 22px;
  transition: background var(--duration) var(--ease);
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--duration) var(--ease-spring);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.toggle input:checked + .toggle-slider { background: var(--red); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
}

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

.modal-handle {
  width: 36px; height: 3px;
  background: var(--surface-5);
  border-radius: 2px;
  margin: 0 auto 1.25rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

/* ─── Toast ──────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface-3);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  padding: 0.65rem 1.25rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.28s var(--ease);
  z-index: 900;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Bar chart ──────────────────────────────────────────────────────────────── */
.bar-chart { display: flex; flex-direction: column; gap: 0.7rem; }
.bar-row { display: flex; align-items: center; gap: 0.75rem; }
.bar-name { font-size: 0.78rem; color: var(--text-secondary); width: 130px; flex-shrink: 0; }
.bar-track { flex: 1; height: 6px; background: var(--surface-4); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--red-dark), var(--red)); }
.bar-count { font-size: 0.75rem; font-weight: 600; width: 28px; text-align: right; }

/* ─── Service item ───────────────────────────────────────────────────────────── */
.service-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  margin-bottom: 0.5rem;
  transition: all var(--duration) var(--ease);
}
.service-item:hover { border-color: var(--border); background: var(--surface-2); }

.service-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* ─── Technician card ────────────────────────────────────────────────────────── */
.tech-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  margin-bottom: 0.5rem;
}

.tech-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #ff2940);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(227,6,19,0.3);
}

/* ─── Alert / reminder banner ────────────────────────────────────────────────── */
.reminder-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(245,158,11,0.04));
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* ─── Perfil header ──────────────────────────────────────────────────────────── */
.profile-hero {
  background:
    radial-gradient(ellipse 60% 80% at 10% 50%, rgba(227,6,19,0.1) 0%, transparent 65%),
    var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #ff2940);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  border: 3px solid rgba(227,6,19,0.3);
  box-shadow: 0 0 24px rgba(227,6,19,0.25);
  flex-shrink: 0;
}

/* ─── Sidebar overlay (mobile) ───────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

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

/* ─── Moto SVG ───────────────────────────────────────────────────────────────── */
.moto-illustration {
  width: 100%;
  filter: drop-shadow(0 4px 16px rgba(227,6,19,0.3));
}

/* ─── Logo SVG ───────────────────────────────────────────────────────────────── */
.logo-svg { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Gauge ring fill */
@keyframes gaugeIn {
  from { stroke-dashoffset: var(--circ, 200); }
  to   { stroke-dashoffset: var(--target, 50); }
}

/* Pulsing glow ring */
@keyframes pulseRing {
  0%, 100% { opacity: 0.55; transform: scale(1);   }
  50%       { opacity: 0.15; transform: scale(1.08); }
}

/* Counter number pop-in */
@keyframes countPop {
  0%   { transform: scale(0.75); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

/* Subtle float for the moto card icon */
@keyframes floatY {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-5px); }
}

/* Progress bar slide in */
@keyframes slideIn {
  from { width: 0 !important; }
}

/* Ripple on KPI hover */
@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Blink dot */
@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* Slide up stagger for items */
@keyframes staggerUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Number digit flip */
@keyframes digitFlip {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Glow pulse on red stroke */
@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(227,6,19,0.5));  }
  50%       { filter: drop-shadow(0 0 14px rgba(227,6,19,0.9)); }
}

/* Scan line animation for moto card */
@keyframes scanLine {
  0%   { top: -2px; opacity: 0.6; }
  100% { top: 100%; opacity: 0;   }
}

/* ─── Animation utility classes ──────────────────────────────────────────────── */
.anim-float   { animation: floatY 4s ease-in-out infinite; }
.anim-glow    { animation: glowPulse 2.5s ease-in-out infinite; }
.anim-blink   { animation: blinkDot 1.8s ease-in-out infinite; }
.anim-pop     { animation: countPop 0.5s var(--ease-spring) both; }

.gauge-fill-anim {
  animation: gaugeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.3s;
}

.pbar-fill-anim {
  animation: slideIn 1s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.4s;
}

.stagger-item { animation: staggerUp 0.35s var(--ease) both; }
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.10s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.20s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }

/* KPI card ripple */
.kpi-card {
  cursor: pointer;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--rx,50%) var(--ry,50%), rgba(255,255,255,0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

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

/* Scan line on moto card */
.moto-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227,6,19,0.4), transparent);
  animation: scanLine 3.5s ease-in-out infinite;
  pointer-events: none;
}

/* Live indicator dot */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: blinkDot 1.8s ease-in-out infinite;
  box-shadow: 0 0 6px var(--green);
}

/* Digit ticker */
.digit-ticker {
  display: inline-block;
  animation: digitFlip 0.4s var(--ease-spring) both;
}

/* Circular gauge pulse ring */
.gauge-pulse-ring {
  fill: none;
  animation: pulseRing 2s ease-in-out infinite;
  transform-origin: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .auth-panel { width: 100%; border-right: none; }
  .auth-bg-moto { display: none; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,0.7); }
  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.open { pointer-events: all; }
  .main-wrap { margin-left: 0; }
  .hamburger { display: flex !important; }
  .bottom-nav { display: flex; }
  .page-area { padding: 1rem; padding-bottom: calc(var(--bottom-h) + 1rem); }
  .moto-stats-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .qa-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
  .modal { align-self: center; border-radius: var(--r-xl); margin: 1rem; max-width: 480px; }
  .modal-overlay { align-items: center; }
}

@media (max-width: 480px) {
  .qa-grid { grid-template-columns: repeat(3, 1fr); }
  .moto-model { font-size: 1.6rem; }
  .auth-panel { padding: 1.5rem; }
}
