/* ==========================================================================
   RoyCars — Car Hire Marketplace (Design System)
   Theme: "Asphalt" — premium automotive marketplace
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
    --bg: #eef1f6;
    --bg-soft: #f7f9fc;
    --surface: #ffffff;
    --ink: #0b1220;
    --text: #17233b;
    --muted: #64708a;
    --line: #e3e8f2;
    --line-strong: #cbd4e4;

    --primary: #f59e0b;
    --primary-strong: #d97706;
    --primary-soft: #fef3c7;
    --red: #ef4444;
    --red-soft: #fee2e2;
    --teal: #0d9488;
    --teal-soft: #ccfbf1;
    --ok: #059669;
    --ok-soft: #d1fae5;
    --blue: #3b82f6;
    --blue-soft: #dbeafe;

    --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.06);
    --shadow: 0 14px 38px rgba(11, 18, 32, 0.1);
    --shadow-lg: 0 30px 80px rgba(11, 18, 32, 0.22);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Sora", "Manrope", ui-sans-serif, system-ui, sans-serif;
}

/* --- Reset & base ----------------------------------------------------------- */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(52% 40% at 4% -6%, rgba(245, 158, 11, 0.14), transparent 60%),
        radial-gradient(46% 36% at 98% 0%, rgba(11, 18, 32, 0.12), transparent 58%),
        radial-gradient(40% 32% at 50% 110%, rgba(239, 68, 68, 0.06), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    letter-spacing: -0.015em;
    color: var(--ink);
}

button {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.muted {
    color: var(--muted);
}

/* --- Buttons --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 999px;
    padding: 0.6rem 1.15rem;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    transition: 0.18s ease;
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #fbbf24);
    color: #3a2502;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
}

.btn-ghost:hover {
    background: var(--bg-soft);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

.btn-big {
    padding: 0.8rem 1.6rem;
    font-size: 0.95rem;
}

.btn-account {
    background: var(--ink);
    color: #fff;
    border-color: transparent;
}

/* --- Top app bar ------------------------------------------------------------ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid rgba(227, 232, 242, 0.9);
}

.topbar-inner {
    width: min(1320px, calc(100% - 2rem));
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--ink);
    font-size: 1.08rem;
}

.brand-accent {
    color: var(--primary-strong);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ink), #1f2937 55%, var(--primary));
    color: #ffd98a;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 6px 16px rgba(11, 18, 32, 0.35);
}

.viewswitch {
    display: flex;
    gap: 0.3rem;
    padding: 0.3rem;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    margin-left: auto;
}

.viewswitch button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    transition: 0.18s ease;
}

.viewswitch button.is-active {
    background: linear-gradient(135deg, var(--ink), #1f2937);
    color: #ffd98a;
    box-shadow: 0 6px 16px rgba(11, 18, 32, 0.35);
}

.vs-icon {
    font-size: 1rem;
}

.account-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-user {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
    padding: 0.4rem 0.8rem;
    background: var(--primary-soft);
    border: 1px solid #fde68a;
    border-radius: 999px;
}

/* --- Shell / panels --------------------------------------------------------- */
.shell {
    width: min(1320px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.6rem 0 4rem;
}

.panel {
    min-width: 0;
}

/* --- Hero ------------------------------------------------------------------- */
.hero {
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    margin-bottom: 1.2rem;
    background:
        linear-gradient(120deg, rgba(11, 18, 32, 0.97), rgba(23, 35, 59, 0.94) 55%, rgba(37, 49, 78, 0.9)),
        var(--ink);
    color: #eef1f6;
}

.hero-inner {
    position: relative;
    z-index: 1;
    padding: clamp(1.6rem, 4vw, 3rem);
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 1.5rem;
    align-items: center;
}

.hero-copy h1 {
    color: #fff;
    font-size: clamp(1.5rem, 3.2vw, 2.4rem);
    margin: 0.5rem 0 0.75rem;
    line-height: 1.12;
}

.hero-copy h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-copy p {
    color: #b6c0d6;
    margin: 0 0 1.2rem;
    max-width: 46ch;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fbbf24;
}

.kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}

.hero-cta {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.btn-hero {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #3a2502;
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.4);
}

.btn-hero-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-trust {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #cdd6e8;
}

.trust-check {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 0.7rem;
}

/* ==========================================================================
   Hero art — dusk open-road scene
   ========================================================================== */
.hero-art {
    position: relative;
    min-height: 250px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 50% 8%, rgba(96, 140, 220, 0.16), transparent 55%),
        linear-gradient(180deg, #0a1220 0%, #101c33 40%, #24334f 52%, #5d5248 62%, #b0703f 70%, #d98d4b 76%, #efaa5c 81%, #f6b868 84%, #1a2440 86%);
}

/* -- sky layer ----------------------------------------------------------- */
.art-sky {
    position: absolute;
    inset: 0;
}

.art-sun {
    position: absolute;
    bottom: 48%;
    right: 16%;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, #fff6cd, #fcd34d 52%, #f59e0b);
    box-shadow:
        0 0 44px 16px rgba(251, 191, 36, 0.55),
        0 0 150px 70px rgba(245, 158, 11, 0.3);
    animation: sunPulse 6s ease-in-out infinite;
}

.art-cloud {
    position: absolute;
    height: 20px;
    border-radius: 50%;
    background: rgba(168, 182, 214, 0.16);
    filter: blur(5px);
}

.art-cloud.c1 {
    top: 22%;
    left: 6%;
    width: 118px;
    box-shadow: 40px 12px 0 0 rgba(168, 182, 214, 0.12), -18px 16px 0 0 rgba(168, 182, 214, 0.1);
}

.art-cloud.c2 {
    top: 36%;
    right: 4%;
    width: 88px;
    box-shadow: 28px 10px 0 0 rgba(168, 182, 214, 0.1);
}

.art-star {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.5);
    animation: twinkle 2.8s ease-in-out infinite;
}

