.pulse-shell {
  display: block;
  background: #f4f7fb;
}

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

.pulse-shell .app-sidebar,
.pulse-shell .sidebar-overlay,
.pulse-shell > .app-main > .topbar {
  display: none !important;
}

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

.pulse-shell .app-container {
  padding: 0 0 28px;
  max-width: none;
  background: #fff;
}

.pulse-top {
  background: #1d6fe8;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 6px 16px;
  position: sticky;
  top: 0;
  z-index: 1040;
  overflow: visible;
}

.pulse-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  margin-right: 8px;
  min-width: 148px;
}

.pulse-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff;
  color: #1d6fe8;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}

.pulse-logo {
  height: 34px;
  width: auto;
  max-width: 128px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 2px 4px;
  flex: 0 0 auto;
}

.pulse-logo-login {
  height: 56px;
  max-width: 220px;
  margin-bottom: 8px;
}

.pulse-brand strong {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.pulse-brand small {
  display: block;
  font-size: 10px;
  opacity: 0.85;
  margin-top: -2px;
}

.pulse-ai {
  margin-right: 8px;
}

.pulse-ai-btn {
  background: #fff !important;
  color: #1d6fe8 !important;
  border-radius: 999px;
  padding: 6px 14px !important;
  font-weight: 700;
}

.pulse-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: visible;
}

.pulse-shell .page-heading {
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  box-shadow: none;
}

.pulse-shell .page-heading h1 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: #334155;
}

.pulse-shell .page-heading .eyebrow,
.pulse-shell .page-heading .lead {
  display: none;
}

.module-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-height: 40px;
  padding: 0 8px;
  background: #fff;
  border-bottom: 1px solid #dbe3ee;
  overflow-x: auto;
}

.module-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  color: #2563eb;
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.module-tabs a.is-active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  background: #f8fafc;
}

.reg-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 12px 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.reg-tabs button {
  border: 0;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
}

.reg-tabs button.is-active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

.pulse-shell .form-panel {
  margin: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.pulse-shell .kpi-grid {
  gap: 12px;
  margin: 12px 16px;
}

.pulse-shell .panel {
  margin: 0 16px 16px;
}

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

.pulse-shell .form-group {
  margin-bottom: 14px;
}

.pulse-shell .form-actions,
.pulse-shell .topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 1180px) {
  .pulse-top,
  .pulse-menu {
    flex-wrap: wrap;
  }

  .pulse-tools {
    margin-left: auto;
  }
}

.pulse-menu .dropdown,
.pulse-tools .dropdown {
  position: relative;
}

.pulse-link,
.pulse-menu .dropdown-toggle {
  color: #fff !important;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pulse-link:hover,
.pulse-menu .dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pulse-link.is-active,
.pulse-menu .dropdown-toggle.is-active {
  background: #3b86f6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.pulse-top .dropdown-menu {
  font-size: 13.5px;
  min-width: 220px;
  border-radius: 8px;
  padding: 6px;
  z-index: 1050;
  color: #0f172a;
  background: #fff;
}

.pulse-top .dropdown-item,
.pulse-top .dropdown-header {
  color: #0f172a !important;
}

.pulse-top .dropdown-item:hover,
.pulse-top .dropdown-item:focus {
  background: #eff6ff;
  color: #1d4ed8 !important;
}

.pulse-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.pulse-search {
  background: #fff;
  color: #334155;
  border: 0;
  border-radius: 6px;
  min-width: 240px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.pulse-user {
  color: #fff !important;
  background: transparent;
  border: 0;
  font-weight: 700;
  font-size: 13.5px;
}

.pulse-page {
  padding: 0 0 24px;
}

.appt-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.appt-tab {
  border: 0;
  background: transparent;
  color: #334155;
  font-weight: 650;
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
}

.appt-tab.is-active {
  color: #1d6fe8;
  box-shadow: inset 0 -2px 0 #1d6fe8;
  border-radius: 0;
}

.appt-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.appt-filters select,
.appt-filters input[type="date"] {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  height: 34px;
  padding: 0 8px;
  background: #fff;
}

.appt-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 16px 12px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.appt-nav a,
.slot-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  text-decoration: none;
  color: #1f2937;
  font-size: 13px;
  font-weight: 650;
}

.day-arrow {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

.day-rail {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  background: #fff;
  overflow-x: auto;
}

.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 68px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
}

.day-chip span {
  font-size: 11px;
  color: #64748b;
}

.day-chip strong {
  font-size: 16px;
}

.day-chip em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  background: #fde047;
  color: #0f172a;
  border-radius: 99px;
  padding: 0 6px;
}

