/* Webpanel 0.4 — estilo del portal GrowIT con el color del panel #336699.
 * Tokens en :root; modo oscuro por sistema (prefers-color-scheme) o elegido (data-theme). */
:root {
  --primary: #336699;
  --primary-600: #2a557f;
  --primary-700: #23476b;
  --primary-50: #eaf1f8;
  --primary-100: #d3e2f0;
  --nav: #14212e;
  --nav-ink: #d3dfeb;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dbe2ea;
  --text: #1b2631;
  --muted: #5a6876;
  --ok: #1a7f50;
  --ok-bg: #e2f4ea;
  --warn: #9a5b00;
  --warn-bg: #fdf0d8;
  --crit: #b8322a;
  --crit-bg: #fbe5e3;
  --code-bg: #0f1b28;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 33, 46, .06), 0 8px 24px rgba(20, 33, 46, .06);
  --shadow-lg: 0 2px 4px rgba(20, 33, 46, .08), 0 18px 40px rgba(20, 33, 46, .14);
  --ring: 0 0 0 3px rgba(51, 102, 153, .28);
  --f-heading: "Barlow Condensed", "Roboto Condensed", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--text);
}
:root[data-theme="dark"] {
  --primary: #5b93c9; --primary-600: #4a80b5; --primary-700: #b4d0ea; --primary-50: #182a3b; --primary-100: #22405b;
  --nav: #0b1219; --nav-ink: #c9d6e3;
  --bg: #0f151b; --surface: #172029; --surface-2: #1b2631; --border: #2a3744; --text: #e6edf3; --muted: #9eb0c1;
  --ok: #67d39f; --ok-bg: #133022; --warn: #f0b75e; --warn-bg: #352810; --crit: #f39189; --crit-bg: #3a1b18; --code-bg: #0a1118;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .45), 0 18px 40px rgba(0, 0, 0, .4);
  --ring: 0 0 0 3px rgba(91, 147, 201, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #5b93c9; --primary-600: #4a80b5; --primary-700: #b4d0ea; --primary-50: #182a3b; --primary-100: #22405b;
    --nav: #0b1219; --nav-ink: #c9d6e3;
    --bg: #0f151b; --surface: #172029; --surface-2: #1b2631; --border: #2a3744; --text: #e6edf3; --muted: #9eb0c1;
    --ok: #67d39f; --ok-bg: #133022; --warn: #f0b75e; --warn-bg: #352810; --crit: #f39189; --crit-bg: #3a1b18; --code-bg: #0a1118;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .45), 0 18px 40px rgba(0, 0, 0, .4);
    --ring: 0 0 0 3px rgba(91, 147, 201, .35);
    color-scheme: dark;
  }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-heading); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.15; }
