/* ==========================================================================
   Clínica Dental El Dienton — Responsive Web App & PWA Design System
   Mobile-First -> Tablet -> Desktop Sidebar Shell
   ========================================================================== */

:root {
  --blue-900: #08397A;
  --blue-800: #0B4DA2;
  --blue-700: #125FC2;
  --blue-600: #1976D2;
  --blue-500: #2196F3;
  --cyan-400: #38BDF8;

  --violet-700: #5B21B6;
  --violet-600: #6D4AFF;
  --violet-500: #7C3AED;
  --violet-100: #EDE9FE;

  --green-600: #16A34A;
  --green-500: #10B981;
  --green-100: #DCFCE7;

  --amber-600: #D97706;
  --amber-100: #FEF3C7;

  --red-600: #DC2626;
  --red-100: #FEE2E2;

  --bg: #F3F6FB;
  --surface: #FFFFFF;
  --surface-soft: #F8FAFC;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 10px rgba(11, 77, 162, 0.06);
  --shadow-md: 0 8px 26px rgba(11, 77, 162, 0.10);
  --shadow-lg: 0 18px 46px rgba(11, 77, 162, 0.18);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --sidebar-w: 266px;
  --topbar-h: 64px;
  --bottomnav-h: 68px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.muted-sm {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ---- OFFLINE BANNER ---- */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1E293B;
  color: #F8FAFC;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
}
.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F59E0B;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 18px;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-lg { padding: 13px 22px; font-size: 0.98rem; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: 0.84rem; border-radius: 10px; }
.btn-xs { padding: 6px 10px; font-size: 0.78rem; border-radius: 8px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: #fff;
  box-shadow: 0 6px 16px rgba(11, 77, 162, 0.25);
}
.btn-primary:hover { filter: brightness(1.06); }

.btn-violet {
  background: linear-gradient(135deg, var(--violet-600), var(--violet-500));
  color: #fff;
  box-shadow: 0 6px 18px rgba(109, 74, 255, 0.28);
}
.btn-violet:hover { filter: brightness(1.06); }

.btn-green {
  background: linear-gradient(135deg, #16A34A, #10B981);
  color: #fff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.26);
}
.btn-green:hover { filter: brightness(1.05); }

.btn-soft-primary {
  background: #E8F1FD;
  color: var(--blue-800);
}
.btn-soft-primary:hover { background: #D7E7FC; }

.btn-soft-violet {
  background: var(--violet-100);
  color: var(--violet-700);
}
.btn-soft-violet:hover { background: #DDD6FE; }

.btn-white {
  background: #fff;
  color: var(--blue-800);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.btn-white-glass {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}
.btn-white-glass:hover { background: rgba(255, 255, 255, 0.26); }

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

.link-btn {
  background: none;
  border: none;
  color: var(--blue-700);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 4px 2px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger, .danger-text { color: var(--red-600) !important; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-soft); }
.icon-btn.danger-ghost { border: none; background: transparent; color: var(--text-muted); }
.icon-btn.danger-ghost:hover { color: var(--red-600); background: var(--red-100); }

/* ---- FORM CONTROLS ---- */
.form-group { margin-bottom: 13px; }
.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  border: 1.5px solid #DCE4F0;
  background: #FBFDFF;
  color: var(--text);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.form-input:focus {
  border-color: var(--blue-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.14);
}
textarea.form-input { resize: vertical; min-height: 76px; }
.compact-select { width: auto; min-width: 185px; padding: 8px 12px; font-size: 0.86rem; }

.input-with-icon, .search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-icon {
  position: absolute;
  left: 12px;
  color: #64748B;
  pointer-events: none;
  display: flex;
}
.input-icon svg { width: 18px; height: 18px; }
.input-with-icon .form-input,
.search-input-wrap .form-input {
  padding-left: 40px;
}
.input-right-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #64748B;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.input-right-btn svg { width: 18px; height: 18px; }
.input-right-btn:hover { background: #F1F5F9; color: var(--text); }

.form-grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 560px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr 1.3fr; }
}

.form-error-box {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 10px 0 14px;
}
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--violet-600); }

/* ==========================================================================
   AUTH PAGE (LOGIN & REGISTRO) — Responsive Mobile Wave -> Desktop Split
   ========================================================================== */
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.auth-hero {
  position: relative;
  background: linear-gradient(155deg, var(--blue-900) 0%, var(--blue-700) 58%, #29B6F6 100%);
  color: #fff;
  padding: 34px 22px 62px;
  text-align: center;
  overflow: hidden;
}
.auth-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 460px;
  margin: 0 auto;
}
.auth-logo-wrap {
  width: 82px;
  height: 82px;
  margin: 0 auto 12px;
  filter: drop-shadow(0 12px 24px rgba(5, 25, 65, 0.3));
}
.auth-logo-wrap .brand-logo-img { width: 100%; height: 100%; border-radius: 22px; }
.auth-clinic-eyebrow {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.92;
  letter-spacing: 0.03em;
}
.auth-brand-title {
  margin: 2px 0 6px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.auth-brand-sub {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.9;
}
.auth-hero-features {
  display: none;
  margin: 26px 0;
  text-align: left;
  gap: 12px;
}
.ah-feat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.ah-feat span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #38BDF8;
  color: #06285A;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.auth-pwa-btn { margin-top: 16px; }
.auth-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 44px;
}

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 16px 36px;
  margin-top: -28px;
  position: relative;
  z-index: 3;
}
.auth-card {
  width: 100%;
  max-width: 470px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #EEF3FA;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-mode-btn {
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.18s;
}
.auth-mode-btn.active {
  background: var(--surface);
  color: var(--blue-800);
  box-shadow: 0 3px 10px rgba(11, 77, 162, 0.12);
}

.role-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.role-btn {
  border: 1.5px solid #DCE4F0;
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px 12px;
  border-radius: 12px;
  transition: all 0.16s;
}
.role-btn.active {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(11, 77, 162, 0.22);
}

.welcome-bonus-pill {
  background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
  border: 1px solid #DDD6FE;
  color: #4C1D95;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.81rem;
  margin-bottom: 14px;
  line-height: 1.4;
}

.auth-links-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.auth-links-row.center { justify-content: center; }

.demo-divider {
  position: relative;
  text-align: center;
  margin: 18px 0 12px;
}
.demo-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.demo-divider span {
  position: relative;
  background: var(--surface);
  padding: 0 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.demo-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Desktop Split-Screen Auth */
@media (min-width: 960px) {
  .auth-page {
    flex-direction: row;
    align-items: stretch;
  }
  .auth-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    text-align: left;
  }
  .auth-logo-wrap { margin: 0 0 18px; width: 90px; height: 90px; }
  .auth-brand-title { font-size: 2.75rem; }
  .auth-hero-features { display: flex; flex-direction: column; }
  .auth-wave { display: none; }
  .auth-form-panel {
    flex: 1;
    align-items: center;
    margin-top: 0;
    padding: 40px;
  }
  .auth-card { padding: 30px; }
}

/* ==========================================================================
   MAIN RESPONSIVE APP SHELL (Mobile Bottom Nav + Desktop Left Sidebar)
   ========================================================================== */
.app-shell {
  min-height: 100dvh;
  display: flex;
  background: var(--bg);
}

.desktop-sidebar {
  display: none;
}

.app-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottomnav-h) + 16px);
}

