:root {
  --bg: #14181F;
  --surface: #1C222B;
  --surface-2: #232B36;
  --border: #2C3444;
  --text: #E8EAED;
  --muted: #8B93A1;
  --accent: #F2B134;
  --accent-dim: #6b5726;
  --green: #3DDC84;
  --red: #E5484D;
  /* CR-036 (auditoría visual): no existía ningún token azul en la
     paleta — se agrega solo para el monto de "Ingresos · Mes actual"
     en Contabilidad (punto 5 de la auditoría). Mismo patrón de
     saturación que --green/--red/--accent en tema oscuro. */
  --blue: #4DA6FF;
  --topbar-bg: rgba(20,24,31,0.92);
  --bottomnav-bg: rgba(28,34,43,0.96);
  --overlay: rgba(0,0,0,0.6);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --radius: 16px;
}

:root[data-theme="light"] {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #ECEEF2;
  --border: #DCE0E7;
  --text: #1B1F27;
  --muted: #6B7280;
  --accent: #C8811A;
  --accent-dim: #F3DFB9;
  --green: #19A15A;
  --red: #D3373D;
  /* CR-036: mismo criterio que --accent/--green/--red en tema claro —
     versión más oscura/saturada para mantener contraste sobre fondo
     blanco (--surface: #FFFFFF). */
  --blue: #1971C2;
  --topbar-bg: rgba(244,245,247,0.92);
  --bottomnav-bg: rgba(255,255,255,0.96);
  --overlay: rgba(20,24,31,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  transition: background-color .2s ease, color .2s ease;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0 0 4px; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 78px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; position: sticky; top: 0; z-index: 10;
  background: var(--topbar-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); font-size: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
/* CR-036: .brand-mark pasó de ser un <span> con letra "P" pintada por CSS
   (fondo var(--accent), texto) a un <img> con el isotipo aprobado. Se
   conserva el mismo tamaño de 34px que tenía la caja anterior; las
   propiedades de fondo/texto/flex ya no aplican a una imagen y se quitan.
   object-fit: contain evita cualquier deformación si el contenedor deja
   de ser perfectamente cuadrado en el futuro. */
.brand-mark {
  width: 34px; height: 34px; display: block; object-fit: contain;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.2px; }

.main-content { padding: 18px 16px 24px; flex: 1; }

.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; flex-wrap: wrap; }
.view-header h1 { font-size: 22px; }
.view-header-center { justify-content: center; text-align: center; flex-direction: column; align-items: center; }
.view-header-center h1 {
  width: 100%; text-align: center; margin: 0 auto; display: block;
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.pad { padding: 24px 0; }
.text-warn { color: var(--accent); font-weight: 600; }
.text-ok { color: var(--green); font-weight: 600; }
.text-bad { color: var(--red); font-weight: 600; }

/* ---------- Ticket cards (elemento firma) ---------- */
.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
}
.ticket-card::before, .ticket-card::after {
  content: ''; position: absolute; width: 14px; height: 14px; background: var(--bg);
  border-radius: 50%; top: 50%; transform: translateY(-50%);
}
.ticket-card::before { left: -7px; }
.ticket-card::after { right: -7px; }

.hero-card { text-align: center; padding: 26px 18px; border-color: var(--accent-dim); }
.hero-label { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.hero-amount { font-family: var(--font-mono); font-size: 42px; font-weight: 700; color: var(--accent); }

.card-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.card-amount { font-family: var(--font-mono); font-size: 26px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }

.comp-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px dashed var(--border); font-size: 13.5px; gap: 8px; flex-wrap: wrap; }
.comp-row:first-of-type { border-top: none; }
.comp-label { flex: 1 1 140px; color: var(--muted); }
.comp-values { font-family: var(--font-mono); }
.comp-values small { color: var(--muted); }
.comp-trend { font-weight: 700; font-family: var(--font-mono); min-width: 70px; text-align: right; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--muted); }

.breakdown-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.breakdown-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 0; border-top: 1px dashed var(--border); }
.breakdown-row:first-child { border-top: none; }
.breakdown-amount { font-family: var(--font-mono); text-align: right; }
.breakdown-amount small { color: var(--muted); }

.select-inline { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; margin-bottom: 6px; font-size: 12.5px; }

/* ---------- CR-036 (auditoría visual): Dashboard — legibilidad ----------
   Aumento moderado y NO uniforme de la jerarquía tipográfica existente,
   escalando más los valores más importantes ("Ingresos de hoy") y menos
   las etiquetas/textos secundarios. Todo bajo .dashboard-view para NO
   afectar .card-label/.card-amount/.view-header h1 reutilizados en
   Clientes, Contabilidad, Egresos, etc. (ver js/dashboard.js). El color
   verde de "Ingresos de hoy" (punto 4 de la auditoría) reutiliza
   var(--green), ya usado en el resto de la app para valores positivos. */
