:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1c232c;
  --border: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #7ee2c8;
  --accent-strong: #5dccae;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --blue: #7ee2c8;
  --gray: #6e7681;
  --code-fg: #d6e3ee;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.brand-name { font-weight: 600; letter-spacing: 0.2px; }
.brand-version { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 12px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.nav a:hover { background: var(--panel-2); }
.nav a.is-active { background: var(--panel-2); color: var(--accent); }
.nav a.muted { color: var(--muted); }

/* Page */
.page { flex: 1; padding: 24px; max-width: 1400px; margin: 0 auto; width: 100%; }
.footer { padding: 14px 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
}
.hero--green { border-left: 4px solid var(--green); }
.hero--yellow { border-left: 4px solid var(--yellow); }
.hero--red { border-left: 4px solid var(--red); }
.hero--blue { border-left: 4px solid var(--blue); }
.hero--gray { border-left: 4px solid var(--gray); }
.hero-left { display: flex; flex-direction: column; gap: 14px; }

/* Hero quad-layout: 4 bloques en linea (status / host / temps / tuning) */
.hero--quad {
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 1fr) minmax(170px, 0.85fr) minmax(200px, 1fr);
  gap: 18px;
  align-items: start;
}
.hero-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hero-block-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
}
.hero-block dl { margin: 0; }
.hero-block + .hero-block {
  border-left: 1px solid var(--border);
  padding-left: 18px;
}
@media (max-width: 1100px) {
  .hero--quad { grid-template-columns: 1fr 1fr; }
  .hero-block + .hero-block { border-left: none; padding-left: 0; }
  .hero-block:nth-child(3), .hero-block:nth-child(4) {
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }
}
@media (max-width: 600px) {
  .hero--quad { grid-template-columns: 1fr; }
  .hero-block:nth-child(n+2) {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    border-left: none;
    padding-left: 0;
  }
}
.semaphore { display: flex; align-items: center; gap: 16px; }
.semaphore .dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray);
  box-shadow: 0 0 14px rgba(0,0,0,0.35);
}
.semaphore--green .dot { background: var(--green); box-shadow: 0 0 14px var(--green); }
.semaphore--yellow .dot { background: var(--yellow); box-shadow: 0 0 14px var(--yellow); }
.semaphore--red .dot { background: var(--red); box-shadow: 0 0 14px var(--red); }
.semaphore--blue .dot { background: var(--blue); box-shadow: 0 0 14px var(--blue); }
.semaphore--gray .dot { background: var(--gray); }
.semaphore-label { font-size: 22px; font-weight: 700; }
.semaphore-mode { color: var(--muted); font-size: 13px; }
.semaphore-reasons { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.semaphore-reasons li { margin: 2px 0; }
.hostmeta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.hostmeta dt { color: var(--muted); }
.hostmeta dd { margin: 0; font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; }

/* Grid de tarjetas */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card--wide { grid-column: span 1; }
.card-header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-header h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.card-sub { font-size: 12px; color: var(--muted); }

.metric-big { font-size: 34px; font-weight: 700; line-height: 1; }
.metric-big .unit { font-size: 18px; color: var(--muted); margin-left: 4px; }

.bar {
  background: var(--panel-2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 0.4s ease;
}
.bar-fill--swap { background: linear-gradient(90deg, var(--blue), var(--yellow)); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; text-align: right; }
.kv--big dd { font-size: 16px; }

/* Tabla */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.table tr:last-child td { border-bottom: none; }
.table code { background: var(--panel-2); color: var(--code-fg); padding: 2px 6px; border-radius: 4px; }
.table a code { color: var(--accent-strong); }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pill--ok { background: rgba(63, 185, 80, 0.18); color: var(--green); }
.pill--err { background: rgba(248, 81, 73, 0.18); color: var(--red); }

.muted { color: var(--muted); }
.small { font-size: 12px; }

.quick { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.quick h2 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.quicklinks { list-style: none; padding: 0; margin: 0 0 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.quicklinks a { color: var(--accent-strong); text-decoration: none; font-family: ui-monospace, Menlo, Consolas, monospace; }
.quicklinks a:hover { text-decoration: underline; }

/* Buttons + forms */
.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn--small { padding: 3px 10px; font-size: 12px; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--panel-2); }
.btn--danger { background: var(--red); border-color: var(--red); color: white; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-grid label.span-2 { grid-column: 1 / -1; }
.form-grid label.row-inline { flex-direction: row; align-items: center; gap: 8px; }
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid select,
.form-grid textarea {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
}
.form-grid textarea { font-family: ui-monospace, Menlo, Consolas, monospace; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: 1px solid var(--accent); }

.form-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.form-inline input[type="text"] {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 8px; font-size: 12px; max-width: 180px;
}

/* Login screen */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; display: flex; justify-content: center; padding: 24px; }
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 6px 30px rgba(0,0,0,0.35);
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.login-form input[type="text"], .login-form input[type="password"] {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.login-form input:focus { outline: 1px solid var(--accent-strong); }

.alert-banner {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-banner--err { background: rgba(248,81,73,0.15); color: var(--red); border: 1px solid rgba(248,81,73,0.3); }

/* Session bar (logout button in topbar) */
.session-info { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.session-info .muted { font-size: 12px; }
.session-info form { display: inline; }

.mono-block {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--code-fg);
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
}

/* === UX HELPERS === */

/* Tooltip "i" */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
  border: 1px solid var(--border);
  margin-left: 6px;
  vertical-align: middle;
}
.help-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #0a0d12;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  width: max-content;
  max-width: 320px;
  white-space: pre-wrap;
  text-align: left;
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
  z-index: 100;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.help-icon:hover::after, .help-icon:focus::after { opacity: 1; visibility: visible; }

/* Helper banner */
.helper-banner {
  background: rgba(126,226,200,0.08);
  border-left: 3px solid var(--accent-strong);
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.helper-banner-icon {
  flex: 0 0 22px;
  height: 22px;
  background: var(--accent-strong);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.helper-banner-text { flex: 1; }
.helper-banner-text strong { color: var(--accent-strong); }
.helper-banner ol, .helper-banner ul {
  margin: 6px 0 0; padding-left: 22px; line-height: 1.5;
}
.helper-banner code { background: var(--panel-2); padding: 1px 6px; border-radius: 3px; font-size: 12px; }

/* Helper banner --warning */
.helper-banner--warn {
  background: rgba(210,153,34,0.08);
  border-left-color: var(--yellow);
}
.helper-banner--warn .helper-banner-icon { background: var(--yellow); color: var(--bg); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state-title { font-size: 18px; color: var(--text); margin: 0 0 8px; }
.empty-state-text { font-size: 14px; margin: 0 0 20px; }
.empty-state-cta { display: inline-block; }

/* Breadcrumb */
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent-strong); }
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 600;
}
.page-header-subtitle {
  font-size: 13px;
  color: var(--muted);
}

/* Step list */
.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.step-list li {
  counter-increment: step;
  position: relative;
  padding: 8px 0 8px 38px;
  font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.step-list li:last-child { border-bottom: none; }
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 26px;
  height: 26px;
  background: var(--accent-strong);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.step-list code { background: var(--panel-2); padding: 1px 6px; border-radius: 3px; font-size: 12px; }

/* Field hint */
.field-hint {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}

/* Inline confirm form (simple) */
form.inline-confirm { display: inline; }
form.inline-confirm button.btn--danger { font-size: 11px; }

/* Settings */
.setting-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.setting-key {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px;
  color: var(--muted);
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 3px;
}
.setting-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* === NAV REDESIGN === */
.nav { gap: 4px; flex-wrap: wrap; }
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s;
}
.nav-item:hover { background: var(--panel-2); }
.nav-item.is-active { background: rgba(126,226,200,0.12); color: var(--accent-strong); }
.nav-ico { font-size: 16px; }
.nav-divider { flex: 0 0 1px; height: 24px; background: var(--border); margin: 0 4px; }
.nav-more { position: relative; }
.nav-more summary {
  list-style: none; cursor: pointer;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--muted);
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more[open] summary { background: var(--panel-2); color: var(--text); }
.nav-more-panel {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px;
  display: flex; flex-direction: column;
  min-width: 200px;
  z-index: 50;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.nav-more-panel a {
  padding: 8px 12px; border-radius: 6px;
  text-decoration: none; color: var(--text); font-size: 13px;
}
.nav-more-panel a:hover { background: var(--panel-2); }
.nav-more-panel a.is-active { color: var(--accent-strong); background: rgba(126,226,200,0.1); }

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: white;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

/* === STATUS HERO (¿está todo bien?) === */
.status-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 26px 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 24px;
  position: relative;
}
.status-hero--green  { border-left: 6px solid var(--green); }
.status-hero--yellow { border-left: 6px solid var(--yellow); }
.status-hero--red    { border-left: 6px solid var(--red); }
.status-hero--blue   { border-left: 6px solid var(--blue); }
.status-hero--gray   { border-left: 6px solid var(--gray); }
.status-hero-icon {
  flex: 0 0 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 700;
  color: var(--bg);
}
.status-hero--green  .status-hero-icon { background: var(--green); }
.status-hero--yellow .status-hero-icon { background: var(--yellow); }
.status-hero--red    .status-hero-icon { background: var(--red); }
.status-hero--blue   .status-hero-icon { background: var(--blue); }
.status-hero--gray   .status-hero-icon { background: var(--gray); }
.status-hero-text { flex: 1; min-width: 0; }
.status-hero-title { font-size: 26px; font-weight: 700; margin: 0 0 4px; }
.status-hero-sub { color: var(--muted); margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.status-hero-meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.status-hero-meta strong { color: var(--text); font-weight: 500; }
.status-hero-meta .meta-warn { color: var(--yellow); font-weight: 500; }

/* === ACTION TILES === */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.action-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.action-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-strong);
  background: rgba(126,226,200,0.06);
}
.action-tile-ico { font-size: 28px; }
.action-tile-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.action-tile-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.action-tile--alert { border-color: var(--yellow); background: rgba(210,153,34,0.06); }

/* === QUICK STATS === */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.qs-card {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
}
.qs-card--ok   { border-left-color: var(--green); }
.qs-card--warn { border-left-color: var(--yellow); }
.qs-card--err  { border-left-color: var(--red); }
.qs-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 4px; }
.qs-value { font-size: 28px; font-weight: 700; line-height: 1; }
.qs-value--small { font-size: 18px; padding-top: 4px; }
.qs-unit { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.qs-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* === SERVICE LIST (dashboard mini) === */
.service-list { list-style: none; padding: 0; margin: 0; }
.service-list li {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.service-list li:last-child { border-bottom: none; }
.service-desc { flex: 1; font-weight: 500; }
.service-name { white-space: nowrap; }
.service-status { white-space: nowrap; }
.dot-ok      { color: var(--green); }
.dot-err     { color: var(--red); }
.dot-warn    { color: var(--yellow); }
.dot-info    { color: var(--accent-strong); }
.dot-neutral { color: var(--muted); }

/* === TECH DETAILS (collapsible) === */
.tech-details {
  background: var(--panel-2);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 24px;
}
.tech-details summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  user-select: none;
}
.tech-details[open] summary { color: var(--text); margin-bottom: 8px; }

/* === ASSISTANT CARDS === */
.assistant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.assistant-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s, border-color 0.12s;
}
.assistant-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-strong);
}
.assistant-ico { font-size: 32px; }
.assistant-card h3 { font-size: 16px; font-weight: 600; margin: 4px 0 0; }
.assistant-card p { font-size: 12px; color: var(--muted); line-height: 1.4; margin: 0; flex: 1; }
.assistant-cta { font-size: 13px; color: var(--accent-strong); font-weight: 600; margin-top: 6px; }
.assistant-card.is-active {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(126,226,200,0.25);
  background: rgba(126,226,200,0.08);
}

