*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --surface2:  #f8fafc;
  --border:    #e2e8f0;
  --border2:   #cbd5e1;
  --text:      #0f172a;
  --text2:     #334155;
  --muted:     #64748b;
  --muted2:    #94a3b8;
  --accent:    #2563eb;
  --accent-h:  #1d4ed8;
  --accent-bg: #eff6ff;
  --ok:        #16a34a;
  --ok-bg:     #f0fdf4;
  --caution:   #65a30d;
  --caution-bg:#f7fee7;
  --warning:   #d97706;
  --warning-bg:#fffbeb;
  --critical:  #dc2626;
  --critical-bg:#fef2f2;
  --error:     #64748b;
  --error-bg:  #f8fafc;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT (sidebar + contenido) ───────────── */
#app-content { display: flex; min-height: 100vh; }

/* ── SIDEBAR ────────────────────────────────── */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.logo svg { color: var(--accent); flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }

/* ── TABS (verticales) ──────────────────────── */
nav.tabs { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; }
.tab {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.tab svg { flex-shrink: 0; width: 19px; height: 19px; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 8px; }
.tab:hover { color: var(--text2); background: var(--surface2); }
.tab.active { color: var(--accent); background: var(--accent-bg); }

/* ── CONTENT AREA ───────────────────────────── */
.content-area { flex: 1; min-width: 0; }

/* ── TAB CONTENT ─────────────────────────────── */
.tab-content { display: flex; flex-direction: column; gap: 20px; padding: 28px 32px; width: 100%; }
.tab-content.hidden { display: none !important; }

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4px;
}
.tab-title { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.tab-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ── ADD FORM ────────────────────────────────── */
.add-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}
.add-section form { display: flex; gap: 10px; }
.input-name { max-width: 200px; }
.add-section input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.add-section input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.add-section input::placeholder { color: var(--muted2); }
.add-section button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  white-space: nowrap;
}
.add-section button:hover {
  background: var(--accent-h);
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}

