:root {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent: #f59e0b;
    --border: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.8);
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

/* Desktop: sidebar-toggled is not used, hamburger is hidden */

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.05em;
    text-decoration: none;
    display: block;
    /* margin-bottom: 1rem; */
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.nav-link.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
}

.main-content.full-width {
    margin-left: 0;
    width: 100%;
}

.no-sidebar .sidebar {
    display: none;
}

.no-sidebar .main-content {
    margin-left: 0;
    width: 100%;
}

.no-sidebar .hamburger,
.no-sidebar .overlay,
.is-hidden {
    display: none !important;
}

/* Auth pages */
body.auth-page {
    display: block;
}

body.marketing-body {
    font-family: 'Outfit', sans-serif;
}

.auth-page .main-content {
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.auth-page .app-header {
    display: none;
}

.auth-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 3vw, 3rem) 1.25rem;
}

.auth-card {
    width: min(420px, 92%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
}

.auth-brand {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.auth-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    /* margin-bottom: 1.5rem; */
}

body.marketing-body .auth-shell {
    min-height: 0;
}

body.marketing-body .auth-title,
body.marketing-body .auth-subtitle {
    text-align: left;
}

body.marketing-body .auth-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
}

.marketing-header {
    padding: 1.1rem 0;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.marketing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.marketing-footer {
    padding: 2rem 0 2.5rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: auto;
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}

.brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--primary);
    text-decoration: none;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.auth-alert {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
}

.error-text {
    color: #dc2626;
    font-size: 0.85rem;
}

.reveal {
    animation: fadeUp 0.6s ease both;
}

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

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

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger {
    display: none !important;
    /* Default hidden on desktop */
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    z-index: 100;
    /* Baseline z-index */
}

.hamburger span {
    width: 20px;
    height: 2px;
    background: var(--text-main);
    margin: 2px 0;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-4px, 4px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-4px, -4px);
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.2;
    gap: 0.5rem;
    height: 42px;
    white-space: nowrap;
    max-width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 12px rgba(139, 92, 246, 0.4);
    background: var(--primary-hover);
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.btn-secondary {
    background: #64748b;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: #10b981;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline,
.btn-danger {
    min-width: 120px;
    justify-content: center;
}

.btn-outline.btn-sm,
.btn-danger.btn-sm {
    min-width: 90px;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    height: 32px;
}

/* Loading Spinner */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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


/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    /* Standardized spacing below header */
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    /* Standard padding */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
    /* Consistent spacing between cards */
}

.card-flush {
    padding: 0;
}

