/* Portal de administración de El Dorado (28/10/2026). Base: la hoja del panel de licencias 2.0
   (familia del tema «Arena OS» del juego). Solo oscuro. Sin fuentes externas: la CSP solo deja 'self'. */
:root {
  color-scheme: dark;
  --bg: #0c0f13;
  --bg-side: #10141a;
  --panel: #141920;
  --panel-2: #192029;
  --line: #232a33;
  --line-2: #2f3843;
  --text: #edf0f4;
  --muted: #8f99a7;
  --dim: #636d7a;
  --gold: #d9b66f;
  --gold-2: #ecd096;
  --gold-ink: #1c1608;
  --gold-soft: rgba(217, 182, 111, .1);
  --ok: #5fcb8e;
  --ok-soft: rgba(95, 203, 142, .1);
  --warn: #f0a24a;
  --warn-soft: rgba(240, 162, 74, .1);
  --bad: #ef7b6b;
  --bad-soft: rgba(239, 123, 107, .1);
  --info: #79aef0;
  --info-soft: rgba(121, 174, 240, .1);
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: var(--sans);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.cargando > * { visibility: hidden; }
[hidden] { display: none !important; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
code, .mono { font-family: var(--mono); }
code { font-size: .92em; color: var(--gold-2); background: var(--gold-soft); padding: 1px 6px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.02em; }
h2 { font-size: 16px; }
p { margin: 0; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: 10.5px; letter-spacing: .16em; font-weight: 600; color: var(--gold); margin-bottom: 6px; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 12px; }
.fine { font-size: 12px; color: var(--dim); line-height: 1.6; }
.center { display: flex; justify-content: center; padding-top: 14px; }
.link { font-size: 12.5px; font-weight: 500; }
svg.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; }

/* ---------- Controles ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--gold); margin: 0; cursor: pointer; }
input[type=datetime-local] { color-scheme: dark; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 9px; color: var(--text); font-size: 13px; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--gold); }
.btn:focus-visible, .chip:focus-visible, .nav a:focus-visible, .sort:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn-danger { color: var(--bad); border-color: rgba(239, 123, 107, .35); background: var(--bad-soft); }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; padding: 12px 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }
kbd { font-family: var(--mono); font-size: 11px; color: var(--dim); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; }
.form-error { color: var(--bad); font-size: 12.5px; min-height: 0; }
.form-error:empty { display: none; }

/* ---------- Etiquetas de estado ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { color: var(--ok); border-color: rgba(95, 203, 142, .3); background: var(--ok-soft); }
.tag.warn { color: var(--warn); border-color: rgba(240, 162, 74, .3); background: var(--warn-soft); }
.tag.bad { color: var(--bad); border-color: rgba(239, 123, 107, .3); background: var(--bad-soft); }
.tag.info { color: var(--info); border-color: rgba(121, 174, 240, .3); background: var(--info-soft); }
.tag.off { color: var(--muted); border-color: var(--line-2); background: transparent; }
.tag.gold { color: var(--gold-2); border-color: rgba(217, 182, 111, .35); background: var(--gold-soft); }
.tag.plain::before { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pill b { color: var(--text); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: latido 2.4s ease-in-out infinite; }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
@keyframes latido { 50% { box-shadow: 0 0 0 7px rgba(95, 203, 142, 0); } }
@media (prefers-reduced-motion: reduce) { .dot.ok { animation: none; } * { transition: none !important; } }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid !important; place-items: center; color: var(--gold); background: linear-gradient(160deg, #1f2630, #12171d); border: 1px solid #3a3326; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { font-weight: 700; font-size: 13px; letter-spacing: .2em; line-height: 1.2; display: block !important; }
.brand-text small { display: block; font-size: 9.5px; letter-spacing: .2em; color: var(--muted); font-weight: 500; margin-top: 3px; }
.brand-big .brand-mark { width: 48px; height: 48px; border-radius: 12px; }
.brand-big .brand-mark svg { width: 28px; height: 28px; }

/* ---------- Acceso ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.login-art { padding: 56px clamp(28px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; gap: 22px; border-right: 1px solid var(--line); background: radial-gradient(1200px 500px at -10% -20%, rgba(217, 182, 111, .12), transparent 60%), radial-gradient(800px 400px at 110% 120%, rgba(121, 174, 240, .06), transparent 60%), var(--bg-side); }
.login-art h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -.03em; margin-top: 28px; max-width: 14ch; }
.login-art > p { font-size: 15px; max-width: 46ch; line-height: 1.65; }
.login-points { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 14px; }
.login-points li { display: flex; gap: 12px; align-items: center; color: var(--text); font-size: 14px; }
.login-points li > span { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(217, 182, 111, .2); flex-shrink: 0; }
.login-box { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: min(400px, 100%); display: grid; gap: 16px; }
.login-form h2 { font-size: 22px; margin-bottom: 6px; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 26px 16px 20px; background: var(--bg-side); border-right: 1px solid var(--line); }
.side > .brand { padding: 0 8px; }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; border: 1px solid transparent; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--gold-2); background: var(--gold-soft); border-color: rgba(217, 182, 111, .22); }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 7px; min-width: 22px; text-align: center; }
.nav-count:empty { display: none; }
.nav-count.bad { color: #1b0c09; background: var(--bad); border-color: var(--bad); }
.nav-count.warn { color: #1d1206; background: var(--warn); border-color: var(--warn); }
.side-foot { margin-top: auto; display: grid; gap: 14px; padding: 0 8px; }
.side-foot small { color: var(--dim); font-size: 11px; }
.side-agent { display: grid; gap: 4px; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.side-agent strong { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 12.5px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 36px 18px; background: rgba(12, 15, 19, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .eyebrow { margin-bottom: 4px; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.server-pick select { width: auto; min-width: 180px; padding-top: 7px; padding-bottom: 7px; border-radius: 999px; }
main { padding: 26px 36px 48px; max-width: 1480px; width: 100%; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@keyframes entra { from { opacity: 0; transform: translateY(4px); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.card > h2 { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.view-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.stack .btn { justify-self: start; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Resumen ---------- */
.hero { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.hero-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.hero-icon svg { width: 24px; height: 24px; }
.hero-text { flex: 1; min-width: 0; }
.hero-text h2 { font-size: 18px; margin-bottom: 3px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero.ok { border-color: rgba(95, 203, 142, .25); background: linear-gradient(100deg, rgba(95, 203, 142, .08), var(--panel) 55%); }
.hero.ok .hero-icon { color: var(--ok); background: var(--ok-soft); }
.hero.warn { border-color: rgba(240, 162, 74, .3); background: linear-gradient(100deg, rgba(240, 162, 74, .1), var(--panel) 55%); }
.hero.warn .hero-icon { color: var(--warn); background: var(--warn-soft); }
.hero.bad { border-color: rgba(239, 123, 107, .35); background: linear-gradient(100deg, rgba(239, 123, 107, .12), var(--panel) 55%); }
.hero.bad .hero-icon { color: var(--bad); background: var(--bad-soft); }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: left; color: inherit; font: inherit; }
button.kpi { cursor: pointer; transition: border-color .15s; }
button.kpi:hover { border-color: var(--line-2); }
.kpi > span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi strong { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi strong small { font-size: 14px; color: var(--dim); font-weight: 500; margin-left: 3px; }
.kpi em { font-style: normal; font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn strong { color: var(--warn); }
.kpi.bad strong { color: var(--bad); }
.kpi.ok strong { color: var(--ok); }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 2px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.uptime svg { display: block; width: 100%; height: 48px; }
.uptime-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin: 6px 0 12px; }
.uptime-empty { padding: 16px 0; color: var(--dim); font-size: 13px; }
.uptime rect { fill: var(--line-2); transition: opacity .15s; }
.uptime rect.ok { fill: var(--ok); opacity: .8; }
.uptime rect.warn { fill: var(--warn); }
.uptime rect.bad { fill: var(--bad); }
.uptime rect.nodata { fill: var(--line); }
.uptime rect:hover { opacity: 1; }

/* Listas de sucesos (actividad y cambios) */
.feed { list-style: none; margin: 0; padding: 0; }
.feed > li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed > li:last-child { border-bottom: 0; }
.feed .ev-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: var(--panel-2); }
.feed .ev-icon svg { width: 14px; height: 14px; }
.feed .ev-icon.ok { color: var(--ok); background: var(--ok-soft); }
.feed .ev-icon.bad { color: var(--bad); background: var(--bad-soft); }
.feed .ev-icon.warn { color: var(--warn); background: var(--warn-soft); }
.feed .ev-icon.info { color: var(--info); background: var(--info-soft); }
.feed .ev-icon.gold { color: var(--gold); background: var(--gold-soft); }
.feed .ev-text { font-size: 13px; color: var(--text); overflow-wrap: anywhere; padding-top: 4px; }
.feed .ev-text small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.feed .ev-text b { font-family: var(--mono); font-weight: 500; font-size: 12.5px; color: var(--gold-2); }
.feed time { font-size: 11.5px; color: var(--dim); white-space: nowrap; padding-top: 5px; font-variant-numeric: tabular-nums; }
.feed .empty { display: block; color: var(--dim); font-size: 13px; padding: 14px 0; border: 0; }
.feed .day { display: block; padding: 18px 0 6px; border: 0; font-size: 11px; letter-spacing: .14em; color: var(--gold); font-weight: 600; text-transform: uppercase; }
.feed .day:first-child { padding-top: 0; }
.feed details summary { cursor: pointer; color: var(--text); list-style: none; }
.feed details summary::-webkit-details-marker { display: none; }
.feed details summary::after { content: " · ver"; color: var(--gold); font-size: 12px; }
.feed details[open] summary::after { content: " · ocultar"; }
.feed details p { white-space: pre-line; max-height: 260px; overflow: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.7; }

/* ---------- Recursos ---------- */
.alert { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid rgba(239, 123, 107, .35); background: linear-gradient(100deg, rgba(239, 123, 107, .1), var(--panel) 70%); }
.alert > span:first-child { color: var(--bad); }
.alert-text { flex: 1; min-width: 0; font-size: 13px; }
.alert-text strong { color: var(--text); }
.alert-text p { font-family: var(--mono); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 10px; }
.search { flex-direction: row; align-items: center; gap: 0; position: relative; flex: 1; max-width: 460px; min-width: 220px; color: var(--dim); }
.search > span:first-child { position: absolute; left: 12px; pointer-events: none; }
.search input { padding-left: 38px; padding-right: 40px; background: var(--panel); }
.search kbd { position: absolute; right: 10px; pointer-events: none; }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.chip.active { color: var(--gold-2); border-color: rgba(217, 182, 111, .45); background: var(--gold-soft); }
.chip.active b { color: var(--gold-2); }
.chip.bad b { color: var(--bad); }
.chip.warn b { color: var(--warn); }
.chips-sm .chip { font-size: 12px; padding: 4px 10px; }
.chips:empty { display: none; }
.bulk { position: sticky; top: 86px; z-index: 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius); background: #1d1a12; border: 1px solid rgba(217, 182, 111, .4); box-shadow: var(--shadow); }
.bulk strong { color: var(--gold-2); font-size: 13px; margin-right: 6px; }
.table-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding: 0 14px; height: 42px; background: #11161c; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .015); }
tbody tr.selected td { background: rgba(217, 182, 111, .05); }
tbody tr.sin-alta td:nth-child(2) { box-shadow: inset 3px 0 0 var(--bad); }
.col-check { width: 44px; padding-right: 0; }
.col-actions { width: 1%; text-align: right; }
.sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; }
.sort:hover { color: var(--text); }
.sort.asc::after { content: "↑"; color: var(--gold); }
.sort.desc::after { content: "↓"; color: var(--gold); }
.res-name { font-family: var(--mono); font-size: 13px; color: var(--text); }
.res-note { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; max-width: 44ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { white-space: nowrap; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.when.soon { color: var(--warn); }
.when.past { color: var(--bad); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.row-actions .btn { min-width: 92px; }
.table-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.table-empty td { padding: 36px 14px; text-align: center; color: var(--dim); }

/* ---------- Servidores ---------- */
.view-actions p { font-size: 13px; }
.server-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.server-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.server-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.server-title h2 { font-size: 18px; }
.server-title .tags { display: flex; gap: 6px; margin-left: auto; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0; }
.facts > div { padding: 12px 14px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.facts dt { font-size: 11.5px; color: var(--dim); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 6px; min-width: 0; font-variant-numeric: tabular-nums; }
.facts dd .mono { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfg { position: relative; }
.cfg pre { margin: 0; padding: 14px 16px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--muted); overflow-x: auto; }
.cfg pre .k { color: var(--info); }
.cfg pre .s { color: var(--gold-2); }
.cfg .icon-btn { position: absolute; top: 30px; right: 8px; }
.server-foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 16px; }
.server-foot .btn-left { margin-right: auto; }
.outages { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Seguridad ---------- */
.sessions { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sessions li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); }
.sessions li > span:first-child { color: var(--muted); }
.sessions .ses-text { flex: 1; min-width: 0; font-size: 13px; }
.sessions .ses-text small { display: block; color: var(--dim); font-size: 11.5px; }
.meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: -6px; }
.meter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s, background .2s; }
.mfa-setup { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; margin-top: 4px; }
#mfa-qr { background: #fff; border-radius: 10px; padding: 8px; width: 200px; height: auto; }
#mfa-state { margin-bottom: 14px; }

/* ---------- Diálogos ---------- */
dialog { padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); color: var(--text); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(4, 6, 9, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog[open] { animation: entra .18s ease; }
.modal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 24px; }
.modal h2 { font-size: 19px; margin-top: -4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.modal-foot .btn-left { margin-right: auto; }
.modal textarea.mono, .modal input.mono { font-size: 12.5px; }

/* ---------- Avisos flotantes ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: #1a2028; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 13px; animation: entra .2s ease; }
.toast > span:first-child { margin-top: 1px; }
.toast.ok > span:first-child { color: var(--ok); }
.toast.bad { border-color: rgba(239, 123, 107, .45); }
.toast.bad > span:first-child { color: var(--bad); }
.toast p { color: var(--text); flex: 1; }

/* ---------- Pantallas estrechas ---------- */
@media (max-width: 1320px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } .hide-md { display: none; } }
@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { border-right: 0; border-bottom: 1px solid var(--line); padding: 32px 16px; gap: 14px; }
  .login-art h1 { margin-top: 12px; font-size: 30px; }
  .login-points { display: none; }
  .login-box { padding: 28px 16px 40px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 6; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side > .brand { padding: 0; }
  .side .brand-text { display: none !important; }
  .side .brand-mark { width: 34px; height: 34px; }
  .nav { display: flex; overflow-x: auto; gap: 2px; scrollbar-width: none; flex: 1; min-width: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 8px 10px; white-space: nowrap; font-size: 13px; }
  .side-foot { display: none; }
  .top { position: static; padding: 18px 16px 14px; flex-wrap: wrap; }
  main { padding: 18px 16px 40px; }
  .bulk { top: 64px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi strong { font-size: 24px; }
  .hero { flex-wrap: wrap; }
  .hide-sm { display: none; }
  .nav a > span:first-child { display: none; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .search kbd { display: none; }
  .toolbar-right { width: 100%; }
  .toolbar-right .btn { flex: 1; }
  .row-2, .mfa-setup { grid-template-columns: minmax(0, 1fr); }
  .view-actions { flex-direction: column; align-items: stretch; }
  .card { padding: 16px; }
  td, th { padding-left: 10px; padding-right: 10px; }
  .row-actions .btn { min-width: 0; }
  .top-tools { width: 100%; flex-wrap: wrap; }
  .server-pick { flex: 1; min-width: 0; }
  .server-pick select { min-width: 0; width: 100%; }
  .pill-detail { display: none; }
  .card-head { flex-wrap: wrap; }
  .feed > li { grid-template-columns: 28px minmax(0, 1fr); }
  .feed time { grid-column: 2; padding-top: 0; }
}


/* ======================= Propio del portal ======================= */
.sub { font-size: 12px; color: var(--dim); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.mini-bars { display: grid; gap: 3px; width: 70px; }
.mini-bars i { display: block; height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.mini-bars i b { display: block; height: 100%; border-radius: 3px; }
.mini-bars .vida b { background: var(--ok); }
.mini-bars .chaleco b { background: var(--info); }
tbody tr.clic { cursor: pointer; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 6px; }

/* Ficha del jugador */
.ficha-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(217, 182, 111, .25); flex-shrink: 0; }
.ficha-head h2 { font-size: 22px; }
.ficha-head .sub { margin-top: 3px; }
.ficha-head .tags { margin-left: auto; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.acciones .grupo { display: flex; gap: 6px; flex-wrap: wrap; padding-right: 10px; margin-right: 2px; border-right: 1px solid var(--line); }
.acciones .grupo:last-child { border-right: 0; }
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.inv-item { position: relative; padding: 10px 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.inv-item strong { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-item small { display: block; font-size: 11.5px; color: var(--dim); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-item .cant { position: absolute; top: 8px; right: 10px; font-size: 12px; font-weight: 600; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.inv-item .icon-btn { position: absolute; bottom: 4px; right: 4px; width: 24px; height: 24px; opacity: 0; }
.inv-item:hover .icon-btn, .inv-item .icon-btn:focus-visible { opacity: 1; }
.vivo-at { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.lista-simple { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lista-simple li { padding: 10px 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.lista-simple li > div { flex: 1; min-width: 0; }
.lista-simple li small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.vacio { color: var(--dim); font-size: 13px; padding: 6px 0; }

/* Consola */
.consola { height: calc(100vh - 290px); min-height: 320px; overflow: auto; background: #07090c; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 0; font-family: var(--mono); font-size: 12px; line-height: 1.55; }
.consola div { padding: 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; color: #c9d1db; }
.consola div:hover { background: rgba(255, 255, 255, .03); }
.consola time { color: var(--dim); margin-right: 10px; }
.consola .err { color: var(--bad); }
.consola .warn { color: var(--warn); }
.consola .cfx { color: var(--muted); }

/* Registros */
.reg-row td { vertical-align: top; }
.reg-row .x { max-width: 520px; overflow-wrap: anywhere; color: var(--text); }
.flecha { color: var(--dim); margin: 0 4px; }

/* Formulario genérico de los diálogos */
.campos { display: grid; gap: 14px; }
.campos .row-2 { grid-template-columns: 1fr 1fr; }
.enlace { font-family: var(--mono); font-size: 12px; word-break: break-all; padding: 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); color: var(--gold-2); }
.centro-pantalla { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.centro-pantalla .card { width: min(520px, 100%); }
.mfa-box { display: grid; gap: 14px; }
.mfa-box img { background: #fff; border-radius: 10px; padding: 8px; width: 200px; justify-self: center; }
@media (max-width: 640px) { .acciones .grupo { border-right: 0; padding-right: 0; } .consola { height: 60vh; } .campos .row-2 { grid-template-columns: 1fr; } }
.ficha-head .sub { overflow-wrap: anywhere; }
.view[data-view="jugador"] .facts { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
