/* ═══════════════════════════════════════════════════
   MailPilot - Design System (Dark Theme)
   ═══════════════════════════════════════════════════ */

:root {
    --bg-primary: #080816;
    --bg-secondary: #0d0d24;
    --bg-card: rgba(18, 18, 42, 0.45);
    --bg-input: rgba(13, 13, 30, 0.7);
    --border-primary: rgba(255, 255, 255, 0.06);
    --border-active: rgba(99, 102, 241, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-light: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.6);
    --shadow-accent: 0 4px 12px rgba(99, 102, 241, 0.3);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme {
    --bg-primary: #fbfbfc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-input: #f4f4f6;
    --border-primary: rgba(0, 0, 0, 0.06);
    --border-active: #a855f7;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #8b5cf6;
    --accent-light: #a855f7;
    --accent-gradient: linear-gradient(135deg, #8b5cf6, #d946ef);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.08);
    --shadow-accent: 0 4px 12px rgba(139, 92, 246, 0.3);
}

body.light-theme .app-header {
    background: rgba(255, 255, 255, 0.9);
}
body.light-theme .filter-bar {
    background: rgba(0, 0, 0, 0.02);
}
body.light-theme .toast {
    background: var(--bg-card);
}
body.light-theme .toast-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
body.light-theme .toast-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
body.light-theme .table th {
    background: #f1f5f9;
    color: var(--text-secondary);
}
body.light-theme .table tr:hover {
    background: #f8fafc;
}
body.light-theme .empty .icon {
    opacity: 0.2;
}

/* Override inline dark backgrounds for Light mode explicitly */
body.light-theme [style*="background:rgba(16,16,40"],
body.light-theme [style*="background: rgba(16,16,40"],
body.light-theme [style*="background:rgba(22,22,50"],
body.light-theme [style*="background: rgba(22,22,50"] {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme [style*="background:rgba(34,197,94"],
body.light-theme [style*="background: rgba(34,197,94"],
body.light-theme [style*="background:rgba(16,185,129"],
body.light-theme [style*="background: rgba(16,185,129"] {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

body.light-theme [style*="background:rgba(99,102,241"],
body.light-theme [style*="background: rgba(99,102,241"] {
    background: #e0e7ff !important;
    border-color: #c7d2fe !important;
}

body.light-theme [style*="background:rgba(239,68,68"],
body.light-theme [style*="background: rgba(239,68,68"] {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
}

body.light-theme [style*="background:rgba(251,191,36"],
body.light-theme [style*="background: rgba(251,191,36"],
body.light-theme [style*="background:rgba(245,158,11"],
body.light-theme [style*="background: rgba(245,158,11"],
body.light-theme [style*="background:rgba(249,115,22"],
body.light-theme [style*="background: rgba(249,115,22"] {
    background: #fffbeb !important;
    border-color: #fde68a !important;
}



body.light-theme [style*="background:rgba(255,255,255"],
body.light-theme [style*="background: rgba(255,255,255"],
body.light-theme [style*="background:rgba(0,0,0"],
body.light-theme [style*="background: rgba(0,0,0"] {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: var(--text-primary) !important;
}

/* Override inline foreground text colors for light mode visibility */
body.light-theme [style*="color:#818cf8"],
body.light-theme [style*="color: #818cf8"],
body.light-theme [style*="color:#a78bfa"],
body.light-theme [style*="color: #a78bfa"] {
    color: #6d28d9 !important; /* Deeper violet/indigo */
}

body.light-theme [style*="color:#f87171"],
body.light-theme [style*="color: #f87171"] {
    color: #dc2626 !important;
}

body.light-theme [style*="color:#fbbf24"],
body.light-theme [style*="color: #fbbf24"],
body.light-theme [style*="color:#f59e0b"],
body.light-theme [style*="color: #f59e0b"] {
    color: #d97706 !important;
}

body.light-theme [style*="color:#34d399"],
body.light-theme [style*="color: #34d399"] {
    color: #059669 !important;
}

body.light-theme [style*="color:#a5f3fc"],
body.light-theme [style*="color: #a5f3fc"],
body.light-theme [style*="color:#60a5fa"],
body.light-theme [style*="color: #60a5fa"] {
    color: #0284c7 !important;
}

body.light-theme [style*="color:#94a3b8"],
body.light-theme [style*="color: #94a3b8"] {
    color: #475569 !important;
}

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

body {
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── Custom Scrollbar ───────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* ── Layout ─────────────────────────────────────── */
.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.app-logo {
    font-size:20px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 32px;
    margin-right: auto;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size:14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.08); /* slight accent background on hover */
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.15); /* active state background */
    font-weight: 600;
}

.app-user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size:14px;
    color: var(--text-secondary);
}

.app-user .credits {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size:12px;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

body.light-theme .btn-logout {
    background: rgba(239, 68, 68, 0.06) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-logout:active {
    transform: translateY(0);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Tabs ───────────────────────────────────────── */
.main-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    border: 1px solid var(--border-primary);
}

.main-tab {
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size:14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: var(--transition);
    text-align: center;
}

.main-tab:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.main-tab.active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Cards ──────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-primary);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease, background-color 0.4s ease;
    animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

body.light-theme .card::before {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(255, 255, 255, 0.2) 100%);
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.card:hover {
    border-color: var(--border-active);
    transform: translateY(-4px) scale(1.005);
    box-shadow: var(--shadow-hover);
}

.card-title {
    font-size:16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    transition: var(--transition);
}

body.light-theme .card-title .icon {
    background: rgba(139, 92, 246, 0.1);
    text-shadow: none;
    color: var(--accent);
}

.section-title {
    font-size:16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; /* Fixes overflowing on mobile */
}

/* ── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    height: 32px;
    min-width: 100px;
    border-radius: 8px;
    font-size:14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.btn-ghost {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-light);
    border: 1px solid var(--border-primary);
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.2);
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Forms ──────────────────────────────────────── */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size:14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

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

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

input,
select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size:14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size:14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    resize: vertical;
    min-height: 80px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Fix mobile zooming on inputs */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size:16px;
    }
}

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

select option {
    background: var(--bg-secondary);
}

/* ── Tables ─────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size:14px;
}

th {
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
    padding: 12px 14px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-primary);
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

tr:hover td {
    background: rgba(99, 102, 241, 0.05);
}

tr:hover td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

tr:hover td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* ── Badges ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size:12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-draft {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.badge-scheduled {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-sending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    animation: pulse 2s infinite;
}

.badge-completed {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.badge-paused {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}

.badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.badge-bounced {
    background: rgba(234, 88, 12, 0.12);
    color: #fb923c;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ── Modal ──────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-primary);
}

.modal-header h3 {
    font-size:16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size:20px;
    padding: 4px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Filter Bar (Detail Modal) ────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-primary);
    width: 100%;
}

.filter-status-select {
    padding: 8px 12px;
    font-size:14px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    width: auto;
    min-width: 180px;
    max-width: 300px;
    outline: none;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    /* Push to right on desktop */
}

