:root {
  --navy: #0C1824;
  --navy-2: #14283a;
  --teal: #18A8B4;
  --teal-dark: #128a94;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #5b6875;
  --line: #dfe5ea;
  --ok: #1f8a4c;
  --warn: #b7791f;
  --danger: #c0392b;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
pre { white-space: pre-wrap; word-break: break-word; background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; padding: .75rem; }

/* Layout */
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 1.25rem; padding: .6rem 1.25rem; flex-wrap: wrap; }
.topbar .brand { font-weight: 600; letter-spacing: .2px; color: #fff; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.topbar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); display: inline-block; }
.topbar nav { white-space: nowrap; }
.topbar nav a { color: #cfd8e0; margin-right: .8rem; font-size: .92rem; }
.topbar nav a.active, .topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .85rem; color: #cfd8e0; white-space: nowrap; }
.topbar .who strong { color: #fff; }
.banner { padding: .5rem 1.25rem; font-size: .9rem; display: flex; gap: .75rem; align-items: center; }
.banner.sim { background: #fff4d6; color: #6b4b00; border-bottom: 1px solid #f0d58a; }
.banner.live { background: #dcf3e5; color: #145a32; border-bottom: 1px solid #b7e2c7; }
.dry-tag { display: inline-block; background: #dbeefc; color: #0b4a7a; border: 1px solid #a9cdec; padding: .05rem .45rem; border-radius: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .5px; }
.badge-dry_run { background: #dbeefc; color: #0b4a7a; }
.badge-live { background: #dcf3e5; color: #145a32; }
.badge-blocked { background: #fde0dc; color: #7a1d12; }
.badge-simulated { background: #fff1cc; color: #6b4b00; }
.badge-lead-new { background: #e8edf1; color: #35434f; }
.badge-lead-contacted { background: #fff1cc; color: #6b4b00; }
.badge-lead-call_booked { background: #dbeefc; color: #0b4a7a; }
.badge-lead-proposal { background: #e8dcf5; color: #4a2a7a; }
.badge-lead-won { background: #dcf3e5; color: #145a32; }
.badge-lead-lost { background: #fde0dc; color: #7a1d12; }
.funnel td.num, .funnel th.num { text-align: right; }
.badge-review-pass { background: #dcf3e5; color: #145a32; }
.badge-review-warn { background: #fff1cc; color: #6b4b00; }
.badge-review-block { background: #fde0dc; color: #7a1d12; }
.badge-review-none { background: #e8edf1; color: #35434f; }
.review-card.review-block { border-color: #f2a79e; }
.review-card.review-warn { border-color: #f0d58a; }
.review-card.review-pass { border-color: #b7e2c7; }
.review-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; margin: .75rem 0 .25rem; }
.review-h.review-block { color: var(--danger); } .review-h.review-warn { color: var(--warn); } .review-h.review-info { color: var(--muted); }
.findings { list-style: none; padding: 0; margin: 0; }
.findings li { padding: .4rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.findings li:last-child { border-bottom: 0; }
.banner.pause { background: #ffd9d4; color: #7a1d12; border-bottom: 1px solid #f2a79e; font-weight: 600; }
.banner .tag { white-space: nowrap; background: rgba(0,0,0,.08); padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; letter-spacing: .5px; text-transform: uppercase; }
main { max-width: 1180px; margin: 1.5rem auto; padding: 0 1.25rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.flash { padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; }
.flash.ok { background: #e2f5ea; color: #145a32; border: 1px solid #b7e2c7; }
.flash.err { background: #fde5e2; color: #7a1d12; border: 1px solid #f2b3ac; }

/* Cards & grids */
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card h2, .card h3 { margin-bottom: .6rem; }
.stat { text-align: left; }
.stat .n { font-size: 1.8rem; font-weight: 600; color: var(--navy); }
.stat .l { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: 0; }

/* Forms & buttons */
form.inline { display: inline; }
label { display: block; font-size: .85rem; font-weight: 600; margin: .6rem 0 .25rem; color: var(--navy-2); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.btn { display: inline-block; padding: .5rem .9rem; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; background: var(--teal); color: #fff; }
.btn:hover { background: var(--teal-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.secondary:hover { background: #f0f3f6; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #a93226; }
.btn.warn { background: var(--warn); }
.btn.sm { padding: .3rem .6rem; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .75rem; }
.help { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.checks label { display: inline-flex; align-items: center; gap: .35rem; margin: .25rem 1rem .25rem 0; font-weight: 500; }
.checks input { width: auto; }

/* Badges */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; text-transform: capitalize; background: #e8edf1; color: #35434f; white-space: nowrap; }
.badge-draft { background: #e8edf1; }
.badge-pending_approval { background: #fff1cc; color: #6b4b00; }
.badge-approved { background: #dcf3e5; color: #145a32; }
.badge-rejected { background: #fde0dc; color: #7a1d12; }
.badge-scheduled { background: #dbeefc; color: #0b4a7a; }
.badge-published { background: #cfe9ec; color: #0b4d54; }
.badge-archived, .badge-cancelled { background: #eee; color: #666; }
.badge-active { background: #dcf3e5; color: #145a32; }
.badge-paused, .badge-failed { background: #fde0dc; color: #7a1d12; }
.badge-completed { background: #dbeefc; color: #0b4a7a; }
.sim-tag { display: inline-block; background: #fff1cc; color: #6b4b00; border: 1px solid #f0d58a; padding: .05rem .45rem; border-radius: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .5px; }
.live-tag { display: inline-block; background: #dcf3e5; color: #145a32; border: 1px solid #b7e2c7; padding: .05rem .45rem; border-radius: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .5px; }
.channel { font-weight: 600; color: var(--navy-2); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: .75rem; color: var(--muted); text-transform: uppercase; padding: .25rem; }
.cal .day { min-height: 96px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .35rem; font-size: .8rem; }
.cal .day.empty { background: transparent; border-color: transparent; }
.cal .day.today { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.cal .day .num { font-weight: 600; color: var(--muted); }
.cal .ev { display: block; margin-top: .25rem; padding: .2rem .35rem; border-radius: 5px; background: #dbeefc; color: #0b4a7a; font-size: .74rem; line-height: 1.25; }
.cal .ev.published { background: #cfe9ec; color: #0b4d54; }
.cal .ev.failed { background: #fde0dc; color: #7a1d12; }
.cal .ev.cancelled { background: #eee; color: #777; text-decoration: line-through; }

/* Login */
.login-wrap { max-width: 420px; margin: 6vh auto; }
.login-wrap .logo { text-align: center; margin-bottom: 1rem; }
.login-wrap .logo h1 { color: var(--navy); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .4rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.timeline li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .25rem .75rem; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
footer { text-align: center; color: var(--muted); font-size: .78rem; padding: 2rem 0; }
