:root {
  color-scheme: light;
  --bg: #fafbf9;
  --paper: #fff;
  --text: #252c28;
  --muted: #626b64;
  --line: #dfe4dd;
  --brand: #39a900;
  --link: #286c0d;
  --success: #286c0d;
  --warning: #805819;
  --danger: #a3362f;
  --status-bg: #faf6ec;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171a18;
  --paper: #1d211e;
  --text: #e4e8e1;
  --muted: #a1aaa2;
  --line: #363d36;
  --link: #99d87b;
  --success: #99d87b;
  --warning: #e5be76;
  --danger: #ef9e98;
  --status-bg: #28251e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
.skip-link { position: absolute; left: 16px; top: -80px; padding: 12px; background: var(--paper); z-index: 5; }
.skip-link:focus { top: 8px; }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { max-width: 1040px; margin: auto; padding: 22px 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: flex; gap: 14px; align-items: center; font-size: 19px; font-weight: 650; letter-spacing: -.4px; }
.brand img { object-fit: contain; }
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: .1px; }
nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
nav > a { padding: 10px 0; color: var(--muted); border-bottom: 2px solid transparent; }
nav > a[aria-current] { color: var(--text); border-color: var(--brand); }
nav > a:hover { color: var(--link); }
.boton-tema { width: 40px; height: 40px; border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.boton-tema:hover { background: var(--bg); }
.boton-tema svg { width: 19px; height: 19px; }
.icono-sol { display: none; }
html[data-theme="dark"] .icono-sol { display: block; }
html[data-theme="dark"] .icono-luna { display: none; }
.page { max-width: 960px; padding: 0 32px; margin: 54px auto 72px; min-height: 60vh; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -1px; margin-bottom: 0; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.4; }
.update-note, .last-check, .chart-note { font-size: 13px; color: var(--muted); }
.update-note { padding-bottom: 3px; }
.service-status { border: 1px solid var(--line); border-left: 4px solid var(--warning); border-radius: 5px; padding: 30px 32px; background: var(--paper); }
.status-heading { display: flex; align-items: center; gap: 18px; }
.status-heading h2 { font-size: clamp(24px, 4vw, 30px); line-height: 1.2; font-weight: 600; letter-spacing: -.7px; margin: 0; }
.status-symbol { display: grid; place-items: center; color: var(--warning); width: 48px; height: 48px; flex-shrink: 0; background: var(--status-bg); border-radius: 50%; }
.status-symbol svg { width: 29px; height: 29px; }
.status-description { color: var(--muted); max-width: 65ch; margin: 22px 0 14px; }
.last-check { margin: 0; font-variant-numeric: tabular-nums; }
.is-available { border-left-color: var(--brand); }
.is-available .status-symbol { color: var(--success); background: transparent; }
.is-unavailable { border-left-color: var(--danger); }
.is-unavailable .status-symbol { color: var(--danger); background: transparent; }
.is-intermittent { border-left-color: var(--warning); }
.is-intermittent .status-symbol { color: var(--warning); background: transparent; }
.metrics { display: grid; grid-template-columns: 1fr 1fr 1.2fr; margin: 0; padding: 30px 0; border-bottom: 1px solid var(--line); gap: 24px; }
.metrics > div + div { border-left: 1px solid var(--line); padding-left: 24px; }
dt { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
dd { margin: 0; font-size: 23px; letter-spacing: -.4px; font-weight: 550; font-variant-numeric: tabular-nums; }
.metrics small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.metric-text { font-size: 16px; line-height: 1.6; letter-spacing: 0; }
.history-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.history-link h2 { margin-bottom: 3px; font-size: 16px; }
.history-link p { color: var(--muted); margin: 0; font-size: 14px; }
.history-link > span { color: var(--link); white-space: nowrap; font-size: 14px; }
.history-link:hover > span { text-decoration: underline; }
.method { margin-top: 24px; color: var(--muted); font-size: 13px; max-width: 75ch; }
summary { cursor: pointer; color: var(--text); padding: 8px 0; }
.method p { margin: 10px 0; }
.site-footer { border-top: 1px solid var(--line); max-width: 976px; margin: auto; padding: 24px 24px 32px; display: flex; gap: 20px; justify-content: space-between; color: var(--muted); font-size: 11px; }
.footer-dot { padding: 0 5px; }
.footer-admin { color: var(--muted); font-weight: 400; }
.footer-admin:hover { text-decoration: underline; }
.admin-card { max-width: 440px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); padding: 28px; }
.admin-card p { margin: 0 0 16px; }
.admin-form label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="date"],
.admin-form select { width: 100%; padding: 10px 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.admin-form button,
.admin-logout button { margin-top: 18px; padding: 10px 16px; border-radius: 4px; border: 1px solid transparent; background: var(--brand); color: #fff; cursor: pointer; }
.admin-logout button { margin-top: 4px; background: transparent; color: var(--text); border-color: var(--line); }
.admin-error { color: var(--danger); font-size: 14px; }
.admin-credentials { max-width: 520px; }
.admin-help { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.admin-field-error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.admin-status { margin: 0 0 16px; }
.admin-links { margin: 16px 0; }
.admin-links a { color: var(--link); }
.admin-links a:hover { text-decoration: underline; }
[data-branch-field][hidden] { display: none; }
.range-filter { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
select { padding: 9px 32px 9px 12px; background: var(--paper); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.history-metrics { grid-template-columns: repeat(4, 1fr); padding: 0 0 24px; margin-bottom: 28px; }
.chart-panel { border: 1px solid var(--line); border-radius: 5px; padding: 22px; background: var(--paper); }
.chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chart-heading h2 { font-size: 16px; margin-bottom: 8px; }
.legend { color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 14px; height: 3px; background: var(--brand); vertical-align: middle; margin-right: 5px; }
.chart-wrap { position: relative; height: 290px; width: 100%; }
.chart-note { margin: 12px 0 0; font-size: 12px; }
.checks-section { margin-top: 30px; }
.checks-section h2 { font-size: 16px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 0; }
td:last-child, th:last-child { text-align: right; }
.result-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--muted); margin-right: 7px; }
.result-dot.available { background: var(--brand); }
.result-dot.unavailable { background: var(--danger); }
.result-dot.intermittent { background: var(--warning); }
.admin-nav { display: flex; gap: 22px; margin: 0 0 28px; font-size: 14px; }
.admin-nav a { color: var(--muted); border-bottom: 2px solid transparent; padding: 8px 0; }
.admin-nav a[aria-current] { color: var(--text); border-bottom-color: var(--brand); }
.admin-nav a:hover { color: var(--link); }
.admin-reports { max-width: 520px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.report-actions button { margin-top: 18px; }
.report-actions button[formaction] { background: transparent; color: var(--text); border-color: var(--line); }
.report-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 28px; }
.report-toolbar a,
.report-toolbar button { font-size: 14px; color: var(--link); background: transparent; border: 0; padding: 0; cursor: pointer; }
.report-toolbar .admin-logout { margin-left: auto; }
.report-toolbar .admin-logout button { margin-top: 0; }
.report-sheet h2 { margin: 32px 0 14px; }
.report-sheet h3 { font-size: 16px; font-weight: 600; margin: 22px 0 10px; }
.report-sheet h4 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.report-facts { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 8px 16px; margin: 0; }
.report-facts dt { margin: 0; }
.report-facts dd { margin: 0; }
.report-metrics { margin-top: 8px; }
.report-metrics dd { font-size: 20px; }
.report-types { margin: 8px 0 0; padding-left: 18px; }
.report-code { display: block; color: var(--muted); font-size: 12px; }
.report-url { overflow-wrap: anywhere; }
.report-incident { margin-top: 22px; padding-top: 8px; border-top: 1px solid var(--line); }
.report-table { font-variant-numeric: tabular-nums; }
.report-table td:last-child,
.report-table th:last-child { text-align: left; }
@media print {
  .no-print, .site-header, .site-footer, .skip-link { display: none !important; }
  body { background: #fff; color: #111; }
  .page { max-width: none; margin: 0; padding: 0; }
  .report-sheet h2 { margin-top: 18px; }
  .report-incident, .report-facts, tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .report-table { font-size: 11px; }
}
@media (max-width: 620px) {
  .header-inner { padding: 16px 20px; gap: 12px; }
  .brand { gap: 8px; font-size: 16px; }
  .brand img { width: 32px; height: 32px; }
  .brand small { display: none; }
  nav { gap: 14px; font-size: 13px; }
  .boton-tema { width: 36px; height: 36px; }
  .page { padding: 0 20px; margin-top: 32px; margin-bottom: 42px; }
  .page-heading { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  h1 { font-size: 28px; }
  .service-status { padding: 24px 20px; }
  .status-heading { gap: 12px; }
  .status-symbol { width: 40px; height: 40px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 20px; }
  .metrics > div + div { border-left: 0; padding-left: 0; }
  .metrics > div:last-child { grid-column: 1 / -1; }
  .history-metrics > div:last-child { grid-column: auto; }
  dd { font-size: 21px; }
  .metric-text { font-size: 16px; }
  .history-link { flex-direction: column; align-items: start; gap: 12px; }
  .chart-panel { padding: 16px 12px; }
  .chart-heading { align-items: start; flex-direction: column; gap: 0; }
  .chart-wrap { height: 240px; }
  .site-footer { margin: 0 20px; padding: 20px 0; flex-direction: column; gap: 4px; }
  .report-facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .service-status { animation: appear 220ms ease-out; }
  @keyframes appear { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
}