/* Wrapper de cada formulario del asistente (acordeón) */
.asst-form-wrap {
  padding: 4px 0 8px;
  animation: asst-fade-in 0.18s ease-out;
}
.asst-form-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.asst-empty { padding: 8px 0; }

/* Bloque "Programación + Historial + RG" debajo del form */
.asst-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.asst-meta-block { background: var(--panel-2); border-radius: 8px; padding: 12px 14px; }
.asst-meta-block h4 { margin: 0 0 8px; font-size: 13px; color: var(--text); font-weight: 600; }
.asst-meta-list { list-style: none; padding: 0; margin: 0 0 10px; }
.asst-meta-list li { padding: 4px 0; font-size: 12px; border-bottom: 1px dashed var(--border); }
.asst-meta-list li:last-child { border-bottom: none; }
.table-mini { width: 100%; font-size: 12px; }
.table-mini th, .table-mini td { padding: 4px 6px; }
.rg-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rg-result { flex: 1; min-width: 200px; }

/* Políticas de Resource Guard */
.policy-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.policy-card summary {
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  user-select: none;
}
.policy-card[open] summary { margin-bottom: 8px; }
.policy-card summary > strong { font-size: 15px; }
@keyframes asst-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Pills tone-based (semantica) === */
.pill { font-size: 11px; }
.pill--ok      { background: rgba(63, 185, 80, 0.18); color: var(--green); }
.pill--err     { background: rgba(248, 81, 73, 0.18); color: var(--red); }
.pill--warn    { background: rgba(210, 153, 34, 0.18); color: var(--yellow); }
.pill--info    { background: rgba(126, 226, 200, 0.16); color: var(--accent-strong); }
.pill--neutral { background: rgba(110, 118, 129, 0.2); color: var(--muted); }

