:root {
  --brand: #a78bfa;   --accent: #c4b5fd;
  --bg: #0e0b16;      --bg2: #15111f;   --card: #1a1526;  --card2: #201a2e;
  --border: #2a2338;  --border2: #362d49;
  --text: #ede9f7;    --label: #b3aac6; --muted: #7a7290;
  --ok: #66e08a;      --warn: #ffc24b;  --err: #ff7a94;   --info: #8fb7ff;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #1c1430 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5; min-height: 100vh;
}
a { color: var(--accent); }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 22px; background: rgba(14,11,22,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 18px; letter-spacing: .2px; }
.brand .moon { color: var(--brand); font-size: 20px; }
.brand b { font-weight: 700; }
.brand .sub { color: var(--muted); font-weight: 500; }
.who { font-size: 13px; color: var(--label); text-align: right; }
.who .dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--ok); margin-right:6px; vertical-align: middle;}
.who.off .dot { background: var(--warn); }
.who small { color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 57px; z-index: 15; overflow-x: auto; }
.tabs button {
  appearance: none; background: none; border: none; color: var(--label);
  padding: 14px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--brand); }

main { max-width: 1000px; margin: 0 auto; padding: 22px 18px 60px; }
.tab.hidden { display: none; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.section-head h2 { font-size: 18px; margin: 0; font-weight: 700; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* Buttons */
.btn { appearance: none; border: 1px solid var(--border2); background: var(--card2); color: var(--text);
  padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: linear-gradient(180deg, #7c5cf0, #6d4de0); border-color: #7c5cf0; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 6px 8px; }
.btn.ghost:hover { color: var(--err); border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* Cards / lists */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

.stat { padding: 16px; }
.stat .label { color: var(--label); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .value .unit { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 5px; }
.stat .foot { margin-top: 10px; display: flex; gap: 6px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
.stat:hover .foot { opacity: 1; }
.stat .meta { color: var(--muted); font-size: 11px; margin-top: 8px; }

/* Timeline (cambios) */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.entry { padding: 14px 16px; display: flex; gap: 14px; }
.entry .when { min-width: 92px; color: var(--muted); font-size: 12px; padding-top: 2px; }
.entry .main { flex: 1; min-width: 0; }
.entry .main h3 { margin: 0 0 4px; font-size: 15px; }
.entry .main .body { color: var(--label); font-size: 13.5px; white-space: pre-wrap; }
.entry .main .by { color: var(--muted); font-size: 11.5px; margin-top: 8px; }
.entry .acts { opacity: 0; transition: opacity .12s; }
.entry:hover .acts { opacity: 1; }

/* Incidents */
.inc { padding: 14px 16px; }
.inc .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc h3 { margin: 8px 0 4px; font-size: 15px; }
.inc .body { color: var(--label); font-size: 13.5px; white-space: pre-wrap; }
.inc .resolution { margin-top: 8px; padding: 8px 10px; background: var(--bg2); border-radius: 8px; font-size: 13px; color: var(--label); border-left: 2px solid var(--ok); }
.inc .by { color: var(--muted); font-size: 11.5px; margin-top: 8px; display:flex; gap:8px; justify-content: space-between; align-items:center; }
.inc.done { opacity: .72; }

/* Services */
.svc { padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.svc .sdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.svc .sname { font-weight: 600; }
.svc .ver { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.svc .note { color: var(--label); font-size: 12.5px; }
.svc .acts { margin-left: auto; opacity: 0; transition: opacity .12s; }
.svc:hover .acts { opacity: 1; }
.list { display: flex; flex-direction: column; gap: 8px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid var(--border2); color: var(--label); background: var(--card2); text-transform: capitalize; }
.chip.config { color: var(--accent); border-color: #4a3f6b; }
.chip.plugin { color: #7fd7ff; border-color: #2a5566; }
.chip.servidor { color: var(--ok); border-color: #2f5e40; }
.chip.evento { color: #ffb3e6; border-color: #6b3a5a; }
.chip.incidente, .chip.critico, .chip.offline, .chip.grave { color: var(--err); border-color: #6b2f3d; }
.chip.warn, .chip.abierto, .chip.degradado, .chip.leve { color: var(--warn); border-color: #6b5a2f; }
.chip.en_curso, .chip.info { color: var(--info); border-color: #33456b; }
.chip.resuelto, .chip.online { color: var(--ok); border-color: #2f5e40; }

.empty { text-align: center; color: var(--muted); padding: 44px 10px; }

/* Banner */
.banner { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; font-size: 13px; background: rgba(255,194,75,.08); border: 1px solid #6b5a2f; color: var(--warn); }
.banner.hidden { display: none; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6,4,12,.6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 40; }
.modal-backdrop.hidden { display: none; }
.modal { width: 100%; max-width: 520px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 16px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--border); font-size: 16px; }
.modal form { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.field label { display: block; font-size: 12px; color: var(--label); margin-bottom: 5px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--card); border: 1px solid var(--border2); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; font-family: inherit;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.err-msg { color: var(--err); font-size: 13px; min-height: 18px; }

@media (max-width: 560px) {
  .entry { flex-direction: column; gap: 6px; }
  .entry .when { padding-top: 0; }
  .who .email { display: none; }
}
