/* ===== TrustMaily design system ===== */
:root {
  --bg: #0b0e14;
  --panel: #ffffff;
  --panel-dark: #11151f;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --text: #1a1d29;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #059669;
  --danger: #dc2626;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f6f7fb; color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.logo { font-weight: 800; font-size: 22px; }
.logo span { color: var(--accent); }

/* ---- Buttons ---- */
.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; font-size: 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #fee2e2; color: var(--danger); border: 1px solid #fecaca; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; text-align: center; }

/* ---- Marketing site ---- */
.site-header { border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 0; z-index: 10; }
.nav-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.site-nav a { margin: 0 14px; color: var(--text-muted); font-weight: 500; }
.nav-cta a { margin-left: 10px; }
.hero { text-align: center; padding: 100px 20px 60px; background: linear-gradient(180deg,#fff,#f6f7fb); }
.hero h1 { font-size: 48px; max-width: 780px; margin: 0 auto 20px; line-height: 1.15; }
.accent { color: var(--accent); }
.hero-sub { max-width: 600px; margin: 0 auto 30px; color: var(--text-muted); font-size: 18px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.hero-note { color: var(--text-muted); font-size: 13px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 60px 24px; }
.feature-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature-icon { font-size: 28px; margin-bottom: 10px; }
.warmup-section { background: var(--panel-dark); color: #fff; padding: 70px 0; }
.warmup-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.checklist { list-style: none; padding: 0; }
.checklist li::before { content: "✓ "; color: #34d399; font-weight: 700; }
.warmup-score-demo { text-align: center; }
.score-ring { width: 140px; height: 140px; border-radius: 50%; border: 10px solid #34d399; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; margin: 0 auto 10px; }
.pricing { text-align: center; padding: 70px 24px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 30px; }
.price-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; background: #fff; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 10px 30px rgba(79,70,229,.15); }
.price { font-size: 36px; font-weight: 800; margin: 10px 0 20px; }
.price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.price-card ul { list-style: none; padding: 0; margin-bottom: 20px; color: var(--text-muted); }
.site-footer { text-align: center; padding: 30px; color: var(--text-muted); font-size: 13px; }

/* ---- Auth pages ---- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f6f7fb; }
.auth-card { background: #fff; padding: 40px; border-radius: var(--radius); width: 380px; border: 1px solid var(--border); }
.auth-card h1 { font-size: 22px; margin-top: 4px; }
.auth-switch, .auth-hint { text-align: center; font-size: 13px; color: var(--text-muted); }

/* ---- App shell ---- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--panel-dark); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; flex-shrink: 0; }
.sidebar .logo { padding: 0 8px 20px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a { color: #cbd0dc; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.plan-badge { font-size: 12px; color: #9ca3af; margin-bottom: 8px; }
.logout-link { color: #f87171 !important; }
.main-content { flex: 1; padding: 30px 40px; max-width: 1200px; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-header h1 { font-size: 24px; }

/* ---- Panels & forms ---- */
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.panel-narrow { max-width: 480px; }
.panel h2 { margin-top: 0; font-size: 17px; }
.panel-sub { color: var(--text-muted); font-size: 13px; margin-top: -6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; }
.inline-fields { display: flex; gap: 10px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-row.inline { display: inline-flex; margin-right: 14px; }
.checkbox-row input { width: auto; }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.empty-state { color: var(--text-muted); padding: 20px 0; }

/* ---- Badges ---- */
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-active, .badge-connected { background: #d1fae5; color: #065f46; }
.badge-draft { background: #f3f4f6; color: #4b5563; }
.badge-paused { background: #fef3c7; color: #92400e; }
.badge-completed { background: #e0e7ff; color: #3730a3; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-replied { background: #d1fae5; color: #065f46; }
.badge-bounced { background: #fee2e2; color: #991b1b; }
.badge-unsubscribed { background: #f3f4f6; color: #4b5563; }
.badge-pending { background: #f3f4f6; color: #4b5563; }
.badge-in_sequence { background: #dbeafe; color: #1e40af; }

/* ---- Stats ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { color: var(--text-muted); font-size: 13px; }

.pipeline-bar { display: flex; gap: 10px; }
.pipeline-stage { flex: 1; text-align: center; background: var(--accent-light); border-radius: 8px; padding: 14px 6px; }
.pipeline-count { font-size: 20px; font-weight: 800; color: var(--accent); }
.pipeline-label { font-size: 12px; color: var(--text-muted); }

.score-bar { background: #f3f4f6; border-radius: 999px; height: 6px; width: 100px; display: inline-block; margin-right: 8px; vertical-align: middle; }
.score-fill { background: linear-gradient(90deg,#f59e0b,#10b981); height: 100%; border-radius: 999px; }

/* ---- Sequence builder ---- */
.sequence-step { border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.sequence-step.new-step { border-style: dashed; }
.step-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.step-subject { margin-bottom: 8px; }
.step-actions { margin-top: 10px; display: flex; gap: 8px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* ---- Unibox ---- */
.inbox-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.inbox-item.unread { background: #fafaff; }
.inbox-meta { font-size: 13px; margin-bottom: 4px; }
.inbox-subject { font-weight: 600; }
.inbox-preview { color: var(--text-muted); font-size: 13px; margin: 4px 0 8px; }
.muted { color: var(--text-muted); }

/* ---- Bar chart ---- */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; }
.bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #d1fae5; color: #065f46; }

@media (max-width: 900px) {
  .features, .pricing-grid, .warmup-grid, .grid-2, .stat-grid { grid-template-columns: 1fr; }
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; }
}
