/* Status page — Expertium (Sprint 47 #135)
   Diseño: claro, profesional, legible en móvil, sin dependencias. */

:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1a1d21;
  --sub: #6b7280;
  --border: #e5e7eb;
  --accent: #00b89c;
  --green: #16a34a;
  --yellow: #eab308;
  --red: #dc2626;
  --blue: #2563eb;
  --purple: #7c3aed;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.03);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f12;
    --card: #14171c;
    --text: #e6e9ee;
    --sub: #8a929c;
    --border: #23272e;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 'Syne', sans-serif;
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 920px; margin: 0 auto; padding: 0 16px; }

.header {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.brand-mark { font-size: 11px; color: var(--accent); letter-spacing: 0.18em; font-family: monospace; }
.brand-sub   { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.back-link   { color: var(--sub); font-size: 13px; text-decoration: none; font-family: monospace; }
.back-link:hover { color: var(--accent); }

.main { padding: 32px 0 60px; }

/* Overall */
.overall {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 24px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--sub);
  margin-bottom: 28px;
  transition: border-color .3s;
}
.overall.loading        { border-left-color: var(--sub); }
.overall.operational    { border-left-color: var(--green); }
.overall.minor_issue    { border-left-color: var(--yellow); }
.overall.partial_outage { border-left-color: var(--yellow); }
.overall.major_outage   { border-left-color: var(--red); }
.overall.maintenance    { border-left-color: var(--blue); }

.overall-indicator {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--sub);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
.overall.operational    .overall-indicator { background: var(--green); }
.overall.minor_issue    .overall-indicator { background: var(--yellow); }
.overall.partial_outage .overall-indicator { background: var(--yellow); }
.overall.major_outage   .overall-indicator { background: var(--red); }
.overall.maintenance    .overall-indicator { background: var(--blue); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 8px transparent; opacity: 0.6; }
}

.overall h1 { font-size: 20px; margin: 0 0 2px; font-weight: 800; }
.overall-sub { font-size: 13px; color: var(--sub); margin: 0; }

/* Sections */
.section { margin-bottom: 32px; }
.section.hidden { display: none; }
.section-title { font-size: 14px; font-weight: 700; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sub); }
.section-sub   { font-size: 12px; color: var(--sub); margin: 0 0 12px; }

/* Components */
.components { display: grid; gap: 10px; }
.component {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px;
}
.component.skeleton { height: 58px; opacity: 0.4; background: linear-gradient(90deg, var(--card) 0%, var(--bg) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.component-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.component-name { font-weight: 700; font-size: 15px; }
.component-desc { font-size: 12px; color: var(--sub); }
.component-error{ font-size: 11px; color: var(--red); margin-top: 4px; font-family: monospace; }
.component-status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sub); }
.dot.operational { background: var(--green); }
.dot.degraded    { background: var(--yellow); }
.dot.outage      { background: var(--red); }
.dot.unknown     { background: var(--sub); }
.status-operational { color: var(--green); }
.status-degraded    { color: var(--yellow); }
.status-outage      { color: var(--red); }
.status-unknown     { color: var(--sub); }

/* Incidents */
.incidents { display: grid; gap: 10px; }
.incident {
  padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--sub);
  border-radius: 10px;
}
.incident.severity-minor       { border-left-color: var(--yellow); }
.incident.severity-major       { border-left-color: var(--red); }
.incident.severity-critical    { border-left-color: var(--red); }
.incident.severity-maintenance { border-left-color: var(--blue); }

.incident-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.incident-title { font-weight: 700; font-size: 15px; margin: 0; }
.incident-meta  { font-size: 11px; color: var(--sub); font-family: monospace; }
.incident-desc  { font-size: 13px; color: var(--sub); margin-top: 6px; }
.incident-updates { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.incident-update { font-size: 12px; padding: 4px 0; color: var(--sub); }
.incident-update-time { font-family: monospace; font-size: 10px; color: var(--accent); margin-right: 6px; }

.sev-pill {
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.06em; font-family: monospace; font-weight: 700;
  margin-left: 6px;
}
.sev-pill.severity-minor       { color: var(--yellow); border-color: var(--yellow); }
.sev-pill.severity-major       { color: var(--red); border-color: var(--red); }
.sev-pill.severity-critical    { color: #fff; background: var(--red); border-color: var(--red); }
.sev-pill.severity-maintenance { color: var(--blue); border-color: var(--blue); }

/* History grid */
.history-grid { display: grid; gap: 16px; }
.history-component { padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.history-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 10px; }
.history-name { font-weight: 700; font-size: 14px; }
.history-uptime { font-family: monospace; font-size: 12px; color: var(--sub); }
.history-bars { display: flex; gap: 2px; height: 28px; flex-wrap: nowrap; overflow-x: auto; }
.history-bar {
  flex: 1 0 5px; min-width: 5px; max-width: 14px;
  border-radius: 2px;
  background: var(--border);
  cursor: help;
}
.history-bar.operational { background: var(--green); }
.history-bar.degraded    { background: var(--yellow); }
.history-bar.outage      { background: var(--red); }

/* Footer */
.footer { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--sub); font-size: 12px; }
.footer p { margin: 4px 0; }
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-sub { font-family: monospace; font-size: 11px; opacity: 0.8; }

/* Responsive */
@media (max-width: 520px) {
  .component { flex-direction: column; align-items: flex-start; gap: 8px; }
  .component-status { align-self: flex-end; }
  .overall { flex-direction: column; text-align: center; gap: 10px; }
}
