/* HostPanel · sistema de diseño. Tokens arriba, componentes abajo. Tema claro y oscuro (automático o elegido con el botón). */
:root {
  --bg: #f4f5f9; --surface: #ffffff; --surface-2: #f8f9fc;
  --text: #171c2c; --muted: #6a7389; --faint: #98a0b3; --line: #e5e8f0; --line-strong: #d3d8e4;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: #eceafd; --accent-text: #ffffff; --ring: rgba(79, 70, 229, .28);
  --ok: #12805c; --ok-bg: #e3f6ee; --warn: #9a5b00; --warn-bg: #fff2d6; --bad: #c0332b; --bad-bg: #fdeae8; --info: #1d6fb8; --info-bg: #e5f1fb;
  --code: #eef0f6; --side: #12162a; --side-2: #1b2040; --side-text: #aab1cc; --side-on: #ffffff;
  --shadow-sm: 0 1px 2px rgba(23, 28, 44, .06); --shadow: 0 1px 3px rgba(23, 28, 44, .06), 0 8px 24px -12px rgba(23, 28, 44, .14); --shadow-lg: 0 24px 60px -20px rgba(23, 28, 44, .35);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f1c; --surface: #141a2e; --surface-2: #19203a; --text: #e8ebf5; --muted: #98a1ba; --faint: #6b7592; --line: #252d4a; --line-strong: #323c5f;
    --accent: #8b87ff; --accent-hover: #a29fff; --accent-soft: #23264d; --accent-text: #0c0f1c; --ring: rgba(139, 135, 255, .35);
    --ok: #55d6a0; --ok-bg: #11302a; --warn: #f2c36b; --warn-bg: #352a0f; --bad: #ff8d84; --bad-bg: #3b1a1d; --info: #6db6f2; --info-bg: #132a40;
    --code: #1d2542; --side: #0a0d19; --side-2: #151a30; --side-text: #8d96b4;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 12px 28px -14px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0f1c; --surface: #141a2e; --surface-2: #19203a; --text: #e8ebf5; --muted: #98a1ba; --faint: #6b7592; --line: #252d4a; --line-strong: #323c5f;
  --accent: #8b87ff; --accent-hover: #a29fff; --accent-soft: #23264d; --accent-text: #0c0f1c; --ring: rgba(139, 135, 255, .35);
  --ok: #55d6a0; --ok-bg: #11302a; --warn: #f2c36b; --warn-bg: #352a0f; --bad: #ff8d84; --bad-bg: #3b1a1d; --info: #6db6f2; --info-bg: #132a40;
  --code: #1d2542; --side: #0a0d19; --side-2: #151a30; --side-text: #8d96b4;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 12px 28px -14px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); display: flex; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { color: var(--accent-hover); }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--code); padding: .12em .42em; border-radius: 6px; } .break { word-break: break-all; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0; letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: 1rem; margin: 0 0 .9rem; font-weight: 650; display: flex; align-items: center; letter-spacing: -.005em; }
h3 { font-size: .78rem; margin: 1.1rem 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .nowrap { white-space: nowrap; } .spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--ring); }