.art-star.s1 {
    top: 14%;
    left: 20%;
}

.art-star.s2 {
    top: 26%;
    left: 46%;
    animation-delay: 0.8s;
}

.art-star.s3 {
    top: 10%;
    right: 34%;
    animation-delay: 1.4s;
}

.art-star.s4 {
    top: 20%;
    right: 12%;
    animation-delay: 2s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 0.9;
    }
}

@keyframes sunPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

/* -- city skyline --------------------------------------------------------- */
.art-skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 45%;
    height: 24%;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 0 2%;
    opacity: 0.95;
}

.art-bldg {
    flex: 1;
    height: var(--bh, 50%);
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #101a2d, #1b2740);
    box-shadow: inset 0 -8px 10px rgba(0, 0, 0, 0.35);
}

.art-bldg.b2,
.art-bldg.b4,
.art-bldg.b7,
.art-bldg.b9 {
    background:
        radial-gradient(2px 2px at 30% 24%, #fbbf24 1px, transparent 1.6px),
        radial-gradient(2px 2px at 58% 42%, #fde68a 1px, transparent 1.6px),
        radial-gradient(2px 2px at 40% 64%, #f59e0b 1px, transparent 1.6px),
        radial-gradient(2px 2px at 66% 80%, #fcd34d 1px, transparent 1.6px),
        linear-gradient(180deg, #101a2d, #1b2740);
}

/* -- ground & road -------------------------------------------------------- */
.art-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46%;
    background: linear-gradient(180deg, #1b263e 0%, #0a101f 100%);
}

.art-road {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46%;
    background: linear-gradient(180deg, #26334f 0%, #0d1526 38%, #070e1b 100%);
    clip-path: polygon(0 100%, 15% 0, 85% 0, 100% 100%);
}

.art-center-line {
    position: absolute;
    left: 50%;
    top: 54%;
    bottom: 0;
    width: 4px;
    transform: translateX(-50%);
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0 9px, transparent 9px 20px);
    clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
    opacity: 0.85;
}

.art-edge {
    position: absolute;
    top: 54%;
    bottom: 0;
    width: 16%;
    background: linear-gradient(180deg, #fbbf24, rgba(251, 191, 36, 0.18));
    opacity: 0.9;
}

.art-edge.e-l {
    left: 0;
    /* follow the road's left border: thin at the horizon (≈15%) → widens to the panel corner (0%) */
    clip-path: polygon(90% 0, 97% 0, 10% 100%, 0 100%);
}

.art-edge.e-r {
    right: 0;
    /* mirror: road's right border (≈85% → 100%) */
    clip-path: polygon(3% 0, 10% 0, 100% 100%, 90% 100%);
}

/* -- car ------------------------------------------------------------------ */
.art-car {
    position: absolute;
    bottom: 7%;
    left: 10%;
    width: 42%;
    z-index: 3;
    filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.5));
}

.art-car-shadow {
    display: block;
    height: 9px;
    margin-top: -5px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.65), transparent 72%);
}

.art-car-body {
    display: block;
    height: 24px;
    border-radius: 12px 18px 16px 12px;
    background: linear-gradient(180deg, #ffe4a6, #f59e0b 55%, #c47a08);
    box-shadow:
        inset 0 3px 4px rgba(255, 255, 255, 0.5),
        inset 0 -5px 7px rgba(120, 60, 0, 0.55);
}

.art-car-roof {
    position: absolute;
    top: -14px;
    left: 19%;
    width: 50%;
    height: 17px;
    background: linear-gradient(180deg, #ffd98a, #d9870a);
    border-radius: 12px 13px 2px 2px;
    box-shadow: inset 0 3px 3px rgba(255, 255, 255, 0.4);
}

.art-car-glass {
    position: absolute;
    top: -12px;
    left: 22%;
    width: 44%;
    height: 14px;
    background: linear-gradient(180deg, #d7ecff, #4d7298 85%);
    border-radius: 10px 11px 2px 2px;
    opacity: 0.95;
}

.art-car-pillar {
    position: absolute;
    top: -12px;
    left: 42%;
    width: 2px;
    height: 13px;
    background: #e08a0a;
}

.art-wheel {
    position: absolute;
    bottom: -7px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, #4b5563, #0b1220 70%);
    border: 3px solid #1f2937;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.art-wheel.w1 {
    left: 13%;
}

.art-wheel.w2 {
    right: 14%;
}

.art-headlight {
    position: absolute;
    top: 6px;
    right: -3px;
    width: 7px;
    height: 6px;
    border-radius: 3px;
    background: #fefce8;
    box-shadow: 0 0 12px 4px rgba(254, 249, 195, 0.9);
}

.art-beam {
    position: absolute;
    top: 2px;
    right: -34%;
    width: 36%;
    height: 16px;
    background: linear-gradient(90deg, rgba(254, 249, 195, 0.85), rgba(254, 249, 195, 0));
    clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 80%);
    filter: blur(1px);
    opacity: 0.9;
}

.art-taillight {
    position: absolute;
    top: 6px;
    left: -3px;
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--red);
    box-shadow: 0 0 12px 4px rgba(239, 68, 68, 0.7);
}

/* -- streetlights --------------------------------------------------------- */
.art-streetlight {
    position: absolute;
    bottom: 4%;
    width: 2px;
    height: 36%;
    background: linear-gradient(180deg, #1f2b42, #0a1220);
    z-index: 2;
}

.art-streetlight.s1 {
    left: 24%;
    transform: skewY(-2deg);
}

.art-streetlight.s2 {
    right: 18%;
    transform: skewY(2deg);
}

.art-streetlight::before {
    content: "";
    position: absolute;
    top: -6px;
    left: -4px;
    width: 10px;
    height: 9px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #f3f4f6, #9ca3af);
    box-shadow: 0 0 10px 2px rgba(254, 243, 199, 0.7);
}

.art-streetlight::after {
    content: "";
    position: absolute;
    bottom: 6%;
    left: -76px;
    width: 152px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(254, 243, 199, 0.34), transparent 68%);
}

/* --- Search / filters --------------------------------------------------------- */
.search-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.4rem;
}

.filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.field.span-2 {
    grid-column: span 2;
}

.field label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    transition: 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.field textarea {
    resize: vertical;
}

/* --- Results head -------------------------------------------------------------- */
.results-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin: 0.2rem 0 1rem;
}

.results-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.result-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
}

