:root {
  --ink: #14212c;
  --muted: #66727c;
  --line: #d7dfdc;
  --panel: #ffffff;
  --page: #f3f6f4;
  --teal: #0057a8;
  --teal-dark: #00326f;
  --olive: #58b90f;
  --rust: #ff7a18;
  --red: #d9542b;
  --gold: #ffc62b;
  --shadow: 0 18px 45px rgba(0, 32, 78, 0.1);
  --sidebar-bg: #07131c;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --input-bg: #fbfaf7;
  --chart-bg: #fbfaf7;
  --footer-bg: rgba(244, 242, 236, 0.9);
}

[data-theme="dark"] {
  --ink: #eef7fb;
  --muted: #a8b8c2;
  --line: #263b4a;
  --panel: #101b24;
  --page: #07131c;
  --teal: #1da7ff;
  --teal-dark: #7dd4ff;
  --olive: #7ee024;
  --rust: #ff8a20;
  --red: #ff6645;
  --gold: #ffd34d;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  --sidebar-bg: #040a10;
  --sidebar-hover: rgba(255, 255, 255, 0.1);
  --input-bg: #101a22;
  --chart-bg: #121d25;
  --footer-bg: rgba(13, 21, 27, 0.92);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px;
  color: #f8fbfa;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  color: #fff;
  text-decoration: none;
}

.brand-text {
  min-width: 0;
}

.brand-logo,
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #286278;
  font-weight: 800;
}

.brand-logo {
  display: block;
  object-fit: cover;
  padding: 0;
  background: #07131c;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: #adc0c9;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.main-nav {
  display: grid;
  gap: 8px;
}

.nav-link,
.nav-group summary {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #dce8ea;
  text-decoration: none;
  cursor: pointer;
}

.nav-link:hover,
.nav-group summary:hover {
  background: var(--sidebar-hover);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #00326f);
  box-shadow: inset 3px 0 0 var(--rust);
}