.card-padding {
    padding: 1.5rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-footer {
    padding: .5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    text-align: right;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.card-divider {
    margin: 1.5rem 0;
    border-top: 1px solid var(--border);
}

.container-xs {
    max-width: 400px;
    margin: 0 auto;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
}

.container-md {
    max-width: 800px;
    margin: 0 auto;
}

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

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Utility */
.flex {
    display: flex;
    min-width: 0;
}

.flex > * {
    min-width: 0;
}

.block {
    display: block;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.items-start {
    align-items: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-main {
    color: var(--text-main);
}

.text-accent {
    color: var(--accent);
}

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

.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

.text-xs {
    font-size: 0.85rem;
}

.text-2xs {
    font-size: 0.8rem;
}

.text-sm {
    font-size: 0.9rem;
}

.text-lg {
    font-size: 1.1rem;
}

.text-xl {
    font-size: 1.2rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 2rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Standardized Spacing Scale (0.25rem = 4px steps) */
.m-0 {
    margin: 0 !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* Margins */
.mb-0-5 {
    margin-bottom: 0.5rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-1-5 {
    margin-bottom: 1.5rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mb-3 {
    margin-bottom: 3rem;
}

.mt-0-5 {
    margin-top: 0.5rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-1-5 {
    margin-top: 1.5rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-auto {
    margin-top: auto;
}

/* Paddings */
.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 1rem;
}

.p-1-5 {
    padding: 1.5rem;
}

.p-2 {
    padding: 2rem;
}

.px-1 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-1-5 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.px-2 {
    padding-left: 2rem;
    padding-right: 2rem;
}

.py-0-5 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-1 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-1-5 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.pt-1 {
    padding-top: 1rem;
}

.pt-1-5 {
    padding-top: 1.5rem;
}

.pb-1 {
    padding-bottom: 1rem;
}

/* Gaps */
.gap-0-5 {
    gap: 0.5rem;
}

.gap-1 {
    gap: 1rem;
}

.gap-1-5 {
    gap: 1.5rem;
}

.gap-2 {
    gap: 2rem;
}

/* Utility Overrides for cleaner HTML */
.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}


/* .mb-2 { margin-bottom: 2rem; } */

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.action-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.btn-borderless {
    border: none;
}

.btn-block {
    width: 100%;
}

.btn-slim {
    padding: 0 1rem;
}

.btn-compact {
    height: auto;
    padding: 0.5rem 1rem;
}

.btn-min-120 {
    min-width: 120px;
}

.btn-min-200 {
    min-width: 200px;
}

.btn-min-220 {
    min-width: 220px;
}

.preview-toggle {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-toggle {
    background: transparent;
    border: 1px solid var(--chat-border, var(--border));
    color: var(--text-muted);
}

.btn-toggle.is-active {
    background: var(--chat-accent-soft, rgba(139, 92, 246, 0.14));
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--text-main);
}

.preview-subject {
    background: #ffffff;
    border: 1px solid var(--chat-border, var(--border));
    border-radius: 0.9rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.preview-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.preview-subject-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.template-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.body-content {
    background: #ffffff;
    border: 1px solid var(--chat-border, var(--border));
    border-radius: 0.9rem;
    padding: 1rem;
    line-height: 1.6;
    min-height: 220px;
}

.preview-code {
    white-space: pre-wrap;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(15, 23, 42, 0.4);
}

.input-md {
    height: 42px;
}

.select-multiple {
    height: 140px;
    padding: 0.75rem;
}

.textarea-resize {
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-input {
    width: auto;
}

.smtp-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    max-width: 100%;
}

.table-container.table-horizontal {
    -webkit-overflow-scrolling: touch;
}

.table-container.table-horizontal table {
    min-width: 640px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead tr {
    background: #f8fafc;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    padding: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 2.25rem;
    user-select: none;
}

th.sortable::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid var(--text-muted);
    opacity: 0.35;
    transform: translateY(-50%);
}

th.sortable.sorted-asc::after {
    border-top-color: var(--primary);
    opacity: 0.9;
    transform: translateY(-50%) rotate(180deg);
}

th.sortable.sorted-desc::after {
    border-top-color: var(--primary);
    opacity: 0.9;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    /* margin-bottom: 2rem; */
}

.grid-3 > * {
    min-width: 0;
}

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

.grid-2 > * {
    min-width: 0;
}

.grid-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.grid-split > * {
    min-width: 0;
}

.grid-span-full {
    grid-column: 1 / -1;
}

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

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

.empty-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.empty-text {
    margin-bottom: 1.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    color: #475569;
}

.status-inline {
    display: inline-block;
    margin-top: 0.25rem;
}

.badge-muted {
    background: #f1f5f9;
    color: #475569;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.panel {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.panel-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.panel-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.code-badge {
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.alert-danger {
    margin-top: 1.5rem;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.alert-danger-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #c53030;
}

.alert-danger-text {
    color: #742a2a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.message-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
}

.detail-card {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.detail-card-header {
    background: #f8fafc;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.detail-card-body {
    padding: 2rem;
    background: white;
    max-height: 400px;
    overflow-y: auto;
}

.email-preview-frame {
    width: 100%;
    min-height: 320px;
    border: none;
    display: block;
    background: #ffffff;
}

.pagination-padded {
    padding: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

.header-user {
    font-weight: 500;
    color: var(--text-muted);
}

#django-messages {
    display: none;
}

/* Ensure SweetAlert overlays all UI (sidebar/hamburger/overlay) */
.swal2-container {
    z-index: 2000 !important;
}

.swal2-actions {
    gap: 0.75rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-DRAFT {
    background: #f1f5f9;
    color: #475569;
}

.status-SENT,
.status-COMPLETED {
    background: #dcfce7;
    color: #166534;
}

.status-SCHEDULED {
    background: #fef3c7;
    color: #92400e;
}

.status-SENDING {
    background: #dbeafe;
    color: #1e40af;
}

.status-PAUSED {
    background: #ffedd5;
    color: #9a3412;
}

.status-FAILED,
.status-BOUNCED {
    background: #fee2e2;
    color: #991b1b;
}

.status-lg {
    font-size: 1rem;
    padding: 0.5rem 1.25rem;
}


.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    /* Between main content and sidebar drawer */
    display: none;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-link:hover:not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.pagination-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

.pagination-link.nav-btn {
    width: auto;
    padding: 0 1rem;
}

/* Search & Filters */
.filters-container {
    width: 100%;
    margin: 0;
}

.filters-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.filters-toolbar .search-group {
    flex: 1 1 260px;
    min-width: 220px;
}

.filters-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.search-group {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-input {
    padding-left: 2.75rem !important;
    height: 42px;
    padding-right: 2.5rem !important;
}

.search-clear-btn {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    color: var(--text-main);
    background: rgba(15, 23, 42, 0.06);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select,
.date-input {
    width: auto;
    min-width: 140px;
    height: 42px;
    padding: 0.5rem 0.75rem;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 140px;
}

.date-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.date-input {
    padding-left: 2.35rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M7 3v3M17 3v3M4 9h16M5 6h14a1 1 0 0 1 1 1v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a1 1 0 0 1 1-1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 16px;
}

.date-field .date-input {
    width: 100%;
}

.filter-shell {
    width: 100%;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-toggle.is-active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
}

.filters-active-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1400;
    backdrop-filter: blur(2px);
}

.filter-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1500;
}

.filter-modal-card {
    width: min(680px, 92%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(16px);
    transition: transform 0.2s ease, opacity 0.2s ease;
    max-height: 90vh;
    overflow: hidden;
}

.filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.filter-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.filter-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: calc(90vh - 64px);
}

.filter-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.filter-close {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.filter-close:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
}

.filter-shell.is-open .filter-overlay {
    opacity: 1;
    visibility: visible;
}

.filter-shell.is-open .filter-modal {
    pointer-events: auto;
}

.filter-shell.is-open .filter-modal-card {
    opacity: 1;
    transform: translateY(0);
}

.filter-modal .search-group {
    min-width: 100%;
}

.filter-modal .filter-select,
.filter-modal .date-input {
    min-width: 160px;
}

body.modal-open {
    overflow: hidden;
}

.billing-shell {
    position: relative;
}

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

.plan-card {
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 0.85rem;
    padding: 1rem 1.1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.2s ease;
    min-height: 120px;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
    color: var(--text-main);
    max-width: 100%;
}

.plan-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.plan-card:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.6);
    outline-offset: 2px;
}

.plan-card:focus-within {
    outline: 2px solid rgba(139, 92, 246, 0.6);
    outline-offset: 2px;
}

.plan-card.is-selected {
    border-color: var(--primary);
    box-shadow: 0 12px 26px rgba(139, 92, 246, 0.18);
    background: rgba(139, 92, 246, 0.06);
}

.plan-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.plan-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.plan-card-meta {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.plan-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.template-card-footer {
    gap: 0.75rem;
    flex-wrap: wrap;
}

.template-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .template-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .template-card-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 0.5rem;
        width: 100%;
    }

    .template-card-actions .btn {
        width: 100%;
    }

    .template-card-badge {
        align-self: flex-start;
    }
}

.billing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1600;
    backdrop-filter: blur(2px);
}

.billing-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1700;
}

.billing-modal-card {
    width: min(680px, 92%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(16px);
    transition: transform 0.2s ease, opacity 0.2s ease;
    max-height: 90vh;
    overflow: hidden;
}

.billing-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.billing-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.billing-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

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

.billing-modal-footer .btn {
    margin-bottom: 0.4rem;
}

.billing-close {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.billing-close:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
}

.selected-plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.selected-plan-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.selected-plan-value {
    font-weight: 600;
    color: var(--text-main);
}

.selected-plan-amount {
    font-weight: 700;
    color: var(--primary);
}

.billing-shell.is-open .billing-overlay {
    opacity: 1;
    visibility: visible;
}

.billing-shell.is-open .billing-modal {
    pointer-events: auto;
}

.billing-shell.is-open .billing-modal-card {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    .billing-modal {
        align-items: flex-end;
        padding: 0;
    }

    .billing-modal-card {
        width: 100%;
        border-radius: 1rem 1rem 0 0;
        max-height: 80vh;
    }

    .billing-modal-header {
        padding: 0.9rem 1rem;
    }

    .billing-modal-body {
        padding: 1rem;
        max-height: calc(80vh - 120px);
    }

    .billing-modal-footer {
        padding: 0.5rem 1rem calc(1.9rem + env(safe-area-inset-bottom));
    }

    .selected-plan {
        flex-direction: column;
        align-items: flex-start;
    }
}

input[type="date"] {
    font-family: inherit;
    color: var(--text-main);
}

/* Page Headers */
.page-header {
    margin-bottom: 2.5rem;
}

.page-header-actions {
    margin-bottom: 1.5rem;
}

.user-profile {
    margin-top: auto;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-value {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
}

.user-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: #ef4444;
    background: #fee2e2;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: #fecaca;
    transform: scale(1.05);
}

/* Global Loader */
#global-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: wait;
}

#global-loader.active {
    display: flex;
}

.spinner-ring {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.spinner-ring-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

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

body.loader-active {
    overflow: hidden;
}

body.landing-page {
    --landing-bg: #faf7ff;
    --landing-bg-strong: #f2ebff;
    --landing-surface: rgba(255, 255, 255, 0.88);
    --landing-surface-strong: #ffffff;
    --landing-ink: #0f172a;
    --landing-muted: #6c6782;
    --landing-border: rgba(139, 92, 246, 0.16);
    --landing-primary: #8b5cf6;
    --landing-primary-hover: #7c3aed;
    --landing-primary-soft: rgba(139, 92, 246, 0.14);
    --landing-secondary: #c084fc;
    background:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.18), transparent 26%),
        radial-gradient(circle at 100% 10%, rgba(192, 132, 252, 0.16), transparent 24%),
        linear-gradient(180deg, #fdfaff 0%, #f4ecff 48%, #faf7ff 100%);
    color: var(--landing-ink);
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Manrope', sans-serif;
}

body.landing-page .marketing-header {
    background: rgba(252, 249, 255, 0.84);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    backdrop-filter: blur(18px);
}

body.landing-page .brand {
    color: var(--landing-ink);
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.04em;
}

body.landing-page .btn {
    background: var(--landing-primary);
    border: 1px solid transparent;
    box-shadow: 0 18px 32px rgba(139, 92, 246, 0.22);
}

body.landing-page .btn:hover {
    background: var(--landing-primary-hover);
    box-shadow: 0 20px 36px rgba(139, 92, 246, 0.28);
}

body.landing-page .btn-outline {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(139, 92, 246, 0.16);
    color: var(--landing-ink);
    box-shadow: none;
}

body.landing-page .btn-outline:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.28);
    color: var(--landing-primary);
}

.landing-main {
    overflow: clip;
}

.landing-hero {
    padding: 4.5rem 0 2.75rem;
}

.landing-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 2.25rem;
    align-items: center;
}

.landing-copy {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.landing-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(139, 92, 246, 0.16);
    color: var(--landing-primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.landing-copy h1,
.landing-section-head h2,
.landing-proof-card h2,
.landing-plan-card h3,
.landing-page-card h3,
.landing-flow-card h3 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.04em;
    color: var(--landing-ink);
}

.landing-copy h1 {
    font-size: clamp(2.7rem, 4.6vw, 5rem);
    line-height: 0.98;
    max-width: 12ch;
}

.landing-copy-text,
.landing-section-head p,
.landing-proof-card p,
.landing-page-card p,
.landing-flow-card p,
.landing-empty-copy {
    color: var(--landing-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.landing-copy-text {
    max-width: 60ch;
}

.landing-hero-actions {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.landing-provider-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.landing-provider-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--landing-border);
    color: var(--landing-ink);
    font-size: 0.86rem;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.landing-visual {
    position: relative;
    min-height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-orbit {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
}

.landing-orbit-one {
    width: 340px;
    height: 340px;
    top: 10px;
    right: 25px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, rgba(139, 92, 246, 0) 72%);
}

.landing-orbit-two {
    width: 260px;
    height: 260px;
    bottom: 12px;
    left: 32px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.22) 0%, rgba(192, 132, 252, 0) 72%);
}

.landing-console {
    position: relative;
    width: min(100%, 520px);
    padding: 1.15rem;
    border-radius: 1.9rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 255, 255, 0.68) 100%);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
}

.landing-console-topbar {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.landing-console-topbar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.landing-console-topbar span:nth-child(1) {
    background: rgba(221, 214, 254, 0.96);
}

.landing-console-topbar span:nth-child(2) {
    background: rgba(192, 132, 252, 0.9);
}

.landing-console-topbar span:nth-child(3) {
    background: rgba(139, 92, 246, 0.9);
}

.landing-console-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.landing-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.landing-metric-card,
.landing-compose-card,
.landing-log-card,
.landing-proof-card,
.landing-page-card,
.landing-flow-card,
.landing-plan-card {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.07);
}

.landing-metric-card {
    border-radius: 1.1rem;
    padding: 1rem;
}

.landing-metric-card strong {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    letter-spacing: -0.04em;
    color: var(--landing-ink);
}

.landing-metric-card span {
    color: var(--landing-muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.landing-compose-card {
    border-radius: 1.25rem;
    padding: 1.1rem;
}

.landing-compose-label {
    color: var(--landing-primary);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.landing-compose-subject {
    margin-top: 0.65rem;
    font-weight: 700;
    color: var(--landing-ink);
}

.landing-compose-lines {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.95rem;
}

.landing-compose-lines span,
.landing-template-lines span,
.landing-contact-list span,
.landing-log-stack span {
    display: block;
    height: 11px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(196, 181, 253, 0.18), rgba(139, 92, 246, 0.28));
}

.landing-compose-lines span:nth-child(2) {
    width: 88%;
}

.landing-compose-lines span:nth-child(3) {
    width: 72%;
}

.landing-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}

.landing-tag-row span {
    padding: 0.38rem 0.6rem;
    border-radius: 999px;
    background: var(--landing-primary-soft);
    color: var(--landing-primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.landing-log-card {
    border-radius: 1.25rem;
    padding: 1.1rem;
    display: grid;
    gap: 0.7rem;
}

.landing-log-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    color: var(--landing-ink);
    font-weight: 700;
}

.landing-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--landing-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.landing-status-success {
    background: rgba(16, 185, 129, 0.14);
    color: #0f9f6e;
}

.landing-proof,
.landing-section,
.landing-flow,
.landing-plans {
    padding: 1.4rem 0 5.5rem;
}

.landing-proof-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.landing-proof-card {
    border-radius: 1.4rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.landing-proof-index,
.landing-flow-step,
.landing-plan-type {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--landing-primary);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.landing-proof-card h2 {
    font-size: 1.45rem;
    line-height: 1.08;
}

.landing-section-head {
    max-width: 760px;
    margin-bottom: 2rem;
}

.landing-section-head h2 {
    font-size: clamp(1.9rem, 3vw, 3rem);
    line-height: 1.05;
    margin-top: 0.7rem;
    margin-bottom: 0.8rem;
}

.landing-section-head-inline {
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.landing-page-grid,
.landing-flow-grid,
.landing-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.landing-page-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-page-card,
.landing-flow-card,
.landing-plan-card {
    border-radius: 1.4rem;
    padding: 1.25rem;
}

.landing-page-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.landing-window {
    padding: 0.95rem;
    border-radius: 1.1rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.landing-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.landing-window-title {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.landing-window-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.landing-window-stats span,
.landing-template-block {
    display: block;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, rgba(196, 181, 253, 0.38) 0%, rgba(139, 92, 246, 0.18) 100%);
}

.landing-window-stats span {
    height: 52px;
}

.landing-window-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    height: 100px;
}

.landing-window-chart i {
    display: block;
    flex: 1;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(180deg, rgba(216, 180, 254, 0.95) 0%, rgba(139, 92, 246, 0.54) 100%);
}

.landing-window-chart i:nth-child(1) {
    height: 42%;
}

.landing-window-chart i:nth-child(2) {
    height: 72%;
}

.landing-window-chart i:nth-child(3) {
    height: 56%;
}

.landing-window-chart i:nth-child(4) {
    height: 84%;
}

.landing-window-chart i:nth-child(5) {
    height: 64%;
}

.landing-template-block {
    height: 84px;
    margin-bottom: 0.85rem;
}

.landing-template-lines,
.landing-contact-list,
.landing-log-stack {
    display: grid;
    gap: 0.55rem;
}

.landing-template-lines span:nth-child(2),
.landing-contact-list span:nth-child(2),
.landing-log-stack div:nth-child(2) span {
    width: 84%;
}

.landing-template-lines span:nth-child(3),
.landing-contact-list span:nth-child(4),
.landing-log-stack div:nth-child(3) span {
    width: 64%;
}

.landing-contact-list span {
    height: 13px;
}

.landing-log-stack div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.landing-log-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.45);
}

.landing-log-dot.success {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.landing-log-dot.pending {
    background: var(--landing-secondary);
    box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.18);
}

.landing-page-card h3,
.landing-flow-card h3,
.landing-plan-card h3 {
    font-size: 1.25rem;
    line-height: 1.12;
}

.landing-flow-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-height: 100%;
}

.landing-plan-grid {
    align-items: stretch;
}

.landing-plan-card {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    height: 100%;
}

.landing-plan-card.is-featured {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 240, 255, 0.98) 100%);
    border-color: rgba(139, 92, 246, 0.28);
    transform: translateY(-8px);
    box-shadow: 0 26px 46px rgba(139, 92, 246, 0.18);
}

.landing-plan-top {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.landing-plan-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.landing-plan-price strong {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    line-height: 1;
    color: var(--landing-ink);
}

.landing-plan-price span {
    color: var(--landing-muted);
    font-weight: 700;
}

.landing-plan-points {
    display: grid;
    gap: 0.65rem;
    color: var(--landing-ink);
    font-weight: 700;
}

.landing-plan-points span {
    padding: 0.8rem 0.9rem;
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.landing-plan-empty {
    justify-content: space-between;
}

.landing-footer {
    color: var(--landing-muted);
}

@media (max-width: 1200px) {
    .landing-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-flow-grid,
    .landing-plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .landing-hero-grid,
    .landing-proof-grid {
        grid-template-columns: 1fr;
    }

    .landing-copy h1 {
        max-width: 14ch;
    }

    .landing-visual {
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .landing-hero {
        padding-top: 3rem;
    }

    .landing-page-grid,
    .landing-flow-grid,
    .landing-plan-grid {
        grid-template-columns: 1fr;
    }

    .landing-section,
    .landing-flow,
    .landing-plans {
        padding-bottom: 4.25rem;
    }

    .landing-proof {
        padding-bottom: 3.25rem;
    }
}

@media (max-width: 640px) {
    .landing-copy h1 {
        font-size: 2.45rem;
        max-width: none;
    }

    .landing-console {
        padding: 0.9rem;
        border-radius: 1.35rem;
    }

    .landing-metric-grid {
        grid-template-columns: 1fr;
    }

    .landing-section-head-inline {
        align-items: stretch;
    }

    .landing-page-card,
    .landing-proof-card,
    .landing-flow-card,
    .landing-plan-card {
        padding: 1rem;
        border-radius: 1.15rem;
    }
}

@media (max-width: 480px) {
    .landing-copy h1 {
        font-size: 2rem;
    }

    .landing-kicker,
    .landing-proof-index,
    .landing-flow-step,
    .landing-plan-type {
        font-size: 0.68rem;
    }

    .landing-provider-chip,
    .landing-status,
    .landing-tag-row span {
        font-size: 0.72rem;
    }
}

/* Responsive (at end to ensure overrides work) */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%) !important;
        z-index: 1200 !important;
        /* Above overlay */
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
        position: fixed !important;
    }

    .sidebar.sidebar-toggled {
        transform: translateX(0) !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .app-header {
        position: relative;
        margin-bottom: 1.5rem;
        padding-left: 3.5rem;
    }

    .hamburger {
        display: flex !important;
        /* Show on mobile */
        position: fixed !important;
        /* Fixed to stay on top while drawer is open */
        top: 1rem;
        left: 1rem;
        z-index: 1300 !important;
        /* Highest layer for toggling */
    }

    .hamburger.active {
        display: none !important;
    }

    /* Overlay is already handled by .overlay.active globally, 
       but we want to make sure it doesn't show on desktop accidentally 
       if the user triggers it somehow. */

    .overlay.active {
        display: block !important;
        z-index: 1100 !important;
    }

    .page-header {
        margin-bottom: 1.5rem;
    }

    .card {
        padding: 1.25rem;
    }

    h1 {
        font-size: 1.25rem;
    }

    .flex-between {
        /* flex-direction: column; */
        align-items: flex-start;
        gap: 1rem;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .marketing-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .nav-link {
        font-weight: 600;
    }

    label,
    .font-medium {
        font-weight: 600;
    }

    .font-semibold {
        font-weight: 700;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 0.875rem 0.75rem;
    }

    .app-header {
        margin-top: 0.25rem;
        min-height: 40px;
        align-items: center;
    }

    .filter-modal {
        align-items: flex-end;
    }

    .filter-modal-card {
        width: 100%;
        border-radius: 1rem 1rem 0 0;
    }

    .filter-modal-header {
        padding: 0.9rem 1rem;
    }

    .filter-modal-body {
        padding: 1rem;
        max-height: calc(90vh - 60px);
    }

    .filters-toolbar {
        align-items: stretch;
    }

    .filters-toolbar .search-group {
        min-width: 100%;
    }

    .filters-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .filters-actions .btn {
        flex: 1 1 auto;
    }

    .filters-active-text {
        width: 100%;
    }

    .filter-fields {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .btn,
    .btn-outline,
    .btn-danger {
        min-width: 0;
        white-space: normal;
    }

    .table-container .action-group,
    .table-container .flex.gap-0-5,
    .table-container .actions-cell {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
        width: 100%;
    }

    .table-container .action-group .btn,
    .table-container .flex.gap-0-5 .btn,
    .table-container .actions-cell .btn {
        width: 100%;
    }

    .card .flex-between {
        flex-direction: column;
        align-items: flex-start;
    }

    .card .flex-between > * {
        width: 100%;
    }

    .card .action-group,
    .card .flex.gap-0-5,
    .modal-panel .action-group,
    .modal-panel .flex.gap-0-5 {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 0.5rem;
        width: 100%;
    }

    .card .action-group .btn,
    .card .flex.gap-0-5 .btn,
    .modal-panel .action-group .btn,
    .modal-panel .flex.gap-0-5 .btn {
        width: 100%;
    }

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

    .page-header {
        margin-bottom: 1.25rem;
        gap: 0.75rem;
    }

    .page-header-actions {
        margin-bottom: 1rem;
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .filters-container {
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    h1 {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    h3 {
        font-size: 1rem;
    }

    .sidebar .logo,
    .brand {
        font-size: 1.2rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .user-label {
        font-size: 0.7rem;
    }

    .user-value,
    .header-user {
        font-size: 0.85rem;
    }

    .auth-card {
        padding: 1.4rem;
    }

    .auth-title,
    body.marketing-body .auth-title {
        font-size: 1.4rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }

    .auth-brand {
        font-size: 1.1rem;
    }

    .auth-alert {
        font-size: 0.85rem;
    }

    .text-lg {
        font-size: 0.95rem;
    }

    .text-xl {
        font-size: 1rem;
    }

    .text-2xl {
        font-size: 1.05rem;
    }

    .text-3xl {
        font-size: 1.2rem;
    }

    .grid-3,
    .grid-2 {
        gap: 0.75rem;
    }

    .grid-split {
        gap: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .empty-title {
        font-size: 1.1rem;
    }

    .empty-text {
        font-size: 0.9rem;
    }

    .panel-title {
        font-size: 0.95rem;
    }

    .message-meta {
        font-size: 0.9rem;
    }

    .preview-subject-text {
        font-size: 0.95rem;
    }

    .body-content {
        font-size: 0.95rem;
    }

    .chip {
        font-size: 0.75rem;
    }

    .status-badge {
        font-size: 0.7rem;
    }

    th,
    td {
        padding: 0.85rem 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem 0.625rem;
    }

    .app-header {
        margin-bottom: 1rem;
        padding-left: 4rem;
        margin-top: 0.35rem;
        min-height: 40px;
    }

    .card {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .card-header,
    .card-section,
    .card-footer {
        padding: 0 0 1rem 0;
    }

    .page-header {
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .page-header-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-bottom: 0.75rem;
    }

    h1 {
        font-size: 1.05rem;
    }

    h2 {
        font-size: 0.98rem;
    }

    h3 {
        font-size: 0.92rem;
    }

    .sidebar .logo,
    .brand {
        font-size: 1.05rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .user-label {
        font-size: 0.68rem;
    }

    .user-value,
    .header-user {
        font-size: 0.8rem;
    }

    .auth-card {
        padding: 1.1rem;
    }

    .auth-title,
    body.marketing-body .auth-title {
        font-size: 1.2rem;
    }

    .auth-subtitle {
        font-size: 0.85rem;
    }

    .auth-brand {
        font-size: 1rem;
    }

    .auth-alert {
        font-size: 0.8rem;
    }

    .text-lg {
        font-size: 0.9rem;
    }

    .text-xl {
        font-size: 0.95rem;
    }

    .text-2xl {
        font-size: 1rem;
    }

    .text-3xl {
        font-size: 1.05rem;
    }

    .page-subtitle {
        font-size: 0.8rem;
    }

    .empty-title {
        font-size: 1rem;
    }

    .empty-text {
        font-size: 0.85rem;
    }

    .panel-title {
        font-size: 0.9rem;
    }

    .message-meta {
        font-size: 0.85rem;
    }

    .preview-label {
        font-size: 0.6rem;
    }

    .preview-subject-text {
        font-size: 0.9rem;
    }

    .body-content {
        font-size: 0.9rem;
    }

    .chip {
        font-size: 0.7rem;
    }

    .status-badge {
        font-size: 0.68rem;
    }

    .status-lg {
        font-size: 0.9rem;
        padding: 0.45rem 1rem;
    }

    .grid-3,
    .grid-2 {
        gap: 0.6rem;
    }

    .grid-split {
        gap: 1rem;
    }

    .filters-container {
        margin-bottom: 0.85rem;
    }

    .btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.82rem;
        height: auto;
        min-height: 36px;
        border: 1px solid var(--border);
    }

    .btn-sm {
        padding: 0.35rem 0.625rem;
        font-size: 0.75rem;
        height: auto;
        min-height: 30px;
    }

    input,
    select,
    textarea {
        padding: 0.625rem 0.75rem;
        font-size: 0.9rem;
    }

    th,
    td {
        padding: 0.65rem 0.75rem;
        font-size: 0.9rem;
    }
}