.dashboard-view .view-header h1 { font-size: 24px; }
.dashboard-view .hero-label { font-size: 15px; }
.dashboard-view .hero-amount { font-size: 46px; color: var(--green); }
.dashboard-view .card-label { font-size: 14px; }
.dashboard-view .card-amount { font-size: 29px; }
.dashboard-view .card-sub { font-size: 13px; }
.dashboard-view .comp-row { font-size: 14.5px; }
.dashboard-view .breakdown-row { font-size: 14.5px; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 12px; padding: 12px 18px; font-weight: 600; font-size: 14.5px;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #14181F; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-xs { padding: 5px 8px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Search / Inputs ---------- */
.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 14.5px; font-family: inherit;
}
textarea.input { resize: vertical; }
.search-result { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 70px; }

/* ---------- Client / list rows ---------- */
.mini-client-card, .client-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px; background: var(--surface-2); border-radius: 12px; flex-wrap: wrap;
}
.client-row { background: var(--surface); }
.mini-client-info { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-display); flex-shrink: 0;
}
.avatar-lg { width: 46px; height: 46px; }
.avatar-xl { width: 60px; height: 60px; font-size: 22px; }
.avatar-search-lg { width: 84px; height: 84px; font-size: 28px; flex-shrink: 0; }
.mini-client-actions { display: flex; align-items: center; gap: 8px; }
.debt-chip { font-family: var(--font-mono); font-size: 12.5px; padding: 4px 8px; border-radius: 8px; }
.chip { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.chip-warn, .debt-chip.chip-warn { background: rgba(242,177,52,0.15); color: var(--accent); }
.chip-ok, .debt-chip.chip-ok { background: rgba(61,220,132,0.15); color: var(--green); }
.debt-amount-prominent { font-family: var(--font-mono); font-weight: 700; font-size: 17px; background: none; padding: 0; border-radius: 0; margin-top: 2px; }

.client-row-mid { text-align: center; }
.client-row-actions { display: flex; gap: 8px; }
.client-list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Banner de clientes registrados y asistiendo (Clientes) ---------- */
.clients-banner-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; margin-top: 4px;
  scroll-snap-type: x proximity;
}
.client-banner-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0;
  width: 74px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 6px 8px; scroll-snap-align: start; text-align: center;
}
.client-banner-chip:active { transform: scale(0.97); }
.client-banner-chip .avatar { width: 40px; height: 40px; }
.client-banner-id { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; }
.client-banner-name {
  font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.tab { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); border-radius: 20px; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.tab-active { background: var(--accent); color: #14181F; border-color: var(--accent); font-weight: 700; }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; }
.modal-root.open { display: block; }
.modal-backdrop { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; } }
.modal-box {
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 22px 18px 28px;
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; position: relative;
  border: 1px solid var(--border); animation: slideUp .18s ease;
}
@media (min-width: 640px) { .modal-box { border-radius: 20px; margin-bottom: 40px; } }
.modal-wide { max-width: 560px; }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close { position: absolute; top: 14px; right: 14px; background: var(--surface-2); border: none; color: var(--text); width: 30px; height: 30px; border-radius: 50%; font-size: 14px; }
.modal-title { font-size: 19px; margin-bottom: 12px; padding-right: 24px; }
.modal-client-info { background: var(--surface-2); padding: 10px; border-radius: 12px; margin-bottom: 14px; }

.debt-section { border-top: 1px dashed var(--border); padding: 10px 0; }
.debt-section-head { display: flex; justify-content: space-between; cursor: pointer; font-weight: 600; font-size: 14px; }
.debt-section-head .link { color: var(--accent); }
.debt-section-body { padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.debt-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 6px 0; }
.debt-item-amount { margin-left: auto; font-family: var(--font-mono); }

.advance-box { padding: 10px 0; }
.total-box { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-top: 2px solid var(--border); margin-top: 6px; }
.total-amount { font-family: var(--font-mono); font-size: 24px; color: var(--accent); font-weight: 700; }
.method-box { display: flex; gap: 18px; padding: 10px 0 18px; font-size: 14px; }
.method-box label { display: flex; align-items: center; gap: 6px; }

.confirm-box { text-align: center; padding-top: 6px; }
.confirm-msg { font-size: 15px; margin-bottom: 18px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.field-error { color: var(--red); font-size: 12px; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; font-size: 14px; }

.apuntes-summary { display: flex; justify-content: space-between; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.apuntes-list, .scroll-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.scroll-list { max-height: 220px; overflow-y: auto; }
.apunte-row { display: grid; grid-template-columns: 90px 110px 1fr auto auto; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-top: 1px dashed var(--border); }
@media (max-width: 480px) { .apunte-row { grid-template-columns: 1fr 1fr; } }

.toast-root { position: fixed; bottom: 90px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 10px 18px; border-radius: 30px; font-size: 13.5px; opacity: 0; transform: translateY(10px); transition: all .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-color: var(--red); color: var(--red); }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profile-info { flex: 1; }
.profile-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.select-sm { padding: 6px 8px; font-size: 12.5px; width: auto; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Perfil de cliente compacto: mismo tamaño de letra, menos espacio vacío entre
   tarjetas para que el botón "Pagar" quede visible sin hacer scroll en móvil. */
.profile-page .ticket-card { padding: 12px 14px; margin-bottom: 10px; }
.profile-page .profile-head { gap: 10px; }
.profile-page .profile-head .avatar-xl { width: 48px; height: 48px; }
.profile-page .profile-info p { margin: 0; }
.profile-page .profile-photos-row { display: flex; align-items: center; gap: 12px; }
.profile-page .profile-photos { display: flex; gap: 8px; margin: 0; flex: 1; }
.profile-page .profile-photo-item { flex: 1; text-align: center; }
.profile-page .profile-photo-item img,
.profile-page .profile-photo-item .photo-preview { aspect-ratio: 16 / 7; margin-bottom: 3px; }
.profile-page .profile-photo-item .muted.small { font-size: 11px; }
.profile-page .grid-2 { gap: 8px; margin-bottom: 10px; }
.profile-page .action-row { gap: 8px; }

/* ---------- Receipt (Conteos) ---------- */
.receipt-card { font-family: var(--font-mono); }
.receipt-header { text-align: center; font-family: var(--font-display); font-weight: 700; margin-bottom: 10px; letter-spacing: 0.5px; }
.receipt-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-top: 1px dashed var(--border); }
.receipt-row:first-of-type { border-top: none; }
.receipt-total { text-align: right; font-size: 18px; font-weight: 700; color: var(--accent); margin-top: 10px; border-top: 2px solid var(--border); padding-top: 10px; }

/* ---------- Nav grid (Mi Parqueo / Reportes) ---------- */
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .nav-grid { grid-template-columns: 1fr; } }
.nav-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: left; transition: border-color .15s; }
.nav-card:hover { border-color: var(--accent); }
.nav-card-icon { font-size: 26px; margin-bottom: 8px; }
.nav-card-title { font-family: var(--font-display); font-weight: 600; margin-bottom: 4px; }
.nav-card-desc { font-size: 12.5px; color: var(--muted); }

/* ---------- Formulario compacto (Nuevo Conteo) ---------- */
.modal-compact { padding: 18px 16px 20px; }
.form-grid-compact { gap: 9px; }
.form-grid-compact label { gap: 4px; }
.form-grid-compact .input { padding: 9px 10px; font-size: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-lg { padding: 14px 20px; font-size: 15.5px; }
.btn-ver-conteo { padding: 11px 18px; font-size: 14px; font-weight: 700; }

/* ---------- Confirmar Conteo (rediseño grande y claro) ---------- */
.confirm-conteo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
@media (max-width: 480px) { .confirm-conteo-grid { grid-template-columns: 1fr; } }
.confirm-check-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  background: var(--surface-2); border: 2px solid var(--border); border-radius: 14px; padding: 14px 10px;
  cursor: pointer; transition: border-color .15s;
}
.confirm-check-card input { width: 20px; height: 20px; margin-bottom: 4px; }
.confirm-check-card:has(input:checked), .confirm-check-card.is-checked { border-color: var(--green); background: rgba(61,220,132,0.08); }
.confirm-check-icon { font-size: 24px; }
.confirm-check-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.confirm-check-value { font-family: var(--font-mono); font-size: 17px; font-weight: 700; }

.confirm-ids-section { margin: 14px 0; }
.confirm-ids-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.confirm-id-chip {
  display: flex; align-items: center; gap: 6px; background: var(--surface-2);
  border: 2px solid var(--border); border-radius: 20px; padding: 8px 14px; font-family: var(--font-mono);
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.confirm-id-chip input { width: 16px; height: 16px; }
.confirm-id-chip:has(input:checked), .confirm-id-chip.is-checked { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.confirm-ids-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Contabilidad (Ingresos / Gastos / Ganancia Neta) ---------- */
.fin-summary-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { .fin-summary-grid { grid-template-columns: 1fr; } }
.fin-summary-card { text-align: center; }
/* CR-036 (auditoría visual, puntos 5 y 6): se colorea SOLO el monto de
   las tarjetas "Ingresos" (1ª) y "Gastos" (2ª) de este grid de 3 —
   nunca su etiqueta, y sin tocar la 3ª tarjeta ("Ganancia Neta"), que
   conserva su color dinámico verde/rojo según sea positiva o negativa.
   Se usa :nth-child en vez de tocar .card-amount/.text-ok/.text-warn
   directamente porque esas clases se reutilizan en Clientes, Dashboard
   y otras filas de Contabilidad, y recolorearlas ahí habría cambiado
   pantallas fuera del alcance de esta auditoría. Aplica también con
   RD$0 porque el elemento y su clase existen igual, solo cambia el
   texto que contiene. */
.fin-summary-card:nth-child(1) .card-amount { color: var(--blue); }
.fin-summary-card:nth-child(2) .card-amount { color: var(--red); }
.fin-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.fin-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.fin-row-ingreso { border-left: 4px solid var(--green); }
.fin-row-egreso { border-left: 4px solid var(--red); }

/* ---------- Bar chart (Evolución) ---------- */
.bar-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 200px; margin-top: 10px; }
.bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; }
.bar { width: 60%; background: var(--accent); border-radius: 6px 6px 0 0; }
.bar-label { font-size: 11px; color: var(--muted); margin-top: 6px; text-transform: capitalize; }
.bar-value { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

/* ---------- Contabilidad ---------- */
.mov-list { display: flex; flex-direction: column; gap: 8px; }
.mov-row { display: grid; grid-template-columns: 70px 100px 1fr 1fr 90px; gap: 8px; align-items: center; font-size: 12.5px; border-top: 1px dashed var(--border); padding: 6px 0; }
.mov-row:first-of-type { border-top: none; }
@media (max-width: 560px) { .mov-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 720px; display: flex; justify-content: space-around;
  background: var(--bottomnav-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 10.5px; padding: 4px 6px; border-radius: 10px; flex: 1; }
.nav-icon { font-size: 19px; }
.nav-item-active { color: var(--accent); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---------- Fotos de cliente / motor ---------- */
.avatar-photo { object-fit: cover; }
.photo-upload-row { display: flex; gap: 14px; flex-wrap: wrap; }
.photo-upload-box { flex: 1 1 140px; }
.photo-upload-box label.photo-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.photo-preview {
  width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--surface-2);
  border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; margin-bottom: 6px;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photos { display: flex; gap: 12px; margin: 12px 0; }
.profile-photo-item { flex: 1; text-align: center; }
.profile-photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.profile-photo-item .card-label { margin-top: 6px; }

/* ---------- Badges financieros (Pagos) ---------- */
.client-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mini-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.mini-badge.badge-warn { color: var(--accent); border-color: var(--accent-dim); }
.mini-client-card { align-items: flex-start; }

/* ---------- Acceso al sistema (login contra el servidor) ---------- */
#authGate {
  position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.auth-gate-box {
  width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 22px; text-align: center;
}
.auth-gate-brand { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-bottom: 6px; }
/* CR-036: antes .auth-gate-brand solo contenía texto + el emoji 🅿️ (sin
   regla propia). Ahora contiene también <img class="auth-gate-logo">;
   se agrega esta regla únicamente para el tamaño/alineación de esa
   imagen, sin tocar la tipografía del texto "Mi Parqueo" que ya existía. */
.auth-gate-logo {
  width: 40px; height: 40px; display: inline-block; vertical-align: middle;
  object-fit: contain; margin-right: 8px;
}
.auth-gate-box .muted.small { margin-bottom: 16px; }
.auth-gate-box form { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Aviso de trabajo sin conexión al servidor ---------- */
.sync-offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300; text-align: center;
  background: var(--accent-dim); color: var(--accent); font-size: 12.5px; font-weight: 600;
  padding: 8px 12px;
}

/* ---------- CR-013: aviso persistente de respaldo por conflicto ----------
   No se oculta solo (a diferencia del banner de arriba): se queda visible
   hasta que el propietario revise y borre el respaldo desde Mi Parqueo →
   Diagnóstico de Sincronización. Se posiciona debajo del banner de "sin
   conexión" (top: 34px en vez de 0) para que ambos puedan mostrarse a la
   vez sin superponerse, ya que son avisos independientes. */
.sync-conflict-banner {
  position: fixed; top: 34px; left: 0; right: 0; z-index: 300; text-align: center;
  background: rgba(229,72,77,0.15); color: var(--red); font-size: 12.5px; font-weight: 600;
  padding: 8px 12px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
