:root {
  color-scheme: light;
  --nav: #062f56;
  --nav-dark: #042746;
  --nav-active: #1164cf;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #0f172a;
  --muted: #5d6b82;
  --line: #dce3ee;
  --blue: #1467df;
  --green: #18a957;
  --orange: #f59e0b;
  --purple: #6753d8;
  --teal: #22b8a7;
  --red: #ef4444;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  --sidebar-expanded: 280px;
  --sidebar-collapsed: 86px;
  --list-view-height: calc(100vh - 102px);
  --patient-list-rows-height: calc(100vh - 292px);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-expanded) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.24s ease;
}

.app.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: visible;
  background: linear-gradient(180deg, var(--nav), var(--nav-dark));
  color: #ffffff;
  padding: 22px 14px;
  transition: padding 0.24s ease, transform 0.24s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 10px;
  padding: 0 8px;
}

.brand-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #cfe2ff;
}

.brand strong {
  font-size: 0.96rem;
  font-weight: 700;
}

.brand-icon svg,
.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

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

.side-nav p {
  margin: 18px 6px 6px;
  color: #c4d8ee;
  font-size: 0.76rem;
  font-weight: 650;
  text-transform: uppercase;
}

.side-nav a,
.nav-section-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-radius: 8px;
  background: transparent;
  color: #f5f9ff;
  font-weight: 600;
  padding: 0 12px;
  text-align: left;
}

.nav-section-toggle {
  width: 100%;
  color: #c4d8ee;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-parent {
  justify-content: flex-start;
}

.nav-text {
  flex: 1 1 auto;
}

.nav-chevron {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 900;
  transition: transform 0.18s ease;
}

.nav-submenu {
  display: none;
  gap: 4px;
  padding-left: 0;
}

.nav-group.expanded .nav-submenu {
  display: grid;
}

.nav-group:not(.expanded) .nav-chevron {
  transform: rotate(-90deg);
}

.nav-submenu a {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 0.94rem;
}

.nav-submenu-main a {
  min-height: 46px;
}

.side-nav a:hover,
.side-nav a:focus-visible,
.side-nav a.active,
.nav-section-toggle:hover,
.nav-section-toggle:focus-visible,
.nav-section-toggle.active {
  background: var(--nav-active);
  color: #ffffff;
  outline: 0;
}

.side-nav .nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  color: #d8e8ff;
}

.side-nav a:hover .nav-icon,
.side-nav a:focus-visible .nav-icon,
.side-nav a.active .nav-icon,
.nav-section-toggle:hover .nav-icon,
.nav-section-toggle:focus-visible .nav-icon,
.nav-section-toggle.active .nav-icon {
  color: #ffffff;
}

.collapse-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin: 0 6px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 0 12px;
}

.collapse-button:hover,
.collapse-button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: 2px solid rgba(255, 255, 255, 0.34);
  outline-offset: 2px;
}

.collapse-icon {
  display: inline-grid;
  width: 20px;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 900;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(15, 23, 42, 0.36);
}

.app.sidebar-collapsed .sidebar {
  padding-inline: 12px;
}

.app.sidebar-collapsed .brand {
  justify-content: center;
  padding-inline: 0;
}

.app.sidebar-collapsed .brand strong,
.app.sidebar-collapsed .side-nav p,
.app.sidebar-collapsed .nav-text,
.app.sidebar-collapsed .nav-chevron,
.app.sidebar-collapsed .nav-submenu {
  display: none;
}

.app.sidebar-collapsed .collapse-button {
  justify-content: center;
  margin-inline: 0;
  padding-inline: 0;
}

.app.sidebar-collapsed .collapse-text {
  display: none;
}

.app.sidebar-collapsed .collapse-button:hover::after,
.app.sidebar-collapsed .collapse-button:focus-visible::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 50;
  transform: translateY(-50%);
  white-space: nowrap;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1;
  padding: 9px 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.app.sidebar-collapsed .side-nav p + a {
  margin-top: 10px;
}

.app.sidebar-collapsed .side-nav a,
.app.sidebar-collapsed .nav-section-toggle {
  justify-content: center;
  gap: 0;
  padding-inline: 0;
  font-size: 0;
}