.col-camp-name {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Breakpoint for Filter Bar and Tables */
@media (max-width: 600px) {
    .filter-bar {
        flex-direction: column;
        align-items: center;
        /* Center everything on mobile */
        padding: 16px;
        gap: 16px;
    }

    .filter-status-select {
        width: 100%;
        min-width: unset;
        max-width: none;
        text-align: left;
    }

    .filter-actions {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        /* Center buttons */
    }

    .hide-mobile {
        display: none !important;
    }
    .col-camp-name {
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .editor-actions {
        width: 100%;
        flex-direction: column;
        margin-left: 0 !important;
        margin-top: 8px;
    }

    .editor-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Toast ──────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size:14px;
    max-width: 360px;
    animation: toastIn 0.3s;
    box-shadow: var(--shadow);
}

.toast-success {
    background: rgba(22, 22, 50, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: var(--success);
}

.toast-error {
    background: rgba(22, 22, 50, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger);
}

.toast-warning {
    background: rgba(22, 22, 50, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--warning);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── Progress bar ───────────────────────────────── */
.progress-bar {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 20px;
    transition: width 0.5s;
}

/* ── Stats ──────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
}

.stat-card .value {
    font-size:24px;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-card .label {
    font-size:12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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


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

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

/* ── Empty state ────────────────────────────────── */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty .icon {
    font-size:32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty p {
    font-size:14px;
}

/* ── Pagination ─────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 0 4px;
    flex-wrap: wrap;
}

.pg-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size:14px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.pg-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-light);
    border-color: var(--border-active);
}

.pg-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

.pg-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pg-ellipsis {
    color: var(--text-muted);
    padding: 0 4px;
}

.pg-info {
    margin-left: 8px;
    font-size:12px;
    color: var(--text-muted);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
    .app-container {
        padding: 16px 12px;
    }

    .app-header {
        padding: 10px 16px;
        flex-wrap: wrap; /* allow wrapping if needed */
        height: auto;
        justify-content: space-between;
    }

    .app-logo {
        font-size:20px;
    }

    .app-nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        justify-content: center;
        margin-top: 8px;
        border-top: 1px solid var(--border-primary);
        padding-top: 8px;
    }

    .nav-link {
        font-size:14px;
        padding: 6px 12px;
    }

    .app-user {
        gap: 8px;
        font-size:12px;
        flex-wrap: wrap;
    }

    .hide-on-mobile,
    .app-user .credits {
        display: none !important;
    }

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

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

    .main-tabs {
        padding: 3px;
        gap: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .main-tabs::-webkit-scrollbar {
        display: none;
    }

    .main-tab {
        padding: 8px 12px;
        font-size:12px;
    }

    .card {
        padding: 16px;
    }

    .section-title {
        font-size:16px; /* Slightly smaller on mobile */
        gap: 6px;
        margin-bottom: 12px;
    }

    th,
    td {
        padding: 8px 10px;
        font-size:12px;
    }

    .btn-sm {
        padding: 5px 8px;
        font-size:12px;
    }

    .modal {
        margin: 24px 8px;
        max-height: calc(100vh - 88px);
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .toast-container {
        right: 16px;
        left: 16px;
    }

    .toast {
        max-width: 100%;
    }

    .smtp-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .app-logo {
        font-size:16px;
    }
}

/* ── Jodit Editor — Dark Theme Override ────────────── */

/* Container & borders */
.jodit-container {
    border: 1px solid var(--border-primary) !important;
    border-radius: var(--radius) !important;
    background: var(--bg-secondary) !important;
}

.jodit-workplace {
    margin-bottom: 0 !important;
    background: #ffffff !important;
}

/* Toolbar */
.jodit-toolbar__box,
.jodit-toolbar-editor-collection {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

.jodit-toolbar-button__button {
    color: var(--text-primary) !important;
    border-radius: 6px !important;
    transition: var(--transition);
}

.jodit-toolbar-button__button svg {
    fill: var(--text-primary) !important;
}

.jodit-toolbar-button__button:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--accent) !important;
}

.jodit-toolbar-button__button[aria-pressed="true"],
.jodit-toolbar-button_active_true .jodit-toolbar-button__button {
    background: rgba(99, 102, 241, 0.25) !important;
    color: var(--accent) !important;
}

.jodit-toolbar-button__trigger {
    color: var(--text-primary) !important;
}

.jodit-toolbar-button__trigger svg {
    fill: var(--text-primary) !important;
}

.jodit-toolbar__box .jodit-separator {
    border-color: var(--border-primary) !important;
}

/* Editor area — keep WHITE for realistic email preview */
.jodit-wysiwyg {
    background: transparent !important;
    color: #1e293b !important;
    padding: 24px 32px !important;
    font-family: Arial, sans-serif !important;
    font-size:16px !important;
    line-height: 1.7 !important;
}

/* Source code view */
.jodit-source__mirror-fake,
.jodit-source__mirror {
    background: #0d1117 !important;
    color: #c9d1d9 !important;
    font-family: 'Consolas', 'Monaco', monospace !important;
    font-size:14px !important;
    border: none !important;
    padding: 16px !important;
}

body.light-theme .jodit-source__mirror-fake,
body.light-theme .jodit-source__mirror {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Status bar */
.jodit-status-bar {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-primary) !important;
    color: var(--text-muted) !important;
}

.jodit-status-bar a,
.jodit-status-bar__item {
    color: var(--text-muted) !important;
}

/* Dropdown menus & popups */
.jodit-popup,
.jodit-popup__content {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
    color: var(--text-primary) !important;
}

.jodit-popup .jodit-toolbar-button__button {
    color: var(--text-primary) !important;
}

.jodit-popup .jodit-toolbar-button__button svg {
    fill: var(--text-primary) !important;
}

.jodit-popup .jodit-toolbar-button__button:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--text-primary) !important;
}

/* Input fields in popups (link, image URL, etc.) */
.jodit-ui-input__input,
.jodit-ui-input__wrapper,
.jodit-ui-text-area__input,
.jodit-ui-select__select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    font-family: inherit !important;
}

