:root {
    --bg-dark: #1B232C;
    --bg-dark-2: #232D38;
    --accent: #D7262B;
    --accent-hover: #B81F23;
    --gold: #F2B705;
    --text-light: #F5F6F7;
    --text-muted: #9AA5B1;
    --border: #2E3A46;
    --card-bg: #FFFFFF;
    --page-bg: #F3F4F6;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--page-bg);
    color: #1B232C;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.topbar {
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 13px;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.topbar a { margin-left: 20px; color: var(--text-muted); }
.topbar a:hover { color: var(--text-light); }

.header {
    background: var(--bg-dark);
    padding: 16px 0;
}
.header .container { display: flex; align-items: center; gap: 20px; }
.logo-block { display: flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.logo { color: var(--text-light); font-size: 20px; font-weight: 700; white-space: nowrap; }
.logo span { color: var(--accent); }
.logo-tagline { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
@media (max-width: 480px) {
    .logo-tagline { display: none; }
}

.header-nav { display: flex; gap: 20px; margin-left: 24px; }
.header-nav a { color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.header-nav a:hover { color: var(--text-light); }
.header-actions { display: flex; gap: 12px; flex-wrap: nowrap; }
@media (max-width: 800px) {
    .header-nav { display: none; }
    .header-actions .btn { padding: 8px 12px; font-size: 13px; }
}

.breadcrumbs { background: #fff; border-bottom: 1px solid #E5E7EB; }
.breadcrumbs nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 0; font-size: 13px; }
.breadcrumbs a { color: #6B7280; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumb-sep { color: #D1D5DB; }
.breadcrumb-current { color: #1B232C; font-weight: 600; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent); color: #fff; border: none; border-radius: 8px;
    padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-light); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn-outline-dark { background: transparent; border: 1px solid #D1D5DB; color: #1B232C; }
.btn-outline-dark:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn-gold { background: var(--gold); color: #1B232C; }
.btn-gold:hover { background: var(--accent-hover); color: #fff; }

.search-form { flex: 1; display: flex; }
.search-form input {
    flex: 1; border: 1px solid var(--accent); border-radius: 8px 0 0 8px;
    padding: 10px 16px; font-size: 14px; outline: none;
}
.search-form button {
    border-radius: 0 8px 8px 0; padding: 10px 18px;
}

.nav {
    background: var(--bg-dark-2);
    border-top: 1px solid var(--border);
}
.nav .container { display: flex; gap: 24px; overflow-x: auto; height: 44px; align-items: center; }
.nav a { color: var(--text-light); font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--accent); }

/* Hero */
.hero {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 48px 0;
}
.hero .badge { display: inline-block; background: rgba(215,38,43,.15); color: var(--accent); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 16px; letter-spacing: .5px; }
.hero h1 { font-size: 30px; line-height: 1.25; margin-bottom: 12px; }
.hero p { color: var(--text-muted); margin-bottom: 24px; }

.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: stretch; }
.hero-text { display: flex; flex-direction: column; justify-content: center; }
.hero .hero-form-card.form-card { margin: 0; max-width: none; color: #1B232C; align-self: center; }
.hero .hero-form-card.form-card h2 { color: #1B232C; }
.hero .hero-form-card.form-card label { color: #1B232C; }
.hero .hero-form-card.form-card p { color: #1B232C; margin-bottom: 0; }

.hero-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.hero-mini-card { display: block; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 10px; transition: border-color .15s ease, background .15s ease; }
.hero-mini-card:hover { background: rgba(255,255,255,.1); border-color: var(--gold); }
.hero-mini-img { aspect-ratio: 4/3; background: var(--bg-dark-2); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.hero-mini-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-mini-title { font-size: 12px; color: var(--text-light); font-weight: 600; line-height: 1.3; }
.hero-mini-power { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.hero-mini-price { font-size: 13px; font-weight: 700; color: var(--gold); margin-top: 6px; white-space: nowrap; }
@media (max-width: 420px) {
    .hero-mini-price { font-size: 11px; }
    .hero-mini-card { padding: 8px; }
}
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 34px; }
}

/* Cards */
.section { padding: 40px 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-title h2 { font-size: 22px; }

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

.card {
    background: var(--card-bg); border-radius: var(--radius); border: 1px solid #E5E7EB;
    overflow: hidden; display: flex; flex-direction: column;
}
/* Вся карточка кликабельна: ссылка в названии растягивается на карточку, интерактивные элементы поверх неё */
.card { position: relative; transition: box-shadow .15s, border-color .15s; }
.card:hover { border-color: #D1D5DB; box-shadow: 0 6px 18px rgba(17,24,39,.08); }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-title a:focus-visible { outline: none; }
.card-title a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.card .js-open-lead, .card .btn { position: relative; z-index: 2; }
.card-badge, .card-discount { pointer-events: none; }
.card-img { position: relative; aspect-ratio: 4/3; background: #fff; overflow: hidden; }
.card-img img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.card-img img[src$="placeholder.svg"] { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-badge { position: absolute; z-index: 2; top: 10px; left: 10px; background: #16A34A; color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.card-discount { position: absolute; z-index: 2; top: 10px; right: 10px; background: var(--accent); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.price { font-size: 18px; font-weight: 700; white-space: nowrap; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 13px; margin-left: 6px; white-space: nowrap; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.card-meta { font-size: 12px; color: #6B7280; }
.card-matched { font-size: 12px; color: #16A34A; font-weight: 600; }
.card-matched b { font-weight: 800; }
.card-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
.supplier-verified { font-size: 11px; color: #16A34A; }
.ref-badge { display: inline-block; font-size: 11px; font-weight: 700; color: #9A6B00; background: #FEF3C7; padding: 2px 8px; border-radius: 6px; }

/* Forms */
.form-card {
    background: #fff; border-radius: var(--radius); padding: 32px; max-width: 420px; margin: 40px auto;
    border: 1px solid #E5E7EB;
}
.form-card h1 { font-size: 22px; margin-bottom: 20px; }
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; font-weight: 600; }
.field input:not([type=checkbox]), .field select, .field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #D1D5DB; border-radius: 8px; font-size: 14px;
}
.field input[type=checkbox] { width: 16px; height: 16px; flex: none; }
.role-switch { display: flex; gap: 10px; margin-bottom: 20px; }
.role-tab {
    flex: 1; border: none; border-radius: 8px; padding: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    background: #E5E7EB; color: #9CA3AF;
    transition: background .15s ease, color .15s ease;
}
.role-tab:hover { background: #D1D5DB; color: #6B7280; }
.role-tab.active { background: var(--accent); color: #fff; }
.role-tab.active:hover { background: var(--accent-hover); color: #fff; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-success { background: #DCFCE7; color: #166534; }

table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; table-layout: fixed; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid #E5E7EB; font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; word-break: break-word; }
table.data th { background: #F9FAFB; }

/* Админка: шире контент и разнесённые кнопки действий */
.container-wide { max-width: 1480px; }
.row-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
.row-actions form { margin: 0; display: block; }
.act-btn {
    display: block; width: 100%; box-sizing: border-box; text-align: center; text-decoration: none;
    font: inherit; font-size: 12px; line-height: 1.3; padding: 7px 12px; border-radius: 6px;
    border: 1px solid #D1D5DB; background: #fff; color: #1B232C; cursor: pointer;
}
.act-btn:hover { background: #F3F4F6; }
.act-btn.ok { border-color: #16A34A; color: #166534; }
.act-btn.ok:hover { background: #DCFCE7; }
.act-btn.warn { border-color: #D97706; color: #92400E; }
.act-btn.warn:hover { background: #FEF3C7; }
.act-btn.danger { border-color: #DC2626; color: #991B1B; }
.act-btn.danger:hover { background: #FEE2E2; }
.leads-table th:nth-child(1), .leads-table td:nth-child(1) { width: 9%; }
.leads-table th:nth-child(2), .leads-table td:nth-child(2) { width: 19%; }
.leads-table th:nth-child(3), .leads-table td:nth-child(3) { width: 8%; }
.leads-table th:nth-child(4), .leads-table td:nth-child(4) { width: 13%; }
.leads-table th:nth-child(5), .leads-table td:nth-child(5) { width: 33%; }
.leads-table th:nth-child(6), .leads-table td:nth-child(6) { width: 18%; }
.lead-contacts { display: flex; flex-direction: column; gap: 6px; }
.lead-contacts input { width: 100%; box-sizing: border-box; font-size: 13px; padding: 6px 8px; border: 1px solid #D1D5DB; border-radius: 6px; }
.credits-table th:nth-child(1), .credits-table td:nth-child(1) { width: 9%; }
.credits-table th:nth-child(2), .credits-table td:nth-child(2) { width: 22%; }
.credits-table th:nth-child(3), .credits-table td:nth-child(3) { width: 11%; }
.credits-table th:nth-child(4), .credits-table td:nth-child(4) { width: 10%; }
.credits-table th:nth-child(5), .credits-table td:nth-child(5) { width: 9%; }
.credits-table th:nth-child(6), .credits-table td:nth-child(6) { width: 14%; }
.credits-table th:nth-child(7), .credits-table td:nth-child(7) { width: 25%; }

/* Страница товара */
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.product-layout > * { min-width: 0; }
.product-image { width: 100%; display: block; border-radius: 12px; background: #fff; }
table.data.specs { table-layout: auto; }
table.data.specs th { width: 42%; font-weight: 600; }
table.data.specs th, table.data.specs td { word-break: normal; overflow-wrap: break-word; text-overflow: clip; }
@media (max-width: 768px) {
    .product-layout { grid-template-columns: 1fr; gap: 18px; }
    .product-layout h1 { font-size: 24px; }
}

/* Журнал согласий: 9 колонок — Дата, Форма, Email, Телефон, Принятый документ, Принят, Политика, IP, Устройство */
.consent-table th:nth-child(1), .consent-table td:nth-child(1) { width: 10%; }
.consent-table th:nth-child(2), .consent-table td:nth-child(2) { width: 11%; }
.consent-table th:nth-child(3), .consent-table td:nth-child(3) { width: 16%; }
.consent-table th:nth-child(4), .consent-table td:nth-child(4) { width: 11%; }
.consent-table th:nth-child(5), .consent-table td:nth-child(5) { width: 13%; }
.consent-table th:nth-child(6), .consent-table td:nth-child(6) { width: 6%; }
.consent-table th:nth-child(7), .consent-table td:nth-child(7) { width: 8%; }
.consent-table th:nth-child(8), .consent-table td:nth-child(8) { width: 9%; }
.consent-table th:nth-child(9), .consent-table td:nth-child(9) { width: 16%; }
.consent-table td:nth-child(1), .consent-table td:nth-child(8) { white-space: nowrap; }
@media (max-width: 900px) {
    .consent-table { table-layout: auto; min-width: 760px; }
    .consent-table th, .consent-table td { width: auto !important; }
}

.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.tag-new { background: #DBEAFE; color: #1D4ED8; }
.tag-in_progress { background: #FEF3C7; color: #92400E; }
.tag-confirmed { background: #DCFCE7; color: #166534; }
.tag-rejected { background: #FEE2E2; color: #991B1B; }
.tag-done { background: #E5E7EB; color: #374151; }
.tag-pending { background: #FEF3C7; color: #92400E; }
.tag-approved { background: #DCFCE7; color: #166534; }
.tag-free { background: #E0F2FE; color: #075985; }

.footer { background: var(--bg-dark); color: var(--text-muted); padding: 32px 0; font-size: 13px; }

.dashboard { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 24px 0; }
.dashboard > * { min-width: 0; }
.sidebar { background: var(--bg-dark); color: var(--text-light); border-radius: var(--radius); padding: 16px; height: fit-content; }
/* Боковое меню кабинетов остаётся на экране при прокрутке (только на широких экранах) */
@media (min-width: 801px) {
    .sidebar { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; }
}
.sidebar a { display: block; padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 4px; }
.sidebar a:hover, .sidebar a.active { background: var(--accent); }
.panel { background: #fff; border-radius: var(--radius); padding: 20px; border: 1px solid #E5E7EB; min-width: 0; overflow-x: auto; }

@media (max-width: 800px) {
    .dashboard { grid-template-columns: 1fr; }
    .header .container { flex-wrap: wrap; }
}

.why-section { background: var(--page-bg); padding: 48px 0; }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.why-card { background: #fff; border: 1px solid #E5E7EB; border-radius: var(--radius); padding: 20px; }
.why-icon {
    width: 44px; height: 44px; border-radius: 10px; background: rgba(215,38,43,.1); color: var(--accent);
    display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.why-icon svg { width: 22px; height: 22px; }
.why-card h3 { font-size: 15px; margin-bottom: 6px; line-height: 1.3; }
.why-card p { font-size: 13px; color: #6B7280; line-height: 1.5; margin: 0; }
.why-card p a { color: var(--accent); }
@media (max-width: 860px) {
    .why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .why-grid { grid-template-columns: 1fr; }
}

.calc-section { background: #fff; padding: 32px 0; }
.calc-intro { color: #6B7280; margin-bottom: 16px; max-width: 640px; font-size: 14px; }

.calc-panel { padding: 18px; }
.calc-row { display: flex; flex-wrap: nowrap; gap: 12px; align-items: end; }
.calc-field { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; width: max-content; }
.calc-field label { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #374151; white-space: nowrap; }

.calc-tip {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%; background: #E5E7EB; color: #6B7280;
    font-size: 10px; font-weight: 700; cursor: help; flex: 0 0 auto;
}

.calc-tip-popup {
    display: none; position: fixed; width: 280px; white-space: pre-line;
    background: #1B232C; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.5;
    padding: 10px 12px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.25); z-index: 1100;
}
.calc-tip-popup::after {
    content: ""; position: absolute; top: 100%; left: var(--arrow-left, 50%); transform: translateX(-50%);
    border: 6px solid transparent; border-top-color: #1B232C;
}
.calc-tip-popup.calc-tip-popup-below::after {
    top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #1B232C;
}
.calc-field input:not([type=checkbox]), .calc-field select {
    width: 100%; padding: 8px 10px; border: 1px solid #D1D5DB; border-radius: 8px; font-size: 13px; height: 36px;
}
.calc-field-narrow { width: 90px; }
.calc-field-wide { flex: 1 1 auto; min-width: 260px; }
.calc-field-btn { flex: 0 0 220px; width: auto; }
.calc-field-btn .btn { height: 36px; width: 100%; padding: 0 20px; white-space: nowrap; font-size: 14px; }

.calc-toggle { display: flex; gap: 6px; height: 36px; }
.calc-toggle .role-tab { flex: 1 1 auto; padding: 0 12px; font-size: 12px; height: 36px; white-space: nowrap; }

.calc-hint { font-size: 12px; color: #9CA3AF; margin-top: 12px; line-height: 1.4; }

.filter-panel { padding: 16px; margin-bottom: 24px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filter-row .calc-field { width: 160px; }
.filter-stock-field { align-self: end; padding-bottom: 8px; width: auto !important; }
.filter-stock-label { display: flex; align-items: center; gap: 6px; font-weight: 400 !important; white-space: nowrap; }
.filter-stock-label input[type=checkbox] { width: 16px; height: 16px; }
.filter-row .calc-field-btn { width: auto; flex: 0 0 auto; }
.filter-row .calc-field-btn .btn { width: auto; padding: 0 18px; }
.filter-row .filter-range-field { width: 300px; flex: 0 0 auto; }
.filter-range { display: flex; align-items: center; gap: 6px; }
.filter-range input { width: 0; flex: 1 1 0; min-width: 100px; }
.filter-range span { color: #9CA3AF; flex: 0 0 auto; }
@media (max-width: 700px) {
    .filter-row .calc-field { width: 100%; }
    .filter-row .filter-range-field { width: 100%; }
}

@media (max-width: 900px) {
    .calc-row { flex-wrap: wrap; }
    .calc-row .calc-field { width: 100%; }
    .calc-field-narrow { width: 100%; }
    .calc-field-btn { width: 100%; flex-basis: 100%; }
    .calc-field-wide { min-width: 0; width: 100%; }
}

.calc-result-inline {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 16px; padding: 14px 16px; background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 10px;
}
.calc-result-label { font-size: 13px; color: #6B7280; margin-right: 6px; }
.calc-result-value { font-size: 20px; font-weight: 800; color: var(--accent); margin-right: 10px; }
.calc-result-note { font-size: 12px; color: #6B7280; }

@media (max-width: 700px) {
    .calc-result-inline { flex-direction: column; align-items: stretch; }
    .calc-result-inline .btn { width: 100%; }
}

.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(27,35,44,.65);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-overlay .modal-box.form-card { position: relative; max-width: 440px; width: 100%; margin: 0; max-height: 90vh; overflow-y: auto; }
.modal-close {
    position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px;
    border: none; background: #F3F4F6; color: #6B7280; font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: #E5E7EB; }
body.modal-open { overflow: hidden; }

/* Обрезка фото образца в админке */
.crop-modal {
    display: none; position: fixed; inset: 0; background: rgba(17,24,39,.7);
    z-index: 1000; align-items: center; justify-content: center; padding: 16px;
}
.crop-modal-inner { background: #fff; border-radius: var(--radius); padding: 20px; max-width: 92vw; }
.crop-frame {
    position: relative; width: min(480px, 82vw); aspect-ratio: 4/3; overflow: hidden;
    background: #fff; border-radius: 8px; cursor: grab; touch-action: none;
    box-shadow: inset 0 0 0 1px #E5E7EB;
}
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; top: 0; left: 0; max-width: none; max-height: none; user-select: none; -webkit-user-drag: none; }
.crop-controls { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.crop-controls input[type=range] { flex: 1; min-width: 120px; }
.crop-actions { display: flex; gap: 8px; margin-left: auto; }

/* iOS Safari автоматически зумит страницу при фокусе на поле с font-size < 16px */
@media (max-width: 600px) {
    input, select, textarea { font-size: 16px !important; }
    .calc-field input, .calc-field select { height: 40px; }
    .filter-range input { min-width: 70px; }
}

/* Поле выбора файлов в форме заявки */
.field input[type="file"] {
    width: 100%; padding: 8px; font-size: 13px; color: #6B7280;
    border: 1px dashed #C9CED6; border-radius: 8px; background: #F9FAFB; cursor: pointer;
}
.field input[type="file"]:hover { border-color: var(--accent); }
.field input[type="file"]::file-selector-button {
    margin-right: 12px; padding: 8px 16px; border: none; border-radius: 8px;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
.field input[type="file"]::file-selector-button:hover { background: var(--accent-hover); }

/* Выбор файла не вызывает зум в Safari (нет клавиатуры), поэтому ему можно вернуть компактный шрифт */
@media (max-width: 600px) {
    .field input[type="file"] { font-size: 13px !important; }
    .field input[type="file"]::file-selector-button { font-size: 14px; padding: 8px 14px; }
}

/* Таблица каталога образцов в админке */
.ref-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid #E5E7EB; background: #fff; display: block; }
.ref-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.ref-table th.sortable:hover { color: var(--accent); }
.ref-table th.sortable::after { content: ' ↕'; color: #9CA3AF; font-size: 11px; }
.ref-table th[data-dir="asc"]::after { content: ' ▲'; color: var(--accent); }
.ref-table th[data-dir="desc"]::after { content: ' ▼'; color: var(--accent); }
.ref-table td { vertical-align: middle; }

/* Мобильные: карточки товаров по две в ряд */
@media (max-width: 600px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .card-img img { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
    .card-badge, .card-discount { top: 6px; font-size: 10px; padding: 2px 6px; }
    .card-badge { left: 6px; max-width: calc(100% - 52px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .card-discount { right: 6px; }
    .card-body { padding: 10px; gap: 4px; }
    .price { font-size: 15px; }
    .price-old { display: block; margin-left: 0; font-size: 11px; }
    .card-title { font-size: 13px; }
    .card-meta, .card-matched { font-size: 11px; }
    .card-footer { padding-top: 4px; }
    .card .btn.js-open-lead { padding: 9px 6px; font-size: 13px; }
}

/* Мобильные: цена всегда в одну строку — шрифт подстраивается под ширину карточки (до «от 175 000 000 ₽») */
@media (max-width: 600px) {
    .card-body { container-type: inline-size; }
    .card .price { font-size: min(16px, 12cqw); }
}

/* Cookie-баннер */
.cookie-banner {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 900;
    width: min(960px, calc(100% - 24px)); background: #fff; color: #1B232C;
    border: 1px solid #E5E7EB; border-top: 4px solid var(--accent); border-radius: 12px;
    box-shadow: 0 10px 40px rgba(17,24,39,.28); padding: 16px 18px;
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 13px; line-height: 1.45;
}
.cookie-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.cookie-text b { font-size: 15px; }
.cookie-text span { color: #4B5563; }
.cookie-text a { color: var(--accent); text-decoration: underline; }
.cookie-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cookie-btn { font: inherit; font-size: 14px; font-weight: 700; border-radius: 8px; cursor: pointer; padding: 11px 18px; white-space: nowrap; }
.cookie-btn-main { background: var(--accent); color: #fff; border: 2px solid var(--accent); box-shadow: 0 4px 14px rgba(215,38,43,.35); }
.cookie-btn-main:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.cookie-btn-alt { background: #fff; color: #1B232C; border: 1px solid #C9CED6; font-weight: 600; }
.cookie-btn-alt:hover { border-color: #1B232C; }
.cookie-btn-link { background: none; border: none; color: #6B7280; font-weight: 500; text-decoration: underline; padding-left: 6px; padding-right: 6px; }
body.has-cookie-banner { padding-bottom: 150px; }
@media (max-width: 600px) {
    .cookie-banner { bottom: 8px; padding: 14px; gap: 12px; }
    .cookie-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
    .cookie-btn { width: 100%; text-align: center; }
    body.has-cookie-banner { padding-bottom: 300px; }
}

/* Кнопка открытия контактов в кабинете поставщика */
.reveal-btn { padding: 9px 14px; font-size: 13px; white-space: nowrap; box-shadow: 0 3px 10px rgba(215,38,43,.25); }
.reveal-btn-empty { background: #fff; color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
.reveal-btn-empty:hover { background: var(--accent); color: #fff; }

/* Кабинет поставщика: ширины колонок, чтобы кнопки и контакты не обрезались справа */
.sup-leads-table th:nth-child(1), .sup-leads-table td:nth-child(1) { width: 12%; }
.sup-leads-table th:nth-child(2), .sup-leads-table td:nth-child(2) { width: 10%; }
.sup-leads-table th:nth-child(3), .sup-leads-table td:nth-child(3) { width: 40%; }
.sup-leads-table th:nth-child(4), .sup-leads-table td:nth-child(4) { width: 38%; }
.sup-orders-table th:nth-child(1), .sup-orders-table td:nth-child(1) { width: 11%; }
.sup-orders-table th:nth-child(2), .sup-orders-table td:nth-child(2) { width: 22%; }
.sup-orders-table th:nth-child(3), .sup-orders-table td:nth-child(3) { width: 15%; }
.sup-orders-table th:nth-child(4), .sup-orders-table td:nth-child(4) { width: 25%; }
.sup-orders-table th:nth-child(5), .sup-orders-table td:nth-child(5) { width: 12%; }
.sup-orders-table th:nth-child(6), .sup-orders-table td:nth-child(6) { width: 15%; }
.sup-leads-table td:nth-child(4), .sup-orders-table td:nth-child(4) { overflow: visible; text-overflow: clip; }
.reveal-btn { white-space: normal; text-align: center; line-height: 1.25; }
@media (max-width: 1180px) {
    .sup-purchases-table, .credit-history-table { table-layout: auto; min-width: 560px; }
    /* заявки и запросы на мобильных — карточками, чтобы кнопка не уходила за край */
    .sup-leads-table, .sup-orders-table { display: block; background: none; }
    .sup-leads-table tbody, .sup-orders-table tbody { display: block; }
    .sup-leads-table tr:first-child, .sup-orders-table tr:first-child { display: none; }
    .sup-leads-table tr, .sup-orders-table tr { display: block; border: 1px solid #E5E7EB; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
    .sup-leads-table td, .sup-orders-table td { display: block; width: auto !important; border: none; padding: 5px 0; overflow: visible; text-overflow: clip; }
    .sup-leads-table td::before, .sup-orders-table td::before { display: block; font-size: 11px; color: #6B7280; text-transform: uppercase; letter-spacing: .3px; }
    .sup-leads-table td:nth-child(1)::before { content: "Заявка"; }
    .sup-leads-table td:nth-child(2)::before { content: "Мощность"; }
    .sup-leads-table td:nth-child(3)::before { content: "Комментарий"; }
    .sup-leads-table td:nth-child(4)::before { content: "Контакты"; }
    .sup-orders-table td:nth-child(1)::before { content: "Дата"; }
    .sup-orders-table td:nth-child(2)::before { content: "Установка"; }
    .sup-orders-table td:nth-child(3)::before { content: "Заказчик"; }
    .sup-orders-table td:nth-child(4)::before { content: "Контакт"; }
    .sup-orders-table td:nth-child(5)::before { content: "Статус"; }
    .sup-orders-table td:nth-child(6)::before { content: "Действия"; }
    .sup-leads-table .reveal-btn, .sup-orders-table .reveal-btn { width: 100%; }
}

/* Таблицы в кабинетах: текст переносится внутри столбцов, а не обрезается многоточием */
.dashboard table.data { table-layout: auto; }
.dashboard table.data.leads-table, .dashboard table.data.credits-table, .dashboard table.data.consent-table,
.dashboard table.data.sup-leads-table, .dashboard table.data.sup-orders-table { table-layout: fixed; }
.dashboard table.data th, .dashboard table.data td {
    overflow: visible; text-overflow: clip; word-break: normal; overflow-wrap: anywhere;
    vertical-align: top; line-height: 1.45;
}
.dashboard table.data th { vertical-align: middle; }
.dashboard table.data td form { max-width: 100%; }
.dashboard table.data td input[type="text"], .dashboard table.data td input[type="email"], .dashboard table.data td input[type="tel"], .dashboard table.data td select { max-width: 100%; }
.dashboard table.data.consent-table td:last-child { font-size: 11px; color: #6B7280; }

/* Файлы заявки в ячейке контактов */
.lead-files { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.lead-file { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.35; color: var(--accent); text-decoration: none; }
.lead-file:hover .lead-file-name { text-decoration: underline; }
.lead-file-icon { flex: 0 0 14px; margin-top: 1px; }
.lead-file-name { min-width: 0; overflow-wrap: anywhere; }
.lead-file-size { flex: 0 0 auto; color: #6B7280; white-space: nowrap; margin-left: 2px; }
.lead-file-locked { color: #6B7280; }

/* Пометки в подписях полей: (обязательно), требования к паролю */
.req { font-weight: 400; font-size: 12px; color: #6B7280; }

/* Админка, заявки: на телефонах, планшетах и малых ноутбуках (до 1180px) каждая заявка — отдельная карточка вместо сжатой таблицы */
@media (max-width: 1180px) {
    .leads-table { display: block; background: none; table-layout: auto; }
    .leads-table tbody { display: block; }
    .leads-table tr:first-child { display: none; }
    .leads-table tr { display: block; border: 1px solid #E5E7EB; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #fff; }
    .leads-table td { display: block; width: auto !important; border: none; padding: 6px 0; overflow: visible; text-overflow: clip; }
    .leads-table td::before { display: block; font-size: 11px; color: #6B7280; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 3px; }
    .leads-table td:nth-child(1)::before { content: "Заявка"; }
    .leads-table td:nth-child(2)::before { content: "Заказчик"; }
    .leads-table td:nth-child(3)::before { content: "Мощность"; }
    .leads-table td:nth-child(4)::before { content: "Статус"; }
    .leads-table td:nth-child(5)::before { content: "Комментарий (виден поставщикам)"; }
    .leads-table td:nth-child(6)::before { content: "Действия"; }
    .leads-table .row-actions { min-width: 0; }
    .leads-table textarea { min-width: 0 !important; }
}
@media (max-width: 1180px) {
    .dashboard table.data.leads-table td { padding: 6px 0; }
}

/* Подвал: ссылки в ряд на компьютере и в два столбца на телефонах */
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
@media (max-width: 600px) {
    .footer .container { flex-direction: column; }
    .footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; width: 100%; }
    .footer-links a { display: block; line-height: 1.35; }
}

/* Главная на узких телефонах (320–360px): первый экран не должен быть шире экрана */
.hero-grid > * { min-width: 0; }
.hero h1 { overflow-wrap: break-word; }
@media (max-width: 420px) {
    .hero h1 { font-size: 27px; }
    .hero-mini-grid { gap: 8px; }
    .hero-mini-card { padding: 6px; min-width: 0; }
    .hero-mini-title { font-size: 11px; }
}

/* Кабинет поставщика: история пополнений и история откликов на телефонах и планшетах — карточками, без горизонтальной прокрутки */
@media (max-width: 1180px) {
    .sup-purchases-table, .credit-history-table { display: block; min-width: 0 !important; background: none; table-layout: auto; }
    .sup-purchases-table tbody, .credit-history-table tbody { display: block; }
    .sup-purchases-table tr:first-child, .credit-history-table tr:first-child { display: none; }
    .sup-purchases-table tr, .credit-history-table tr { display: block; border: 1px solid #E5E7EB; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
    .dashboard table.data.sup-purchases-table td, .dashboard table.data.credit-history-table td { display: block; width: auto !important; border: none; padding: 5px 0; overflow: visible; text-overflow: clip; }
    .sup-purchases-table td::before, .credit-history-table td::before { display: block; font-size: 11px; color: #6B7280; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px; }
    .sup-purchases-table td:nth-child(1)::before { content: "Дата"; }
    .sup-purchases-table td:nth-child(2)::before { content: "Пакет"; }
    .sup-purchases-table td:nth-child(3)::before { content: "Сумма"; }
    .sup-purchases-table td:nth-child(4)::before { content: "Способ"; }
    .sup-purchases-table td:nth-child(5)::before { content: "Статус"; }
    .sup-purchases-table td:nth-child(6)::before { content: "Действия"; }
    .credit-history-table td:nth-child(1)::before { content: "Дата"; }
    .credit-history-table td:nth-child(2)::before { content: "Операция"; }
    .credit-history-table td:nth-child(3)::before { content: "Детали"; }
    .credit-history-table td:nth-child(4)::before { content: "Изменение"; }
    .credit-history-table td:nth-child(5)::before { content: "Остаток после"; }
}

/* Компактные карточки (≤1180px): связанные данные стоят рядом, а не по одному в строке */
@media (max-width: 1180px) {
    .sup-leads-table tr, .sup-orders-table tr, .sup-purchases-table tr, .credit-history-table tr, .leads-table tr {
        display: grid; column-gap: 14px; row-gap: 0; align-items: start; padding: 6px 12px;
    }
    .sup-leads-table td, .sup-orders-table td, .sup-purchases-table td, .credit-history-table td, .leads-table td { min-width: 0; }
    .dashboard table.data.sup-leads-table td, .dashboard table.data.sup-orders-table td,
    .dashboard table.data.sup-purchases-table td, .dashboard table.data.credit-history-table td,
    .dashboard table.data.leads-table td { padding: 4px 0; }

    /* Заявки заказчиков (поставщик): №/дата — слева, мощность — справа; комментарий и контакты на всю ширину */
    .sup-leads-table tr { grid-template-columns: 1fr auto; }
    .sup-leads-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .sup-leads-table td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }
    .sup-leads-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
    .sup-leads-table td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
    .sup-leads-table td:nth-child(1)::before, .sup-leads-table td:nth-child(2)::before { display: none; }

    /* Запросы по установкам: дата | статус; установка; заказчик | контакт; действия */
    .sup-orders-table tr { grid-template-columns: 1fr 1fr; }
    .sup-orders-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .sup-orders-table td:nth-child(5) { grid-column: 2; grid-row: 1; }
    .sup-orders-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    .sup-orders-table td:nth-child(3) { grid-column: 1; grid-row: 3; }
    .sup-orders-table td:nth-child(4) { grid-column: 2; grid-row: 3; }
    .sup-orders-table td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }

    /* История пополнений: дата | статус; пакет | сумма; способ | действия */
    .sup-purchases-table tr { grid-template-columns: 1fr 1fr; }
    .sup-purchases-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .sup-purchases-table td:nth-child(5) { grid-column: 2; grid-row: 1; }
    .sup-purchases-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
    .sup-purchases-table td:nth-child(3) { grid-column: 2; grid-row: 2; }
    .sup-purchases-table td:nth-child(4) { grid-column: 1; grid-row: 3; }
    .sup-purchases-table td:nth-child(6) { grid-column: 2; grid-row: 3; }

    /* История откликов: дата | изменение; операция | остаток; детали */
    .credit-history-table tr { grid-template-columns: 1fr 1fr; }
    .credit-history-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .credit-history-table td:nth-child(4) { grid-column: 2; grid-row: 1; }
    .credit-history-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
    .credit-history-table td:nth-child(5) { grid-column: 2; grid-row: 2; }
    .credit-history-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }

    /* Админка, заявки: №/дата | мощность | статус в одну строку; контакты, комментарий, действия на всю ширину */
    .leads-table tr { grid-template-columns: auto auto 1fr; }
    .leads-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .leads-table td:nth-child(3) { grid-column: 2; grid-row: 1; }
    .leads-table td:nth-child(4) { grid-column: 3; grid-row: 1; }
    .leads-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    .leads-table td:nth-child(5) { grid-column: 1 / -1; grid-row: 3; }
    .leads-table td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }
}

/* Заявки заказчиков (кабинет поставщика): мощность слегка выделена; в карточках нет линий под ячейками */
.sup-leads-table td:nth-child(2) { font-weight: 600; white-space: nowrap; }
@media (max-width: 1180px) {
    .dashboard table.data.sup-leads-table td, .dashboard table.data.sup-orders-table td,
    .dashboard table.data.sup-purchases-table td, .dashboard table.data.credit-history-table td,
    .dashboard table.data.leads-table td { border: none; border-bottom: none; }
    .dashboard table.data.sup-leads-table td:nth-child(2) { justify-self: end; align-self: start; margin-top: 4px; padding: 3px 10px; background: #F3F4F6; border-radius: 6px; font-weight: 700; }
}

/* Пустой комментарий в карточке заявки на телефонах не занимает место */
@media (max-width: 1180px) {
    .sup-leads-table td.cell-empty { display: none; }
}

/* Кликабельные контакты: звонок и письмо одним нажатием */
a.contact-link { color: var(--accent); text-decoration: none; word-break: break-word; }
a.contact-link:hover { text-decoration: underline; }
.contact-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.contact-quick a { display: inline-block; padding: 5px 12px; font-size: 12px; font-weight: 600; border: 1px solid #D1D5DB; border-radius: 6px; color: #1B232C; text-decoration: none; background: #fff; }
.contact-quick a:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 1180px) {
    a.contact-link { display: inline-block; padding: 2px 0; font-size: 14px; }
    .contact-quick a { flex: 1; text-align: center; padding: 9px 12px; font-size: 13px; }
}

/* Элементы, которые не нужны на телефонах (например, каталог образцов в админке) */
@media (max-width: 800px) {
    .hide-mobile { display: none !important; }
}

/* Админка на телефонах и планшетах (≤1180px): пользователи, модераторы, счета и журнал согласий — компактные карточки без горизонтальной прокрутки */
@media (max-width: 1180px) {
    .users-table, .staff-table, .credits-table, .consent-table { display: block; min-width: 0 !important; background: none; table-layout: auto; }
    .users-table tbody, .staff-table tbody, .credits-table tbody, .consent-table tbody { display: block; }
    .users-table tr:first-child, .staff-table tr:first-child, .credits-table tr:first-child, .consent-table tr:first-child { display: none; }
    .users-table tr, .staff-table tr, .credits-table tr, .consent-table tr {
        display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; align-items: start;
        border: 1px solid #E5E7EB; border-radius: 10px; padding: 6px 12px; margin-bottom: 10px; background: #fff;
    }
    .dashboard table.data.users-table td, .dashboard table.data.staff-table td, .dashboard table.data.credits-table td, .dashboard table.data.consent-table td {
        display: block; width: auto !important; min-width: 0; border: none; padding: 4px 0; overflow: visible; text-overflow: clip; font-size: 13px; color: inherit;
    }
    .users-table td::before, .staff-table td::before, .credits-table td::before, .consent-table td::before {
        display: block; font-size: 11px; color: #6B7280; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 1px;
    }
    /* Пользователи: имя; роль | статус; email; проверен | отклики; действия */
    .users-table td:nth-child(1) { grid-column: 1 / -1; font-weight: 700; }
    .users-table td:nth-child(2) { grid-column: 1; }
    .users-table td:nth-child(5) { grid-column: 2; grid-row: 2; }
    .users-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
    .users-table td:nth-child(4) { grid-column: 1; grid-row: 4; }
    .users-table td:nth-child(6) { grid-column: 2; grid-row: 4; }
    .users-table td:nth-child(7) { grid-column: 1 / -1; grid-row: 5; }
    .users-table td:nth-child(1)::before { display: none; }
    .users-table td:nth-child(2)::before { content: "Роль"; } .users-table td:nth-child(3)::before { content: "Email"; }
    .users-table td:nth-child(4)::before { content: "Проверен"; } .users-table td:nth-child(5)::before { content: "Статус"; }
    .users-table td:nth-child(6)::before { content: "Отклики"; } .users-table td:nth-child(7)::before { content: "Действия"; }
    .users-table td:nth-child(7) form { display: inline-block; margin: 2px 12px 2px 0; }
    /* Модераторы: имя | статус; email; добавлен | последний вход; действия */
    .staff-table td:nth-child(1) { grid-column: 1; grid-row: 1; font-weight: 700; }
    .staff-table td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; }
    .staff-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    .staff-table td:nth-child(3) { grid-column: 1; grid-row: 3; }
    .staff-table td:nth-child(4) { grid-column: 2; grid-row: 3; }
    .staff-table td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }
    .staff-table td:nth-child(1)::before, .staff-table td:nth-child(5)::before { display: none; }
    .staff-table td:nth-child(2)::before { content: "Email"; } .staff-table td:nth-child(3)::before { content: "Добавлен"; }
    .staff-table td:nth-child(4)::before { content: "Последний вход"; } .staff-table td:nth-child(6)::before { content: "Действия"; }
    /* Счета: поставщик; дата | статус; пакет | сумма; способ; действия */
    .credits-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; font-weight: 700; }
    .credits-table td:nth-child(1) { grid-column: 1; grid-row: 2; }
    .credits-table td:nth-child(6) { grid-column: 2; grid-row: 2; }
    .credits-table td:nth-child(3) { grid-column: 1; grid-row: 3; }
    .credits-table td:nth-child(4) { grid-column: 2; grid-row: 3; }
    .credits-table td:nth-child(5) { grid-column: 1 / -1; grid-row: 4; }
    .credits-table td:nth-child(7) { grid-column: 1 / -1; grid-row: 5; }
    .credits-table td:nth-child(2)::before { display: none; }
    .credits-table td:nth-child(1)::before { content: "Дата"; } .credits-table td:nth-child(3)::before { content: "Пакет"; }
    .credits-table td:nth-child(4)::before { content: "Сумма"; } .credits-table td:nth-child(5)::before { content: "Способ"; }
    .credits-table td:nth-child(6)::before { content: "Статус"; } .credits-table td:nth-child(7)::before { content: "Действия"; }
    .credits-table .row-actions { min-width: 0; }
    /* Журнал согласий: дата | форма; email | телефон; документ | принят; политика | IP; устройство */
    .consent-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .consent-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
    .consent-table td:nth-child(3) { grid-column: 1; grid-row: 2; }
    .consent-table td:nth-child(4) { grid-column: 2; grid-row: 2; }
    .consent-table td:nth-child(5) { grid-column: 1; grid-row: 3; }
    .consent-table td:nth-child(6) { grid-column: 2; grid-row: 3; }
    .consent-table td:nth-child(7) { grid-column: 1; grid-row: 4; }
    .consent-table td:nth-child(8) { grid-column: 2; grid-row: 4; }
    .consent-table td:nth-child(9) { grid-column: 1 / -1; grid-row: 5; font-size: 11px; color: #6B7280; }
    .consent-table td:nth-child(1)::before { content: "Дата"; } .consent-table td:nth-child(2)::before { content: "Форма"; }
    .consent-table td:nth-child(3)::before { content: "Email"; } .consent-table td:nth-child(4)::before { content: "Телефон"; }
    .consent-table td:nth-child(5)::before { content: "Принятый документ"; } .consent-table td:nth-child(6)::before { content: "Принят"; }
    .consent-table td:nth-child(7)::before { content: "Политика"; } .consent-table td:nth-child(8)::before { content: "IP"; }
    .consent-table td:nth-child(9)::before { content: "Устройство"; }
    .consent-table td:nth-child(1), .consent-table td:nth-child(8) { white-space: normal; }
}

/* Кабинет поставщика: кнопки «Не удалось связаться» / «Уже выбрал поставщика» под контактами заявки */
.claim-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.claim-box form { margin: 0; }
.claim-box .act-btn { font-size: 12px; padding: 5px 10px; }
@media (max-width: 1180px) { .claim-box .act-btn { padding: 8px 12px; font-size: 13px; } }

/* Админка, жалобы поставщиков: таблица на компьютере, карточки на узких экранах */
.claims-table th:nth-child(1), .claims-table td:nth-child(1) { width: 9%; }
.claims-table th:nth-child(2), .claims-table td:nth-child(2) { width: 9%; }
.claims-table th:nth-child(3), .claims-table td:nth-child(3) { width: 17%; }
.claims-table th:nth-child(4), .claims-table td:nth-child(4) { width: 15%; }
.claims-table th:nth-child(5), .claims-table td:nth-child(5) { width: 19%; }
.claims-table th:nth-child(6), .claims-table td:nth-child(6) { width: 13%; }
.claims-table th:nth-child(7), .claims-table td:nth-child(7) { width: 18%; }
.dashboard table.data.claims-table { table-layout: fixed; }
@media (max-width: 1180px) {
    .claims-table { display: block; min-width: 0 !important; background: none; table-layout: auto; }
    .claims-table tbody { display: block; }
    .claims-table tr:first-child { display: none; }
    .claims-table tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; align-items: start; border: 1px solid #E5E7EB; border-radius: 10px; padding: 6px 12px; margin-bottom: 10px; background: #fff; }
    .dashboard table.data.claims-table td { display: block; width: auto !important; min-width: 0; border: none; padding: 4px 0; overflow: visible; text-overflow: clip; font-size: 13px; }
    .claims-table td::before { display: block; font-size: 11px; color: #6B7280; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 1px; }
    .claims-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 1; font-weight: 700; }
    .claims-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
    .claims-table td:nth-child(6) { grid-column: 2; grid-row: 2; }
    .claims-table td:nth-child(4) { grid-column: 1; grid-row: 3; }
    .claims-table td:nth-child(1) { grid-column: 2; grid-row: 3; }
    .claims-table td:nth-child(5) { grid-column: 1 / -1; grid-row: 4; }
    .claims-table td:nth-child(7) { grid-column: 1 / -1; grid-row: 5; }
    .claims-table td:nth-child(3)::before { display: none; }
    .claims-table td:nth-child(1)::before { content: "Дата"; } .claims-table td:nth-child(2)::before { content: "Заявка"; }
    .claims-table td:nth-child(4)::before { content: "Причина"; } .claims-table td:nth-child(5)::before { content: "Заказчик"; }
    .claims-table td:nth-child(6)::before { content: "Статус"; } .claims-table td:nth-child(7)::before { content: "Действия"; }
}

/* Сколько других поставщиков уже откликнулись на заявку */
.resp-count { display: inline-block; margin-top: 4px; font-size: 12px; color: #4B5563; background: #F3F4F6; border-radius: 6px; padding: 2px 8px; white-space: normal; }
.resp-count b { color: #1B232C; }
.resp-count.resp-none { color: #166534; background: #DCFCE7; font-weight: 600; }