:root {
    --bg: #f7f8fa; --card: #fff; --text: #1a1f2b; --muted: #6b7280; --line: #e5e7eb;
    --brand: #2563eb; --good: #15803d; --bad: #b91c1c; --gold: #b45309;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.8rem; margin: 1.2rem 0 .4rem; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: #eef0f4; padding: 1px 5px; border-radius: 4px; }

.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.nav nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-footer { margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--line); background: var(--card); font-size: .9rem; }

.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; cursor: pointer; }
.btn:hover { text-decoration: none; opacity: .92; }
.btn.small { padding: 5px 12px; font-size: .9rem; }
.btn.big { padding: 12px 22px; font-size: 1.05rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.linkbtn.good { color: var(--good); } .linkbtn.bad { color: var(--bad); }
form.inline { display: inline; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 14px 0; }
.flash.ok { background: #dcfce7; color: #14532d; }
.flash.err { background: #fee2e2; color: #7f1d1d; }
.flash ul { margin: 0; padding-left: 18px; }

.hero { padding: 28px 0 8px; }
.hero p { color: var(--muted); margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 8px; }
.filters input[type=search], .filters select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.filters input[type=search] { flex: 1 1 200px; }
.check { display: inline-flex; gap: 6px; align-items: center; }

.list { display: grid; gap: 10px; }
.card { display: flex; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card.featured { border-color: #f59e0b; background: #fffbeb; }
.card h3 { margin: 0; font-size: 1.1rem; }
.company { margin: 2px 0 6px; color: var(--muted); }
.card-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; white-space: nowrap; }
.chips { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 2px 10px; font-size: .82rem; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; background: #e5e7eb; color: #374151; }
.badge.verified, .badge.approved { background: #dcfce7; color: #14532d; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.rejected { background: #fee2e2; color: #7f1d1d; }
.badge.closed { background: #e5e7eb; color: #374151; }
.badge.risk-low { background: #dcfce7; color: #14532d; }
.badge.risk-medium { background: #fef3c7; color: #92400e; }
.badge.risk-high { background: #fee2e2; color: #7f1d1d; }
.ai-review { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.ai-review h2 { margin: 0 0 8px; font-size: 1.05rem; }
.badge.gold { background: #fde68a; color: var(--gold); }

.empty { text-align: center; padding: 36px 12px; background: var(--card); border: 1px dashed var(--line); border-radius: 12px; }

.detail, .about, .panel, .plan { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 14px 0; }
.detail h1 { margin-top: 6px; }
.prose { margin: 16px 0; }
.about h2 { margin-top: 0; }

.form { display: grid; gap: 14px; margin: 14px 0; max-width: 720px; }
.form.narrow { max-width: 360px; }
.form label { display: grid; gap: 4px; font-weight: 600; }
.form label.check { display: flex; font-weight: 400; }
.form input, .form select, .form textarea { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; font-weight: 400; }
.form input[type=checkbox] { width: auto; }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 14px; background: var(--card); }
.form legend { font-weight: 700; padding: 0 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.stat { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--text); }
.stat .num { font-size: 1.8rem; font-weight: 700; }
.chart { position: relative; height: 300px; }
.up { color: var(--good); } .down { color: var(--bad); }
.bar-row { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; margin: 6px 0; }
.bar { background: #eef0f4; border-radius: 6px; height: 14px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); }
.bar-num { text-align: right; }

.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mini { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; width: 120px; font: inherit; font-size: .85rem; }
.admin-nav, .tabs { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tabs a.active { font-weight: 700; color: var(--text); }
.row-line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.plan h2 { margin-top: 0; }
.price { font-size: 1.2rem; font-weight: 700; }

ul.pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 18px 0; }
ul.pagination li a, ul.pagination li span { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
ul.pagination li.active span { background: var(--brand); color: #fff; border-color: var(--brand); }
ul.pagination li.disabled span { color: var(--muted); }

@media (max-width: 640px) {
    .row, .row.three { grid-template-columns: 1fr; }
    .card { flex-direction: column; }
    .card-side { flex-direction: row; align-items: center; }
    .bar-row { grid-template-columns: 100px 1fr 30px; }
    .table { display: block; overflow-x: auto; }
}