.jodit-ui-input__input:focus,
.jodit-ui-text-area__input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

.jodit-ui-input__label {
    color: var(--text-secondary) !important;
}

/* Buttons in popups */
.jodit-ui-button_variant_primary {
    background: var(--accent-gradient) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
}

.jodit-ui-button_variant_default {
    background: var(--bg-input) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 8px !important;
}

/* File browser / tabs */
.jodit-tabs__buttons {
    background: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

.jodit-tabs__buttons .jodit-tabs__button {
    color: var(--text-secondary) !important;
}

.jodit-tabs__buttons .jodit-tabs__button.active {
    color: var(--accent-light) !important;
    border-color: var(--accent) !important;
}

/* Color picker */
.jodit-color-picker {
    background: var(--bg-secondary) !important;
}

/* Drag/resize handles */
.jodit-resizer>span {
    background: var(--accent) !important;
}

/* Placeholder text */
.jodit-placeholder {
    color: var(--text-muted) !important;
    padding: 24px 32px !important;
}

/* ═══════════════════════════════════════════════════
   Landing Page (index.php)
   ═══════════════════════════════════════════════════ */
body.landing-page {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
body.landing-page .bg { position: fixed; inset: 0; z-index: 0; }
body.landing-page .hero { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 0; position: relative; z-index: 1; }

body.landing-page .features-section { position: relative; z-index: 1; padding: 80px 20px; background: rgba(13, 13, 30, 0.3); border-top: 1px solid var(--border-primary); }
body.landing-page.light-theme .features-section { background: rgba(255, 255, 255, 0.4); }
body.landing-page .features-title { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 48px; background: var(--text-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

body.landing-page .pricing-section { position: relative; z-index: 1; padding: 80px 20px; background: var(--bg-card); border-top: 1px solid var(--border-primary); }
body.landing-page .pricing-container { max-width: 1040px; margin: 0 auto; }
body.landing-page .pricing-title { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 16px; background: var(--text-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.landing-page .pricing-desc { text-align: center; color: var(--text-secondary); font-size: 16px; max-width: 600px; margin: 0 auto 48px; line-height: 1.6; }
body.landing-page .pricing-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: center; }
@media(max-width:900px) { body.landing-page .pricing-cards { grid-template-columns: 1fr; gap: 32px; } }

body.landing-page .p-card { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 24px; padding: 36px; text-align: center; transition: var(--transition); position: relative; }
body.landing-page .p-card:hover { transform: translateY(-8px); border-color: var(--border-active); background: var(--bg-card); box-shadow: var(--shadow-hover); }
body.landing-page .p-card.highlighted { background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%); border-color: var(--accent); box-shadow: var(--shadow-accent); transform: scale(1.05); }
@media(max-width:900px) { 
    body.landing-page .p-card.highlighted { transform: scale(1); } 
    body.landing-page .p-card.highlighted:hover { transform: translateY(-8px); } 
}
body.landing-page .p-card.highlighted:hover { transform: scale(1.05) translateY(-8px); }
body.landing-page .badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--accent-gradient); color: #fff; font-size: 14px; font-weight: 600; padding: 6px 16px; border-radius: 24px; letter-spacing: 0.5px; box-shadow: var(--shadow-accent); }
body.landing-page .p-card h3 { font-size: 20px; color: var(--text-primary); font-weight: 600; margin-bottom: 12px; }
body.landing-page .price { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-bottom: 28px; display: flex; justify-content: center; align-items: flex-start; }
body.landing-page .price span { font-size: 20px; color: var(--text-secondary); font-weight: 500; margin-top: 6px; margin-left: 4px; }
body.landing-page .p-features { list-style: none; text-align: left; margin-bottom: 36px; }
body.landing-page .p-features li { color: var(--text-secondary); font-size: 14px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; }
body.landing-page .p-features li::before { content: '✓'; color: var(--success); font-weight: bold; font-size: 16px; }

body.landing-page .p-btn { width: 100%; padding: 16px; border-radius: 14px; border: 1px solid var(--border-active); background: transparent; color: var(--text-primary); font-size: 16px; font-weight: 600; cursor: pointer; transition: var(--transition); }
body.landing-page .p-btn:hover { background: rgba(99,102,241,.1); border-color: var(--accent); }
body.landing-page .p-card.highlighted .p-btn { background: var(--accent-gradient); border: none; box-shadow: var(--shadow-accent); color: #fff; }
body.landing-page .p-card.highlighted .p-btn:hover { box-shadow: 0 10px 25px rgba(99,102,241,.5); transform: translateY(-2px); }

body.landing-page .bg::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at 30% 40%, rgba(99,102,241,.15), transparent 50%), radial-gradient(circle at 70% 60%, rgba(139,92,246,.12), transparent 50%); animation: bgFloat 20s ease-in-out infinite; }
@keyframes bgFloat { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-3%,2%); } }

