@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  --blue-950: #071d35;
  --blue-900: #0b2b4c;
  --blue-800: #15456d;
  --blue-700: #1d5d89;
  --blue-600: #2a72a8;
  --blue-100: #e8f1f8;
  --green-700: #0f7441;
  --green-600: #169653;
  --green-100: #e6f6ee;
  --yellow-500: #f4c542;
  --yellow-100: #fff6d8;
  --gray-950: #1f2933;
  --gray-700: #425466;
  --gray-500: #6b7b8c;
  --gray-300: #d9e2ec;
  --gray-200: #e8eef5;
  --gray-100: #f4f7fb;
  --gray-50: #f8fafc;
  --white: #ffffff;
  --red: #d93025;
  --orange: #ef7d22;
  --risk-yellow: #d99a00;
  --risk-blue: #276ef1;
  --shadow: 0 20px 48px rgba(9, 35, 63, 0.14);
  --shadow-soft: 0 8px 22px rgba(9, 35, 63, 0.07);
  --shadow-lift: 0 14px 30px rgba(9, 35, 63, 0.16);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar-width: 296px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--gray-950);
  font-family: "Inter", "Segoe UI", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 480px at 100% -10%, rgba(29, 93, 137, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(232, 241, 248, 0.72), rgba(244, 247, 251, 0.9) 280px),
    var(--gray-100);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--gray-300);
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 22px 18px;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(22, 70, 111, 0.52), transparent 42%),
    var(--blue-950);
  box-shadow: 12px 0 30px rgba(7, 29, 53, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  color: var(--white);
  /* Identidade GSI ONE: gradiente oficial de marca (azul petróleo -> verde-água). */
  background: var(--gsi-gradiente-marca, linear-gradient(135deg, var(--white), #dcecf7));
  font-weight: 800;
  box-shadow: inset 0 -6px 14px rgba(9, 35, 63, 0.08);
}

.brand strong,
.brand small,
.user-card strong,
.user-card small {
  display: block;
}

.brand small,
.user-card small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  line-height: 1.35;
}

.user-card {
  gap: 9px;
  padding: 10px 12px;
}

.user-card .avatar {
  width: 32px;
  height: 32px;
  font-size: 0.72rem;
}

.user-card strong {
  font-size: 0.86rem;
  line-height: 1.25;
}

.user-card small {
  font-size: 0.68rem;
  line-height: 1.3;
}

.sidebar-status {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-status span,
.sidebar-status strong {
  display: block;
}

.sidebar-status span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-status strong {
  color: var(--white);
  font-size: 0.9rem;
}

.side-nav {
  display: grid;
  gap: 5px;
  margin: 16px 0 20px;
  overflow-y: auto;
  padding-right: 4px;
}

.side-nav button {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  background: transparent;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}

.side-nav button:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.side-nav button.is-active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: inset 3px 0 0 var(--yellow-500);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--yellow-500);
  font-size: 0.76rem;
  font-weight: 800;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  padding: 15px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--white);
  background: var(--green-600);
  font-size: 0.9rem;
  font-weight: 800;
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding: 15px 30px;
  border-bottom: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 22px rgba(9, 35, 63, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.institutional-emblem {
  flex: 0 0 auto;
  height: 60px;
  width: auto;
  object-fit: contain;
}

.greeting span,
.field span,
.topbar label span {
  display: block;
  color: var(--gray-500);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.greeting strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-950);
  font-size: 1.04rem;
}

.greeting small {
  display: block;
  margin-top: 3px;
  color: var(--gray-500);
}

.topbar-controls {
  display: flex;
  align-items: end;
  gap: 12px;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  color: var(--gray-950);
  background: var(--white);
  box-shadow: inset 0 1px 0 rgba(9, 35, 63, 0.02);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

select:focus,
input:focus,
textarea:focus {
  outline: 0;
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px rgba(29, 93, 137, 0.13);
}

select,
input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 106px;
  padding: 12px;
  resize: vertical;
}

.topbar label {
  min-width: 190px;
}

.topbar select {
  margin-top: 6px;
  max-width: 280px;
}

.notification-button,
.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
}

.notification-button small {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  border: 2px solid var(--white);
  border-radius: 999px;
  color: var(--blue-950);
  background: var(--yellow-500);
  font-size: 0.68rem;
  font-weight: 800;
}

