@font-face {
    font-family: "Blauer Nue";
    src: url("/assets/BlauerNue-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Blauer Nue";
    src: url("/assets/BlauerNue-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Backgrounds */
    --background: var(--background-100);
    --background-soft: var(--background-200);
    --background-muted: var(--background-150);
    --background-100: #fcf7f7;
    --background-150: #f8f0f0;
    --background-200: #f5ecec;
    --background-rgb: 252, 247, 247;

    /* Panels */
    --panel-background: var(--panel-background-100);
    --panel-background-soft: var(--panel-background-50);
    --panel-background-success: var(--panel-background-green);
    --panel-background-error: var(--panel-background-red);
    --panel-background-50: #fffdfd;
    --panel-background-100: #ffffff;
    --panel-background-green: #e7f7ef;
    --panel-background-red: #fff0f0;

    /* Primary (gebaseerd op #991c1c) */
    --primary: var(--primary-700);
    --primary-soft: var(--primary-600);
    --primary-muted: rgba(var(--primary-rgb), 0.22);
    --primary-contrast: var(--panel-background);

    --primary-600: #b12424;
    --primary-700: #991c1c;
    --primary-800: #7f1717;
    --primary-rgb: 153, 28, 28;

    /* Accent */
    --accent: var(--accent-500);
    --accent-soft: rgba(var(--accent-rgb), 0.16);
    --accent-500: #991c1c;
    --accent-rgb: 153, 28, 28;
    --text-on-accent: white;

    /* Secondary blue */
    --accent-blue: var(--accent-blue-500);
    --accent-blue-soft: rgba(var(--accent-blue-rgb), 0.12);
    --accent-blue-500: #c24141;
    --accent-blue-rgb: 194, 65, 65;

    /* Success */
    --accent-success: var(--accent-success-500);
    --accent-success-dark: var(--accent-success-700);
    --accent-success-soft: rgba(var(--accent-success-rgb), 0.12);
    --accent-success-border: rgba(var(--accent-success-rgb), 0.28);
    --accent-success-500: #2ecc71;
    --accent-success-700: #176145;
    --accent-success-rgb: 46, 204, 113;

    /* Error */
    --accent-error: var(--accent-error-700);
    --accent-error-700: #991c1c;
    --accent-mailbox: #991c1c;

    /* Typography & UI */
    --text: #3f1111;
    --text-muted: #8f6b6b;
    --border: #ead6d6;

    --shadow: 0 18px 50px rgba(var(--primary-rgb), 0.10);
    --shadow-soft: 0 8px 24px rgba(var(--primary-rgb), 0.05);
}

* {
    box-sizing: border-box;
}

strong {
    font-weight: 600;
}

[x-cloak] {
    display: none !important;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: "Blauer Nue", Verdana, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.auth-body {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--background-soft) 0%, var(--panel-background) 72%);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-panel {
    display: flex;
    gap: 10px;
    align-items: center;
    align-self: flex-start;
    max-width: 450px;
    width: 100%;
}

.auth-card {
    background: var(--panel-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: clamp(28px, 5vw, 48px);
    box-shadow: var(--shadow);
    width: 100%;
}

.auth-logo {
    width: 350px;
    display: block;
    margin-bottom: 36px;
}

.eyebrow,
.metric-label {
    margin: 0 0 10px;
    color: var(--accent-blue);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0;
}

h1,
h2 {
    color: var(--primary);
    line-height: 1.02;
    letter-spacing: 0;
    font-weight: 600;
}

h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2rem, 2.5rem);
}

h2 {
    margin: 0;
    font-size: clamp(1rem, 1.5vw, 2rem);
}

.auth-copy {
    margin: 18px 0 28px;
    color: var(--text-muted);
    line-height: 1.6;
}

.form-stack {
    display: grid;
    gap: 12px;
}

.form-stack label,
.search-field span,
.campaign-switcher label {
    color: var(--primary);
    font-size: 0.86rem;
    font-weight: 400;
}

.form-stack input,
.search-field input,
.campaign-switcher select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-background-soft);
    color: var(--text);
    padding: 14px 15px;
    outline: none;
}

.form-stack input:focus,
.search-field input:focus,
.campaign-switcher select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px var(--accent-blue-soft);
}

