* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --accent: #f0c040;
    --accent-dim: #c9a030;
    --accent-glow: rgba(240, 192, 64, 0.15);
    --text-primary: #f5f5f7;
    --text-secondary: #8a8a9a;
    --text-muted: #5a5a6a;
    --border: #2a2a35;
    --border-light: #353540;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
}

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ─── NAV ─────────────────────────────────────────── */

nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a, .nav-links button {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links button:hover {
    color: var(--text-primary);
}

.nav-tag {
    font-size: 0.7rem;
    color: var(--accent);
    background: rgba(240, 192, 64, 0.1);
    border: 1px solid rgba(240, 192, 64, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    font-weight: 500;
}

/* ─── BUTTONS ─────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #0a0a0f;
}

.btn-primary:hover {
    background: var(--accent-dim);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── HERO ────────────────────────────────────────── */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(240, 192, 64, 0.08);
    border: 1px solid rgba(240, 192, 64, 0.15);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero h1 .accent { color: var(--accent); }

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ─── FEATURES ────────────────────────────────────── */

.features {
    padding: 6rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.features-header {
    text-align: center;
    margin-bottom: 4rem;
}

.features-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.features-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    background: var(--accent-glow);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ─── LAYOUT ──────────────────────────────────────── */

.page-wrapper {
    padding-top: 60px;
    min-height: 100vh;
}

.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ─── CARDS ───────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* ─── STATS GRID ──────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.stat-card .stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-value.accent { color: var(--accent); }
.stat-card .stat-value.success { color: var(--success); }
.stat-card .stat-value.info { color: var(--info); }
.stat-card .stat-value.warning { color: var(--warning); }

/* ─── TABLE ───────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    white-space: nowrap;
}

tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ─── STATUS BADGES ───────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-draft { background: rgba(90, 90, 106, 0.2); color: var(--text-muted); }
.badge-new { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge-active { background: rgba(240, 192, 64, 0.15); color: var(--accent); }
.badge-scheduled { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge-sent { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-opened { background: rgba(240, 192, 64, 0.15); color: var(--warning); }
.badge-replied { background: rgba(52, 211, 153, 0.25); color: var(--success); }
.badge-bounced { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.badge-paused { background: rgba(90, 90, 106, 0.2); color: var(--text-muted); }
.badge-completed { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-cancelled { background: rgba(248, 113, 113, 0.1); color: var(--text-muted); }

/* ─── FORMS ───────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ─── AUTH PAGE ────────────────────────────────────── */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
}

.auth-card h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: var(--danger);
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

/* ─── MODAL ───────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 2rem;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ─── EMAIL PREVIEW ───────────────────────────────── */

.email-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.email-preview .email-step {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.email-preview .email-subject {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.email-preview .email-body {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ─── EMPTY STATE ─────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ─── TABS ────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.tab {
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab:hover:not(.active) {
    color: var(--text-secondary);
}

/* ─── LOADING ─────────────────────────────────────── */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--text-muted);
}

/* ─── PROSPECT CHECKBOX ───────────────────────────── */

.checkbox-cell {
    width: 40px;
}

.checkbox-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ─── SIDEBAR NAV (DASHBOARD) ─────────────────────── */

.app-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 56px;
}

.sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    flex-shrink: 0;
    position: fixed;
    top: 56px;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 0 0.75rem;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}

.sidebar-nav a:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.sidebar-nav .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 2rem;
    max-width: calc(100% - 220px);
}

/* ─── ACTIVITY FEED ───────────────────────────────── */

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-dot.sent { background: var(--success); }
.activity-dot.opened { background: var(--warning); }
.activity-dot.replied { background: var(--accent); }
.activity-dot.draft { background: var(--text-muted); }

.activity-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.activity-text strong {
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ─── CAMPAIGN DETAIL ─────────────────────────────── */

.campaign-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.campaign-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.campaign-meta-item .meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campaign-meta-item .meta-value {
    font-size: 1rem;
    font-weight: 600;
}

/* ─── RESPONSIVE ──────────────────────────────────── */

@media (max-width: 768px) {
    nav { padding: 1rem; }

    .sidebar { display: none; }
    .main-content { margin-left: 0; max-width: 100%; }

    .form-row { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .hero h1 { font-size: 2rem; }
    .hero-cta { flex-direction: column; align-items: center; }

    .page-header { flex-direction: column; align-items: flex-start; }

    .modal { margin: 1rem; padding: 1.5rem; }
}

/* ─── TOAST ───────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.success { border-color: rgba(52, 211, 153, 0.3); }
.toast.error { border-color: rgba(248, 113, 113, 0.3); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── STEP INDICATORS ─────────────────────────────── */

.step-indicators {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.step-dot.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.step-dot.completed {
    border-color: var(--success);
    color: var(--success);
    background: rgba(52, 211, 153, 0.1);
}