.sort-control {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-control label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}

.sort-control select {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font: inherit;
    font-size: 0.84rem;
    background: var(--surface);
    color: var(--text);
}

/* --- Listing grid / cards ------------------------------------------------------ */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}

.car-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}

.car-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #1f2937, #111827);
    overflow: hidden;
}

.car-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-thumb .thumb-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 3rem;
}

.car-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: rgba(11, 18, 32, 0.82);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.car-badge.unavailable {
    background: rgba(239, 68, 68, 0.9);
}

.rating-pill {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.94);
    color: #92400e;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.rating-pill .star {
    color: var(--primary-strong);
}

.car-body {
    padding: 0.9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
}

.car-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--ink);
    line-height: 1.25;
    margin: 0;
}

.car-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
}

.car-features-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.car-features-preview .chip {
    color: var(--teal);
    background: var(--teal-soft);
    border-color: transparent;
}

.car-foot {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.car-price {
    line-height: 1.1;
}

.car-price .amount {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--ink);
}

.car-price .per {
    font-size: 0.72rem;
    color: var(--muted);
}

.car-fee {
    font-size: 0.7rem;
    color: var(--muted);
}

.btn-view {
    background: linear-gradient(135deg, var(--ink), #1f2937);
    color: #fff;
    border-color: transparent;
    font-size: 0.8rem;
    padding: 0.45rem 0.95rem;
}

/* --- Empty state ----------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.empty-state .empty-icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 0.5rem;
}

.empty-state h3 {
    margin: 0 0 0.3rem;
}

/* --- KPI grid ---------------------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
}

.kpi .kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.kpi .kpi-value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--ink);
    margin-top: 0.2rem;
}

/* --- Boxes --------------------------------------------------------------------------- */
.box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.box-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.box-head p {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

/* --- Owner car list ------------------------------------------------------------------- */
.owner-car-list {
    display: grid;
    gap: 0.8rem;
}

.owner-car {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 0.9rem;
    align-items: center;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
}

.owner-car-thumb {
    width: 96px;
    height: 72px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #1f2937, #111827);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.owner-car-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.owner-car-thumb span {
    font-size: 1.6rem;
}

.owner-car-title {
    font-weight: 700;
    color: var(--ink);
}

.owner-car-sub {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.3rem;
}

.status-dot.available {
    background: var(--ok);
}

.status-dot.booked {
    background: var(--blue);
}

.status-dot.maintenance {
    background: var(--red);
}

.status-dot.inactive {
    background: var(--muted);
}

.owner-car-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* --- Booking list / cards ---------------------------------------------------------------- */
.booking-list {
    display: grid;
    gap: 0.8rem;
}

.booking-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
    align-items: center;
}

.booking-main {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    min-width: 0;
}

.booking-thumb {
    width: 72px;
    height: 54px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #1f2937, #111827);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: none;
}

.booking-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.booking-thumb span {
    font-size: 1.3rem;
}

.booking-info .b-title {
    font-weight: 700;
    color: var(--ink);
}

.booking-info .b-sub {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.booking-meta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.booking-meta strong {
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
}

.badge.pending {
    background: var(--blue-soft);
    color: #1e40af;
}

.badge.approved {
    background: var(--ok-soft);
    color: #065f46;
}

.badge.completed {
    background: var(--primary-soft);
    color: #92400e;
}

.badge.rejected {
    background: var(--red-soft);
    color: #b91c1c;
}

.badge.cancelled {
    background: var(--bg-soft);
    color: var(--muted);
    border: 1px solid var(--line);
}

.badge.paid {
    background: var(--ok-soft);
    color: #065f46;
}

.badge.pending-pay {
    background: var(--primary-soft);
    color: #92400e;
}

.badge.refunded {
    background: var(--bg-soft);
    color: var(--muted);
    border: 1px solid var(--line);
}

.booking-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* --- Modals --------------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    background: rgba(8, 13, 24, 0.6);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}

.modal {
    display: block;
    /* override framework `.modal { display:none }` */
    width: min(560px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.22s ease;
}

.modal-wide {
    width: min(860px, 100%);
}

.modal-sm {
    width: min(400px, 100%);
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.modal-close:hover {
    background: var(--red-soft);
    color: var(--red);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* --- Car detail ------------------------------------------------------------------------------ */
.car-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
}

.car-gallery {
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, #1f2937, #111827);
    min-width: 0;
}

.car-gallery-main {
    aspect-ratio: 4 / 3;
    position: relative;
    display: grid;
    place-items: center;
}

.car-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-gallery-main .thumb-fallback {
    font-size: 4rem;
}

.car-gallery-thumbs {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    overflow-x: auto;
}

.car-gallery-thumbs img,
.car-gallery-thumbs .thumb-fallback {
    width: 64px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    flex: none;
}

.car-gallery-thumbs img.active,
.car-gallery-thumbs .thumb-fallback.active {
    border-color: var(--primary);
}

.car-gallery-thumbs .thumb-fallback {
    display: grid;
    place-items: center;
    background: #1f2937;
    font-size: 1.2rem;
}

.car-info-head h2 {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
}

.car-info-head .car-meta {
    margin-bottom: 0.7rem;
}

.detail-price {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 0.4rem 0 0.8rem;
}

.detail-price .amount {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.7rem;
    color: var(--ink);
}

.detail-price .per {
    color: var(--muted);
    font-size: 0.85rem;
}

.detail-fee {
    font-size: 0.8rem;
    color: var(--teal);
    font-weight: 700;
}

.section-label {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 1rem 0 0.45rem;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.stat-box {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.55rem;
    text-align: center;
}

.stat-box .stat-ico {
    font-size: 1.1rem;
}

.stat-box .stat-val {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--ink);
    margin-top: 0.15rem;
}

.stat-box .stat-lbl {
    font-size: 0.66rem;
    color: var(--muted);
}

.feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.terms-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.7;
}

.owner-box {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 0.9rem;
}

.owner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ink), var(--primary));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.owner-name {
    font-weight: 700;
    color: var(--ink);
}