.user-menu-wrap {
  position: relative;
}

.user-menu-wrap .avatar {
  border: 0;
  padding: 0;
  font: inherit;
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 280px;
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-lift);
}

.user-menu-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}

.user-menu-head strong {
  display: block;
  color: var(--blue-950);
  font-size: 0.92rem;
}

.user-menu-head small {
  display: block;
  margin-top: 3px;
  color: var(--gray-500);
  font-size: 0.76rem;
  line-height: 1.35;
}

.user-menu-block {
  margin-bottom: 10px;
}

.user-menu-block span {
  display: block;
  color: var(--gray-500);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-menu-block p {
  margin: 3px 0 0;
  color: var(--gray-700);
  font-size: 0.84rem;
}

.user-menu-select {
  display: block;
  margin-bottom: 12px;
}

.user-menu-select span {
  display: block;
  margin-bottom: 5px;
  color: var(--gray-500);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-menu-actions {
  display: grid;
  gap: 8px;
}

.user-menu-actions .secondary-action {
  width: 100%;
}

.bell {
  width: 16px;
  height: 18px;
  border: 2px solid var(--blue-900);
  border-bottom: 0;
  border-radius: 11px 11px 4px 4px;
}

.bell::after {
  content: "";
  display: block;
  width: 7px;
  height: 3px;
  margin: 17px auto 0;
  border-radius: 999px;
  background: var(--blue-900);
}

.mobile-menu {
  display: none;
}

.mobile-menu span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 2px 0;
  background: var(--blue-950);
}

.content {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 30px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 4px 0 2px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green-700);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: var(--yellow-500);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  color: var(--blue-950);
  font-size: clamp(1.55rem, 2.2vw, 2.08rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.page-head p,
.muted {
  color: var(--gray-500);
  line-height: 1.55;
}

.page-head p {
  max-width: 780px;
  margin-bottom: 0;
  font-size: 0.94rem;
}

.action-button,
.secondary-action,
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease), border-color 0.16s var(--ease);
}

.action-button {
  border: 0;
  padding: 0 15px;
  color: var(--white);
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  box-shadow: 0 12px 20px rgba(22, 150, 83, 0.23);
}

.action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(22, 150, 83, 0.3);
}

.action-button:active {
  transform: translateY(0);
}

.secondary-action,
.table-action {
  border: 1px solid var(--gray-300);
  padding: 0 10px;
  color: var(--blue-900);
  background: var(--white);
}

.secondary-action:hover,
.table-action:hover {
  border-color: var(--blue-700);
  background: var(--blue-100);
  transform: translateY(-1px);
}

.table-action {
  min-height: 30px;
  font-size: 0.72rem;
  font-weight: 750;
}

.table-action.danger {
  color: var(--red);
  border-color: #f3c7c3;
}

.queue-actions {
  gap: 8px;
}

.queue-action {
  min-width: 132px;
  min-height: 32px;
  padding: 0 12px;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
}

.queue-action-highlight {
  min-width: 132px;
}

.queue-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 8px;
}

.queue-actions-grid .queue-action {
  width: 100%;
}

.queue-action-primary {
  color: var(--white);
  background: var(--blue-700);
  border-color: var(--blue-700);
}

.queue-action-primary:hover {
  background: var(--blue-800);
  border-color: var(--blue-800);
  color: var(--white);
}

.queue-action-muted {
  color: var(--gray-500);
  background: var(--gray-50);
  border-color: var(--gray-200);
}