/* ── ACTIONS BAR ─────────────────────────────── */
.actions-bar { display: flex; justify-content: space-between; align-items: center; }
.summary { color: var(--muted); font-size: 13px; }
.btn-check-all {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-check-all:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.btn-check-all:disabled { opacity: .5; cursor: not-allowed; }
.btn-test-action { color: var(--muted); }
.btn-test-action:hover {
  border-color: var(--ok);
  color: var(--ok);
  background: var(--ok-bg);
}

/* ── SETTINGS BUTTON ─────────────────────────── */
.btn-settings {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-settings:hover {
  color: var(--text2);
  border-color: var(--border2);
  background: var(--surface2);
}

/* ── TABLE ───────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
thead tr { background: var(--surface2); }
th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

.name-cell { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; }
.domain-cell { font-size: 13px; }
.domain-cell a { color: var(--accent); text-decoration: none; }
.domain-cell a:hover { text-decoration: underline; }

/* ── BADGES ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-ok      { background: var(--ok-bg);       color: var(--ok);       border: 1px solid #bbf7d0; }
.badge-caution { background: var(--caution-bg);   color: var(--caution);  border: 1px solid #d9f99d; }
.badge-warning { background: var(--warning-bg);   color: var(--warning);  border: 1px solid #fde68a; }
.badge-critical{ background: var(--critical-bg);  color: var(--critical); border: 1px solid #fecaca; }
.badge-error   { background: var(--error-bg);     color: var(--error);    border: 1px solid var(--border); }
.badge-pending { background: var(--surface2);     color: var(--muted);    border: 1px solid var(--border); }

/* ── DAYS ────────────────────────────────────── */
.days-ok      { color: var(--ok);      font-weight: 700; }
.days-caution { color: var(--caution); font-weight: 700; }
.days-warning { color: var(--warning); font-weight: 700; }
.days-critical{ color: var(--critical);font-weight: 700; }

/* ── ROW LEFT BORDER ─────────────────────────── */
tr.row-ok       td:first-child { border-left: 3px solid var(--ok); }
tr.row-caution  td:first-child { border-left: 3px solid var(--caution); }
tr.row-warning  td:first-child { border-left: 3px solid var(--warning); }
tr.row-critical td:first-child { border-left: 3px solid var(--critical); }
tr.row-error    td:first-child { border-left: 3px solid var(--error); }
tr.row-pending  td:first-child { border-left: 3px solid var(--border2); }

/* ── ACTION BUTTONS ──────────────────────────── */
.btn-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}
.btn-icon.danger:hover {
  color: var(--critical);
  border-color: var(--critical);
  background: var(--critical-bg);
}
.btn-icon:disabled { opacity: .4; cursor: not-allowed; }
.btn-group { display: flex; gap: 6px; }

/* ── LOADING ─────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 72px 0;
  color: var(--muted);
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.empty-state svg { opacity: .25; margin-bottom: 8px; color: var(--accent); }
.empty-state p { font-size: 14px; }

/* ── COMING SOON ─────────────────────────────── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 80px 32px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
}
.coming-soon svg { opacity: .2; margin-bottom: 8px; color: var(--accent); }
.coming-soon h2 { font-size: 20px; font-weight: 700; color: var(--text); }
.coming-soon > p { color: var(--muted); font-size: 14px; max-width: 420px; }
.coming-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  text-align: left;
}
.coming-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.coming-features li svg { color: var(--accent); opacity: .6; flex-shrink: 0; }

/* ── MODALS ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
  width: 100%;
  max-width: 560px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: all .15s;
  line-height: 1.4;
}
.modal-close:hover { color: var(--text); background: var(--surface2); border-color: var(--border2); }
#modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; color: var(--accent); }
.modal-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.modal-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.modal-value { font-size: 14px; color: var(--text2); word-break: break-all; }

/* ── SETTINGS MODAL ──────────────────────────── */
.settings-box { max-width: 620px; }
.settings-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.settings-header svg { color: var(--accent); }
.settings-header h2 { font-size: 17px; font-weight: 700; color: var(--text); }
.settings-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 22px;
  padding: 11px 14px;
  background: var(--accent-bg);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.field-group { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.field-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-group input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.field-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.field-group input::placeholder { color: var(--muted2); }
.field-hint { color: var(--muted2); font-size: 11px; }
.field-row { display: flex; gap: 14px; margin-bottom: 16px; }
.input-with-hint { position: relative; }
.input-with-hint input { width: 100%; }
.key-masked {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted2);
  font-size: 11px;
  pointer-events: none;
}

/* threshold dots */
.threshold-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.threshold-dot.warning  { background: var(--warning); }
.threshold-dot.critical { background: var(--critical); }

/* toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  margin: 18px 0 22px;
  gap: 16px;
  transition: border-color .15s;
}
.toggle-row:hover { border-color: var(--accent); }
.toggle-info { display: flex; flex-direction: column; gap: 3px; }
.toggle-label { font-size: 14px; font-weight: 600; color: var(--text); }
.toggle-sub   { font-size: 12px; color: var(--muted); }
.toggle-wrap  { flex-shrink: 0; position: relative; }
.toggle-wrap input { display: none; }
.toggle-track {
  display: block;
  width: 44px; height: 24px;
  background: var(--border2);
  border-radius: 99px;
  position: relative;
  transition: background .2s;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-wrap input:checked + .toggle-track { background: var(--accent); }
.toggle-wrap input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }

.settings-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}
.btn-save {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.btn-save:hover { background: var(--accent-h); box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.btn-test {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-test:hover { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.btn-test:disabled { opacity: .5; cursor: not-allowed; }

/* ── CONFIRM MODAL ───────────────────────────── */
.confirm-box { max-width: 420px; text-align: center; }
.confirm-box h2 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.confirm-box p { color: var(--muted); font-size: 14px; margin-bottom: 24px; word-break: break-all; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions button {
  border-radius: 8px;
  padding: 9px 26px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid var(--border);
}
.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-cancel:hover { background: var(--border); border-color: var(--border2); }
.btn-delete { background: var(--critical-bg); color: var(--critical); border-color: #fca5a5 !important; }
.btn-delete:hover { background: #fee2e2; }

/* ── PING STATUS ─────────────────────────────── */
.badge-ping-up      { background: var(--ok-bg);       color: var(--ok);       border: 1px solid #bbf7d0; }
.badge-ping-slow    { background: var(--warning-bg);   color: var(--warning);  border: 1px solid #fde68a; }
.badge-ping-down    { background: var(--critical-bg);  color: var(--critical); border: 1px solid #fecaca; }
.badge-ping-error   { background: var(--error-bg);     color: var(--error);    border: 1px solid var(--border); }
.badge-ping-pending { background: var(--surface2);     color: var(--muted);    border: 1px solid var(--border); }

.resp-fast { color: var(--ok);      font-weight: 700; }
.resp-slow { color: var(--warning); font-weight: 700; }
.resp-down { color: var(--critical);font-weight: 700; }

.uptime-ok      { color: var(--ok);      font-weight: 700; }
.uptime-warn    { color: var(--warning); font-weight: 700; }
.uptime-critical{ color: var(--critical);font-weight: 700; }

/* ── SELECT ──────────────────────────────────── */
.field-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  width: 100%;
  cursor: pointer;
  transition: border-color .2s;
}
.field-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ── STATS MODAL ─────────────────────────────── */
.stats-box { max-width: 860px; max-height: 90vh; overflow-y: auto; }
.stats-header { margin-bottom: 16px; }
.stats-header h2 { font-size: 18px; font-weight: 700; color: var(--text); }
.stats-url-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

.stats-filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-card-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card-sub   { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-card.ok       { border-left: 3px solid var(--ok); }
.stat-card.warning  { border-left: 3px solid var(--warning); }
.stat-card.critical { border-left: 3px solid var(--critical); }
.stat-card.neutral  { border-left: 3px solid var(--accent); }

.stats-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.btn-export-pdf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-export-pdf:hover { color: var(--text2); border-color: var(--border2); background: var(--surface2); }

/* ── PRINT / PDF ─────────────────────────────── */
@page {
  margin: 0;
  size: A4 portrait;
}

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }

  #print-area {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    color: #0f172a;
    background: #fff;
    margin: 0;
    padding: 0;
  }

  .pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 32px 20px;
    border-bottom: 3px solid #2563eb;
    margin-bottom: 24px;
  }
  .pdf-brand { font-size: 22px; font-weight: 800; color: #0f172a; }
  .pdf-brand span { color: #2563eb; }
  .pdf-meta { text-align: right; font-size: 12px; color: #64748b; }
  .pdf-meta strong { color: #0f172a; font-size: 14px; display: block; margin-bottom: 2px; }

  .pdf-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin: 20px 32px 10px;
  }

  .pdf-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 32px;
    margin-bottom: 20px;
  }
  .pdf-card {
    flex: 1 1 120px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    background: #f8fafc;
  }
  .pdf-card.ok       { border-left: 3px solid #16a34a; }
  .pdf-card.warning  { border-left: 3px solid #d97706; }
  .pdf-card.critical { border-left: 3px solid #dc2626; }
  .pdf-card.neutral  { border-left: 3px solid #2563eb; }
  .pdf-card-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing:.05em; color: #64748b; margin-bottom: 4px; }
  .pdf-card-value { font-size: 20px; font-weight: 800; color: #0f172a; line-height: 1; }
  .pdf-card-sub   { font-size: 10px; color: #94a3b8; margin-top: 3px; }

  .pdf-chart-wrap {
    padding: 0 32px;
    margin-bottom: 20px;
    page-break-inside: avoid;
  }
  .pdf-chart-wrap canvas { max-width: 100%; }

  .pdf-table {
    width: calc(100% - 64px);
    margin: 0 32px;
    border-collapse: collapse;
    font-size: 12px;
    page-break-inside: auto;
  }
  .pdf-table thead tr { background: #f1f5f9; }
  .pdf-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
  }
  .pdf-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
  }
  .pdf-table tr:nth-child(even) td { background: #f8fafc; }
  .pdf-ok       { color: #16a34a; font-weight: 700; }
  .pdf-warning  { color: #d97706; font-weight: 700; }
  .pdf-critical { color: #dc2626; font-weight: 700; }

  .pdf-footer {
    margin-top: 32px;
    padding: 12px 32px;
    border-top: 1px solid #e2e8f0;
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
  }
}

.hidden { display: none !important; }

/* ── LOGIN SCREEN ────────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,.08);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 28px;
}
.login-logo svg { color: var(--accent); }
.login-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 6px; letter-spacing: -.02em; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.login-error {
  background: var(--critical-bg);
  color: var(--critical);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ── USER MENU ───────────────────────────────── */
.user-menu { position: relative; }
.btn-user {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-user > span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.btn-user:hover { border-color: var(--border2); background: var(--border); }
.user-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  min-width: 190px;
  z-index: 200;
  overflow: hidden;
}
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.user-dropdown button:hover { background: var(--surface2); }
.user-dropdown button.danger { color: var(--critical); }
.user-dropdown button.danger:hover { background: var(--critical-bg); }
.dropdown-divider { height: 1px; background: var(--border); margin: 2px 0; }

/* ── CelcomHost ──────────────────────────────────────────── */
.badge-host-up       { background: var(--ok-bg);       color: var(--ok);       border: 1px solid #bbf7d0; }
.badge-host-warning  { background: var(--warning-bg);  color: var(--warning);  border: 1px solid #fde68a; }
.badge-host-critical { background: var(--critical-bg); color: var(--critical); border: 1px solid #fecaca; }
.badge-host-down     { background: var(--critical-bg); color: var(--critical); border: 1px solid #fecaca; }
.badge-host-error    { background: var(--error-bg);    color: var(--error);    border: 1px solid var(--border); }
.badge-host-pending  { background: var(--surface2);    color: var(--muted);    border: 1px solid var(--border); }

.btn-add-host {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-add-host:hover { background: var(--accent-h); }

.host-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}
/* Tarjeta seleccionable por métrica — se ilumina al marcarse */
.metric-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.metric-chip input { display: none; }
.metric-chip svg { width: 18px; height: 18px; flex-shrink: 0; }
.metric-chip:hover { border-color: var(--border2); color: var(--text2); }
.metric-chip:has(input:checked) {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

/* Matriz de umbrales: métrica × (advertencia | crítico) */
.threshold-grid {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  gap: 10px 12px;
  align-items: center;
}
.threshold-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.threshold-metric { font-size: 13px; font-weight: 600; color: var(--text2); }
.threshold-grid input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.threshold-grid input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.host-test-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.host-test-result { font-size: 13px; font-weight: 600; color: var(--muted); }
.host-test-result.ok  { color: var(--ok); }
.host-test-result.err { color: var(--critical); }

/* ── Configuración: tarjetas Email / SMS ── */
.cfg-cards { display: flex; gap: 14px; margin-top: 8px; }
.cfg-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  text-align: center;
}
.cfg-card:hover { border-color: var(--accent); background: var(--accent-bg); transform: translateY(-2px); }
.cfg-card svg { color: var(--accent); }
.cfg-card-title { font-size: 16px; font-weight: 700; color: var(--text); }
.cfg-card-sub { font-size: 12px; color: var(--muted); }

/* ── CelcomHost: sub-navegación (Servidores/Grupos/Horarios) ── */
.hostsub-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: -8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.hostsub-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.hostsub-btn:hover { color: var(--text2); }
.hostsub-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Inputs de hora consistentes con el resto (el nativo se ve feo por defecto) */
input[type="time"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input[type="time"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: .45;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: opacity .15s, background .15s;
}
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: .9;
  background: var(--border);
}

/* Días de la semana como chips seleccionables (más grandes y alineados) */
.sch-days { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.sch-days label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.sch-days label:hover { border-color: var(--border2); }
.sch-days label:has(input:checked) { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.sch-days input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* Par de selects hora : minutos */
.time-pick { display: flex; align-items: center; gap: 6px; }
.time-pick span { color: var(--muted); font-weight: 700; }
.time-pick .field-select { min-width: 0; flex: 0 0 60px; text-align: center; padding: 7px 8px; }

/* El form de agregar (check/grupo/horario) hace wrap para acomodar selects */
.hc-add-form { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
.hc-add-form .field-select { min-width: 130px; }
.hc-add-form .field-group { gap: 3px; }
.hc-add-form label { font-size: 11px; }
.hc-add-form input, .hc-add-form .field-select { padding: 7px 11px; font-size: 13px; }

/* ── CelcomHost: franja de acciones (totales + agregar) ── */
.host-actions-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.host-actions-bar .summary { margin: 0; }
.host-actions-bar .btn-add-host { padding: 8px 16px; }
#host-list-view, #host-detail-view { display: flex; flex-direction: column; }

/* Nombre del servidor como enlace + pill de cantidad de checks */
.host-name-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.host-name-link:hover { text-decoration: underline; }
.checks-pill {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.checks-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ── Vista detalle de un servidor (sus checks) ── */
.host-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.host-detail-title h2 { font-size: 18px; font-weight: 700; color: var(--text); }
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.btn-back:hover { background: var(--border); border-color: var(--border2); }

/* Formulario para agregar un check */
.hc-add-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.hc-add-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Tabla de checks */
/* Filas más compactas en la tabla de servidores y en la de checks */
#host-table td { padding: 7px 16px; }
.hc-table td, .hc-table th { padding: 7px 14px; }
.hc-table td { vertical-align: top; }
.hc-disabled { font-size: 12px; color: var(--muted2); font-style: italic; }
.hc-exit { display: inline-block; font-size: 11px; color: var(--muted2); margin-top: 4px; }
.hc-cmd {
  font-size: 12px;
  color: var(--text2);
  word-break: break-all;
}
.hc-output {
  margin: 0;
  font-size: 12px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  background: none;
  color: var(--text2);
  padding: 0;
  max-height: 90px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Perfil de solo lectura: ocultar todo control de modificación ──────────── */
body.role-viewer .admin-only { display: none !important; }

/* ── Gestión de usuarios ───────────────────────────────────────────────────── */

/* Formulario "crear usuario" */
.users-create {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; margin-bottom: 22px;
}
.users-create-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 14px;
}
.users-create-grid {
  display: grid; grid-template-columns: 1fr 1fr 180px; gap: 14px; margin-bottom: 16px;
}
.users-create-grid .field-group { margin: 0; }
.users-create-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.users-create-foot .btn-save { flex: 0 0 auto; }
@media (max-width: 620px) { .users-create-grid { grid-template-columns: 1fr; } }

/* Tabla de usuarios */
.users-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.users-table th {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em;
}
.users-table td {
  padding: 12px; border-bottom: 1px solid var(--border);
  font-size: 14px; vertical-align: middle;
}
.users-table tbody tr { transition: background .15s; }
.users-table tbody tr:hover { background: var(--surface2); }
.users-table tbody tr:last-child td { border-bottom: none; }
.u-name { font-weight: 600; color: var(--text); }
.u-you  { font-weight: 400; color: var(--muted); font-size: 12px; }

/* Selector de perfil con flecha propia (no el feo del navegador) */
.role-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 30px 6px 14px; font-size: 13px; font-weight: 600;
  color: var(--text2); cursor: pointer; outline: none; transition: all .15s;
}
.role-select:hover  { border-color: var(--border2); }
.role-select:focus  { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* Insignias de estado (2FA / cuenta) */
.u-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.u-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.u-badge.on      { background: var(--ok-bg); color: var(--ok); }
.u-badge.off     { background: var(--surface2); color: var(--muted); }
.u-badge.pending { background: var(--warning-bg); color: var(--warning); }
.u-2fa-none      { color: var(--muted2); font-size: 13px; }

/* Casilla "Exigir 2FA" del formulario de crear usuario */
.nu-2fa-check {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text2);
  user-select: none;
}
.nu-2fa-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* Acciones como enlaces sobrios (más limpio que cajitas) */
.user-actions {
  display: flex; column-gap: 14px; row-gap: 6px; align-items: center;
  justify-content: flex-end; flex-wrap: wrap;
}
.u-link {
  background: none; border: none; padding: 0; cursor: pointer; white-space: nowrap;
  color: var(--accent); font-size: 13px; font-weight: 600; transition: color .15s;
}
.u-link:hover        { color: var(--accent-h); text-decoration: underline; }
.u-link.danger       { color: var(--critical); }
.u-link.danger:hover { color: #b91c1c; }
.u-link.muted        { color: var(--muted); }
.u-link.muted:hover  { color: var(--text2); }

/* ── Campo de contraseña con "ojito" para mostrar/ocultar ──────────────────── */
.pwd-wrap { position: relative; }
.pwd-wrap input { width: 100%; padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 5px; display: inline-flex; align-items: center; border-radius: 6px;
  transition: color .15s, background .15s;
}
.pwd-eye:hover { color: var(--text2); background: var(--surface2); }
.pwd-eye .eye-hide { display: none; }
.pwd-eye.on .eye-show { display: none; }
.pwd-eye.on .eye-hide { display: inline-flex; }
