/* Oficina de Punteero: tablero con aspecto de videojuego. Mismo look que punteero.com (Manrope, Banky Sans, azul eléctrico). */
@font-face { font-family: "Manrope"; font-weight: 300 800; src: url("fonts/manrope-latin.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Manrope"; font-weight: 300 800; src: url("fonts/manrope-latin-ext.woff2") format("woff2"); font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF; }
@font-face { font-family: "Banky Sans"; font-weight: 400; src: url("fonts/banky-sans-latin.woff2") format("woff2"); font-display: swap; }
:root { --tinta: #00003C; --gris: #4A4A6B; --linea: #D4D8E3; --fondo: #F2F4F7; --alto: #E9ECF2; --papel: #fff; --azul: #1312F1; --azul-vivo: #3B3AFF; --turq: #00D4C6; --aviso: #FFB84D; --rojo: #FF4D5E; --radio: 4px; --radio-g: 10px; --display: "Banky Sans", "Manrope", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 15px/1.5 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--tinta); background: var(--fondo); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.03em; }

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr) 360px; height: 100vh; }
.lado { background: var(--tinta); color: #fff; padding: 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.marca { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 21px; letter-spacing: -0.03em; }
.marca img { width: 24px; height: 24px; } .marca span { color: #A6ABD2; }
.boton { border: 1px solid var(--linea); background: var(--papel); border-radius: 999px; padding: 9px 18px; font-weight: 600; font-size: 14px; cursor: pointer; }
.boton.principal { background: var(--azul); border-color: var(--azul); color: #fff; } .boton.principal:hover { background: var(--azul-vivo); }
.boton:focus-visible, .lista button:focus-visible, .vistas button:focus-visible, .enlace:focus-visible { outline: 2px solid var(--turq); outline-offset: 2px; }
.vistas { display: grid; gap: 2px; }
.vistas button, .lista button { text-align: left; border: 0; background: none; color: inherit; border-radius: var(--radio); padding: 8px 10px; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; }
.vistas button:hover, .lista button:hover { background: rgba(255,255,255,.07); }
.vistas button.activo, .lista button.activo { background: var(--azul); font-weight: 700; }
.vistas em { margin-left: auto; font-style: normal; font-weight: 800; background: var(--rojo); color: #fff; border-radius: 99px; min-width: 22px; text-align: center; padding: 0 6px; font-size: 13px; }
.vistas em:empty { display: none; }
.lado h3 { font-size: 13px; font-weight: 600; color: #A6ABD2; margin-top: 8px; }
.lista { display: grid; gap: 2px; }
.fila-depto { display: flex; align-items: center; gap: 10px; padding: 4px 10px; font-size: 14px; }
.lista .punto, .fila-depto .punto { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lista small, .fila-depto small { margin-left: auto; color: #A6ABD2; font-size: 13px; }
.cara { width: 30px; height: 30px; border-radius: 6px; flex: none; background: #fff; border: 3px solid var(--c, #999); display: grid; place-items: center; overflow: hidden; }
.cara img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cara.grande { width: 56px; height: 56px; border-width: 4px; border-radius: var(--radio-g); }
.lista span.n { display: grid; line-height: 1.25; min-width: 0; } .lista span.n i { font-style: normal; font-size: 13px; color: #A6ABD2; }
.lista button.activo span.n i { color: #D9DBFF; }
.s-trabajando { background: var(--turq); } .s-junta, .s-bloqueado, .s-apagado { background: var(--rojo); } .s-cola { background: var(--azul-vivo); box-shadow: 0 0 0 2px #fff; } .s-come { background: var(--aviso); } .s-duerme { background: #7C83B3; } .s-ausente { background: transparent; border: 1px dashed #A6ABD2; }
.motor { margin-top: auto; font-size: 13px; color: #A6ABD2; }

.centro { display: flex; flex-direction: column; min-width: 0; }
.saludo { padding: 20px 24px 12px; }
.saludo h1 { font-size: 34px; line-height: 1.05; }
.saludo p { color: var(--gris); margin-top: 6px; }
.alerta-pc { margin: 0 24px 12px; background: var(--rojo); color: #fff; font-weight: 700; padding: 12px 16px; border-radius: var(--radio-g); animation: late 1.4s ease-in-out infinite; }
@keyframes late { 50% { background: #C2283A; } }
.mapa { flex: 1; min-height: 0; margin: 0 24px 24px; border-radius: var(--radio-g); overflow: hidden; background: var(--tinta); position: relative; }
.mapa canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ayuda { position: absolute; left: 14px; bottom: 10px; color: #A6ABD2; font-size: 13px; pointer-events: none; }

.panel { background: var(--papel); border-left: 1px solid var(--linea); padding: 22px 20px; overflow-y: auto; }
.panel h2 { font-size: 26px; line-height: 1.1; } .panel h2.aparte { margin-top: 26px; font-size: 21px; }
.panel .sub { color: var(--gris); margin-top: 4px; }
.cabeza { display: flex; gap: 12px; align-items: center; }
.chip { display: inline-flex; align-items: center; border-radius: 99px; padding: 3px 12px; font-weight: 700; font-size: 13px; margin-top: 12px; background: var(--alto); }
.chip.junta, .chip.bloqueado, .chip.apagado { background: #FFE3E6; color: #B0182A; } .chip.trabajando { background: #D5F8F5; color: #00665F; } .chip.cola { background: #E1E1FF; color: var(--azul); } .chip.come { background: #FFF0D6; color: #8A5200; }
.enlace { border: 0; background: none; padding: 0; margin-left: 10px; color: var(--azul); text-decoration: underline; cursor: pointer; font-size: 13px; }
.dato { margin-top: 16px; } .dato b { display: block; font-size: 13px; color: var(--gris); font-weight: 700; margin-bottom: 3px; }
.dato p { white-space: pre-wrap; overflow-wrap: anywhere; }
.dato.espera p { background: #FFF0D6; border-radius: var(--radio-g); padding: 10px 12px; }
.dato.revisa p { background: #E1E1FF; border-radius: var(--radio-g); padding: 10px 12px; }
.dato a { color: var(--azul); }
.orden { margin-top: 18px; border-top: 1px solid var(--linea); padding-top: 16px; display: grid; gap: 8px; }
.orden textarea, dialog textarea, dialog select { width: 100%; border: 1px solid var(--linea); border-radius: var(--radio-g); padding: 10px 12px; background: #fff; resize: vertical; }
.orden textarea:focus, dialog textarea:focus, dialog select:focus, .acceso input:focus { outline: 2px solid var(--azul); outline-offset: 1px; }
.orden .fila, dialog .fila { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.orden input[type=file] { font-size: 13px; max-width: 100%; }
.tarjeta { border: 1px solid var(--linea); border-radius: var(--radio-g); padding: 12px; margin-top: 10px; cursor: pointer; background: #fff; width: 100%; text-align: left; display: block; }
.tarjeta:hover { border-color: var(--azul); }
.tarjeta b { font-weight: 800; } .tarjeta p { margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.tarjeta small { color: var(--gris); }
.tarjeta.fija { cursor: default; } .tarjeta.fija:hover { border-color: var(--linea); } .tarjeta.fija p { -webkit-line-clamp: 12; }
.puntos { margin: 0; padding: 10px 12px 10px 30px; background: #FFF0D6; border-radius: var(--radio-g); display: grid; gap: 10px; }
.puntos li { overflow-wrap: anywhere; } .boton.chico { display: block; margin-top: 6px; padding: 3px 12px; font-size: 13px; }
.vacio { color: var(--gris); margin-top: 14px; }

dialog { border: 0; border-radius: var(--radio-g); padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,60,.4); color: var(--tinta); }
dialog::backdrop { background: rgba(0,0,60,.55); }
dialog form { display: grid; gap: 12px; } dialog label { display: grid; gap: 5px; font-weight: 700; font-size: 14px; }
dialog label > * { font-weight: 400; } .nota { color: var(--gris); font-size: 13px; }
#aviso { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--tinta); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); z-index: 9; }
#aviso.visible { opacity: 1; transform: translate(-50%, 0); }

.acceso { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--tinta); }
.acceso form { background: var(--papel); border-radius: var(--radio-g); padding: 28px; width: min(360px, 100%); display: grid; gap: 12px; }
.acceso .marca { color: var(--tinta); } .acceso .marca span { color: var(--gris); }
.acceso label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.acceso input { border: 1px solid var(--linea); border-radius: var(--radio-g); padding: 11px 12px; width: 100%; }
.acceso .error { color: #B0182A; font-weight: 700; }

.mapa canvas { touch-action: none; }
.ir { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ir::-webkit-scrollbar { display: none; }
.ir button { flex: none; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; backdrop-filter: blur(6px); }
.ir button:hover, .ir button:active { background: var(--azul); }
.tarjeta { display: flex; gap: 10px; align-items: flex-start; } .tarjeta > span { min-width: 0; flex: 1; } .tarjeta.fija { display: block; }
.lista .punto { margin-left: auto; }

/* Celular y pantallas angostas: todo en vertical. Arriba la marca y el equipo en una tira, el mapa grande, la ficha debajo y las vistas en una barra fija abajo. */
@media (max-width: 900px) {
  html, body { height: auto; }
  .app { display: block; height: auto; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .lado { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; overflow: visible; position: sticky; top: 0; z-index: 5; }
  .lado h3, #deptos, .motor { display: none; }
  .lado .boton.principal { padding: 8px 14px; }
  #equipo { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
  #equipo::-webkit-scrollbar { display: none; }
  #equipo button { flex: none; width: auto; flex-direction: column; gap: 3px; padding: 4px 6px; position: relative; max-width: 74px; }
  #equipo .cara { width: 40px; height: 40px; }
  #equipo span.n { font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 64px; display: block; } #equipo span.n i { display: none; }
  #equipo .punto { position: absolute; top: 2px; right: 8px; margin: 0; width: 12px; height: 12px; border: 2px solid var(--tinta); }
  .vistas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--tinta); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.12); }
  .vistas button { justify-content: center; text-align: center; padding: 12px 4px; font-size: 13px; font-weight: 600; gap: 4px; min-height: 48px; }
  .vistas em { margin-left: 0; }
  .vistas span { font-size: 0; } .vistas span::after { content: attr(data-corto); font-size: 13px; }
  .saludo { padding: 12px 12px 8px; } .saludo h1 { font-size: 24px; } .saludo p { font-size: 14px; }
  .alerta-pc { margin: 0 12px 10px; font-size: 14px; }
  .mapa { height: min(62dvh, 560px); flex: none; margin: 0 8px 10px; }
  .ayuda { display: none; }
  .panel { border-left: 0; padding: 16px 14px 24px; overflow: visible; scroll-margin-top: 120px; }
  .panel h2 { font-size: 22px; }
  .boton, .orden textarea, dialog select, dialog textarea { font-size: 16px; } /* 16 px evita que el celular haga zoom al escribir */
  .boton.chico { font-size: 14px; padding: 6px 14px; }
  dialog { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
