@font-face {
    font-family: "Alata";
    src: url("/assets/fonts/Alata-Regular.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-family: "Hanken Grotesk";
    src: url("/assets/fonts/HankenGrotesk-Regular.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-family: "Hanken Grotesk";
    src: url("/assets/fonts/HankenGrotesk-SemiBold.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 600;
}

:root {
    --ink: #1c1c1c;
    --muted: #666666;
    --paper: #ffffff;
    --canvas: #f3f3f3;
    --soft: #f7f7f7;
    --line: #d9d9d9;
    --pink: #e23d64;
    --plum: #9c1b61;
    --blue: #0096cf;
    --navy: #00344a;
    --positive: #23764d;
    --negative: #aa304b;
    --heading: "Alata", Arial, sans-serif;
    --body: "Hanken Grotesk", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: var(--body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: var(--heading); font-weight: 400; }

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 31px 22px 24px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: var(--navy);
}

.product-brand { display: block; width: 166px; }
.product-brand img { display: block; width: 100%; height: auto; }
.report-back-link { margin-top: 28px; padding: 10px 11px; display: block; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; color: rgba(255,255,255,.86); font-size: 12px; font-weight: 600; text-decoration: none; }
.report-back-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.report-back-link span { margin-right: 6px; }
.sidebar nav { margin-top: 55px; }

.nav-label,
.eyebrow {
    margin: 0 0 11px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    line-height: 1.2;
    text-transform: uppercase;
}

.sidebar .nav-label { padding: 0 11px; color: rgba(255, 255, 255, .56); }

.campaign-link {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 0;
    padding: 12px 12px 11px;
    border-radius: 4px;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.campaign-link span { font-family: var(--heading); font-size: 14px; }
.campaign-link small { color: rgba(255, 255, 255, .49); font-size: 11px; }
.campaign-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.campaign-link.active { color: #fff; background: rgba(255, 255, 255, .1); }
.campaign-link.active small { color: rgba(255, 255, 255, .72); }

.sidebar-foot {
    margin-top: auto;
    padding: 17px 10px 0;
    border-top: 1px solid rgba(255, 255, 255, .15);
    color: rgba(255, 255, 255, .55);
    font-size: 12px;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: #69c496;
}

.report-page { min-width: 0; padding: 27px 38px 48px; }

.toolbar {
    width: min(100%, 1120px);
    margin: 0 auto 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toolbar > div { display: flex; align-items: baseline; gap: 10px; }
.toolbar .eyebrow { margin: 0; color: var(--plum); }
.toolbar strong { font-weight: 600; }

.export-button {
    display: inline-block;
    border: 0;
    padding: 10px 15px;
    color: #fff;
    background: var(--navy);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.export-button span { margin-right: 5px; }
.export-button:hover { background: var(--plum); }

.report {
    width: min(100%, 1120px);
    min-height: 730px;
    margin: 0 auto;
    padding: 38px 43px 28px;
    background: var(--paper);
    box-shadow: 0 8px 28px rgba(0, 52, 74, .07);
}

.client-header {
    min-height: 104px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 34px;
}

.client-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 23px;
}

.client-identity h1 {
    margin: 0 0 4px;
    color: var(--navy);
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.03;
}

.client-identity p { margin: 0; color: var(--muted); font-size: 15px; }

.practice-logo {
    width: 170px;
    height: 100px;
    flex: 0 0 auto;
    background-repeat: no-repeat;
}
.practice-logo-image { object-fit: contain; object-position: left center; background: transparent; }

.practice-logo--legacy-aslvets {
    background-image: url("/assets/practices/asl-vets.png");
    background-position: -420px -8px;
    background-size: 600px 300px;
}

.dp-colour-logo { display: block; width: 183px; height: auto; margin-top: 5px; }

.section-heading {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 13px;
}

.section-heading p { margin: 0; }
.section-heading strong { color: var(--navy); font-family: var(--heading); font-weight: 400; }
.section-heading span { padding: 0 8px; color: var(--pink); }
.section-heading time { white-space: nowrap; }

.dashed-rule { margin: 12px 0 24px; border-top: 1px dashed #a8a8a8; }

.performance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(320px, 1fr);
    gap: 18px;
}

.report-card { border: 1px solid var(--line); background: var(--paper); }
.open-card { min-width: 0; padding: 22px 23px 12px; }

.metric-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.metric-label { display: block; color: var(--navy); font-family: var(--heading); font-size: 15px; }
.hero-value { display: block; margin: 5px 0 6px; color: var(--pink); font-family: var(--heading); font-size: 50px; font-weight: 400; line-height: 1; }
.metric-heading p { max-width: 430px; margin: 0; color: var(--muted); font-size: 12px; }

.metric-delta { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-delta.positive { color: var(--positive); }
.metric-delta.negative { color: var(--negative); }

.chart-title-row {
    margin-top: 23px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.chart-title-row h2 { margin: 0; color: var(--navy); font-size: 14px; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.legend-open { background: var(--pink); }
.legend-click { background: var(--blue); }

.engagement-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-family: var(--body); font-size: 14px; }
.chart-area { fill: rgba(226, 61, 100, .07); }
.chart-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-opens { stroke: var(--pink); stroke-width: 3; }
.chart-line-clicks { stroke: var(--blue); stroke-width: 2; }

.secondary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 155px; padding: 18px; }
.metric-card strong { display: block; margin: 17px 0 7px; color: var(--navy); font-family: var(--heading); font-size: 31px; font-weight: 400; line-height: 1; }
.metric-context { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }

.delivery-strip {
    margin-top: 19px;
    padding: 18px 21px;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    background: var(--soft);
}

.strip-title .eyebrow { margin-bottom: 5px; color: var(--pink); }
.strip-title h2 { margin: 0; color: var(--navy); font-size: 16px; }
.delivery-strip dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.delivery-strip dl div { padding: 0 17px; border-left: 1px solid var(--line); }
.delivery-strip dt { color: var(--muted); font-size: 10px; }
.delivery-strip dd { margin: 3px 0 0; color: var(--navy); font-family: var(--heading); font-size: 21px; }
.delivery-strip dd small { display: block; color: var(--muted); font-family: var(--body); font-size: 10px; }

.measurement-note {
    margin-top: 14px;
    padding: 11px 14px;
    display: flex;
    gap: 12px;
    color: var(--muted);
    background: var(--soft);
    font-size: 10px;
    line-height: 1.45;
}

.measurement-note strong { flex: 0 0 auto; color: var(--navy); }

.report-footer {
    margin-top: 20px;
    padding-top: 13px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 9px;
}

.internal-history { max-width: 1120px; margin: 24px auto 0; padding: 27px 29px 30px; border: 1px solid var(--dp-border-soft); background: var(--dp-surface); }
.internal-history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; }
.internal-history-header h2 { margin: 5px 0 5px; color: var(--dp-text-strong); font-size: 24px; }
.internal-history-header p { margin: 0; color: var(--dp-text-muted); font-size: 13px; }
.internal-only-pill { padding: 5px 9px; border-radius: 999px; color: var(--dp-text-muted); background: var(--dp-surface-2); font-size: 10px; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.internal-history-summary { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr 1.5fr; border: 1px solid var(--dp-border-soft); }
.internal-history-summary > div { min-height: 98px; padding: 17px 19px; border-left: 1px solid var(--dp-border-soft); }
.internal-history-summary > div:first-child { border-left: 0; }
.internal-history-summary span, .internal-history-summary strong, .internal-history-summary small { display: block; }
.internal-history-summary span { color: var(--dp-text-muted); font-size: 11px; }
.internal-history-summary strong { margin-top: 6px; color: var(--dp-text-strong); font-family: var(--heading); font-size: 27px; font-weight: 400; }
.internal-history-summary small { margin-top: 4px; color: var(--dp-text-muted); font-size: 11px; }
.internal-history-summary .history-takeaway { background: var(--dp-surface-2); }
.history-takeaway p { margin: 11px 0 0; color: var(--dp-text-strong); font-size: 14px; line-height: 1.4; }
.internal-history-chart { margin-top: 17px; padding: 18px 20px 12px; border: 1px solid var(--dp-border-soft); }
.internal-chart-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.internal-chart-title strong { color: var(--dp-text-strong); font-family: var(--heading); font-size: 16px; font-weight: 400; }
.internal-chart-title span { color: var(--dp-text-muted); font-size: 10px; }
.internal-history-chart img { display: block; width: 100%; height: auto; margin-top: 4px; }
.internal-history-chart-labels-wrap { padding: 0 5.6%; }
.internal-history-chart-labels { width: 100%; border-collapse: collapse; table-layout: fixed; }
.internal-history-chart-labels td { padding: 0; color: var(--dp-text-muted); font-size: 11px; line-height: 1; text-align: center; white-space: nowrap; }
.internal-history-chart-labels td:first-child { text-align: left; }
.internal-history-chart-labels td:last-child { text-align: right; }
.internal-history-table-wrap { margin-top: 17px; overflow-x: auto; }
.internal-history-table { width: 100%; border-collapse: collapse; }
.internal-history-table th, .internal-history-table td { padding: 12px 14px; border-bottom: 1px solid var(--dp-border-soft); text-align: right; }
.internal-history-table th { color: var(--dp-text-muted); background: var(--dp-surface-2); font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.internal-history-table th:first-child, .internal-history-table td:first-child { text-align: left; }
.internal-history-table td { color: var(--dp-text); font-size: 13px; }
.internal-history-table td:first-child strong, .internal-history-table td:first-child small { display: block; }
.internal-history-table td:first-child strong { color: var(--dp-text-strong); font-weight: 600; }
.internal-history-table td:first-child small { margin-top: 3px; color: var(--dp-text-muted); font-size: 10px; }
.embedded-report-page { padding: 0 0 30px; background: transparent; }
.embedded-report-page .export-later,
.embedded-report-page .export-button { color: #fff; background: var(--pink); border-color: var(--pink); }
.embedded-report-page .export-button:hover { background: var(--plum); border-color: var(--plum); }
.report-main { padding-left: clamp(24px, 4vw, 54px); padding-right: clamp(24px, 4vw, 54px); }
.report-admin-header { max-width: 1120px; align-items: center; }
.report-practice-picker, .report-campaign-picker { display: flex; align-items: center; gap: 8px; color: var(--dp-text-muted); font-size: 12px; }
.report-practice-picker select, .report-campaign-picker select { min-height: 38px; padding: 7px 32px 7px 10px; border: 1px solid var(--dp-border); border-radius: 5px; color: var(--dp-text-strong); background: var(--dp-surface); font: inherit; }
.embedded-report-page .toolbar { gap: 16px; }
.embedded-report-page .toolbar > div:first-child { margin-right: auto; }

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.error-card { max-width: 520px; padding: 35px; background: #fff; }
.error-card h1 { margin: 22px 0 10px; color: var(--navy); font-size: 32px; }
.error-card p { color: var(--muted); }

@media (max-width: 1120px) {
    .performance-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 130px; }
}

@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; width: 100%; height: auto; padding: 22px 25px; }
    .product-brand { width: 145px; }
    .sidebar nav, .sidebar-foot { display: none; }
    .report-page { padding-top: 20px; }
    .delivery-strip { grid-template-columns: 1fr; }
    .delivery-strip dl div:first-child { border-left: 0; padding-left: 0; }
}

@media (max-width: 650px) {
    .report-page { padding: 16px 10px 28px; }
    .toolbar > div { display: none; }
    .toolbar { justify-content: flex-end; }
    .report { padding: 25px 18px 21px; }
    .client-header { min-height: 0; align-items: flex-start; }
    .client-identity { gap: 12px; }
    .practice-logo { width: 112px; height: 67px; }
    .practice-logo--legacy-aslvets { background-position: -280px -5px; background-size: 400px 200px; }
    .client-identity h1 { font-size: 25px; }
    .client-identity p { font-size: 12px; }
    .dp-colour-logo { width: 105px; }
    .section-heading { margin-top: 20px; align-items: flex-start; flex-direction: column; gap: 4px; }
    .dashed-rule { margin-bottom: 17px; }
    .open-card { padding: 18px 15px 8px; }
    .metric-heading { flex-direction: column; gap: 8px; }
    .hero-value { font-size: 43px; }
    .chart-title-row { align-items: flex-start; flex-direction: column; }
    .legend { white-space: normal; }
    .secondary-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 0; }
    .delivery-strip dl { grid-template-columns: repeat(2, 1fr); row-gap: 17px; }
    .delivery-strip dl div { padding: 0 12px; }
    .delivery-strip dl div:nth-child(odd) { border-left: 0; padding-left: 0; }
    .measurement-note { flex-direction: column; gap: 4px; }
    .report-footer { flex-direction: column; gap: 5px; }
    .internal-history { padding: 22px 18px; }
    .internal-history-summary { grid-template-columns: 1fr; }
    .internal-history-summary > div { border-top: 1px solid var(--dp-border-soft); border-left: 0; }
    .internal-history-summary > div:first-child { border-top: 0; }
    .internal-chart-title { align-items: flex-start; flex-direction: column; gap: 4px; }
    .internal-history-table { min-width: 700px; }
}

@media print {
    @page { size: A4 landscape; margin: 8mm; }
    html, body { background: #fff; }
    .no-print { display: none !important; }
    .app-shell { display: block; }
    .report-page { padding: 0; }
    .report { width: 100%; min-height: 0; padding: 0; box-shadow: none; }
    .client-header { min-height: 80px; }
    .practice-logo { transform: scale(.8); transform-origin: left top; }
    .client-identity { gap: 0; }
    .dp-colour-logo { width: 150px; }
    .section-heading { margin-top: 3px; }
    .dashed-rule { margin: 8px 0 13px; }
    .performance-grid { grid-template-columns: minmax(0, 1.85fr) minmax(310px, 1fr); gap: 10px; }
    .open-card { padding: 14px 15px 5px; }
    .hero-value { font-size: 39px; }
    .chart-title-row { margin-top: 10px; }
    .engagement-chart { max-height: 190px; }
    .secondary-grid { gap: 7px; }
    .metric-card { min-height: 116px; padding: 12px; break-inside: avoid; }
    .metric-card strong { margin: 10px 0 5px; font-size: 25px; }
    .delivery-strip { margin-top: 10px; padding: 10px 14px; }
    .measurement-note { margin-top: 8px; padding: 7px 11px; }
    .report-footer { margin-top: 8px; padding-top: 7px; }
}
