:root { --bg:#f6f7f9; --card:#fff; --ink:#18202a; --muted:#687384; --line:#dfe4ea; --brand:#1f5f74; --danger:#9f1d35; --warn:#a46300; --ok:#1d6f42; }
* { box-sizing:border-box; }
body { margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif; background:var(--bg); color:var(--ink); }
a { color:var(--brand); text-decoration:none; }
a:hover { text-decoration:underline; }
.topbar { display:flex; align-items:center; justify-content:space-between; padding:14px 24px; background:#102a36; color:white; }
.topbar a { color:white; margin-left:16px; }
.brand a { font-weight:800; letter-spacing:.02em; margin-left:0; }
.container { max-width:1100px; margin:28px auto; padding:0 20px; }
.footer { color:var(--muted); text-align:center; padding:30px; font-size:13px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:18px; margin:16px 0; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:14px; }
.stat { font-size:32px; font-weight:800; }
.muted { color:var(--muted); }
.flash { padding:12px 14px; border-radius:10px; margin-bottom:16px; border:1px solid var(--line); background:white; }
.flash.success { border-color:#b7e0c6; background:#effaf3; }
.flash.error { border-color:#efbdc7; background:#fff3f5; }
label { display:block; font-weight:650; margin:13px 0 6px; }
input[type=text], input[type=email], input[type=password], textarea, select { width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; background:white; }
textarea { min-height:90px; }
button, .button { display:inline-block; border:0; border-radius:10px; padding:10px 14px; background:var(--brand); color:white; font-weight:750; cursor:pointer; margin-top:12px; }
button:hover, .button:hover { opacity:.92; text-decoration:none; }
.secondary { background:#506070; }
.danger { background:var(--danger); }
table { width:100%; border-collapse:collapse; background:white; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
th, td { text-align:left; padding:11px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
th { background:#f0f3f6; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:#495667; }
.badge { display:inline-block; padding:4px 9px; border-radius:999px; background:#e9eef2; color:#263441; font-weight:750; font-size:12px; }
.badge.low { background:#edf8f1; color:var(--ok); }
.badge.moderate { background:#fff6e6; color:var(--warn); }
.badge.high { background:#fff0ee; color:#a94225; }
.badge.override { background:#ffe8ee; color:var(--danger); }
.question { border-top:1px solid var(--line); padding:16px 0; }
.option { display:block; font-weight:500; margin:8px 0; }
.warning { border-left:5px solid var(--danger); background:#fff5f7; padding:16px; border-radius:10px; }

.module-name { display:block; font-size:12px; font-weight:600; color:#c9d7df; margin-top:2px; }
.topbar { gap:20px; }

.badge.queued { background:#eef1f5; color:#445162; }
.badge.sent { background:#edf8f1; color:#1d6f42; }
.badge.failed { background:#fff0ee; color:#9f1d35; }
table form { margin:0; }
table button { margin-top:0; padding:7px 10px; }

input[readonly] { background:#f3f6f8; }
.button + .button { margin-left:8px; }

input[readonly] { background:#f3f6f8; }
.button + .button { margin-left:8px; }

ol, ul { line-height:1.65; }
@media print {
  .topbar, .footer, .button, button, form { display:none !important; }
  body { background:white; }
  .container { max-width:none; margin:0; padding:0; }
  .card { box-shadow:none; border:1px solid #ddd; break-inside:avoid; }
}

.workflow { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; margin:12px 0 16px; }
.workflow > div { border:1px solid var(--line); background:#f7f9fb; border-radius:10px; padding:12px; }
.button.secondary { background:#506070; }
select { width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; background:white; }

.inline-editor, .question-editor { border:1px solid var(--line); background:#f8fafc; border-radius:12px; padding:14px; margin:14px 0; }
.option-editor { border-left:4px solid #dfe6ee; padding:10px 0 10px 12px; margin:10px 0; }
.compact-form { padding:8px 0; border-bottom:1px solid var(--line); }
hr { border:0; border-top:1px solid var(--line); margin:18px 0; }

.main-nav { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.nav-group { position:relative; display:inline-block; }
.nav-group-button { background:transparent; color:white; border:0; padding:8px 10px; margin:0; font:inherit; font-weight:650; cursor:pointer; }
.nav-menu { display:none; position:absolute; right:0; top:100%; min-width:210px; background:#163847; border:1px solid rgba(255,255,255,.18); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.2); padding:8px; z-index:100; }
.nav-menu a { display:block; margin:0; padding:9px 10px; border-radius:8px; color:white; white-space:nowrap; }
.nav-menu a:hover { background:rgba(255,255,255,.1); text-decoration:none; }
.nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu { display:block; }

.builder-question-card { display:flex; justify-content:space-between; gap:14px; border:1px solid var(--line); background:#f8fafc; border-radius:14px; padding:14px; margin:12px 0; }
.builder-question-main { display:flex; gap:14px; flex:1; }
.builder-question-main h3 { margin:0 0 6px; }
.builder-sort { width:42px; height:42px; border-radius:10px; background:#e9eef3; color:#344251; display:flex; align-items:center; justify-content:center; font-weight:800; flex:0 0 auto; }
.builder-actions { display:flex; gap:6px; align-items:flex-start; flex-wrap:wrap; justify-content:flex-end; }
.builder-actions form { margin:0; }
.option-pills { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.pill { display:inline-block; padding:5px 9px; border-radius:999px; background:#e9eef3; color:#334155; font-size:12px; font-weight:700; }
.danger-pill { background:#ffe8ee; color:#9f1d35; }
.friendly-option-card { border:1px solid var(--line); background:#f8fafc; border-radius:14px; padding:14px; margin:14px 0; }
.sort-row { display:flex; gap:8px; margin-top:10px; }
.sort-row form { margin:0; }
@media (max-width: 760px) {
  .builder-question-card { flex-direction:column; }
  .builder-actions { justify-content:flex-start; }
  .nav-menu { left:0; right:auto; }
}

.preset-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; }
.preset-card { border:1px solid var(--line); border-top:5px solid var(--accent); background:#f8fafc; border-radius:14px; padding:14px; }
.preset-card h3 { margin-top:0; }
.brand-preview { color:white; border-radius:14px; padding:18px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand-preview strong { display:block; font-size:22px; }
.brand-preview span { display:block; opacity:.85; margin-top:4px; }
.brand-preview button { color:white; border:0; border-radius:8px; padding:10px 14px; font-weight:700; }
input[readonly] { background:#eef2f7; color:#475569; }
button.danger, .button.danger { background:#9f1d35 !important; color:white; }

.color-field { display:flex; align-items:center; gap:10px; }
.color-field input[type="color"] { width:54px; height:44px; padding:2px; border:1px solid var(--line); border-radius:10px; background:white; cursor:pointer; }
.color-field input[type="text"] { flex:1; min-width:120px; }
.color-swatch-row { display:flex; gap:8px; margin:10px 0; }
.color-swatch { width:28px; height:28px; border-radius:999px; border:2px solid white; box-shadow:0 0 0 1px rgba(0,0,0,.15); display:inline-block; }

.color-field { display:flex; align-items:center; gap:10px; }
.color-field input[type="color"] { width:54px; height:44px; padding:2px; border:1px solid var(--line); border-radius:10px; background:white; cursor:pointer; }
.color-field input[type="text"] { flex:1; min-width:120px; }
.color-swatch-row { display:flex; gap:8px; margin:10px 0; }
.color-swatch { width:28px; height:28px; border-radius:999px; border:2px solid white; box-shadow:0 0 0 1px rgba(0,0,0,.15); display:inline-block; }

.brand-logo { max-height:30px; width:auto; vertical-align:middle; margin-right:8px; }
header.topbar { background: var(--brand) !important; background-color: var(--brand) !important; background-image:none !important; }
.nav-menu { background: var(--brand) !important; background-color: var(--brand) !important; }
a.button:not(.secondary):not(.danger), button:not(.secondary):not(.danger):not(.nav-group-button) { background: var(--accent) !important; background-color: var(--accent) !important; color:#fff !important; }
