:root {
  --mb-red: #E31837;
  --mb-red-hover: #C8102E;
  --mb-dark: #1B1B1B;
  --mb-bg: #F0EBF8;
  --mb-accent: #003DA5;
  --mb-card: #FFFFFF;
  --mb-text: #1B1B1B;
  --mb-text-secondary: #666666;
  --mb-border: #e2e6ea;

  --e-pendiente: #f59e0b;
  --e-confirmado: #003DA5;
  --e-senado: #0d9488;
  --e-pagado: #16a34a;
  --e-a_pagar_total: #4f46e5;
  --e-esperando_barbero: #7c3aed;
  --e-pendiente_verificacion: #f97316;
  --e-terminado: #64748b;
  --e-completado: #15803d;
  --e-cancelado: #E31837;

  --error-bg: #fee2e2;
  --error-text: #b91c1c;
  --ok-bg: #dcfce7;
  --ok-text: #166534;

  --sidebar-w: 240px;
}

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--mb-bg);
  color: var(--mb-text);
}

/* ─── Utilities ─── */

.hidden { display: none !important; }
.muted { color: var(--mb-text-secondary); }

/* ─── Sidebar ─── */

#app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--mb-dark);
  color: #ccc;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: #aaa;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(227, 24, 55, 0.15);
  color: #fff;
  box-shadow: 0 0 12px rgba(227, 24, 55, 0.2);
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--mb-red);
}

.nav-icon {
  flex-shrink: 0;
}

/* ─── Topbar ─── */

#app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--mb-card);
  border-bottom: 1px solid var(--mb-border);
  padding: 12px 24px;
  margin-left: var(--sidebar-w);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--mb-text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-menu {
  display: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  color: var(--mb-text);
}

.user-tag {
  color: var(--mb-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ─── Notifications (comprobantes pendientes, c-15) ─── */

.notif {
  position: relative;
}

.notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 8px;
}

.notif-icon {
  display: block;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--mb-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 340px;
  max-width: 88vw;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--mb-card);
  border: 1px solid var(--mb-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 12px;
  z-index: 60;
}

.notif-vacio {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
  padding: 8px;
}

.notif-card + .notif-card {
  border-top: 1px solid var(--mb-border);
  margin-top: 10px;
  padding-top: 10px;
}

.notif-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.notif-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--mb-text-secondary);
  margin-top: 2px;
}

.notif-monto {
  font-weight: 700;
  color: var(--mb-text);
}

.notif-thumb-link {
  display: block;
  margin: 8px 0;
  text-decoration: none;
  line-height: 0;
}

.notif-thumb {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  border: 1px solid var(--mb-border);
  background: #f3f4f6;
}

.notif-error {
  margin: 0 0 6px;
}

.notif-card .acciones {
  justify-content: flex-end;
}

/* ─── Main Content ─── */

main,
#view {
  padding: 24px;
  max-width: 1100px;
  position: relative;
  z-index: 1;
}

body.logeado main,
body.logeado #view {
  margin-left: var(--sidebar-w);
}

/* c-20 D13: on the login route the body is exactly the viewport, so the
   document itself has nothing to scroll. A fixed 100vh (plus the 100dvh
   fallback) would otherwise leave the hidden overflow reachable and add
   browser-chrome rubber-banding; `100dvh` tracks the visible area.
   Scoped to body:not(.logeado) so the panel (a normal, scrolling document)
   is untouched. The .login escape for viewports shorter than 480px lives
   further down (@media (max-height: 480px)). */
body:not(.logeado) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body:not(.logeado) main,
body:not(.logeado) #view {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ─── Ambient Background ─── */

#ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(135deg, #f6f1fb 0%, #ece4f6 30%, #e6ddf2 55%, #f2ebf6 80%, #f6f1fb 100%);
  background-size: 300% 300%;
  animation: bgPan 18s ease-in-out infinite alternate;
}

@keyframes bgPan {
  0% { background-position: 0% 20%; }
  100% { background-position: 100% 80%; }
}

/* Orbs: orb element = parallax layer (JS transforms it), ::before = visible glow (CSS animates it).
   This composes reliably — no custom props inside keyframes. */
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  transform: translate(var(--px, 0px), var(--py, 0px));
}

.ambient-orb::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: blur(48px);
  will-change: transform;
}

