:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-light: #eff6ff;
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --danger: #b91c1c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.topbar {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topnav form {
    margin: 0;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
    font: inherit;
}

.page-content {
    padding: 48px 0;
}

.hero {
    min-height: 460px;
    display: flex;
    align-items: center;
    border-radius: 22px;
    padding: 64px;
    background:
        radial-gradient(circle at top right, #dbeafe 0, transparent 35%),
        #fff;
    border: 1px solid var(--border);
}

.hero > div {
    max-width: 720px;
}

h1 {
    margin: 8px 0 16px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    letter-spacing: -.045em;
    line-height: 1.08;
}

h2 {
    margin: 30px 0 14px;
    font-size: 1.15rem;
}

.hero p {
    max-width: 620px;
    color: var(--muted);
    font-size: 1.12rem;
}

.eyebrow {
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--blue);
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.button:hover {
    background: var(--blue-dark);
    text-decoration: none;
}

.button-secondary {
    background: #fff;
    color: var(--blue);
}

.button-secondary:hover {
    color: #fff;
}

.button-small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: .9rem;
}

.button-full {
    width: 100%;
    margin-top: 24px;
}

.form-page {
    display: flex;
    justify-content: center;
}

.form-card {
    width: min(780px, 100%);
    padding: 34px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
}

.form-card-small {
    width: min(480px, 100%);
}

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

label {
    display: block;
    margin-top: 16px;
    font-size: .92rem;
    font-weight: 700;
}

input {
    width: 100%;
    height: 44px;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #cfd5dd;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(37, 99, 235, .16);
    border-color: var(--blue);
}

.checkbox-label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 400;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.error {
    display: block;
    margin-top: 5px;
    color: var(--danger);
    font-size: .82rem;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin: 18px 0;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

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

.center {
    text-align: center;
}

.message-text {
    margin: 20px 0 28px;
    color: var(--muted);
}

.honeypot {
    display: none;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.branch-switcher,
.empty-state {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.branch-switcher {
    min-width: 190px;
}

.branch-switcher span,
.branch-switcher strong {
    display: block;
}

.empty-state {
    margin-top: 28px;
}

@media (max-width: 700px) {
    .page-content {
        padding: 24px 0;
    }

    .hero,
    .form-card {
        padding: 24px;
    }

    .hero {
        min-height: 390px;
    }

    .form-grid,
    .dashboard-header {
        grid-template-columns: 1fr;
        display: grid;
    }

    .topbar-inner {
        min-height: 60px;
    }

    .topnav {
        gap: 10px;
        font-size: .9rem;
    }
}

.app-nav,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-actions {
    margin-left: auto;
}

.branch-form select {
    height: 38px;
    max-width: 230px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
}

.user-menu {
    display: flex;
    flex-direction: column;
    min-width: 100px;
    line-height: 1.2;
}

.user-menu strong {
    font-size: .86rem;
}

.user-menu span {
    max-width: 150px;
    overflow: hidden;
    color: var(--muted);
    font-size: .74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 22px;
    margin-top: 28px;
    align-items: start;
}

.card {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.card h2 {
    margin-top: 0;
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child {
    border-bottom: 0;
}

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-size: .72rem;
    font-weight: 700;
}

.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
}

.checkbox-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-list .checkbox-label {
    margin-top: 0;
    padding: 8px;
    border-radius: 7px;
}

.checkbox-list .checkbox-label:hover {
    background: #f8fafc;
}

.checkbox-list small {
    display: block;
    margin-top: 2px;
}

.permission-module {
    margin: 22px 0 8px;
    color: var(--blue-dark);
    font-size: .95rem;
}

.role-permissions {
    max-width: 500px;
    margin-top: 6px;
    font-size: .8rem;
}

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

    .app-nav {
        display: none;
    }

    .topbar-actions {
        gap: 8px;
    }

    .user-menu {
        display: none;
    }
}

.vehicle-filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.vehicle-filter-form input {
    margin-top: 0;
    flex: 1;
}

.vehicle-filter-form select {
    height: 44px;
    min-width: 180px;
    padding: 0 10px;
    border: 1px solid #cfd5dd;
    border-radius: 8px;
    background: #fff;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.vehicle-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
    text-decoration: none;
}

.vehicle-image-placeholder,
.vehicle-image-large {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.vehicle-image-placeholder {
    min-height: 150px;
    font-size: .85rem;
}

.vehicle-image-large {
    min-height: 290px;
    border-radius: 10px;
}

.vehicle-card-content {
    padding: 16px;
}

.vehicle-card-top,
.vehicle-card-bottom,
.vehicle-price-box,
.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.vehicle-card h2 {
    margin: 14px 0 6px;
    font-size: 1.05rem;
}

.vehicle-card-bottom {
    margin-top: 18px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: .73rem;
    font-weight: 800;
}

.status-received {
    background: #e0f2fe;
    color: #075985;
}

.status-preparation,
.status-photography {
    background: #fef3c7;
    color: #92400e;
}

.status-advertising {
    background: #dcfce7;
    color: #166534;
}

.status-reserved {
    background: #ede9fe;
    color: #6d28d9;
}

.status-sold,
.status-issued {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-archived {
    background: #e5e7eb;
    color: #4b5563;
}

.vehicle-form {
    display: grid;
    gap: 20px;
}

.vehicle-form textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    resize: vertical;
    border: 1px solid #cfd5dd;
    border-radius: 8px;
    font: inherit;
}

.vehicle-form select {
    width: 100%;
    height: 44px;
    margin-top: 6px;
    padding: 0 10px;
    border: 1px solid #cfd5dd;
    border-radius: 8px;
    background: #fff;
    font: inherit;
}

.button-large {
    min-height: 52px;
    font-size: 1rem;
}

.vehicle-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
    gap: 22px;
    margin-top: 24px;
    align-items: start;
}

.vehicle-sidebar {
    display: grid;
    gap: 20px;
}

.vehicle-price-box {
    margin-top: 18px;
}

.vehicle-price-box strong {
    font-size: 1.6rem;
}

.vehicle-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin: 0;
}

.vehicle-specs dt {
    color: var(--muted);
}

.vehicle-specs dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    gap: 3px;
    padding-left: 12px;
    border-left: 3px solid #bfdbfe;
}

.timeline-item small {
    color: var(--muted);
}

.vehicle-description {
    white-space: normal;
    line-height: 1.7;
}

@media (max-width: 800px) {
    .vehicle-filter-form,
    .page-actions {
        flex-wrap: wrap;
    }

    .vehicle-filter-form input,
    .vehicle-filter-form select,
    .vehicle-filter-form .button {
        width: 100%;
    }

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