:root {
    --violet: #6a3cff;
    --pink: #ff4d8f;
    --orange: #ff8a00;
    --grad: linear-gradient(135deg, #6a3cff 0%, #ff4d8f 55%, #ff8a00 100%);
    --ink: #0b0f19;
    --ink-soft: #1b2336;
    --muted: #697386;
    --bg: #f2f4f7;
    --card: #ffffff;
    --line: #e6e9f0;
    --line-2: #eef1f6;
    --sidebar: #0f1422;
    --sidebar-line: rgba(255, 255, 255, 0.09);
    --success: #1a8f5a;
    --success-bg: #e4f6ec;
    --warning: #9a6b00;
    --warning-bg: #fdf0cf;
    --error: #c2384a;
    --error-bg: #fbe7ea;
    --shadow: 0 1px 2px rgba(11, 15, 25, 0.05), 0 16px 38px rgba(11, 15, 25, 0.08);
    --shadow-lg: 0 24px 60px rgba(11, 15, 25, 0.14);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Satoshi", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(640px 300px at 14% -5%, rgba(106, 60, 255, 0.12), transparent 62%),
        radial-gradient(520px 280px at 88% 4%, rgba(255, 138, 0, 0.1), transparent 60%),
        radial-gradient(520px 280px at 55% 0%, rgba(255, 77, 143, 0.09), transparent 58%),
        var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--violet);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: Consolas, Monaco, "Courier New", monospace;
    background: #f6f7fb;
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    padding: 0.15rem 0.45rem;
}

.shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: 2rem 1.4rem;
    background:
        radial-gradient(280px 220px at 20% -10%, rgba(255, 77, 143, 0.16), transparent 60%),
        radial-gradient(260px 200px at 90% 0%, rgba(106, 60, 255, 0.18), transparent 58%),
        linear-gradient(180deg, #12192b 0%, #0b0f19 100%);
    color: #edf1fb;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.brand {
    font-size: 1.8rem;
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.brand span {
    display: inline-block;
    margin-top: 0.55rem;
    font-size: 0.95rem;
    color: rgba(237, 241, 251, 0.72);
    font-weight: 500;
    letter-spacing: 0;
}

.nav {
    display: grid;
    gap: 0.65rem;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    color: #e7eaf3;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-link.is-active,
.nav-link:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--sidebar-line);
    transform: translateY(-1px);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--sidebar-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.mini-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(237, 241, 251, 0.6);
}

.main {
    width: min(1180px, 100%);
    padding: 2rem;
    margin: 0 auto;
}

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

.page-header h1 {
    margin: 0.3rem 0 0;
    font-size: clamp(2.15rem, 4vw, 3.35rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--violet);
}

.header-note {
    max-width: 24rem;
    color: var(--muted);
    text-align: right;
    font-weight: 500;
}

.grid {
    display: grid;
    gap: 1.2rem;
}

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

.grid.single {
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
    min-height: calc(100vh - 9rem);
    align-content: center;
}

.stats-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.25rem;
}

.stats-grid.compact {
    margin-top: 1rem;
}

.card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1.35rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--grad);
    opacity: 0.9;
}

.login-card {
    padding: 2rem;
}

.login-card h2,
.card h2,
.card h3 {
    letter-spacing: -0.02em;
}

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

.section-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.stat-card {
    padding: 1.15rem 1.2rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.96));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card strong {
    display: block;
    margin-top: 0.5rem;
    font-size: clamp(1.9rem, 4vw, 2.45rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pill {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    background: rgba(106, 60, 255, 0.08);
    border: 1px solid rgba(106, 60, 255, 0.12);
    color: var(--ink-soft);
    font-weight: 700;
}

.stack {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-weight: 700;
    font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #d8ddea;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(106, 60, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(106, 60, 255, 0.12);
}

.field textarea {
    resize: vertical;
    min-height: 140px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.9rem;
    align-items: end;
}

.primary-button,
.secondary-button,
.ghost-button {
    appearance: none;
    border: none;
    border-radius: 14px;
    padding: 0.95rem 1.15rem;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

.primary-button {
    color: #fff;
    background: var(--grad);
    box-shadow: 0 12px 26px rgba(106, 60, 255, 0.28);
}

.secondary-button {
    color: #fff;
    background: linear-gradient(135deg, #0b0f19, #1f2940);
    box-shadow: 0 12px 26px rgba(11, 15, 25, 0.18);
}

.compact-button {
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.ghost-button {
    color: #edf1fb;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--sidebar-line);
}

.alert {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-weight: 600;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(26, 143, 90, 0.18);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border-color: rgba(194, 56, 74, 0.18);
}

.callout {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #f9fbfe, #f3f6fb);
}

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

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

th,
td {
    text-align: left;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--line-2);
    vertical-align: top;
}

thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

tbody tr:hover {
    background: rgba(106, 60, 255, 0.025);
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-opted_in,
.status-completed,
.status-delivered,
.status-read {
    background: var(--success-bg);
    color: var(--success);
}

.status-pending_review,
.status-ready,
.status-sending,
.status-sent {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-opted_out,
.status-failed {
    background: var(--error-bg);
    color: var(--error);
}

.flat-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.65rem;
}

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

.site-policy-footer {
    margin-top: 1.4rem;
    padding-bottom: 1.2rem;
}

.site-policy-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
}

.site-policy-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-policy-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.site-policy-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.78rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.site-policy-links a:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.inline-form {
    margin: 0;
}

.campaign-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
}

.runner-actions {
    margin-top: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

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

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

    .sidebar {
        position: static;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .main {
        padding: 1.1rem;
    }

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

    .header-note {
        text-align: left;
    }

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

    .site-policy-footer-inner {
        align-items: flex-start;
    }
}

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

    .card,
    .login-card {
        padding: 1.15rem;
        border-radius: 18px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .primary-button,
    .secondary-button,
    .ghost-button {
        width: 100%;
        justify-content: center;
    }
}