.queue-action-muted:hover {
  color: var(--blue-900);
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.queue-panel {
  position: relative;
  padding-left: 20px;
  border-left: 4px solid transparent;
}

.queue-panel-waiting {
  border-left-color: var(--blue-700);
}

.queue-panel-active {
  border-left-color: var(--green-600);
}

.queue-panel-critical {
  border-left-color: var(--red);
}

.queue-panel-critical .queue-table {
  direction: ltr;
}

.queue-panel-critical .queue-table table {
  min-width: 720px;
  table-layout: auto;
  direction: ltr;
}

.queue-panel-critical .queue-table th {
  white-space: nowrap;
}

.queue-panel-critical .queue-table td {
  white-space: normal;
}

.queue-panel-critical .queue-table th:nth-child(1),
.queue-panel-critical .queue-table td:nth-child(1) {
  min-width: 120px;
}

.queue-panel-critical .queue-table th:nth-child(2),
.queue-panel-critical .queue-table td:nth-child(2) {
  min-width: 90px;
}

.queue-panel-critical .queue-table th:nth-child(3),
.queue-panel-critical .queue-table td:nth-child(3) {
  min-width: 190px;
}

.queue-panel-critical .queue-table th:nth-child(4),
.queue-panel-critical .queue-table td:nth-child(4) {
  min-width: 110px;
  white-space: normal;
}

.queue-panel-critical .queue-table th:nth-child(5),
.queue-panel-critical .queue-table td:nth-child(5) {
  min-width: 150px;
}

.queue-panel-critical .queue-table th:nth-child(6),
.queue-panel-critical .queue-table td:nth-child(6) {
  min-width: 150px;
}

.checklist-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.checklist-summary {
  display: grid;
  gap: 8px;
}

.checklist-summary-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
}

.checklist-summary-item strong {
  color: var(--blue-950);
  font-size: 1.25rem;
  line-height: 1;
}

.checklist-summary-item span {
  color: var(--gray-700);
  font-size: 0.78rem;
}

.checklist-summary-item.completo strong {
  color: var(--green-700);
}

.checklist-summary-item.pendente strong {
  color: var(--gray-500);
}

.queue-panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--gray-700);
  background: var(--gray-100);
  font-size: 0.72rem;
  font-weight: 800;
}

.queue-table th,
.queue-table td {
  padding: 12px 14px;
}

