:root {
  --bg: #000;
  --side: #0a0a0b;
  --card: #0d0d0e;
  --card2: #121214;
  --line: #1d1d20;
  --line2: #26262a;
  --text: #ededef;
  --muted: #8a8a92;
  --dim: #5c5c63;
  --accent: #0F6DEA;
  --accent2: #4D94F2;
  --green: #23a55a;
  --icon: #b5bac1;
  --red: #ed4245;
  --yellow: #f0b232;
  --radius: 14px;
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 8px; }

/* Layout */
.app { display: grid; grid-template-columns: 290px 1fr; height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 16px; font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #4D94F2); display: grid; place-items: center; }
.brand .logo svg { width: 19px; height: 19px; stroke: #fff; }
.switcher { margin: 0 12px 10px; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; background: #0e0e10; position: relative; cursor: pointer; }
.switcher:hover { border-color: #34343a; }
.gicon { width: 38px; height: 38px; border-radius: 50%; background: #1a1a1e; display: grid; place-items: center; font-size: 13px; font-weight: 700; overflow: hidden; flex: none; border: 1px solid var(--line2); }
.gicon img { width: 100%; height: 100%; object-fit: cover; }
.switcher .meta { min-width: 0; flex: 1; }
.switcher .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher .sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.switcher .sub::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #111114; border: 1px solid var(--line2); border-radius: 12px; padding: 6px; z-index: 20; box-shadow: 0 20px 40px rgba(0,0,0,.6); }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.menu a:hover { background: #1a1a1e; }
.menu .gicon { width: 28px; height: 28px; font-size: 11px; }
.nav { overflow-y: auto; padding: 4px 10px 16px; flex: 1; }
.nav h6 { margin: 18px 12px 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: #cfcfd4; font-weight: 500; }
.nav a:hover { background: #141416; color: var(--text); }
.nav a.on { background: #18181b; color: var(--text); }
.nav a .n { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; }
.badge { margin-left: auto; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #1d1d21; color: #d8d8dc; }
.badge.prem { background: rgba(240,178,50,.12); color: var(--yellow); }
.userbox { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.userbox img { width: 36px; height: 36px; border-radius: 50%; }
.userbox .meta { flex: 1; min-width: 0; }
.userbox .name { font-weight: 600; }
.userbox .sub { font-size: 13px; color: var(--muted); }
.iconbtn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.iconbtn:hover { background: #1a1a1e; color: var(--text); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: 64px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; flex: none; }
.top .title { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 17px; }
.top .title svg { color: var(--muted); }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.saved { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.saved.busy { color: var(--yellow); }
.saved.err { color: var(--red); }
.search { position: relative; }
.search input { width: 260px; background: #0e0e10; border: 1px solid var(--line2); border-radius: 10px; padding: 9px 60px 9px 38px; outline: none; }
.search input:focus { border-color: #3a3a42; }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.results { position: absolute; right: 0; top: calc(100% + 6px); width: 380px; background: #111114; border: 1px solid var(--line2); border-radius: 12px; padding: 6px; z-index: 30; max-height: 420px; overflow: auto; box-shadow: 0 20px 40px rgba(0,0,0,.6); }
.results a { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; align-items: center; }
.results a:hover, .results a.hl { background: #1a1a1e; }
.results small { color: var(--muted); margin-left: auto; font-size: 12px; }

.content { overflow-y: auto; flex: 1; }
.page { max-width: 1660px; margin: 0 auto; padding: 14px 48px 80px; }
.page.narrow { max-width: 1320px; }
.head { display: flex; align-items: flex-end; gap: 20px; padding: 34px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.head h1 { margin: 0; font-size: 40px; letter-spacing: -.02em; font-weight: 700; }
.head p { margin: 10px 0 0; color: var(--muted); font-size: 17px; max-width: 760px; line-height: 1.5; }
.head .actions { margin-left: auto; display: flex; gap: 10px; }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); background: #0e0e10; padding: 9px 16px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #3a3a42; background: #141417; }
.btn.white { background: #f2f2f4; color: #0b0b0c; border-color: #f2f2f4; }
.btn.white:hover { background: #fff; }
.btn.danger { color: #ff8a8c; }
.btn.sm { padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Avisos */
.notice { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line2); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; background: var(--card); font-weight: 600; }
.notice svg { color: var(--muted); }
.notice .btn { margin-left: auto; }
.notice.warn { border-color: rgba(240,178,50,.35); }
.notice.warn svg { color: var(--yellow); }

/* Overview */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 52px; margin-top: 34px; }
.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.sec-title h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.sec-title a { font-weight: 600; font-size: 15px; }
.sec-title a:hover { color: var(--accent2); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.list > * { border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.catrow { display: grid; grid-template-columns: 220px 1fr 70px 20px; align-items: center; gap: 20px; padding: 19px 22px; font-weight: 600; font-size: 17px; }
.catrow:hover { background: #111113; }
.bar { height: 6px; border-radius: 6px; background: #1a1a1d; overflow: hidden; }
.bar i { display: block; height: 100%; background: #f2f2f4; border-radius: 6px; min-width: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; color: var(--muted); font-size: 14px; font-weight: 400; text-align: right; }
.chev { color: var(--dim); }
.quick h5 { margin: 0 0 10px; font-size: 15px; color: var(--muted); font-weight: 500; }
.quick .card { margin-bottom: 30px; }
.qrow { display: flex; align-items: center; gap: 14px; padding: 15px 18px; font-weight: 600; font-size: 16px; }
.qrow:hover { background: #111113; }
.qrow .ico { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line2); display: grid; place-items: center; color: var(--muted); background: #0f0f11; }
.qrow .ico svg { width: 17px; height: 17px; }
.qrow .st { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.qrow .st.on { color: var(--text); font-weight: 600; }
.qrow .st.on::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.act { display: flex; align-items: center; gap: 12px; padding: 16px 22px; }
.act .when { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.act .emo { width: 30px; text-align: center; font-size: 17px; }
.empty { padding: 24px 26px; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; }
.empty::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text); }
.empty span { color: var(--muted); font-weight: 400; }

/* Páginas de protecciones */
.split { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 30px; }
.filterbox { position: relative; margin-bottom: 16px; }
.filterbox input { width: 100%; background: #0e0e10; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px 12px 42px; outline: none; }
.filterbox svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cats a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; color: #d4d4d8; font-weight: 500; font-size: 16px; }
.cats a:hover { background: #121214; }
.cats a.on { background: #18181b; color: var(--text); font-weight: 600; }
.cats a .n { margin-left: auto; }
.cats .emo { width: 22px; text-align: center; }
.progress { margin-top: 16px; padding: 18px 20px; }
.progress .row1 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; color: #d4d4d8; }
.progress b { font-size: 20px; color: var(--text); }
.progress b small { color: var(--muted); font-weight: 400; }
.tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; padding: 3px; background: #0b0b0c; }
.seg button { background: none; border: 0; padding: 6px 13px; border-radius: 8px; color: var(--muted); font-weight: 600; display: flex; gap: 7px; align-items: center; }
.seg button small { font-weight: 400; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.seg button.on { background: #18181b; color: var(--text); }
.group { margin-bottom: 22px; }
.group-h { display: flex; align-items: center; gap: 14px; padding: 18px 26px; }
.group-h h3 { margin: 0; font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.group-h h3 .vbar { color: #6d6f78; font-weight: 400; }
.group-h h3 svg.i { width: 20px; height: 20px; }
.group-h .emo { font-size: 19px; }
.group-h .btn { margin-left: auto; }
.frow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 20px; align-items: center; padding: 18px 26px; cursor: pointer; border-top: 1px solid var(--line); }
.frow:hover { background: #101012; }
.frow .dot { width: 7px; height: 7px; border-radius: 50%; background: #2c2c31; }
.frow .dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(59,165,93,.15); }
.frow .t { font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.frow .d { color: var(--muted); margin-top: 4px; font-size: 15px; }
.frow .chev { transition: transform .15s; }
.frow.open .chev { transform: rotate(90deg); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 7px; background: #1b1b1f; border: 1px solid var(--line2); }
.pill.prem { color: var(--yellow); border-color: rgba(240,178,50,.3); background: rgba(240,178,50,.08); }

/* Interruptor */
.sw { width: 42px; height: 24px; border-radius: 24px; background: #4e5058; border: 0; position: relative; padding: 0; transition: background .15s; flex: none; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #b5bac1; transition: left .15s; }
.sw.on { background: var(--accent); }
.sw.on::after { background: #fff; }
.sw.on::after { left: 21px; }
.sw:disabled { opacity: .4; cursor: not-allowed; }

/* Editor */
.editor { padding: 6px 26px 24px 58px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px 26px; cursor: default; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.field.wide { grid-column: 1 / -1; }
.inp, select.inp, textarea.inp { width: 100%; background: #0a0a0b; border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; outline: none; }
.inp:focus { border-color: #3d3d46; }
textarea.inp { min-height: 96px; resize: vertical; line-height: 1.45; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.boolf { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; border: 1px solid var(--line2); border-radius: 10px; padding: 7px; min-height: 44px; background: #0a0a0b; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: #18181c; border: 1px solid var(--line2); border-radius: 8px; padding: 4px 6px 4px 9px; font-size: 14px; }
.chip img { width: 18px; height: 18px; border-radius: 50%; }
.chip .rc { width: 9px; height: 9px; border-radius: 50%; }
.chip button { background: none; border: 0; color: var(--muted); padding: 0 2px; font-size: 15px; line-height: 1; }
.chip button:hover { color: var(--text); }
.chips select, .chips input { background: transparent; border: 0; outline: none; color: var(--muted); padding: 4px; min-width: 150px; flex: 1; }
.chips select option { background: #111; color: var(--text); }
.hint { font-size: 13px; color: var(--dim); margin-top: 6px; }
.ehead { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }

/* Tablas */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 14px 20px; border-bottom: 1px solid var(--line); }
td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 26px; height: 26px; border-radius: 50%; }
.who small { color: var(--muted); display: block; font-size: 12px; }

.panelbox { padding: 26px 28px; margin-bottom: 22px; }
.panelbox h3 { margin: 0 0 4px; font-size: 20px; }
.panelbox > p { color: var(--muted); margin: 0 0 20px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 24px; align-items: end; }
.plan { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.plan .card { padding: 26px 28px; }
.plan h3 { margin: 0 0 6px; font-size: 22px; display: flex; gap: 10px; align-items: center; }
.plan ul { margin: 16px 0 0; padding: 0; list-style: none; }
.plan li { padding: 8px 0; border-bottom: 1px solid var(--line); color: #d0d0d5; display: flex; justify-content: space-between; gap: 10px; }
.plan li span { color: var(--muted); }
.plan li:last-child { border: 0; }
.cur { outline: 1px solid var(--accent); }
.preview { grid-column: 1 / -1; background: #313338; border-radius: 10px; padding: 14px 16px; }
.preview .msg { border-left: 4px solid var(--accent); background: #2b2d31; border-radius: 6px; padding: 12px 14px; color: #dbdee1; white-space: pre-wrap; line-height: 1.4; }
.preview .msg h2 { font-size: 20px; margin: 0 0 6px; color: #fff; }
.preview .msg h3 { font-size: 17px; margin: 0 0 6px; color: #fff; }
.preview small { display: block; color: #949ba4; margin-bottom: 8px; font-size: 12px; }
.mention { background: rgba(88,101,242,.3); color: #c9cdfb; padding: 0 3px; border-radius: 3px; }
.toast { position: fixed; bottom: 24px; right: 24px; background: #17171a; border: 1px solid var(--line2); padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: 420px; box-shadow: 0 20px 40px rgba(0,0,0,.6); }
.toast.err { border-color: rgba(237,66,69,.5); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; z-index: 60; }
.modal { background: #0f0f11; border: 1px solid var(--line2); border-radius: 16px; padding: 26px 28px; max-width: 560px; line-height: 1.6; }
.modal h3 { margin-top: 0; }
.loading { display: grid; place-items: center; height: 60vh; color: var(--muted); }
@media (max-width: 1200px) { .grid2, .split, .plan { grid-template-columns: 1fr; } .page { padding: 14px 24px 60px; } }

/* Iconos de línea grises (estilo Discord) */
svg.i.o { color: var(--icon); stroke-width: 2; }
.frow .fic { display: flex; color: var(--icon); }
.frow .fic svg.i { width: 22px; height: 22px; }
.cats .emo, .act .emo { display: flex; justify-content: center; }
.cfgbtn { color: #dbdee1; }
.cfgbtn:hover { border-color: #3a3a40; background: #151518; }
.cfgbtn svg.i { width: 16px; height: 16px; }
.frow.open .cfgbtn { background: #1b1b1f; border-color: #3a3a40; }
.tic { display: inline-flex; align-items: center; gap: 8px; }
.pill svg.i { width: 13px; height: 13px; color: var(--yellow); }
.ldot { width: 8px; height: 8px; border-radius: 50%; background: #4e5058; flex: none; }
.ldot.on { background: var(--green); }
.sw.fixed { cursor: default; opacity: .75; }

/* Páginas nuevas: chequeo de salud, tickets, edición en bloque */
.scanlist { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
.scanlist li { margin: 4px 0; }
.scanlist code, .act code { font-size: 12px; opacity: .8; }
.plan .card p.big { font-size: 28px; font-weight: 700; margin: 6px 0 0; }
.plan .card p.big small { font-size: 13px; font-weight: 500; opacity: .6; }
.plan.stats4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 14px; }
.plan.stats4 .card { padding: 18px 20px; }
.plan.stats4 h3 { font-size: 14px; color: var(--muted); }
.bulk { margin-bottom: 14px; }
.bulk .form { align-items: end; }