.ambient-orb-1 {
  width: 540px;
  height: 540px;
  top: -200px;
  right: -140px;
}
.ambient-orb-1::before {
  background: radial-gradient(circle at 30% 30%, rgba(227, 24, 55, 0.55), rgba(227, 24, 55, 0.12) 55%, transparent 70%);
  animation: orbFloat1 14s ease-in-out infinite alternate;
}

.ambient-orb-2 {
  width: 480px;
  height: 480px;
  bottom: -180px;
  left: -160px;
}
.ambient-orb-2::before {
  background: radial-gradient(circle at 60% 40%, rgba(0, 61, 165, 0.50), rgba(0, 61, 165, 0.10) 55%, transparent 70%);
  animation: orbFloat2 18s ease-in-out infinite alternate;
}

.ambient-orb-3 {
  width: 400px;
  height: 400px;
  top: 28%;
  left: 55%;
}
.ambient-orb-3::before {
  background: radial-gradient(circle at 50% 50%, rgba(227, 24, 55, 0.28), rgba(0, 61, 165, 0.08) 60%, transparent 75%);
  animation: orbFloat3 22s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-70px, 60px) scale(1.1); }
}

@keyframes orbFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, -50px) scale(1.06); }
}

@keyframes orbFloat3 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-50px, -40px); }
}

.ambient-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(27, 27, 27, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 27, 27, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
}

/* ─── Cards ─── */

.card {
  background: var(--mb-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(227, 24, 55, 0.12), 0 2px 8px rgba(0,0,0,0.08);
  }
}

/* ─── Section Head ─── */

.seccion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.seccion-head h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* ─── Buttons ─── */

.btn {
  display: inline-block;
  border: 1px solid var(--mb-border);
  background: var(--mb-card);
  color: var(--mb-text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  background: #f3f4f6;
}

.btn:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .btn:hover {
    transform: scale(1.02);
  }
}

.btn-primary {
  background: var(--mb-red);
  border-color: var(--mb-red);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--mb-red-hover);
}

.btn-danger {
  color: var(--mb-red);
  border-color: #fecaca;
  background: transparent;
}

.btn-danger:hover {
  background: var(--error-bg);
}

.btn-ok {
  color: var(--e-pagado);
  border-color: #bbf7d0;
  background: transparent;
}

.btn-ok:hover {
  background: var(--ok-bg);
}

.btn-warn {
  color: var(--e-pendiente);
  border-color: #fde68a;
  background: transparent;
}

.btn-warn:hover {
  background: #fffbeb;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--mb-text-secondary);
}

.btn-ghost:hover {
  background: #f3f4f6;
}

