/* Pantallas de acceso y administración del Atlas en línea (mismos tokens que la app). */
:root {
  --bg: #f3f1ec; --panel: #fbfaf7; --ink: #1f2429; --muted: #6b747c; --line: #dcd8cf;
  --accent: #1f4e79; --accent-ink: #fff; --accent-soft: #e3ecf4;
  --warn-bg: #fbf3df; --warn-ink: #6b5313; --alert-bg: #fbe9e5; --alert-ink: #7a2618; --ok: #3f7f4f; --ok-bg: #e6f2e8;
  --shadow: 0 6px 24px rgba(20, 30, 40, .12); --field: #eaf1fb; --field-line: #cfdcec;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419; --panel: #161c22; --ink: #e9edf1; --muted: #98a4ae; --line: #2b343c;
    --accent: #7fb4e6; --accent-ink: #0f1419; --accent-soft: #1d3247;
    --warn-bg: #3a3017; --warn-ink: #f3dc9b; --alert-bg: #42211b; --alert-ink: #ffc2b5; --ok: #7ccf8f; --ok-bg: #1b3322;
    --shadow: 0 6px 24px rgba(0, 0, 0, .5); --field: #1b2530; --field-line: #2f3b47; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
h1, h2 { font-family: var(--serif); font-weight: 600; text-wrap: balance; margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 9px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 13px; font-weight: 500; }
.btn.danger { border-color: var(--alert-ink); background: transparent; color: var(--alert-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.msg { padding: 9px 12px; border-radius: 6px; font-size: 14px; }
.msg.err { background: var(--alert-bg); color: var(--alert-ink); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.muted { color: var(--muted); }

/* Acceso: la ilustración a pantalla completa; sólo «Entrar» y «Solicitar acceso» a la vista. Cada botón despliega
   su formulario en un panel sobre la imagen; × o Esc lo cierran. */
.gate { position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; background: #0d1117; }
.gate::before { content: ""; position: absolute; inset: -60px; background: url(/acceso-fondo.webp?v=2) center / cover; filter: blur(30px) brightness(.5); }
/* La ilustración se ve completa y un poco ampliada (6 %); el título y los botones van dentro de ella.
   Lo que sobra alrededor lo llena la copia desenfocada. */
.marco { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(106vw, calc(106vh * 1368 / 841)); aspect-ratio: 1368 / 841; }
.fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.titulo { position: absolute; z-index: 2; top: max(5%, 14px); left: 4.5%; margin: 0;
  line-height: 0; padding: 7px 12px; border-radius: 10px;
  background: rgba(10, 12, 16, .26); -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, .12); }
.titulo img { display: block; width: clamp(140px, 11vw, 190px); height: auto; opacity: .9; }
.logo-panel { display: block; width: 230px; max-width: 100%; height: auto; }
@media (prefers-color-scheme: dark) { .logo-panel { content: url(/logo-claro.svg); } }
.inicio { position: absolute; z-index: 2; left: 0; right: 0; bottom: 6%; display: flex; justify-content: center; }
.botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn.grande { min-width: 150px; padding: 9px 22px; font-size: 15px; border-radius: 999px; box-shadow: none; }
.btn.claro { background: rgba(251, 250, 247, .94); border-color: rgba(251, 250, 247, .94); color: #1f4e79; }
.velo { position: fixed; inset: 0; z-index: 3; background: rgba(8, 10, 14, .35); }
.card { position: fixed; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .45); padding: 22px; display: grid; gap: 14px; }
.brand { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand h2 { font-size: 21px; line-height: 1.15; }
.cerrar { flex: none; width: 32px; height: 32px; margin: -4px -6px 0 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.cerrar:hover { background: var(--bg); color: var(--ink); }
.cerrar svg { width: 16px; height: 16px; }
.card input, .card textarea { background: var(--field); border-color: var(--field-line); }
.ia { position: absolute; z-index: 2; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom, 0px)); margin: 0; padding: 0 16px; text-align: center;
  font-size: 11px; color: rgba(243, 241, 236, .82); text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
/* Teléfono: la imagen a todo lo ancho en el tercio superior y los botones debajo de ella. */
@media (max-aspect-ratio: 1/1) {
  .marco { width: 100vw; top: 24vh; transform: translateX(-50%); }
  .titulo { top: 6%; left: 4%; }
  .titulo img { width: 112px; }
  .inicio { bottom: auto; top: calc(100% + 28px); }
  .btn.grande { min-width: 140px; }
}
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 8px; }
.tabs button { flex: 1; white-space: nowrap; border: 0; background: transparent; padding: 7px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
form { display: grid; gap: 10px; }
.foot { margin: 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.credito { margin: -6px 0 0; font-size: 12px; color: var(--muted); }

/* Administración */
.admin { max-width: 1100px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 20px; }
.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; }
.top h1 { font-size: 24px; }
.top nav { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stats button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: 14px; }
.stats button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.stats b { margin-left: 4px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 12px; min-width: 0; }
.panel h2 { font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td .sub { display: block; font-size: 12px; color: var(--muted); }
.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.tag.activo { background: var(--ok-bg); color: var(--ok); }
.tag.pendiente { background: var(--warn-bg); color: var(--warn-ink); }
.tag.suspendido, .tag.vencido { background: var(--alert-bg); color: var(--alert-ink); }
.tag.admin { background: var(--accent-soft); color: var(--accent); }
.confirm { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
