* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; background: #f5f6f8; color: #1a1a1a; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 24px; background: #16213e; color: #fff; }
.topbar .brand { font-weight: 700; letter-spacing: 0.02em; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar nav a { color: #cfd8ff; text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: #fff; }
.topbar .session { font-size: 13px; display: flex; gap: 12px; align-items: center; color: #cfd8ff; }
.topbar .session a { color: #ff8a8a; text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin-bottom: 4px; }
h2 { font-size: 17px; margin-top: 32px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eceef1; font-size: 14px; }
th { background: #fafbfc; font-weight: 600; color: #555; }
.card { background: #fff; border-radius: 8px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); margin-bottom: 16px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-draft { background: #eee; color: #555; }
.badge-scheduled { background: #fff3cd; color: #856404; }
.badge-sending { background: #cfe2ff; color: #084298; }
.badge-completed { background: #d1e7dd; color: #0f5132; }
.badge-cancelled { background: #f8d7da; color: #842029; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin: 12px 0; }
label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; }
input, select, textarea { padding: 7px 9px; border: 1px solid #d5d9e0; border-radius: 6px; font-size: 14px; font-family: inherit; }
button { padding: 8px 14px; border: none; border-radius: 6px; background: #16213e; color: #fff; font-size: 14px; cursor: pointer; }
button:hover { background: #223060; }
button.danger { background: #b3261e; }
.funnel { display: flex; gap: 12px; margin: 16px 0; }
.funnel .stat { flex: 1; text-align: center; background: #fff; padding: 12px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.funnel .stat .n { font-size: 22px; font-weight: 700; }
.funnel .stat .l { font-size: 12px; color: #777; }
.error { color: #b3261e; font-size: 13px; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #16213e; }
.login-card { background: #fff; padding: 32px; border-radius: 10px; width: 320px; }
.muted { color: #888; font-size: 13px; }

/* Help & search system */
.help-search-card { position: relative; }
.help-search-card input[type="text"] { width: 100%; max-width: 480px; padding: 10px 12px; font-size: 15px; }
.help-search-results {
  position: absolute; left: 20px; right: 20px; top: 78px; z-index: 20;
  background: #fff; border: 1px solid #e0e3e8; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); max-height: 420px; overflow-y: auto;
}
.help-result { padding: 10px 14px; border-bottom: 1px solid #eceef1; cursor: pointer; }
.help-result:last-child { border-bottom: none; }
.help-result:hover { background: #f5f6fa; }
.help-result-title { font-weight: 600; font-size: 14px; }
.help-result-phase { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; margin: 2px 0; }
.help-result-summary { font-size: 13px; }
.help-result-empty { padding: 14px; font-size: 13px; color: #888; }
.help-article h3 { margin-top: 0; }
.help-article pre { background: #f5f6f8; padding: 10px 12px; border-radius: 6px; overflow-x: auto; font-size: 13px; }
.help-article code { background: #f0f1f5; padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.help-back-btn { background: none; border: none; color: #16213e; font-size: 13px; cursor: pointer; padding: 0 0 12px 0; text-decoration: underline; }
.danger-link { color: #b3261e; } tr.editing input { padding: 4px 6px; font-size: 13px; width: 100%; }

/* Template / landing page presets */
.preset-box { margin-bottom: 10px; }
.preset-btn {
  background: #eef1fa; color: #16213e; border: 1px solid #cdd4e8;
  padding: 7px 12px; border-radius: 6px; font-size: 13px; margin: 0 6px 6px 0; cursor: pointer;
}
.preset-btn:hover { background: #dbe1f5; }
.preset-hint { min-height: 16px; }

/* Explicit recipient picker — campaigns never default to the whole directory. */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(13, 22, 47, 0.56); }
.modal-card { width: min(680px, 100%); max-height: min(720px, 90vh); overflow: auto; background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 16px 48px rgba(0,0,0,.28); }
.picker-select-all, .target-picker-row { display: block; margin: 0; padding: 10px 4px; font-size: 14px; color: #1a1a1a; }
.target-picker-list { margin: 10px 0; border-top: 1px solid #eceef1; border-bottom: 1px solid #eceef1; max-height: 300px; overflow-y: auto; }
.target-picker-row { border-bottom: 1px solid #f0f1f4; }
.target-picker-row:last-child { border-bottom: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
