@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --green-950: #0b2b26;
    --green-900: #103b34;
    --green-800: #174a41;
    --green-700: #1d5b4f;
    --green-600: #277663;
    --green-100: #e8f4ef;
    --green-50: #f4faf7;
    --cream: #f5f2ea;
    --white: #ffffff;
    --ink: #17201d;
    --muted: #6c7772;
    --line: #dde4df;
    --amber: #d99228;
    --amber-soft: #fff4dd;
    --red: #b74638;
    --red-soft: #fbe9e6;
    --blue: #3276a8;
    --blue-soft: #eaf3fa;
    --shadow: 0 10px 30px rgba(17, 51, 44, .07);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behaviour: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #eef1ed;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
svg {
    width: 1.2em;
    height: 1.2em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.car-silhouette svg { fill: currentColor; stroke: none; width: 120px; height: 60px; }

.app-shell { min-height: 100vh; display: flex; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 252px;
    background: linear-gradient(180deg, var(--green-950), #0d332d);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 30;
    box-shadow: 14px 0 34px rgba(5, 28, 24, .12);
}
.brand {
    min-height: 98px;
    padding: 22px 22px 18px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo {
    width: 47px;
    height: 47px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,.08);
}
.brand-copy { display: flex; flex-direction: column; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.brand-tagline { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 3px; }

.nav-list { padding: 24px 14px; display: grid; gap: 7px; }
.nav-item {
    min-height: 46px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: .2s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.active {
    background: rgba(255,255,255,.11);
    color: white;
    box-shadow: inset 3px 0 0 #4fb38f;
}
.nav-icon { display: grid; place-items: center; color: currentColor; }
.nav-icon svg { width: 19px; height: 19px; }
.sidebar-footer {
    margin-top: auto;
    padding: 0 14px 22px;
}
.powered-by {
    margin: 20px 14px 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: rgba(255,255,255,.48);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.powered-by strong { color: rgba(255,255,255,.75); font-size: 11px; }

.main-content { width: calc(100% - 252px); margin-left: 252px; min-height: 100vh; }
.topbar {
    min-height: 98px;
    padding: 20px 34px;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.menu-button { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-button {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
    background: white; display: grid; place-items: center; position: relative; color: #44504b;
}
.notification-dot {
    position: absolute; width: 7px; height: 7px; background: var(--red); border-radius: 50%;
    right: 8px; top: 8px; box-shadow: 0 0 0 2px white;
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: var(--green-100); color: var(--green-800); font-weight: 800; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; gap: 2px; }
.user-meta strong { font-size: 13px; }
.user-meta small { font-size: 11px; color: var(--muted); }
.user-chip > svg { width: 15px; }

.content-wrap { max-width: 1450px; margin: 0 auto; padding: 28px 34px 52px; }
.analyse-panel,
.vehicle-summary,
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.analyse-panel { padding: 23px 24px 24px; }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.panel-heading h2 { margin: 0 0 5px; font-size: 17px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.status-pill {
    padding: 7px 10px; border-radius: 999px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
}
.status-pill.ready { background: var(--green-100); color: var(--green-700); }

.analysis-form {
    display: grid;
    grid-template-columns: 1.5fr .75fr .7fr .75fr;
    gap: 16px;
    align-items: end;
}
.field { display: grid; gap: 7px; }
.field-wide { grid-column: span 4; }
.field label { font-size: 11px; color: #46514d; font-weight: 700; }
.field input, .field textarea {
    width: 100%; border: 1px solid #d8dfdb; background: #fbfcfb; border-radius: 10px;
    min-height: 44px; padding: 0 13px; outline: none; color: var(--ink);
    transition: .2s ease;
}
.field textarea { min-height: 92px; padding-top: 12px; resize: vertical; }
.field input:focus, .field textarea:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(39,118,99,.10);
    background: white;
}
.input-with-icon, .input-prefix, .input-suffix { position: relative; }
.input-with-icon > span {
    position: absolute; inset: 0 auto 0 13px; display: grid; place-items: center; color: #7b8782;
}
.input-with-icon input { padding-left: 42px; }
.input-prefix > span {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #59645f; font-weight: 700;
}
.input-prefix input { padding-left: 29px; }
.input-suffix span {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px;
}
.input-suffix input { padding-right: 52px; }
.form-actions {
    grid-column: span 4; display: flex; justify-content: flex-end; gap: 10px; margin-top: 2px;
}
.primary-button, .secondary-button {
    min-height: 43px; border-radius: 10px; padding: 0 17px; border: 0;
    display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12px;
}
.primary-button { background: var(--green-700); color: white; box-shadow: 0 8px 18px rgba(29,91,79,.18); }
.primary-button:hover { background: var(--green-800); transform: translateY(-1px); }
.secondary-button { background: #f0f3f1; color: #4d5a55; }
.primary-button.loading { opacity: .72; pointer-events: none; }

.vehicle-summary {
    margin-top: 20px; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 22px;
}
.vehicle-identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.vehicle-photo {
    width: 132px; height: 82px; background: linear-gradient(145deg,#edf1ed,#e0e6e1);
    border: 1px solid #d9e0db; border-radius: 12px; display: grid; place-items: center;
    overflow: hidden;
}
.car-silhouette { color: #59645f; transform: scale(.82); }
.vehicle-copy { min-width: 0; }
.eyebrow { display: block; color: var(--green-700); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.vehicle-copy h2 { margin: 6px 0 10px; font-size: 21px; letter-spacing: -.03em; }
.vehicle-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.vehicle-tags span { padding: 6px 9px; border-radius: 7px; background: #f0f3f1; color: #59645f; font-size: 10px; font-weight: 600; }
.score-card { display: flex; align-items: center; gap: 13px; min-width: 195px; justify-content: flex-end; }
.score-ring {
    --size: 70px;
    width: var(--size); height: var(--size); border-radius: 50%;
    display: grid; place-items: center;
    background: conic-gradient(var(--green-600) calc(var(--score) * 1%), #e2e8e4 0);
    position: relative;
}
.score-ring::before { content: ""; position: absolute; width: 54px; height: 54px; border-radius: 50%; background: white; }
.score-ring > div { z-index: 1; display: flex; align-items: baseline; }
.score-ring strong { font-size: 20px; }
.score-ring span { font-size: 9px; color: var(--muted); }
.score-copy { display: flex; flex-direction: column; gap: 4px; }
.score-copy span { color: var(--muted); font-size: 10px; }
.score-copy strong { font-size: 13px; }
.buy-text { color: var(--green-700); }

.dashboard-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0,1fr));
    gap: 18px;
}
.card { grid-column: span 4; overflow: hidden; }
.recommendation-card { grid-column: span 8; }
.profit-card { grid-column: span 4; }
.missed-card { grid-column: span 12; }

.card-header {
    min-height: 76px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border-bottom: 1px solid #e7ece8;
}
.card-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.card-title h3 { margin: 0 0 4px; font-size: 14px; }
.card-title p { margin: 0; color: var(--muted); font-size: 10px; }
.card-icon {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto;
}
.card-icon.green { background: var(--green-100); color: var(--green-700); }
.card-icon.amber { background: var(--amber-soft); color: var(--amber); }
.card-icon.blue { background: var(--blue-soft); color: var(--blue); }
.card-icon.red { background: var(--red-soft); color: var(--red); }
.card-icon svg { width: 17px; height: 17px; }
.card-total { font-size: 18px; color: var(--green-800); }
.risk-badge, .confidence {
    border-radius: 999px; padding: 6px 9px; font-size: 9px; font-weight: 800; white-space: nowrap;
}
.risk-badge.low { background: var(--green-100); color: var(--green-700); }
.confidence { background: #f1f4f2; color: #66716c; }

.card-body { padding: 19px 20px 20px; }
.mot-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 17px; }
.mot-hero > div { padding: 13px; background: #f7f9f7; border-radius: 9px; }
.label { display: block; font-size: 9px; color: var(--muted); margin-bottom: 5px; }
.mot-hero strong { font-size: 12px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.check-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 10px; color: #4e5a55; line-height: 1.5; }
.check-list li svg { width: 15px; flex: 0 0 auto; margin-top: 1px; }
.check-list .positive svg { color: var(--green-600); }
.check-list .warning svg { color: var(--amber); }
.text-button {
    border: 0; background: transparent; color: var(--green-700); font-weight: 700; font-size: 10px;
    padding: 16px 0 0; display: inline-flex; align-items: center; gap: 5px;
}
.text-button svg { width: 13px; }

.cost-list { display: grid; gap: 0; }
.cost-list div {
    min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 15px;
    border-bottom: 1px dashed #e1e6e2; font-size: 10px;
}
.cost-list div:last-child { border-bottom: 0; }
.cost-list span { color: #53605a; }
.cost-list strong { font-size: 10px; }

.value-range { padding: 16px; border-radius: 11px; background: var(--green-50); border: 1px solid #dcebe4; margin-bottom: 16px; }
.value-range span { display: block; font-size: 9px; color: var(--green-700); margin-bottom: 6px; }
.value-range strong { font-size: 19px; color: var(--green-900); }
.market-bars { display: grid; gap: 11px; }
.market-row { display: grid; grid-template-columns: 70px 1fr 52px; align-items: center; gap: 8px; font-size: 9px; color: #5d6863; }
.market-row strong { color: var(--ink); text-align: right; }
.bar { height: 6px; background: #e5ebe7; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--green-600); }
.small-note { margin: 15px 0 0; color: var(--muted); font-size: 9px; }

.recommendation-card { background: linear-gradient(180deg, #fff 0%, #fbfdfb 100%); }
.recommendation-hero { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.recommendation-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--green-100); color: var(--green-700); display: grid; place-items: center; }
.recommendation-icon svg { width: 21px; height: 21px; }
.recommendation-hero div { display: flex; flex-direction: column; gap: 4px; }
.recommendation-hero span { color: var(--muted); font-size: 9px; }
.recommendation-hero strong { color: var(--green-700); font-size: 18px; }
.recommendation-copy { color: #53605a; font-size: 11px; line-height: 1.7; margin: 0 0 17px; max-width: 95%; }
.max-price {
    background: var(--green-950); color: white; border-radius: 11px; padding: 14px 16px;
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.max-price span { font-size: 10px; color: rgba(255,255,255,.68); }
.max-price strong { font-size: 18px; }

.profit-list { display: grid; }
.profit-list > div {
    min-height: 36px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px dashed #e1e6e2; font-size: 10px;
}
.profit-list .negative { color: var(--red); }
.profit-list .profit-result {
    margin-top: 8px; min-height: 52px; border-bottom: 0; background: var(--green-100); padding: 0 13px; border-radius: 10px;
}
.profit-result span { color: var(--green-800); font-weight: 700; }
.profit-result strong { color: var(--green-800); font-size: 20px; }
.profit-meta { margin-top: 12px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }

.missed-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.missed-list li {
    display: flex; gap: 10px; padding: 14px; border: 1px solid #ece1df; background: #fffaf9; border-radius: 11px;
}
.missed-list li > span {
    width: 24px; height: 24px; border-radius: 50%; background: var(--red-soft); color: var(--red);
    display: grid; place-items: center; font-size: 9px; font-weight: 800; flex: 0 0 auto;
}
.missed-list div { display: flex; flex-direction: column; gap: 5px; }
.missed-list strong { font-size: 10px; }
.missed-list small { color: var(--muted); font-size: 9px; line-height: 1.5; }

.toast {
    position: fixed; right: 24px; bottom: 24px; background: var(--green-950); color: white;
    padding: 13px 16px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,.18);
    font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(10px); pointer-events: none;
    transition: .25s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
    .analysis-form { grid-template-columns: repeat(2, 1fr); }
    .field-wide, .form-actions { grid-column: span 2; }
    .card { grid-column: span 6; }
    .recommendation-card { grid-column: span 8; }
    .profit-card { grid-column: span 4; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: .25s ease; }
    .sidebar.open { transform: translateX(0); }
    .main-content { width: 100%; margin-left: 0; }
    .menu-button {
        width: 40px; height: 40px; border: 1px solid var(--line); background: white; border-radius: 10px;
        display: grid; place-items: center; flex: 0 0 auto;
    }
    .topbar { padding: 16px 20px; }
    .content-wrap { padding: 22px 20px 40px; }
    .card, .recommendation-card, .profit-card, .missed-card { grid-column: span 12; }
    .missed-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .topbar p, .user-meta, .user-chip > svg { display: none; }
    .topbar h1 { font-size: 20px; }
    .analysis-form { grid-template-columns: 1fr; }
    .field-wide, .form-actions { grid-column: span 1; }
    .form-actions { flex-direction: column-reverse; }
    .primary-button, .secondary-button { justify-content: center; }
    .vehicle-summary { align-items: flex-start; flex-direction: column; }
    .score-card { width: 100%; justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 16px; }
    .vehicle-photo { display: none; }
    .mot-hero { grid-template-columns: 1fr; }
    .panel-heading { flex-direction: column; }
    .content-wrap { padding-inline: 14px; }
}
