/* Visit flow: progress, review lists, work queues, search. */
.visit-progress {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.visit-progress li {
  flex: 1 1 90px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.visit-progress .is-done {
  background: var(--brand-ring, rgba(15, 118, 110, 0.1));
  color: var(--primary-dark);
}

.visit-progress .is-current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 650;
}

.review-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.review-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.review-list span {
  color: var(--muted);
}

.no-charge {
  margin-top: 14px;
}

.no-charge summary {
  cursor: pointer;
  color: var(--muted);
}

.no-charge form {
  margin-top: 10px;
}

.lane-body[data-book-url] {
  cursor: copy;
}

.work-queues {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.work-queue-count {
  margin-left: 6px;
}

.work-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.work-item:first-of-type {
  border-top: 0;
}

.work-item a:first-child strong,
.work-item small {
  display: block;
}

.work-item small {
  color: var(--muted);
}

.work-item form {
  margin: 0;
}

.work-clear {
  margin-bottom: 18px;
}

.patient-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.patient-row-actions form {
  margin: 0;
}

.topbar-search {
  position: relative;
  flex: 0 1 320px;
  margin-right: 12px;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

.search-results button {
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-results button:hover,
.search-results button:focus {
  background: var(--brand-ring, rgba(15, 118, 110, 0.1));
}

.search-results small {
  display: block;
  color: var(--muted);
}

.patient-picker {
  position: relative;
}

.sidebar .nav-group summary {
  padding: 8px 12px;
  color: var(--sidebar-label, #89aaa7);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.sidebar .nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

@media (max-width: 760px) {
  .topbar-search {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 8px;
  }
}

.no-charge-request {
  margin-top: 14px;
}

.more-details {
  margin-top: 18px;
}

.more-details summary,
.cover-visit summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 650;
}

.more-details .form-grid {
  margin-top: 14px;
}

.cover-visit {
  margin-bottom: 16px;
}

.cover-visit form {
  max-width: 420px;
  margin-top: 10px;
}

.price-input {
  max-width: 140px;
  text-align: right;
}

.note-templates,
.favourite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.favourite-list form {
  margin: 0;
}

.tooth-chart {
  margin-bottom: 14px;
}

.tooth-chart-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.tooth-chart-switch .is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tooth-map {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
}

.tooth-map[hidden] {
  display: none;
}

.tooth {
  cursor: pointer;
  outline: none;
}

.tooth-crown {
  fill: #fff;
  stroke: #8fa9a6;
  stroke-width: 1.3;
}

.tooth-groove {
  fill: none;
  stroke: #b7c9c6;
  stroke-width: 1;
}

.tooth-no {
  fill: #48605e;
  font-size: 10.5px;
  font-weight: 700;
}

.tooth-side {
  fill: #7b918f;
  font-size: 10.5px;
}

.tooth:hover .tooth-crown {
  fill: #e4f4f0;
}

.tooth:focus-visible .tooth-crown {
  stroke: var(--primary);
  stroke-width: 2.5;
}

.tooth.is-selected .tooth-crown {
  stroke: var(--primary);
  stroke-width: 3;
}

.tooth.is-selected .tooth-no {
  fill: var(--primary);
}

.tooth-caries .tooth-crown, .tooth-swatch.tooth-caries { fill: #f4a79c; background: #f4a79c; }
.tooth-filled .tooth-crown, .tooth-swatch.tooth-filled { fill: #a9cdf3; background: #a9cdf3; }
.tooth.tooth-crown .tooth-crown, .tooth-swatch.tooth-crown { fill: #f2d27e; background: #f2d27e; }
.tooth-root_canal .tooth-crown, .tooth-swatch.tooth-root_canal { fill: #cdb7ee; background: #cdb7ee; }
.tooth-implant .tooth-crown, .tooth-swatch.tooth-implant { fill: #bcc7d3; background: #bcc7d3; }
.tooth-healthy .tooth-crown, .tooth-swatch.tooth-healthy { fill: #bfead8; background: #bfead8; }
.tooth-other .tooth-crown, .tooth-swatch.tooth-other { fill: #e3e3dd; background: #e3e3dd; }
.tooth-missing .tooth-crown { fill: transparent; stroke-dasharray: 3 3; }
.tooth-swatch.tooth-missing { background: transparent; border-style: dashed; }

.tooth-status {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.tooth-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}

.tooth-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 5px;
  border: 1px solid #8fa9a6;
  border-radius: 3px;
  vertical-align: -1px;
}

.patient-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-bottom: 16px;
}

.patient-summary dl {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 0;
}

.patient-summary dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.patient-summary dd {
  margin: 2px 0 0;
  font-weight: 650;
}

[data-tab-panel][hidden] {
  display: none;
}

.print-page {
  margin: 0;
  color: #17302f;
  background: #fff;
  font: 15px/1.5 system-ui, sans-serif;
}

.print-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #c6d6d3;
}

.print-actions form {
  margin: 0;
}

.print-sheet {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

.print-sheet header {
  padding-bottom: 12px;
  border-bottom: 2px solid #17302f;
}

.print-sheet h1,
.print-sheet header p {
  margin: 0;
}

.print-sheet table {
  width: 100%;
  border-collapse: collapse;
}

.print-sheet th,
.print-sheet td {
  padding: 8px 6px;
  border-bottom: 1px solid #c6d6d3;
  text-align: left;
  vertical-align: top;
}

.print-sheet .n {
  text-align: right;
}

.print-sheet dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  margin: 16px 0 0 auto;
  max-width: 280px;
}

.print-sheet dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.signature {
  margin-top: 56px;
}

@media print {
  .print-actions {
    display: none;
  }
}

/* Leave room for the sticky top bar when a redirect lands on a section anchor. */
.card[id] {
  scroll-margin-top: 140px;
}

/* Medical alerts (conditions, medicines) sit beside the allergy warning without looking like one. */
.alert.info{background:var(--blue);border-color:#bcd3ee;color:#1f4a75}
.alert.info div{margin-top:3px}