.owner-city {
    font-size: 0.78rem;
    color: var(--muted);
}

.review-item {
    border-top: 1px solid var(--line);
    padding: 0.7rem 0;
}

.review-item .review-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-item .review-name {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--ink);
}

.review-item .review-date {
    font-size: 0.72rem;
    color: var(--muted);
    margin-left: auto;
}

.review-stars {
    color: var(--primary-strong);
    letter-spacing: 0.08em;
}

.review-comment {
    font-size: 0.85rem;
    color: var(--text);
    margin-top: 0.3rem;
}

/* --- Booking modal --------------------------------------------------------------------------- */
.booking-head h2 {
    margin: 0.2rem 0 0.2rem;
    font-size: 1.25rem;
}

.booking-head p {
    margin: 0;
}

.modal-step {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-strong);
    background: var(--primary-soft);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.step-hint {
    font-size: 0.88rem;
    color: var(--muted);
    margin: 0.2rem 0 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.form-row .span-2 {
    grid-column: span 2;
}

.quote-box {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    margin: 0.4rem 0 1rem;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.86rem;
    padding: 0.22rem 0;
    color: var(--text);
}

.quote-row.total {
    font-weight: 800;
    font-size: 1rem;
    color: var(--ink);
    border-top: 1px solid var(--line);
    margin-top: 0.4rem;
    padding-top: 0.5rem;
}

.quote-row .fee {
    color: var(--teal);
    font-weight: 700;
}

.upload-box {
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 1.4rem;
    text-align: center;
    cursor: pointer;
    transition: 0.18s ease;
    background: var(--bg-soft);
    margin-bottom: 0.9rem;
}

.upload-box:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.upload-box .upload-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 0.4rem;
}

