/* Vircab Panel — brand styles
   60-30-10: Cream #F4ECE0 (bg), Charcoal #1A1A1A (text), Vircab Red #C0152D (accent)
*/
:root {
  --cream: #F4ECE0;
  --cream-soft: #FAF5EC;
  --charcoal: #1A1A1A;
  --gray-1: #6B7280;
  --gray-2: #D1D5DB;
  --vircab-red: #C0152D;
  --wine: #7A0E1B;
  --green: #22C55E;
  --yellow: #F59E0B;
  --blue: #3B82F6;
  --white: #FFFFFF;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: 'Geist', 'Inter', system-ui, -apple-system, sans-serif; background: var(--cream); color: var(--charcoal); line-height: 1.5; }
a { color: var(--vircab-red); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .btn { cursor: pointer; font: inherit; }

/* Layout */
.page { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--charcoal); color: var(--white); padding: 24px 0; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; }
.sidebar-brand { padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand img { width: 32px; height: 32px; }
.sidebar-brand h1 { font-size: 18px; font-weight: 700; margin-top: 8px; }
.sidebar-brand small { font-size: 11px; opacity: 0.6; }
.sidebar nav { padding: 16px 0; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 24px; color: rgba(255,255,255,0.7); font-size: 14px; }
.sidebar nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255,255,255,0.05); color: var(--white); text-decoration: none; }
.sidebar nav a.active { background: var(--vircab-red); color: var(--white); }
.sidebar-footer { padding: 16px 24px; font-size: 12px; opacity: 0.6; }
.sidebar-footer a { color: rgba(255,255,255,0.8); }

main { flex: 1; padding: 32px 40px; max-width: 1400px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h2 { font-size: 24px; font-weight: 700; }
.page-header .subtitle { color: var(--gray-1); font-size: 14px; margin-top: 4px; }

/* Card */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stat-card .label { font-size: 12px; color: var(--gray-1); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.stat-card .value { font-size: 32px; font-weight: 800; margin-top: 8px; color: var(--charcoal); }
.stat-card .value.accent { color: var(--vircab-red); }

/* Buttons */
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; border: none; transition: all 0.2s; }
.btn-primary { background: var(--vircab-red); color: var(--white); }
.btn-primary:hover { background: var(--wine); }
.btn-secondary { background: var(--white); color: var(--charcoal); border: 1px solid var(--gray-2); }
.btn-secondary:hover { background: var(--cream-soft); }
.btn-ghost { background: transparent; color: var(--charcoal); }
.btn-ghost:hover { background: rgba(0,0,0,0.05); }
.btn-danger { background: transparent; color: var(--vircab-red); border: 1px solid var(--vircab-red); }
.btn-danger:hover { background: var(--vircab-red); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Inputs */
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-2);
  border-radius: 8px; font: inherit; background: var(--white); color: var(--charcoal);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vircab-red); outline-offset: 1px; border-color: transparent; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--charcoal); }
.form-row { margin-bottom: 16px; }

/* Table */
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th { text-align: left; padding: 12px 16px; background: var(--cream-soft); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-1); border-bottom: 1px solid var(--gray-2); }
td { padding: 14px 16px; border-bottom: 1px solid var(--cream); font-size: 14px; }
tbody tr:hover { background: var(--cream-soft); }
tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; font-size: 11px; font-weight: 700; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-cold { background: #E5E7EB; color: #4B5563; }
.badge-contacted { background: #DBEAFE; color: #1E40AF; }
.badge-replied { background: #FEF3C7; color: #92400E; }
.badge-positive { background: #DCFCE7; color: #166534; }
.badge-negative { background: #FEE2E2; color: #991B1B; }
.badge-unsubscribed { background: #F3F4F6; color: #4B5563; }
.badge-won { background: var(--vircab-red); color: var(--white); }
.badge-lost { background: #E5E7EB; color: #6B7280; }
.badge-bounced { background: #FEE2E2; color: #991B1B; }

/* Sequence step cells (Mail 1/2/3) - compact chip, no wrap */
.step-cell { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.step-cell.sent { background: #DCFCE7; color: #166534; }
.step-cell.due { background: #FEF3C7; color: #92400E; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--cream); padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 32px; }
.login-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; color: var(--vircab-red); }
.login-card .sub { color: var(--gray-1); font-size: 14px; margin-bottom: 24px; }
.error-msg { background: #FEE2E2; color: #991B1B; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.success-msg { background: #DCFCE7; color: #166534; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }

/* Timeline */
.timeline { border-left: 2px solid var(--gray-2); padding-left: 20px; margin: 16px 0; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--gray-2); }
.timeline-item.done::before { background: var(--green); }
.timeline-item.due::before { background: var(--yellow); }
.timeline-item .when { font-size: 11px; color: var(--gray-1); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.timeline-item .what { font-size: 14px; margin-top: 2px; }

/* Compose helper */
.compose-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.compose-modal.hidden { display: none; }
.compose-box { background: var(--white); border-radius: var(--radius); padding: 24px; max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto; }
.compose-output { background: var(--cream-soft); padding: 16px; border-radius: 8px; white-space: pre-wrap; font-family: 'Geist Mono', monospace; font-size: 13px; line-height: 1.6; margin: 12px 0; max-height: 300px; overflow-y: auto; }

/* Utility */
.muted { color: var(--gray-1); }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { height: 16px; }
.hidden { display: none !important; }
.text-right { text-align: right; }
.no-data { text-align: center; padding: 40px; color: var(--gray-1); }

@media (max-width: 768px) {
  .page { flex-direction: column; }
  .sidebar { width: 100%; padding: 16px; height: auto; position: static; overflow-y: visible; }
  .sidebar nav a { padding: 8px 16px; }
  main { padding: 16px; }
}
