:root {
  --navy: #0d1b2e;
  --navy-mid: #162236;
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --surface: #ffffff;
  --accent: #2563eb;
  --positive: #16a34a;
  --negative: #dc2626;
}

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

html, body {
  font-family: "DM Sans", Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 56px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo { height: 28px; display: block; filter: brightness(0) invert(1); }

.topnav { display: flex; gap: 4px; }
.topnav a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }

.topbar-search {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex: 0 1 380px;
}
.topbar-search input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  font-size: 14px;
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.topbar-search input::placeholder { color: rgba(255,255,255,0.4); }
.topbar-search input:focus { outline: none; border-color: var(--blue-light); background: rgba(255,255,255,0.12); }
.topbar-search button {
  padding: 7px 16px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.topbar-search button:hover { background: #1d4ed8; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  padding: 80px 24px 72px;
  text-align: center;
  color: #fff;
}
.hero-inner { max-width: 660px; margin: 0 auto; }
.hero h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero-sub { font-size: 1.1rem; color: rgba(255,255,255,0.75); margin-bottom: 36px; }

.hero-search { width: 100%; }
.hero-search-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.hero-search-wrap .search-icon {
  width: 18px; height: 18px;
  margin-left: 16px;
  color: #94a3b8;
  flex-shrink: 0;
}
.hero-search-wrap input {
  flex: 1;
  padding: 16px 12px;
  border: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
}
.hero-search-wrap input:focus { outline: none; }
.hero-search-wrap button {
  padding: 0 28px;
  height: 54px;
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.hero-search-wrap button:hover { background: #1d4ed8; }

.hero-hint { margin-top: 16px; font-size: 0.9rem; color: rgba(255,255,255,0.55); }
.hero-hint a { color: rgba(255,255,255,0.8); }
.hero-hint a:hover { color: #fff; }

/* ── Stats bar ── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--navy-mid);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 40px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.stat:last-child { border-right: none; }
.stat-num { font-size: 1.3rem; font-weight: 700; color: #fff; }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* ── Features ── */
.features { padding: 64px 24px; background: var(--bg); }
.features-inner {
  max-width: 1000px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}
.feature-icon { font-size: 1.8rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* ── Product CTA ── */
.product-cta { padding: 48px 24px; background: var(--bg); }
.product-cta-inner { max-width: 700px; margin: 0 auto; }
.product-card.explore {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  border-radius: 16px;
  padding: 40px;
  color: #fff;
  text-align: center;
}
.product-card.explore h2 { font-size: 1.5rem; margin-bottom: 12px; }
.product-card.explore p { color: rgba(255,255,255,0.75); margin-bottom: 28px; }

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  padding: 9px 18px;
  background: var(--navy);
  color: #fff;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: #162236; text-decoration: none; color: #fff; }
.btn-primary.btn-full { display: block; text-align: center; }
.btn-secondary {
  display: inline-block;
  padding: 8px 18px;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: var(--navy); color: #fff; text-decoration: none; }

/* ── Search page ── */
.search-page { padding: 32px 24px; }
.search-page-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.search-heading {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-count { font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.result-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.result-item { border-radius: 10px; overflow: hidden; }
.result-link {
  display: block;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.result-link:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(37,99,235,0.1); text-decoration: none; }
.result-name { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Tags ── */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  letter-spacing: 0.01em;
}
.tag-status.active { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.tag-status.bankrupt { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.tag-status.winding_up { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* ── Company / Person page ── */
.company-page { padding: 32px 24px; }
.company-page-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.company-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.company-header h1 { font-size: 1.7rem; font-weight: 700; margin-bottom: 8px; }
.company-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.company-header-actions { flex-shrink: 0; }

.person-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 16px;
}
.company-header-left { display: flex; align-items: center; gap: 14px; }
.company-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex; align-items: center; justify-content: center;
}

/* ── Two-column grid (registry + contact) ── */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.two-col-grid .card { margin-bottom: 0; }
@media (max-width: 640px) { .two-col-grid { grid-template-columns: 1fr; } }

/* ── Financials highlight grid ── */
.fin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 640px) { .fin-grid { grid-template-columns: repeat(2, 1fr); } }
.fin-cell {
  padding: 14px 12px;
  background: var(--bg);
  border-radius: 8px;
  text-align: center;
}
.fin-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.fin-value { font-size: 1.2rem; font-weight: 700; }
.fin-value.negative { color: var(--negative); }
.fin-value.positive { color: var(--positive); }

/* ── Financial health ── */
.health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 640px) { .health-grid { grid-template-columns: 1fr; } }
.health-cell { padding: 16px; background: var(--bg); border-radius: 8px; }
.health-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.health-value { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.health-hint { font-size: 0.72rem; color: var(--muted); margin-top: 8px; }
.rate-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}
.rating-bad   { background: #fee2e2; color: #991b1b; }
.rating-weak  { background: #ffedd5; color: #9a3412; }
.rating-ok    { background: #fef9c3; color: #854d0e; }
.rating-good  { background: #dcfce7; color: #166534; }
.rating-vgood { background: #bbf7d0; color: #14532d; }
.rating-na    { background: #f1f5f9; color: #64748b; }

/* ── Negative value in table ── */
.data-table td.neg { color: var(--negative); }

.muted-text { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.78rem; }
.sidebar-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 10px; }
.sidebar-card p { font-size: 0.88rem; color: var(--muted); margin-bottom: 14px; }

/* ── KPI row ── */
.kpi-row { display: flex; flex-wrap: wrap; gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 1.4rem; font-weight: 700; }
.kpi-value.negative { color: var(--negative); }
.kpi-highlight .kpi-value { color: var(--blue); }
.kpi-highlight-card .card h2 { color: var(--blue); }
.portfolio-big, .valuation-big {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue);
  margin: 8px 0;
}
.valuation-range { font-size: 0.85rem; color: var(--muted); }

/* ── Info grid ── */
.info-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 16px;
  font-size: 0.9rem;
}
.info-grid dt { color: var(--muted); font-weight: 500; }
.info-grid dd { color: var(--text); word-break: break-word; }

/* ── Data table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }
.table-note { font-size: 0.82rem; color: var(--muted); margin-top: 10px; }
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.accounts-table { min-width: 560px; }

/* ── Data source note ── */
.data-source { font-size: 0.78rem; color: var(--muted); margin-top: 12px; }

/* ── Empty state ── */
.empty-state { padding: 48px 0; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }

/* ── Ad slots ── */
.ad-slot { background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 8px; margin-bottom: 20px; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-leaderboard { max-width: 1100px; margin: 0 auto 0; padding: 0 24px; }
.ad-banner { min-height: 90px; }
.ad-sidebar { min-height: 250px; }

/* ── About page ── */
.about-page { max-width: 860px; margin: 0 auto; padding: 48px 24px; }
.about-hero { text-align: center; margin-bottom: 56px; }
.about-hero h1 { font-size: 2rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.about-hero p { font-size: 1.05rem; color: var(--muted); max-width: 600px; margin: 0 auto; }
.about-section { margin-bottom: 48px; }
.about-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 16px; }
.about-section p { color: var(--muted); margin-bottom: 12px; }
.about-inner { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.about-products h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.product-card-about {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}
.product-card-about h3 { font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.product-card-about p { font-size: 0.9rem; color: var(--muted); margin-bottom: 20px; }
.about-data { padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.source-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.source-list li { font-size: 0.9rem; color: var(--muted); padding-left: 16px; position: relative; }
.source-list li::before { content: "·"; position: absolute; left: 0; color: var(--blue); font-weight: 700; }

/* ── Footer ── */
.sitefooter {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 48px 24px 24px;
  margin-top: 64px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand p { font-size: 0.85rem; margin-top: 10px; }
.footer-logo { height: 24px; filter: brightness(0) invert(1); opacity: 0.7; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links h4 { color: rgba(255,255,255,0.9); font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.footer-links a { font-size: 0.85rem; color: rgba(255,255,255,0.55); }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 20px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .topnav { display: none; }
  .topbar-search { flex: 1; }
  .hero h1 { font-size: 1.7rem; }
  .stats-bar { flex-wrap: wrap; }
  .stat { padding: 14px 20px; }
  .search-page-inner,
  .company-page-inner { grid-template-columns: 1fr; }
  .search-sidebar,
  .company-sidebar { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 130px 1fr; }
  .about-inner { grid-template-columns: 1fr; }
  .about-image { display: none; }
}
