/* Daiky Sport · sistema de diseño compartido.
   Se duplica igual en zapia/api/public/theme.css (cada servicio sirve sus
   propios archivos estáticos) — si se edita acá, replicar el cambio allá.
   Paleta extraída del logo (azul, negro y dorado del perrito). */

:root {
  /* marca — azul del logo */
  --brand-50: #eaf2fb;
  --brand-100: #d2e3f7;
  --brand-200: #a3c7ef;
  --brand-500: #1565c0;
  --brand-600: #0050a0;
  --brand-700: #003d7a;
  --brand-900: #001f3f;

  /* negro del logo, para el sidebar */
  --ink-700: #1c1c1c;
  --ink-800: #121212;
  --ink-900: #000000;

  /* dorado del logo, acento secundario */
  --accent-50: #fdf6ec;
  --accent-100: #f8e7c9;
  --accent-500: #d89c54;
  --accent-600: #c07f36;
  --accent-700: #9c6526;

  /* neutros */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* semántico */
  --ok-bg: #dcfce7; --ok-text: #15803d; --ok-dot: #16a34a;
  --warn-bg: #fef3c7; --warn-text: #92400e; --warn-dot: #d97706;
  --danger-bg: #fee2e2; --danger-text: #b91c1c; --danger-dot: #dc2626;
  --info-bg: #d2e3f7; --info-text: #003d7a; --info-dot: #0050a0;

  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 20px -6px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, .18);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;

  --sidebar-w: 236px;
}

/* Siempre tema claro. Había un "modo oscuro" a medias que, con el
   celular en modo oscuro, volvía casi blancas las letras grises mientras
   las tarjetas, botones y campos seguían con fondo blanco fijo: letra
   blanca sobre blanco, ilegible. "only light" además le dice a Chrome /
   Samsung Internet que no oscurezcan la página por su cuenta. */
:root { color-scheme: only light; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
a { color: var(--brand-600); }
::selection { background: var(--brand-200); }

/* ---------- shell: sidebar + contenido ---------- */

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--brand-600);
  background-image: linear-gradient(180deg, var(--brand-500), var(--brand-900));
  border-right: 1px solid rgba(0, 0, 0, .25);
  color: #eaf1fa;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 14px; padding: 0 6px 28px; }
.brand-mark {
  width: 72px; height: 72px; border-radius: 18px;
  background: #000;
  border: 1px solid rgba(0, 120, 220, .45);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 700; font-size: 20px; color: #fff; letter-spacing: -.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: #c9dbee; text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav a svg { flex-shrink: 0; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.activo { background: rgba(255,255,255,.14); color: #fff; }

.sidebar-foot { margin-top: auto; padding-top: 14px; }

.user-card {
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius-md);
  padding: 11px;
}
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.user-meta { min-width: 0; flex: 1; }
.user-meta .quien {
  display: block; color: #fff; font-weight: 600; font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rol-pill {
  display: inline-block; margin-top: 4px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px;
  border-radius: 999px; background: rgba(255,255,255,.13); color: #dce9f8;
}
.user-card .links { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); display: flex; gap: 4px; }
.user-card .links a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 4px; border-radius: var(--radius-sm);
  color: #c9dbee; font-size: 11.5px; font-weight: 500; text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.user-card .links a svg { opacity: .85; flex-shrink: 0; }
.user-card .links a:hover { background: rgba(255,255,255,.1); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-header { padding: 28px 36px 0; }
.page-header h1 { font-size: 21px; color: var(--gray-900); }
.page-header .sub { color: var(--gray-500); margin: 5px 0 0; font-size: 13.5px; max-width: 640px; }
.page-body { padding: 20px 36px 40px; flex: 1; min-width: 0; }

/* layout sin sidebar (login) */
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 20% 15%, var(--brand-100), var(--gray-50) 55%); }