.btn-small {
  padding: 4px 10px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

/* ─── Forms ─── */

.campo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.campo-fila {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.campo-fila .campo {
  flex: 1;
  min-width: 140px;
}

.campo label {
  font-size: 0.85rem;
  color: var(--mb-text-secondary);
  font-weight: 500;
}

.campo input,
.campo select {
  padding: 8px 12px;
  border: 1px solid var(--mb-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.campo input:focus,
.campo select:focus {
  outline: none;
  border-color: var(--mb-red);
  box-shadow: 0 0 0 3px rgba(227, 24, 55, 0.15);
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ─── Messages ─── */

.error,
.mensaje,
.ok,
#agenda-mensaje,
#servicios-mensaje,
#horarios-mensaje,
#pagos-mensaje {
  padding: 8px 12px;
  border-radius: 8px;
  margin: 8px 0;
  font-size: 0.9rem;
}

.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

/* ─── Tables ─── */

.tabla {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.tabla th,
.tabla td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--mb-border);
}

.tabla th {
  color: var(--mb-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tabla tbody tr:nth-child(even) {
  background: rgba(240, 235, 248, 0.4);
}

@media (hover: hover) {
  .tabla tbody tr:hover {
    background: rgba(240, 235, 248, 0.7);
  }
}

.tabla tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--mb-border);
  border-bottom: none;
}

.tabla-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

.tabla-scroll .tabla {
  min-width: 640px; /* pagos: 7 columnas → ancho mínimo cómodo */
}

.tabla-scroll.tabla-angosta .tabla {
  min-width: 480px; /* horarios: 4 columnas con inputs time */
}

.monto {
  text-align: right;
  font-weight: 600;
}

/* ─── Navigation Date ─── */

.navegador-fecha {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navegador-fecha input[type="date"] {
  padding: 6px 10px;
  border: 1px solid var(--mb-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.navegador-fecha input[type="date"]:focus {
  outline: none;
  border-color: var(--mb-red);
  box-shadow: 0 0 0 3px rgba(227, 24, 55, 0.15);
}

/* ─── Barbero Tabs ─── */

.barbero-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.barbero-tab {
  padding: 6px 14px;
  border: 1px solid var(--mb-border);
  border-radius: 999px;
  background: var(--mb-card);
  color: var(--mb-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.barbero-tab:hover {
  border-color: var(--mb-red);
  color: var(--mb-red);
}

.barbero-tab.activo {
  background: var(--mb-red);
  border-color: var(--mb-red);
  color: #fff;
}

.btn.activo {
  background: var(--mb-red);
  border-color: var(--mb-red);
  color: #fff;
}

/* ─── Modal ─── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 27, 27, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--mb-card);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  padding: 20px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-acciones {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ─── Notif badge pago en el local ─── */

.notif-badge-pago {
  padding: 2px 8px;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ─── Filters ─── */

.filtros {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.filtros .campo {
  margin-bottom: 0;
}

/* ─── Login ─── */

/* c-20 D13: the login route must not scroll the document.
   .login still centers its own card with flex (no position:fixed, no
   ancestor-transform trap), and #view gets full-viewport size when not logged
   in (body:not(.logeado) #view below), so the centering invariant holds.
   `overflow: hidden` here clips the 200% x 200% `::before` glow (top/left -50%)
   in place: without it, the pseudo-element's box escapes .login and, per CSS
   Overflow, its scrollable overflow propagates up to the document — that was
   the page-level scroll (measured 974x1874 against a 634x1249 viewport).
   Keep the 100vh fallback BEFORE 100dvh: without dvh support the old
   (buggy) 100vh behavior is what you get, and mobile browser chrome otherwise
   adds a few px of rubber-band even with the glow clipped. */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  /* Semi-transparent so the ambient background shows through */
  background: linear-gradient(135deg, rgba(27, 27, 27, 0.55) 0%, rgba(27, 27, 27, 0.35) 55%, rgba(227, 24, 55, 0.18) 100%);
}

.login::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(227, 24, 55, 0.10) 0%, transparent 50%);
  animation: loginGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes loginGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(20%, 10%); }
}

.login-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  position: relative;
}

/* c-20 D13 escape hatch for short viewports: `overflow: hidden` would hide
   the brand + password field + submit button on a laptop with the browser
   chrome taken into account (<=480px tall). Here the *login card* becomes the
   scroll container instead of the page, and the card stops being flex-centered
   (align-items: flex-start) so a short card is fully reachable. The
   body:not(.logeado) overflow:hidden from the Login section still holds, so
   the document itself still never scrolls. */
@media (max-height: 480px) {
  .login {
    overflow-y: auto;
    align-items: flex-start;
  }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-titulo {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--mb-text);
}

.login-card label {
  display: block;
  font-size: 0.85rem;
  color: var(--mb-text-secondary);
  margin: 10px 0 4px;
  text-align: left;
  font-weight: 500;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--mb-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--mb-red);
  box-shadow: 0 0 0 3px rgba(227, 24, 55, 0.15);
}

/* ─── Turnos ─── */

.turno {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-left: 6px solid var(--mb-border);
  padding-left: 16px;
}

.turno-hora {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 52px;
}

.turno-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 180px;
  gap: 2px;
}

/* ─── Status Pills ─── */

.estado {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.estado-pendiente {
  background: var(--e-pendiente);
  color: #fff;
}
.estado-confirmado {
  background: var(--e-confirmado);
  color: #fff;
}
.estado-señado {
  background: var(--e-senado);
  color: #fff;
}
.estado-pagado {
  background: var(--e-pagado);
  color: #fff;
}
.estado-a_pagar_total {
  background: var(--e-a_pagar_total);
  color: #fff;
}
.estado-esperando_barbero {
  background: var(--e-esperando_barbero);
  color: #fff;
}
.estado-pendiente_verificacion {
  background: var(--e-pendiente_verificacion);
  color: #fff;
}
.estado-terminado {
  background: var(--e-terminado);
  color: #fff;
}
.estado-completado {
  background: var(--e-completado);
  color: #fff;
}
.estado-cancelado {
  background: var(--e-cancelado);
  color: #fff;
}

.turno.estado-pendiente { border-left-color: var(--e-pendiente); }
.turno.estado-confirmado { border-left-color: var(--e-confirmado); }
.turno.estado-señado { border-left-color: var(--e-senado); }
.turno.estado-pagado { border-left-color: var(--e-pagado); }
.turno.estado-a_pagar_total { border-left-color: var(--e-a_pagar_total); }
.turno.estado-esperando_barbero { border-left-color: var(--e-esperando_barbero); }
.turno.estado-pendiente_verificacion { border-left-color: var(--e-pendiente_verificacion); }
.turno.estado-terminado { border-left-color: var(--e-terminado); }
.turno.estado-completado { border-left-color: var(--e-completado); }
.turno.estado-cancelado { border-left-color: var(--e-cancelado); }

/* ─── Servicios ─── */

.servicio {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.servicio-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 180px;
}

/* ─── Badges ─── */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-activo {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge-inactivo {
  background: #f3f4f6;
  color: var(--mb-text-secondary);
}

/* ─── Actions ─── */

.acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Stat Tiles ─── */

.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.tarjeta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tarjeta-numero {
  font-size: 2rem;
  font-weight: 700;
}

@keyframes countPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.tarjeta-numero {
  animation: countPulse 0.6s ease-out;
}

/* ─── Animations ─── */

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

.view-enter {
  animation: fadeInUp 0.4s ease-out backwards;
}

.view-enter .card,
.view-enter .tarjeta {
  animation: fadeInUp 0.4s ease-out backwards;
  animation-delay: calc(var(--i, 0) * 0.08s);
}

/* ─── Skeleton Loading ─── */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 60px;
}

.skeleton-row {
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}

/* ─── Sidebar Backdrop ─── */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

body.sidebar-open .sidebar-backdrop {
  display: block;
}

/* ─── Barber pole logo ─── */

.barber-pole {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.pole-cap {
  width: 28px;
  height: 4px;
  background: linear-gradient(180deg, #999 0%, #ddd 50%, #999 100%);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.pole-body {
  width: 20px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 10px rgba(227, 24, 55, 0.3), inset 0 0 4px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.1);
}

.pole-body::before {
  content: '';
  position: absolute;
  top: -34px;
  left: -4px;
  right: -4px;
  bottom: -34px;
  background: repeating-linear-gradient(
    45deg,
    #E31837 0px, #E31837 8px,
    #FFFFFF 8px, #FFFFFF 16px,
    #003DA5 16px, #003DA5 24px
  );
  animation: poleScroll 1.5s linear infinite;
}

@keyframes poleScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(34px); }
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
  #app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  body.sidebar-open #app-sidebar {
    transform: translateX(0);
  }

  #app-topbar {
    margin-left: 0;
  }

  .topbar-menu {
    display: flex;
  }

  body.logeado main,
  body.logeado #view {
    margin-left: 0;
    padding: 16px;
  }

  .navegador-fecha {
    width: 100%;
  }

  .navegador-fecha input[type="date"] {
    flex: 1;
  }

  .tarjetas {
    grid-template-columns: 1fr;
  }

  .notif-panel {
    right: 50%;
    transform: translateX(50%);
    width: min(340px, 92vw);
  }

  .tabla th,
  .tabla td {
    padding: 8px 10px;
  }
}

/* ─── Reduced Motion ─── */

@media (prefers-reduced-motion: reduce) {
  .view-enter,
  .view-enter .card,
  .view-enter .tarjeta {
    animation: none;
    opacity: 1;
  }

  .pole-body::before,
  .login::before {
    animation: none;
  }

  #ambient-bg,
  .ambient-orb {
    animation: none;
  }

  .skeleton,
  .skeleton-row {
    animation: none;
    opacity: 0.5;
  }

  .card,
  .btn {
    transition: none;
  }
}

/* ——— Tabs por barbero (Horarios) ——— */
.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border, #ddd);
  padding-bottom: 0.5rem;
}

.tab {
  border: 1px solid var(--border, #ddd);
  background: #f2f2f2;
  color: #333;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  background: #e6e6e6;
}

.tab.active {
  background: #6a2c9e;
  border-color: #6a2c9e;
  color: #fff;
  font-weight: 600;
}

.tabla-titulo {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: #4a154b;
}