/* ---------- estructura ---------- */
.side { width: 252px; background: var(--side); color: var(--side-text); padding: 1.1rem .85rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; overflow-y: auto; z-index: 30; }
.side .brand { display: flex; align-items: center; gap: .65rem; color: var(--side-on); font-weight: 750; font-size: 1.1rem; letter-spacing: -.01em; padding: .35rem .55rem 1.2rem; }
.side .brand:hover { color: var(--side-on); }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #6d63ff, #3b82f6); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .8); flex: none; }
.logo .i { margin: 0; width: 19px; height: 19px; }
.side nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.nav-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: .9rem .75rem .35rem; font-weight: 650; }
.side nav a { color: var(--side-text); padding: .55rem .75rem; border-radius: 10px; display: flex; align-items: center; gap: .7rem; font-weight: 500; transition: background .15s, color .15s; }
.side nav a .i { margin: 0; width: 1.15rem; height: 1.15rem; opacity: .8; }
.side nav a:hover { background: var(--side-2); color: var(--side-on); }
.side nav a.on { background: linear-gradient(90deg, rgba(109, 99, 255, .28), rgba(109, 99, 255, .1)); color: var(--side-on); box-shadow: inset 2px 0 0 #8b87ff; }
.side nav a.on .i { opacity: 1; color: #b3b0ff; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .07); margin-top: .8rem; padding-top: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.who { display: flex; align-items: center; gap: .65rem; padding: 0 .35rem; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #7c74ff, #38bdf8); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; text-transform: uppercase; }
.who-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; } .who-t b { color: var(--side-on); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who-t span { font-size: .76rem; color: var(--faint); }
.side-actions { display: flex; gap: .4rem; } .side-actions form { flex: 1; margin: 0; }
.side-btn { width: 100%; background: transparent; border: 1px solid rgba(255, 255, 255, .1); color: var(--side-text); border-radius: 9px; padding: .45rem .5rem; font-size: .83rem; display: flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; box-shadow: none; font-weight: 500; }
.side-btn:hover { background: var(--side-2); color: var(--side-on); }
.side-btn .i { margin: 0; }

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: .8rem; padding: .7rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 750; } .topbar .logo { width: 30px; height: 30px; }
.icon-btn { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; box-shadow: none; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); } .icon-btn .i { margin: 0; width: 1.2rem; height: 1.2rem; }
main { flex: 1; padding: 2rem 2.4rem 4rem; min-width: 0; width: 100%; max-width: 1280px; margin: 0 auto; }
.scrim { display: none; }
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; } body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 10, 22, .55); z-index: 25; backdrop-filter: blur(2px); }
  .topbar { display: flex; } main { padding: 1.2rem 1rem 3rem; }
}

/* ---------- cabecera de página ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head .sub { color: var(--muted); margin: .3rem 0 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .85rem; margin-bottom: .55rem; } .crumb:hover { color: var(--accent); } .crumb .i { margin: 0; width: 1em; height: 1em; }
.site-title { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; }
.site-ico { width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; } .site-ico .i { margin: 0; width: 22px; height: 22px; }
.meta { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .75rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: .15rem .7rem; font-size: .8rem; color: var(--muted); } .chip .i { margin: 0; width: .95em; height: .95em; }
.head { margin-bottom: 1.1rem; }

/* ---------- tarjetas ---------- */
section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem 1.4rem; margin: 0 0 1.2rem; box-shadow: var(--shadow-sm); }
section > h2 .i { color: var(--accent); width: 1.15em; height: 1.15em; margin-right: .5em; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.2rem; } .two > section { margin-bottom: 0; } @media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.2rem; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.05rem 1.15rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.card .k { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.card .v { font-size: 1.95rem; font-weight: 720; letter-spacing: -.02em; line-height: 1.2; margin-top: .2rem; } .card .s { color: var(--muted); font-size: .82rem; }
.stat-ico { position: absolute; right: .95rem; top: .95rem; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; } .stat-ico .i { margin: 0; }
.meter { height: 7px; border-radius: 99px; background: var(--code); overflow: hidden; margin-top: .55rem; } .meter > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s; }
.meter.warn > i { background: #e5a21a; } .meter.bad > i { background: var(--bad); }

/* ---------- tablas ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 650; font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
th:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
th, td { padding: .7rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; } th { border-bottom: 0; }
tbody tr:hover > td, table > tr:hover > td { background: var(--surface-2); } tr:last-child > td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; } .actions form { margin: 0; }
td.actions { display: table-cell; text-align: right; white-space: nowrap; } td.actions > * { display: inline-flex; vertical-align: middle; margin: 0 0 0 .35rem; } td.actions > form { display: inline-block; } td.actions > :first-child { margin-left: 0; }
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--muted); } .empty .i { width: 2.4rem; height: 2.4rem; margin: 0 auto .6rem; display: block; color: var(--faint); } .empty b { display: block; color: var(--text); margin-bottom: .2rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .6rem; border-radius: 99px; font-size: .76rem; font-weight: 650; line-height: 1.5; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.tag { display: inline-block; background: var(--code); border-radius: 6px; padding: .05rem .5rem; font-size: .8rem; font-weight: 550; }

/* ---------- pestañas ---------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin: 0 0 1.4rem; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: .7rem 1rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; font-weight: 500; border-radius: 8px 8px 0 0; }
.tabs a .i { margin: 0; width: 1.05rem; height: 1.05rem; } .tabs a:hover { color: var(--text); background: var(--surface-2); } .tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 650; }

/* ---------- formularios ---------- */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .85rem; font-weight: 550; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; margin-top: .35rem; font-weight: 400; }
label.inline { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-size: .92rem; font-weight: 450; cursor: pointer; margin-bottom: .5rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: .55rem .75rem; width: 100%; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); padding: 0; flex: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2.1rem; }
textarea { font-family: var(--mono); font-size: .88rem; line-height: 1.5; resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .2rem 1.2rem; align-items: end; } .grid .wide { grid-column: 1 / -1; } .end { grid-column: 1 / -1; text-align: right; margin-top: .3rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 .8rem; padding: .8rem 1rem .4rem; background: var(--surface-2); } legend { color: var(--muted); font-size: .8rem; padding: 0 .5rem; font-weight: 650; }
fieldset label.inline { margin-right: 1.4rem; }