/* ---------- componentes ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease, transform .05s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: #fff; color: var(--gray-700); border-color: var(--gray-200); }
.btn-ghost:hover { border-color: var(--gray-300); background: var(--gray-50); }
.btn-danger-ghost { background: #fff; color: var(--gray-600); border-color: var(--gray-200); }
.btn-danger-ghost:hover { border-color: var(--danger-dot); color: var(--danger-text); background: var(--danger-bg); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--gray-900);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100);
}
.input::placeholder { color: var(--gray-400); }

.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-neutral { background: var(--gray-100); color: var(--gray-600); }

.section-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin: 34px 0 4px; }
.section-sub { color: var(--gray-500); font-size: 13px; margin: 0 0 14px; }

.empty-box {
  border: 1px dashed var(--gray-300); border-radius: var(--radius-md);
  padding: 32px 20px; text-align: center; color: var(--gray-500); font-size: 13.5px; background: #fff;
}

table.table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.table th, table.table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--gray-200); }
table.table th { background: var(--gray-50); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); font-weight: 700; }
table.table tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: var(--gray-50); }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* utilitarios chicos */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; }
.muted { color: var(--gray-500); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- menú móvil (cajón) ---------- */
/* Checkbox oculto que abre/cierra el sidebar como cajón lateral en
   pantallas chicas — sin JS, funciona siempre. #navToggle tiene que ir
   ANTES de .sidebar y de .nav-backdrop en el HTML (selector ~). */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.mobile-topbar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 760px) {
  .app-shell { display: block; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    height: 56px; padding: 0 14px;
    background: var(--brand-600);
    background-image: linear-gradient(135deg, var(--brand-500), var(--brand-900));
    position: sticky; top: 0; z-index: 40;
    box-shadow: var(--shadow-sm);
  }
  .mobile-topbar .brand-mini { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .mobile-topbar .brand-mini img { width: 32px; height: 32px; border-radius: 8px; background: #000; flex-shrink: 0; border: 1px solid rgba(0,120,220,.45); }
  .mobile-topbar .brand-mini span { color: #fff; font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-toggle-label {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  }
  .nav-toggle-label:active { background: rgba(255,255,255,.22); }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    width: 82%; max-width: 300px; flex: none;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 60;
  }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }

  .nav-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 55; opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .nav-toggle:checked ~ .nav-backdrop { opacity: 1; pointer-events: auto; }

  .page-header, .page-body { padding-left: 18px; padding-right: 18px; }
}

/* ---------- componentes del rediseño (28/10/2026) ---------- */

/* Pestañas: una página, varias secciones sin hacer scroll eterno. */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--gray-200); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  appearance: none; border: none; background: none; font: inherit; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 14px; margin-bottom: -1px; font-size: 13.5px; font-weight: 600; color: var(--gray-500);
  border-bottom: 2px solid transparent; transition: color .12s ease, border-color .12s ease;
}
.tabs button:hover { color: var(--gray-800); }
.tabs button.activo { color: var(--brand-600); border-bottom-color: var(--brand-600); }
.tabs .cuenta { background: var(--gray-100); color: var(--gray-600); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.tabs button.activo .cuenta { background: var(--brand-50); color: var(--brand-600); }
.tab-panel[hidden] { display: none !important; }

/* Contadores que además filtran (Pedidos). --tile-c = color del estado. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile {
  appearance: none; font: inherit; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--gray-200); border-top: 3px solid var(--tile-c, var(--gray-300));
  border-radius: var(--radius-md); padding: 11px 14px 12px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 3px; transition: box-shadow .12s ease, transform .12s ease;
}
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tile b { font-size: 24px; font-weight: 800; line-height: 1.05; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; font-weight: 600; color: var(--gray-500); }
.tile.activo { outline: 2px solid var(--tile-c, var(--brand-600)); outline-offset: -1px; }
.tile.urgente b { color: var(--tile-c); }

/* Interruptor (on/off) — el estado se ve en el interruptor, no en el texto del botón. */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .pista { position: absolute; inset: 0; border-radius: 999px; background: var(--gray-300); transition: background .15s ease; }
.switch .pista::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .15s ease;
}
.switch input:checked + .pista { background: var(--ok-dot); }
.switch input:checked + .pista::after { transform: translateX(20px); }
.switch input:focus-visible + .pista { box-shadow: 0 0 0 3px var(--brand-200); }
.switch input:disabled { cursor: progress; }

.control-card { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; }
.control-card .titulo { font-weight: 700; font-size: 14px; color: var(--gray-900); display: flex; align-items: center; gap: 8px; }
.control-card .detalle { font-size: 12.5px; color: var(--gray-500); margin-top: 3px; line-height: 1.45; }

/* Punto de estado (líneas conectadas, etc.) */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--gray-400); }
.dot.ok { background: var(--ok-dot); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.warn { background: var(--warn-dot); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot.danger { background: var(--danger-dot); box-shadow: 0 0 0 3px var(--danger-bg); }

.page-header.con-acciones { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

/* Cargando: bloques grises en vez de "Cargando…" */
.skeleton { background: linear-gradient(90deg, var(--gray-100), var(--gray-200), var(--gray-100)); background-size: 200% 100%; animation: brillo 1.2s ease-in-out infinite; border-radius: var(--radius-md); }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

@media (max-width: 760px) {
  /* Dedos, no mouse: nada que se toque por debajo de ~40px. */
  .btn { min-height: 40px; }
  .tabs button { padding: 12px 12px; }
  .tile b { font-size: 21px; }
}