.queue-table th {
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.queue-table td:first-child {
  font-weight: 700;
  color: var(--blue-950);
}

.queue-table tbody tr:hover {
  background: var(--blue-100);
}

.observation-table table {
  min-width: 980px;
  table-layout: auto;
}

.observation-table td {
  white-space: normal;
}

.transfer-table table {
  min-width: 920px;
  table-layout: auto;
}

.transfer-table td {
  white-space: normal;
}

.transfer-stats .metric-card i {
  display: none;
}

.transfer-stats .metric-top {
  justify-content: flex-start;
}

.transfer-table tbody tr:hover {
  background: rgba(232, 241, 248, 0.42);
}

.transfer-table th:nth-child(1),
.transfer-table td:nth-child(1) {
  min-width: 140px;
}

.transfer-table th:nth-child(2),
.transfer-table td:nth-child(2) {
  min-width: 130px;
}

.transfer-table th:nth-child(3),
.transfer-table td:nth-child(3) {
  min-width: 140px;
}

.transfer-table th:nth-child(4),
.transfer-table td:nth-child(4) {
  min-width: 130px;
}

.transfer-table th:nth-child(5),
.transfer-table td:nth-child(5) {
  min-width: 150px;
}

.transfer-table th:nth-child(6),
.transfer-table td:nth-child(6) {
  min-width: 100px;
}

.transfer-table th:nth-child(7),
.transfer-table td:nth-child(7) {
  min-width: 80px;
}

.transfer-table th:nth-child(8),
.transfer-table td:nth-child(8) {
  min-width: 150px;
}

.transfer-overview .panel {
  min-height: 100%;
}

.transfer-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.transfer-flow span {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--blue-900);
  background: var(--blue-100);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.transfer-flow strong {
  display: block;
  color: var(--blue-950);
  font-size: 1.05rem;
  line-height: 1;
}

.transfer-flow small {
  display: block;
  margin-top: 4px;
  color: var(--gray-700);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.transfer-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.transfer-summary p {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
}

.transfer-summary span,
.transfer-destinations span {
  display: block;
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.transfer-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--blue-950);
  font-size: 1.35rem;
  line-height: 1;
}

.transfer-destinations {
  gap: 8px;
}

.transfer-destinations li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.observation-table th:nth-child(1),
.observation-table td:nth-child(1) {
  min-width: 130px;
}

.observation-table th:nth-child(2),
.observation-table td:nth-child(2) {
  min-width: 95px;
}

.observation-table th:nth-child(3),
.observation-table td:nth-child(3) {
  min-width: 140px;
}

.observation-table th:nth-child(4),
.observation-table td:nth-child(4) {
  min-width: 90px;
}

.observation-table th:nth-child(5),
.observation-table td:nth-child(5) {
  min-width: 130px;
}

.observation-table th:nth-child(6),
.observation-table td:nth-child(6) {
  min-width: 100px;
}

.observation-table th:nth-child(7),
.observation-table td:nth-child(7) {
  min-width: 130px;
}

.observation-table th:nth-child(8),
.observation-table td:nth-child(8) {
  min-width: 140px;
}

.observation-table th:nth-child(9),
.observation-table td:nth-child(9) {
  min-width: 150px;
}

.patients-table table {
  min-width: 980px;
  table-layout: auto;
}

.patients-table td {
  white-space: normal;
}

.patients-table th:nth-child(1),
.patients-table td:nth-child(1) {
  min-width: 140px;
}

.patients-table th:nth-child(2),
.patients-table td:nth-child(2) {
  min-width: 95px;
}

.patients-table th:nth-child(3),
.patients-table td:nth-child(3) {
  min-width: 130px;
}

.patients-table th:nth-child(4),
.patients-table td:nth-child(4) {
  min-width: 110px;
}

.patients-table th:nth-child(5),
.patients-table td:nth-child(5) {
  min-width: 130px;
}

.patients-table th:nth-child(6),
.patients-table td:nth-child(6) {
  min-width: 100px;
}

.patients-table th:nth-child(7),
.patients-table td:nth-child(7) {
  min-width: 110px;
}

.patients-table th:nth-child(8),
.patients-table td:nth-child(8) {
  min-width: 140px;
}

.patients-table th:nth-child(9),
.patients-table td:nth-child(9) {
  min-width: 150px;
}

.care-table table {
  min-width: 860px;
  table-layout: auto;
}

.care-table td {
  white-space: normal;
}

.care-table th:nth-child(1),
.care-table td:nth-child(1) {
  min-width: 160px;
}

.care-table th:nth-child(2),
.care-table td:nth-child(2) {
  min-width: 90px;
}

.care-table th:nth-child(3),
.care-table td:nth-child(3) {
  min-width: 90px;
}

.care-table th:nth-child(4),
.care-table td:nth-child(4) {
  min-width: 150px;
}

.care-table th:nth-child(5),
.care-table td:nth-child(5) {
  min-width: 110px;
}

.care-table th:nth-child(6),
.care-table td:nth-child(6) {
  min-width: 110px;
}

.care-table th:nth-child(7),
.care-table td:nth-child(7) {
  min-width: 150px;
}

.record-block {
  margin-bottom: 16px;
}

.record-block:last-child {
  margin-bottom: 0;
}

.record-block h3 {
  margin-bottom: 8px;
  color: var(--blue-700);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-action.danger:hover {
  background: #fde8e6;
  border-color: var(--red);
}

.grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.grid > * {
  min-width: 0;
}

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

.dashboard-row-label {
  margin: 16px 0 8px;
  color: var(--gray-500);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-row-label:first-of-type {
  margin-top: 18px;
}

.module-stats {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.exam-stats {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.two-column {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
}

.three-column {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.metric-card,
.panel {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 14px 15px;
}

.metric-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green-600);
}

.metric-card.primary::before {
  background: var(--blue-700);
}

.metric-card.danger::before {
  background: var(--red);
}

.metric-card.warning::before {
  background: var(--yellow-500);
}

.metric-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.metric-card small {
  color: var(--gray-500);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.3;
}

.metric-card i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  color: var(--blue-900);
  background: var(--blue-100);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin-top: 11px;
  color: var(--blue-950);
  font-size: 1.55rem;
  line-height: 1;
}

.metric-card span {
  display: inline-flex;
  margin-top: 9px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 0.7rem;
  font-weight: 800;
}

.panel {
  padding: 16px;
}

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

.section-gap {
  margin-top: 14px;
}

.panel h2,
.panel h3 {
  margin-bottom: 10px;
  color: var(--blue-950);
  font-size: 1rem;
  line-height: 1.25;
}

.executive-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid rgba(29, 93, 137, 0.18);
  border-radius: var(--radius);
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(7, 29, 53, 0.96), rgba(21, 69, 109, 0.95)),
    var(--blue-950);
  box-shadow: var(--shadow);
  min-width: 0;
}

.executive-hero > * {
  min-width: 0;
}

.executive-hero .eyebrow {
  color: #bfe7d2;
}

.executive-hero h2 {
  margin: 8px 0;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.12;
}

.executive-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  min-width: 0;
}