/* ---------- botones ---------- */
button, .btn { font: inherit; font-weight: 600; font-size: .9rem; background: var(--accent); color: var(--accent-text); border: 1px solid transparent; border-radius: 10px; padding: .55rem 1.05rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-align: center; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); line-height: 1.3; }
button:hover, .btn:hover { background: var(--accent-hover); color: var(--accent-text); text-decoration: none; } button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); border-color: var(--faint); color: var(--text); }
button.bad { background: var(--bad); color: #fff; box-shadow: none; } button.bad:hover { background: #a82a23; color: #fff; }
button.link { background: none; color: var(--accent); padding: 0; border: 0; box-shadow: none; font-weight: 550; } button.link:hover { background: none; text-decoration: underline; color: var(--accent-hover); } button.link.bad { color: var(--bad); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.loading { position: relative; color: transparent !important; pointer-events: none; } button.loading .i { opacity: 0; } button.loading::after { content: ""; position: absolute; width: 1.05em; height: 1.05em; border: 2px solid var(--accent-text); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
button.secondary.loading::after { border-color: var(--accent); border-right-color: transparent; } @keyframes spin { to { transform: rotate(1turn); } }
.inlineform { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.danger { border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-bg); border-radius: var(--r); padding: 1rem 1.2rem; } .danger h2 { color: var(--bad); } .danger h2 .i { color: var(--bad); } .danger input { max-width: 22rem; margin-bottom: .6rem; background: var(--surface); }
.stack { display: flex; flex-direction: column; gap: .5rem; margin: .5rem 0; }
details { border: 1px solid var(--line); border-radius: 10px; padding: .1rem .9rem; background: var(--surface-2); margin: .6rem 0; } details > summary { cursor: pointer; color: var(--text); font-weight: 600; padding: .6rem 0; list-style: none; display: flex; align-items: center; gap: .4rem; } details > summary::-webkit-details-marker { display: none; } details > summary::before { content: "›"; font-size: 1.2rem; line-height: 1; color: var(--muted); transition: transform .15s; } details[open] > summary::before { transform: rotate(90deg); } details[open] { padding-bottom: .6rem; }

/* ---------- avisos y toasts ---------- */
.note { padding: .8rem 1.05rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid var(--line); }
.note.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); } .note.err { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); } .note.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.note.secret { background: var(--surface); color: var(--text); border: 1px solid var(--warn); box-shadow: var(--shadow); } .note.secret dl { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem .8rem; margin: .7rem 0 0; } .note.secret dt { color: var(--muted); } .note.secret dd { margin: 0; }
.toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; display: flex; flex-direction: column; gap: .6rem; z-index: 100; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: .8rem 1rem; box-shadow: var(--shadow-lg); display: flex; gap: .7rem; align-items: flex-start; animation: toast-in .25s ease; transition: opacity .25s, transform .25s; }
.toast.ok { border-left-color: var(--ok); } .toast.ok > .i { color: var(--ok); } .toast.err { border-left-color: var(--bad); } .toast.err > .i { color: var(--bad); }
.toast > .i { margin: .15rem 0 0; flex: none; } .toast span { flex: 1; } .toast button { background: none; border: 0; padding: 0; color: var(--muted); box-shadow: none; width: 1.4rem; height: 1.4rem; } .toast button:hover { background: none; color: var(--text); } .toast button .i { margin: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } } .toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- inicio de sesión ---------- */
body.auth { display: block; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at 10% -10%, #5b50ff 0%, transparent 60%), radial-gradient(900px 600px at 100% 100%, #0ea5e9 0%, transparent 55%), #0d1126; color: #fff; padding: 3rem; display: grid; place-items: center; order: 2; }
.hero-in { width: min(30rem, 100%); }
.auth-hero h2 { font-size: 2rem; line-height: 1.2; margin: 0 0 1rem; display: block; letter-spacing: -.02em; max-width: 22ch; } .auth-hero p { color: rgba(255, 255, 255, .75); max-width: 44ch; }
.auth-feats { display: grid; gap: 1.1rem; margin-top: 2rem; } .auth-feats div { display: flex; gap: .8rem; align-items: flex-start; color: rgba(255, 255, 255, .8); } .auth-feats .i { margin: .2rem 0 0; color: #a5b4fc; width: 1.2rem; height: 1.2rem; } .auth-feats b { color: #fff; display: block; }
.auth-form { display: grid; place-items: center; padding: 2rem; order: 1; }
.login { width: min(400px, 100%); } .login .logo { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 1.4rem; } .login .logo .i { width: 26px; height: 26px; }
.login h1 { font-size: 1.7rem; margin-bottom: .3rem; } .login .sub { color: var(--muted); margin-bottom: 1.6rem; } .login button[type=submit] { width: 100%; padding: .7rem; margin-top: .4rem; font-size: .95rem; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }

pre.log { background: #0d1126; color: #d7dcf0; border-radius: 10px; padding: 1rem 1.1rem; overflow: auto; max-height: 62vh; font-size: .8rem; line-height: 1.55; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--line); }

/* ---------- gestor de archivos ---------- */
.fm-bar { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.fm-bar.sel { background: var(--accent-soft); padding: .55rem .8rem; border-radius: 10px; justify-content: flex-start; }
.fm-actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; } .fm-bar.tools { align-items: flex-start; padding: .6rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
#selbar { padding-left: .6rem; margin-left: .2rem; border-left: 1px solid var(--line-strong); }
.fm-actions button, .fm-actions .btn { padding: .42rem .8rem; font-size: .84rem; }
.search { width: 16rem; max-width: 100%; }
.crumbs { display: flex; gap: .1rem; flex-wrap: wrap; font-family: var(--mono); font-size: .88rem; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .3rem .5rem; }
.crumbs a { padding: .15rem .45rem; border-radius: 6px; cursor: pointer; color: var(--text); } .crumbs a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.drop { border-radius: 12px; transition: background .15s; } .drop.over { outline: 2px dashed var(--accent); outline-offset: 4px; background: var(--accent-soft); }
#tbl td.name a { cursor: pointer; font-weight: 550; color: var(--text); } #tbl td.name a:hover { color: var(--accent); }
#tbl .ico { margin-right: .35rem; } #tbl td.name .i { width: 1.25em; height: 1.25em; margin-right: .55em; vertical-align: -.28em; color: var(--muted); } #tbl td.name .ico { display: inline-block; } #tbl td.name .ico .i { color: var(--accent); }
#tbl td { padding-top: .45rem; padding-bottom: .45rem; }
.row-btn { background: transparent; color: var(--muted); border: 0; box-shadow: none; width: 32px; height: 32px; padding: 0; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; }
.row-btn:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; } .row-btn .i { margin: 0; width: 1.05rem; height: 1.05rem; }
dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 0; width: min(900px, 94vw); box-shadow: var(--shadow-lg); } dialog::backdrop { background: rgba(8, 10, 22, .55); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s ease; } @keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.askform { padding: 1.4rem 1.5rem; min-width: min(440px, 90vw); } .askform h3 { margin: 0 0 1rem; font-size: 1.1rem; color: var(--text); text-transform: none; letter-spacing: 0; } .askform .end { margin-top: 1rem; display: flex; gap: .5rem; justify-content: flex-end; }
dialog.editor { width: min(1180px, 96vw); overflow: hidden; } .ed-head { display: flex; gap: .7rem; align-items: center; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--surface-2); }
#ed-ace { width: 100%; height: 66vh; } .ed-foot { display: flex; gap: .3rem; padding: .45rem 1.1rem; border-top: 1px solid var(--line); background: var(--surface-2); }
#clipinfo { margin: -.2rem 0 .8rem; } [hidden] { display: none !important; }
.i { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.2em; margin-right: .4em; }
button .i, .btn .i { margin-right: .5em; } .icon-btn .i, .side-btn .i { margin-right: 0; }
.i.protected { color: var(--warn); margin-left: .4em; margin-right: 0; }

/* ---------- modales ---------- */
dialog.modal { width: min(560px, 94vw); max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); background: var(--surface-2); } .modal-head h3 { margin: 0 0 .25rem; font-size: 1.05rem; color: var(--text); text-transform: none; letter-spacing: 0; }
.modal-body { padding: 1.2rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-sec { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; } .modal-sec h4 { margin: 0 0 .6rem; font-size: .92rem; display: flex; align-items: center; } .modal-sec h4 .i { color: var(--accent); }
.modal-sec p { margin-bottom: .6rem; } .modal-sec.danger { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); } .modal-sec.danger h4, .modal-sec.danger h4 .i { color: var(--bad); }
.modal-sec .row input { margin: 0; }
input[type=file] { padding: .4rem .5rem; } input[type=file]::file-selector-button { font: inherit; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px; padding: .3rem .7rem; margin-right: .7rem; color: var(--text); cursor: pointer; }