.primary-button {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--text-on-accent);
    cursor: pointer;
    font-weight: 400;
    padding: 15px 18px;
}

.primary-button:hover {
    filter: brightness(0.98);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.86;
}

.loading-button {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.button-spinner {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 2px solid color-mix(in srgb, var(--text-on-accent) 34%, transparent);
    border-top-color: var(--text-on-accent);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

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

.text-link {
    color: var(--primary);
    font-weight: 400;
    text-decoration: none;
}

.auth-visual {
    position: relative;
    min-height: 520px;
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.92), rgba(var(--primary-rgb), 0.58)),
        url("../img/webtify-logo-blue.svg") center 48px / 64% auto no-repeat,
        var(--primary);
}

.mini-card {
    position: absolute;
    right: 32px;
    min-width: 210px;
    border-radius: 8px;
    padding: 22px;
    font-weight: 400;
    box-shadow: 0 18px 36px rgba(var(--primary-rgb), 0.16);
}

.mini-card.yellow {
    top: 48px;
    background: var(--accent);
    color: var(--text-on-accent);
}

.mini-card.dark {
    top: 150px;
    right: 84px;
    background: var(--primary-800);
    color: var(--primary-contrast);
}

.mini-card.light {
    bottom: 52px;
    background: var(--panel-background);
    color: var(--primary);
}

.flash {
    width: 450px;
    max-width: 95%;
    margin: 0 auto 18px;
    border-radius: 8px;
    padding: 14px 16px;
    font-weight: 400;
    align-self: flex-end;
}

.flash.success {
    background: var(--panel-background-success);
    color: var(--accent-success-dark);
}

.flash.error {
    background: var(--panel-background-error);
    color: var(--accent-error);
}

.inline-note {
    margin: 0 0 18px;
    border-radius: 8px;
    background: var(--panel-background-success);
    color: var(--accent-success-dark);
    font-weight: 400;
    padding: 12px 14px;
}

.app-body {
    min-height: 100vh;
    background: var(--background);
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    background: var(--panel-background);
    border-right: 1px solid var(--border);
    padding: 30px 24px;
}

.brand img {
    width: 225px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a,
.logout-link {
    border-radius: 8px;
    padding: 13px 14px;
    color: var(--primary);
    font-weight: 400;
    text-decoration: none;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: var(--background-soft);
}

.logout-link {
    margin-top: auto;
    color: var(--text-muted);
}

.main-wrap {
    min-width: 0;
}

.topbar {
    display: none;
}

.main-content {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 38px clamp(18px, 4vw, 52px) 64px;
}

.page-header,
.section-header,
.panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
}

.page-header {
    margin-bottom: 28px;
}

.page-header p:not(.eyebrow) {
    margin: 16px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 680px;
}

.campaign-switcher {
    min-width: min(320px, 100%);
    display: grid;
    gap: 8px;
}

.highlight-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--border);
    margin-bottom: 18px;
}

.highlight-band > div {
    background: var(--primary);
    color: var(--primary-contrast);
    padding: clamp(18px, 2.5vw, 30px);
}

.highlight-band strong {
    display: block;
    font-size: clamp(1.9rem, 3vw, 3rem);
    line-height: 1;
}

.highlight-band .metric-label {
    color: currentColor;
    opacity: 0.72;
}

.stat-grid,
.rate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.stat-card,
.rate-card,
.panel,
.leads-toolbar,
.empty-state {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-background);
    box-shadow: var(--shadow-soft);
}

.stat-card {
    padding: 20px;
}

.stat-card span {
    display: block;
    min-height: 38px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 400;
}

.stat-card strong {
    display: block;
    color: var(--primary);
    font-size: 2rem;
    line-height: 1;
}

.section-header {
    margin: 34px 0 16px;
}

.rate-card {
    display: grid;
    justify-items: center;
    gap: 13px;
    padding: 22px 18px;
    text-align: center;
}

.rate-ring {
    width: 92px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--value, 0) * 1%), var(--background-muted) 0);
}

.rate-ring span {
    width: 68px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--panel-background);
    color: var(--primary);
    font-weight: 400;
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    gap: 18px;
    margin-top: 28px;
}

