/* Ativa Uptime — Sistema de diseño (ADR-004) */
:root {
  --font: "Maven Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ativa-orange: #f57f26;
  --ativa-orange-600: #dc6a14;
  --ativa-orange-soft: rgba(245, 127, 38, 0.14);
  --ativa-slate: #5f6e7d;

  /* Panel oscuro derivado del slate */
  --bg: #12171d;
  --surface: #1a2129;
  --surface-2: #222b35;
  --border: #2c3744;
  --text: #e8edf2;
  --text-muted: #93a1af;

  /* Estados semánticos e independientes de la marca */
  --up: #22c55e;
  --up-soft: rgba(34, 197, 94, 0.15);
  --down: #ef4444;
  --down-soft: rgba(239, 68, 68, 0.15);
  --paused: #93a1af;
  --maintenance: #5f6e7d;
  --pending: #93a1af;
  --slow: #eab308;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration: none;
}

/* Modales nativos <dialog> (Modern Web Guidance: prevent-page-scroll-under-modal-dialog) */
dialog:modal {
  overscroll-behavior: contain;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 560px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(10, 14, 18, 0.72);
  backdrop-filter: blur(3px);
}

/* Layout principal con Sidebar tipo UptimeRobot + identidad Ativa */
.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sidebar-brand img {
  height: 30px;
  width: auto;
  display: block;
}

.sidebar-brand-title {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar-brand-title .dot,
.page-title .dot {
  color: var(--ativa-orange);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--ativa-orange-soft);
  color: var(--ativa-orange);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.user-pill-name {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill-version {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.main-content {
  padding: 1.75rem 2.25rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Botones (ADR-004: texto oscuro #12171d sobre naranja para cumplir contraste AA) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.05rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn:focus-visible,
.form-input:focus-visible {
  outline: 2px solid var(--ativa-orange);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--ativa-orange);
  color: #12171d;
}

.btn-primary:hover {
  background: var(--ativa-orange-600);
  color: #12171d;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--ativa-slate);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  width: 100%;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Tarjetas y grillas */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

.card-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.15;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.text-up { color: var(--up); }
.text-down { color: var(--down); }
.text-muted { color: var(--text-muted); }

/* Alertas y Banners */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 1.2rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.alert-danger {
  background: var(--down-soft);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

.alert-ok {
  background: var(--up-soft);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

.alert-warning {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.4);
  color: #fef08a;
}

/* Formularios y Pantallas de Login / Instalación */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top, #1b2430 0%, var(--bg) 65%);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
}

.auth-card-wide {
  max-width: 640px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.auth-logo img {
  height: 36px;
  width: auto;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}

.form-input[readonly] {
  opacity: 0.75;
  cursor: not-allowed;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.diag-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  divide-y: 1px solid var(--border);
}

.diag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.diag-item:last-child {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-up {
  background: var(--up-soft);
  color: var(--up);
}

.badge-down {
  background: var(--down-soft);
  color: var(--down);
}

/* Responsive (ADR-004) */
@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 50;
    width: 260px;
    left: 0;
    top: 0;
    bottom: 0;
  }
  .sidebar.is-open {
    display: flex;
  }
  .topbar-mobile {
    display: flex;
  }
  .main-content {
    padding: 1.25rem;
  }
}

/* Fase 2 — Vista de Monitores, 30 rayitas, filtros y panel derecho (ADR-004) */
.monitors-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 1.5rem;
  align-items: start;
}

.toolbar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.toolbar-search {
  flex: 1;
  min-width: 190px;
}

.toolbar-select {
  width: auto;
  min-width: 135px;
}

.bulk-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.bulk-bar {
  background: var(--surface-2);
  border: 1px solid var(--ativa-orange);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bulk-bar[hidden] {
  display: none !important;
}

.bulk-bar-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ativa-orange);
}

.monitor-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.monitor-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.monitor-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.15s ease;
}

.monitor-row:hover {
  border-color: var(--ativa-slate);
}

.monitor-row-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-up {
  background: var(--up);
  box-shadow: 0 0 0 4px var(--up-soft);
}

.status-dot-down {
  background: var(--down);
  box-shadow: 0 0 0 4px var(--down-soft);
}

.status-dot-maint {
  background: var(--ativa-slate);
}

.status-dot-paused {
  background: var(--paused);
}

.monitor-info {
  min-width: 0;
}

.monitor-title-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.monitor-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
}

.monitor-name:hover {
  color: var(--ativa-orange);
}

.tag-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.monitor-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.type-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-muted);
}

.monitor-row-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.interval-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 30 rayitas (sparkbars-30) */
.sparkbars-30 {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 22px;
}

.spark-tick {
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--border);
}

.spark-tick.is-up {
  background: var(--up);
}

.spark-tick.is-down {
  background: var(--down);
  height: 22px;
}