.day-chip.is-selected {
  background: #1d6fe8;
  border-color: #1d6fe8;
  color: #fff;
}

.day-chip.is-selected span,
.day-chip.is-today span {
  color: inherit;
}

.day-chip.is-today:not(.is-selected) {
  border-color: #1d6fe8;
}

.day-chip.is-selected em {
  background: #fff;
}

.day-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 12px 16px 20px;
}

.doctor-day {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.doctor-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 48%);
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  padding: 14px;
}

.doctor-card-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.doctor-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1d6fe8;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.doctor-card strong {
  display: block;
  color: #1d4ed8;
  font-size: 16px;
  line-height: 1.2;
}

.doctor-card small,
.doctor-card em {
  display: block;
  color: #64748b;
  font-style: normal;
  font-size: 12px;
  margin-top: 2px;
}

.doctor-shift {
  margin-top: 8px;
}

.doctor-card .doc-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.doctor-card .doc-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 4px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: #fff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}

.doctor-card .doc-links a:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.doctor-card .doc-links svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doctor-card .doc-actions a {
  display: block;
  width: 100%;
  text-align: center;
  background: #fff;
}

.hour-board,
.slot-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  align-items: stretch;
}

.hour-board.is-single,
.slot-blocks.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.hour-period {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
}

.hour-period > p,
.slot-block > p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.hour-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(96px, 1fr);
  gap: 8px;
  align-items: start;
}

.hour-col {
  min-width: 0;
  padding: 8px 6px 10px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 12px;
}

.hour-col strong {
  display: block;
  margin-bottom: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.hour-slots {
  display: grid;
  grid-template-columns: repeat(2, 46px);
  gap: 6px;
  justify-content: center;
}

.hour-slots .slot-chip {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  font-size: 10px;
}

.slot-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
}

.slot-block p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.hour-period p small,
.slot-block p small {
  font-weight: 600;
  color: #64748b;
}

.slot-empty {
  margin: 0;
  padding: 18px 8px;
  color: #64748b;
  font-size: 13px;
}

.slot-flash {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
}

.slot-flash.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.slot-menu {
  position: fixed;
  z-index: 40;
  min-width: 210px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.slot-menu[hidden],
.slot-menu [hidden] {
  display: none;
}

.slot-menu-title {
  margin: 0;
  padding: 8px 10px 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.slot-menu a,
.slot-menu button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.slot-menu a:hover,
.slot-menu button:hover {
  background: #f1f5f9;
}

.slot-menu .is-danger {
  color: #be123c;
}

.slot-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, 60px);
  grid-auto-rows: 60px;
  gap: 8px;
  justify-content: start;
  align-content: start;
  width: 100%;
  min-width: 0;
}

.slot-blocks.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.slot-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 2px;
  text-decoration: none;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.slot-chip span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.slot-chip small {
  font-size: 9px;
  font-weight: 700;
}