.nav-group {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.nav-group summary {
  justify-content: space-between;
  font-weight: 700;
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "+";
  color: #adc0c9;
  font-weight: 500;
}

.nav-group[open] summary::after {
  content: "-";
}

.nav-sublist {
  display: grid;
  gap: 4px;
  padding: 4px 0 8px 14px;
}

.nav-sublist .nav-link {
  min-height: 36px;
  color: #c9d5d9;
  font-size: 14px;
}

.nav-short {
  display: none;
  font-weight: 900;
}

body.sidebar-collapsed .sidebar {
  padding: 18px 14px;
}

body.sidebar-collapsed .brand-row {
  display: grid;
  justify-items: center;
  gap: 12px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .side-note,
body.sidebar-collapsed .nav-group summary::after {
  display: none;
}

body.sidebar-collapsed .main-nav {
  gap: 10px;
}

body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-group summary {
  justify-content: center;
  padding: 10px 6px;
}

body.sidebar-collapsed .nav-sublist {
  padding: 6px 0 8px;
}

body.sidebar-collapsed .nav-short {
  display: inline-flex;
}

.side-note {
  margin-top: 26px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.side-note strong {
  display: block;
  margin-bottom: 8px;
}

.side-note p {
  margin: 0;
  color: #c4d0d6;
  font-size: 13px;
  line-height: 1.45;
}

.main-panel {
  min-width: 0;
}

body.auth-locked .sidebar {
  display: none;
}

body.auth-locked .app-shell {
  grid-template-columns: 1fr;
}

body.auth-locked .topbar {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 18px 34px;
  background: var(--footer-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar h1,
.section-heading h2,
.hero-copy h2,
.intro-band h2,
.holding-header h2,
.checklist-summary h2 {
  margin: 0;
  line-height: 1.08;
}

.topbar h1 {
  margin-top: 4px;
  font-size: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.theme-switcher {
  display: inline-flex;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.theme-option {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 32px;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.theme-option.active {
  color: #fff;
  background: var(--teal);
}

.ghost-button,
.danger-button,
.primary-button {
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.danger-button {
  border-color: #e1b2aa;
  color: #8d2f24;
}

.primary-button {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-size: 13px;
  font-weight: 800;
}

.install-prompt {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: min(460px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.install-prompt[hidden] {
  display: none;
}

.install-prompt span {
  color: var(--muted);
  font-weight: 800;
}

.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(24, 33, 42, 0.08);
}

.content {
  display: grid;
  gap: 28px;
  padding: 28px 34px 44px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  min-height: 310px;
  overflow: hidden;
  border-radius: 8px;
  background: #07131c;
  box-shadow: var(--shadow);
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.78fr);
  min-height: calc(100vh - 56px);
  gap: 22px;
  align-items: stretch;
}

.login-visual,
.login-card,
.user-form,
.users-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
  padding: 38px;
  color: #fff;
  background:
    radial-gradient(circle at 44% 34%, rgba(255, 122, 24, 0.28), transparent 28%),
    radial-gradient(circle at 32% 60%, rgba(88, 185, 15, 0.18), transparent 30%),
    #07131c;
}

.login-logo {
  width: min(520px, 100%);
  margin-bottom: 24px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 70px rgba(255, 122, 24, 0.14);
}

.login-visual h2 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
}

.login-visual p {
  max-width: 560px;
  color: #d6e7eb;
  font-size: 17px;
  line-height: 1.6;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: 520px;
  padding: 28px;
}

.login-card h2,
.user-form h2,
.empty-state h2 {
  margin: 0 0 10px;
  line-height: 1.1;
}

.login-card label,
.user-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-card input,
.user-form input,
.user-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--input-bg);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--rust);
  font-size: 13px;
  font-weight: 800;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.user-form,
.users-panel,
.empty-state {
  padding: 20px;
}

.user-form {
  display: grid;
  align-content: start;
  gap: 14px;
}

.inline-check {
  display: flex !important;
  grid-template-columns: auto minmax(0, 1fr);
  flex-direction: row;
  align-items: center;
}

.inline-check input {
  width: 18px;
  min-height: 18px;
}

.users-table {
  display: grid;
  gap: 8px;
}

.users-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.8fr 0.7fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
}

.users-row.header {
  min-height: auto;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.users-row em {
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
  color: #fff;
}

.hero-copy h2 {
  max-width: 720px;
  margin-top: 18px;
  font-size: 42px;
}

.hero-copy p {
  max-width: 680px;
  margin: 18px 0 0;
  color: #d4e2e5;
  font-size: 17px;
  line-height: 1.55;
}

.dashboard-hero img {
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
  object-position: center;
}

.status-pill,
.card-topline span,
.case-card span,
.video-body span {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill {
  color: #17323e;
  background: #d9ece8;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.panel,
.video-card,
.case-card,
.source-panel,
.intro-band,
.doc-card,
.checklist-panel,
.decision-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(24, 33, 42, 0.05);
}

.info-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 18px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.card-topline span {
  color: #17323e;
  background: #e5f1ef;
}

.card-topline time {
  color: var(--muted);
  font-size: 13px;
}

.info-card h3,
.video-body h3,
.case-card h3,
.decision-grid h3 {
  margin: 0;
  line-height: 1.2;
}

.info-card p,
.video-body p,
.case-card p,
.source-item p,
.intro-band p,
.decision-grid p {
  color: var(--muted);
  line-height: 1.55;
}

.info-card p {
  flex: 1;
}

.text-link {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.chart-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.section-heading h2,
.intro-band h2,
.holding-header h2,
.checklist-summary h2 {
  font-size: 26px;
}

.section-heading.compact {
  display: block;
  margin-bottom: 18px;
}

.filter-grid {
  display: grid;
  gap: 12px;
}

.filter-grid label,
.type-filters legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.filter-grid input {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
}

.type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  border: 0;
}

.type-filters legend {
  width: 100%;
  margin-bottom: 2px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--input-bg);
  cursor: pointer;
}

.check-pill input {
  accent-color: var(--teal);
}

.source-warning {
  margin: 0 0 14px;
  padding: 12px;
  border-left: 4px solid var(--gold);
  background: #fff7e5;
  color: #6b5522;
  line-height: 1.45;
}

.chart-panel {
  min-width: 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--teal-dark);
  font-size: 26px;
}

.chart-mount {
  width: 100%;
  min-height: 330px;
  overflow-x: auto;
}

.bar-chart {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}

.grid-line {
  stroke: #e5e3dc;
  stroke-width: 1;
}

.axis-line {
  stroke: #c8d0ca;
  stroke-width: 1.5;
}

.axis-label,
.bar-value,
.legend text,
.empty-chart {
  fill: #5d6871;
  font-size: 13px;
}

.bar-value {
  fill: var(--ink);
  font-weight: 800;
}

.type-axis {
  font-weight: 800;
}

.legend text {
  font-weight: 800;
}

.video-card {
  overflow: hidden;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #14242f;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-body {
  padding: 16px;
}

.video-body span {
  margin-bottom: 10px;
  color: #6d4c12;
  background: #fff1d1;
}

.case-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.case-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 16px;
}

.case-card span {
  margin-bottom: 10px;
  color: #27410f;
  background: #e6efdc;
}

.case-card p {
  flex: 1;
}

.source-panel {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.source-item {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.source-item a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.source-item p {
  margin: 8px 0 0;
  font-size: 14px;
}

.monitor-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.monitor-copy p {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.monitor-copy h2 {
  margin: 0;
  line-height: 1.12;
}

.monitor-status {
  display: grid;
  gap: 14px;
}

.monitor-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.monitor-kpis div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
}

.monitor-kpis span,
.network-urls span,
.source-monitor-list article span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.monitor-kpis strong {
  display: block;
  margin-top: 8px;
  color: var(--teal-dark);
  font-size: 18px;
}

.network-urls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.network-urls span {
  width: 100%;
}

.network-urls a {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal);
  background: var(--input-bg);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.source-monitor-list {
  display: grid;
  gap: 8px;
}

.source-monitor-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
}

.source-monitor-list article.changed {
  border-color: var(--gold);
  background: #fff7e5;
}

.source-monitor-list a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  padding: 24px;
  align-items: center;
}

.comparison-table {
  display: grid;
  gap: 8px;
}

.table-header,
.table-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.1fr 1.1fr;
  gap: 12px;
  align-items: start;
}

.table-header {
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.table-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-row strong,
.table-row small {
  display: block;
}

.table-row small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.table-row p {
  margin: 0;
  color: #4f5a62;
  line-height: 1.5;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.decision-grid article {
  padding: 18px;
}

.decision-grid span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.rules-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 22px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 122, 24, 0.18), transparent 32%),
    linear-gradient(135deg, #07131c, #00326f);
  color: #fff;
}

.rules-hero .eyebrow {
  color: #bde5ee;
}

.rules-hero h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.rules-hero p {
  margin: 0;
  color: #d6e7eb;
  line-height: 1.6;
}

.rules-list {
  display: grid;
  gap: 14px;
}

.rule-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(24, 33, 42, 0.05);
}

.rule-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.rule-title span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.rule-title a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rule-grid div {
  min-height: 210px;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.rule-grid div:last-child {
  border-right: 0;
}

.rule-grid strong {
  display: block;
  margin-bottom: 10px;
  color: var(--teal-dark);
}

.rule-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.watchlist-panel {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.watchlist-panel h2 {
  margin: 0;
}

.watchlist-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.holding-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-radius: 8px;
  color: #fff;
}

.holding-header.empresarial {
  background: #1d5f7a;
}

.holding-header.patrimonial {
  background: #5c7c32;
}

.holding-header.familiar {
  background: #9b4d38;
}

.holding-header .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quick-links a {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
}

.quick-links a.active,
.quick-links a:hover {
  background: rgba(255, 255, 255, 0.18);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.timeline-item span,
.doc-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.timeline-item p,
.doc-card p {
  margin: 0;
  color: #3f4a52;
  line-height: 1.58;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.doc-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 118px;
  padding: 16px;
}

.checklist-panel {
  overflow: hidden;
}

.checklist-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.progress-box {
  display: grid;
  place-items: center;
  min-width: 150px;
  min-height: 86px;
  padding: 14px;
  border-radius: 8px;
  background: #e9f1ed;
}

.progress-box strong {
  color: var(--teal-dark);
  font-size: 30px;
}

.progress-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checklist-items {
  display: grid;
}

.check-item {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1.1fr);
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.check-item:last-child {
  border-bottom: 0;
}

.task-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  font-weight: 800;
  line-height: 1.4;
}

.task-line input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
  accent-color: var(--olive);
}

.check-item textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  line-height: 1.45;
}

