/* =============================================================================
   AGUIRRESYSTEM - Componentes: cards, botones, inputs, badges, layout
   ============================================================================= */

/* --- Glass / Card ----------------------------------------------------------- */

.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .glass {
    background: rgba(10, 14, 26, 0.7);
    border-color: rgba(255, 255, 255, 0.05);
  }
}
:root[data-theme="dark"] .glass {
  background: rgba(10, 14, 26, 0.7);
  border-color: rgba(255, 255, 255, 0.05);
}

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card-hover {
  transition: all 0.3s ease;
}
.card-hover:hover {
  box-shadow: 0 20px 40px rgba(0, 61, 165, 0.1);
  transform: translateY(-2px);
}

.card-pad { padding: 20px; }
@media (max-width: 640px) { .card-pad { padding: 16px; } }

/* --- Botones ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--aguirre-blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 61, 165, 0.2);
}
.btn-primary:hover:not(:disabled) { background: var(--aguirre-blue-dark); }

.btn-secondary {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn-secondary:hover:not(:disabled) { background: var(--muted); }

.btn-danger {
  background: var(--aguirre-red);
  color: #fff;
  box-shadow: 0 8px 20px rgba(227, 6, 19, 0.2);
}
.btn-danger:hover:not(:disabled) { background: var(--aguirre-red-dark); }

.btn-success {
  background: #059669;
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #047857; }

.btn-outline-danger {
  background: transparent;
  color: var(--aguirre-red);
  border: 1px solid rgba(227,6,19,.25);
  font-weight: 500;
}
.btn-outline-danger:hover:not(:disabled) { background: rgba(227,6,19,.08); }

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
  padding: 8px;
  border-radius: 10px;
}
.btn-ghost:hover:not(:disabled) { background: var(--muted); color: var(--foreground); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { padding: 8px; }
.btn-block { width: 100%; }

.btn-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--aguirre-blue); font-weight: 600; text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

.cliente-encontrado { color: #047857; }

.search-icon-wrap { position: relative; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); display: flex; pointer-events: none; }
.search-icon-wrap input.input { padding-left: 36px; }

/* --- Inputs -------------------------------------------------------------- */

.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}

.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.15s ease;
}
.input::placeholder { color: var(--muted-foreground); }
.input:focus {
  outline: none;
  border-color: var(--aguirre-blue);
  box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.15);
}
.input:disabled { opacity: 0.6; cursor: not-allowed; }

.field { margin-bottom: 16px; }
.field-error { color: var(--aguirre-red); font-size: 12.5px; margin-top: 4px; }
.input.has-error { border-color: var(--aguirre-red); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--aguirre-blue); }

/* --- Badge ----------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-indigo  { background: #e0e7ff; color: #4338ca; }
.badge-purple  { background: #f3e8ff; color: #7e22ce; }
.badge-cyan    { background: #cffafe; color: #0e7490; }
.badge-orange  { background: #ffedd5; color: #c2410c; }
.badge-emerald { background: #d1fae5; color: #047857; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-slate   { background: #f1f5f9; color: #475569; }
.badge-amber   { background: #fef3c7; color: #b45309; }

:root[data-theme="dark"] .badge-blue    { background: rgba(59,130,246,.15); color: #60a5fa; }
:root[data-theme="dark"] .badge-indigo  { background: rgba(99,102,241,.15); color: #818cf8; }
:root[data-theme="dark"] .badge-purple  { background: rgba(168,85,247,.15); color: #c084fc; }
:root[data-theme="dark"] .badge-cyan    { background: rgba(6,182,212,.15); color: #22d3ee; }
:root[data-theme="dark"] .badge-orange  { background: rgba(249,115,22,.15); color: #fb923c; }
:root[data-theme="dark"] .badge-emerald { background: rgba(16,185,129,.15); color: #34d399; }
:root[data-theme="dark"] .badge-red     { background: rgba(239,68,68,.15); color: #f87171; }
:root[data-theme="dark"] .badge-slate   { background: rgba(148,163,184,.15); color: #cbd5e1; }
:root[data-theme="dark"] .badge-amber   { background: rgba(245,158,11,.15); color: #fbbf24; }

/* --- Layout: sidebar + topbar ------------------------------------------------ */

