:root {
  --header-bg: #0a0a0a;
  --header-border: rgba(255, 255, 255, 0.08);
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --surface: #ffffff;
  --bg: #f1f5f9;
  --text-muted: #64748b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 0;
  min-height: 72px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.header-logo {
  height: 48px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 1.25rem;
}

.header-discipline {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.2;
}

#brandTitle {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-actions .btn {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.header-actions .btn:active {
  transform: scale(0.97);
}

.btn-header-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.btn-header-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.btn-header-solid {
  background: #fff;
  border: 1px solid #fff;
  color: #0a0a0a;
}

.btn-header-solid:hover {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #0a0a0a;
}

/* ── Main ── */
main {
  flex: 1;
}

.page-intro {
  margin-bottom: 1.5rem;
}

.page-intro h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

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

/* ── Cards ── */
.card {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.card-title {
  font-weight: 600;
  color: #0f172a;
}

.main-content-row {
  align-items: flex-start;
}

.indicators-panel {
  position: sticky;
  top: 88px;
}

.quick-actions-grid {
  max-width: 280px;
}

.maturity-wrap {
  padding: 8px 12px;
}

.how-it-works-list {
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.how-it-works-list li {
  margin-bottom: 0.6rem;
}

.how-it-works-list li:last-child {
  margin-bottom: 0;
}

.how-it-works-list strong {
  color: #334155;
  font-weight: 600;
}

/* ── Table ── */
.table thead th {
  vertical-align: middle;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0;
}

.table tbody td {
  font-size: 0.9rem;
  border-color: #f1f5f9;
}

.table-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  width: 100%;
}

.table-action-btn {
  width: 100%;
  min-width: 96px;
  font-size: 0.72rem;
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
}

.badge-factor {
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-weight: 500;
}

code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #475569;
}

/* ── Buttons ── */
.btn {
  border-radius: 8px;
}

.btn-success {
  background: #16a34a;
  border-color: #16a34a;
}

/* ── Footer ── */
.site-footer {
  background: var(--header-bg);
  border-top: 1px solid var(--header-border);
  color: rgba(255, 255, 255, 0.6);
  margin-top: auto;
}

.site-footer .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 0.78rem;
}

.site-footer strong {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 4px;
}

.footer-credit {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* ── Misc ── */
#companyInput {
  display: inline-block;
  vertical-align: middle;
  border-radius: 8px;
}

#maturityCard .card {
  min-width: 220px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 3px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 575px) {
  .header-brand {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .header-text {
    border-left: none;
    padding-left: 0;
    width: 100%;
  }

  #brandTitle {
    white-space: normal;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions .btn {
    flex: 1;
    text-align: center;
  }

  .site-footer .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-brand {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-credit {
    white-space: normal;
  }

  .badge-factor {
    display: block;
    margin-bottom: 0.25rem;
  }
}