/* ---------- zona de peligro y opciones ---------- */
section.zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); } section.zone > h2, section.zone > h2 .i { color: var(--bad); }
.zone-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); } .zone-row:first-of-type { border-top: 0; padding-top: .2rem; } .zone-row p { margin: .15rem 0 0; } .zone-row form { margin: 0; flex: none; }
@media (max-width: 600px) { .zone-row { flex-direction: column; align-items: flex-start; } }
.opt-list { display: flex; flex-direction: column; gap: .6rem; }
.opt { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; cursor: pointer; color: var(--text); font-weight: 400; margin: 0; background: var(--surface-2); } .opt:hover { border-color: var(--faint); }
.opt input { margin-top: .2rem; } .opt b { display: block; font-weight: 600; font-size: .92rem; } .opt small { display: block; color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rules { display: flex; flex-direction: column; gap: .3rem; min-width: 16rem; } .rules div { font-size: .82rem; line-height: 1.35; } .rules code { margin-right: .35rem; }
td.detail { max-width: 26rem; word-break: break-word; color: var(--muted); }
td.url { max-width: 24rem; } td.url code { word-break: break-all; white-space: normal; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.pager .pages { display: flex; gap: .3rem; flex-wrap: wrap; } .pager a, .pager span.cur, .pager span.gap { min-width: 34px; height: 34px; padding: 0 .6rem; border-radius: 8px; display: inline-grid; place-items: center; font-size: .86rem; font-weight: 600; }
.pager a { color: var(--text); border: 1px solid var(--line-strong); background: var(--surface); } .pager a:hover { background: var(--surface-2); text-decoration: none; border-color: var(--faint); } .pager span.cur { background: var(--accent); color: var(--accent-text); } .pager span.gap { color: var(--faint); } .pager a.off { opacity: .4; pointer-events: none; }
.pager .info { color: var(--muted); font-size: .84rem; } .toolbar { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; } .toolbar label { margin: 0; } .toolbar input, .toolbar select { width: auto; min-width: 11rem; }

/* ---------- ajustes (filas con interruptor), listas y formularios en línea ---------- */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: .85rem 0; border-top: 1px solid var(--line); margin: 0; color: var(--text); cursor: default; font-weight: 400; }
.setting:first-of-type { border-top: 0; } label.setting { cursor: pointer; }
.setting .st { display: flex; flex-direction: column; min-width: 0; } .setting .st b { font-weight: 600; font-size: .93rem; } .setting .st small { color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.setting select { width: auto; min-width: 13rem; max-width: 18rem; flex: none; }
@media (max-width: 640px) { .setting { flex-wrap: wrap; } .setting select { width: 100%; max-width: none; } }
input.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); border: 0; padding: 0; position: relative; cursor: pointer; flex: none; transition: background .18s; box-shadow: none; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
input.switch:checked { background: var(--accent); } input.switch:checked::after { transform: translateX(18px); } input.switch:focus-visible { box-shadow: 0 0 0 4px var(--ring); }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.1rem; margin: 0 0 1.2rem; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 5; }
.inline-add { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: .7rem; margin-top: .9rem; }
.inline-add > input, .inline-add > select { flex: 1; min-width: 9rem; margin: 0; } .inline-add > button { flex: none; }
.inline-add.stacked { flex-direction: column; align-items: stretch; } .inline-add.stacked > input { width: 100%; min-width: 0; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; border-top: 1px solid var(--line); } .li:first-child { border-top: 0; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; } .li-main b { font-weight: 600; word-break: break-all; }
.li-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; } .li-ico .i { margin: 0; }
.li-ico.warn { background: var(--warn-bg); color: var(--warn); }
.li form { margin: 0; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: .82rem; }
.two.cols { gap: 1.2rem; margin: 1rem 0 0; }
.panel-box { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem 1.1rem; background: var(--surface); }
.box-head h3 { margin: 0 0 .4rem; color: var(--text); font-size: .95rem; text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: .5rem; }
.count { background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 0 .55rem; font-size: .76rem; font-weight: 700; line-height: 1.6; }
.empty.sm { padding: 1.3rem .5rem; } .empty.sm .i { width: 1.8rem; height: 1.8rem; }