.hero-kpis article {
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
}

.hero-kpis small,
.hero-kpis strong {
  display: block;
}

.hero-kpis small {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}

.hero-kpis strong {
  margin-top: 8px;
  font-size: 1.55rem;
  line-height: 1;
}

.risk-bars {
  display: grid;
  gap: 9px;
}

.risk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px 10px;
  font-size: 0.86rem;
}

.risk-row strong {
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.risk-row .bar-track {
  grid-column: 1 / -1;
  min-width: 0;
}

.risk-row span {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}

.obs-bars {
  display: grid;
  gap: 10px;
}

.obs-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px 10px;
}

.obs-bar-row strong {
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.25;
  font-weight: 750;
  overflow-wrap: anywhere;
  white-space: normal;
}

.obs-bar-row span {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}

.obs-bar-row .bar-track {
  grid-column: 1 / -1;
  min-width: 0;
}

@media (max-width: 980px) {
  .obs-bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 720px) {
  .risk-row,
  .obs-bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
  }

  .risk-row:last-child,
  .obs-bar-row:last-child {
    border-bottom: 0;
  }
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gray-200);
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  padding: 9px 11px;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--green-600);
  border-radius: var(--radius);
  background: var(--gray-50);
  color: var(--gray-700);
}

.alert-list li {
  border-left-color: var(--yellow-500);
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.module-tabs button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  color: var(--blue-900);
  background: var(--gray-50);
  font-size: 0.84rem;
  font-weight: 800;
}

.module-tabs button.is-active {
  color: var(--white);
  border-color: var(--blue-900);
  background: var(--blue-900);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.search-box {
  max-width: 360px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--blue-900);
  background: #f0f6fb;
  font-size: 0.69rem;
  text-transform: uppercase;
}

td {
  color: var(--gray-700);
  font-size: 0.84rem;
}

.municipio-origin-panel .table-wrap {
  overflow-x: visible;
}

.municipio-origin-panel table {
  min-width: 0;
  table-layout: fixed;
}

.municipio-origin-panel th,
.municipio-origin-panel td {
  padding: 9px 8px;
  font-size: 0.78rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.municipio-origin-panel th:nth-child(1),
.municipio-origin-panel td:nth-child(1) {
  width: 34%;
}

.municipio-origin-panel th:nth-child(2),
.municipio-origin-panel td:nth-child(2) {
  width: 9%;
}

.municipio-origin-panel th:nth-child(3),
.municipio-origin-panel td:nth-child(3) {
  width: 14%;
}

.municipio-origin-panel th:nth-child(4),
.municipio-origin-panel td:nth-child(4) {
  width: 16%;
}

.municipio-origin-panel th:nth-child(5),
.municipio-origin-panel td:nth-child(5) {
  width: 27%;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: var(--gray-50);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.tag.red,
.bar-red {
  background: var(--red);
}

.tag.orange,
.bar-orange {
  background: var(--orange);
}

.tag.yellow,
.bar-yellow {
  background: var(--risk-yellow);
}

.tag.green,
.bar-green {
  background: var(--green-600);
}

.tag.blue,
.bar-blue {
  background: var(--risk-blue);
}

.risk-card.red {
  background: var(--red);
}

.risk-card.orange {
  background: var(--orange);
}

.risk-card.yellow {
  background: var(--risk-yellow);
}

.risk-card.green {
  background: var(--green-600);
}

.risk-card.blue {
  background: var(--risk-blue);
}

.status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue-900);
  background: var(--blue-100);
  font-size: 0.68rem;
  font-weight: 800;
}

.status.compact {
  padding: 3px 7px;
  font-size: 0.62rem;
  white-space: nowrap;
}

.status.warn {
  color: #7a5200;
  background: var(--yellow-100);
}

.status.good {
  color: var(--green-700);
  background: var(--green-100);
}

.status.danger {
  color: #9d2119;
  background: #fde8e6;
}