/* Topbar (Deep Blue Mobile Header like Mockup -> Clean Elevated Desktop Bar) */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 400;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: #fff;
  box-shadow: 0 4px 18px rgba(8, 57, 122, 0.2);
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mini-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  overflow: hidden;
  flex-shrink: 0;
}
.mini-logo .brand-logo-img { width: 100%; height: 100%; }
.mobile-brand-mini strong { display: block; font-size: 1rem; line-height: 1.1; }
.mobile-brand-mini small { display: block; font-size: 0.74rem; opacity: 0.85; }

.topbar-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}
.desktop-only { display: none; }

.topbar-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s;
}
.topbar-icon-btn:hover { background: rgba(255, 255, 255, 0.24); }
.topbar-icon-btn svg { width: 20px; height: 20px; }

.icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #EF4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--blue-800);
}

.topbar-pwa-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
}
.topbar-pwa-pill svg { width: 15px; height: 15px; }
.topbar-pwa-pill span { display: none; }
@media (min-width: 480px) {
  .topbar-pwa-pill span { display: inline; }
}

/* PWA Dismissible Install Banner */
.pwa-install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, #EFF6FF, #F5F3FF);
  border-bottom: 1px solid #DBEAFE;
  padding: 10px 16px;
}
.pwa-banner-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pwa-banner-icon { width: 34px; height: 34px; flex-shrink: 0; }
.pwa-banner-icon .brand-logo-img { width: 100%; height: 100%; border-radius: 9px; }
.pwa-banner-left strong { display: block; font-size: 0.85rem; color: var(--blue-900); }
.pwa-banner-left span { display: block; font-size: 0.76rem; color: var(--text-muted); }
.pwa-banner-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* App Content Container */
.app-content {
  flex: 1;
  width: 100%;
  padding: 18px 14px 24px;
}
.view-container {
  max-width: 1180px;
  margin: 0 auto;
}
.view-container.narrow { max-width: 680px; }
.view-container.narrow-lg { max-width: 920px; }

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 450;
  height: var(--bottomnav-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px env(safe-area-inset-bottom, 6px);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}
.bnav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 12px;
  transition: color 0.16s, background 0.16s;
}
.bnav-icon { position: relative; display: flex; }
.bnav-icon svg { width: 22px; height: 22px; }
.bnav-item.active {
  color: var(--blue-800);
}
.bnav-item.active .bnav-icon {
  color: var(--violet-600);
}
.bnav-badge {
  position: absolute;
  top: -5px;
  right: -9px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--violet-600);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop Sidebar Breakpoint (>= 1024px) */
