:root {
  --navy: #092139;
  --teal: #00b8a9;
  --blue: #0f8bea;
  --ink: #102033;
  --muted: #64748b;
  --line: #dbe7f1;
  --bg: #f4f9fb;
  --card: #ffffff;
  --danger: #e11d48;
  --ok: #059669;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }

.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #062b2c; color: #dff9f7; padding: 28px 18px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 22px; margin-bottom: 34px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--teal), var(--blue)); display: grid; place-items: center; color: white; }
.nav button { width: 100%; text-align: left; padding: 13px 14px; border-radius: 8px; margin: 4px 0; background: transparent; color: #dff9f7; font-weight: 750; }
.nav button.active { background: #eafdfa; color: #052b2c; }
.side-note { margin-top: 30px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 14px; color: #bdece7; line-height: 1.45; font-size: 13px; }

.main { padding: 26px; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 30px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: #e8fff7; color: #067857; font-weight: 800; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(15, 54, 84, .06); }
.metric { padding: 18px; }
.metric span { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.metric strong { display: block; margin-top: 8px; font-size: 30px; }
.panel { padding: 20px; margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel h2 { margin: 0; font-size: 20px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.field label { color: #28445f; font-weight: 750; font-size: 13px; }
.field input, .field textarea, .field select { border: 1px solid #c9d8e7; border-radius: 8px; padding: 12px 13px; background: white; color: var(--ink); min-width: 0; }
.field textarea { min-height: 180px; resize: vertical; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { border-radius: 8px; padding: 11px 15px; font-weight: 850; background: var(--blue); color: white; display: inline-flex; align-items: center; gap: 8px; }
.btn.secondary { background: #e9f2fb; color: #12324e; }
.btn.ghost { background: white; border: 1px solid #c9d8e7; color: #12324e; }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { padding: 12px 13px; border-bottom: 1px solid #edf2f7; text-align: left; vertical-align: top; }
th { background: #f8fbfd; color: #46617b; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
td { font-size: 14px; }
.status { border-radius: 999px; padding: 5px 9px; font-weight: 850; font-size: 12px; display: inline-block; }
.status.running, .status.sent, .status.completed { background: #e8fff7; color: #047857; }
.status.failed { background: #fff1f2; color: #be123c; }
.status.paused, .status.draft, .status.queued { background: #eef6ff; color: #1d4ed8; }
.progress { height: 8px; border-radius: 999px; background: #e7eef5; overflow: hidden; min-width: 130px; }
.progress b { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); width: 0%; }
.hidden { display: none !important; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 20%, #c9fff3, transparent 30%), radial-gradient(circle at 80% 10%, #d7eaff, transparent 32%), var(--bg); }
.login-box { width: min(420px, 100%); padding: 28px; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 750; }
.success { color: var(--ok); font-weight: 750; }
.notice { padding: 12px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; color: #9a3412; margin-bottom: 14px; }
iframe.preview { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 8px; background: white; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 1fr; }
}
