:root {
  --oxygen: #e7fcf9;
  --oxygen-deep: #d3f5ef;
  --forest: #115541;
  --forest-hover: #0d4434;
  --dark-forest: #113126;
  --white: #ffffff;
  --muted: #5c746c;
  --line: #dce9e5;
  --danger-bg: #fff2f0;
  --danger: #9b2c22;
  --shadow: 0 14px 40px rgba(17, 49, 38, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --page-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f8fbfa;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--dark-forest);
  background: linear-gradient(180deg, var(--oxygen) 0, #f8fbfa 340px);
  font-family: "Degular", "Aptos", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--forest);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(17, 85, 65, 0.28);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--dark-forest);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-width {
  width: min(calc(100% - 40px), var(--page-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(17, 85, 65, 0.1);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  width: min(calc(100% - 40px), var(--page-width));
  min-height: 76px;
  margin-inline: auto;
  align-items: center;
  gap: 34px;
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 14px;
  color: var(--dark-forest);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 92px;
  height: auto;
}

.main-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: 22px;
}

.main-nav a {
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  color: var(--dark-forest);
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover {
  border-bottom-color: var(--oxygen-deep);
  color: var(--forest);
}

.main-nav a.is-active {
  border-bottom-color: var(--forest);
  color: var(--forest);
  font-weight: 750;
}

.account-nav {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 16px;
}

.account-name {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-nav form {
  margin: 0;
}

.page-main {
  min-height: calc(100vh - 150px);
  padding-block: 64px 80px;
}

.page-heading {
  display: flex;
  margin-bottom: 34px;
  align-items: end;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Campaign", "Aptos Display", "Segoe UI", sans-serif;
  font-weight: 300;
  letter-spacing: -0.025em;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1.02;
}

h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
}

.page-intro {
  max-width: 580px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.current-date {
  margin: 0 0 5px;
  color: var(--muted);
  flex: none;
  font-size: 13px;
  font-weight: 650;
}

.summary-grid {
  display: grid;
  margin-bottom: 24px;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.summary-card {
  display: flex;
  min-height: 138px;
  padding: 25px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  flex-direction: column;
  justify-content: space-between;
}

.summary-card-accent {
  border-color: var(--forest);
  color: var(--white);
  background: var(--forest);
}

.summary-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.summary-card-accent .summary-label {
  color: var(--oxygen);
}

.summary-card strong {
  font-family: "Campaign", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.panel-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel-header-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.employee-header-actions {
  display: grid;
  width: min(100%, 606px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.employee-header-actions form {
  display: flex;
  margin: 0;
}

.employee-header-actions .button {
  width: 100%;
  min-height: 68px;
  height: 100%;
  padding-inline: 20px;
  text-align: center;
}

.employee-header-actions > .button span {
  width: 100%;
  text-align: center;
}

.employee-filter-form {
  display: grid;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(240px, 1fr) 210px 230px auto;
  align-items: end;
  gap: 12px;
  background: linear-gradient(90deg, #f8fcfb, var(--white));
}

.employee-overview-panel {
  overflow: visible;
}

.employee-filter-field {
  position: relative;
}

.employee-filter-field > label,
.filter-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.employee-search-field input {
  width: 100%;
  border-radius: 999px;
}

.multi-select-filter {
  position: relative;
  width: 100%;
}

.multi-select-filter summary {
  display: flex;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--forest);
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.multi-select-filter summary::-webkit-details-marker {
  display: none;
}

.multi-select-filter summary:hover {
  border-color: var(--forest);
  background: var(--oxygen);
}

.multi-select-filter summary::after {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: var(--muted);
  content: "";
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease;
}

.multi-select-filter[open] summary {
  border-color: var(--forest);
  background: var(--oxygen);
  box-shadow: 0 0 0 3px rgba(17, 85, 65, 0.08);
}

.multi-select-filter[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.multi-select-options {
  position: absolute;
  z-index: 10;
  top: calc(100% + 7px);
  left: 0;
  width: 310px;
  max-height: min(360px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid #c8dcd5;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 18px 45px rgba(17, 49, 38, 0.16);
}

.multi-select-options fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.multi-select-options fieldset + fieldset {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.multi-select-options legend {
  margin: 0 0 6px 4px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.multi-select-options label {
  display: flex;
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 9px;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  cursor: pointer;
}

.multi-select-options label:hover {
  background: var(--oxygen);
}

.multi-select-options input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--forest);
}

.employee-filter-actions {
  display: flex;
  gap: 8px;
}

.employee-filter-actions .button {
  min-height: 44px;
}

.invitation-checkbox-column {
  width: 56px;
  text-align: center;
}

.employee-invitation-checkbox {
  width: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--forest);
}

.invitation-form-actions {
  display: flex;
  padding: 20px 28px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  gap: 10px;
}

.filter-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.multi-filter {
  flex-wrap: wrap;
}

.availability-search-field {
  min-width: min(260px, 100%);
}

.filter-form label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-controls {
  display: flex;
  margin-top: 5px;
  gap: 8px;
}

select,
input,
textarea {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #bfcfc9;
  border-radius: 10px;
  color: var(--dark-forest);
  background: var(--white);
}

select {
  min-width: 180px;
}

input {
  width: 100%;
}

textarea {
  width: 100%;
  resize: vertical;
}

select:hover,
input:hover,
textarea:hover {
  border-color: var(--forest);
}

.button {
  display: inline-flex;
  min-height: 42px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  color: var(--white);
  background: var(--forest);
}

.button-primary:hover {
  background: var(--forest-hover);
}

.button-quiet {
  border-color: var(--line);
  color: var(--forest);
  background: var(--white);
}

.button-quiet:hover {
  border-color: var(--forest);
  background: var(--oxygen);
}

.button-wide {
  width: 100%;
  min-height: 48px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  background: #fbfdfc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

tbody tr:hover {
  background: #f8fcfa;
}

.employee-cell {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--dark-forest);
  text-decoration: none;
}

.employee-cell strong,
.employee-cell small {
  display: block;
}

.employee-cell strong {
  font-weight: 700;
}

.employee-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--forest);
  background: var(--oxygen);
  flex: none;
  font-weight: 700;
  place-items: center;
}

.location-pill {
  display: inline-flex;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--oxygen);
  font-size: 13px;
  font-weight: 700;
}

.competency-pill {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dark-forest);
  background: #f8fbfa;
  font-size: 13px;
  font-weight: 700;
}

.row-action {
  width: 60px;
  text-align: right;
}

.row-action a {
  font-size: 22px;
  text-decoration: none;
}

.empty-state {
  padding-block: 48px;
  color: var(--muted);
  text-align: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 30px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.profile-hero {
  display: flex;
  margin-bottom: 36px;
  align-items: center;
  gap: 24px;
}

.profile-hero h1 {
  font-size: clamp(38px, 5vw, 56px);
}

.profile-hero p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.profile-avatar {
  display: grid;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  color: var(--white);
  background: var(--forest);
  flex: none;
  font-family: "Campaign", "Aptos Display", sans-serif;
  font-size: 38px;
  font-weight: 300;
  place-items: center;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: start;
}

.profile-grid-wide {
  grid-template-columns: 1fr;
}

.profile-card .panel-header {
  position: relative;
  align-items: center;
}

.profile-editor-actions {
  display: flex;
  padding-top: 4px;
  justify-content: flex-end;
}

.profile-edit-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.profile-edit-trigger {
  user-select: none;
}

.profile-edit-close,
.profile-details-form {
  display: none;
}

.profile-edit-toggle:focus-visible + .panel-header .profile-edit-trigger {
  outline: 3px solid rgba(17, 85, 65, 0.25);
  outline-offset: 3px;
}

.profile-edit-toggle:checked + .panel-header .profile-edit-open,
.profile-edit-toggle:checked ~ .profile-details-view {
  display: none;
}

.profile-edit-toggle:checked + .panel-header .profile-edit-close,
.profile-edit-toggle:checked ~ .profile-details-form {
  display: block;
}

.profile-details-form .profile-editor-actions {
  padding: 20px 28px;
  border-top: 1px solid var(--line);
}

.profile-details-form select {
  width: min(100%, 360px);
}

.profile-details-form [hidden] {
  display: none !important;
}

.competency-pill-options > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.competency-pill-options label {
  position: relative;
  display: inline-flex;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  align-items: center;
  color: var(--dark-forest);
  background: #f8fbfa;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.competency-pill-options label:hover {
  border-color: var(--forest);
}

.competency-pill-options label:has(input:checked) {
  border-color: var(--forest);
  color: var(--white);
  background: var(--forest);
}

.competency-pill-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.competency-pill-options label:has(input:focus-visible) {
  outline: 3px solid rgba(17, 85, 65, 0.25);
  outline-offset: 2px;
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: grid;
  padding: 19px 28px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  font-weight: 650;
}

.profile-note {
  display: flex;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--oxygen);
  gap: 16px;
}

.availability-summary {
  margin-top: 24px;
}

.availability-summary .panel-header {
  align-items: center;
}

.holiday-summary {
  display: block;
}

.holiday-summary + .holiday-summary {
  margin-top: 8px;
}

.holiday-summary small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.detail-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 400;
}

.empty-panel {
  padding: 30px 28px;
  color: var(--muted);
}

.doctor-availability-summary {
  display: grid;
  margin-bottom: 24px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.doctor-availability-summary article {
  display: flex;
  min-height: 104px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  flex-direction: column;
  justify-content: space-between;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(17, 49, 38, 0.05);
}

.doctor-availability-summary article.needs-attention {
  border-color: #edc7c2;
  background: var(--danger-bg);
}

.doctor-availability-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.doctor-availability-summary strong {
  font-family: "Campaign", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
}

.doctor-availability-grid {
  display: grid;
  padding: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.doctor-availability-grid > .empty-panel {
  grid-column: 1 / -1;
  text-align: center;
}

.doctor-availability-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdfc;
}

.doctor-availability-card header {
  display: flex;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.doctor-availability-card h3 {
  margin: 0;
  font-size: 21px;
}

.doctor-availability-card header a {
  text-decoration: none;
}

.doctor-availability-card header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.availability-status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  flex: none;
  font-size: 12px;
  font-weight: 750;
}

.status-planned,
.status-complete {
  color: var(--forest);
  background: var(--oxygen);
}

.status-missing {
  color: var(--danger);
  background: var(--danger-bg);
}

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

.doctor-holiday-list li {
  display: flex;
  min-width: 0;
  padding: 11px 13px;
  border-radius: 10px;
  flex-wrap: wrap;
  align-items: baseline;
  background: var(--white);
  font-weight: 700;
  gap: 5px;
  scroll-margin-top: 96px;
}

.doctor-holiday-list small {
  width: 100%;
  color: var(--muted);
  font-weight: 400;
}

.holiday-approval {
  display: flex;
  width: 100%;
  margin-top: 6px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.holiday-approval form {
  margin: 0;
}

.button-compact {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.holiday-approval-status {
  margin-top: 4px;
  font-weight: 650;
}

.holiday-approval-status.approved {
  color: var(--forest);
}

.holiday-approval-status.pending {
  color: var(--danger);
}

.current-holiday-label {
  margin-left: auto;
  color: var(--forest);
  font-size: 12px;
  font-weight: 750;
}

.doctor-holiday-empty {
  margin: 16px 0 0;
  color: var(--muted);
}

.more-doctor-holidays {
  margin-top: 12px;
}

.more-doctor-holidays summary {
  color: var(--forest);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.more-doctor-holidays .doctor-holiday-list {
  padding-top: 10px;
}

.availability-dashboard {
  margin-bottom: 24px;
  scroll-margin-top: 96px;
}

.capacity-table {
  min-width: 1180px;
}

.table-scroll-top {
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--line);
  background: #fbfdfc;
}

.table-scroll-top > div {
  height: 1px;
}

.capacity-table th,
.capacity-table td {
  min-width: 138px;
  padding: 15px 18px;
}

.capacity-table th:first-child,
.capacity-table td:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  min-width: 210px;
  background: var(--white);
}

.capacity-table thead th:first-child {
  z-index: 3;
  background: #fbfdfc;
}

.capacity-table td small,
.table-heading-note {
  display: block;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
}

.table-heading-note {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: normal;
}

.number-cell {
  font-variant-numeric: tabular-nums;
}

.future-average {
  background: var(--oxygen);
}

.future-average-low {
  color: var(--danger);
  background: var(--danger-bg);
}

.missing-value {
  color: var(--muted);
  font-size: 13px;
}

.capacity-summary-panel {
  overflow: visible;
  margin-bottom: 24px;
  scroll-margin-top: 96px;
}

.location-capacity + .location-capacity {
  border-top: 1px solid var(--line);
}

.location-capacity-heading {
  display: flex;
  padding: 22px 24px 0;
  align-items: center;
  justify-content: space-between;
}

.location-capacity-heading h3 {
  margin: 0;
  font-family: "Campaign", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 25px;
  font-weight: 400;
}

.location-capacity-heading span {
  color: var(--muted);
  font-size: 13px;
}

.more-months {
  padding: 0 24px 24px;
}

.more-months summary {
  display: inline-flex;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--forest);
  background: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.more-months summary:hover {
  border-color: var(--forest);
  background: var(--oxygen);
}

.more-months[open] summary {
  margin-bottom: 18px;
}

.more-months .month-status-grid {
  padding: 0;
}

.month-status-grid {
  display: grid;
  padding: 24px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.month-status {
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--muted);
  border-radius: var(--radius-md);
  background: #fbfdfc;
}

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

.month-status > strong {
  margin-top: 12px;
  font-family: "Campaign", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
}

.month-status > strong + span {
  color: var(--muted);
  font-size: 13px;
}

.month-status-label {
  font-weight: 750;
}

.month-status dl {
  margin: 18px 0;
}

.month-status dl div {
  display: flex;
  padding: 4px 0;
  justify-content: space-between;
  gap: 10px;
}

.month-status dt {
  color: var(--muted);
}

.month-status dd {
  margin: 0;
  font-weight: 650;
}

.month-status-healthy {
  border-top-color: #2f855a;
}

.month-status-margin {
  border-color: #ead7ad;
  border-top-color: #c58a2a;
  background: #fffaf0;
}

.month-status-shortage {
  border-color: #eccdca;
  border-top-color: var(--danger);
  background: #fff7f5;
}

.month-status-incomplete {
  border-top-color: #718096;
}

.status-badge {
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--oxygen);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.month-status-margin .status-badge {
  color: #805b1f;
  background: #f9edcf;
}

.month-status-shortage .status-badge {
  color: var(--danger);
  background: var(--danger-bg);
}

.missing-assistants {
  margin-top: 10px;
  font-size: 13px;
}

.missing-assistants summary {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  cursor: pointer;
}

.missing-assistants ul {
  margin: 8px 0 0;
  padding-left: 24px;
}

.missing-assistants li + li {
  margin-top: 4px;
}

.study-overview-panel {
  margin-top: 24px;
  scroll-margin-top: 96px;
}

.study-overview-table {
  min-width: 1050px;
}

.study-overview-table td {
  vertical-align: top;
}

.study-overview-table td strong,
.study-overview-table td small {
  display: block;
}

.study-overview-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.study-date-value {
  display: block;
  font-size: 1.08rem;
  line-height: 1.25;
}

.study-date-status {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  padding: 28px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.settings-grid-small {
  max-width: 420px;
  grid-template-columns: 1fr;
}

.availability-form {
  display: grid;
  gap: 24px;
}

.form-panel {
  overflow: visible;
}

.form-grid {
  display: grid;
  padding: 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.monthly-availability-table th[scope="row"] {
  min-width: 155px;
  color: var(--dark-forest);
  background: var(--white);
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
}

.monthly-availability-table td:nth-child(2) {
  width: 240px;
}

.monthly-availability-table input {
  min-width: 180px;
}

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

.study-card {
  display: grid;
  margin: 0;
  padding: 28px;
  border: 0;
  gap: 20px;
}

.study-card + .study-card {
  border-left: 1px solid var(--line);
}

.study-card legend {
  padding: 0;
  font-family: "Campaign", "Aptos Display", "Segoe UI", sans-serif;
  font-size: 23px;
}

.study-card select {
  width: 100%;
}

.holiday-list {
  display: grid;
}

.holiday-row {
  display: grid;
  margin: 0;
  padding: 24px 28px 28px;
  border: 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.holiday-row legend {
  padding: 24px 28px 0;
  font-weight: 700;
}

.delete-field {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 9px;
}

.delete-field input {
  width: auto;
  min-height: auto;
}

.holiday-add-action {
  padding: 0 28px 28px;
}

.holiday-acknowledgement {
  margin: 0 28px 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfa;
}

.holiday-acknowledgement-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.holiday-acknowledgement-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--forest);
  cursor: pointer;
}

.holiday-acknowledgement-option label {
  color: var(--dark-forest);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.holiday-acknowledgement .help-text {
  margin: 5px 0 0 28px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-actions-padded {
  padding: 0 28px 28px;
}

.tamigo-sync-form,
.tamigo-sync-preview {
  padding: 24px 28px;
}

.tamigo-sync-options {
  display: grid;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  gap: 12px;
}

.tamigo-sync-option {
  display: flex;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  align-items: center;
  gap: 14px;
  background: var(--white);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.tamigo-sync-option:hover {
  border-color: #9fc3b8;
  background: #fbfefd;
}

.tamigo-sync-option:has(input:checked) {
  border-color: var(--forest);
  background: var(--oxygen);
  box-shadow: inset 4px 0 0 var(--forest);
}

.tamigo-sync-option input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  flex: 0 0 20px;
  accent-color: var(--forest);
  cursor: pointer;
}

.tamigo-sync-option span {
  display: block;
  min-width: 0;
  flex: 1;
}

.tamigo-sync-option strong {
  display: block;
}

.tamigo-sync-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.4;
}

.tamigo-email-list {
  max-height: 420px;
  margin: 16px 0;
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  list-style: none;
}

.tamigo-email-list li {
  border-bottom: 1px solid var(--line);
}

.tamigo-email-list label {
  display: flex;
  min-height: 44px;
  padding: 10px 14px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.tamigo-email-list input,
.tamigo-select-all input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  accent-color: var(--forest);
}

.tamigo-email-list label span {
  min-width: 0;
  flex: 1;
}

.tamigo-email-list label small {
  color: #8a3f3f;
}

.tamigo-email-list .tamigo-email-existing {
  background: #fdf1f1;
}

.tamigo-email-list li:last-child {
  border-bottom: 0;
}

.tamigo-select-all {
  display: inline-flex;
  margin-top: 14px;
  align-items: center;
  gap: 9px;
  color: var(--forest);
  font-weight: 700;
  cursor: pointer;
}

.tamigo-existing-warning {
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid #e8bcbc;
  border-radius: 10px;
  color: #7d3535;
  background: #fdf1f1;
}

.tamigo-existing-warning[hidden] {
  display: none;
}

.tamigo-sync-actions {
  padding: 0 28px 28px;
}

.tamigo-sync-actions form {
  margin: 0;
}

.doctor-create-form {
  max-width: 820px;
}

.week-toolbar {
  display: flex;
  margin-bottom: 18px;
  align-items: center;
  gap: 10px;
}

.week-toolbar form {
  margin: 0 0 0 auto;
}

.week-current-button {
  border-color: var(--forest);
  gap: 7px;
  background: var(--oxygen);
}

.week-current-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.week-toolbar input[type="hidden"],
form > input[type="hidden"] {
  display: none;
}

.roster-table {
  min-width: 900px;
  table-layout: fixed;
}

.roster-table th,
.roster-table td {
  padding-inline: 14px;
}

.roster-table th:nth-child(1) {
  width: 11%;
}

.roster-table th:nth-child(2) {
  width: 10%;
}

.roster-table th:nth-child(3),
.roster-table th:nth-child(4) {
  width: 19%;
}

.roster-table th:nth-child(5) {
  width: 21%;
}

.roster-table th:nth-child(6) {
  width: 20%;
}

.roster-table th[scope="row"] {
  color: var(--dark-forest);
  background: var(--white);
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
}

.roster-table select {
  width: 100%;
  min-width: 0;
}

.roster-table textarea {
  min-width: 0;
}

.roster-table td.roster-current-user {
  color: var(--dark-forest);
  background: #e3f3eb;
  box-shadow: inset 4px 0 0 var(--forest);
  font-weight: 700;
}

.roster-table td.roster-shift-missing {
  color: #793f3f;
  background: #fbeeee;
  box-shadow: inset 4px 0 0 #c97878;
}

.roster-table td.roster-shift-missing select {
  border-color: #d9aaaa;
  background: #fff8f8;
}

.roster-you-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--white);
  background: var(--forest);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  vertical-align: middle;
}

.roster-personal-legend {
  display: flex;
  width: fit-content;
  margin: 0 0 12px auto;
  align-items: center;
  gap: 8px;
  color: var(--dark-forest);
  font-size: 13px;
  font-weight: 650;
}

.roster-personal-swatch {
  width: 18px;
  height: 18px;
  border-left: 4px solid var(--forest);
  border-radius: 4px;
  background: #e3f3eb;
}

.roster-actions {
  margin-top: 18px;
}

.profile-note h2 {
  font-size: 23px;
}

.profile-note p {
  margin: 9px 0;
  color: var(--muted);
}

.compact-form {
  display: grid;
  margin: 16px 0;
  gap: 8px;
}

.compact-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compact-form-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.competency-form ul {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 6px;
  list-style: none;
}

.competency-form li label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dark-forest);
  font-size: 14px;
  font-weight: 600;
}

.competency-form input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.competency-management {
  margin-top: 24px;
}

.competency-management-body {
  padding: 24px 28px;
}

.competency-list {
  min-height: 31px;
}

.competency-editor {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.competency-editor summary {
  display: inline-flex;
  color: var(--forest);
  font-weight: 750;
  cursor: pointer;
}

.competency-editor summary:hover {
  text-decoration: underline;
}

.competency-editor[open] summary {
  margin-bottom: 16px;
}

.competency-editor .competency-form {
  display: grid;
  gap: 18px;
}

.competency-editor .competency-form ul {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.competency-editor .competency-form .button {
  justify-self: start;
}

.compact-form .button {
  margin-top: 3px;
}

.note-mark {
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--white);
  background: var(--forest);
  flex: none;
  font-weight: 700;
  place-items: center;
}

.text-link {
  font-weight: 700;
  text-decoration: none;
}

.auth-main {
  min-height: calc(100vh - 137px);
}

.auth-main + .site-footer {
  display: none;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 76px);
  grid-template-columns: minmax(360px, 0.95fr) minmax(460px, 1.05fr);
}

.auth-brand-panel {
  display: flex;
  min-height: 100%;
  padding: clamp(48px, 8vw, 100px);
  color: var(--dark-forest);
  background: var(--oxygen);
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand-panel img {
  width: 130px;
}

.auth-brand-panel h1 {
  max-width: 600px;
  font-size: clamp(42px, 5vw, 70px);
}

.auth-brand-panel p:last-child {
  max-width: 500px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.auth-form-panel {
  display: grid;
  padding: 48px 30px;
  background: var(--white);
  place-items: center;
}

.auth-form-inner,
.auth-card {
  width: min(100%, 430px);
}

.auth-form-inner h2 {
  font-size: 44px;
}

.auth-intro {
  margin: 12px 0 30px;
  color: var(--muted);
}

.auth-secondary-link {
  margin: 22px 0 0;
  text-align: center;
}

.stacked-form {
  display: grid;
  gap: 20px;
}

.form-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}

.form-error,
.field-error {
  color: var(--danger);
}

.form-error {
  margin-bottom: 22px;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--danger-bg);
}

.form-error-summary {
  border: 1px solid #e3b8b2;
}

.form-error-summary strong {
  display: block;
  margin-bottom: 3px;
}

.form-error-summary p {
  margin: 0;
}

.field-error {
  margin-top: 6px;
  font-size: 13px;
}

.danger-zone {
  display: flex;
  margin-top: 24px;
  padding: 24px 28px;
  border: 1px solid #e3b8b2;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--danger-bg);
}

.danger-zone h2 {
  color: var(--danger);
}

.danger-zone p {
  margin: 6px 0 0;
  color: var(--muted);
}

.button-danger {
  border-color: var(--danger);
  color: var(--white);
  background: var(--danger);
}

.button-danger:hover {
  border-color: #7f2119;
  background: #7f2119;
}

.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-text {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.help-text ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.auth-main-simple {
  display: grid;
  min-height: calc(100vh - 76px);
  padding: 60px 20px;
  background: var(--oxygen);
  place-items: center;
}

.auth-card {
  padding: 42px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 44px;
}

.message-list {
  padding-top: 20px;
}

.message {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .employee-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-header-actions {
    width: 100%;
  }

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

@media (max-width: 820px) {
  .header-inner {
    min-height: 68px;
    gap: 18px;
  }

  .brand img {
    width: 78px;
  }

  .account-name {
    display: none;
  }

  .main-nav {
    margin-left: auto;
    gap: 14px;
  }

  .account-nav {
    margin-left: 0;
  }

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

  .doctor-availability-summary,
  .doctor-availability-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 110px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-header-actions {
    grid-template-columns: 1fr;
  }

  .employee-filter-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .multi-select-filter,
  .multi-select-options {
    width: 100%;
  }

  .employee-filter-actions .button {
    flex: 1;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .filter-form,
  .filter-controls {
    align-items: stretch;
  }

  .filter-form {
    flex-direction: column;
  }

  select {
    width: 100%;
  }

  .week-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .week-toolbar form {
    margin-left: 0;
  }

  .profile-grid,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .holiday-row,
  .study-grid {
    grid-template-columns: 1fr;
  }

  .study-card + .study-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .auth-brand-panel {
    min-height: 360px;
    padding: 48px 30px;
  }

  .auth-brand-panel h1 {
    font-size: 46px;
  }

  .auth-form-panel {
    min-height: 560px;
  }
}

@media (max-width: 560px) {
  .page-width,
  .header-inner {
    width: min(calc(100% - 28px), var(--page-width));
  }

  .page-main {
    padding-block: 42px 60px;
  }

  .main-nav {
    display: none;
  }

  .button-quiet {
    padding-inline: 13px;
  }

  h1 {
    font-size: 42px;
  }

  .summary-card,
  .panel-header {
    padding: 22px;
  }

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

  .doctor-availability-grid {
    padding: 14px;
  }

  .doctor-availability-card header {
    flex-direction: column;
  }

  th,
  td {
    padding: 15px 20px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    display: none;
  }

  .monthly-availability-table th:nth-child(2),
  .monthly-availability-table td:nth-child(2) {
    display: table-cell;
  }

  .employee-cell small {
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-list > div {
    padding-inline: 22px;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .auth-card {
    padding: 30px 24px;
  }
}
