:root { color-scheme: light dark; --bg: #f5f6f8; --panel: #fff; --text: #1d2330; --muted: #667085; --line: #e3e6ec; --accent: #1f5fbf; --link: #175cd3; --ok: #1f7a4d; --error: #b42318; --pending: #9a6700; --soft: #eef3fb; }
@media (prefers-color-scheme: dark) { :root { --bg: #14171c; --panel: #1c2027; --text: #e6e8ec; --muted: #9aa3b2; --line: #2c323c; --accent: #6b9ef0; --link: #84adff; --ok: #4cc38a; --error: #f97066; --pending: #e3b341; --soft: #222a36; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); text-underline-offset: .15em; }
header.top { display: flex; align-items: center; gap: 1.25rem; padding: .7rem 1.5rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header.top .brand { font-weight: 700; color: var(--accent); text-decoration: none; }
header.top nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
header.top nav a { color: var(--text); text-decoration: none; padding: .1rem 0; border-bottom: 2px solid transparent; }
header.top nav a.active { border-bottom-color: var(--accent); }
.testmode { background: #fff4d6; color: #7a4d00; padding: .4rem 1.5rem; font-size: .9rem; border-bottom: 1px solid #f0d58a; }
@media (prefers-color-scheme: dark) { .testmode { background: #3a2f12; color: #f3d48a; border-color: #5c4a1a; } }
main { max-width: 78rem; margin: 1.5rem auto; padding: 0 1rem; }
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 1rem; align-items: start; }
@media (max-width: 70rem) { .editor-layout { grid-template-columns: 1fr; } }
.stat { font-size: 1.8rem; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
tr.dim td { opacity: .6; }
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .85rem; }
label { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
label.inline { display: inline-flex; gap: .35rem; align-items: center; font-weight: normal; margin: .2rem 1rem .2rem 0; }
.hint { color: var(--muted); font-size: .85rem; font-weight: normal; margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=search], select, textarea { width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
textarea { min-height: 8rem; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
button, .button { display: inline-block; padding: .42rem .9rem; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--error); border-color: var(--error); }
button.small, .button.small { padding: .15rem .55rem; font-size: .85rem; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
form.inline { display: inline; }
.badge { display: inline-block; padding: .02rem .5rem; border-radius: 99px; font-size: .78rem; border: 1px solid currentColor; white-space: nowrap; }
.badge-ok, .badge-sent { color: var(--ok); }
.badge-error, .badge-failed { color: var(--error); }
.badge-pending, .badge-scheduled, .badge-sending { color: var(--pending); }
.badge-muted, .badge-skipped, .badge-cancelled { color: var(--muted); }
.flash { padding: .6rem 1rem; border-radius: 6px; margin-bottom: 1rem; background: var(--panel); border-left: 4px solid var(--ok); }
.flash.error { border-left-color: var(--error); }
.flash.warning { border-left-color: var(--pending); }
code, pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .6rem; max-height: 30rem; overflow: auto; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: .75rem; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--text); border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; }
.tabs button.active { border-color: var(--line); background: var(--panel); color: var(--accent); font-weight: 600; margin-bottom: -1px; }
.tabs button .dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); margin-left: .35rem; vertical-align: middle; }
.tabs button .dot.filled { background: var(--ok); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.variables { max-height: 26rem; overflow: auto; font-size: .88rem; }
.variables h4 { margin: .6rem 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.variables button { display: block; width: 100%; text-align: left; background: transparent; color: var(--text); border: 1px solid transparent; padding: .2rem .35rem; white-space: normal; }
.variables button:hover { border-color: var(--line); background: var(--soft); }
.variables code { color: var(--accent); }
iframe.preview { width: 100%; height: 34rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.sms-bubble { background: var(--soft); border-radius: 12px; padding: .7rem .9rem; white-space: pre-wrap; max-width: 22rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 9.5rem 1fr; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--muted); font-size: .85rem; }
.kv { display: grid; grid-template-columns: 10rem 1fr; gap: .2rem .75rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.errors { color: var(--error); margin: .3rem 0; }
.pagination { display: flex; gap: .3rem; list-style: none; padding: 0; flex-wrap: wrap; }
.pagination li a, .pagination li span { display: inline-block; padding: .2rem .55rem; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.pagination li.active span { background: var(--accent); color: #fff; border-color: var(--accent); }
.login { max-width: 24rem; margin: 10vh auto; }
