/* ---------- Design tokens ---------- */
:root {
    --ca-navy: #14213D;
    --ca-navy-2: #2B3A5C;
    --ca-amber: #C98A1B;
    --ca-bg: #F5F6F8;
    --ca-surface: #FFFFFF;
    --ca-line: #E1E4EA;
    --ca-text: #1A1F2B;
    --ca-muted: #5B6472;
    --ca-radius: 8px;
    --ca-shadow-sm: 0 1px 2px rgba(20, 33, 61, 0.06), 0 1px 3px rgba(20, 33, 61, 0.08);
    --ca-shadow-md: 0 4px 12px rgba(20, 33, 61, 0.10);
}

html, body { height: 100%; background: var(--ca-bg); color: var(--ca-text); font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
h1, h2, h3, h4 { letter-spacing: -0.01em; }
a { color: var(--ca-navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Customer shell ---------- */
.ca-header { background: var(--ca-surface); border-bottom: 1px solid var(--ca-line); position: sticky; top: 0; z-index: 1200; }
.ca-header-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 24px; }
.ca-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; color: var(--ca-navy); }
.ca-brand:hover { text-decoration: none; }
.ca-brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--ca-navy); display: grid; place-items: center; color: #fff; }
.ca-nav { display: flex; gap: 4px; flex: 1; }
.ca-nav a { padding: 8px 12px; border-radius: 6px; color: var(--ca-text); font-weight: 500; font-size: 0.9375rem; }
.ca-nav a:hover { background: #F0F2F5; text-decoration: none; }
.ca-nav a.active { color: var(--ca-navy); background: #EEF1F6; }
.ca-main { max-width: 1280px; margin: 0 auto; padding: 32px 20px 64px; }
.ca-footer { background: var(--ca-navy); color: #C9D0DD; margin-top: 48px; }
.ca-footer-inner { max-width: 1280px; margin: 0 auto; padding: 48px 20px 24px; }
.ca-footer a { color: #E6E9F0; }
.ca-footer h6 { color: #fff; margin-bottom: 12px; }

/* ---------- Hero ---------- */
.ca-hero { background: linear-gradient(135deg, var(--ca-navy) 0%, #1F2F52 100%); color: #fff; border-radius: 16px; padding: 56px 48px; position: relative; overflow: hidden; }
.ca-hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(201, 138, 27, 0.14); }
.ca-hero h1 { color: #fff; font-size: 2.5rem; margin: 0 0 12px; max-width: 640px; }
.ca-hero p { color: #C9D0DD; font-size: 1.125rem; max-width: 560px; margin: 0 0 28px; }
.ca-hero-search { background: #fff; border-radius: 12px; padding: 12px; display: flex; gap: 8px; max-width: 720px; box-shadow: var(--ca-shadow-md); }

/* ---------- Vehicle cards ---------- */
.ca-card { background: var(--ca-surface); border: 1px solid var(--ca-line); border-radius: 12px; overflow: hidden; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; height: 100%; }
.ca-card:hover { box-shadow: var(--ca-shadow-md); transform: translateY(-2px); }
.ca-card-media { aspect-ratio: 4 / 3; background: #E9ECF1 center/cover no-repeat; position: relative; }
.ca-card-media .ca-fav { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); border-radius: 50%; }
.ca-card-media .ca-badge { position: absolute; top: 10px; left: 10px; }
.ca-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ca-card-title { font-weight: 600; font-size: 1.0625rem; color: var(--ca-text); line-height: 1.3; }
.ca-card-specs { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ca-muted); font-size: 0.8125rem; }
.ca-card-specs span { display: inline-flex; align-items: center; gap: 4px; }
.ca-card-footer { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--ca-line); }
.ca-price-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ca-muted); }
.ca-price { font-weight: 700; font-size: 1.0625rem; color: var(--ca-navy); }
.ca-countdown { font-size: 0.8125rem; color: var(--ca-muted); display: inline-flex; align-items: center; gap: 4px; }
.ca-countdown.soon { color: #B3261E; font-weight: 600; }
.ca-placeholder { display: grid; place-items: center; color: #9AA3B2; height: 100%; }

/* ---------- Gallery ---------- */
.ca-gallery-main { aspect-ratio: 16 / 10; border-radius: 12px; background: #E9ECF1 center/contain no-repeat; border: 1px solid var(--ca-line); }
.ca-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.ca-gallery-thumbs button { width: 88px; height: 66px; flex: 0 0 auto; border-radius: 8px; border: 2px solid transparent; background: #E9ECF1 center/cover no-repeat; cursor: pointer; padding: 0; }
.ca-gallery-thumbs button.active { border-color: var(--ca-amber); }

/* ---------- Spec grid ---------- */
.ca-spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; }
.ca-spec { padding: 10px 0; border-bottom: 1px solid var(--ca-line); }
.ca-spec dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ca-muted); margin: 0 0 2px; }
.ca-spec dd { margin: 0; font-weight: 500; }

/* ---------- Bid panel ---------- */
.ca-bid-panel { background: var(--ca-surface); border: 1px solid var(--ca-line); border-radius: 12px; padding: 20px; position: sticky; top: 84px; box-shadow: var(--ca-shadow-sm); }
.ca-bid-panel .ca-deadline { background: #F7F8FA; border-radius: 8px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; margin: 12px 0; }
.ca-bid-own { background: #EEF6F0; border: 1px solid #CDE7D4; border-radius: 8px; padding: 14px; }

/* ---------- Marketplace (Aampere-style) ---------- */
:root { --ca-green: #1F9D55; --ca-green-dark: #177F44; }

.ca-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ca-line); margin-bottom: 20px; overflow-x: auto; }
.ca-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-weight: 500; font-size: 0.9375rem; color: var(--ca-text); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ca-tab:hover { color: var(--ca-text); text-decoration: none; }
.ca-tab.active { color: var(--ca-text); font-weight: 600; border-bottom-color: var(--ca-green); }
.ca-tab .count { background: #EDF1F5; color: var(--ca-muted); border-radius: 10px; font-size: 0.75rem; font-weight: 600; padding: 1px 8px; }
.ca-tab.active .count { background: #E3F3EA; color: var(--ca-green-dark); }

/* Sidebar facet groups */
.ca-facet { border-bottom: 1px solid var(--ca-line); }
.ca-facet:last-child { border-bottom: none; }
.ca-facet-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 0; background: none; border: none; font: inherit; font-weight: 600; font-size: 0.9375rem; cursor: pointer; color: var(--ca-text); }
.ca-facet-head .mud-icon-root { color: var(--ca-muted); transition: transform .15s; }
.ca-facet-head.open .mud-icon-root { transform: rotate(180deg); }
.ca-facet-body { padding: 0 0 14px; }
.ca-facet-opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 0.875rem; cursor: pointer; color: var(--ca-text); }
.ca-facet-opt:hover { color: var(--ca-green-dark); }
.ca-facet-opt .count { color: var(--ca-muted); font-size: 0.75rem; background: #EDF1F5; border-radius: 8px; padding: 0 6px; }
.ca-facet-opt input { accent-color: var(--ca-green); width: 15px; height: 15px; margin: 0; }

/* Horizontal auction row card */
.ca-row { display: flex; background: var(--ca-surface); border: 1px solid var(--ca-line); border-radius: 12px; overflow: hidden; transition: box-shadow .15s; }
.ca-row:hover { box-shadow: var(--ca-shadow-md); }
.ca-row + .ca-row { margin-top: 14px; }
.ca-row-media { position: relative; width: 300px; flex: 0 0 300px; background: #E9ECF1 center/cover no-repeat; min-height: 200px; }
.ca-row-media .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; color: var(--ca-text); box-shadow: var(--ca-shadow-sm); }
.ca-row-media .nav:hover { background: #fff; }
.ca-row-media .nav.prev { left: 10px; }
.ca-row-media .nav.next { right: 10px; }
.ca-row-body { flex: 1 1 auto; min-width: 0; padding: 18px 20px; display: flex; flex-direction: column; }
.ca-row-title { font-size: 1.25rem; font-weight: 700; color: var(--ca-text); line-height: 1.25; }
.ca-row-title:hover { color: var(--ca-text); text-decoration: underline; }
.ca-row-variant { color: var(--ca-text); font-weight: 500; font-size: 0.9375rem; margin-top: 2px; }
.ca-row-sub { color: var(--ca-muted); font-size: 0.8125rem; margin-top: 6px; }
.ca-row-icons { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
.ca-row-icons .mud-icon-button, .ca-row-icons a.icon-btn { background: rgba(255,255,255,.92); border-radius: 8px; width: 34px; height: 34px; padding: 5px; display: grid; place-items: center; color: var(--ca-muted); }
.ca-row-features { list-style: none; margin: 14px 0 0; padding: 0; columns: 1; font-size: 0.875rem; }
.ca-row-features li { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--ca-text); }
.ca-row-features .mud-icon-root { font-size: 1.1rem; }
.ca-row-features li.on { color: var(--ca-text); }
.ca-row-features li.on .mud-icon-root { color: var(--ca-green); }
.ca-row-features li.off { color: var(--ca-muted); }
.ca-row-features li.off .mud-icon-root { color: #B0B8C4; }

/* Right-side auction panel inside the row card */
.ca-row-side { flex: 0 0 240px; width: 240px; padding: 18px 20px; border-left: 1px solid var(--ca-line); background: #FBFCFD; display: flex; flex-direction: column; }
.ca-blind { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 600; color: var(--ca-text); }
.ca-blind .mud-icon-root { color: var(--ca-green); }
.ca-progress { height: 5px; background: #E5E9EF; border-radius: 3px; margin: 10px 0 8px; overflow: hidden; }
.ca-progress > i { display: block; height: 100%; background: var(--ca-green); border-radius: 3px; }
.ca-ends { font-size: 0.8125rem; color: var(--ca-muted); }
.ca-tax-tag { display: inline-block; font-size: 0.75rem; color: var(--ca-muted); margin-top: 10px; }
.ca-btn-cta { margin-top: auto; display: block; width: 100%; background: var(--ca-green); color: #fff; border: none; border-radius: 8px; padding: 11px 16px; font: inherit; font-weight: 600; font-size: 0.9375rem; text-align: center; cursor: pointer; transition: background .15s; }
.ca-btn-cta:hover { background: var(--ca-green-dark); color: #fff; text-decoration: none; }
.ca-btn-cta:disabled, .ca-btn-cta.disabled { background: #C4CBD4; cursor: default; }
.ca-btn-cta.bid-placed { background: #E3F3EA; color: var(--ca-green-dark); }
.ca-mybid { font-size: 0.8125rem; color: var(--ca-muted); margin-top: 10px; }
.ca-mybid b { color: var(--ca-text); font-size: 0.9375rem; }

/* Details page: blind-auction panel */
.ca-auction-panel { background: var(--ca-surface); border: 1px solid var(--ca-line); border-radius: 12px; padding: 22px; position: sticky; top: 84px; box-shadow: var(--ca-shadow-sm); }
.ca-auction-panel h1 { font-size: 1.5rem; margin: 0; }
.ca-panel-row { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--ca-line); font-size: 0.9375rem; }
.ca-panel-row .v { font-weight: 700; }
.ca-panel-row .muted { color: var(--ca-muted); font-size: 0.8125rem; }
.ca-terms { font-size: 0.75rem; color: var(--ca-muted); line-height: 1.55; margin: 12px 0; }

@media (max-width: 960px) {
    .ca-row { flex-direction: column; }
    .ca-row-media { width: 100%; flex-basis: auto; aspect-ratio: 16/10; }
    .ca-row-side { width: auto; flex-basis: auto; border-left: none; border-top: 1px solid var(--ca-line); }
    .ca-btn-cta { margin-top: 14px; }
}

/* ---------- Admin shell ---------- */
.ca-admin-content { padding: 24px 28px 48px; max-width: 1480px; }
.ca-page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.ca-page-header h1 { font-size: 1.625rem; margin: 0; }
.ca-page-header .ca-sub { color: var(--ca-muted); margin-top: 4px; }
.ca-stat { background: var(--ca-surface); border: 1px solid var(--ca-line); border-radius: 12px; padding: 18px 20px; display: flex; gap: 14px; align-items: center; height: 100%; }
.ca-stat:hover { box-shadow: var(--ca-shadow-sm); text-decoration: none; }
.ca-stat-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.ca-stat-value { font-size: 1.625rem; font-weight: 700; line-height: 1; color: var(--ca-text); }
.ca-stat-label { font-size: 0.8125rem; color: var(--ca-muted); margin-top: 4px; }
.ca-panel { background: var(--ca-surface); border: 1px solid var(--ca-line); border-radius: 12px; }
.ca-panel-head { padding: 14px 18px; border-bottom: 1px solid var(--ca-line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ca-panel-body { padding: 18px; }
.ca-filterbar { background: var(--ca-surface); border: 1px solid var(--ca-line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.ca-table-wrap { overflow-x: auto; }
.mud-table .mud-table-cell { font-size: 0.875rem; }
.mud-table-head .mud-table-cell { font-weight: 600; color: var(--ca-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; background: #FAFBFC; }
.ca-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; }
.ca-drawer-brand { padding: 18px 20px 14px; display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.ca-drawer-section { padding: 16px 20px 6px; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .08em; color: #8793A8; }
.mud-drawer .mud-nav-link { color: #D6DCE7; border-radius: 8px; margin: 1px 10px; }
.mud-drawer .mud-nav-link:hover { background: rgba(255,255,255,.06); }
.mud-drawer .mud-nav-link.active { background: rgba(201,138,27,.18); color: #fff; }
.mud-drawer .mud-nav-link .mud-icon-root { color: inherit; }

/* ---------- Auth pages ---------- */
.ca-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.ca-auth-side { background: linear-gradient(160deg, var(--ca-navy) 0%, #1F2F52 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.ca-auth-side h2 { color: #fff; font-size: 2rem; }
.ca-auth-side p { color: #C9D0DD; }
.ca-auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.ca-auth-card { width: 100%; max-width: 440px; }
.ca-auth-card.wide { max-width: 640px; }

/* ---------- Native form controls (used where a real HTML POST is required) ---------- */
.ca-label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--ca-muted); margin-bottom: 6px; }
.ca-input { width: 100%; box-sizing: border-box; font: inherit; padding: 12px 14px; border: 1px solid #C6CCD6; border-radius: var(--ca-radius); background: #fff; color: var(--ca-text); transition: border-color .15s, box-shadow .15s; }
.ca-input:focus { outline: none; border-color: var(--ca-navy); box-shadow: 0 0 0 3px rgba(20, 33, 61, 0.12); }
.ca-input-wrap { position: relative; }
.ca-input-wrap .ca-input { padding-right: 44px; }
.ca-input-adorn { position: absolute !important; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Misc ---------- */
.ca-empty { text-align: center; padding: 56px 24px; color: var(--ca-muted); }
.ca-empty .mud-icon-root { font-size: 48px; color: #B8C0CC; margin-bottom: 12px; }
.ca-kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 0.9375rem; }
.ca-kv dt { color: var(--ca-muted); }
.ca-kv dd { margin: 0; font-weight: 500; }
.ca-section-title { font-size: 1.25rem; font-weight: 600; margin: 0 0 14px; }
.ca-step { display: flex; gap: 14px; }
.ca-step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--ca-navy); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.ca-note { background: #FFF7E8; border: 1px solid #F3DDB0; border-radius: 8px; padding: 12px 14px; font-size: 0.875rem; }
.ca-prose { max-width: 820px; }
.ca-prose h2 { margin-top: 32px; font-size: 1.375rem; }
.ca-prose p, .ca-prose li { color: #2E3542; line-height: 1.7; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .ca-auth { grid-template-columns: 1fr; }
    .ca-auth-side { display: none; }
    .ca-hero { padding: 36px 24px; }
    .ca-hero h1 { font-size: 1.875rem; }
    .ca-hero-search { flex-direction: column; }
    .ca-bid-panel { position: static; }
    .ca-admin-content { padding: 16px; }
    .ca-kv { grid-template-columns: 1fr; gap: 2px 0; }
    .ca-kv dt { margin-top: 8px; }
}
@media (max-width: 600px) {
    .ca-main { padding: 20px 14px 48px; }
    .ca-nav { display: none; }
}