.app-footer {
  padding: 18px 34px 26px;
  color: var(--muted);
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.app-footer strong {
  color: var(--ink);
}

[data-theme="dark"] .dashboard-hero {
  background: #0b1820;
}

[data-theme="dark"] .info-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .video-card,
[data-theme="dark"] .case-card,
[data-theme="dark"] .source-panel,
[data-theme="dark"] .intro-band,
[data-theme="dark"] .doc-card,
[data-theme="dark"] .checklist-panel,
[data-theme="dark"] .decision-grid article,
[data-theme="dark"] .table-row,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .source-monitor-list article,
[data-theme="dark"] .monitor-kpis div,
[data-theme="dark"] .network-urls a {
  background: var(--panel);
}

[data-theme="dark"] .source-warning,
[data-theme="dark"] .source-monitor-list article.changed {
  color: #f3dca2;
  background: #32280f;
}

[data-theme="dark"] .filter-grid input,
[data-theme="dark"] .check-item textarea,
[data-theme="dark"] .check-pill {
  border-color: var(--line);
  background: var(--input-bg);
  color: var(--ink);
}

[data-theme="dark"] .bar-chart rect:first-child {
  fill: var(--chart-bg);
}

@media (max-width: 1180px) {
  .grid.three,
  .case-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-layout,
  .source-panel,
  .monitor-panel,
  .watchlist-panel,
  .login-screen,
  .users-layout {
    grid-template-columns: 1fr;
  }

  .rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rule-grid div:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-group {
    border-top: 0;
    padding-top: 0;
  }

  .side-note {
    display: none;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    padding: 18px 20px;
  }

  .content {
    padding: 20px;
  }

  .dashboard-hero,
  .intro-band,
  .holding-header,
  .rules-hero,
  .table-header,
  .table-row,
  .check-item {
    grid-template-columns: 1fr;
  }

  .dashboard-hero img {
    min-height: 210px;
    max-height: 280px;
  }

  .login-visual,
  .login-card {
    min-height: auto;
  }

  .users-row {
    grid-template-columns: 1fr;
  }

  .users-row.header {
    display: none;
  }

  .hero-copy h2 {
    font-size: 34px;
  }

  .table-header {
    display: none;
  }

  .table-row {
    gap: 14px;
  }

  .quick-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar {
    display: grid;
  }

  .topbar h1 {
    font-size: 24px;
  }

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

  .top-actions > button {
    flex: 1;
  }

  .theme-switcher,
  .user-badge {
    width: 100%;
    justify-content: center;
  }

  .install-prompt {
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: grid;
  }

  .main-nav,
  .grid.three,
  .grid.two,
  .metric-row,
  .monitor-kpis,
  .case-list,
  .source-list,
  .decision-grid,
  .doc-grid,
  .rule-grid {
    grid-template-columns: 1fr;
  }

  .rule-grid div {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rule-grid div:last-child {
    border-bottom: 0;
  }

  .hero-copy {
    padding: 24px;
  }

  .hero-copy h2 {
    font-size: 28px;
  }

  .hero-copy p {
    font-size: 15px;
  }

  .section-heading {
    display: block;
  }

  .section-heading h2,
  .intro-band h2,
  .holding-header h2,
  .checklist-summary h2 {
    font-size: 23px;
  }

  .checklist-summary {
    display: grid;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-text {
    display: inline;
  }

  body.sidebar-collapsed .nav-short {
    display: none;
  }
}

@media print {
  .sidebar,
  .top-actions {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .topbar {
    position: static;
    padding: 0 0 18px;
    background: #fff;
  }

  .content {
    padding: 0;
  }

  .info-card,
  .panel,
  .video-card,
  .case-card,
  .source-panel,
  .intro-band,
  .doc-card,
  .checklist-panel,
  .decision-grid article,
  .table-row {
    box-shadow: none;
  }
}