.app.sidebar-collapsed .side-nav .nav-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.app.sidebar-collapsed .side-nav a:hover::after,
.app.sidebar-collapsed .side-nav a:focus-visible::after,
.app.sidebar-collapsed .nav-section-toggle:hover::after,
.app.sidebar-collapsed .nav-section-toggle:focus-visible::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 50;
  transform: translateY(-50%);
  white-space: nowrap;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1;
  padding: 9px 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.main {
  min-width: 0;
  padding-bottom: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 0 24px;
  backdrop-filter: blur(14px);
}

.menu-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
}

@media (min-width: 761px) {
  .topbar {
    justify-content: flex-end;
  }

  .menu-button {
    display: none;
  }
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.notification {
  position: relative;
  width: 40px;
  height: 40px;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.notification span {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 0.7rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #6d5df0 0 22%, #ece9ff 23% 48%, #6d5df0 49% 100%);
}

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

.user-chip small {
  color: var(--muted);
}

.dashboard-head,
.kpi-grid,
.dashboard-grid,
.statistics-dashboard,
.patient-module,
footer {
  width: min(1280px, calc(100% - 48px));
  margin-inline: auto;
}

.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 18px;
}

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

h1 {
  margin-bottom: 6px;
  font-size: 1.55rem;
  font-weight: 700;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.dashboard-head small {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-head p,
.module-header p,
.empty-detail p {
  margin-bottom: 0;
  color: var(--muted);
}

.date-filter,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #1d2939;
  font-weight: 800;
  padding: 0 14px;
  box-shadow: var(--shadow);
}

.status-pill.ready {
  color: var(--green);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card,
.panel,
.patient-module,
.patient-list,
.patient-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  min-height: 126px;
  align-items: center;
  padding: 16px;
}

.kpi-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 900;
}

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

.green {
  background: var(--green);
}

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

.purple {
  background: var(--purple);
}

.teal {
  background: var(--teal);
}

.kpi-card small,
.fact small {
  color: var(--text);
  font-weight: 800;
}

.kpi-card strong {
  display: block;
  margin: 8px 0 12px;
  font-size: 2rem;
  line-height: 1;
}

.kpi-card a,
.link-button {
  background: transparent;
  color: #075dc8;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0;
}

.upcoming-controls,
.consultation-controls,
.message-controls,
.admission-controls,
.patient-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upcoming-controls select,
.consultation-controls select,
.message-controls select,
.admission-controls select,
.patient-controls select,
.custom-period input {
  width: auto;
  min-width: 150px;
  min-height: 34px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 0 10px;
}

.custom-period {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-period input {
  min-width: 74px;
  width: 74px;
}

.custom-period select {
  min-width: 104px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.22fr 1fr;
  gap: 14px;
}

.main:not([data-view="dashboard"]) > .dashboard-head,
.main:not([data-view="dashboard"]) > .kpi-grid {
  display: none;
}

.main:not([data-view="dashboard-estadistico"]) .statistics-dashboard {
  display: none;
}

.main[data-view="dashboard"] .appointments-list-module {
  display: none;
}

.main[data-view="dashboard"] .full-list-module {
  display: none;
}

.main[data-view="citas"] .dashboard-grid > :not(.module-citas),
.main[data-view="consultas"] .dashboard-grid > :not(.module-consultas),
.main[data-view="mensajes"] .dashboard-grid > :not(.module-mensajes),
.main[data-view="pacientes"] .dashboard-grid > :not(.module-pacientes),
.main[data-view="admisiones"] .dashboard-grid > :not(.module-admisiones) {
  display: none;
}

.main:not([data-view="pacientes"]) .patient-module {
  display: none;
}

.main[data-view="citas"] footer,
.main[data-view="consultas"] footer,
.main[data-view="mensajes"] footer,
.main[data-view="admisiones"] footer,
.main[data-view="pacientes"] footer {
  display: none;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel.highlight-target {
  animation: highlightTarget 1.8s ease;
}

@keyframes highlightTarget {
  0%,
  100% {
    box-shadow: var(--shadow);
  }

  18%,
  70% {
    box-shadow: 0 0 0 3px rgba(20, 103, 223, 0.22), var(--shadow);
  }
}

.statistics-dashboard {
  padding: 0 0 18px;
}

.statistics-head {
  width: 100%;
}

.statistics-period {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 620px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 6px;
}

.statistics-period label,
.stat-local-filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.statistics-period select,
.statistics-period input,
.stat-local-filter select,
.stat-local-filter input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  padding: 0 10px;
}

.statistics-period > label {
  display: block;
}

.statistics-period > label select {
  min-width: 170px;
  border: 0;
  background: transparent;
}

.statistics-custom {
  display: flex;
  align-items: end;
  gap: 8px;
}

.statistics-custom.compact {
  margin-top: 6px;
}

.period-summary {
  align-self: end;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid var(--line);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  padding: 0 12px 0 14px;
}

.statistics-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  min-height: 150px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.stat-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
}

.stat-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.stat-card-content {
  display: flex;
  min-width: 0;
  min-height: 118px;
  flex-direction: column;
  align-items: flex-start;
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-weight: 900;
}

.stat-card strong {
  display: block;
  margin: 10px 0;
  font-size: 2rem;
}

.stat-period-label {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.stat-comparison {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.stat-comparison.up .stat-variation {
  color: var(--green);
}

.stat-comparison.down .stat-variation {
  color: var(--red);
}

.stat-comparison.same .stat-variation {
  color: var(--muted);
}

.stat-comparison.reference .stat-variation {
  color: var(--blue);
}

.stat-detail-link {
  margin-top: auto;
}

.statistics-grid {
  display: grid;
  grid-template-columns: 1.22fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.stat-panel {
  overflow: visible;
}

.stat-filter-header {
  gap: 14px;
}

.analysis-title {
  margin: 18px 0 12px;
}

.analysis-title small {
  display: block;
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
}

.bar-chart,
.line-chart,
.stacked-chart,
.stat-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.chart-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.chart-meta strong {
  color: var(--text);
}

.donut-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.donut-chart {
  position: relative;
  display: grid;
  width: 210px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 42px;
  border-radius: inherit;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-chart span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 900;
}

.donut-chart small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chart-legend {
  display: grid;
  gap: 9px;
}

.legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.legend-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row small {
  color: var(--muted);
  font-weight: 900;
}

.legend-dot,
.chart-legend.compact i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.chart-legend.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.chart-legend.compact span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bar-row,
.stack-row {
  display: grid;
  gap: 7px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 0.9rem;
}

.bar-label span {
  color: var(--muted);
  font-weight: 900;
}

.bar-track,
.stack-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3fa;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #39b2df);
}

.stack-track {
  display: flex;
}

.stack-track span {
  display: grid;
  min-width: 24px;
  place-items: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.stack-track .good {
  background: var(--green);
}

.stack-track .bad {
  background: var(--red);
}

.stack-track .warn {
  background: var(--orange);
}

.stack-track .same,
.stack-track span:not(.good):not(.bad):not(.warn) {
  background: #64748b;
}

.line-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.series {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.series.appointments,
.line-bar.appointments {
  background: var(--blue);
}

.series.consultations,
.line-bar.consultations {
  background: var(--green);
}

.line-svg {
  width: 100%;
  min-height: 260px;
}

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

.axis-label,
.x-label {
  fill: #667085;
  font-size: 12px;
  font-weight: 800;
}

.x-label {
  text-anchor: middle;
}

.line-path {
  fill: none;
  stroke-width: 3;
}

.line-path.appointments {
  stroke: var(--blue);
}

.line-path.consultations {
  stroke: var(--green);
}

.line-point {
  fill: currentColor;
  stroke: #fff;
  stroke-width: 2;
}

.line-point.appointments {
  color: var(--blue);
}

.line-point.consultations {
  color: var(--green);
}

.stat-summary {
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--muted);
  font-weight: 800;
}

.stat-summary strong {
  color: var(--text);
}

.stat-summary-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.info-button {
  position: relative;
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  place-items: center;
  border-radius: 50%;
  background: #eaf2ff;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  vertical-align: middle;
}

.info-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 80;
  display: none;
  width: min(280px, 70vw);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  padding: 10px;
  text-align: left;
}

.info-button:hover::after,
.info-button:focus-visible::after,
.info-button.open::after {
  display: block;
}

#proximas,
#consultas-anteriores,
#mensajes-anteriores,
#admisiones-recientes,
#pacientes-nuevos,
#pacientes-recientes {
  display: flex;
  flex-direction: column;
  height: 380px;
  min-height: 0;
}

#proximas .panel-header,
#consultas-anteriores .panel-header,
#mensajes-anteriores .panel-header,
#admisiones-recientes .panel-header,
#pacientes-nuevos .panel-header,
#pacientes-recientes .panel-header {
  flex: 0 0 auto;
}

#upcomingList,
#previousConsultationsList,
#previousMessagesList,
#previousAdmissionsList,
#newPatientsList,
#recentPatientsList {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#upcomingList::-webkit-scrollbar,
#previousConsultationsList::-webkit-scrollbar,
#previousMessagesList::-webkit-scrollbar,
#previousAdmissionsList::-webkit-scrollbar,
#newPatientsList::-webkit-scrollbar,
#recentPatientsList::-webkit-scrollbar {
  width: 8px;
}

