@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --page: #10161a;
  --surface: #1a2227;
  --surface-2: #222b30;
  --ink: #f5f7f7;
  --ink-2: #b9c2c4;
  --muted: #8a9298;
  --border: rgba(255,255,255,0.10);
  --accent: #8a9a5b;
  --accent-ink: #10140b;
  --gold: #d9a441;
  --warning: #d9a441;
  --warning-soft: #2e2b20;
  --critical: #c0553f;
  --critical-soft: #2a1f20;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 20px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.display { font-family: "Big Shoulders Display", sans-serif; letter-spacing: 0.01em; }
a { color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 24px 64px; }

header.top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 14px; padding: 18px 24px; margin-bottom: 20px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 14px; box-shadow: var(--shadow); border-bottom: 3px solid var(--gold);
}
header.top h1 {
  font-family: "Big Shoulders Display", sans-serif; font-weight: 800; font-size: 26px;
  letter-spacing: 0.02em; margin: 0;
}
header.top .sub { font-size: 12.5px; opacity: 0.85; margin-top: 2px; }
header.top .userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; }

nav.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
nav.tabs a {
  padding: 10px 16px; font-size: 13px; font-weight: 700; text-decoration: none;
  color: var(--muted); border-bottom: 2px solid transparent; letter-spacing: 0.03em;
}
nav.tabs a.active { color: var(--ink); border-bottom-color: var(--gold); }
nav.tabs a:hover { color: var(--ink); }

.btn {
  font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
  border-radius: 9px; border: 1px solid var(--border); padding: 9px 15px;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--surface-2); color: var(--ink);
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--gold); }
.btn-danger { background: var(--critical-soft); color: var(--critical); border-color: var(--critical); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 820px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.tile .label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.tile .value { font-family: "Big Shoulders Display", sans-serif; font-weight: 800; font-size: 32px; margin-top: 4px; }
.tile .value.critical { color: var(--critical); }
.tile .value.warning { color: var(--warning); }
.tile .foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.statuspill {
  display: block; text-decoration: none; border-radius: 12px; padding: 12px 16px;
  border: 2px solid transparent; box-shadow: var(--shadow); transition: border-color .12s;
}
.statuspill.critical { background: var(--critical-soft); }
.statuspill.critical .num, .statuspill.critical .lbl { color: var(--critical); }
.statuspill.warning { background: var(--warning-soft); }
.statuspill.warning .num, .statuspill.warning .lbl { color: var(--warning); }
.statuspill.active { border-color: currentColor; }
.statuspill .num { font-family: "Big Shoulders Display", sans-serif; font-weight: 800; font-size: 28px; display: block; }
.statuspill .lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

.chipgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 20px; }
.chip {
  display: flex; flex-direction: column; gap: 5px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.chip.active { background: var(--accent); border-color: var(--gold); }
.chip.active .tail, .chip.active .hoja { color: var(--accent-ink); }
.chip .row1 { display: flex; align-items: center; gap: 6px; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip .tail { font-family: "IBM Plex Mono", monospace; font-weight: 700; font-size: 13px; color: var(--ink); }
.chip .hoja { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num { font-family: "IBM Plex Mono", monospace; white-space: nowrap; }
table.data td.actions { white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); white-space: nowrap; }
.tag.alta { background: var(--critical-soft); color: var(--critical); }

form.formgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
@media (max-width: 700px) { form.formgrid { grid-template-columns: 1fr; } }
form.formgrid .full { grid-column: 1 / -1; }
form.formgrid label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 5px; }
form.formgrid input[type=text], form.formgrid input[type=number], form.formgrid select, form.formgrid textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; color: var(--ink); font: inherit; font-size: 13.5px;
}
form.formgrid textarea { min-height: 64px; resize: vertical; font-family: "IBM Plex Mono", monospace; font-size: 12.5px; }
form.formgrid input:focus, form.formgrid select:focus, form.formgrid textarea:focus { outline: 2px solid var(--accent); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px 30px; width: 100%; max-width: 360px; box-shadow: var(--shadow); border-top: 3px solid var(--gold); }
.login-card h1 { font-family: "Big Shoulders Display", sans-serif; font-size: 24px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.03em; }
.field input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--ink); font: inherit; }
.field input:focus { outline: 2px solid var(--accent); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: var(--critical-soft); color: var(--critical); border: 1px solid var(--critical); }
.alert-ok { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--gold); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-2); }
.footnote { font-size: 11.5px; color: var(--muted); margin-top: 18px; }
