:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #171a20;
    --muted: #6d7480;
    --border: #e2e6ea;
    --soft: #f8f9fa;
    --accent: #1f5eff;
    --accent-dark: #1649cc;
    --good: #13795b;
    --radius: 14px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}
a { color: inherit; }
button, input, select { font: inherit; }
.app-shell { width: min(1480px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 56px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 28px; }
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .13em; font-weight: 800; margin-bottom: 8px; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.035em; }
.topbar p { margin: 10px 0 0; color: var(--muted); max-width: 760px; }
.topbar-meta { white-space: nowrap; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px #dff5ed; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-card strong { display: block; font-size: 27px; letter-spacing: -.03em; }
.stat-card span { color: var(--muted); font-size: 13px; }
.filters-panel, .results-section { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.filters-panel { padding: 18px; margin-bottom: 16px; }
.filters-form { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(130px, 1fr)) 100px auto; gap: 12px; align-items: end; }
.field { min-width: 0; }
.field span { display: block; font-size: 12px; font-weight: 700; color: #505866; margin-bottom: 6px; }
.field input, .field select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #d9dee4; border-radius: 10px; background: #fff; color: var(--text); outline: none; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,94,255,.10); }
.filter-actions { display: flex; gap: 8px; }
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--soft); border-color: var(--border); }
.results-section { overflow: hidden; }
.results-head { min-height: 62px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.results-head strong { display: block; }
.results-head span { color: var(--muted); font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1080px; }
th { padding: 11px 16px; text-align: left; color: #636b76; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: #fafbfc; border-bottom: 1px solid var(--border); }
td { padding: 15px 16px; border-bottom: 1px solid #edf0f2; vertical-align: top; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
.company-name { color: var(--text); font-weight: 800; text-decoration: none; font-size: 14px; }
.company-name:hover { color: var(--accent); }
.company-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.country-pill { color: #354052; background: #eef1f4; padding: 3px 7px; border-radius: 999px; font-weight: 700; }
.main-value { font-weight: 700; }
.sub-value { color: var(--muted); font-size: 12px; margin-top: 4px; max-width: 310px; }
.contacts { display: flex; flex-direction: column; gap: 5px; max-width: 290px; }
.contact-link { text-decoration: none; overflow-wrap: anywhere; }
.contact-link:hover { color: var(--accent); }
.contact-link.email::before { content: '✉'; color: var(--muted); margin-right: 7px; }
.contact-link.phone::before { content: '☎'; color: var(--muted); margin-right: 7px; }
.category-tag { display: inline-block; background: #eef4ff; color: #234b9b; padding: 5px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; }
.brands { margin-top: 7px; color: var(--muted); font-size: 12px; max-width: 230px; }
.web-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px; border-radius: 8px; background: #171a20; color: white; text-decoration: none; font-weight: 750; font-size: 12px; white-space: nowrap; }
.web-btn:hover { background: #2a2f36; }
.no-web, .muted { color: #9298a2; font-size: 12px; }
.pagination { padding: 16px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.page-btn, .page-numbers a { min-height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; background: white; font-size: 13px; font-weight: 700; }
.page-btn:hover, .page-numbers a:hover { border-color: #bdc5cf; }
.page-btn.disabled { color: #b3b8c0; background: #fafafa; }
.page-numbers { display: flex; align-items: center; gap: 5px; }
.page-numbers a { width: 38px; padding: 0; }
.page-numbers a.active { background: var(--accent); color: white; border-color: var(--accent); }
.empty-state { padding: 70px 24px; text-align: center; }
.empty-state h2 { margin: 0 0 6px; }
.empty-state p { margin: 0; color: var(--muted); }
/* detail */
.detail-shell { width: min(1080px, calc(100% - 32px)); }
.back-link { display: inline-flex; margin-bottom: 24px; text-decoration: none; color: var(--muted); font-weight: 700; }
.back-link:hover { color: var(--accent); }
.detail-hero { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.status-badge { display: inline-block; background: #edf8f3; color: #13795b; padding: 5px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; }
.web-btn-large { min-height: 44px; padding: 0 15px; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.detail-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; min-width: 0; }
.detail-card-wide { grid-column: 1 / -1; }
.detail-card h2 { margin: 0 0 16px; font-size: 16px; }
.detail-card p { color: #4f5864; margin: 0; }
.detail-line + .detail-line { margin-top: 14px; }
.detail-line strong, .detail-line span { display: block; }
.detail-line span { color: var(--muted); margin-top: 4px; }
.detail-contact { display: flex; flex-direction: column; gap: 2px; text-decoration: none; padding: 10px 0; border-bottom: 1px solid #eef0f2; overflow-wrap: anywhere; }
.detail-contact:last-child { border-bottom: 0; }
.detail-contact span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.detail-contact:hover strong { color: var(--accent); }
.brand-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.brand-list span { background: #f0f2f4; border-radius: 8px; padding: 6px 9px; font-size: 12px; font-weight: 700; }
.source-list { display: flex; flex-direction: column; }
.source-list a, .source-list > div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid #eef0f2; text-decoration: none; min-width: 0; }
.source-list a:last-child, .source-list > div:last-child { border-bottom: 0; }
.source-list span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.source-list strong { font-size: 12px; overflow-wrap: anywhere; font-weight: 600; }
.source-list a:hover strong { color: var(--accent); }
@media (max-width: 1280px) {
    .filters-form { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .field-search { grid-column: span 2; }
    .filter-actions { grid-column: span 2; justify-content: flex-end; }
}
@media (max-width: 760px) {
    .app-shell { width: min(100% - 20px, 1480px); padding-top: 24px; }
    .topbar, .detail-hero { align-items: flex-start; flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .filters-form { grid-template-columns: 1fr 1fr; }
    .field-search, .filter-actions { grid-column: 1 / -1; }
    .filter-actions { justify-content: stretch; }
    .filter-actions .btn { flex: 1; }
    .results-head { align-items: flex-start; gap: 8px; }
    .pagination { flex-wrap: wrap; justify-content: center; }
    .page-numbers { order: -1; width: 100%; justify-content: center; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-card-wide { grid-column: auto; }
    .source-list a, .source-list > div { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 14px; }
    .filters-form { grid-template-columns: 1fr; }
    .field-search, .filter-actions { grid-column: auto; }
    .filter-actions { flex-direction: column; }
    table, thead, tbody, th, td, tr { display: block; }
    table { min-width: 0; }
    thead { display: none; }
    tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
    tbody tr:last-child { border-bottom: 0; }
    td { border: 0; padding: 8px 0; }
    td::before { content: attr(data-label); display: block; color: #969ca6; text-transform: uppercase; letter-spacing: .06em; font-size: 9px; font-weight: 800; margin-bottom: 4px; }
    .sub-value, .contacts, .brands { max-width: none; }
}