#upcomingList::-webkit-scrollbar-thumb,
#previousConsultationsList::-webkit-scrollbar-thumb,
#previousMessagesList::-webkit-scrollbar-thumb,
#previousAdmissionsList::-webkit-scrollbar-thumb,
#newPatientsList::-webkit-scrollbar-thumb,
#recentPatientsList::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d3e2;
}

#upcomingList::-webkit-scrollbar-track,
#previousConsultationsList::-webkit-scrollbar-track,
#previousMessagesList::-webkit-scrollbar-track,
#previousAdmissionsList::-webkit-scrollbar-track,
#newPatientsList::-webkit-scrollbar-track,
#recentPatientsList::-webkit-scrollbar-track {
  background: transparent;
}

.panel-large {
  grid-column: span 1;
}

.expandable-list-module {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  justify-items: center;
}

.primary-toggle {
  min-height: 42px;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 900;
  padding: 0 18px;
}

.secondary-toggle {
  min-height: 38px;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--blue);
  font-weight: 900;
  padding: 0 14px;
}

.secondary-toggle:hover,
.secondary-toggle:focus-visible {
  background: #dceaff;
}

.expandable-list-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: var(--list-view-height);
  min-height: min(560px, calc(100vh - 92px));
}

.main[data-view="citas"] .dashboard-grid.appointments-list-mode > .module-citas:not(.appointments-list-module) {
  display: none;
}