.spark-tick.is-empty {
  background: var(--surface-2);
  opacity: 0.6;
}

.uptime-pct-label {
  font-weight: 700;
  font-size: 0.88rem;
  min-width: 58px;
  text-align: right;
  color: var(--text);
}

.monitor-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-icon {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-icon:hover {
  color: var(--text);
  border-color: var(--ativa-slate);
}

.btn-icon-danger:hover {
  color: var(--down);
  border-color: var(--down);
}

.monitors-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.current-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.last24-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.last24-val {
  font-size: 1.3rem;
  font-weight: 800;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

/* Modal form layout */
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.contacts-checklist {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.advanced-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-top: 0.5rem;
  background: var(--surface-2);
}

.advanced-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}

.advanced-body {
  margin-top: 0.85rem;
}

.badge-neutral {
  background: var(--bg);
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .monitors-layout {
    grid-template-columns: 1fr;
  }
  .monitor-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .monitor-row-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Fase 3 — Detalle de Monitor e Incidentes Globales */
.detail-breadcrumb {
  margin-bottom: 0.65rem;
}

.detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.status-dot-lg {
  width: 16px;
  height: 16px;
}

.detail-subtitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.monitor-type-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 0.32rem 0.68rem;
  font-size: 0.78rem;
}

.badge-paused {
  background: var(--surface-2);
  color: var(--paused);
}

.badge-maintenance {
  background: var(--surface-2);
  color: var(--text);
}

.detail-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-stat-card {
  padding: 1.15rem 1.35rem;
}

.detail-stat-main {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0.25rem 0;
}

.detail-stat-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.detail-section {
  margin-bottom: 1.25rem;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.hourly-bars-24 {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 4px;
  height: 34px;
  align-items: stretch;
}

.bar-tick {
  border-radius: 3px;
  background: var(--surface-2);
  transition: transform 0.12s ease;
}

.bar-tick:hover {
  transform: scaleY(1.08);
}

.bar-up {
  background: var(--up);
}

.bar-warn {
  background: var(--slow);
}

.bar-down {
  background: var(--down);
}

.bar-empty {
  background: var(--surface-2);
  opacity: 0.55;
}

.bars-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.uptime-ranges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.uptime-range-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.uptime-range-val {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0.2rem 0;
}

.custom-range-form {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.custom-range-result {
  font-size: 0.88rem;
  color: var(--text);
  margin-left: 0.35rem;
}

.range-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.response-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.resp-metric-val {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: 0.15rem;
}

.response-chart-container {
  width: 100%;
  min-height: 190px;
}

.response-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.ssl-days {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.ssl-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ssl-meta strong {
  color: var(--text);
}

.contact-list-compact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.contact-list-compact li {
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Tablas de Incidentes */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
  font-weight: 700;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cause-code-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--down-soft);
  color: var(--down);
  margin-right: 0.35rem;
}

.cause-text {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.incident-monitor-link {
  color: var(--text);
  margin-right: 0.35rem;
}

.incident-monitor-link:hover {
  color: var(--ativa-orange);
}

.incident-comments-row td {
  background: var(--bg);
  padding: 1rem 1.25rem;
}

.incident-comments-box {
  border-left: 3px solid var(--ativa-orange);
  padding-left: 1rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.comment-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.comment-body {
  font-size: 0.88rem;
  color: var(--text);
}

.comment-add-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.comment-add-form .form-input {
  flex: 1;
  min-width: 220px;
}

@media (max-width: 860px) {
  .detail-cards-grid,
  .uptime-ranges-grid,
  .response-stats-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
 * Fase 5 y 6: Clases y utilidades del panel (Status Pages, Mantenciones, Sistema)
 * ============================================================================ */
.form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--ativa-orange);
}

.form-help {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table th,
.table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.text-right {
  text-align: right !important;
}

.text-xs {
  font-size: 0.78rem;
}

.fw-600 {
  font-weight: 600;
}

.link-primary {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.link-primary:hover {
  color: var(--ativa-orange);
}

.inline-form {
  display: inline-block;
  margin: 0;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: var(--down);
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.btn-danger:hover {
  background: var(--down);
  color: #ffffff;
}

.badge-neutral {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-warning {
  background: rgba(234, 179, 8, 0.14);
  color: var(--slow);
  border: 1px solid rgba(234, 179, 8, 0.32);
}

.badge-up {
  background: rgba(34, 197, 94, 0.14);
  color: var(--up);
}

.badge-paused {
  background: var(--surface-2);
  color: var(--paused);
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--up);
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--down);
}

dialog.modal {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  width: min(540px, 94vw);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

dialog.modal::backdrop {
  background: rgba(10, 14, 18, 0.75);
}

.modal-box {
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.95rem 1.35rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.card-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}


