:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #697386;
    --line: #dfe5ef;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #c2410c;
    --success: #15803d;
    --warning: #a16207;
    --danger: #b91c1c;
    --radius: 8px;
    --shadow: 0 14px 40px rgba(15, 23, 42, .08);
    font-family: Tahoma, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

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

input,
select,
textarea,
button {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.public-nav,
.public-hero,
.public-section,
.success-wrap {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.public-nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.public-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: end;
    padding: 40px 0 24px;
}

.hero-copy h1 {
    font-size: clamp(32px, 6vw, 64px);
    line-height: 1.02;
    margin: 0 0 16px;
    letter-spacing: 0;
}

.hero-copy p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
    margin: 0;
}

.agency-card,
.panel,
.car-card,
.auth-card,
.success-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.agency-card {
    padding: 22px;
}

.agency-card h2,
.panel h2,
.panel h3,
.success-card h1 {
    margin-top: 0;
}

.public-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
    padding-bottom: 42px;
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.car-card {
    overflow: hidden;
}

.car-card .car-media {
    aspect-ratio: 16 / 10;
    background: #dce7ec;
    overflow: hidden;
}

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

.car-card .car-body {
    padding: 16px;
}

.car-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.car-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.price-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.price {
    font-weight: 700;
    color: var(--primary-dark);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-row {
    display: grid;
    gap: 7px;
}

.form-row.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 6px;
    padding: 11px 15px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    min-height: 42px;
    font-weight: 700;
}

.button:hover,
button:hover {
    background: var(--primary-dark);
}

.button-light {
    background: #eef4f8;
    color: var(--text);
}

.button-light:hover {
    background: #dfe9ef;
}

.button-danger {
    background: var(--danger);
}

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

.small {
    font-size: 13px;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
    background: #fff;
}

.lang-switcher a {
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
}

.lang-switcher a.active {
    background: var(--primary);
    color: white;
}

.admin-page {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 248px;
    background: #111827;
    color: #e5edf6;
    padding: 22px 18px;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    margin-bottom: 28px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
}

.sidebar nav {
    display: grid;
    gap: 7px;
}

.sidebar nav a {
    color: #cdd6e2;
    padding: 11px 12px;
    border-radius: 6px;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, .08);
    color: white;
}

.admin-shell {
    margin-inline-start: 248px;
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: 28px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat {
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.stat strong {
    display: block;
    font-size: 28px;
    margin-top: 6px;
}

.panel {
    padding: 18px;
    margin-bottom: 18px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: start;
    vertical-align: middle;
}

th {
    font-size: 13px;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    background: #e5e7eb;
    color: #374151;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: var(--success);
}

.badge-warning {
    background: #fef3c7;
    color: var(--warning);
}

.badge-danger {
    background: #fee2e2;
    color: var(--danger);
}

.flash {
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.flash-success {
    background: #dcfce7;
    color: var(--success);
}

.flash-error {
    background: #fee2e2;
    color: var(--danger);
}

.auth-wrap,
.success-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 0;
}

.auth-card,
.success-card {
    width: min(460px, 100%);
    padding: 24px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.embed-page {
    background: transparent;
}

.embed-page .public-hero {
    display: none;
}

.embed-page .public-grid {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .public-hero,
    .public-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
    }

    .admin-shell {
        margin-inline-start: 0;
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

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

    .public-nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 0;
    }

    .hero-copy h1 {
        font-size: 38px;
    }
}