.main[data-view="citas"] .dashboard-grid.appointments-list-mode > #citas,
.main[data-view="citas"] .dashboard-grid.appointments-list-mode > #proximas {
  display: none;
}

.main[data-view="consultas"] .dashboard-grid.consultations-list-mode > #consultas-hoy,
.main[data-view="consultas"] .dashboard-grid.consultations-list-mode > #consultas-anteriores,
.main[data-view="mensajes"] .dashboard-grid.messages-list-mode > #mensajes,
.main[data-view="mensajes"] .dashboard-grid.messages-list-mode > #mensajes-anteriores,
.main[data-view="admisiones"] .dashboard-grid.admissions-list-mode > #admisiones-hoy,
.main[data-view="admisiones"] .dashboard-grid.admissions-list-mode > #admisiones-recientes {
  display: none;
}

.main[data-view="pacientes"] .dashboard-grid.patients-list-mode > #pacientes-nuevos,
.main[data-view="pacientes"] .dashboard-grid.patients-list-mode > #pacientes-recientes {
  display: none;
}

.main[data-view="citas"] .dashboard-grid.appointments-list-mode,
.main[data-view="consultas"] .dashboard-grid.consultations-list-mode,
.main[data-view="mensajes"] .dashboard-grid.messages-list-mode,
.main[data-view="admisiones"] .dashboard-grid.admissions-list-mode,
.main[data-view="pacientes"] .dashboard-grid.patients-list-mode {
  grid-template-columns: 1fr;
}

.main[data-view="citas"] .dashboard-grid.appointments-list-mode .appointments-list-module,
.main[data-view="consultas"] .dashboard-grid.consultations-list-mode .consultations-list-module,
.main[data-view="mensajes"] .dashboard-grid.messages-list-mode .messages-list-module,
.main[data-view="admisiones"] .dashboard-grid.admissions-list-mode .admissions-list-module,
.main[data-view="pacientes"] .dashboard-grid.patients-list-mode .patient-list-module {
  grid-column: 1 / -1;
  justify-items: stretch;
}

.appointments-list-header,
.expandable-list-panel .list-filters {
  flex: 0 0 auto;
}

