:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #d0d5dd;
  --soft-line: #eaecf0;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #ecfdf5;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
  --card-shadow: 0 4px 20px rgba(16, 24, 40, 0.04);
  --danger: #d92d20;
  --success: #039855;
  --info: #0284c7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

.page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* Header & Typography */
.topbar {
  min-height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 54px;
  border-bottom: 1px solid var(--soft-line);
  background: #ffffff;
}

.topbar__left {
  display: flex;
  flex-direction: column;
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.updated {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f9fafb;
  padding: 8px 14px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.main {
  padding: 40px 54px 80px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms;
}

.breadcrumbs a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.breadcrumbs span.separator {
  color: var(--line);
}

/* Back Button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 20px;
  transition: color 150ms;
}

.btn-back:hover {
  color: var(--ink);
}

/* Filters Panel */
.filters {
  margin: 0 auto 20px;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.filters__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.toggle-box {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
  cursor: pointer;
}

.filters.is-collapsed .filter-body {
  display: none;
}

.filter-body {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.sector-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}

.checkbox-row:hover {
  border-color: #99f6e4;
  background: #fafffe;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Inputs & Forms */
label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  padding: 9px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus, select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.list-search {
  margin: 0 auto 18px;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: #ffffff;
  padding: 18px;
  box-shadow: var(--card-shadow);
}

.list-search input {
  min-height: 48px;
  font-size: 16px;
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.summary span {
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: #ffffff;
  padding: 8px 14px;
}

/* Company Grid & Cards */
.company-list {
  display: grid;
  gap: 18px;
}

.company-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 238px;
  gap: 22px;
  align-items: center;
  min-height: 150px;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms/transform 160ms ease;
  text-decoration: none;
  color: inherit;
}

.company-card:hover {
  border-color: #b7c0cc;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.logo-frame {
  width: 132px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}

.logo-frame img {
  display: block;
  max-width: 104px;
  max-height: 84px;
  object-fit: contain;
}

.logo-fallback {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.company-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.symbol {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.meta {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
}

.sector-line {
  width: fit-content;
  max-width: 100%;
  border: 1px solid #ccfbf1;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.business {
  color: #475467;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 13.5px;
  line-height: 1.4;
}

.founded-line {
  color: #667085;
  font-weight: 700;
}

.card-actions {
  display: grid;
  gap: 10px;
  align-self: stretch;
  align-content: end;
}

.report-count {
  justify-self: end;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: #f9fafb;
  color: #475467;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}

.report-select {
  min-height: 42px;
  border-color: #b7c0cc;
  color: #101828;
  font-size: 14px;
  font-weight: 700;
}

.empty {
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: #ffffff;
  padding: 40px;
  font-size: 18px;
  text-align: center;
  color: var(--muted);
}

.company-card.hidden {
  display: none !important;
}

/* Details Page CSS */
.details-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.details-card {
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: var(--panel);
  padding: 32px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}

.details-header-section {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 28px;
  margin-bottom: 28px;
}

.details-logo-frame {
  width: 140px;
  height: 120px;
  display: grid;
  place-items: center;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: #fbfcfd;
  flex-shrink: 0;
  overflow: hidden;
}

.details-logo-frame img {
  display: block;
  max-width: 120px;
  max-height: 98px;
  object-fit: contain;
}

.details-title-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.details-title-info h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.price-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.price-badge {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
}

.price-badge .label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.price-badge .value {
  font-size: 18px;
  font-weight: 800;
}

.price-badge.change-up {
  background: #ecfdf5;
  color: var(--success);
}

.price-badge.change-down {
  background: #fef2f2;
  color: var(--danger);
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  margin: 32px 0 16px;
  color: var(--ink);
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title span.badge {
  font-size: 12px;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--soft-line);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
}

.business-summary-text {
  font-size: 15px;
  line-height: 1.6;
  color: #344054;
}

.reports-list {
  display: grid;
  gap: 12px;
}

.report-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 14px 18px;
  background: #fbfcfd;
  transition: border-color 150ms, box-shadow 150ms;
  text-decoration: none;
  color: inherit;
}

.report-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.03);
  background: #ffffff;
}

.report-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #fef2f2;
  color: var(--danger);
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
}

.report-title-text {
  font-weight: 700;
  font-size: 14px;
}

.report-year-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #99f6e4;
  padding: 2px 8px;
  border-radius: 6px;
}

.btn-open {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-open:hover {
  color: var(--accent-strong);
}

/* Sidebar & Contact Details */
.sidebar-panel {
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--card-shadow);
  display: grid;
  gap: 20px;
}

.sidebar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 12px;
}

.info-grid {
  display: grid;
  gap: 14px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item .label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.info-item .value {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.info-item a.value {
  color: var(--accent);
  text-decoration: none;
}

.info-item a.value:hover {
  text-decoration: underline;
  color: var(--accent-strong);
}

/* Corporate Governance (Table) */
.gov-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  text-align: left;
}

.gov-table th {
  padding: 12px;
  border-bottom: 2px solid var(--soft-line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.gov-table td {
  padding: 12px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 14px;
  font-weight: 700;
}

.gov-table tr:last-child td {
  border-bottom: 0;
}

/* Footer styling */
footer {
  margin-top: auto;
  border-top: 1px solid var(--soft-line);
  background: #ffffff;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Media Queries */
@media (max-width: 980px) {
  .topbar {
    padding: 15px 24px;
  }
  .main {
    padding: 24px 20px 60px;
  }
  .filter-body {
    grid-template-columns: 1fr;
  }
  .sector-options {
    grid-template-columns: 1fr;
    max-height: 260px;
  }
  .company-card {
    grid-template-columns: 118px minmax(0, 1fr);
  }
  .logo-frame {
    width: 118px;
    height: 104px;
  }
  .card-actions {
    grid-column: 2;
  }
  
  .details-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .company-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .logo-frame {
    width: 100%;
    height: 120px;
  }
  .card-actions {
    grid-column: auto;
  }
  .company-name {
    font-size: 20px;
  }
  .details-logo-frame {
    width: 100%;
    height: 140px;
  }
}

/* Nav Links */
.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: color 150ms;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
}

/* Rich Footer */
.footer-rich {
  border-top: 1px solid var(--soft-line);
  background: #ffffff;
  padding: 48px 54px 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto 32px;
  text-align: left;
}
.footer-col h4 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.footer-col ul a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 150ms;
}
.footer-col ul a:hover {
  color: var(--accent);
}
.footer-bottom {
  border-top: 1px solid var(--soft-line);
  padding-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.footer-bottom a {
  color: var(--accent);
  text-decoration: none;
}
.footer-bottom a:hover {
  text-decoration: underline;
}

/* Directory Listing Styles */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.directory-card {
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}
.directory-card:hover {
  border-color: #b7c0cc;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.directory-card .title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.3;
}
.directory-card .count {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #99f6e4;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}

/* Glossary Styles */
.glossary-list {
  display: grid;
  gap: 24px;
}
.glossary-item {
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.glossary-item h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-strong);
}
.glossary-item p {
  margin: 0;
  color: #344054;
  font-size: 15px;
  line-height: 1.6;
}

/* Responsive adjustments for rich footer */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-rich {
    padding: 32px 20px 20px;
  }
}
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
}