:root {
  --asfalto: #1C2226;
  --asfalto-2: #2A3237;
  --senal: #F2B705;
  --senal-2: #FFC928;
  --papel: #F6F5F1;
  --blanco: #FFFFFF;
  --texto: #1C2226;
  --texto-2: #565D63;
  --linea: #DAD7CE;
  --ok: #2D6A4F;
  --alerta: #B4471E;
  --info: #2F4A6E;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --wrap: 1120px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papel); color: var(--texto);
  font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.55;
}
a { color: var(--info); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--senal); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--texto-2); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* Marca */
.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.marca-icono { width: 30px; height: 30px; flex: none; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--r-sm);
  border: 1.5px solid transparent; font: inherit; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; background: var(--asfalto); color: var(--papel);
}
.btn:hover { background: var(--asfalto-2); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-senal { background: var(--senal); color: var(--asfalto); }
.btn-senal:hover { background: var(--senal-2); }
.btn-borde { background: transparent; color: var(--asfalto); border-color: var(--asfalto); }
.btn-borde:hover { background: var(--asfalto); color: var(--papel); }
.btn-chico { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-wa { background: #1F7A4D; color: #fff; }
.btn-wa:hover { background: #18663F; }
.btn-texto { background: none; border: 0; color: var(--info); padding: 0 4px; min-height: 36px; font-weight: 600; }
.btn-texto:hover { background: none; text-decoration: underline; }

/* Formularios */
label { font-size: 14px; font-weight: 600; display: grid; gap: 6px; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--texto); background: var(--blanco);
  border: 1.5px solid var(--linea); border-radius: var(--r-md); min-height: 46px; padding: 8px 12px; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--asfalto); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; min-height: 20px; height: 20px; margin-top: 2px; flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Tarjetas y avisos */
.tarjeta { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-lg); padding: 20px; }
.aviso { border-radius: var(--r-md); padding: 12px 14px; font-size: 15px; }
.aviso-error { background: #FBEDE7; color: #7A2E12; border: 1px solid #F0C8B8; }
.aviso-ok { background: #E7F3EC; color: #1D4D37; border: 1px solid #BFDCCB; }
.aviso-info { background: #EAF0F7; color: #233A57; border: 1px solid #C9D6E6; }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #ECEAE3; color: var(--texto); }
.chip-reservada { background: #EAF0F7; color: #233A57; }
.chip-confirmada { background: #FFF4CC; color: #6B4E00; }
.chip-atendida { background: #E7F3EC; color: #1D4D37; }
.chip-no_asistio, .chip-cancelada { background: #F4E4DD; color: #7A2E12; }

/* Tablas */
.tabla-caja { overflow-x: auto; border: 1px solid var(--linea); border-radius: var(--r-md); background: var(--blanco); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { font-size: 13px; color: var(--texto-2); font-weight: 700; background: #FAF9F6; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* Diálogos */
dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(28, 34, 38, .55); }
.dialogo { padding: 22px; display: grid; gap: 14px; }

/* Encabezado general */
.barra { background: var(--asfalto); color: var(--papel); }
.barra .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.barra a { color: var(--papel); }
.carril { height: 6px; background: repeating-linear-gradient(90deg, var(--senal) 0 36px, transparent 36px 64px); background-color: var(--asfalto); }
.banner-config { background: #FFF4CC; color: #4A3600; padding: 10px 16px; font-size: 14px; text-align: center; }
/* Las tablas anchas se desplazan dentro de su caja, no la página */
.stack > *, [data-panel], #v-panel { min-width: 0; }
.inp-num { min-width: 72px; }
td select { min-width: 130px; }

/* Logo del local */
.logo-local { flex: none; display: inline-grid; place-items: center; overflow: hidden; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-md); object-fit: contain; }
img.logo-local { padding: 4px; }
.logo-sm { width: 32px; height: 32px; border-radius: 6px; font-size: 13px; }
img.logo-sm { padding: 2px; }
.logo-md { width: 48px; height: 48px; font-size: 18px; }
.logo-lg { width: 72px; height: 72px; font-size: 26px; }
.logo-iniciales { background: var(--senal); border-color: var(--senal); color: var(--asfalto); font-weight: 800; letter-spacing: -0.02em; }
.local-cab { display: flex; gap: 14px; align-items: center; }
.res-local { display: flex; gap: 12px; align-items: flex-start; }
.logo-campo { display: flex; gap: 16px; align-items: center; padding: 12px; border: 1px dashed var(--linea); border-radius: var(--r-md); background: var(--papel); }
.archivo { position: relative; overflow: hidden; cursor: pointer; }
.archivo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.archivo:focus-within { outline: 3px solid var(--senal); outline-offset: 2px; }
#nombre-local { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
#nombre-local span:not(.logo-local) { max-width: 36vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-campo > [data-logo-vista] { flex: none; }
@media (max-width: 480px) { #nombre-local span:not(.logo-local) { display: none; } .logo-lg { width: 60px; height: 60px; font-size: 22px; } .logo-campo { align-items: flex-start; } }