.list-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(140px, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.list-filters label,
.appointments-custom-range label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.appointments-custom-range {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(160px, 220px));
  gap: 12px;
}

.appointments-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.list-clear-button {
  min-height: 40px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--blue);
  font-weight: 900;
  padding: 0 14px;
  white-space: nowrap;
}

.list-clear-button:hover,
.list-clear-button:focus-visible {
  background: #dceaff;
  outline: 0;
}

.appointments-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overscroll-behavior: contain;
}

.appointments-list-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
}

.panel-header,
.module-header,
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.title-count {
  color: var(--muted);
  font-size: 0.92em;
  font-weight: 800;
}

.panel.custom-active .panel-header {
  align-items: flex-start;
  flex-direction: column;
}

.panel.custom-active .panel-header h2 {
  width: 100%;
  white-space: nowrap;
}

.panel.custom-active .consultation-controls,
.panel.custom-active .message-controls,
.panel.custom-active .admission-controls {
  width: 100%;
  flex-wrap: nowrap;
}

.panel.custom-active .custom-period {
  flex: 0 0 auto;
}

.panel.custom-active .consultation-controls select,
.panel.custom-active .message-controls select,
.panel.custom-active .admission-controls select {
  min-width: 132px;
}

.compact {
  min-height: 50px;
}

.table-scroll {
  overflow: auto;
}

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

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

th {
  background: #f8fafc;
  color: #172033;
  font-size: 0.8rem;
}

td {
  font-size: 0.9rem;
}

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

.initials {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #655ee8;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

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

.person small,
.appointment-list small,
.message-list small,
.admission-list small,
.patient-summary-list small,
.absence-list small {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #edf2f7;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 2px 9px;
}

.badge.good {
  background: #dcfce7;
  color: #15803d;
}

.badge.warn {
  background: #fff4d8;
  color: #b45309;
}

.badge.bad {
  background: #fee2e2;
  color: #dc2626;
}

.row-actions {
  display: flex;
  gap: 10px;
}

.circle-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--blue);
  font-weight: 900;
}

.circle-button.confirm {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: var(--green);
}

.admission-action {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0 10px;
  white-space: nowrap;
}

.admission-action:hover,
.admission-action:focus-visible {
  background: #0f57b8;
  outline: 0;
}

.appointment-list,
.message-list,
.consultation-list,
.admission-list,
.patient-summary-list,
.absence-list {
  display: grid;
  padding: 0 18px;
}

.appointment-item,
.message-item,
.consultation-item,
.admission-item,
.patient-summary-item,
.absence-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.consultation-item {
  grid-template-columns: 38px minmax(0, 1fr);
}

.patient-summary-item {
  grid-template-columns: 38px minmax(0, 1fr);
}

.patient-summary-action,
.message-action,
.admission-record-action {
  width: 100%;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.patient-summary-action:hover,
.patient-summary-action:focus-visible,
.message-action:hover,
.message-action:focus-visible,
.admission-record-action:hover,
.admission-record-action:focus-visible {
  background: #f5f9ff;
  outline: 0;
}

.appointment-action,
.consultation-action {
  width: 100%;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.appointment-action:hover,
.appointment-action:focus-visible,
.consultation-action:hover,
.consultation-action:focus-visible {
  background: #f5f9ff;
  outline: 0;
}

.appointment-row,
.related-appointment-action {
  cursor: pointer;
}

.appointment-row:hover,
.appointment-row:focus-visible,
.related-appointment-action:hover,
.related-appointment-action:focus-visible {
  background: #f5f9ff;
  outline: 0;
}

.consultation-row,
.message-row,
.admission-record-action {
  cursor: pointer;
}

.consultation-row:hover,
.consultation-row:focus-visible,
.message-row:hover,
.message-row:focus-visible,
.admission-record-action:hover,
.admission-record-action:focus-visible {
  background: #f5f9ff;
  outline: 0;
}

.appointment-item:last-child,
.message-item:last-child,
.consultation-item:last-child,
.patient-summary-item:last-child,
.absence-item:last-child {
  border-bottom: 0;
}

.mini-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--blue);
  font-weight: 900;
}

.days-pill {
  border-radius: 999px;
  background: #e8e3ff;
  color: #5b39d6;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 5px 10px;
  white-space: nowrap;
}