.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  border-right: 1px solid var(--border);
  background: var(--card);
  transition: transform 0.3s ease;
  z-index: 50;
}

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

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.15s ease;
}
.nav-link:hover { background: var(--muted); color: var(--foreground); }
.nav-link.active {
  background: var(--aguirre-gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 61, 165, 0.2);
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-divider { border-top: 1px solid var(--border); margin: 12px 0; padding-top: 12px; }
.nav-link-dev:hover { background: rgba(227,6,19,.1); color: var(--aguirre-red); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  background: var(--aguirre-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info p { margin: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 12px; color: var(--muted-foreground); }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 45;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .sidebar-close-btn { display: inline-flex; }
}
@media (min-width: 1024px) {
  .sidebar-close-btn { display: none; }
}

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(8px);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.hamburger { display: inline-flex; }
@media (min-width: 1024px) { .hamburger { display: none; } }

main.content { flex: 1; padding-bottom: 32px; }

/* --- Modal ------------------------------------------------------------------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--card);
  color: var(--card-foreground);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  animation: scaleIn 0.2s ease-out;
}
.modal-lg { max-width: 720px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--border);
}

/* --- Toasts -------------------------------------------------------------- */

.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease-out;
  font-size: 13.5px;
}
.toast-success { border-left: 3px solid #10b981; }
.toast-error { border-left: 3px solid var(--aguirre-red); }
.toast-info { border-left: 3px solid var(--aguirre-blue); }
.toast button { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--muted-foreground); }

/* --- Tabla ------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-weight: 600; color: var(--muted-foreground);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--muted); }

/* --- Utilidades de layout ------------------------------------------------- */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header p { color: var(--muted-foreground); font-size: 13.5px; margin-top: 4px; }

.icon-chip {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-chip svg { width: 20px; height: 20px; }
.icon-chip-blue    { background: rgba(0,61,165,.1); color: var(--aguirre-blue); }
.icon-chip-red     { background: rgba(227,6,19,.1); color: var(--aguirre-red); }
.icon-chip-emerald { background: rgba(16,185,129,.1); color: #10b981; }
.icon-chip-amber   { background: rgba(245,158,11,.1); color: #f59e0b; }
.icon-chip-violet  { background: rgba(139,92,246,.1); color: #8b5cf6; }
.icon-chip-indigo  { background: rgba(99,102,241,.1); color: #6366f1; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted-foreground); }

/* --- Selector de tipo con tarjetas + checkbox con descripción (Filiales, etc) --- */

.tipo-card {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border-radius: 14px; border: 2px solid var(--border); background: transparent;
  cursor: pointer; text-align: left; transition: border-color .15s, background .15s, color .15s;
  color: var(--muted-foreground); font-family: inherit;
}
.tipo-card:hover { border-color: var(--muted-foreground); }
.tipo-card .tipo-card-label { font-size: 13.5px; font-weight: 600; display: block; color: var(--foreground); }
.tipo-card .tipo-card-desc  { font-size: 11.5px; opacity: .75; display: block; }
.tipo-card.active.tipo-blue  { border-color: var(--aguirre-blue); background: rgba(0,61,165,.06); }
.tipo-card.active.tipo-blue .tipo-card-label { color: var(--aguirre-blue); }
.tipo-card.active.tipo-amber { border-color: #f59e0b; background: rgba(245,158,11,.06); }
.tipo-card.active.tipo-amber .tipo-card-label { color: #b45309; }
.tipo-card.active.tipo-indigo { border-color: #6366f1; background: rgba(99,102,241,.06); }
.tipo-card.active.tipo-indigo .tipo-card-label { color: #4f46e5; }
.tipo-card.active.tipo-emerald { border-color: #10b981; background: rgba(16,185,129,.06); }
.tipo-card.active.tipo-emerald .tipo-card-label { color: #059669; }
.tipo-card.tipo-card-compact { flex-direction: column; text-align: center; gap: 6px; }

.qr-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
  border-radius: 8px; border: none; background: var(--muted); color: var(--foreground);
  font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; transition: background .15s;
  max-width: 100%;
}
.qr-chip:hover { background: var(--border); }
.qr-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.qr-chip svg { flex-shrink: 0; }

.checkbox-card {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-radius: 14px; border: 1px solid var(--border); cursor: pointer; transition: background .15s;
}
.checkbox-card:hover { background: var(--muted); }
.checkbox-card input { margin-top: 2px; flex-shrink: 0; }
.checkbox-card .checkbox-card-title { font-size: 13.5px; font-weight: 600; display: block; }
.checkbox-card .checkbox-card-desc  { font-size: 11.5px; color: var(--muted-foreground); margin-top: 1px; display: block; }

.input[readonly] { background: var(--muted); cursor: not-allowed; opacity: .75; }

.data-table tr.is-inactiva { opacity: .55; }
.tag-inactiva {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--aguirre-red);
}
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.4; }

.spinner {
  width: 22px; height: 22px; border-radius: 999px;
  border: 3px solid var(--border);
  border-top-color: var(--aguirre-blue);
  animation: spin 0.7s linear infinite;
}
.spinner-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }

/* --- Grids de 2 columnas con proporción custom (dashboard, detalle) --- */
#gridCharts, #gridMain {
  display: grid;
}
@media (max-width: 900px) {
  #gridCharts, #gridMain { grid-template-columns: 1fr !important; }
}

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

.dash-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
@media (max-width: 640px) { .hide-mobile { display: none; } }

/* --- Cards de KPI del dashboard --------------------------------------- */
.kpi-card-lg {
  position: relative; overflow: hidden; padding: 20px;
}
.kpi-card-lg .kpi-blob {
  position: absolute; top: -48px; right: -48px; width: 128px; height: 128px;
  border-radius: 999px; opacity: 0.1;
}
.kpi-card-lg .kpi-row { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-card-lg .kpi-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card-lg .kpi-value { margin-top: 8px; font-size: 22px; font-weight: 700; font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1024px) { .kpi-card-lg .kpi-value { font-size: 28px; } }
.kpi-card-lg .kpi-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; }

.kpi-card-sm { padding: 16px; }
.kpi-card-sm .kpi-row { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); }
.kpi-card-sm .kpi-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi-card-sm .kpi-value { margin-top: 6px; font-size: 18px; font-weight: 700; font-family: var(--font-display); }
.kpi-card-sm .kpi-sub { font-size: 10px; color: var(--muted-foreground); opacity: .8; }

.actividad-row {
  display: flex; align-items: center; gap: 16px; padding: 12px; margin: 0 -12px;
  border-radius: 12px; text-decoration: none; color: inherit; transition: background .15s;
}
.actividad-row:hover { background: var(--muted); }
.actividad-row:hover .actividad-arrow { color: var(--aguirre-blue); transform: translateX(2px); }
.actividad-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(0,61,165,.1); color: var(--aguirre-blue); }
.actividad-arrow { color: var(--border); transition: all .15s; flex-shrink: 0; }
.actividad-right { text-align: right; flex-shrink: 0; }
@media (max-width: 640px) { .actividad-right { display: none; } }

.encomienda-row { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; }

/* --- Tracking público (/r.php) -------------------------------------------- */
.uc-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.badge-lg { padding: 8px 16px; border-radius: 16px; font-size: 16px; }
.track-ruta-icon { width: 32px; height: 32px; border-radius: 999px; background: rgba(0,61,165,.1); color: var(--aguirre-blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.track-timeline { position: relative; list-style: none; margin: 0; padding: 0; }
.track-timeline li { position: relative; padding: 0 0 16px 28px; }
.track-timeline li:last-child { padding-bottom: 0; }
.track-timeline li::before { content: ''; position: absolute; left: 11px; top: 15px; bottom: 0; width: 1px; background: var(--border); }
.track-timeline li:last-child::before { display: none; }
.track-timeline .dot { position: absolute; left: 6px; top: 4px; width: 12px; height: 12px; border-radius: 999px; background: var(--muted-foreground); opacity: .4; box-shadow: 0 0 0 4px var(--muted); }
.track-timeline li:first-child .dot { background: var(--aguirre-blue); opacity: 1; box-shadow: 0 0 0 4px rgba(0,61,165,.15); }

.caja-hoy-tile { border-radius: 16px; padding: 16px; }
.caja-hoy-tile.ingresos { background: rgba(16,185,129,.06); border: 1px solid rgba(16,185,129,.2); }
.caja-hoy-tile.medio { background: var(--muted); }
.caja-hoy-tile.comisionistas { background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.2); }
.caja-hoy-tile p.label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.caja-hoy-tile p.value { font-size: 22px; font-weight: 700; font-family: var(--font-display); margin-bottom: 2px; }

.notif-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 999px; background: var(--aguirre-red);
  animation: pulseSlow 3s ease-in-out infinite;
}
@keyframes pulseSlow { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* --- Toggle de tema: mostrar sol en oscuro (pasar a claro) y luna en claro --- */
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }

/* --- Scanner QR ------------------------------------------------------------ */
.scanner-sesion-pill { display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(0,61,165,.06); border-color: rgba(0,61,165,.2); }
.scanner-abrir-card .icon-chip { flex-shrink: 0; }

.scanner-hero-icon {
  width: 96px; height: 96px; border-radius: 28px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--aguirre-gradient); color: #fff;
  box-shadow: 0 20px 40px rgba(0,61,165,.3);
  animation: scannerBreathe 2s ease-in-out infinite;
}
@keyframes scannerBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.scanner-frame {
  position: relative; width: 100%; max-width: 400px; min-height: 240px;
  margin: 0 auto; border-radius: 20px; overflow: hidden; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.scanner-frame #reader { width: 100%; }
.scanner-frame #reader video { max-width: 100%; }
.scanner-scanline {
  position: absolute; left: 5%; width: 90%; height: 2px;
  background: var(--aguirre-red); box-shadow: 0 0 20px rgba(227,6,19,.9);
  animation: scannerSweep 1.1s ease-in-out infinite; pointer-events: none;
}
@keyframes scannerSweep { 0%, 100% { top: 18%; } 50% { top: 82%; } }

.scanner-buscando {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  color: #fff; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  pointer-events: none;
}
.scanner-buscando .dot { width: 6px; height: 6px; border-radius: 999px; background: #34d399; animation: pulseSlow 1.1s ease-in-out infinite; }

.scanner-resultado-icon {
  width: 48px; height: 48px; border-radius: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #10b981; color: #fff; box-shadow: 0 8px 20px rgba(16,185,129,.3);
  animation: scaleIn .3s ease-out;
}
.scanner-resultado-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--muted); color: var(--muted-foreground); }
.scanner-resultado-badge.nuevo { background: #10b981; color: #fff; }
[data-theme-icon] { display: inline-flex; }
