/* ============================================================
   Т О К Е Н Ы  (цвета, отступы, радиусы)
============================================================ */

:root {
    --bg: #ffffff;
    --bg-soft: #f6f7f9;
    --card-bg: #ffffff;
    --border: rgba(15, 23, 42, 0.08);

    --text: #111827;
    --text-secondary: #6b7280;

    --accent: #2481cc;
    --accent-soft: #e5f3ff;

    --success: #16a34a;
    --error: #dc2626;

    --radius: 14px;
    --radius-sm: 10px;
}


/* ============================================================
   В К Л А Д К И  (навигация по разделам)
============================================================ */

.tabs {
    margin-top: 12px;
    padding: 4px 2px 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #f3f4f6;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
}


/* ============================================================
   Т И П О Г Р А Ф И К А  + утилиты
============================================================ */

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

p, span, div, li {
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    margin: 0;
}

h1, h2, h3, h4, h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* small-текст как тег и как класс */
small,
.small {
    font-size: 11px;
}

strong, b { font-weight: 600; color: var(--text); }

.value { font-size: 14px; font-weight: 500; }
.muted { color: var(--text-secondary); }
.stat-number { font-weight: 600; color: var(--accent); }
.center { text-align: center; }
.mt-4 { margin-top: 4px; }
.hidden { display: none !important; }

/* доп. утилиты под разметку */
.mt { margin-top: 6px; }

.label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.loader {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.error {
    margin-top: 6px;
    font-size: 12px;
    color: var(--error);
}

.debug {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    background: #f9fafb;
    border-radius: var(--radius-sm);
    padding: 8px;
    word-break: break-word;
}

.list {
    margin-top: 8px;
}

.regions {
    margin-top: 8px;
}

.accent {
    color: var(--accent);
}

.page {
    margin-top: 8px;
}


/* ============================================================
   О Б Щ И Й  Л О Й О У Т
============================================================ */

body {
    background: var(--bg);
    padding: 16px;
}

.header {
    margin-bottom: 16px;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.header p {
    margin-top: 4px;
    color: var(--text-secondary);
}


/* ============================================================
   К А Р Т О Ч К И
============================================================ */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 4px rgba(15,23,42,0.04);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}


/* ============================================================
   К Н О П К И  &  В В О Д
============================================================ */

input, select, button {
    font-family: inherit;
    font-size: 14px;
}

.input {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.btn {
    padding: 10px;
    width: 100%;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
}

.btn-link {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    margin: 8px auto 0;
    display: block;
}


/* ============================================================
   О Б Щ А Я  С Т А Т И С Т И К А — Список регионов
============================================================ */

.region-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 6px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
}

.region-row:last-child { border-bottom: none; }

.region-row-title {
    font-size: 14px;
    font-weight: 500;
}

.region-row-total {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

/* Активный регион */
.region-row.active {
    background: var(--accent-soft);
    border-radius: 10px;
}

.region-row.active .region-row-title {
    font-weight: 600;
}

.region-row.active .region-row-total {
    font-weight: 700;
}


/* ============================================================
   О Б Щ А Я  С Т А Т И С Т И К А — Блок по стране внутри региона
============================================================ */

.country-block {
    background: var(--bg-soft);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0;
}

.country-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 4px;
}

.country-title-flag { font-size: 16px; }

.country-summary {
    font-size: 13px;
    margin-bottom: 6px;
}

.stat-row {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 18px;
    margin-bottom: 2px;
}


/* ============================================================
   П Е Р С О Н А Л Ь Н А Я  С Т А Т И С Т И К А
============================================================ */

#personal-content .country-block {
    background: var(--bg);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 10px 0 12px;
}

#personal-content .kind-block {
    background: var(--accent-soft);
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 6px;
}

#personal-content .kind-name {
    font-weight: 600;
    font-size: 13px;
}

#personal-content .kind-values {
    font-size: 12px;
    color: var(--text-secondary);
}


/* ============================================================
   Ц О Н Ы
============================================================ */

