@font-face {
    font-family: Panton;
    src: url("/fontfaces/Panton-Bold.woff") format("woff");
    font-weight: 700;
    font-display: swap;
}

.cs-admin {
    --ink: var(--cs-ink);
    --muted: var(--cs-muted);
    --line: var(--cs-line);
    --accent: var(--cs-accent);
    --canvas: var(--cs-paper);
    min-width: 0;
    margin: 0;
    padding: 0;
    background: var(--canvas);
    color: var(--ink);
    font: var(--cs-body)/1.45 var(--cs-sans);
}
.cs-admin *, .cs-admin *::before, .cs-admin *::after { box-sizing: border-box; }
.cs-admin :focus-visible { outline: 3px solid #8c71ea; outline-offset: 2px; }
.cs-skip { position: fixed; left: 12px; top: -100px; z-index: 1100; }
.cs-skip:focus { top: 8px; background: white; padding: 10px 16px; border-radius: 8px; }
.cs-bar { background: #191922; color: white; }
.cs-bar-inner, .cs-content {
    width: 100%;
    max-width: 1860px;
    margin: 0 auto;
    padding-inline: var(--cs-gutter);
}
.cs-bar-inner { display: flex; gap: clamp(16px, 3vw, 52px); align-items: center; min-height: 72px; }
.cs-bar a { color: inherit; border: 0; text-decoration: none; }
.cs-brand { display: inline-flex; align-items: center; min-height: 44px; }
.cs-brand img { display: block; width: 128px; height: auto; filter: brightness(0) invert(1); }
.cs-nav, .cs-account { display: flex; align-items: center; gap: 4px; }
.cs-nav a, .cs-account a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 9px;
    color: #dedce8;
    font-weight: 600;
}
.cs-nav a[aria-current] { color: #e9e2ff; background: #403554; }
.cs-bar a:hover { color: white; }
.cs-nav a:hover, .cs-account a:hover { background: #34333f; }
.cs-account { margin-left: auto; }
.cs-account a { padding-inline: 10px; gap: 5px; font-size: 13px; }
.cs-content { display: block; min-width: 0; padding-block: var(--cs-page-top) var(--cs-section-gap); }
.cs-content > .content-wrapper {
    width: 100%; min-width: 0; max-width: none; margin: 0 0 14px; padding: 0;
}
.cs-admin .page-title { flex-wrap: wrap; justify-content: flex-start; gap: 10px 14px; padding: 0; margin: 0 0 var(--cs-heading-gap); }
.cs-admin .page-title h1, .cs-admin .card-admin-login h1 {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    font: var(--cs-title-font);
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
}
.cs-admin .page-title h1 { flex: 0 1 auto; }
.cs-admin .page-title h1 a { color: var(--muted); }
.cs-admin .page-title h1 span {
    display: inline-block; padding: 4px 8px; margin: 0; vertical-align: middle; background: #e9e5f4;
    color: #55496e; font: 650 14px/1.15 var(--cs-sans); border-radius: 7px; letter-spacing: normal;
}
.cs-admin .page-title .header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin-left: auto; }
.cs-admin .page-title .admin-header-values { display: grid; grid-template-columns: auto auto; gap: 0 14px; margin: 0; align-items: end; }
.cs-admin .admin-header-values > .admin-header-value-icon { display: block; width: auto; height: auto; grid-row: 1; color: var(--muted); font: 550 11px/1.4 var(--cs-sans); }
.cs-admin .admin-header-values > .value { grid-row: 2; font: 650 15px/1.3 var(--cs-sans); font-variant-numeric: tabular-nums; }
.cs-admin .page-title .header-links { display: flex; gap: 6px; }
.cs-admin .page-title .header-actions form { margin: 0; }
.cs-admin .search-wrap { position: relative; width: 256px; max-width: 100%; }
.cs-admin .page-title .search-wrap .search-field { width: 100%; border: 1px solid var(--line); background: white; min-height: var(--cs-control-height); padding: 8px 42px 8px 13px; }
.cs-admin .search-wrap .btn-search {
    position: absolute; inset: 0 0 0 auto; width: 42px; height: 100%; margin: 0; padding: 0;
    background: transparent; border: 0; color: var(--accent); box-shadow: none;
}
.cs-admin .btn.btn-primary, .cs-admin .btn.btn-secondary {
    min-height: var(--cs-control-height); border: 1px solid transparent; border-radius: var(--cs-control-radius);
    padding: 9px 14px; font: 650 14px/1.4 var(--cs-sans); text-shadow: none; box-shadow: none;
}
.cs-admin .btn.btn-primary { background: var(--accent); color: white; }
.cs-admin .btn.btn-primary:hover { background: #43259e; }
.cs-admin .btn.btn-secondary { background: white; border-color: var(--line); color: var(--ink); }
.cs-admin .btn.btn-secondary:hover { background: #efedf6; }
.cs-content .form-control, .cs-admin .popup .form-control {
    max-width: 100%; border: 1px solid #ceccd8; border-radius: 8px; background-color: white;
    color: var(--ink); font-family: inherit; box-shadow: none;
}
.cs-admin .form-control:focus { border-color: var(--accent); }
.cs-admin .content-wrapper:has(> .filters) {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px;
    border: 1px solid var(--line); border-radius: var(--cs-radius); background: white;
}
.cs-admin .content-wrapper > .filters { order: -1; flex: 1 1 auto; margin: 0; }
.cs-admin .filters > ul { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-admin .filters > ul > li { margin: 0; }
.cs-admin .filters .tooltip-filter {
    display: inline-flex; align-items: center; min-height: 36px; padding: 7px 10px;
    border: 1px solid var(--line); border-radius: 8px; background: #faf9fc; color: var(--ink); margin: 0;
}
.cs-admin .filters .tooltip-filter.active { background: #eee8ff; border-color: #cfc1f1; color: #4d3199; box-shadow: none; }
.cs-admin #carstore_orderby { min-height: 36px; }
.cs-admin .card { min-width: 0; border: 1px solid var(--line); border-radius: var(--cs-radius); box-shadow: none; background-color: white; }
.cs-admin .card-carstore { padding: 0; }
.cs-admin .card .fullwidth-table {
    width: 100%; max-width: 100%; margin: 0; overflow-x: auto; border-radius: calc(var(--cs-radius) - 1px); overscroll-behavior-x: contain;
}
.cs-admin .card .fullwidth-table > .table { width: 100%; margin: 0; }
.cs-admin .card .fullwidth-table > .table > thead > tr > th {
    padding: 12px 8px; font: 650 12px/1.3 var(--cs-sans); color: #504f5f; background: #f2f1f6;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.cs-admin .card .table > thead th a { color: inherit; border-color: transparent; }
.cs-admin .card .table-carstore > tbody > tr.carstore { background: white; }
.cs-admin .card .table-carstore > tbody > tr.carstore.unread { background: #f8f5ff; }
.cs-admin .card .table-carstore > tbody > tr.carstore:hover { background: #f8f8fb; }
.cs-admin .table-carstore tr.carstore > td {
    padding: 8px 6px; border: 0; box-shadow: inset 0 -1px var(--line); vertical-align: middle;
}
.cs-admin .table-carstore .car-name, .cs-admin .table-carstore .car-issue-name { font-weight: 650; }
.cs-admin .table-carstore .car-image img { width: 66px; height: 44px; max-width: none; max-height: none; object-fit: contain; border-radius: 5px; }
.cs-admin .table-carstore .car-mileage { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs-admin .table-carstore td.car-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.cs-admin .table-carstore td.car-price::after { content: " ₽"; }
.cs-admin .table-carstore td.car-n a, .cs-admin .table-carstore td.car-issue-n a { color: var(--accent); font-weight: 650; }
.cs-admin .table-carstore tr.carstore .custom-control-select { min-height: 32px; border-radius: 7px; }
.cs-admin .table-carstore tr.carstore > .car-location select, .cs-admin .table-carstore tr.carstore > .car-issue-location select {
    background-color: #f3f2f6; background-image: none; color: var(--ink); appearance: auto; box-shadow: none;
}
.cs-admin .cs-empty { padding: 32px 14px; text-align: center; color: var(--muted); }
.cs-admin .cs-table-mode { display: none; }
/* The sidebar reduces the space available to statistics independently of the viewport. */
.cs-admin :is(.carstore-stat-awards, .carstore-stat-insights, .carstore-stat-places, .carstore-brand-grid) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--stat-column, 11.25rem)), 1fr));
    gap: var(--cs-grid-gap);
}
.cs-admin .carstore-stat-awards { --stat-column: 10.75rem; }
.cs-admin .carstore-brand-grid { --stat-column: 13.75rem; }
.cs-admin .carstore-stat-hero { background: #292638; border-radius: var(--cs-radius); }
.cs-admin .carstore-stat-eyebrow { color: #d1c2ff; }
.cs-admin .carstore-stat-progress span { background: #b49af6; }
.cs-admin .carstore-stat-award, .cs-admin .carstore-stat-insight, .cs-admin .carstore-stat-list { border-radius: 12px; }
.cs-admin .popup { max-width: 100%; border-radius: var(--cs-radius); }
.cs-admin.page-admin-login .cs-content { display: grid; place-items: center; min-height: calc(100vh - 72px); min-height: calc(100svh - 72px); }
.cs-admin .card-admin-login {
    position: static; width: min(100%, 420px); margin: 0; transform: none;
    padding: clamp(24px, 5vw, 40px) !important; box-shadow: 0 14px 48px rgb(34 25 68 / 7%);
}
.cs-admin .card-admin-login h1 { margin-bottom: var(--cs-heading-gap); }
.cs-admin .card-admin-login .form-group { margin: 0 0 16px; }
.cs-admin .card-admin-login label { display: block; margin-bottom: 6px; font-weight: 600; }
.cs-admin .card-admin-login .form-control { width: 100%; min-width: 0; min-height: var(--cs-control-height); padding: 10px 12px; font-size: 16px; }
.cs-admin .card-admin-login .btn-login { width: 100%; min-height: var(--cs-control-height); }
.cs-admin .card-admin-login .form-submit { margin-top: 22px; }

@media screen and (max-width: 820px) {
    .cs-bar-inner { flex-wrap: wrap; justify-content: space-between; gap: 0 8px; min-height: 56px; padding-block: 6px; }
    .cs-brand img { width: 112px; }
    .cs-nav { order: 1; width: 100%; }
    .cs-nav a { flex: 1; min-height: 40px; padding-inline: 3px; font-size: 13px; }
    .cs-account { gap: 0; }
    .cs-content { padding-bottom: 32px; }
    .cs-admin .page-title { gap: 8px; margin-bottom: var(--cs-heading-gap); }
    .cs-admin .page-title h1 { flex-basis: 100%; }
    .cs-admin .page-title .header-actions { width: 100%; }
    .cs-admin .page-title .header-links:empty { display: none; }
    .cs-admin .page-title .header-actions form { flex: 1; min-width: 0; }
    .cs-admin .search-wrap { width: 100%; }
    .cs-admin .form-control { font-size: 16px; }
    .cs-admin .card-admin-login { margin-block: 12px; }
    .cs-admin.page-admin-login .cs-content { min-height: calc(100svh - 56px); }
    .cs-admin .form-inline.dates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .cs-admin .cs-table-mode { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0; min-height: 44px; font-size: 14px; font-weight: 550; cursor: pointer; }
    .cs-table-mode input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
    .cs-table-mode:has(input:checked) + .fullwidth-table > table { min-width: 900px; }

    /* The compact view and the full table share the same editable fields. */
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table > .table-carstore,
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table > .table-carstore > tbody { display: block; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table > .table-carstore > thead { display: none; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table > table > tbody > .carstore {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
        gap: 7px 12px; height: auto; padding: 14px; border-top: 1px solid var(--line);
    }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table > table > tbody > .carstore > td {
        display: none; width: auto; min-width: 0; padding: 0; border: 0; box-shadow: none;
        text-align: left; white-space: normal; overflow-wrap: anywhere;
    }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table > table > tbody > .carstore > :is(.car-image,.car-n,.car-name,.car-year,.car-price,.car-condition,.car-location,.car-issue-n,.car-issue-name,.car-issue-question,.car-issue-location,.car-issue-operator,.car-status:not(:empty)) { display: block; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .carstore[data-car-n] > .car-status { display: none; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .car-image { grid-row: 1; grid-column: 1; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .car-image img { width: 92px; height: 60px; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table :is(.car-n,.car-issue-n) { grid-row: 1; grid-column: 2; justify-self: end; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table :is(.car-n,.car-issue-n) a { display: inline-block; padding: 5px; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table :is(.car-n,.car-issue-n) a::before { content: "№ "; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table :is(.car-name,.car-issue-question,.car-issue-operator) { grid-column: 1 / -1; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .car-issue-name { grid-column: 1; grid-row: 1; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .car-name { font-size: 18px; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .car-meta { width: auto; white-space: normal; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table :is(.car-location,.car-issue-location,.car-condition,.car-status,.car-issue-operator)::before {
        display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 550;
    }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table :is(.car-location,.car-issue-location)::before { content: "Локация"; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table :is(.car-condition,.car-status)::before { content: "Статус"; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .car-issue-operator::before { content: "Менеджер"; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .carstore > td.car-mileage {
        display: block;
        justify-self: end;
        white-space: nowrap;
        overflow-wrap: normal;
    }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table td.car-mileage::after { content: " км"; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .car-price { grid-column: 1 / -1; justify-self: end; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .custom-control-select { width: 100%; max-width: 100%; min-height: 40px; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .carstore-details,
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .carstore-content { display: block; max-width: 100%; }
    .cs-table-mode:has(input:not(:checked)) + .fullwidth-table .carstore-content { padding: 10px; overflow-x: auto; }
}
@media print {
    .cs-bar, .cs-skip, .cs-table-mode { display: none !important; }
    .cs-admin, .cs-content { background: white; margin: 0; padding: 0; }
    .cs-admin .card .fullwidth-table { overflow: visible; }
}