/* ---------- piezas comunes de las pestañas ---------- */
.setting input:not(.switch):not([type=checkbox]) { width: 13rem; max-width: 100%; flex: none; margin: 0; }
@media (max-width: 640px) { .setting input:not(.switch):not([type=checkbox]) { width: 100%; } }
table.kv td:first-child { color: var(--muted); width: 11rem; font-weight: 500; } table.kv td { padding-top: .6rem; padding-bottom: .6rem; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: .4rem; } .chips-wrap .chip { background: var(--surface-2); font-family: var(--mono); font-size: .78rem; }
.chips-pick { display: flex; flex-wrap: wrap; gap: .6rem; }
.pick { margin: 0; cursor: pointer; } .pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: inline-flex; align-items: center; padding: .45rem .9rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 550; font-size: .88rem; font-family: var(--mono); transition: .15s; }
.pick:hover span { border-color: var(--faint); } .pick input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); } .pick input:focus-visible + span { box-shadow: 0 0 0 4px var(--ring); }
.end { margin-top: 1rem; }

/* ---------- tiempo real ---------- */
.live { display: inline-flex; align-items: center; gap: .4rem; margin-left: .5rem; padding: .05rem .6rem; border-radius: 99px; background: var(--ok-bg); color: var(--ok); font-size: .76rem; font-weight: 650; vertical-align: 1px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; } .live.off { background: var(--warn-bg); color: var(--warn); } .live.off i { animation: none; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.v, .s { transition: color .2s; } .meter > i { transition: width .6s ease; }

/* ---------- gráficas ---------- */
.spans { display: inline-flex; margin-bottom: 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; } .spans button { background: transparent; color: var(--muted); border: 0; box-shadow: none; padding: .3rem .85rem; border-radius: 8px; font-size: .83rem; } .spans button:hover { background: transparent; color: var(--text); } .spans button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; } @media (max-width: 760px) { .charts { grid-template-columns: 1fr; } } .charts figure { margin: 0; } .charts figcaption { font-size: .82rem; color: var(--muted); margin-bottom: .35rem; font-weight: 600; }
.chart { height: 160px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); } .chart svg { width: 100%; height: 100%; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--muted); font-size: 10px; } .chart .area { fill: var(--accent); opacity: .16; } .chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }

/* ---------- tarjetas de sitio y utilidades ---------- */
.row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .filter { max-width: 20rem; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.site-card { display: flex; flex-direction: column; gap: .9rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.site-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); color: var(--text); text-decoration: none; }
.site-card .top { display: flex; align-items: center; gap: .8rem; } .site-card .dom { font-weight: 650; font-size: 1.02rem; word-break: break-all; line-height: 1.3; } .site-card .slug { color: var(--muted); font-size: .8rem; }
.site-card .meta { margin: 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .topbar, .toasts { display: none; } }