.upload-box p {
    margin: 0.15rem 0;
    font-size: 0.85rem;
}

.preview-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.preview-row img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.face-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.webcam-box {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
}

.webcam-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webcam-actions {
    position: absolute;
    bottom: 0.6rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.face-alt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.review-summary {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    margin-bottom: 0.9rem;
}

.fee-note {
    background: var(--teal-soft);
    border: 1px solid #99f6e4;
    color: #0f766e;
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.booking-nav {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* --- Car form ---------------------------------------------------------------------------------- */
.car-form .field {
    margin-bottom: 0.8rem;
}

.photo-picker {
    margin-bottom: 0.6rem;
}

.photo-add {
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    padding: 0.7rem 1.2rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
}

.photo-add:hover {
    border-color: var(--primary);
    color: var(--primary-strong);
}

.photo-strip {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.photo-thumb {
    position: relative;
    width: 76px;
    height: 58px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--line);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb .photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 0;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

/* --- Star picker --------------------------------------------------------------------------------- */
.star-picker {
    display: flex;
    gap: 0.3rem;
    font-size: 2rem;
    color: var(--line-strong);
    margin-bottom: 1rem;
    cursor: pointer;
}

.star-picker span.active {
    color: var(--primary-strong);
}

/* --- Login card ------------------------------------------------------------------------------------ */
.login-card {
    text-align: center;
    padding: 0.5rem;
}

.login-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 0.6rem;
}

.login-card h2 {
    margin: 0 0 0.4rem;
}

.login-card p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.login-card .btn {
    width: 100%;
}

.login-note {
    font-size: 0.78rem;
    margin-top: 0.9rem;
}

/* --- Toast ------------------------------------------------------------------------------------------- */
.toast {
    position: fixed;
    bottom: 1.4rem;
    left: 50%;
    transform: translate(-50%, 20px);
    z-index: 400;
    background: var(--ink);
    color: #fff;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
    max-width: min(92vw, 560px);
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.ok {
    background: var(--ok);
}

.toast.err {
    background: var(--red);
}

/* --- Responsive ---------------------------------------------------------------------------------------- */
@media (max-width: 1080px) {
    .listing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 860px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-art {
        min-height: 200px;
    }

    .car-detail {
        grid-template-columns: 1fr;
    }

    .owner-car {
        grid-template-columns: 76px 1fr;
    }

    .owner-car-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .booking-card {
        grid-template-columns: 1fr;
    }

    .booking-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .listing-grid {
        grid-template-columns: 1fr;
    }

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

    .field.span-2 {
        grid-column: span 1;
    }

    .viewswitch {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .account-chip {
        margin-left: auto;
    }

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

    .form-row .span-2 {
        grid-column: span 1;
    }

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

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

    .detail-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Dark theme ------------------------------------------------------------------------------------------- */
html[data-bs-theme="dark"] {
    --bg: #0d1524;
    --bg-soft: #111b2e;
    --surface: #131f36;
    --ink: #f3f5f9;
    --text: #c8d2e4;
    --muted: #8b98b5;
    --line: #223048;
    --line-strong: #2e3d58;
    --primary-soft: #3b2f12;
    --teal-soft: #0e3a35;
    --ok-soft: #0f3a2e;
    --red-soft: #3d1a20;
    --blue-soft: #16294b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
}

html[data-bs-theme="dark"] body {
    background:
        radial-gradient(52% 40% at 4% -6%, rgba(245, 158, 11, 0.1), transparent 60%),
        radial-gradient(40% 32% at 50% 110%, rgba(239, 68, 68, 0.05), transparent 60%),
        var(--bg);
}

html[data-bs-theme="dark"] .topbar {
    background: rgba(19, 31, 54, 0.78);
    border-bottom-color: rgba(34, 48, 72, 0.9);
}

html[data-bs-theme="dark"] .car-title,
html[data-bs-theme="dark"] .detail-price .amount,
html[data-bs-theme="dark"] .kpi .kpi-value,
html[data-bs-theme="dark"] .owner-name,
html[data-bs-theme="dark"] .car-price .amount,
html[data-bs-theme="dark"] .stat-box .stat-val,
html[data-bs-theme="dark"] .brand,
html[data-bs-theme="dark"] .account-user {
    color: var(--ink);
}

html[data-bs-theme="dark"] .btn-account {
    background: #e9edf5;
    color: var(--ink);
}

html[data-bs-theme="dark"] .field input,
html[data-bs-theme="dark"] .field select,
html[data-bs-theme="dark"] .field textarea,
html[data-bs-theme="dark"] .sort-control select {
    background: var(--bg-soft);
    color: var(--text);
}

html[data-bs-theme="dark"] .viewswitch button.is-active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #3a2502;
}