.risk-scale {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.risk-card {
  padding: 14px;
  border-radius: var(--radius);
  color: var(--white);
  min-height: 118px;
  box-shadow: var(--shadow-soft);
}

.risk-card h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.risk-card p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.35;
  font-size: 0.86rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field input[readonly] {
  color: var(--blue-950);
  background: var(--gray-50);
  font-weight: 800;
}

.triage-guidance {
  margin-bottom: 14px;
  border-left: 4px solid var(--blue-700);
  background: linear-gradient(90deg, rgba(29, 93, 137, 0.08), rgba(255, 255, 255, 0.96));
}

.triage-guidance .eyebrow {
  display: block;
  margin-bottom: 6px;
}

.record-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 14px;
}

.patient-summary {
  padding: 15px;
  border-left: 5px solid var(--green-600);
}

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

.timeline article {
  padding: 11px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
}

.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
  font-size: 0.82rem;
  line-height: 1.3;
}

.checklist input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.report-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.report-card {
  display: grid;
  gap: 9px;
  min-height: 122px;
  padding: 15px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.report-card strong {
  color: var(--blue-950);
}

.report-card button {
  align-self: end;
  justify-self: start;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.modal-root {
  display: none;
}

.modal-root.is-open {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  animation: fadeIn 0.16s ease;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 29, 53, 0.56);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 28px 80px rgba(7, 29, 53, 0.26);
  animation: modalIn 0.2s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-card.wide {
  width: min(920px, 100%);
}

.modal-card pre {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--gray-700);
  font-family: "Inter", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
}

.switch input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--gray-300);
  transition: background 0.18s ease;
}

.switch span::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 4px rgba(9, 35, 63, 0.25);
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: var(--green-600);
}

.switch input:checked + span::before {
  transform: translateX(20px);
}

.modal-head,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-head h2 {
  margin: 0;
  color: var(--blue-950);
  font-size: 1.2rem;
}

.modal-body {
  padding: 18px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--gray-200);
  border-bottom: 0;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 13px 15px;
  border-left: 4px solid var(--green-600);
  border-radius: var(--radius);
  color: var(--blue-950);
  background: var(--white);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.warn {
  border-left-color: var(--yellow-500);
}

.risk-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.risk-choice {
  min-height: 86px;
  border: 0;
  border-radius: var(--radius);
  color: var(--white);
  font-weight: 900;
}

.risk-choice.red {
  background: var(--red);
}

.risk-choice.orange {
  background: var(--orange);
}

.risk-choice.yellow {
  background: var(--risk-yellow);
}

.risk-choice.green {
  background: var(--green-600);
}

.risk-choice.blue {
  background: var(--risk-blue);
}

.call-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 24px;
  border-radius: var(--radius);
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-950), var(--blue-700));
  box-shadow: var(--shadow);
}

.call-panel span,
.call-panel p,
.call-panel time {
  color: rgba(255, 255, 255, 0.78);
}

.call-panel strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(1.7rem, 4vw, 3.4rem);
  line-height: 1;
}

.call-panel p {
  margin: 0;
  font-weight: 700;
}

.call-panel time {
  font-size: 1.55rem;
  font-weight: 900;
}

.tv-mode {
  overflow-x: hidden;
  background: #06192d;
}

.tv-mode .sidebar,
.tv-mode .topbar,
.tv-mode .overlay {
  display: none;
}

.tv-mode .main-shell {
  margin-left: 0;
}

.tv-mode .content {
  min-height: 100vh;
  padding: 0;
}

.tv-panel {
  display: grid;
  align-content: center;
  gap: 28px;
  min-height: 100vh;
  padding: 42px;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(29, 93, 137, 0.35), transparent 50%),
    #06192d;
}

.tv-header {
  display: grid;
  gap: 8px;
  text-align: center;
}

.tv-header span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.2rem;
  font-weight: 700;
}

.tv-header strong {
  color: var(--yellow-500);
  font-size: 1.45rem;
}

.tv-header h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  line-height: 1;
}

.tv-audio-control {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.tv-audio-control span,
.tv-audio-control button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.92rem;
  font-weight: 800;
}

.tv-audio-control span {
  padding: 10px 14px;
}

.tv-audio-control span.is-active {
  border-color: rgba(53, 178, 123, 0.6);
  background: rgba(53, 178, 123, 0.22);
}

.tv-audio-control button {
  cursor: pointer;
  padding: 10px 16px;
}

.tv-audio-control button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.tv-audio-message {
  max-width: 760px;
  margin: 6px auto 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  font-weight: 700;
}