h1 { font-size: 1.9rem; margin: 0 0 .25rem; display: flex; align-items: center; gap: .55rem; }
h1 .ico { color: var(--primary); flex: none; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
a { color: var(--primary); text-underline-offset: 3px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.ico { flex: none; vertical-align: -.2em; }
::selection { background: var(--primary); color: #fff; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.break { word-break: break-all; }
.stack { display: flex; flex-direction: column; gap: .9rem; }

/* Formularios y botones */
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .9rem; }
input, select, textarea {
  font: inherit; font-weight: 400; padding: .55rem .75rem; min-height: 42px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--primary); }
input:hover, select:hover, textarea:hover { border-color: var(--primary-100); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.input-ico { position: relative; display: block; }
.input-ico > span:first-child { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: flex; }
.input-ico input { width: 100%; padding-left: 2.4rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600; border: 0; border-radius: var(--radius-sm);
  padding: .55rem 1.05rem; min-height: 40px; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .15s, filter .15s, background .15s; }
.btn-primary { background: linear-gradient(180deg, var(--primary), var(--primary-600)); color: #fff; box-shadow: 0 2px 6px rgba(42, 85, 127, .3); }
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary-100); }
.btn-ghost:hover { background: var(--primary-50); border-color: var(--primary); }
.btn-link { background: none; color: var(--primary); padding: .25rem; min-height: 0; }
.btn-block { width: 100%; }
.form-error { color: var(--crit); margin: 0; min-height: 1.2em; font-size: .9rem; }

/* Acceso: pantalla dividida (marca a la izquierda, formulario a la derecha) */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: 3rem clamp(1.5rem, 5vw, 4rem); color: #fff;
  background: radial-gradient(120% 90% at 100% 100%, #3a77b3 0%, rgba(58, 119, 179, 0) 55%), linear-gradient(160deg, #1d3a57 0%, #14212e 70%); }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; right: -170px; bottom: -190px; border-radius: 50%;
  border: 60px solid rgba(255, 255, 255, .06); pointer-events: none; }
.auth-pitch { max-width: 460px; position: relative; z-index: 1; }
.auth-title { font-size: clamp(2.2rem, 4.2vw, 3.4rem); margin: 0 0 1rem; line-height: 1.02; display: block; }
.auth-pitch p { color: #c9d9e8; font-size: 1.05rem; margin: 0 0 1.5rem; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.auth-points li { display: flex; align-items: center; gap: .75rem; color: #e8f0f7; }
.auth-point-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); flex: none; }
.auth-foot { color: #9fb6cc; position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 2rem 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.8rem; }
.auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.auth-top .brand-compact { visibility: hidden; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; background: var(--surface); }
.lang-btn { font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .04em; padding: .28rem .65rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.lang-btn.active { background: var(--primary); color: #fff; }
.lang-switch.on-dark { border-color: rgba(255, 255, 255, .2); background: transparent; }
.lang-switch.on-dark .lang-btn { color: var(--nav-ink); }
.lang-switch.on-dark .lang-btn.active { background: var(--primary); color: #fff; }
.boot-error { margin: 2rem; }
.secret-box { background: var(--primary-50); border: 1px dashed var(--primary); border-radius: var(--radius-sm); padding: .8rem; text-align: center; font-size: 1.05rem; letter-spacing: .05em; }

/* Marca */
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--primary); color: #fff;
  font: 800 1.15rem var(--f-body); box-shadow: 0 4px 12px rgba(0, 0, 0, .15); flex: none; }
.brand-name { font: 700 1.3rem/1 var(--f-heading); text-transform: uppercase; letter-spacing: .06em; }
.brand-light { color: #fff; }
.brand-light .brand-mark { background: #fff; color: #336699; }

/* Estructura: menú lateral + contenido */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
@media (min-width: 801px) { .shell { background: linear-gradient(90deg, #182c40 252px, transparent 252px); } }
.sidebar { background: linear-gradient(180deg, var(--nav) 0%, #182c40 100%); color: var(--nav-ink); display: flex; flex-direction: column;
  padding: 1.2rem .8rem; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.sidebar > .brand { margin: .1rem .45rem .4rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #8ea3b8; margin: .9rem .75rem .3rem; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: .7rem; color: var(--nav-ink); text-decoration: none; padding: .55rem .75rem; border-radius: var(--radius-sm);
  font: 500 .93rem var(--f-body); border: 0; background: none; width: 100%; text-align: left; cursor: pointer; min-height: 42px; transition: background .15s, color .15s; }
.nav-item .ico { opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: #336699; color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(51, 102, 153, .45); }
.nav-item.active .ico { opacity: 1; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; padding-top: .9rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.who { display: flex; align-items: center; gap: .65rem; padding: .25rem .45rem; }
.who-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who-text strong { color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text .small { color: #8ea3b8; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #336699; color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; }
.sidebar-tools { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .45rem; }
.nav-tool { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: var(--nav-ink); cursor: pointer; }
.nav-tool:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar .version { color: #7f95ab; padding: 0 .75rem; }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(10, 18, 26, .5); z-index: 30; }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .7rem clamp(1rem, 3vw, 2rem); background: var(--surface); position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 0 var(--border), 0 6px 18px rgba(20, 33, 46, .04); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--primary), rgba(51, 102, 153, 0)); }
.topbar-right { margin-left: auto; }
.menu-toggle { display: none; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.search-trigger { display: flex; align-items: center; gap: 1.5rem; justify-content: space-between; min-width: 300px; font: inherit; color: var(--muted);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 99px; padding: .45rem .55rem .45rem .9rem; cursor: pointer; min-height: 40px; }
.search-trigger:hover { border-color: var(--primary-100); }
kbd { font-family: inherit; font-size: .72rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .05rem .4rem; color: var(--muted); }
.user { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.role { font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; background: var(--primary-50); color: var(--primary-700); font-weight: 600; }
.view { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem; max-width: 1240px; width: 100%; animation: rise .3s ease both; }
.view:focus { outline: none; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Tarjetas, indicadores y tablas */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow); }
a.card, .card-link { text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s; }
a.card:hover, .card-link:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi { display: flex; align-items: flex-start; gap: .9rem; }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.kpi-icon.ok { background: var(--ok-bg); color: var(--ok); }
.kpi-icon.warn { background: var(--warn-bg); color: var(--warn); }
.kpi-icon.crit { background: var(--crit-bg); color: var(--crit); }
.kpi-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }
.kpi-label { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font: 700 2.1rem/1 var(--f-heading); }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font: 700 1.9rem/1.1 var(--f-heading); margin: .3rem 0; }
.bar { height: 8px; background: var(--primary-50); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s ease; }
.bar.warn > span { background: var(--warn); }
.bar.crit > span { background: var(--crit); }
.section { margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--border); font-size: .92rem; vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--surface-2); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.pill { display: inline-flex; align-items: center; gap: .38rem; font-size: .76rem; font-weight: 700; padding: .18rem .65rem; border-radius: 99px;
  background: var(--primary-50); color: var(--primary-700); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.crit { background: var(--crit-bg); color: var(--crit); }
.services { display: flex; flex-wrap: wrap; gap: .5rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); border-style: dashed; box-shadow: none; }
.notice { border-left: 4px solid var(--primary); background: var(--primary-50); padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.notice.crit { border-color: var(--crit); background: var(--crit-bg); }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); }
.coming ul { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--muted); }

/* Buscador, ventana y aviso */
.palette, .modal { position: fixed; inset: 0; background: rgba(10, 18, 26, .5); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; z-index: 50; backdrop-filter: blur(2px); }
.palette-card, .modal-card { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-card { padding: 1.5rem; }
#palette-input { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 1rem 1.1rem; font-size: 1rem; box-shadow: none; }
#palette-list { list-style: none; margin: 0; padding: .4rem; max-height: 50vh; overflow-y: auto; }
#palette-list li { padding: .6rem .8rem; border-radius: var(--radius-sm); cursor: pointer; display: flex; justify-content: space-between; }
#palette-list li.sel, #palette-list li:hover { background: var(--primary-50); color: var(--primary-700); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--surface); padding: .75rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 60; max-width: 90vw; }
.toast.crit { background: var(--crit); color: #fff; }
.actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }

/* Actualizar con un archivo */
#update-box .dropzone { display: flex; align-items: center; gap: 1rem; text-align: left; padding: 1.1rem 1.2rem; cursor: pointer; font-size: .95rem; color: var(--text); }
.dz-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.update-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; background: var(--surface-2); }
.update-versions { display: flex; align-items: center; gap: 1.25rem; margin-bottom: .6rem; }
.update-versions > div { display: flex; flex-direction: column; }
.update-versions strong { font: 700 1.6rem/1.1 var(--f-heading); }
.update-arrow { color: var(--primary); }
.checklist { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .3rem; }
.checklist .ico { color: var(--ok); }
.spinner { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary-100); border-top-color: var(--primary); animation: spin .8s linear infinite; vertical-align: -2px; margin-right: .35rem; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-top .brand-compact { visibility: visible; }
  .auth-top .brand-compact .brand-name { color: var(--text); }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: .6rem 16px; }
  .topbar-right { display: none; }
  .search-trigger { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; }
  .search-trigger kbd { display: none; }
  .view { padding: 1.1rem 16px 2rem; }
  h1 { font-size: 1.6rem; }
}

/* ---- 0.2.0: módulos ---- */
.row { display: flex; align-items: center; gap: .5rem; }
.row.wrap { flex-wrap: wrap; }
.grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.form-grid { display: grid; gap: .85rem; grid-template-columns: 1fr 1fr; }
.form-grid4 { display: grid; gap: .85rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: auto; }
textarea { font: inherit; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin: 0 0 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--primary-50); }
tr.inactive td { opacity: .55; }
.app-card { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: inherit; }
.app-card:hover { border-color: var(--primary); }
.checks { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .45rem; font-size: .92rem; }
table.kv td { border: 0; padding: .25rem .5rem .25rem 0; }
.files-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.crumbs { font-size: .95rem; }
.crumbs a { text-decoration: none; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: .6rem; text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: .75rem; }
.dropzone.over { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }
.upload-btn { display: inline-flex; align-items: center; }
.row-actions { white-space: nowrap; text-align: right; }
.icon { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: .2rem .35rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.icon:hover { background: var(--primary-50); }
.icon.danger:hover { background: var(--crit-bg); }
.small-btn { padding: .3rem .6rem; font-size: .82rem; }
.modal-card.wide { max-width: 980px; }
.modal-card { max-height: 86vh; overflow-y: auto; }
.editor textarea { width: 100%; min-height: 55vh; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; line-height: 1.45; tab-size: 4; white-space: pre; background: var(--code-bg); color: #e6eef6; border-color: var(--code-bg); }
.editor-head { margin-bottom: .6rem; }
.editor .actions { align-items: center; }
.editor .actions .muted { margin-right: auto; }
pre.output { background: var(--code-bg); color: #e6eef6; padding: .75rem; border-radius: 8px; overflow: auto; max-height: 300px; font-size: .8rem; white-space: pre-wrap; margin: .6rem 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: .75rem; }
.filters label { min-width: 150px; }
.legend { display: flex; gap: .4rem; margin-bottom: .75rem; }
.origin { display: inline-block; font-size: .75rem; font-weight: 700; padding: .12rem .5rem; border-radius: 5px; }
.o-server { background: #ece5f7; color: #5b3a94; }
.o-service { background: #fdf1dc; color: #8a5200; }
.o-site { background: var(--primary-100); color: var(--primary-700); }
.o-panel { background: #e5f5ed; color: #176b45; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; word-break: break-word; }
.nowrap { white-space: nowrap; }
.secret-box.left { text-align: left; margin-top: .75rem; font-size: .9rem; word-break: break-all; }
.warn-list { margin: .3rem 0 0; padding-left: 1.2rem; color: var(--warn); }
.crit-text { color: var(--crit); }
.secret-row { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.secret-row .secret-name { min-width: 220px; }
.secret-row input { flex: 1; min-width: 200px; }
.view-head h2 { margin: 0; }
@media (max-width: 800px) {
  .form-grid, .form-grid4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .grid2 { grid-template-columns: 1fr; }
}

/* ---- 0.3.0: respaldos, velocidad, plugins, integridad ---- */
.row.between { justify-content: space-between; align-items: flex-start; }
.stages { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.pill.muted-pill { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.crit-text { color: var(--crit); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.stat-value.small-value { font-size: 1rem; word-break: break-all; }
.grid2.tight { gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.btn.danger { color: var(--crit); }
.cmp-list { max-height: 260px; overflow: auto; }
.cmp-list td { padding: .3rem .6rem; }
pre.diff { background: #0f1720; color: #d7dee6; padding: .75rem; border-radius: 8px; overflow: auto; max-height: 360px; font-size: .8rem; line-height: 1.45; }
pre.diff .add { color: #7ee2a8; }
pre.diff .del { color: #ff9a9a; }
.notice.ok { border-color: var(--ok); background: var(--ok-bg); }
.kpi-row { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.kpi-row > div { min-width: 120px; }
.verdict { border-left: 4px solid var(--primary); }
.verdict.server { border-left-color: var(--crit); }
.verdict.site { border-left-color: var(--warn); }
.verdict.ok { border-left-color: var(--ok); }
.spark { width: 100%; height: 48px; display: block; }
.spark path.line { fill: none; stroke: var(--primary); stroke-width: 1.5; }
.spark path.area { fill: var(--primary-50); stroke: none; }
.spark line.limit { stroke: var(--crit); stroke-dasharray: 3 3; stroke-width: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; margin-bottom: .25rem; }
.chart-legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }
.chart-plot { position: relative; }
.chart-plot svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-plot .grid { stroke: var(--border); stroke-width: 1; }
.chart-plot .limit { stroke: var(--crit); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-plot .axis { fill: var(--muted); font-size: 10px; }
.chart-plot .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-plot .cross { stroke: #9aa5b1; stroke-width: 1; }
.chart-plot .dot { stroke: var(--surface); stroke-width: 2; }
.chart-plot rect:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.chart-tip { position: absolute; top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .6rem; font-size: .8rem; box-shadow: 0 4px 14px rgba(0,0,0,.08); pointer-events: none; white-space: nowrap; }
.chart-table summary { cursor: pointer; color: var(--primary); margin-top: .35rem; }
.chart-table-body { max-height: 220px; overflow: auto; }
.findings { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .4rem; }
.findings li { display: flex; gap: .5rem; align-items: baseline; }
.cf-grid { display: grid; gap: .5rem; }
.cf-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.cf-row strong { min-width: 180px; }
.output.wrap { white-space: pre-wrap; word-break: break-all; }

/* ---- 0.4.0: modo oscuro de las etiquetas de origen ---- */
:root[data-theme="dark"] .o-server { background: #2a2140; color: #c9b5f0; }
:root[data-theme="dark"] .o-service { background: var(--warn-bg); color: var(--warn); }
:root[data-theme="dark"] .o-panel { background: var(--ok-bg); color: var(--ok); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .o-server { background: #2a2140; color: #c9b5f0; }
  :root:not([data-theme="light"]) .o-service { background: var(--warn-bg); color: var(--warn); }
  :root:not([data-theme="light"]) .o-panel { background: var(--ok-bg); color: var(--ok); }
}
/* Nada se sale de la pantalla en el celular */
.grid > *, .grid2 > *, .kpis > * { min-width: 0; }
.grid2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
@media (max-width: 800px) { form.row, .row { flex-wrap: wrap; } form.row input { min-width: 0; flex: 1 1 180px; } }
.f-ico { color: var(--primary); display: inline-flex; vertical-align: -3px; }
.icon { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--muted); }
.icon:hover { color: var(--primary); }
.icon.danger:hover { color: var(--crit); }
/* Dominio del panel */
.steps { padding-left: 1.2rem; display: grid; gap: .6rem; margin: .5rem 0 1rem; }
.dns-record { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: .4rem; padding: .6rem .8rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.dns-record > span { display: flex; flex-direction: column; gap: .15rem; }
.dns-record code { font-size: .95rem; }
/* Servicios */
.svc-summary { margin-bottom: .5rem; }
.svc-mem { display: flex; flex-direction: column; gap: .25rem; min-width: 110px; }
.svc-mem .bar { height: 6px; }
.svc-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.svc-actions .btn { gap: .3rem; }
@media (max-width: 800px) {
  /* En el celular cada servicio es una tarjeta: nombre, estado y consumo arriba, botones abajo */
  .svc-table thead { display: none; }
  .svc-table, .svc-table tbody, .svc-table tr, .svc-table td { display: block; width: 100%; }
  .svc-table tr { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; padding: .8rem .9rem; border-bottom: 1px solid var(--border); }
  .svc-table tr:last-child { border-bottom: 0; }
  .svc-table td { border: 0; padding: 0; }
  .svc-table td:nth-child(1) { grid-column: 1 / -1; }
  .svc-table td:nth-child(4)::before { content: "CPU "; color: var(--muted); }
  .svc-table td:nth-child(6) { grid-column: 1 / -1; justify-content: flex-start; }
}