@media (min-width: 1024px) {
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, #093C82 0%, #0E4DA4 55%, #135CC0 100%);
    color: #fff;
    padding: 14px 12px;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(8, 57, 122, 0.14);
  }
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 2px 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    margin-bottom: 10px;
  }
  .sidebar-logo { width: 40px; height: 40px; flex-shrink: 0; }
  .sidebar-logo .brand-logo-img { width: 100%; height: 100%; border-radius: 11px; }
  .sidebar-brand strong { display: block; font-size: 1.08rem; font-weight: 800; }
  .sidebar-role-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.16);
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 2px;
  }
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
  }
  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 11px;
    border-radius: 10px;
    text-align: left;
    transition: background 0.16s, color 0.16s;
  }
  .sidebar-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
  .sidebar-link.active {
    background: #fff;
    color: var(--blue-800);
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(5, 25, 65, 0.22);
  }
  .sidebar-link.danger { color: #FCA5A5; }
  .sidebar-link.danger:hover { background: rgba(239, 68, 68, 0.18); color: #fff; }
  .sl-icon svg { width: 19px; height: 19px; }
  .nav-pill-badge {
    margin-left: auto;
    background: var(--violet-600);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
  }
  .sidebar-footer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .pwa-sidebar-card {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 14px;
    padding: 11px;
    text-align: left;
    margin-bottom: 6px;
    transition: background 0.16s;
  }
  .pwa-sidebar-card:hover { background: rgba(255, 255, 255, 0.22); }
  .pwa-sc-top { display: flex; align-items: center; gap: 10px; }
  .pwa-sc-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #38BDF8;
    color: #08397A;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .pwa-sc-icon svg { width: 18px; height: 18px; }
  .pwa-sc-top strong { display: block; font-size: 0.84rem; }
  .pwa-sc-top small { display: block; font-size: 0.72rem; opacity: 0.85; }
  .pwa-installed-badge {
    background: rgba(16, 185, 129, 0.22);
    color: #A7F3D0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
  }

  .app-main-col { padding-bottom: 0; }
  .mobile-bottom-nav, .mobile-only, .mobile-brand-mini { display: none !important; }
  .desktop-only { display: inline-flex; }

  .app-topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    padding: 0 28px;
  }
  .topbar-title { font-size: 1.2rem; color: var(--text); }
  .topbar-icon-btn {
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
  }
  .topbar-icon-btn:hover { background: #E8F1FD; color: var(--blue-800); }
  .icon-badge { border-color: #fff; }
  .topbar-pwa-pill {
    background: #E8F1FD;
    color: var(--blue-800);
    border-color: #BFDBFE;
  }
  .topbar-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--text);
  }
  .user-dot-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-800), var(--violet-600));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
  }
  .app-content { padding: 26px 28px 40px; }
}

/* ==========================================================================
   COMMON CARDS, BADGES, HEADINGS & TOOLBARS
   ========================================================================== */