.tv-call-card {
  display: grid;
  gap: 22px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.tv-call-card > span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tv-call-card > strong {
  color: var(--white);
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.95;
}

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

.tv-call-grid p {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 18px;
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  font-size: clamp(1.15rem, 2vw, 1.75rem);
  font-weight: 800;
}

.tv-call-grid small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.tv-status .status {
  font-size: 1.2rem;
}

.tv-recent {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.tv-recent h2 {
  color: var(--white);
  font-size: 1.6rem;
}

.tv-recent-list {
  display: grid;
  gap: 10px;
}

.tv-recent-list article {
  display: grid;
  grid-template-columns: 90px minmax(180px, 1fr) 2fr;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
}

.tv-recent-list time {
  color: var(--yellow-500);
  font-size: 1.35rem;
  font-weight: 900;
}

.tv-recent-list strong {
  color: var(--white);
  font-size: 1.25rem;
}

.tv-recent-list span,
.tv-empty {
  color: rgba(255, 255, 255, 0.78);
}

.tv-empty {
  padding: 46px;
  text-align: center;
  font-size: 2rem;
}

@media (max-width: 900px) {
  .tv-panel {
    align-content: start;
    padding: 24px;
  }

  .tv-call-card {
    padding: 26px;
  }

  .tv-call-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tv-recent-list article {
    grid-template-columns: 1fr;
  }
}

.call-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.call-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
}

.call-list span {
  color: var(--gray-500);
}

.report-cover {
  padding: 18px 0 8px;
  border-bottom: 2px solid var(--blue-900);
}

.report-cover p {
  margin: 0 0 6px;
}

.report-org {
  color: var(--blue-950);
  font-size: 1rem;
  font-weight: 900;
}

.report-system,
.report-observatory {
  color: var(--green-700);
  font-weight: 900;
}

.report-cover h2 {
  color: var(--blue-950);
  font-size: 1.75rem;
  line-height: 1.15;
}

.report-place,
.report-demo {
  color: var(--gray-700);
  font-weight: 800;
}

.overlay {
  display: none;
}

@media (max-width: 1240px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .executive-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    transform: translateX(-104%);
    transition: transform 0.22s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-shell {
    margin-left: 0;
  }

  .mobile-menu {
    display: grid;
  }

  .topbar {
    align-items: center;
  }

  .topbar-controls {
    display: none;
  }

  .overlay.is-open {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    background: rgba(9, 35, 63, 0.42);
  }

  .two-column,
  .record-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 14px 12px 22px;
  }

  .topbar {
    padding: 12px;
    gap: 10px;
  }

  .greeting strong {
    font-size: 0.96rem;
  }

  .greeting span,
  .greeting small {
    font-size: 0.72rem;
  }

  .page-head {
    display: block;
  }

  .page-head .action-button {
    margin-top: 10px;
    width: 100%;
  }

  .stats-grid,
  .module-stats,
  .exam-stats,
  .three-column,
  .risk-scale,
  .report-grid,
  .form-grid,
  .checklist,
  .hero-kpis,
  .risk-options,
  .call-panel {
    grid-template-columns: 1fr;
  }

  .executive-hero {
    padding: 16px;
  }

  .metric-card {
    min-height: 104px;
  }

  .table-action {
    width: 100%;
    min-height: 36px;
  }

  .actions {
    display: grid;
  }

  .form-actions,
  .modal-footer,
  .call-list li {
    display: grid;
  }

  .toolbar {
    display: grid;
  }

  .search-box {
    max-width: none;
  }

  h1 {
    font-size: 1.42rem;
  }

  .municipio-origin-panel .table-wrap {
    overflow-x: auto;
  }

  .municipio-origin-panel table {
    min-width: 620px;
  }
}

@page {
  size: A4;
  margin: 12mm 10mm;
}