body.landing-page .container { position: relative; z-index: 1; width: 100%; max-width: 1140px; padding: 20px; display: flex; gap: 40px; align-items: center; min-height: 80vh; margin: 0 auto; }

/* Intro Panel */
body.landing-page .intro { flex: 1.2; display: flex; flex-direction: column; justify-content: center; padding: 20px 0; }
body.landing-page .intro-logo { margin-bottom: 24px; }
body.landing-page .intro-logo h1 { font-size: 40px; font-weight: 800; color: #fff; margin-top: 16px; line-height: 1.2; letter-spacing: -0.5px; }
body.landing-page .intro-logo h1 span { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.landing-page .intro-tagline { color: #94a3b8; font-size: 16px; margin-top: 16px; line-height: 1.6; max-width: 90%; }
body.landing-page .features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 40px; }
@media(max-width:768px) { 
    body.landing-page .features { grid-template-columns: 1fr; } 
}

/* Bento Item Styles */
body.landing-page .feature { 
    display: flex; 
    flex-direction: column;
    gap: 16px; 
    align-items: flex-start; 
    padding: 24px; 
    border-radius: 20px; 
    background: rgba(30, 30, 56, 0.6); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative;
    overflow: hidden;
}

body.landing-page.light-theme .feature {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.landing-page .feature.bento-large { grid-column: span 2; }
body.landing-page .feature.bento-wide { grid-column: span 2; }
@media(max-width:768px) { 
    body.landing-page .feature.bento-large, body.landing-page .feature.bento-wide { grid-column: auto; }
}

body.landing-page .feature:hover { 
    background: var(--bg-secondary); 
    border-color: var(--accent); 
    transform: translateY(-4px); 
    box-shadow: var(--shadow-hover);
}

body.landing-page .feature-icon { 
    font-size: 24px; 
    flex-shrink: 0; 
    width: 48px; 
    height: 48px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: rgba(99,102,241,.1); 
    border-radius: 14px; 
}
body.landing-page .feature strong { font-size: 16px; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 4px; }
body.landing-page .feature p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin: 0; }

/* Login Card - Glassmorphism */
body.landing-page .card { 
    background: rgba(22, 22, 50, 0.6); 
    backdrop-filter: blur(32px); 
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 24px; 
    padding: 40px; 
    box-shadow: 0 20px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,0.1); 
    width: 100%; 
    max-width: 400px; 
    flex-shrink: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 24px;
    justify-content: center; 
}
body.landing-page.light-theme .card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 30px 60px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,1);
}
body.landing-page .logo { text-align: center; margin-bottom: 32px; display: none; }
body.landing-page .logo h1 { font-size: 32px; font-weight: 700; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.landing-page .logo p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
body.landing-page .tabs { display: flex; gap: 8px; background: rgba(0,0,0,0.2); border-radius: 12px; padding: 6px; margin-bottom: 0; }
body.landing-page .tab { flex: 1; padding: 10px; text-align: center; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; color: #94a3b8; transition: var(--transition); }
body.landing-page .tab.active { background: var(--accent-gradient); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.3); }
body.landing-page.light-theme .tabs { background: rgba(0,0,0,0.05); }
body.landing-page.light-theme .tab { color: var(--text-secondary); }
body.landing-page.light-theme .tab.active { color: #fff; background: var(--accent-gradient); }

body.landing-page .form { display: none; }
body.landing-page .form.active { display: flex; flex-direction: column; gap: 16px; }
body.landing-page .field { margin-bottom: 0; }
body.landing-page .field label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #cbd5e1; margin-bottom: 8px; }
body.landing-page.light-theme .field label { color: var(--text-secondary); }
body.landing-page .field input { width: 100%; height: 48px; padding: 0 16px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: #fff; font-size: 14px; font-family: inherit; transition: var(--transition); outline: none; }
body.landing-page.light-theme .field input { background: #fff; border-color: rgba(0,0,0,0.1); color: var(--text-primary); }
body.landing-page .field input:focus { border-color: var(--accent); background: rgba(0,0,0,0.3); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
body.landing-page.light-theme .field input:focus { background: #fff; }
body.landing-page .field input::placeholder { color: #64748b; }
body.landing-page .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body.landing-page .btn { 
    width: fit-content;
    min-width: 200px;
    height: 48px;
    padding: 0 32px;
    background: var(--accent-gradient); 
    color: #fff; 
    border: none; 
    border-radius: 12px; 
    font-size: 15px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: var(--transition); 
    font-family: inherit; 
    margin: 16px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.landing-page .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-accent); }
body.landing-page .btn:active { transform: translateY(0); }
body.landing-page .btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
body.landing-page .alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: none; animation: slideIn .3s; }
body.landing-page .alert.success { display: block; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: var(--success); }
body.landing-page .alert.error { display: block; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
body.landing-page .optional { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* Intro Benefits Checklist */
body.landing-page .intro-benefits {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
body.landing-page .benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #cbd5e1;
    font-weight: 500;
}
body.landing-page.light-theme .benefit-item {
    color: var(--text-secondary);
}
body.landing-page .benefit-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    color: #a5b4fc;
    flex-shrink: 0;
}
body.landing-page.light-theme .benefit-icon {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

/* Hero Dashboard Mockup Widget */
body.landing-page .hero-mockup-widget {
    margin-top: 36px;
    background: rgba(22, 22, 50, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    max-width: 95%;
    animation: floatWidget 6s ease-in-out infinite;
}
body.landing-page.light-theme .hero-mockup-widget {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}
@keyframes floatWidget {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

body.landing-page .widget-header {
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
body.landing-page.light-theme .widget-header {
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
body.landing-page .widget-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
body.landing-page .widget-dot.red { background: #ef4444; }
body.landing-page .widget-dot.yellow { background: #f59e0b; }
body.landing-page .widget-dot.green { background: #10b981; }

body.landing-page .widget-title {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 6px;
}
body.landing-page.light-theme .widget-title {
    color: var(--text-secondary);
}

body.landing-page .widget-body {
    padding: 20px;
}
body.landing-page .widget-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
body.landing-page .widget-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
body.landing-page .widget-label {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
body.landing-page .widget-val {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
}
body.landing-page.light-theme .widget-val {
    color: var(--text-primary);
}

body.landing-page .widget-progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}
body.landing-page.light-theme .widget-progress-container {
    background: rgba(0, 0, 0, 0.08);
}
body.landing-page .widget-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 3px;
}

body.landing-page .widget-footer-text {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

body.landing-page .mobile-logo { display: none; }
@media(min-width:769px) { body.landing-page .logo { display: block; } body.landing-page .logo img { display: none; } }
@media(max-width:768px) {
    body.landing-page .container { flex-direction: column; max-width: 440px; padding: 16px; gap: 20px; }
    body.landing-page .card { max-width: 100%; order: -1; padding: 24px 20px; }
    body.landing-page .intro-logo { display: none; }
    body.landing-page .intro { padding: 0; }
    body.landing-page .intro-benefits,
    body.landing-page .hero-mockup-widget {
        display: none;
    }
    body.landing-page .features { gap: 8px; }
    body.landing-page .logo { display: block; }
    body.landing-page .mobile-logo { display: inline-block !important; width: 48px !important; height: 48px !important; }
    body.landing-page .logo h1 { font-size: 24px; }
}

/* FAQ Section */
body.landing-page .faq-section { padding: 80px 20px; background: var(--bg-primary); position: relative; z-index: 1; }
body.landing-page .faq-container { max-width: 800px; margin: 0 auto; }
body.landing-page .faq-title { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 12px; background: linear-gradient(135deg, var(--text-primary), var(--text-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.landing-page .faq-desc { text-align: center; color: var(--text-secondary); font-size: 16px; margin-bottom: 40px; }
body.landing-page .faq-list { display: flex; flex-direction: column; gap: 16px; }
body.landing-page .faq-item { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: 16px; overflow: hidden; transition: var(--transition); }
body.landing-page .faq-item.active { border-color: var(--border-active); box-shadow: var(--shadow-accent); }
body.landing-page .faq-question { padding: 20px 24px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
body.landing-page .faq-question h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }
body.landing-page .faq-icon { font-size: 24px; font-weight: 400; color: var(--accent); transition: var(--transition); line-height: 1; }
body.landing-page .faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
body.landing-page .faq-item.active .faq-answer { max-height: 500px; }
body.landing-page .faq-answer p { padding: 0 24px 24px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0; }
body.landing-page .faq-answer strong { color: var(--text-primary); font-weight: 600; }

/* Main Footer */
body.landing-page .main-footer { background: var(--bg-secondary); border-top: 1px solid var(--border-primary); padding: 60px 20px 20px; position: relative; z-index: 1; }
body.landing-page .footer-container { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media (max-width: 768px) { body.landing-page .footer-container { grid-template-columns: 1fr; gap: 32px; } }
body.landing-page .footer-col h4 { color: var(--text-primary); font-size: 16px; font-weight: 600; margin-bottom: 20px; }
body.landing-page .f-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; color: var(--text-primary); margin-bottom: 16px; }
body.landing-page .f-logo svg { width: 24px; height: 24px; color: var(--accent); }
body.landing-page .f-desc { color: var(--text-secondary); font-size: 14px; line-height: 1.6; max-width: 320px; }
body.landing-page .f-links { list-style: none; display: flex; flex-direction: column; gap: 12px; }
body.landing-page .f-links li { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 14px; }
body.landing-page .f-links li svg { width: 18px; height: 18px; color: var(--text-secondary); }
body.landing-page .f-links a { color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
body.landing-page .f-links a:hover { color: var(--accent-light); }
body.landing-page .footer-bottom { max-width: 1140px; margin: 0 auto; padding-top: 24px; border-top: 1px solid var(--border-primary); text-align: center; color: var(--text-muted); font-size: 12px; }

/* Theme Toggle Button */
body.landing-page #themeToggleBtn { padding: 4px 12px; height: 40px; border-radius: 20px; font-size: 14px; border: 1px solid var(--border-primary); background: var(--bg-card); color: var(--text-primary); cursor: pointer; backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; gap: 6px; transition: var(--transition); box-shadow: var(--shadow); }

/* Landing Page Light Theme Overrides */
body.landing-page.light-theme .p-card.highlighted { background: linear-gradient(180deg,#ffffff 0%,#f8fafc 100%); box-shadow: 0 15px 40px rgba(139,92,246,.15); }
body.landing-page.light-theme .intro-logo h1, 
body.landing-page.light-theme .logo h1 { background: linear-gradient(135deg,#4f46e5,#7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.landing-page.light-theme .pricing-title { background: linear-gradient(135deg,#1e293b,#475569); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.landing-page.light-theme .faq-item { box-shadow: 0 4px 15px rgba(0,0,0,.02); }

/* Animations */
.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* ── Sidebar & Layout ───────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: rgba(13, 13, 30, 0.7);
    border-right: 1px solid var(--border-primary);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 150;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme .app-sidebar {
    background: rgba(255, 255, 255, 0.8);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.sidebar-menu-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 12px 12px 6px;
}

.sidebar-tab, .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, color 0.3s ease;
}

.sidebar-tab:hover, .sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.08);
}

.sidebar-tab.active, .sidebar-link.active {
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-accent);
}

.sidebar-tab .menu-icon, .sidebar-link .menu-icon {
    font-size: 18px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-tab.active .menu-icon, .sidebar-link.active .menu-icon {
    transform: scale(1.2) rotate(-5deg);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.15);
}

body.light-theme .sidebar-footer {
    background: rgba(0, 0, 0, 0.02);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 170px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-credits {
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
    margin-top: 1px;
}

.app-sidebar .btn-logout {
    background: rgba(239, 68, 68, 0.08) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
    flex-shrink: 0;
    box-shadow: none !important;
    transform: none !important;
}

body.light-theme .app-sidebar .btn-logout {
    background: rgba(239, 68, 68, 0.06) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}

.app-sidebar .btn-logout:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15) !important;
}

/* ── Main Panel & Top Bar ──────────────────────── */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.app-topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.light-theme .app-topbar {
    background: rgba(255, 255, 255, 0.9);
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    margin-left: -8px;
    align-items: center;
    justify-content: center;
}

.app-content {
    flex: 1;
    padding: 32px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 140;
}

/* ── Skeleton Loaders ───────────────────────────── */
.skeleton-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
    width: 100%;
}

.skeleton-row {
    height: 40px;
    background: linear-gradient(90deg, var(--bg-input) 25%, rgba(99, 102, 241, 0.08) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}

.skeleton-row.header {
    height: 32px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(99, 102, 241, 0.12) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
}

body.light-theme .skeleton-row {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
}
body.light-theme .skeleton-row.header {
    background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive styles for sidebar layout */
@media (max-width: 1024px) {
    .app-content {
        padding: 24px;
    }
    .app-topbar {
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
        height: 100vh;
    }
    
    .app-sidebar.mobile-active {
        transform: translateX(0);
    }
    
    .app-sidebar.mobile-active ~ .sidebar-overlay {
        display: block;
    }
    
    .app-topbar {
        padding: 0 16px;
    }
    
    .topbar-title {
        font-size: 16px;
    }
    
    .app-content {
        padding: 16px;
    }
}