:root {
  --bg: #071018;
  --bg-2: #0b1724;
  --panel: #102033;
  --panel-2: #163047;
  --line: #274766;
  --text: #eef5fb;
  --muted: #8ea5bd;
  --accent: #4ee0c2;
  --accent-2: #7cb8ff;
  --ok: #5ee09a;
  --warn: #f3c15b;
  --danger: #ff7a88;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background:
  radial-gradient(1100px 520px at 8% -8%, #18486b 0%, transparent 46%),
  radial-gradient(900px 480px at 100% 0%, #123a4e 0%, var(--bg) 42%);
  color: var(--text); }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.rail {
  background: linear-gradient(180deg, rgba(12, 32, 52, 0.96), rgba(6, 16, 28, 0.98));
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 800; letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #062018;
  box-shadow: 0 8px 24px rgba(78, 224, 194, 0.25);
}
.brand small { display: block; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; }
.rail nav { display: flex; flex-direction: column; gap: 6px; }
.rail nav a {
  color: var(--muted); padding: 11px 12px; border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
}
.rail nav a.active, .rail nav a:hover { background: var(--panel-2); color: var(--text); }
.nav-ico { width: 18px; opacity: 0.85; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }

main { padding: 28px 36px 56px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -0.03em; }
.topbar p, .muted { color: var(--muted); }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 12px; }

.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: 1.2fr .8fr; }
.span-2 { grid-column: span 2; }
.card {
  background: linear-gradient(180deg, rgba(16, 32, 51, 0.92), rgba(11, 23, 36, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.kpi-card { min-height: 112px; display: grid; align-items: center; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kpi { font-size: 32px; font-weight: 750; letter-spacing: -0.04em; }
.kpi small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tbody tr:hover { background: rgba(255,255,255,0.03); }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 9px; font-size: 12px; border: 1px solid transparent; }
.badge.ok, .badge.Sent, .badge.Succeeded, .badge.Healthy { color: #08351f; background: var(--ok); }
.badge.warn, .badge.Scheduled, .badge.Pending, .badge.Sending, .badge.Running, .badge.Degraded { color: #3d2c05; background: var(--warn); }
.badge.danger, .badge.Failed, .badge.Unhealthy { color: #4a0810; background: var(--danger); }
.badge.muted, .badge.SkippedDisabled, .badge.SkippedNoDestination, .badge.Cancelled, .badge.Unknown { color: var(--text); background: #2a3d52; }
.badge.on { background: rgba(78,224,194,0.16); color: var(--accent); border-color: rgba(78,224,194,0.35); }
.badge.off { background: rgba(255,122,136,0.12); color: var(--danger); border-color: rgba(255,122,136,0.3); }

.btn { border: 0; border-radius: 11px; padding: 9px 14px; cursor: pointer; background: var(--accent); color: #062018; font-weight: 700; display: inline-flex; align-items: center; }
a.btn { color: #062018; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
a.btn.ghost { color: var(--text); }
.btn.danger { background: var(--danger); color: #2a0006; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar, .toolbar-form, .inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.inline-form { margin: 0; }
select, input, textarea { background: #0a1827; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
textarea { width: 100%; min-height: 90px; }
label { display: block; color: var(--muted); font-size: 12px; margin: 0 0 6px; }
.check-inline { display: flex; gap: 8px; align-items: center; margin-top: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.flag { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.hidden { display: none !important; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--panel-2); border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 20; }
.modal { position: fixed; inset: 0; background: rgba(4, 10, 18, 0.72); display: grid; place-items: center; z-index: 30; padding: 20px; }
.modal-card { width: min(760px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { margin: 0; display: flex; gap: 6px; align-items: center; color: var(--text); }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; color: #c5d8ea; word-break: break-all; }
.empty { color: var(--muted); padding: 18px 0; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .rail-foot { width: 100%; }
  .cards, .split { grid-template-columns: 1fr 1fr; }
  .form-grid, .span-2 { grid-column: auto; grid-template-columns: 1fr; }
}