.slot-chip:hover {
  filter: brightness(0.96);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.slot-chip.available { background: #86efac; }
.slot-chip.booked { background: #fde047; }
.slot-chip.arrived { background: #facc15; box-shadow: inset 0 0 0 3px #854d0e; }
.slot-chip.completed { background: #60a5fa; }
.slot-chip.walkin { background: #fb923c; }
.slot-chip.noshow { background: #f87171; }
.slot-chip.reserved { background: #bae6fd; }
.slot-chip.unavailable { background: #fff; border-color: #cbd5e1; }
.slot-chip.extra { background: #bbf7d0; box-shadow: inset 0 0 0 3px #15803d; }
.slot-chip.blocked { background: #111827; color: #fff; }
.slot-chip.empty { background: #f8fafc; border-color: #e5e7eb; color: #94a3b8; }

.board-wrap {
  overflow: auto;
  background: #fff;
  margin: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.appt-board {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1100px;
  width: 100%;
}

.appt-board th,
.appt-board td {
  border-bottom: 1px solid #eef2f7;
  border-right: 1px solid #eef2f7;
  text-align: center;
  font-size: 12px;
  padding: 0;
}

.appt-board th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  height: 36px;
  min-width: 36px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.appt-board th:first-child,
.appt-board .doctor-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  text-align: left;
  min-width: 190px;
}

.appt-board th:first-child {
  background: #f8fafc;
  z-index: 3;
}

.appt-board .hour-mark {
  box-shadow: inset 1px 0 0 #cbd5e1;
}

.appt-board .slot {
  width: 28px;
  height: 22px;
  margin: 3px auto;
}

.doctor-cell {
  text-align: left !important;
  width: 230px;
  min-width: 230px;
  padding: 12px !important;
  vertical-align: top;
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 1;
}

.doctor-cell strong {
  display: block;
  color: #1d4ed8;
  font-size: 14px;
}

.doctor-cell small {
  color: #64748b;
}

.availability-cell {
  text-align: left !important;
  vertical-align: top;
  min-width: 150px;
  padding: 8px 10px !important;
  background: #fff;
}

.availability-cell strong {
  display: block;
  color: #0f172a;
  font-size: 12px;
}

.availability-cell small {
  color: #64748b;
}

.doc-badge {
  display: inline-block;
  margin-top: 6px;
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
}

.doc-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
}

.doc-actions a {
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
  padding: 4px 8px;
  width: fit-content;
}

.doc-actions .add {
  color: #15803d;
  border: 1px solid #86efac;
}

.doc-actions .busy {
  color: #be123c;
  border: 1px solid #fda4af;
}

.doc-links {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.doc-links a {
  font-size: 11px;
  color: #1d4ed8;
}

.slot {
  width: 42px;
  height: 34px;
  display: block;
  margin: 4px auto;
  border-radius: 3px;
  border: 1px solid transparent;
}

.slot.available { background: #86efac; }
.slot.booked { background: #fde047; }
.slot.arrived { background: #facc15; box-shadow: inset 0 0 0 2px #854d0e; }
.slot.completed { background: #60a5fa; }
.slot.walkin { background: #fb923c; }
.slot.noshow { background: #f87171; }
.slot.reserved { background: #bae6fd; }
.slot.unavailable { background: #fff; border-color: #cbd5e1; }
.slot.extra { background: #bbf7d0; box-shadow: inset 0 0 0 2px #15803d; }
.slot.blocked { background: #111827; }
.slot.empty { background: #f8fafc; border-color: #e5e7eb; }

.legend-help {
  margin: 0;
  padding: 10px 16px 0;
  color: #475569;
  font-size: 13px;
}

.legend-help a {
  color: #1d4ed8;
  font-weight: 700;
}

.status-form select {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  height: 32px;
  padding: 0 8px;
  background: #fff;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 16px 0;
  color: #475569;
  font-size: 12px;
}

.legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -2px;
}

.checkin-table {
  width: calc(100% - 32px);
  margin: 12px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  border-collapse: collapse;
}

.checkin-table th,
.checkin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: 13.5px;
}

.analysis-head {
  background: #1f9d55;
  text-align: center;
  padding: 10px;
  font-weight: 800;
  color: #fff;
}

.analysis-menu {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #eef6f8;
  border-bottom: 1px solid #dbe4ea;
}

.analysis-menu .dropdown-toggle {
  background: transparent;
  border: 0;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 14px;
}

.analysis-sheet {
  margin: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.analysis-sheet h2 {
  margin: 0;
  padding: 14px 16px;
  font-size: 18px;
}

.analysis-sheet table {
  width: 100%;
  border-collapse: collapse;
}

.analysis-sheet th,
.analysis-sheet td {
  padding: 10px 14px;
  border-top: 1px solid #eef2f7;
  text-align: left;
  font-size: 14px;
}

.pulse-login {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 20%, #86efac 0 70px, transparent 72px),
    radial-gradient(circle at 92% 78%, #4ade80 0 90px, transparent 92px),
    linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 16px;
  position: relative;
}

.pulse-pill-top,
.pulse-pill-bottom {
  min-width: 220px;
}

.pulse-orbit {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px) 1fr;
  gap: 18px;
  align-items: center;
}

.pulse-pills {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pulse-pills.right { align-items: flex-start; }
.pulse-pills.left { align-items: flex-end; }

.pulse-pill {
  background: #1d6fe8;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(29, 111, 232, 0.25);
}

.pulse-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.pulse-card h1 {
  text-align: center;
  color: #1d6fe8;
  font-size: 28px;
  margin: 8px 0 0;
}

.pulse-card .tagline {
  text-align: center;
  color: #64748b;
  margin-bottom: 18px;
}

@media (max-width: 800px) {
  .pulse-menu {
    flex: 1 1 100%;
    width: 100%;
    order: 3;
  }

  .pulse-tools {
    order: 2;
  }

  .doctor-day,
  .hour-board,
  .slot-blocks {
    grid-template-columns: 1fr;
  }

  .hour-row {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-columns: unset;
  }

  .slot-block p {
    flex-direction: column;
  }

  .day-board,
  .board-wrap,
  .legend,
  .legend-help,
  .appt-nav,
  .appt-filters,
  .appt-toolbar {
    margin-left: 8px;
    margin-right: 8px;
  }

  .day-rail {
    flex-wrap: wrap;
    overflow: visible;
    padding-left: 8px;
    padding-right: 8px;
  }

  .appt-filters select,
  .appt-filters input[type="date"] {
    max-width: 100%;
  }

  .appt-nav strong {
    flex: 1 1 140px;
  }
}

@media (max-width: 900px) {
  .pulse-orbit { grid-template-columns: 1fr; }
  .pulse-pills { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .pulse-pills.left, .pulse-pills.right { align-items: center; }
  .pulse-search { display: none; }
}

.pulse-shell .dashboard-hero {
  padding: 18px 20px;
  margin: 12px 16px;
  border-radius: 12px;
  box-shadow: none;
  align-items: center;
}

.pulse-shell .dashboard-hero h1 {
  font-size: 26px;
  margin: 2px 0;
}

.pulse-shell .dashboard-hero .lead {
  margin-bottom: 0;
}

.pulse-shell .btn {
  border-radius: 8px;
  overflow: visible;
}

.pulse-shell .btn::before {
  display: none;
}

.pulse-shell .btn-primary {
  background: #1d6fe8;
  color: #fff;
  border: 0;
  box-shadow: none;
}

.pulse-shell .btn-primary:hover,
.pulse-shell .btn-primary:focus {
  background: #1558c0;
  color: #fff;
  transform: none;
  box-shadow: none;
}

.pulse-shell .kpi-card,
.pulse-shell .panel,
.pulse-shell .module-card {
  border-radius: 12px;
  box-shadow: none;
}

.pulse-shell .panel {
  min-height: 0;
}

.pulse-shell .kpi-card strong {
  font-size: 28px;
}

.pulse-shell .table-shell {
  overflow: auto;
}

.analysis-menu {
  overflow: visible;
  position: relative;
  z-index: 3;
}

.analysis-menu .dropdown-menu {
  z-index: 30;
}

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

.queue-kpis article {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
}

.queue-kpis span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.queue-kpis strong {
  font-size: 28px;
  color: #0f172a;
}

.queue-filter {
  margin-bottom: 12px;
}

.queue-filter select,
.consult-form select,
.consult-form textarea,
.consult-form input[type="date"],
.consult-form input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.checkin-table td small {
  display: block;
  color: #64748b;
  font-weight: 600;
}

.checkin-table td:first-child {
  white-space: nowrap;
}

.queue-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 320px;
}

.queue-actions form {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 0;
}

.queue-actions button {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.queue-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  background: #e2e8f0;
}

.queue-badge.wait { background: #dcfce7; color: #166534; }
.queue-badge.called { background: #fde68a; color: #92400e; }
.queue-badge.consult { background: #dbeafe; color: #1d4ed8; }
.queue-badge.done { background: #e0e7ff; color: #3730a3; }
.queue-badge.skip { background: #ffedd5; color: #9a3412; }
.queue-badge.noshow { background: #fee2e2; color: #991b1b; }

.doctor-lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.doctor-lane-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #eef2f7;
}

.doctor-lane-card strong,
.doctor-lane-card span,
.doctor-lane-card small {
  display: block;
}

.queue-empty {
  color: #64748b;
  margin: 8px 0 0;
}

.consult-head h1 {
  margin: 0;
  color: #0f172a;
}

.consult-head p span {
  display: inline-block;
  margin-right: 10px;
  color: #475569;
}

.allergy-banner {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.consult-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.consult-form label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  color: #334155;
}

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

.vitals-line {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.care-timeline,
.timeline-item small {
  color: #64748b;
}

.care-timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  padding: 10px 0 10px 14px;
  border-left: 3px solid #1d6fe8;
  margin-left: 6px;
}

.timeline-item strong,
.timeline-item span,
.timeline-item small,
.timeline-item p {
  display: block;
}

.timeline-item p {
  margin: 4px 0 0;
  color: #0f172a;
}

.queue-display {
  margin: 0;
  min-height: 100vh;
  background: #0f172a;
  color: #fff;
  font-family: "Segoe UI", sans-serif;
}

.queue-display header {
  display: flex;
  justify-content: space-between;
  padding: 22px 32px;
  background: #1d6fe8;
}

.queue-display main {
  padding: 28px 32px 48px;
}

.queue-display .now-label,
.queue-display h2 {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.queue-display h1 {
  font-size: 96px;
  line-height: 1;
  margin: 8px 0;
}

.queue-display #now-meta {
  font-size: 28px;
  margin-top: 0;
}

.queue-display section:has(.token-row:empty) {
  display: none;
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.token-row span {
  min-width: 140px;
  background: #1e293b;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 28px;
  font-weight: 800;
}

.token-row small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

.saas-tree {
  margin-bottom: 16px;
}

.saas-platform {
  width: fit-content;
  margin: 0 auto 14px;
  background: #1d6fe8;
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
}

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

.saas-branches {
  display: grid;
  gap: 8px;
}

.saas-branches article {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
}

.saas-branches strong,
.saas-branches small {
  display: block;
}

.saas-branches small {
  color: #64748b;
}

.patient-profile {
  display: grid;
  gap: 14px;
}

.patient-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
}

.patient-hero h1 {
  margin: 0;
  color: #0f172a;
}

.patient-meta,
.patient-next {
  margin: 8px 0 0;
  color: #475569;
}

.patient-meta span {
  display: inline-block;
  margin-right: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

.patient-next {
  font-weight: 700;
  color: #0f172a;
}

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

.patient-facts dl {
  margin: 0;
}

.patient-facts dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eef2f7;
}

.patient-facts dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.patient-facts dd {
  margin: 0;
  color: #0f172a;
  font-weight: 700;
}

.allergy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.allergy-pills span {
  background: #fef2f2;
  color: #991b1b;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .queue-kpis,
  .doctor-lanes,
  .consult-grid,
  .patient-facts {
    grid-template-columns: 1fr 1fr;
  }

  .patient-hero {
    flex-direction: column;
  }
}

.wallet-grid,
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.package-card h2 {
  margin: 4px 0;
  font-size: 1.15rem;
}

.package-price {
  margin: 0 0 8px;
  color: #1d4ed8;
  font-size: 1.35rem;
  font-weight: 700;
}

.package-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
  color: #475569;
  font-size: 13px;
}

.package-facts div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eef2f7;
}

.package-facts dt {
  color: #64748b;
  font-size: 12px;
}

.package-facts dd {
  margin: 0;
  font-weight: 700;
}

.progress-panel {
  margin-bottom: 16px;
}

.progress-note {
  color: #64748b;
  font-size: 13px;
}

.copilot-panel h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

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

.ai-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.ai-card h2 {
  margin: 4px 0 8px;
  font-size: 1.15rem;
}

.ai-card:hover {
  outline: 2px solid #bfdbfe;
}

@media (max-width: 1100px) {
  .ai-card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

.copilot-grid ul {
  margin: 0;
  padding-left: 18px;
}

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

.wallet-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.wallet-stats-lg {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.wallet-stats div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.wallet-stats span {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.wallet-stats strong {
  font-size: 1.35rem;
}

.wallet-note {
  color: #475569;
  margin-bottom: 16px;
}

.weekday-picks,
.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 8px 0 14px;
}

.wallet-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wallet-actions .form-control {
  width: auto;
  min-width: 160px;
}

.inline-form {
  display: inline;
}

@media (max-width: 800px) {
  .wallet-stats,
  .wallet-stats-lg {
    grid-template-columns: 1fr 1fr;
  }
}

.desk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 16px;
}

.desk-filters a {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.desk-filters a.is-on {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