@media print {
  html,
  body {
    width: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #111827 !important;
    background: #ffffff !important;
    font-size: 9.4pt;
  }

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .sidebar,
  .topbar,
  .overlay,
  .modal-backdrop,
  .modal-head,
  .modal-footer,
  .toast-root,
  button,
  .action-button,
  .secondary-action,
  .table-action {
    display: none !important;
  }

  body.modal-open .app-shell {
    display: none !important;
  }

  .main-shell {
    margin-left: 0 !important;
  }

  .modal-root.is-open {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    display: block !important;
    width: auto !important;
    min-height: auto !important;
    padding: 0 !important;
    animation: none !important;
  }

  .modal-card,
  .modal-card.wide {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    animation: none !important;
    transform: none !important;
  }

  .modal-body {
    display: block !important;
    padding: 0 !important;
  }

  .modal-body > .section-gap:first-child {
    margin-top: 0 !important;
  }

  .modal-body > .section-gap:first-child h2 {
    margin: 1.5mm 0 2.4mm !important;
    color: #071d35 !important;
    font-size: 15pt !important;
    line-height: 1.15 !important;
  }

  .report-cover {
    margin: 0 0 6mm !important;
    padding: 0 0 4mm !important;
    border-bottom: 1.5pt solid #071d35 !important;
    break-after: avoid;
    page-break-after: avoid;
  }

  .report-cover p {
    display: block !important;
    margin: 0 0 1.1mm !important;
    color: #111827 !important;
  }

  .report-org {
    font-size: 11.5pt !important;
    font-weight: 900 !important;
    text-transform: uppercase;
  }

  .report-system,
  .report-observatory {
    font-size: 10pt !important;
    font-weight: 900 !important;
  }

  .report-place,
  .report-demo,
  .report-cover .muted {
    font-size: 8.8pt !important;
    font-weight: 700 !important;
  }

  .panel,
  .card,
  .metric-card,
  .report-card {
    margin: 0 0 5.5mm !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  body.modal-open .modal-root.is-open .modal-card .modal-body .panel,
  body.modal-open .modal-root.is-open .modal-card .modal-body .card,
  body.modal-open .modal-root.is-open .modal-card .modal-body .metric-card,
  body.modal-open .modal-root.is-open .modal-card .modal-body .report-card {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    filter: none !important;
  }

  .modal-body > .panel,
  .modal-body > section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  h1,
  h2,
  h3,
  h4 {
    color: #071d35 !important;
    break-after: avoid;
    page-break-after: avoid;
  }

  h3 {
    margin: 0 0 2.2mm !important;
    padding-top: 0.6mm;
    font-size: 11.2pt !important;
  }

  h4 {
    margin: 3.5mm 0 1.5mm !important;
    font-size: 9.6pt !important;
  }

  p,
  li,
  td,
  th {
    color: #1f2933 !important;
    line-height: 1.35 !important;
  }

  .muted {
    color: #374151 !important;
  }

  .form-grid,
  .grid,
  .module-stats,
  .stats-grid,
  .two-column,
  .three-column {
    display: block !important;
  }

  .field {
    display: block !important;
    margin: 0 0 1.8mm !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .field span {
    display: inline !important;
    color: #111827 !important;
    font-size: 8.4pt !important;
    font-weight: 800 !important;
    text-transform: none !important;
  }

  .field span::after {
    content: ": ";
  }

  .list,
  .alert-list {
    display: block !important;
    margin: 0 0 3mm !important;
    padding-left: 5mm !important;
  }

  .list li,
  .alert-list li {
    display: list-item !important;
    margin: 0 0 1.3mm !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .table-wrap {
    width: 100% !important;
    margin: 1.6mm 0 4mm !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    break-inside: auto;
    page-break-inside: auto;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  th,
  td {
    padding: 1.7mm 1.4mm !important;
    border: 1px solid #d1d5db !important;
    font-size: 7.5pt !important;
    vertical-align: top !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  th {
    color: #071d35 !important;
    background: #eef2f7 !important;
    font-weight: 800 !important;
  }

  .status,
  .tag {
    display: inline !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: #111827 !important;
    background: transparent !important;
    font-size: inherit !important;
    font-weight: 800 !important;
  }
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(244, 197, 66, 0.5);
  border-radius: 999px;
  color: var(--yellow-500);
  background: rgba(244, 197, 66, 0.12);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow-500);
}

@media print {
  body.modal-open .modal-body .panel,
  body.modal-open .modal-body .card,
  body.modal-open .modal-body .metric-card,
  body.modal-open .modal-body .report-card,
  body.modal-open .modal-body .table-wrap {
    box-shadow: 0 0 0 0 transparent !important;
    -webkit-box-shadow: 0 0 0 0 transparent !important;
  }
}
