:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e9f2;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: #111827;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-size: 16px; font-weight: 700; color: #fff;
  padding: 0 22px 18px; letter-spacing: .3px;
}
.brand span { color: #818cf8; }
.cat-switch { padding: 4px 18px 16px; margin-bottom: 6px; border-bottom: 1px solid #1f2937; }
.cat-switch-label { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: #64748b; margin-bottom: 6px; }
.cat-switch select {
  width: 100%; background: #1f2937; color: #fff; border: 1px solid #374151;
  border-radius: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cat-switch select:focus { outline: none; border-color: var(--primary); }
.cat-pill { display: inline-flex; align-items: center; gap: 6px; background: #eef2ff; color: var(--primary-dark);
  padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.badge.cat { background: #ede9fe; color: #5b21b6; }

.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 22px; color: #cbd5e1; font-weight: 500;
  border-left: 3px solid transparent;
}
.nav a:hover { background: #1f2937; text-decoration: none; color: #fff; }
.nav a.active { background: #1f2937; color: #fff; border-left-color: var(--primary); }
.nav .ico { width: 18px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 16px 22px; font-size: 12px; color: #64748b; }

.main { flex: 1; padding: 28px 34px; max-width: 1100px; }
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 24px; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card h2 { font-size: 15px; margin: 0 0 14px; }
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 12px; }

.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.cols-4 { grid-template-columns: repeat(2,1fr); } .grid.cols-2{grid-template-columns:1fr;} }

/* ---- Stat tiles ---- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); }
.stat .num { font-size: 30px; font-weight: 700; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-top: 8px; }
.stat.ok .num { color: var(--success); }
.stat.warn .num { color: var(--warn); }
.stat.bad .num { color: var(--danger); }
.stat.info .num { color: var(--info); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary); color: #fff; border: none;
  padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color:#fff; }
.btn.secondary { background: #eef2ff; color: var(--primary-dark); }
.btn.secondary:hover { background: #e0e7ff; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.success { background: var(--success); }
.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- Forms ---- */
label { font-weight: 600; font-size: 13px; display: block; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--surface);
  color: var(--text);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.field { margin-bottom: 16px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 700px) { .form-2col { grid-template-columns: 1fr; } }
.errorlist { color: var(--danger); font-size: 12px; margin: 4px 0 0; padding-left: 16px; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.pending { background: #f1f5f9; color: #475569; }
.badge.sending { background: #fef3c7; color: #92400e; }
.badge.sent { background: #dcfce7; color: #166534; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.badge.skipped { background: #e5e7eb; color: #4b5563; }
.badge.running { background: #dcfce7; color: #166534; }
.badge.paused { background: #fef3c7; color: #92400e; }
.badge.draft { background: #f1f5f9; color: #475569; }
.badge.completed { background: #dbeafe; color: #1e40af; }
.badge.INFO { background: #dbeafe; color: #1e40af; }
.badge.WARN { background: #fef3c7; color: #92400e; }
.badge.ERROR { background: #fee2e2; color: #991b1b; }

/* ---- Messages ---- */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { padding: 11px 15px; border-radius: 8px; margin-bottom: 8px; font-weight: 500; }
.messages .success { background: #dcfce7; color: #166534; }
.messages .error { background: #fee2e2; color: #991b1b; }
.messages .warning { background: #fef3c7; color: #92400e; }
.messages .info { background: #dbeafe; color: #1e40af; }

/* ---- Chart (pure CSS bars) ---- */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart .bar { width: 70%; background: linear-gradient(180deg, #818cf8, #4f46e5); border-radius: 5px 5px 0 0; min-height: 2px; position: relative; transition: height .3s; }
.chart .bar .val { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.chart .bar-lbl { font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* ---- Misc ---- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.alive { background: var(--success); }
.dot.stalled { background: var(--warn); }
.dot.dead { background: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.preview-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 16px; white-space: pre-wrap; font-size: 13px; min-height: 120px; }
.preview-subject { font-weight: 700; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.help-panel { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 14px 16px; font-size: 12.5px; color: #075985; }
.help-panel strong { color: #0c4a6e; }
.tag { background: #eef2ff; color: var(--primary-dark); padding: 2px 7px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, monospace; }
.inline-form { display: inline; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e1b4b, #4f46e5); }
.login-card { background: #fff; border-radius: 16px; padding: 36px 34px; width: 360px; box-shadow: 0 20px 40px rgba(0,0,0,.25); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p.sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; }

/* Outreach Studio workspace */
:root{--accent:#635bff;--bg:#f5f6fb;--muted:#71768a}
body{background:#f5f6fb;color:#20263d;font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif}
.sidebar{background:#151a32;border-right:1px solid #292e48}.brand{letter-spacing:-1px}.brand span{color:#a49cff}.nav a.active{background:#635bff}.main{max-width:1500px;width:100%;box-sizing:border-box}.card{border:1px solid #e5e7f0;border-radius:18px;box-shadow:0 4px 18px #20263d04}.btn{background:#635bff;border-color:#635bff;border-radius:9px}.btn:hover{filter:brightness(1.08)}.btn.ghost{background:transparent;color:#5148cd;border-color:#dcd9fb}.page-title{letter-spacing:-1px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:2px;color:#766ce3}.welcome-banner{background:linear-gradient(115deg,#eeebff,#e9f5fa);padding:32px;border:1px solid #e0dff3;border-radius:22px;display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px}.welcome-banner h2,.welcome-banner h1{font-size:30px;line-height:1.2;letter-spacing:-1px;margin:12px 0}.welcome-banner p{color:#656d84;max-width:620px}.hero-mark{font-size:85px;color:#8a7be5}.setup-strip{display:flex;gap:16px;margin:20px 0 30px;flex-wrap:wrap}.setup-strip a{padding:14px 20px;border:1px solid #e1e3ef;background:white;border-radius:12px;text-decoration:none;color:#525b78;font-size:13px;flex:1}.narrow{max-width:720px}form p{margin:0 0 18px}form p label{display:block;font-weight:600;font-size:13px;margin-bottom:7px}form p input:not([type=checkbox]),form p select,form p textarea{width:100%;box-sizing:border-box;padding:12px;border:1px solid #dfe2ed;border-radius:9px;background:white;color:#252a40}form .helptext{display:block;color:#747b90;font-size:12px;margin-top:6px}.errorlist{color:#b42335;font-size:13px}.plan-label{color:#c7beff;font-weight:700}.pricing-heading{text-align:center;padding:28px 0 40px}.pricing-heading h1{font-size:44px;line-height:1.15;letter-spacing:-2px}.pricing-heading p{color:#73798f}.pricing-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.pricing-card{position:relative;padding:32px;display:flex;flex-direction:column}.pricing-card h2{font-size:28px;margin:18px 0 12px}.price{font-size:25px;font-weight:800}.pricing-card p{color:#777c90}.pricing-card ul{padding-left:19px;line-height:2.5;font-size:14px;flex:1}.pricing-card .btn{width:100%;justify-content:center}.featured{border:2px solid #7569ec;box-shadow:0 12px 35px #635bff15}.popular{position:absolute;top:-13px;left:24px;background:#635bff;color:white;padding:6px 12px;border-radius:20px;font-size:10px;font-weight:800;letter-spacing:1px}.pricing-note{max-width:800px;margin:28px auto;color:#747b91;text-align:center;font-size:13px;line-height:1.7}.document-row{padding:18px 0;border-bottom:1px solid #e6e8f0}.empty-library{text-align:center;padding:50px 12px;color:#747b91}.empty-library>span{font-size:48px;color:#a397e7}.login-wrap{background:radial-gradient(ellipse at top,#e5e0ff,transparent 65%)}.login-card{border-radius:22px;border:1px solid #e2e3ef;box-shadow:0 20px 80px #31295c12}.login-card h1{letter-spacing:-1px;line-height:1.2}.stat{border-radius:16px}
@media(max-width:1000px){.pricing-grid{grid-template-columns:1fr}.welcome-banner{align-items:flex-start;flex-direction:column}.pricing-heading h1{font-size:34px}}
@media(max-width:600px){.welcome-banner{padding:22px}.setup-strip{flex-direction:column}.hero-mark{display:none}.pricing-card{padding:24px}}
.main{width:auto;min-width:0}.sidebar{flex-shrink:0;overflow-y:auto}.pricing-heading h1{overflow-wrap:break-word}.pricing-card{min-width:0}.pricing-card ul{overflow-wrap:break-word}
@media(max-width:1150px){.pricing-grid{grid-template-columns:1fr}.pricing-heading h1{font-size:34px}}
@media(max-width:720px){.sidebar{height:auto;position:relative;width:100%;overflow:visible}.layout{flex-direction:column}.main{padding:22px 16px}.nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.nav a{padding:10px 16px}.sidebar-foot{padding-top:12px}.pricing-heading h1{font-size:29px}}