.region-row-csc {
    display: flex;
    justify-content: space-between;
    padding: 10px 6px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.region-row-csc.active {
    background: var(--accent-soft);
    border-radius: 10px;
}

.csc-details-block {
    background: var(--bg-soft);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0 14px;
}

/* строка внутри блока */
.csc-office-row {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

.csc-office-address {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.csc-office-2gis {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}


/* ============================================================
   И Т К
============================================================ */

.itk-details-block {
    background: var(--bg-soft);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0 14px;
}

.itk-office-row {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    gap: 8px;
}

.itk-office-right {
    text-align: right;
}

.itk-office-phones,
.itk-office-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.itk-office-email {
    margin-top: 2px;
}


/* ============================================================
   Ф И Л Ь Т Р Ы
============================================================ */

.public-filters,
.personal-filters {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.public-filters-row,
.personal-filters-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.public-filters-row select,
.personal-filters select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
}


/* ============================================================
   F O O T E R
============================================================ */

.footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.personal-country-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    cursor: pointer;
}

.personal-country-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    cursor: pointer;
}

.personal-country-row .country-arrow {
    font-size: 16px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.personal-country-row.active .country-arrow {
    transform: rotate(90deg);
}


/* ============================================================
   П Р О В Е Р К А  VIN — оформляем результат
============================================================ */

#vin-result {
    margin-top: 6px;
    font-size: 13px;
    white-space: pre-line;
    color: var(--text);
}

.vin-line {
    margin-bottom: 2px;
}

.vin-line-bad-title {
    color: var(--error);
    font-weight: 600;
}

.vin-line-good-title {
    color: var(--success);
    font-weight: 600;
}

.vin-label {
    color: var(--text-secondary);
}

.vin-value {
    color: var(--text);
    font-weight: 500;
}

.vin-reason {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================================
   В К Л А Д К И  (кнопки страниц)
============================================================ */

.tabs {
    display: flex;
    gap: 6px;
    margin: 12px 0;
    padding: 4px;
    background: var(--bg-soft);
    border-radius: 999px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Активная вкладка */
.tab-btn.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
}

.vin-block {
    background: #fff;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.45;
}

.vin-error {
    border-left: 4px solid var(--error);
    background: #fff5f5;
}

.vin-block-title {
    font-weight: 700;
    color: var(--error);
    margin-bottom: 6px;
}

.vin-block-row {
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* ============================================================
   В К Л А Д К И — обновлённый красивый бегунок
============================================================ */

.tabs-wrapper {
    position: relative;
    width: calc(100% + 32px); /* выход за край */
    margin-left: -16px;       /* смещение влево */
    margin-right: -16px;      /* смещение вправо */
    overflow: hidden;
}

/* Прокручиваемая область */
.scrollable-tabs {
    padding: 6px 32px; /* чтобы стрелки не закрывали текст */
    margin: 0;         /* убираем лишние отступы */
    background: var(--bg-soft);
    border-radius: 999px;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scrollable-tabs::-webkit-scrollbar {
    display: none;
}

/* стиль вкладок */
.tab-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    border: none;

    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);

    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

/* активная вкладка */
.tab-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(36,129,204,0.35);
}

/* Стрелки */
.tabs-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;

    background: var(--accent);
    color: #fff;
    font-size: 17px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: .92;
    z-index: 6;
    transition: opacity .2s ease;
}

.tabs-arrow.left {
    left: 4px;
}
.tabs-arrow.right {
    right: 4px;
}

.tabs-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

/* мягкие затемнения по краям (fade), чтобы стрелки не сидели на тексте */
.tabs-wrapper::before,
.tabs-wrapper::after {
    width: 40px; /* чуть шире */
}

.tabs-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg) 80%, transparent);
}

.tabs-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg) 80%, transparent);
}

.ad-card {
    margin-top: 16px;
    padding: 8px;
}

.ad-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
.ad-image {
    transform: translateZ(0);
}
.contact-block {
    background: var(--bg-soft);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.contact-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.contact-item {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    font-size: 13px;
    margin-bottom: 4px;
}

.contact-item .icon {
    flex-shrink: 0;
}

.contact-note {
    margin-top: 6px;
    line-height: 1.4;
}