.panel-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.panel-title { margin: 0 0 12px; font-size: 1.05rem; font-weight: 800; }
.panel-header-row, .section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-title { margin: 0; font-size: 1.12rem; font-weight: 800; }
.sub-heading { margin: 0 0 10px; font-size: 0.94rem; font-weight: 800; color: #334155; }

.welcome-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.greeting-title { margin: 0; font-size: 1.48rem; font-weight: 800; letter-spacing: -0.02em; }
.greeting-sub { margin: 3px 0 0; color: var(--text-muted); font-size: 0.92rem; }
.welcome-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill.ok { background: var(--green-100); color: #15803D; }
.status-pill.info { background: #E0F2FE; color: #0369A1; }
.status-pill.warn { background: var(--amber-100); color: #B45309; }
.status-pill.danger { background: var(--red-100); color: #B91C1C; }

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.toolbar-row .search-input-wrap { flex: 1; min-width: 220px; }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  transition: all 0.16s;
}
.pill-btn.active {
  background: var(--blue-800);
  color: #fff;
  border-color: transparent;
}

.segmented-2, .segmented-3 {
  display: grid;
  background: #E7EEF8;
  padding: 4px;
  border-radius: 13px;
  gap: 4px;
}
.segmented-2 { grid-template-columns: 1fr 1fr; }
.segmented-3 { grid-template-columns: repeat(3, 1fr); }
.card-seg { margin-bottom: 16px; }
.seg-btn {
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.seg-btn.active {
  background: var(--blue-800);
  color: #fff;
  box-shadow: 0 3px 10px rgba(11, 77, 162, 0.2);
}

.stack-list { display: flex; flex-direction: column; gap: 10px; }

.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.96rem;
  flex-shrink: 0;
}
.avatar-circle.sm { width: 38px; height: 38px; font-size: 0.84rem; }
.avatar-circle.lg { width: 56px; height: 56px; font-size: 1.15rem; }
.avatar-circle.xl { width: 78px; height: 78px; font-size: 1.6rem; margin: 0 auto 10px; }

/* ==========================================================================
   PATIENT HOME & QUICK TILES
   ========================================================================== */
.patient-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (min-width: 860px) {
  .patient-hero-grid { grid-template-columns: 1.05fr 1.2fr; align-items: stretch; }
}

.next-apt-card {
  background: linear-gradient(135deg, #6D4AFF 0%, #8B5CF6 60%, #7C3AED 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 14px 32px rgba(109, 74, 255, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.next-apt-top { display: flex; justify-content: space-between; gap: 12px; }
.next-apt-eyebrow { font-size: 0.84rem; font-weight: 600; opacity: 0.9; }
.next-apt-card h3 { margin: 4px 0 2px; font-size: 1.35rem; font-weight: 800; }
.next-apt-time { margin: 0 0 8px; font-size: 0.95rem; opacity: 0.92; }
.next-apt-service { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.next-apt-badge {
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 9px;
  border-radius: 999px;
}
.next-apt-cal-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.next-apt-cal-icon svg { width: 28px; height: 28px; }
.next-apt-footer { display: flex; gap: 8px; flex-wrap: wrap; }

.quick-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.quick-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.quick-tile:hover {
  transform: translateY(-2px);
  border-color: #BFDBFE;
  box-shadow: var(--shadow-md);
}
.quick-tile strong { font-size: 0.82rem; color: var(--text); text-align: center; }

.qt-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qt-icon svg { width: 22px; height: 22px; }
.qt-icon.blue { background: #DBEAFE; color: #1D4ED8; }
.qt-icon.cyan { background: #E0F2FE; color: #0284C7; }
.qt-icon.teal { background: #CCFBF1; color: #0F766E; }
.qt-icon.amber { background: #FEF3C7; color: #B45309; }
.qt-icon.indigo { background: #E0E7FF; color: #4338CA; }
.qt-icon.purple { background: #EDE9FE; color: #6D28D9; }
.qt-icon.pink { background: #FCE7F3; color: #BE185D; }
.qt-icon.green { background: #DCFCE7; color: #15803D; }
.qt-icon.slate { background: #E2E8F0; color: #334155; }

/* ==========================================================================
   SHOP / TREATMENTS CATALOG & SIMULATED CHECKOUT
   ========================================================================== */
.shop-promo-banner {
  background: linear-gradient(135deg, #0B4DA2 0%, #3B49DF 58%, #7C3AED 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-md);
}
@media (min-width: 768px) {
  .shop-promo-banner { flex-direction: row; align-items: center; justify-content: space-between; padding: 24px; }
}
.promo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}
.promo-pill svg { width: 14px; height: 14px; }
.shop-promo-text h2 { margin: 8px 0 6px; font-size: 1.32rem; font-weight: 800; }
.shop-promo-text p { margin: 0 0 12px; font-size: 0.88rem; opacity: 0.92; max-width: 580px; }
.coupon-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.coupon-chip {
  border: 1px dashed rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 10px;
}
.coupon-chip:hover { background: rgba(255, 255, 255, 0.28); }
.shop-mini-cart-card {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 14px;
  min-width: 220px;
}
.mini-cart-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1120px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .catalog-grid.compact-4 { grid-template-columns: repeat(4, 1fr); } }

.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s, box-shadow 0.16s;
}
.catalog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.catalog-card-top { display: flex; gap: 12px; align-items: flex-start; }
.catalog-thumb { width: 64px; height: 64px; flex-shrink: 0; }
.catalog-thumb svg { width: 100%; height: 100%; }
.catalog-meta { min-width: 0; flex: 1; }
.catalog-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.cat-type-tag {
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
}
.cat-type-tag.tratamiento { background: #E0F2FE; color: #0369A1; }
.cat-type-tag.promocion { background: #FCE7F3; color: #BE185D; }
.cat-type-tag.producto { background: #DCFCE7; color: #15803D; }
.cat-highlight-badge {
  font-size: 0.69rem;
  font-weight: 800;
  background: var(--violet-100);
  color: var(--violet-700);
  padding: 2px 7px;
  border-radius: 6px;
}
.catalog-meta h3 { margin: 2px 0 4px; font-size: 0.98rem; font-weight: 800; line-height: 1.25; }
.catalog-meta p { margin: 0; font-size: 0.81rem; color: var(--text-muted); line-height: 1.4; }

.catalog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.price-row { display: flex; align-items: baseline; gap: 6px; }
.price-main { font-size: 1.15rem; font-weight: 800; color: var(--blue-800); }
.price-old { font-size: 0.82rem; color: #94A3B8; text-decoration: line-through; }
.price-sub { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.price-sub svg { width: 13px; height: 13px; }
.catalog-actions { display: flex; gap: 6px; }

/* ---- CART DRAWER ---- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-backdrop.open { opacity: 1; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 610;
  width: min(100vw, 430px);
  background: var(--surface);
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}
.cart-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.drawer-header h3 svg { width: 20px; height: 20px; color: var(--violet-600); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.drawer-footer { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface); }

.cart-items-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cart-item-row {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}
.cart-item-thumb { width: 48px; height: 48px; flex-shrink: 0; }
.cart-item-thumb svg { width: 100%; height: 100%; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info strong { display: block; font-size: 0.88rem; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 4px;
}
.qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: #F1F5F9;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.qty-btn svg { width: 13px; height: 13px; }
.qty-controls span { font-size: 0.84rem; font-weight: 800; min-width: 18px; text-align: center; }

.cart-section { margin-bottom: 14px; }
.coupon-form { display: flex; gap: 8px; }
.coupon-hints { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mini-tag-btn {
  border: 1px dashed #93C5FD;
  background: #EFF6FF;
  color: var(--blue-800);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}
.applied-coupon-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--green-100);
  color: #166534;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 0.84rem;
}

.cart-totals-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
}
.tot-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 6px;
}
.tot-row.discount { color: var(--green-600); font-weight: 700; }
.tot-row.grand {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #CBD5E1;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--blue-900);
  margin-bottom: 0;
}

/* ==========================================================================
   3-STEP BOOKING WIZARD
   ========================================================================== */
.stepper-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stepper { display: flex; align-items: center; justify-content: space-between; }
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.step-item.active { color: var(--blue-800); }
.step-item.active .step-circle { background: var(--blue-700); color: #fff; }
.step-item.done .step-circle { background: var(--green-500); color: #fff; }
.step-line { flex: 1; height: 3px; background: #E2E8F0; margin: 0 8px 18px; border-radius: 4px; }
.step-line.active { background: var(--blue-600); }

.service-select-list { display: flex; flex-direction: column; gap: 10px; }
.service-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--surface-soft);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 12px;
  transition: all 0.16s;
}
.service-option:hover { border-color: #BFDBFE; background: #fff; }
.service-option.selected {
  border-color: var(--violet-600);
  background: #F5F3FF;
}
.service-opt-icon { width: 52px; height: 52px; flex-shrink: 0; }
.service-opt-info { flex: 1; min-width: 0; }
.service-opt-info strong { display: block; font-size: 0.94rem; }
.service-opt-info span { display: block; font-size: 0.8rem; color: var(--text-muted); }
.service-opt-info small { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--blue-700); margin-top: 3px; }
.service-opt-info small svg { width: 12px; height: 12px; }
.service-opt-price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #94A3B8;
}
.service-option.selected .radio-dot {
  border-color: var(--violet-600);
  background: radial-gradient(circle, var(--violet-600) 45%, transparent 48%);
}

.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-header h3 { margin: 0; font-size: 1rem; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-weekdays span { font-size: 0.76rem; font-weight: 800; color: var(--text-muted); padding: 4px 0; }
.cal-day {
  border: none;
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 9px 0;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text);
}
.cal-day:hover { background: #DBEAFE; color: var(--blue-800); }
.cal-day.selected {
  background: var(--violet-600);
  color: #fff;
  box-shadow: 0 4px 12px rgba(109, 74, 255, 0.32);
}

.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot-pill {
  border: 1.5px solid #DCE4F0;
  background: #fff;
  border-radius: 11px;
  padding: 10px 6px;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text);
}
.slot-pill.selected {
  background: var(--violet-600);
  border-color: var(--violet-600);
  color: #fff;
}

.confirm-summary-list { display: flex; flex-direction: column; gap: 10px; }
.confirm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: var(--surface-soft);
  border-radius: 13px;
}
.confirm-row.highlight { background: #ECFDF5; border: 1px solid #A7F3D0; }
.confirm-row small { display: block; font-size: 0.75rem; color: var(--text-muted); }
.confirm-row strong { font-size: 0.96rem; }
.cr-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cr-icon svg { width: 19px; height: 19px; }
.cr-icon.blue { background: #DBEAFE; color: #1D4ED8; }
.cr-icon.purple { background: #EDE9FE; color: #6D28D9; }
.cr-icon.cyan { background: #E0F2FE; color: #0284C7; }
.cr-icon.teal { background: #CCFBF1; color: #0F766E; }
.cr-icon.green { background: #DCFCE7; color: #15803D; }

.wizard-footer { margin-top: 18px; }
.wizard-footer.split { display: flex; justify-content: space-between; gap: 10px; }
.wizard-footer.stacked { display: flex; flex-direction: column; gap: 8px; }

/* ==========================================================================
   APPOINTMENTS, TIMELINE, PAYMENTS & PROFILE
   ========================================================================== */
.apt-patient-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.apt-card-left { display: flex; gap: 12px; align-items: flex-start; }
.apt-cal-badge {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--violet-100);
  color: var(--violet-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.apt-cal-badge svg { width: 22px; height: 22px; }
.apt-date-title { display: block; font-size: 0.94rem; font-weight: 800; color: var(--blue-900); }
.apt-sub-time { display: block; font-size: 0.8rem; color: var(--violet-600); font-weight: 700; margin-bottom: 3px; }
.apt-card-left strong { display: block; font-size: 0.94rem; }
.apt-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.apt-inline-btns { display: flex; gap: 6px; }

.patient-clinical-summary { margin-bottom: 18px; }
.patient-mini-head { display: flex; align-items: center; gap: 13px; }
.patient-mini-head h2 { margin: 0 0 3px; font-size: 1.15rem; }
.mini-odontogram-strip {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-radius: 12px;
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.timeline-list { position: relative; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.timeline-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2.5px;
  background: #BFDBFE;
  border-radius: 4px;
}
.timeline-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  box-shadow: var(--shadow-sm);
}
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue-700);
  border: 3px solid #DBEAFE;
}
.timeline-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.timeline-date { font-weight: 800; font-size: 0.82rem; color: var(--blue-700); }
.timeline-content h3 { margin: 0 0 5px; font-size: 0.98rem; }
.timeline-content p { margin: 0 0 6px; font-size: 0.86rem; color: #334155; line-height: 1.45; }

.payments-hero-card, .cashbox-hero-card {
  background: linear-gradient(135deg, #0B4DA2, #1D6AD6);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.payments-hero-card .muted-sm, .cashbox-hero-card span { color: rgba(255, 255, 255, 0.85); }
.payments-hero-card h2, .cashbox-hero-card h2 { margin: 4px 0 2px; font-size: 1.75rem; font-weight: 800; }
.cashbox-left { display: flex; align-items: center; gap: 14px; }
.cashbox-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cashbox-icon svg { width: 26px; height: 26px; }

.payment-row-card {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.payment-row-card.clickable:hover { border-color: #93C5FD; background: #FBFDFF; }
.payment-row-card.pending { border-left: 4px solid var(--violet-600); }
.pay-row-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pay-icon-bubble {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #DCFCE7;
  color: #15803D;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pay-icon-bubble svg { width: 20px; height: 20px; }
.pay-row-left strong { display: block; font-size: 0.92rem; }
.payment-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

.profile-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.profile-hero-card h2 { margin: 0 0 4px; font-size: 1.25rem; }
.profile-hero-card p { margin: 0 0 10px; }

.menu-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.menu-row {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}
.menu-row:last-child { border-bottom: none; }
.menu-row:hover { background: var(--surface-soft); }
.menu-row.danger { color: var(--red-600); }
.menu-row-left { display: flex; align-items: center; gap: 12px; }
.mr-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mr-icon svg { width: 17px; height: 17px; }
.mr-icon.blue { background: #DBEAFE; color: #1D4ED8; }
.mr-icon.purple { background: #EDE9FE; color: #6D28D9; }
.mr-icon.cyan { background: #E0F2FE; color: #0284C7; }
.mr-icon.green { background: #DCFCE7; color: #15803D; }
.mr-icon.amber { background: #FEF3C7; color: #B45309; }
.mr-icon.red { background: #FEE2E2; color: #DC2626; }
.mr-arrow svg { width: 18px; height: 18px; color: #94A3B8; }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: #CBD5E1;
  border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}
.slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .slider { background: var(--green-500); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ==========================================================================
   ADMIN DASHBOARD, CHARTS, ODONTOGRAMA, INVENTORY & STAFF
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:not(.static):hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-icon.purple { background: #EDE9FE; color: #6D28D9; }
.kpi-icon.blue { background: #DBEAFE; color: #1D4ED8; }
.kpi-icon.green { background: #DCFCE7; color: #15803D; }
.kpi-icon.indigo { background: #E0E7FF; color: #4338CA; }
.kpi-body { min-width: 0; }
.kpi-body span { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 700; }
.kpi-body strong { display: block; font-size: clamp(1.02rem, 3.8vw, 1.3rem); font-weight: 800; margin: 2px 0; white-space: nowrap; }
.trend-up { font-size: 0.72rem; font-weight: 800; color: var(--green-600); }

.dashboard-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (min-width: 900px) { .dashboard-split { grid-template-columns: 1.15fr 1fr; } }

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-items: end;
  height: 210px;
  padding-top: 22px;
}
.bar-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.bar-val { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.bar-track {
  width: 100%;
  max-width: 38px;
  flex: 1;
  background: #F1F5F9;
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bar-fill {
  width: 100%;
  border-radius: 10px;
  background: linear-gradient(180deg, #9381FF, #6D4AFF);
  transition: height 0.4s ease;
}
.bar-fill.active { background: linear-gradient(180deg, #38BDF8, #0E4DA4); }
.bar-label { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }

.mini-apt-list { display: flex; flex-direction: column; gap: 8px; }
.timeline-apt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  border-left: 4px solid #3B82F6;
  background: #EFF6FF;
}
.timeline-apt-row.cyan { background: #ECFEFF; border-left-color: #06B6D4; }
.timeline-apt-row.green { background: #F0FDF4; border-left-color: #10B981; }
.timeline-apt-row.amber { background: #FFFBEB; border-left-color: #F59E0B; }
.timeline-apt-row.purple { background: #F5F3FF; border-left-color: #7C3AED; }
.timeline-apt-row.large { flex-wrap: wrap; }
.apt-hour { font-weight: 800; font-size: 0.88rem; color: var(--blue-900); min-width: 48px; }
.apt-info-box { flex: 1; min-width: 150px; }
.apt-info-box strong { display: block; font-size: 0.92rem; }
.apt-info-box span { display: block; font-size: 0.8rem; color: #475569; }
.apt-admin-actions { display: flex; align-items: center; gap: 6px; }

.alert-banner-inline {
  margin-top: 12px;
  width: 100%;
  border: 1px solid #FDE68A;
  background: #FFFBEB;
  color: #92400E;
  padding: 10px 13px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-shortcuts-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.shortcut-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.shortcut-chip svg { width: 17px; height: 17px; color: var(--blue-700); }
.shortcut-chip:hover { border-color: #93C5FD; color: var(--blue-800); }

.date-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.patient-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.patient-list-left { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.patient-list-left strong { display: block; font-size: 0.95rem; }
.patient-list-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.history-header-card { margin-bottom: 16px; }
.history-patient-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.history-top-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs-underline { display: flex; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; overflow-x: auto; }
.tab-u-btn {
  border: none;
  background: transparent;
  padding: 7px 13px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.tab-u-btn.active { background: #E8F1FD; color: var(--blue-800); }
.note-date { font-size: 0.78rem; font-weight: 800; color: var(--blue-700); }
.clinical-note-card h3 { margin: 2px 0 6px; font-size: 1rem; }
.clinical-note-card p { margin: 0 0 8px; font-size: 0.88rem; color: #334155; }

.clinical-images-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.clinical-img-tile {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
}
.clinical-img-tile svg { width: 100%; max-height: 76px; margin: 0 auto 6px; }
.clinical-img-tile span { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }

/* ---- ODONTOGRAMA ---- */
.odontogram-panel { padding: 20px; }
.odonto-tool-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.odonto-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.odonto-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 2px solid var(--border);
  background: #fff;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}
.odonto-tool-btn .dot { width: 11px; height: 11px; border-radius: 50%; }
.tool-sano .dot { background: #10B981; }
.tool-caries .dot { background: #F59E0B; }
.tool-tratamiento .dot { background: #2563EB; }
.tool-extraccion .dot { background: #EF4444; }
.odonto-tool-btn.active { border-color: var(--blue-800); background: #EFF6FF; }

.odonto-arch-section { margin: 12px 0; }
.arch-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 6px 0;
}
.teeth-row {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(8, 1fr);
}
@media (min-width: 720px) {
  .teeth-row.adulto { grid-template-columns: repeat(16, 1fr); }
  .teeth-row.infantil { grid-template-columns: repeat(10, 1fr); }
}
.tooth-cell {
  border: 1.5px solid #CBD5E1;
  background: #fff;
  border-radius: 10px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.12s, border-color 0.14s;
}
.tooth-cell:hover { transform: scale(1.06); border-color: var(--blue-600); }
.tooth-num { font-size: 0.7rem; font-weight: 800; color: #475569; }
.tooth-shape {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8FAFC;
}
.tooth-center { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid #CBD5E1; }

.tooth-cell.status-caries { background: #FFFBEB; border-color: #F59E0B; }
.tooth-cell.status-caries .tooth-shape { background: #FEF3C7; border-color: #D97706; }
.tooth-cell.status-caries .tooth-center { background: #F59E0B; border-color: #D97706; }

.tooth-cell.status-tratamiento { background: #EFF6FF; border-color: #2563EB; }
.tooth-cell.status-tratamiento .tooth-shape { background: #DBEAFE; border-color: #1D4ED8; }
.tooth-cell.status-tratamiento .tooth-center { background: #2563EB; border-color: #1D4ED8; }

.tooth-cell.status-extraccion { background: #FEF2F2; border-color: #EF4444; }
.tooth-cell.status-extraccion .tooth-shape { background: #FEE2E2; border-color: #DC2626; }
.tooth-cell.status-extraccion .tooth-center { background: #EF4444; border-color: #DC2626; }

.odonto-midline { height: 2px; background: repeating-linear-gradient(90deg, #CBD5E1 0 6px, transparent 6px 12px); margin: 14px 0; }
.odonto-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.btn-row { display: flex; gap: 8px; }

/* ---- INVENTORY & STAFF ---- */
.inventory-row-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.inv-left { display: flex; align-items: center; gap: 12px; }
.inv-left strong { display: block; font-size: 0.94rem; }
.inv-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-icon svg { width: 20px; height: 20px; }
.inv-icon.ok { background: #DBEAFE; color: #1D4ED8; }
.inv-icon.warn { background: #FEF3C7; color: #B45309; }
.inv-right { display: flex; align-items: center; gap: 10px; }

.staff-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .staff-grid { grid-template-columns: repeat(2, 1fr); } }
.staff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.staff-info strong { display: block; font-size: 0.98rem; }
.staff-role { display: inline-block; font-size: 0.8rem; font-weight: 700; color: var(--violet-600); margin: 2px 0; }

/* ==========================================================================
   MODALS, CHECKOUT SIMULATOR & DIGITAL RECEIPT
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
}
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.18s ease;
}
.modal-card.modal-sm { max-width: 440px; }
.modal-card.modal-checkout { max-width: 860px; }
.modal-card.modal-receipt { max-width: 540px; }

@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.modal-header h3 svg { width: 20px; height: 20px; color: var(--blue-700); }
.modal-title-group { display: flex; align-items: center; gap: 12px; }
.pwa-modal-icon { width: 42px; height: 42px; flex-shrink: 0; }
.pwa-modal-icon .brand-logo-img { width: 100%; height: 100%; border-radius: 11px; }

.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Checkout Simulator Styles */
.sim-notice-bar {
  background: #EFF6FF;
  border-bottom: 1px solid #BFDBFE;
  color: #1E3A8A;
  padding: 10px 20px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkout-form { overflow-y: auto; }
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 18px 20px;
}
@media (min-width: 760px) {
  .checkout-grid { grid-template-columns: 1.35fr 0.95fr; align-items: start; }
}
.section-mini-title { margin: 0 0 10px; font-size: 0.9rem; font-weight: 800; color: var(--blue-900); }
.pay-methods-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pay-tab {
  border: 1.5px solid #DCE4F0;
  background: #F8FAFC;
  padding: 10px 6px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}
.pay-tab.active {
  border-color: var(--violet-600);
  background: #F5F3FF;
  color: var(--violet-700);
}

.virtual-card-preview {
  background: linear-gradient(135deg, #0B2545 0%, #0E4DA4 55%, #6D4AFF 100%);
  color: #fff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 10px;
  box-shadow: 0 10px 24px rgba(11, 77, 162, 0.28);
}
.vc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.vc-chip {
  width: 34px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #FDE68A, #D97706);
}
.vc-brand { font-weight: 800; letter-spacing: 0.08em; font-size: 0.92rem; }
.vc-number { font-size: 1.12rem; font-weight: 700; letter-spacing: 0.12em; margin-bottom: 16px; }
.vc-bottom { display: flex; justify-content: space-between; font-size: 0.82rem; }
.vc-bottom small { display: block; font-size: 0.65rem; opacity: 0.72; }
.fill-test-row { margin-bottom: 10px; }

.yape-box {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  background: #FAF5FF;
  border: 1px solid #E9D5FF;
  border-radius: 16px;
  padding: 14px;
}
.yape-qr-wrap { text-align: center; }
.qr-svg { width: 122px; height: 122px; border-radius: 12px; border: 1px solid var(--border); }
.yape-badge {
  display: inline-block;
  margin-top: 6px;
  background: #742284;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}
.yape-instructions { flex: 1; min-width: 190px; }
.yape-number { font-size: 1.35rem; font-weight: 800; color: #742284; margin: 3px 0; }
.inline-action-input { display: flex; gap: 6px; }

.cip-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 16px;
  padding: 16px;
}
.cip-header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 8px; }
.cip-code { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.12em; color: #92400E; margin: 6px 0 8px; }

.order-summary-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.order-summary-card h4 { margin: 0 0 12px; font-size: 0.98rem; }
.summary-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.summary-item { display: flex; justify-content: space-between; gap: 8px; font-size: 0.86rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.secure-footnote { text-align: center; font-size: 0.74rem; color: var(--text-muted); margin: 8px 0 0; }

/* Digital Receipt Modal */
.receipt-top-banner {
  background: linear-gradient(135deg, #16A34A, #10B981);
  color: #fff;
  padding: 22px 20px;
  text-align: center;
}
.receipt-check {
  width: 50px;
  height: 50px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}
.receipt-check svg { width: 28px; height: 28px; }
.receipt-top-banner h3 { margin: 0 0 3px; font-size: 1.25rem; }
.receipt-top-banner p { margin: 0; font-size: 0.85rem; opacity: 0.94; }

.receipt-clinic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #CBD5E1;
  margin-bottom: 12px;
}
.receipt-brand { display: flex; align-items: center; gap: 10px; }
.receipt-brand .brand-logo-img { width: 38px; height: 38px; border-radius: 10px; }
.receipt-brand strong { display: block; font-size: 0.92rem; }
.receipt-brand small { display: block; font-size: 0.74rem; color: var(--text-muted); }

.receipt-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--surface-soft);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.receipt-meta-grid small { display: block; font-size: 0.72rem; color: var(--text-muted); }
.receipt-meta-grid strong { font-size: 0.84rem; }

.receipt-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-bottom: 12px; }
.receipt-table th { text-align: left; padding: 7px 6px; border-bottom: 1.5px solid #E2E8F0; color: var(--text-muted); font-size: 0.76rem; }
.receipt-table td { padding: 8px 6px; border-bottom: 1px solid #F1F5F9; }
.receipt-table .right { text-align: right; }
.receipt-totals { margin-bottom: 14px; }
.receipt-qr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 12px;
}
.receipt-qr-mini .qr-svg { width: 68px; height: 68px; }
.receipt-actions { justify-content: space-between; }
@media (max-width: 520px) {
  .receipt-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .receipt-actions .btn-ghost { grid-column: span 2; }
}

/* PWA Modal Guide */
.pwa-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pwa-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.pwa-check-item span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.pwa-check-item.ok span { background: var(--green-100); color: #15803D; }
.pwa-check-item.warn span { background: var(--amber-100); color: #B45309; }
.pwa-check-item.info span { background: #DBEAFE; color: #1D4ED8; }
.pwa-check-item strong { display: block; font-size: 0.82rem; }
.pwa-check-item small { display: block; font-size: 0.72rem; color: var(--text-muted); }

.pwa-steps-box {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.85rem;
}
.pwa-steps-box h4 { margin: 0 0 8px; color: var(--blue-900); font-size: 0.92rem; }
.pwa-steps-box ol { margin: 0; padding-left: 18px; line-height: 1.55; }
.pwa-steps-box code { background: #fff; padding: 1px 5px; border-radius: 5px; font-weight: 700; }

/* Notifications & Empty State */
.notif-item {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 11px 13px;
  border-radius: 12px;
}
.notif-top { display: flex; justify-content: space-between; margin-bottom: 3px; font-size: 0.88rem; }
.notif-item p { margin: 0; }

.empty-state {
  text-align: center;
  background: var(--surface);
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-lg);
  padding: 36px 20px;
}
.empty-state.compact { padding: 28px 16px; }
.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: #EFF6FF;
  color: var(--blue-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-icon svg { width: 26px; height: 26px; }
.empty-state h3, .empty-state h4 { margin: 0 0 6px; }
.empty-state p { margin: 0 0 16px; color: var(--text-muted); font-size: 0.88rem; }

/* Toasts & Spinner */
.toast-container {
  position: fixed;
  bottom: 84px;
  right: 16px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(92vw, 380px);
}
@media (min-width: 1024px) { .toast-container { bottom: 24px; right: 24px; } }
.toast {
  background: #0F172A;
  color: #fff;
  padding: 11px 15px;
  border-radius: 13px;
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: #38BDF8; }
.toast-success .toast-dot { background: #10B981; }
.toast-warn .toast-dot { background: #F59E0B; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Print Styles for Boleta Electrónica / Reportes PDF */
@media print {
  .desktop-sidebar, .app-topbar, .mobile-bottom-nav, .pwa-install-banner, .toast-container, .modal-footer {
    display: none !important;
  }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal-card { box-shadow: none; max-height: none; }
}
