:root {
  --green: #12805c; --green-d: #0f6b4e; --amber: #e08a12; --red: #c0392b;
  --bg: #f4f6f8; --card: #ffffff; --ink: #1f2430; --muted: #8a929c; --line: #e5e7eb;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 210px; background: #0e2b23; color: #cfe9df; padding: 18px 0;
  display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar .brand { font-weight: 700; font-size: 16px; padding: 6px 20px 18px; color: #fff; }
.sidebar a { color: #cfe9df; text-decoration: none; padding: 11px 20px; font-size: 14px; }
.sidebar a:hover { background: rgba(255,255,255,.06); }
.sidebar a.on { background: var(--green); color: #fff; font-weight: 600; }
.sidebar .logout { margin-top: auto; opacity: .8; }

/* Content */
.content { flex: 1; padding: 28px 34px; max-width: 1000px; }
h1 { margin: 0 0 18px; font-size: 24px; }
h2 { font-size: 16px; margin: 26px 0 10px; color: var(--green-d); }
.muted { color: var(--muted); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.card .num { font-size: 26px; font-weight: 700; color: var(--green); }
.card .num.small { font-size: 15px; font-weight: 600; }
.card .lbl { color: var(--muted); font-size: 13px; }

/* Two-column layout for insight tables */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

/* Health banner */
.health { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.health .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.health-ok { background: #d8efe7; color: #0f6b4e; }
.health-ok .dot { background: #12805c; }
.health-warn { background: #fbf1d8; color: #8a6d3b; }
.health-warn .dot { background: #e08a12; }
.health-bad { background: #fbe3e0; color: #c0392b; }
.health-bad .dot { background: #c0392b; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; font-size: 14px; border-bottom: 1px solid var(--line); }
th { background: #fafbfc; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Badges */
.badge { padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.draft { background: #eef2f5; color: #555; }
.badge.sent, .badge.scheduled { background: #d8efe7; color: var(--green-d); }
.badge.error { background: #fbe3e0; color: var(--red); }
.badge.skipped { background: #f0e6d6; color: #8a6d3b; }
.badge.approved { background: #dfeafd; color: #2b5fb8; }

/* Buttons + forms */
button { background: var(--green); color: #fff; border: none; padding: 10px 16px;
  border-radius: 6px; font-size: 14px; cursor: pointer; font-weight: 600; }
button:hover { background: var(--green-d); }
button.secondary { background: #eef2f5; color: var(--ink); }
button.secondary:hover { background: #e2e8ec; }
button.danger { background: var(--red); }
.inline { display: inline; }
.actions, .test-row, .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 6px; max-width: 620px; }
.stack input, .stack textarea, .stack select, select, input[type=text], input[type=url], input[type=password] {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }
label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.check { display: flex; align-items: center; gap: 8px; margin: 14px 0; color: var(--ink); }

/* Drafts */
.draft { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 16px; }
.draft-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.preview { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; }
details summary { cursor: pointer; color: var(--green-d); margin: 8px 0; }

/* Flash / alerts */
.flash { background: #d8efe7; color: var(--green-d); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert { background: #fbe3e0; color: var(--red); padding: 12px 14px; border-radius: 8px;
  margin-bottom: 16px; display: flex; gap: 12px; align-items: center; }
.error { background: #fbe3e0; color: var(--red); padding: 10px 12px; border-radius: 6px; margin: 8px 0; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 32px; width: 340px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card input, .login-card button { padding: 12px; font-size: 15px; }