.panel,
.leads-toolbar,
.empty-state {
    padding: clamp(20px, 3vw, 30px);
}

.activity-panel {
    margin-top: 28px;
}

.chip,
.status-pill {
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--background-soft);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 400;
    padding: 5px 11px;
    width: auto;
    display: inline-block !important;
}

.status-pill-positive {
    border-color: var(--accent-success-border);
    background: var(--accent-success-soft);
    color: var(--accent-success);
}

.health-list,
.steps-list,
.activity-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.health-row,
.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--border);
    padding-top: 13px;
}

.health-row span,
.muted,
.activity-item p {
    color: var(--text-muted);
}

.health-row strong {
    color: var(--primary);
}

.health-row.mailbox strong {
    color: var(--accent-mailbox);
}

.health-row-progress {
    display: grid;
    gap: 10px;
    align-items: stretch;
}

.health-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.health-row.mailbox.health-row-progress strong {
    color: hsl(var(--score-hue), 82%, 36%);
}

.health-progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--background-muted);
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.06);
}

.health-progress span {
    display: block;
    width: var(--score-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: hsl(var(--score-hue), 82%, 46%);
    transition: width 180ms ease, background 180ms ease;
}

.health-row-unavailable .health-progress span {
    width: 0;
}

.health-row.mailbox.health-row-unavailable strong {
    color: var(--text-muted);
}

.step-row {
    display: grid;
    grid-template-columns: 150px minmax(120px, 1fr) 160px;
    gap: 14px;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.step-row span {
    display: block;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--background-muted);
}

.bar span {
    position: absolute;
    inset: 0 auto 0 0;
    display: block;
    width: var(--progress-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent));
}

.bar strong {
    position: relative;
    z-index: 1;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1;
}

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

.activity-item {
    justify-content: flex-start;
}

.activity-item .dot {
    width: 12px;
    aspect-ratio: 1;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--accent);
}

.activity-item div {
    min-width: 0;
    flex: 1;
}

.activity-item p {
    margin: 4px 0 0;
}

.activity-item .activity-subject {
    color: var(--primary);
    font-weight: 400;
}

.activity-item time {
    color: var(--text-muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.leads-toolbar {
    display: grid;
    grid-template-columns: 20% 80%;
    gap: 18px;
    align-items: end;
}

.leads-toolbar > div:first-child strong {
    display: block;
    color: var(--primary);
    font-size: 2.6rem;
}

.search-field {
    display: grid;
    gap: 8px;
}

.table-wrap {
    grid-column: 1 / -1;
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    border-top: 1px solid var(--border);
    padding: 16px 12px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.data-table td strong,
.data-table td span {
    display: block;
}

.data-table td span {
    margin-top: 4px;
    color: var(--text-muted);
}

.empty-inline {
    padding: 28px 10px 6px;
    color: var(--text-muted);
}

.empty-inline strong {
    display: block;
    color: var(--primary);
}

.empty-state {
    max-width: 720px;
    margin: 8vh auto 0;
    text-align: center;
}

.empty-state p:not(.eyebrow) {
    color: var(--text-muted);
    line-height: 1.6;
}

.menu-button {
    display: grid;
    gap: 4px;
    width: 42px;
    height: 42px;
    place-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-background);
}

.menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--primary);
}

@media (max-width: 980px) {
    .auth-panel {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        z-index: 20;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        transform: translateX(-104%);
        transition: transform 180ms ease;
        box-shadow: var(--shadow);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: rgba(var(--background-rgb), 0.92);
        border-bottom: 1px solid var(--border);
        padding: 12px 18px;
        backdrop-filter: blur(12px);
    }

    .topbar img {
        width: 118px;
    }

    .main-content {
        padding-top: 22px;
    }

    .page-header,
    .section-header,
    .panel-head {
        display: grid;
        align-items: start;
    }

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

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

@media (max-width: 640px) {
    .auth-page {
        padding: 18px;
    }

    .auth-card {
        padding: 24px;
    }

    .highlight-band,
    .stat-grid,
    .rate-grid,
    .leads-toolbar {
        grid-template-columns: 1fr;
    }

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

    .step-metrics {
        text-align: left;
    }

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

    .activity-item time {
        white-space: normal;
        text-align: right;
    }
}
