/* Status page pública de FIDI. Misma identidad que hubx y FidiX Ops (tokens.css). Sin estilos en línea (CSP). */
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { background: var(--background); color: var(--fg); font: 15px/1.5 var(--f-sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
h2 { font: 600 18px var(--f-disp); letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* Cabecera */
.hero { background: var(--hero); color: var(--on-hero); padding-bottom: 28px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 26px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { font: 700 13px var(--f-disp); letter-spacing: .12em; padding: 4px 8px; border-radius: 6px; background: var(--brand-500); color: #fff; }
.brand-name { font: 600 17px var(--f-disp); letter-spacing: -.01em; }
.hero-actions { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; text-decoration: none; }
.btn-hero { background: var(--brand-500); color: #fff; }
.btn-hero:hover { background: var(--brand-600); }
.btn-hero-ghost { background: rgb(255 255 255 / .08); color: var(--on-hero); }
.btn-hero-ghost:hover { background: rgb(255 255 255 / .14); }
.btn-primary { background: var(--brand-500); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-primary[disabled] { opacity: .6; cursor: default; }

/* Estado general */
.overall { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 14px; background: var(--hero-2); border: 1px solid rgb(255 255 255 / .06); }
.overall-icon { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--nb-500); position: relative; }
.overall-icon::after { content: ""; width: 14px; height: 8px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) translate(1px, -2px); }
.overall-icon.st-operational { background: var(--ok-600); }
.overall-icon.st-degraded, .overall-icon.st-partial_outage { background: var(--warn-500); }
.overall-icon.st-major_outage { background: var(--err-600); }
.overall-icon.st-maintenance { background: var(--cyan-fg); }
.overall-icon:not(.st-operational)::after { width: 4px; height: 16px; border: 0; background: #fff; border-radius: 2px; transform: none; }
.overall-title { font: 600 22px/1.25 var(--f-disp); letter-spacing: -.01em; }
.overall-sub { color: var(--on-hero-muted); font-size: 13px; margin-top: 2px; }

/* Cuerpo */
.main { flex: 1; display: grid; gap: 34px; padding-top: 28px; padding-bottom: 48px; }
.block { display: grid; gap: 12px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.stack:empty { display: none; }
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: var(--shadow); }
.note { padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.note-info { background: var(--cyan-bg); color: var(--cyan-fg); }
.note-warn { background: var(--warn-100); color: var(--warn-700); }
.link { color: var(--brand-600); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.link-quiet { text-decoration: none; }
.link-quiet:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 16px 18px; font-size: 14px; }

/* Grupos y monitores */
.groups { overflow: hidden; }
.group + .group { border-top: 1px solid var(--line-soft); }
.group-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 18px; text-align: left; }
.group-head:hover { background: var(--surface); }
.group-name { font: 600 15px var(--f-disp); flex: 1; }
.chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.group[data-open="true"] .chev { transform: rotate(45deg); }
.group-body { display: none; }
.group[data-open="true"] .group-body { display: block; }
.monitor { padding: 12px 18px 14px; border-top: 1px solid var(--line-soft); }
.monitor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.monitor-name { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.monitor-name .info { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 14px; text-align: center; flex: none; }
.monitor-desc { color: var(--muted); font-size: 13px; margin: -4px 0 8px; }
.monitor-uptime { font-size: 13px; color: var(--muted); white-space: nowrap; }
.monitor-uptime b { color: var(--fg); font-weight: 600; }

.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state.st-operational { color: var(--ok-600); }
.state.st-degraded, .state.st-partial_outage { color: var(--warn-700); }
.state.st-major_outage { color: var(--err-600); }
.state.st-maintenance { color: var(--cyan-fg); }
.state.st-no_data { color: var(--muted); }

/* Barras de 90 días */
.bars { display: flex; gap: 2px; height: 32px; }
.bar { flex: 1; min-width: 2px; border-radius: 2px; background: var(--nb-200); cursor: default; }
.bar:hover, .bar:focus-visible { opacity: .75; outline: none; }
.st-operational.bar, .sw.st-operational { background: var(--ok-600); }
.st-degraded.bar, .sw.st-degraded { background: #f2c94c; }
.st-partial_outage.bar, .sw.st-partial_outage { background: var(--warn-500); }
.st-major_outage.bar, .sw.st-major_outage { background: var(--err-600); }
.st-maintenance.bar, .sw.st-maintenance { background: #4f9fc0; }
.st-no_data.bar, .sw.st-no_data { background: var(--nb-200); }
.bars-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.bars-foot .line { flex: 1; height: 1px; background: var(--line-soft); margin: 9px 10px 0; }
.r30 { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Avisos y mantenciones */
.notice { padding: 16px 18px; }
.notice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.notice-title { font: 600 16px var(--f-disp); letter-spacing: -.01em; }
.notice-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.notice.live { border-left: 4px solid var(--warn-500); }
.notice.live.imp-major_outage { border-left-color: var(--err-600); }
.notice.live.imp-degraded { border-left-color: #f2c94c; }
.notice.maint { border-left: 4px solid #4f9fc0; }
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; background: var(--surface); color: var(--muted); }
.badge.b-investigating, .badge.b-identified { background: var(--warn-100); color: var(--warn-700); }
.badge.b-monitoring { background: var(--cyan-bg); color: var(--cyan-fg); }
.badge.b-resolved { background: var(--ok-100); color: var(--ok-600); }
.badge.b-scheduled, .badge.b-in_progress { background: var(--cyan-bg); color: var(--cyan-fg); }
.badge.b-completed { background: var(--surface); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--muted); }
.updates { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 12px; }
.updates li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.updates .u-status { font-weight: 600; font-size: 13px; }
.updates .u-time { color: var(--muted); font-size: 12px; }
.updates p { font-size: 14px; }
details.notice > summary { list-style: none; cursor: pointer; }
details.notice > summary::-webkit-details-marker { display: none; }
details.notice[open] .notice-title { color: var(--brand-600); }
.day { display: grid; gap: 8px; }
.day-title { font-size: 13px; font-weight: 600; color: var(--muted); padding-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.day-empty { font-size: 14px; color: var(--muted); }
.month { display: grid; gap: 10px; }
.month-title { font: 600 15px var(--f-disp); }

/* Formulario de reporte */
.report { padding: 18px; display: grid; gap: 14px; }
.report-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.report-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.report-form .full { grid-column: 1 / -1; }
.field { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); min-width: 0; font-weight: 400; }
.field:focus { outline: 2px solid var(--brand-500); outline-offset: 0; }
textarea.field { resize: vertical; }
.report-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg-ok { color: var(--ok-600); }
.msg-err { color: var(--err-600); }

/* Tooltip de las barras */
.tooltip { position: fixed; z-index: 30; max-width: 280px; background: var(--hero); color: var(--on-hero); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; box-shadow: var(--shadow); pointer-events: none; }
.tooltip .t-date { font-weight: 700; margin-bottom: 4px; }
.tooltip .t-line { color: var(--on-hero-muted); }
.tooltip .t-inc { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgb(255 255 255 / .12); }

.footer { border-top: 1px solid var(--line); padding: 18px 0; font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Móvil: 30 días en vez de 90 */
@media (max-width: 640px) {
  .overall { padding: 16px; }
  .overall-title { font-size: 19px; }
  .bars .bar:nth-child(-n+60) { display: none; }
  .r90 { display: none; }
  .r30 { display: inline; }
  .monitor-head { flex-wrap: wrap; }
  .report-form { grid-template-columns: 1fr; }
  .updates li { grid-template-columns: 1fr; gap: 2px; }
  .hero-actions .btn-hero { display: none; }
}