/* === Glossary === */
.glossary { display: grid; grid-template-columns: minmax(200px, 1fr) 3fr; gap: 8px 18px; margin: 0; }
.glossary dt { font-weight: 600; padding-top: 6px; border-top: 1px dashed var(--border); }
.glossary dt:first-child { border-top: none; }
.glossary dd { margin: 0; padding-top: 6px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 13px; line-height: 1.5; }
.glossary dd:nth-of-type(1) { border-top: none; }
@media (max-width: 700px) { .glossary { grid-template-columns: 1fr; } .glossary dd { padding-top: 0; border-top: none; } }

.help-h3 { font-size: 16px; margin: 18px 0 6px; color: var(--text); }
.help-h3 + p, .help-h3 + ul, .help-h3 + ol { margin-top: 0; }

/* === MODO LENGUAJE NATURAL === */
.nl-box {
  background: linear-gradient(135deg, rgba(126,226,200,0.07), rgba(88,166,255,0.05));
  border: 1px solid var(--accent-strong);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nl-box-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nl-icon { font-size: 18px; }
.nl-input {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.nl-input:focus { outline: 1px solid var(--accent-strong); }
.nl-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nl-status { font-size: 12px; }
.nl-status--info { color: var(--accent-strong); }
.nl-status--ok { color: var(--green); }
.nl-status--warn { color: var(--yellow); }
.nl-status--err { color: var(--red); }
.nl-btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}
.nl-btn.is-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: nl-spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes nl-spin { to { transform: rotate(360deg); } }

/* === Enlaces dentro de bloques de contenido — NUNCA azul eléctrico === */
.helper-banner a,
.helper-banner-text a,
.empty-state a,
.empty-state-text a,
.glossary a,
.glossary dd a,
.field-hint a,
.muted a,
.muted small a,
.asst-meta-block a,
.action-tile-sub a,
.assistant-card p a,
.help-h3 + p a,
.help-h3 + ul a,
.help-h3 + ol a,
.tech-details a,
.status-hero-sub a,
.policy-card a,
.setting-hint a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.helper-banner a:hover,
.helper-banner-text a:hover,
.empty-state a:hover,
.glossary a:hover,
.field-hint a:hover,
.muted a:hover,
.asst-meta-block a:hover,
.policy-card a:hover { color: var(--text); }
