/* CHATARRA · panel de administración (admin.mlmc.lat). Mismo aire que el juego: chapa, cinta de peligro, rótulos Dymo. */
:root { --bg: #121315; --plate: #2d3136; --plate2: #23262a; --line: #0d0e10; --text: #e9ecef; --muted: #9aa2ab; --gold: #f0b400; --gold2: #ffcf4d;
  --red: #d3271f; --green: #5fd068; --blue: #4aa8ff; --rad: 5px; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { background: radial-gradient(120% 60% at 50% -10%, rgba(240, 180, 0, .08), rgba(0, 0, 0, 0) 60%), repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 1px, rgba(0, 0, 0, 0) 1px 4px), var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, .dymo, .kpi b, .nav button, .btn { font-family: Oswald, "Arial Narrow", "Roboto Condensed", Impact, sans-serif; }
.boot { display: grid; place-items: center; min-height: 100vh; font: 700 42px/1 Oswald, Impact, sans-serif; letter-spacing: .12em; color: var(--gold); }

/* chapa */
.plate { position: relative; padding: 20px 18px 16px; border-radius: var(--rad); border: 2px solid var(--line);
  background: radial-gradient(circle at 11px 11px, #c9ced4 0 1.4px, #6f757c 2.4px, rgba(0, 0, 0, 0) 4px),
    radial-gradient(circle at calc(100% - 11px) 11px, #c9ced4 0 1.4px, #6f757c 2.4px, rgba(0, 0, 0, 0) 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .02) 0 1px, rgba(0, 0, 0, 0) 1px 3px), linear-gradient(180deg, #3a3f45, var(--plate) 40%, var(--plate2));
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .1); }
.plate + .plate { margin-top: 14px; }
.plate h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: .08em; text-transform: uppercase; }
.plate h3 { margin: 16px 0 8px; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold2); }
.hazard { height: 10px; background: repeating-linear-gradient(-45deg, var(--gold) 0 10px, #18191b 10px 20px); }
.dymo { display: inline-block; padding: 5px 13px 4px; background: linear-gradient(180deg, #d3271f, #a9150f); color: #fff; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; clip-path: polygon(0 0, 100% 0, 98% 50%, 100% 100%, 0 100%, 2% 50%); transform: rotate(-1.2deg); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }

/* formularios */
label.f { display: block; margin: 0 0 12px; }
label.f > span { display: block; margin: 0 0 5px; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: #e2c25a; }
label.f > small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=email], input[type=number], input[type=datetime-local], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 4px; border: 2px solid var(--line); background: #17191c; outline: none;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, .55); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 4px; border: 2px solid var(--line);
  background: linear-gradient(180deg, #ffd65a, #e9a800); color: #1a1406; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  box-shadow: 0 3px 0 #7a5800, 0 6px 12px rgba(0, 0, 0, .35); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a5800; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.dark { background: linear-gradient(180deg, #4a5058, #31353a); color: var(--text); box-shadow: 0 3px 0 #15171a, 0 6px 12px rgba(0, 0, 0, .35); }
.btn.red { background: linear-gradient(180deg, #e8473e, #b3201a); color: #fff; box-shadow: 0 3px 0 #5e0d0a, 0 6px 12px rgba(0, 0, 0, .35); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; }
.sw { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw i { position: relative; width: 52px; height: 28px; border-radius: 14px; background: #17191c; border: 2px solid var(--line); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6); transition: background .15s; }
.sw i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(180deg, #d9dde2, #8d949c); transition: transform .15s; }
.sw input:checked + i { background: #2f6f35; }
.sw input:checked + i::after { transform: translateX(24px); }
.sw input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.rng { display: flex; align-items: center; gap: 12px; }
.rng input[type=range] { flex: 1; accent-color: var(--gold); }
.rng output { min-width: 58px; text-align: right; font: 700 18px/1 Oswald, Impact, sans-serif; color: var(--gold2); }
.def { font-size: 12px; color: var(--muted); }
.dirty { color: var(--gold2) !important; }

/* entrada */
.login { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.login .plate { width: min(100%, 400px); padding-top: 28px; }
.login .hazard { position: absolute; left: 0; right: 0; top: 0; border-radius: 3px 3px 0 0; }
.login .dymo { font-size: 20px; margin: 4px auto 14px; display: table; }
.code8 { width: 100%; padding: 12px; text-align: center; font: 700 30px/1 ui-monospace, Consolas, monospace !important; letter-spacing: .32em;
  background: linear-gradient(180deg, #fbfaf4, #e2ded2) !important; color: #141518 !important; border: 2px solid #16171a !important; border-radius: 6px !important; }
.err { min-height: 20px; margin: 4px 0 8px; color: #ffab8f; font-size: 13.5px; text-align: center; }
.brand { font: 700 34px/1 Oswald, Impact, sans-serif; letter-spacing: .1em; color: var(--gold); text-align: center; }
.brand small { display: block; margin-top: 6px; font-size: 12px; letter-spacing: .3em; color: var(--muted); }

/* armazón */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #0c0d0f; border-bottom: 2px solid #000; }
.top .brand { font-size: 22px; text-align: left; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2s ease-in-out infinite; }
.live.off i { background: #777; box-shadow: none; animation: none; }
@keyframes blink { 50% { opacity: .35; } }
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 54px); }
.nav { padding: 14px 10px; background: #0f1012; border-right: 2px solid #000; }
.nav button { display: flex; align-items: center; gap: 9px; width: 100%; margin: 0 0 4px; padding: 10px 12px; border: 0; border-radius: 4px; background: none; color: var(--muted);
  font-size: 15px; letter-spacing: .08em; text-transform: uppercase; text-align: left; cursor: pointer; }
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav button.on { color: #1a1406; background: linear-gradient(180deg, #ffd65a, #e9a800); }
.nav button em { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 6px; border-radius: 9px; background: var(--red); color: #fff; }
.main { padding: 18px; min-width: 0; }
.main > h1 { margin: 0 0 14px; font-size: 26px; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: flex; overflow-x: auto; gap: 4px; padding: 8px; border-right: 0; border-bottom: 2px solid #000; position: sticky; top: 54px; z-index: 4; }
  .nav button { width: auto; flex: none; margin: 0; padding: 8px 11px; font-size: 13px; }
  .main { padding: 12px; }
  .top .who { display: none; }
}

/* números */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 14px 14px 12px; border-radius: var(--rad); border: 2px solid var(--line); background: linear-gradient(180deg, #33373d, #26292d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.kpi small { display: block; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kpi b { display: block; margin-top: 6px; font-size: 32px; line-height: 1; color: #fff; }
.kpi span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.kpi.hot b { color: var(--green); }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 10px 4px 0; border-bottom: 2px solid #000; }
.chart > div { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; min-width: 4px; }
.chart > div > i { display: block; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, #ffd65a, #e9a800); min-height: 1px; }
.chart > div > i.b { background: linear-gradient(180deg, #7fd8e8, #2f8ea0); margin-top: 1px; }
.chart > div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 4px 8px; border-radius: 4px;
  background: #000; color: #fff; font-size: 12px; z-index: 2; }
.axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; background: var(--gold); vertical-align: -1px; }
.legend i.b { background: #4fb8cc; }
.hbar { display: grid; grid-template-columns: 90px 1fr 46px; align-items: center; gap: 10px; margin: 0 0 7px; font-size: 13.5px; }
.hbar > div { height: 14px; border-radius: 3px; background: #17191c; overflow: hidden; }
.hbar > div > i { display: block; height: 100%; background: linear-gradient(90deg, #e9a800, #ffd65a); }
.hbar b { text-align: right; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.cols > .plate { margin: 0 !important; }

/* tablas */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { padding: 8px; text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid #000; }
.tbl td { padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: top; }
.tbl tr:hover td { background: rgba(255, 255, 255, .03); }
.scroll { overflow-x: auto; }
.heat { text-align: center; font-weight: 700; border-radius: 3px; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: #3b4046; color: #e9ecef; }
.tag.alta, .tag.panel_entrada { background: #2f6f35; } .tag.entrada { background: #2f5d8a; } .tag.baja, .tag.error_juego, .tag.error_servidor, .tag.correo_fallo { background: #a9150f; }
.tag.admin { background: #8a6a00; } .tag.codigo_mal, .tag.panel_fallo, .tag.limite, .tag.conflicto, .tag.registro_cerrado { background: #8a4a00; }
.ev { display: grid; grid-template-columns: 112px 130px 1fr; gap: 10px; padding: 7px 4px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 13.5px; }
.ev time { color: var(--muted); font-variant-numeric: tabular-nums; }
.ev .who { color: #7fd8e8; overflow-wrap: anywhere; }
@media (max-width: 760px) { .ev { grid-template-columns: 1fr; gap: 2px; } }

/* calendario */
.cal-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; margin: 0 0 8px; border-radius: 4px; background: #1b1d20; border: 2px solid var(--line); }
.cal-item .d { min-width: 64px; text-align: center; font: 700 15px/1.1 Oswald, Impact, sans-serif; color: var(--gold2); }
.cal-item .d small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .1em; }

/* vista previa del mantenimiento */
.prev { position: relative; overflow: hidden; min-height: 210px; border-radius: 6px; border: 2px solid #000; display: grid; place-items: center; padding: 18px;
  background: radial-gradient(80% 60% at 50% 0%, rgba(255, 150, 40, .25), rgba(0, 0, 0, 0) 70%), linear-gradient(180deg, #3a2a1c, #16100c); }
.prev::before, .prev::after { content: 'CERRADO · MANTENIMIENTO · CERRADO · MANTENIMIENTO · CERRADO · MANTENIMIENTO'; position: absolute; left: -10%; right: -10%; padding: 4px 0;
  white-space: nowrap; overflow: hidden; font: 700 12px/1 Oswald, Impact, sans-serif; letter-spacing: .2em; color: #111; background: var(--gold); text-align: center; }
.prev::before { top: 22%; transform: rotate(-7deg); }
.prev::after { bottom: 18%; transform: rotate(5deg); }
.prev .plate { position: relative; z-index: 1; max-width: 320px; text-align: center; }

#toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 11px 14px; border-radius: 4px; background: #0c0d0f; border: 2px solid var(--gold); box-shadow: 0 10px 24px rgba(0, 0, 0, .5); animation: tin .25s ease-out; }
.toast.bad { border-color: var(--red); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