.message-state {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 5px 10px;
  white-space: nowrap;
}

.message-state.sent {
  background: #dcfce7;
  color: #15803d;
}

.message-state.pending {
  background: #fff4d8;
  color: #b45309;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.quick-actions button {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fbff, #ffffff);
  color: #075dc8;
  font-weight: 800;
}

.quick-actions button:nth-child(2) {
  color: var(--green);
  background: linear-gradient(135deg, #f5fff8, #ffffff);
}

.quick-actions button:nth-child(3) {
  color: var(--purple);
  background: linear-gradient(135deg, #fbf9ff, #ffffff);
}

.quick-actions button:nth-child(4) {
  color: var(--orange);
  background: linear-gradient(135deg, #fffaf0, #ffffff);
}

.quick-actions span {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.patient-module {
  margin-top: 16px;
  overflow: hidden;
}

.patients-list-header {
  flex: 0 0 auto;
}

.filters {
  display: grid;
  grid-template-columns: minmax(280px, 1.75fr) minmax(142px, 0.85fr) minmax(142px, 0.85fr) minmax(108px, 0.62fr) minmax(168px, 1fr) minmax(168px, 1fr);
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.filters label:first-child {
  grid-column: auto;
}

.load-status-hidden {
  display: none;
}

.date-range span {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: 0;
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(20, 103, 223, 0.14);
}

input.filter-active,
select.filter-active {
  border-color: #86b7f5;
  background: #eef6ff;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(20, 103, 223, 0.08);
}

.filters button,
.detail-header button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 900;
  padding: 0 14px;
}

.filters button:disabled {
  background: #aeb7c4;
}

.patient-full-list {
  padding: 0 14px 14px;
}

.patient-full-scroll {
  height: var(--patient-list-rows-height);
  min-height: min(440px, calc(100vh - 230px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.patient-full-list .panel-header {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.patient-full-list .panel-header button {
  min-height: 36px;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--blue);
  font-weight: 900;
  padding: 0 12px;
}

.patient-full-list table {
  min-width: 1040px;
}

.patient-full-list th:nth-child(1),
.patient-full-list td:nth-child(1) {
  min-width: 220px;
}

.patient-full-list th:nth-child(3),
.patient-full-list td:nth-child(3),
.patient-full-list th:nth-child(7),
.patient-full-list td:nth-child(7) {
  min-width: 150px;
}

.patient-full-list th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--line);
}

.patient-full-row {
  cursor: pointer;
}

.patient-full-row.selected {
  background: #eef6ff;
  box-shadow: inset 4px 0 0 var(--blue);
}

.patient-full-row.selected td {
  color: var(--text);
  font-weight: 800;
}

.patient-full-row:hover,
.patient-full-row:focus-visible {
  background: #f5f9ff;
  outline: 0;
}

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

.patient-list,
.patient-detail {
  box-shadow: none;
}

.results {
  max-height: 520px;
  overflow: auto;
}

.patient-card {
  display: grid;
  width: 100%;
  min-height: 76px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
  text-align: left;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.patient-card:hover,
.patient-card.active {
  background: #eef6ff;
  box-shadow: inset 4px 0 0 var(--blue);
}

.patient-card strong,
.patient-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.patient-detail {
  min-height: 520px;
  overflow: hidden;
}

.empty-detail {
  display: grid;
  min-height: 460px;
  place-content: center;
  padding: 28px;
  text-align: center;
}

.detail-header small {
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
}

.patient-detail .detail-header {
  align-items: center;
  min-height: 112px;
  background:
    linear-gradient(135deg, rgba(20, 103, 223, 0.08), rgba(24, 169, 87, 0.06)),
    #ffffff;
}

.patient-detail .detail-header > div {
  min-width: 0;
}

.detail-header h2 {
  margin: 4px 0 5px;
  overflow: hidden;
  font-size: 1.45rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.fact {
  border-right: 1px solid var(--line);
  padding: 16px;
}

.fact:last-child {
  border-right: 0;
}

.fact b {
  display: block;
  overflow: hidden;
  color: #0f172a;
  font-size: 1.2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fact small {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.tab {
  min-height: 34px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  padding: 0 12px;
}

.tab:hover,
.tab.active {
  background: var(--blue);
  color: #ffffff;
}

.patient-detail .table-scroll {
  max-height: 380px;
}

.patient-detail table {
  min-width: 680px;
}

.patient-detail th,
.patient-detail td {
  padding: 11px 14px;
}

.muted-row {
  color: var(--muted);
  font-weight: 800;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.34);
}

.appointment-modal {
  display: flex;
  width: min(520px, 100%);
  height: 100%;
  flex-direction: column;
  background: var(--surface);
  box-shadow: -18px 0 44px rgba(15, 23, 42, 0.18);
}

.appointment-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(20, 103, 223, 0.08), rgba(24, 169, 87, 0.06)),
    #ffffff;
  padding: 18px;
}

.appointment-modal-header small {
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
}

.appointment-modal-header h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
}

.modal-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.detail-nav-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 900;
}

.detail-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.detail-nav-counter {
  min-width: 54px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

.modal-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 800;
}

.appointment-modal-body {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding: 18px;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section h3 {
  margin: 0;
  font-size: 0.98rem;
}

.detail-grid,
.related-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-row,
.message-detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 11px 12px;
}

.origin-summary-card {
  width: 100%;
}

.detail-row span,
.message-detail-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.detail-row strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.empty-note {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  padding: 12px;
}

.message-detail-list {
  display: grid;
  gap: 10px;
}

.message-detail-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

footer {
  color: var(--muted);
  font-size: 0.84rem;
  padding: 24px 0 0;
  text-align: center;
}

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

  .dashboard-grid,
  .statistics-grid,
  .patient-layout {
    grid-template-columns: 1fr;
  }

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

  .list-filters {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --list-view-height: calc(100vh - 84px);
    --patient-list-rows-height: calc(100vh - 330px);
  }

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(82vw, var(--sidebar-expanded));
    max-width: 320px;
    height: 100vh;
    padding: 18px 14px;
    transform: translateX(-105%);
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.22);
  }

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

  .app.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding: 0 8px;
  }

  .app.sidebar-collapsed .brand strong,
  .app.sidebar-collapsed .side-nav p,
  .app.sidebar-collapsed .nav-text,
  .app.sidebar-collapsed .nav-chevron,
  .app.sidebar-collapsed .nav-submenu {
    display: block;
  }

  .app.sidebar-collapsed .nav-submenu {
    display: grid;
  }

  .app.sidebar-collapsed .collapse-button {
    justify-content: flex-start;
    gap: 10px;
    margin: 0 6px 18px;
    padding: 0 12px;
  }

  .app.sidebar-collapsed .collapse-text {
    display: inline;
  }

  .app.sidebar-collapsed .collapse-button:hover::after,
  .app.sidebar-collapsed .collapse-button:focus-visible::after {
    display: none;
  }

  .app.sidebar-collapsed .side-nav a {
    justify-content: flex-start;
    gap: 12px;
    padding: 0 12px;
    font-size: inherit;
  }

  .app.sidebar-collapsed .side-nav a:hover::after,
  .app.sidebar-collapsed .side-nav a:focus-visible::after {
    display: none;
  }

  .dashboard-head,
  .kpi-grid,
  .dashboard-grid,
  .statistics-dashboard,
  .patient-module,
  footer {
    width: min(100% - 28px, 1280px);
  }

  .dashboard-head,
  .module-header,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-grid,
  .statistics-kpis,
  .statistics-grid,
  .filters,
  .quick-facts,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .statistics-period {
    justify-content: stretch;
    max-width: none;
  }

  .statistics-custom {
    width: 100%;
    flex-wrap: wrap;
  }

  .period-summary {
    width: 100%;
  }

  .donut-layout,
  .legend-row {
    grid-template-columns: 1fr;
  }

  .stat-summary {
    grid-template-columns: 1fr;
  }

  .donut-chart {
    width: min(220px, 72vw);
    justify-self: center;
  }

  .legend-row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .legend-row small {
    grid-column: 2;
  }

  .filters label:first-child {
    grid-column: auto;
  }

  .modal-backdrop {
    align-items: flex-end;
  }

  .appointment-modal {
    width: 100%;
    height: min(88vh, 720px);
    border-radius: 12px 12px 0 0;
  }

  .detail-grid,
  .related-card {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 14px;
  }

  .user-chip div {
    display: none;
  }
}
