@font-face {
    font-family: "Ford Antenna";
    src: url("fonts/Ford/FordAntenna-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Ford Antenna";
    src: url("fonts/Ford/FordAntenna-Medium.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Ford Antenna";
    src: url("fonts/Ford/FordAntenna-Bold.ttf") format("truetype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --canvas: #f7f8fa;
    --surface: #ffffff;
    --ink: #00095b;
    --muted: #4d5b73;
    --line: #d7dce3;
    --brand: #00095b;
    --brand-dark: #00043d;
    --brand-soft: #edf4ff;
    --ford-blue: #1700f4;
    --ford-blue-hover: #0000c8;
    --green: #008a00;
    --amber: #ba6f00;
    --red: #d62d20;
    --violet: #5f49c8;
    --shadow: 0 16px 34px rgba(0, 9, 91, 0.09);
}

html {
    min-height: 100%;
    background: var(--canvas);
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Ford Antenna", Arial, sans-serif;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

h1:focus {
    outline: none;
}

.app-shell {
    max-width: 100%;
    overflow-x: hidden;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #ffffff 0, rgba(247, 248, 250, 0) 320px),
        var(--canvas);
}

.desktop-sidebar {
    display: none;
}

.main-surface {
    min-width: 0;
    min-height: 100vh;
    padding: 1rem 1rem 6.25rem;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(180deg, #ffffff 0, rgba(237, 244, 255, 0.82) 48%, #f7f8fa 100%),
        var(--canvas);
}

.login-page {
    width: min(100%, 28rem);
    display: grid;
    gap: 1.25rem;
}

.login-brand {
    text-align: center;
}

.login-logo {
    width: min(10rem, 52vw);
    height: auto;
}

.login-brand h1 {
    margin: 0.75rem 0 0.35rem;
    color: var(--ink);
    font-size: 2rem;
    line-height: 1.05;
}

.login-brand p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.login-card {
    display: grid;
    gap: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.login-card label {
    display: grid;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.login-card input {
    min-height: 3rem;
    border: 1px solid #b9c1cf;
    border-radius: 8px;
    padding: 0 0.85rem;
    color: var(--ink);
    font: inherit;
}

.login-card input:focus {
    border-color: var(--ford-blue);
    outline: 3px solid rgba(23, 0, 244, 0.12);
}

.login-button {
    min-height: 3rem;
    border: 0;
    border-radius: 8px;
    background: var(--ford-blue);
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.login-button:hover {
    background: var(--ford-blue-hover);
}

.login-error {
    border: 1px solid rgba(214, 45, 32, 0.24);
    border-radius: 8px;
    padding: 0.75rem;
    background: rgba(214, 45, 32, 0.08);
    color: var(--red);
    font-size: 0.85rem;
    font-weight: 800;
}

.login-success {
    border: 1px solid rgba(0, 138, 0, 0.22);
    border-radius: 8px;
    padding: 0.75rem;
    background: rgba(0, 138, 0, 0.08);
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 800;
}

.login-secondary-link {
    display: inline-flex;
    justify-content: center;
    color: var(--ford-blue);
    font-size: 0.86rem;
    font-weight: 800;
}

.login-secondary-link:hover {
    color: var(--ford-blue-hover);
    text-decoration: underline;
}

.settings-page {
    width: min(100%, 1180px);
    min-width: 0;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.settings-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: 2rem;
    line-height: 1.1;
}

.settings-lead {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.settings-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.settings-month-picker {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    width: min(100%, 20rem);
}

.settings-month-picker select,
.settings-input {
    min-height: 3rem;
    border: 1px solid #b9c1cf;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.settings-month-picker select {
    padding: 0 0.75rem;
}

.settings-empty,
.settings-alert {
    border-radius: 8px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.settings-empty {
    color: var(--muted);
}

.settings-alert-error {
    border-color: rgba(214, 45, 32, 0.22);
    background: rgba(214, 45, 32, 0.08);
    color: var(--red);
    font-weight: 800;
}

.settings-alert-success {
    border-color: rgba(0, 138, 0, 0.22);
    background: rgba(0, 138, 0, 0.08);
    color: var(--green);
    font-weight: 800;
}

.settings-stack {
    display: grid;
    gap: 1rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 0.9rem;
}

.settings-card {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.settings-card-header h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.15;
}

.settings-card-header p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.settings-card-body {
    display: grid;
    gap: 0.75rem;
}

.settings-card-body-inline {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.settings-input {
    width: 100%;
    padding: 0 0.85rem;
}

.settings-input:focus,
.settings-month-picker select:focus {
    border-color: var(--ford-blue);
    outline: 3px solid rgba(23, 0, 244, 0.12);
}

.settings-save-button {
    min-height: 3rem;
    border: 0;
    border-radius: 8px;
    background: var(--ford-blue);
    color: #fff;
    font-weight: 800;
}

.settings-save-button:hover {
    background: var(--ford-blue-hover);
}

.settings-save-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-card-wide {
    width: 100%;
}

.dashboard-page {
    width: min(100%, 1180px);
    min-width: 0;
    margin: 0 auto;
}

.dashboard-page [id] {
    scroll-margin-top: 1.5rem;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0 1.25rem;
}

.dashboard-header > div {
    width: 100%;
}

.header-mark {
    display: flex;
    justify-content: center;
    margin-bottom: 0.65rem;
}

.ford-logo {
    display: block;
    width: min(10rem, 42vw);
    height: auto;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--ford-blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dashboard-header h1 {
    text-align: center;
    margin: 0;
    color: var(--ink);
    font-size: 2.25rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.dealer-dashboard-title {
    margin: 0.35rem 0 0.7rem;
    color: var(--brand);
    text-align: center;
    font-size: 1.45rem;
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.header-copy {
    text-align: center;
    max-width: 39rem;
    margin: 0.6rem auto 0;
    color: #26354f;
    font-size: 0.95rem;
    line-height: 1.5;
}

.header-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.5rem;
}

.filter-strip {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 9, 91, 0.04);
}

.filter-strip label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.period-view-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.period-view-field > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.period-view-toggle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 3rem;
    overflow: hidden;
    border: 1px solid #b9c1cf;
    border-radius: 8px;
    background: #ffffff;
}

.period-view-toggle button {
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.period-view-toggle button + button {
    border-left: 1px solid #d7dce5;
}

.period-view-toggle button.is-active {
    background: #00095b;
    color: #ffffff;
}

.period-view-toggle button:focus-visible {
    position: relative;
    outline: 2px solid rgba(0, 9, 91, 0.3);
    outline-offset: -3px;
}

.filter-strip select {
    min-height: 3rem;
    border: 1px solid #b9c1cf;
    border-radius: 8px;
    padding: 0 0.75rem;
    background: #ffffff;
    color: var(--brand);
    font: inherit;
}

.scope-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.scope-tab {
    display: grid;
    min-height: 3.2rem;
    gap: 0.1rem;
    justify-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.scope-tab span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.scope-tab.active {
    border-color: rgba(21, 112, 239, 0.35);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.filter-strip label:last-child {
    min-width: 0;
}

.icon-button,
.primary-action {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #c7cfda;
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.icon-button {
    width: 2.5rem;
}

.primary-action {
    padding: 0 0.9rem;
    background: var(--ford-blue);
    color: #ffffff;
    border-color: var(--ford-blue);
    font-weight: 800;
}

.primary-action:hover {
    background: var(--ford-blue-hover);
    border-color: var(--ford-blue-hover);
}

.hero-strip {
    display: grid;
    gap: 1rem;
    border: 0;
    border-radius: 8px;
    padding: 1rem;
    background: linear-gradient(135deg, #00095b 0%, #001b75 58%, #1700f4 100%);
    color: #ffffff;
    box-shadow: var(--shadow);
}

.score-block {
    display: grid;
    min-height: 9rem;
    align-content: center;
    justify-items: start;
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.score-block span,
.score-block small,
.health-pill small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    font-weight: 700;
}

.score-block strong {
    font-size: 4rem;
    line-height: 0.95;
    letter-spacing: 0;
}

.score-copy {
    align-self: center;
}

.score-copy h2 {
    margin: 0;
    max-width: 42rem;
    font-size: 1.45rem;
    line-height: 1.14;
    letter-spacing: 0;
}

.score-copy p {
    max-width: 38rem;
    margin: 0.75rem 0 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.55;
}

.health-pill {
    display: inline-grid;
    width: 6rem;
    height: 6rem;
    place-items: center;
    justify-self: start;
    border-radius: 999px;
    background: var(--brand);
    color: #ffffff;
}

.health-pill span {
    font-size: 1.35rem;
    font-weight: 850;
}

.funnel-mini {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

.carline-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    grid-column: 1 / -1;
    margin-top: 0.15rem;
}

.carline-mode-button {
    position: relative;
    min-height: 2.5rem;
    border: 1px solid rgba(0, 9, 91, 0.14);
    border-radius: 8px;
    background: #ffffff;
    color: var(--brand);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 9, 91, 0.05);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.carline-mode-button.is-active {
    border-color: #00095b;
    background: linear-gradient(135deg, #00095b 0%, #001b75 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 9, 91, 0.18);
    transform: translateY(-1px);
}

.carline-mode-button.is-active:hover {
    border-color: #00095b;
    background: linear-gradient(135deg, #00095b 0%, #001b75 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 9, 91, 0.18);
    transform: translateY(-1px);
}

.carline-mode-button.is-inactive {
    opacity: 1;
    box-shadow: 0 4px 10px rgba(0, 9, 91, 0.04);
    transform: translateY(0);
}

.carline-mode-button:hover {
    border-color: rgba(0, 9, 91, 0.3);
    background: #f5f8ff;
    color: #00095b;
    transform: translateY(-1px);
}

.carline-mode-button.is-inactive:hover {
    border-color: rgba(0, 9, 91, 0.3);
    background: #f5f8ff;
    color: #00095b;
}

.carline-mode-button:focus-visible {
    outline: 2px solid rgba(0, 9, 91, 0.28);
    outline-offset: 2px;
}

@media (hover: none) {
    .carline-mode-button:hover,
    .carline-mode-button.is-active:hover,
    .carline-mode-button.is-inactive:hover {
        transform: none;
        border-color: rgba(0, 9, 91, 0.14);
        background: #ffffff;
        color: var(--brand);
    }

    .carline-mode-button.is-active,
    .carline-mode-button.is-active:hover {
        border-color: #00095b;
        background: linear-gradient(135deg, #00095b 0%, #001b75 100%);
        color: #ffffff;
        box-shadow: 0 8px 18px rgba(0, 9, 91, 0.18);
    }
}

.funnel-stage {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.funnel-stage:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.18);
}

.funnel-stage.open {
    border-color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.2);
}

.funnel-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 15%;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 0.75rem;
    border: 0;
    padding: 0.8rem 0.9rem;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.funnel-step span,
.funnel-step small {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.72rem;
    font-weight: 750;
}
.funnel-step small span {
    font-size: 0.62rem;
}


.funnel-step strong {
    font-size: 1.1rem;
}

.funnel-breakdown {
    display: grid;
    gap: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.8rem 0.9rem 0.9rem;
}

.breakdown-row {
    display: grid;
    grid-template-columns: minmax(5.5rem, 0.8fr) minmax(6rem, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
}

.breakdown-label,
.breakdown-value {
    display: grid;
    gap: 0.12rem;
}

.breakdown-label span,
.breakdown-value span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 700;
}

.breakdown-value {
    min-width: 3.75rem;
    justify-items: end;
}

.breakdown-track {
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.breakdown-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #ffffff;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.metric-card,
.panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 24px rgba(0, 9, 91, 0.05);
}

.metric-card {
    min-height: 8.5rem;
    padding: 1rem;
}

.metric-topline,
.panel-header,
.channel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.metric-topline span,
.metric-card small,
.updated-at,
.channel-label span,
.channel-meta span,
.insight-item small {
    color: var(--muted);
    font-size: 0.78rem;
}

.metric-topline strong {
    white-space: nowrap;
    font-size: 0.78rem;
}

.metric-topline-status {
    display: grid;
    justify-items: end;
    gap: 0.15rem;
    text-align: right;
}

.metric-topline-status small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.metric-topline-status small.standard-high {
    color: var(--ford-blue);
}

.metric-topline-status small.standard-low {
    color: var(--red);
}

.metric-value {
    margin: 1rem 0 0.2rem;
    font-size: 1.65rem;
    color: var(--brand);
    font-weight: 800;
    letter-spacing: 0;
}

.metric-standard {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    background: var(--brand-soft);
    color: var(--ford-blue);
    font-size: 0.75rem;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.dashboard-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.seller-panel {
    margin-top: 0.75rem;
}

.panel {
    padding: 1rem;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: 0;
}

.channel-list,
.carline-list,
.insight-list,
.seller-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.seller-list {
    gap: 0.75rem;
}

.seller-card {
    display: grid;
    gap: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.85rem;
    background: #ffffff;
}

.seller-card.open {
    border-color: rgba(23, 0, 244, 0.22);
    box-shadow: 0 12px 28px rgba(0, 9, 91, 0.08);
}

.seller-summary {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.seller-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 0.75rem;
    min-width: 0;
}

.seller-heading > span:first-child {
    min-width: 0;
}

.seller-heading strong,
.seller-score strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.seller-heading span,
.seller-heading small,
.seller-score span,
.seller-score small,
.seller-kpis span,
.seller-progress span,
.seller-times dt {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
}

.seller-score {
    display: grid;
    flex-shrink: 0;
    justify-items: end;
    text-align: right;
    white-space: nowrap;
}

.seller-heading .chevron {
    justify-self: end;
    align-self: start;
    margin-left: 0.25rem;
}

.seller-score strong {
    color: var(--green);
    font-size: 1.05rem;
}

.seller-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
    min-width: 0;
}

.seller-details {
    display: grid;
    gap: 0.8rem;
    border-top: 1px solid var(--line);
    margin-top: 0.85rem;
    padding-top: 0.85rem;
}

.seller-section-title {
    color: var(--ford-blue);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.seller-commerce {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    min-width: 0;
}

.seller-counter-button {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.55rem;
    background: #ffffff;
    color: var(--ink);
    text-align: left;
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.seller-counter-button strong {
    font-size: 1.05rem;
}

.seller-counter-button.active {
    border-color: var(--ford-blue);
    background: var(--brand-soft);
}

.seller-counter-button:hover {
    border-color: var(--ford-blue);
}

.seller-kpis div,
.seller-times div,
.seller-commerce div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    border-radius: 4px;
    background: #f7f8fa;
    padding: 0.55rem;
}

.seller-kpis strong,
.seller-times dd,
.seller-commerce strong {
    min-width: 0;
    color: var(--ink);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.seller-commerce span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
}

.seller-progress {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.seller-breakdown {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.seller-progress > div {
    display: grid;
    gap: 0.3rem;
}

.seller-times {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0;
}

.seller-times dd {
    margin: 0;
    font-size: 0.95rem;
}

.carline-list {
    gap: 0.75rem;
}

.carline-card {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.carline-card.open {
    background: #ffffff;
    border-color: rgba(23, 0, 244, 0.22);
    box-shadow: 0 12px 28px rgba(0, 9, 91, 0.08);
}

.carline-card.used {
    border-color: rgba(95, 73, 200, 0.28);
    background: linear-gradient(180deg, rgba(247, 248, 250, 0.9), rgba(255, 255, 255, 1));
}

.carline-card.used .summary-metrics strong,
.carline-card.used .carline-title strong {
    color: var(--violet);
}

.carline-card.used .chevron {
    color: var(--violet);
    border-color: rgba(95, 73, 200, 0.32);
}

.carline-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-height: 4.25rem;
    border: 0;
    padding: 0.85rem;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.carline-title strong {
    display: block;
    font-size: 1rem;
}

.carline-title small,
.summary-metrics small,
.conversion-flow span,
.sold-bars span,
.timing-grid dt {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
}

.summary-metrics {
    display: grid;
    justify-items: end;
    gap: 0.15rem;
    white-space: nowrap;
}

.summary-metrics strong {
    color: var(--green);
}

.chevron {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid #c7cfda;
    border-radius: 4px;
    background: #ffffff;
    color: var(--ford-blue);
    font-size: 1.1rem;
    font-weight: 850;
}

.carline-details {
    display: grid;
    gap: 0.85rem;
    border-top: 1px solid var(--line);
    padding: 0.85rem;
}

.conversion-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.conversion-flow div,
.timing-grid div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    border-radius: 4px;
    background: #f7f8fa;
    padding: 0.6rem;
}

.conversion-flow strong {
    font-size: 1.05rem;
}

.conversion-flow span,
.conversion-flow strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.sold-bars {
    display: grid;
    gap: 0.55rem;
}

.sold-bars > div {
    display: grid;
    gap: 0.3rem;
}

.sold-bar {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f6;
}

.sold-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.sold-bar.sold span {
    background: #008a00;
}

.sold-bar.unsold span {
    background: #ba6f00;
}

.timing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0;
}

.timing-grid dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 850;
}

.channel-row {
    display: grid;
    grid-template-columns: minmax(5.5rem, 1fr) minmax(6rem, 1.5fr) auto;
    min-height: 3.5rem;
}

.channel-label,
.channel-meta {
    display: grid;
    gap: 0.2rem;
}

.channel-meta {
    justify-items: end;
}

.channel-bar {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f6;
}

.channel-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--green));
}

.insight-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.insight-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.insight-item strong {
    display: block;
    font-size: 0.95rem;
}

.insight-item p {
    margin: 0.35rem 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.status-dot {
    width: 0.65rem;
    height: 0.65rem;
    margin-top: 0.3rem;
    border-radius: 999px;
    background: var(--brand);
}

.status-positive {
    color: var(--green);
}

.status-warning {
    color: var(--amber);
}

.status-critical {
    color: var(--red);
}

.status-neutral {
    color: var(--violet);
}

.status-dot.status-positive {
    background: var(--green);
}

.status-dot.status-warning {
    background: var(--amber);
}

.status-dot.status-critical {
    background: var(--red);
}

.status-dot.status-neutral {
    background: var(--violet);
}

.mobile-nav {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 20;
    display: flex;
    gap: 0.25rem;
    border: 1px solid rgba(215, 220, 227, 0.95);
    border-radius: 8px;
    padding: 0.45rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.mobile-tab {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    border-radius: 8px;
    padding: 0.35rem 0.2rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
    overflow: hidden;
}

.mobile-tab > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-tab.active {
    background: var(--brand-soft);
    color: var(--ford-blue);
    box-shadow: inset 0 0 0 1px rgba(23, 0, 244, 0.12);
}

.mobile-icon,
.nav-icon {
    display: inline-grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    border-radius: 7px;
    background: #edf1f6;
    line-height: 1;
    font-size: 0.75rem;
    font-weight: 850;
}

.nav-svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-tab.active .mobile-icon,
.nav-item.active .nav-icon {
    background: var(--ford-blue);
    color: #ffffff;
}

.nav-item.active,
.mobile-tab.active {
    box-shadow: inset 0 0 0 1px rgba(23, 0, 244, 0.12);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    padding: 1rem;
    color: #ffffff;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 420px) {
    .dashboard-header {
        align-items: stretch;
        flex-direction: column;
    }

    .ford-logo {
        width: min(8.5rem, 48vw);
    }

    .header-actions {
        justify-content: space-between;
    }

    .primary-action {
        flex: 1;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .channel-row {
        grid-template-columns: 1fr auto;
    }

    .channel-bar {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .conversion-flow,
    .timing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seller-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seller-commerce {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seller-times {
        grid-template-columns: 1fr;
    }

    .seller-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .seller-score {
        justify-items: start;
    }

    .mobile-nav {
        right: 0.5rem;
        left: 0.5rem;
        padding: 0.35rem;
        gap: 0.15rem;
    }

    .mobile-tab {
        padding: 0.3rem 0.1rem;
        font-size: 0.6rem;
    }

    .mobile-icon {
        width: 1.4rem;
        height: 1.4rem;
    }

    .breakdown-row {
        grid-template-columns: 1fr auto;
    }

    .breakdown-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (min-width: 760px) {
    .main-surface {
        padding: 1.5rem 1.5rem 2rem;
    }

    .hero-strip {
        grid-template-columns: 12rem 1fr auto;
        align-items: center;
        padding: 1.25rem;
    }

    .sales-hero {
        grid-template-columns: 12rem 1fr minmax(22rem, 0.9fr);
    }

    .filter-strip {
        grid-template-columns: minmax(13rem, 0.4fr) minmax(12rem, 0.4fr) minmax(0, 1fr);
        align-items: end;
    }

    .carline-mode-toggle {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .scope-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(19rem, 0.8fr);
    }
}

@media (min-width: 1024px) {
    .app-shell {
        display: grid;
        grid-template-columns: 16rem 1fr;
    }

    .desktop-sidebar {
        position: sticky;
        top: 0;
        display: block;
        height: 100vh;
        border-right: 1px solid #e2e6ec;
        padding: 1.25rem;
        background: #ffffff;
    }

    .brand-lockup {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 2rem;
    }

    .brand-mark {
        display: inline-grid;
        width: 2.75rem;
        height: 2.75rem;
        place-items: center;
        border-radius: 4px;
        background: var(--brand);
        color: #ffffff;
        font-weight: 900;
    }

    .brand-lockup strong,
    .brand-lockup span {
        display: block;
    }

    .brand-lockup span {
        color: var(--muted);
        font-size: 0.78rem;
    }

    .desktop-nav {
        display: grid;
        gap: 0.3rem;
    }

    .nav-item {
        display: flex;
        align-items: center;
        gap: 0.625rem;
        border-radius: 8px;
        padding: 0.625rem 0.75rem;
        color: var(--muted);
        font-size: 0.875rem;
        font-weight: 700;
    }

    .nav-item.active {
        background: var(--brand-soft);
        color: var(--ford-blue);
    }

    .main-surface {
        padding: 2rem;
    }

    .ford-logo {
        width: 11rem;
    }

    .mobile-nav {
        display: none;
    }
}
