/* Shared additions for the integrated, desktop-first development baseline. */
html,
body {
  min-height: 100%;
  background: #f7f8f5;
}
body {
  overflow-x: hidden;
}
.screen {
  transform-origin: top left;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #397456;
  outline-offset: 3px;
}
button:disabled,
a[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}
.search input {
  min-width: 0;
  flex: 1;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.login-brand .real-logo {
  width: 260px;
  height: 190px;
  background-image: url('lotus.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: 260px 260px;
}
.welcome-logo .real-logo {
  width: 96px;
  height: 70px;
  background-image: url('lotus.png');
  background-size: 96px 96px;
  background-position: center;
}
.brand-small .real-logo {
  background-image: url('lotus.png') !important;
}
.login-card .input {
  font-family: Inter, Arial, sans-serif;
}
.checkbox-native {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.note-field textarea {
  width: 100%;
  height: 100%;
  border: 0;
  resize: vertical;
  background: transparent;
  font: inherit;
  color: inherit;
}
.handoff-panel select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font: inherit;
}
.click-row {
  cursor: pointer;
}
.click-row:hover {
  background: #f1f6ef;
}
.form-error {
  color: #a94235;
  font-size: 16px;
  line-height: 1.5;
  min-height: 0;
  margin: 10px 0;
}
.form-error:empty {
  display: none;
}
/* Form pop-ups use the Appointments "Appointment details" pop-up's layout and sizes:
   700px wide, 27px title over a divider, 15px text, 49px fields, footer band with 47px buttons. */
.app-dialog {
  width: 700px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #d9e3d6;
  border-radius: 16px;
  background: white;
  color: var(--ink);
  box-shadow: 0 18px 70px #1f352b25;
  font:
    15px/1.5 Inter,
    Arial,
    sans-serif;
}
.app-dialog::backdrop {
  background: #24372d40;
}
.app-dialog h2 {
  margin: 0;
  padding: 30px 34px;
  border-bottom: 1px solid #e0e7dc;
  font-size: 27px;
  font-weight: 600;
  line-height: 33px;
  letter-spacing: -0.6px;
}
/* Corner close button, same place and look as the Appointment details pop-up's X. */
.app-dialog h2 {
  padding-right: 80px;
}
.app-dialog .dialog-x {
  position: absolute;
  top: 32px;
  right: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: #7c897e;
  cursor: pointer;
}
.app-dialog form {
  padding: 26px 34px;
}
.app-dialog label {
  display: block;
  margin: 23px 0 0;
  font-size: 15px;
  font-weight: 600;
}
.app-dialog form > label:first-child {
  margin-top: 0;
}
.app-dialog input:not([type='checkbox']):not([type='radio']),
.app-dialog select,
.app-dialog textarea {
  display: block;
  height: 49px;
  padding: 0 15px;
  width: 100%;
  border: 1px solid #b7c9ba;
  border-radius: 8px;
  font: 400 15px Inter, Arial, sans-serif;
  color: var(--ink);
  margin-top: 10px;
}
.app-dialog textarea {
  height: 83px;
  min-height: 83px;
  padding: 12px 15px;
}
.app-dialog .dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 29px -34px -26px;
  padding: 23px 34px;
  border-top: 1px solid #e0e7db;
  background: #fcfdfa;
}
.app-dialog button,
.app-dialog .result-link {
  padding: 10px 18px;
  background: #2c624b;
  color: white;
  border: 0;
  border-radius: 8px;
  font: inherit;
}
.app-dialog .dialog-actions button {
  height: 47px;
  padding: 0 21px;
  border: 1px solid #2c624b;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.app-dialog .dialog-actions [type='submit'] {
  margin-left: auto;
}
.app-dialog .dialog-actions .secondary {
  border-color: #c0d0c1;
}
.app-dialog .secondary {
  background: white;
  border: 1px solid #c0d0c1;
  color: #3b644c;
}
.app-dialog .search-results {
  display: grid;
  gap: 8px;
}
.app-dialog .result-link {
  display: block;
  background: #eff4ec;
  color: #24372d;
}
.app-dialog .dialog-check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-dialog .dialog-check input {
  width: auto;
  margin: 0;
}
.app-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 480px;
  padding: 16px 20px;
  background: #24372d;
  color: white;
  border-radius: 10px;
  z-index: 1000;
  font:
    16px/1.5 Inter,
    Arial,
    sans-serif;
  box-shadow: 0 8px 28px #0002;
}
.app-dialog small {
  color: var(--muted);
}
.empty-state {
  padding: 32px;
  color: var(--muted);
}
.zain-screen .sidebar {
  width: 230px;
}
.zain-screen .topbar {
  left: 230px;
}
.zain-screen .brand-small {
  padding: 0 23px;
  font-size: 23px;
}
.zain-screen .nav {
  padding-left: 15px;
  padding-right: 15px;
}
.zain-screen .nav a {
  padding: 0 17px;
  font-size: 18px;
}
.z-main {
  position: absolute;
  left: 252px;
  top: 184px;
  width: 1396px;
  bottom: 25px;
  font-size: 24px;
}
.z-main h1 {
  font-size: 44px;
  font-weight: 600;
  line-height: 1.15;
  margin: 4px 0 26px;
}
.z-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 80px;
  margin-bottom: 24px;
}
.z-search {
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 40px;
  background: white;
  padding: 0 30px;
  width: 900px;
  font:
    24px Inter,
    sans-serif;
  color: var(--ink);
}
.z-btn {
  border: 1px solid transparent;
  background: #2c624b;
  color: white;
  border-radius: 8px;
  min-height: 64px;
  padding: 14px 24px;
  font:
    24px Inter,
    sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.z-toolbar > .z-btn {
  flex: 1;
  height: 80px;
}
.z-btn.outline {
  background: white;
  border-color: #aec4b6;
  color: #2c624b;
}
.z-btn.danger {
  background: #a94235;
  color: white;
}
.z-btn.red-soft {
  background: #fbece8;
  color: #24372d;
  border-color: var(--border);
}
.z-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 40px;
  background: white;
  min-height: 50px;
  padding: 10px 24px;
  color: var(--ink);
  font:
    22px Inter,
    sans-serif;
  white-space: nowrap;
}
.z-chip.active,
.z-chip:has(input:checked) {
  background: #e8f0e2;
}
.z-tabs {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 0 0 12px;
}
.z-tabs .z-chip {
  padding: 10px 30px;
}
.z-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 6px 14px;
  border: 1px solid #dce4dc;
  border-radius: 4px;
  background: #e8f0e2;
  color: #2c624b;
  font-size: 18px;
  white-space: nowrap;
}
.z-badge.blue {
  background: #eaf1f5;
  color: #52646e;
}
.z-badge.amber,
.z-note.amber {
  background: #fff4da;
  color: #855f18;
}
.z-badge.red,
.z-note.red {
  background: #fbece8;
  color: #a94235;
}
.z-badge.gray {
  background: #eef1ee;
  color: #68766d;
}
.z-badge.white {
  background: white;
  color: var(--ink);
  border-radius: 28px;
}
.z-table {
  border-collapse: collapse;
  width: 100%;
  background: white;
  font-size: 22px;
}
.z-table th {
  font-weight: 400;
  text-align: left;
  font-size: 21px;
  padding: 18px 22px;
  border: 1px solid var(--border);
}
.z-table td {
  padding: 24px 22px;
  height: 108px;
  border: 1px solid var(--border);
  vertical-align: middle;
}
.z-table td a {
  color: var(--ink);
  font-weight: 400;
}
.z-table .z-badge {
  width: 100%;
  font-size: 18px;
}
.z-table tr[data-patient],
.z-table tr[data-doctor] {
  cursor: pointer;
}
.z-table tr[data-patient]:hover,
.z-table tr[data-doctor]:hover {
  background: #f1f6ef;
}
.z-list-card {
  border: 1px solid var(--border);
  overflow: auto;
  max-height: 670px;
}
.z-foot {
  padding: 15px 18px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  background: white;
}
.z-foot .z-badge {
  min-width: 0;
  margin-right: 16px;
  font-size: 16px;
}
.z-selected {
  display: flex;
  align-items: center;
  gap: 44px;
  background: white;
  border: 1px solid var(--border);
  height: 80px;
  padding: 0 28px;
  border-radius: 40px;
  flex: 1;
}
.z-selected small {
  font-size: 18px;
  color: var(--muted);
}
.z-toolbar > .z-badge {
  border-radius: 30px;
  font-size: 20px;
  min-width: 215px;
  padding: 12px;
}
.z-patient-columns {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
  min-height: 600px;
}
.z-card {
  position: relative;
  border: 1px solid var(--border);
  background: white;
  min-height: 0;
}
.z-card h2 {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
}
.z-info {
  padding: 8px 22px;
  margin: 0;
  font-size: 19px;
}
.z-info > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.z-info dt {
  font-size: 18px;
}
.z-info dd {
  margin: 0;
  text-align: right;
}
.z-card-bottom {
  display: grid;
  gap: 15px;
  padding: 20px 22px;
  margin-top: auto;
}
.z-patient-columns > .z-card {
  display: flex;
  flex-direction: column;
}
.z-card-bottom .z-btn {
  width: 100%;
  font-size: 22px;
}
.z-stack {
  display: grid;
  gap: 20px;
  align-content: start;
}
.z-pad {
  padding: 17px 22px;
}
.z-pad p {
  line-height: 1.4;
}
.z-sub {
  font-size: 21px;
  margin-top: 12px;
}
.z-between {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.z-between small {
  flex: 1;
  font-size: 17px;
}
.z-between .z-btn {
  font-size: 19px;
  min-height: 52px;
  padding: 8px 20px;
}
.z-history {
  font-size: 19px;
}
.z-history > div {
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.z-history > div span:not(.z-badge) {
  flex: 1;
}
.z-history .z-badge {
  min-width: 180px;
  font-size: 16px;
}
.z-strike {
  text-decoration: line-through;
}
.z-banner {
  position: absolute;
  top: 0;
  right: 0;
  max-width: 940px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #e8f0e2;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 19px;
  color: #2c624b;
}
.z-banner .z-chip {
  min-height: 40px;
  padding: 6px 20px;
  font-size: 18px;
  margin-left: auto;
}
.z-overlay {
  position: absolute;
  inset: -184px -31px -25px -252px;
  background: #24372d66;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}
.z-modal {
  width: 700px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: white;
  box-shadow: 0 12px 40px #24372d18;
  overflow: hidden;
}
.z-modal.wide {
  width: 800px;
}
.z-modal h2 {
  padding: 30px 40px;
  border-bottom: 1px solid var(--border);
  font-size: 29px;
  font-weight: 600;
}
.z-modal form {
  padding: 30px 40px;
}
.z-modal form > p {
  font-size: 20px;
  margin-bottom: 28px;
}
.z-modal label {
  display: block;
  font-size: 21px;
  margin-top: 24px;
}
.z-modal label input:not([type='checkbox']):not([type='radio']),
.z-modal label select {
  display: block;
  height: 70px;
  border: 1px solid var(--border);
  border-radius: 35px;
  padding: 0 26px;
  width: 100%;
  font:
    23px Inter,
    sans-serif;
  color: var(--ink);
  background: white;
  margin-top: 10px;
}
.z-modal-actions {
  display: flex;
  gap: 40px;
  margin-top: 30px;
}
.z-modal-actions > .z-btn {
  flex: 1;
  font-size: 23px;
}
.z-note {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 21px;
  line-height: 1.5;
  margin-top: 16px;
}
.z-note small {
  font-size: 17px;
}
.z-check {
  display: flex !important;
  align-items: center;
  gap: 12px;
}
.z-check input {
  width: 24px;
  height: 24px;
  accent-color: var(--brand);
}
.z-contact {
  font-size: 18px;
}
.z-contact th {
  font-size: 18px;
  padding: 12px 16px;
}
.z-contact td {
  font-size: 18px;
  padding: 20px 16px;
  height: 105px;
}
.z-contact .z-badge {
  min-width: 160px;
  font-size: 14px;
  white-space: normal;
}
.z-log {
  position: absolute;
  right: 16px;
  top: 8px;
  min-height: 44px;
  padding: 7px 20px;
  font-size: 17px;
}
.z-doctor-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  height: 665px;
}
.z-doctor-columns > .z-card {
  display: flex;
  flex-direction: column;
}
.z-doctor-columns h3 {
  font-size: 25px;
  font-weight: 400;
  margin: 25px 22px 8px;
}
.z-doctor-columns .z-note {
  margin: 12px 22px;
  font-size: 18px;
}
.z-week {
  padding: 6px 22px;
  flex: 1;
}
.z-week > div {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 23px 0;
  border-bottom: 1px solid var(--border);
  min-height: 92px;
}
.z-week > div > span:first-child {
  min-width: 54px;
  font-size: 24px;
}
.z-week .z-badge {
  font-size: 16px;
  white-space: normal;
}
.z-modal fieldset {
  border: 0;
  padding: 0;
  margin: 24px 0;
}
.z-modal legend {
  font-size: 21px;
}
.z-modal fieldset label {
  display: inline-flex;
  margin: 10px 10px 0 0;
  font-size: 20px;
}
.z-modal fieldset input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}
.custom-hours:not([hidden]) {
  display: flex;
  gap: 20px;
}
.custom-hours label {
  flex: 1;
}
.z-main .form-error {
  font-size: 18px;
}
a[aria-current='page'] {
  background: #e8f0e6;
  color: #2f6349;
}
.z-search::placeholder {
  color: #69796e;
}

.filter-native {
  display: block;
  min-height: 48px;
  border: 1px solid #bccabb;
  border-radius: 8px;
  padding: 8px 14px;
  font:
    18px Inter,
    sans-serif;
  background: white;
  color: #24372d;
}
.cal-context:has(.calendar-patient-search) {
  padding-block: 10px;
}

.calendar-patient-search {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.cal-context:has(.calendar-patient-search) :is(.cal-context-main, .context-person) {
  width: 100%;
  min-width: 0;
}

.calendar-patient-search input {
  width: 100%;
  max-width: 390px;
  min-width: 0;
  height: 43px;
  padding: 0 13px;
  border: 1px solid #b8c8bb;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
}
.calendar-patient-results {
  position: absolute;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  inset: 100% 0 auto;
  max-width: 390px;
  max-height: 240px;
  overflow: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.calendar-patient-results:empty,
.calendar-patient-search:not(:focus-within) .calendar-patient-results {
  display: none;
}

.calendar-patient-results button,
.calendar-patient-results p {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  background: white;
  color: #24372d;
  font: 400 15px Inter, sans-serif;
  text-align: left;
}

.calendar-patient-results button:hover,
.calendar-patient-results button:focus-visible {
  background: #eff4ec;
}
.calendar-patient-results .calendar-add-patient {
  color: var(--status-ready-ink);
  font-weight: 600;
  border-top: 1px solid var(--border);
}

.filter-options {
  display: flex;
  gap: 24px;
  align-items: center;
}
.filter-section {
  margin-bottom: 28px;
}
.cal-remove {
  border: 0;
  background: transparent;
  color: #2c624b;
  font-size: 24px;
  cursor: pointer;
}
.cancel-select,
.cancel-note {
  font: inherit;
  width: 100%;
  color: inherit;
  background: #fff;
}
.cancel-note {
  padding: 12px;
  resize: vertical;
}
.checkrow label {
  display: flex;
  gap: 9px;
  align-items: center;
}
.z-row {
  display: flex;
  gap: 12px;
}
.z-row .z-btn {
  font-size: 18px;
  min-height: 48px;
  padding: 8px 20px;
}
.z-warning {
  margin: 12px 20px;
  background: #fff4da;
  padding: 12px;
  border-radius: 8px;
  font-size: 18px;
}
.z-muted {
  color: #68766d;
  padding: 12px 20px;
}
.colpatient small {
  display: block;
  font-size: 16px;
  color: #68766d;
  margin-top: 6px;
}
.review-consent input,
.filter-options input[type='checkbox'] {
  accent-color: #2c624b;
  width: 20px;
  height: 20px;
}
.request-row {
  min-height: 100px;
}
.z-btn:not(.primary):not(.danger) {
  background: white;
  border-color: #aec4b6;
  color: #2c624b;
}
.z-toolbar > .z-btn {
  background: #2c624b;
  color: white;
}
.z-main h2 {
  margin: 0;
}
.app-dialog input[type='checkbox'] {
  width: auto;
  display: inline-block;
}
.login-card input.input {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.handoff-panel textarea.note-field {
  padding: 14px;
  resize: vertical;
  font: inherit;
  line-height: 1.6;
}
.appt-scroll .empty-state {
  padding: 40px;
}
.z-info dd {
  overflow-wrap: anywhere;
}

.staff-profile {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 4px 0 24px;
}
.staff-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e8f0e6;
  color: #2c624b;
  font-size: 28px;
  font-weight: 600;
}
.staff-profile h3 {
  font-size: 23px;
  margin: 0;
}
.staff-profile p {
  color: #68766d;
  margin: 3px 0;
}
.profile-details {
  margin: 0;
}
.profile-details > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #e3eae1;
  padding: 10px 0;
  font-size: 15px;
}
.profile-details dt {
  color: #68766d;
}
.profile-details dd {
  margin: 0;
  text-align: right;
}
.profile-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 0;
}
.profile-options a {
  color: #2c624b;
}

.screen {
  visibility: hidden;
}
.screen.is-ready {
  visibility: visible;
}

.app-dialog:has(.staff-profile) {
  padding: 0;
  max-height: calc(100dvh - 32px);
}
.profile-details > div {
  padding: 7px 0;
}
.staff-profile {
  margin-bottom: 18px;
}
.profile-options {
  margin-top: 18px;
}

.modal-foot .appt-reschedule ,
.modal-foot .appt-confirm {
  margin-left: auto;
}
.modal-foot .appt-reschedule + .appt-danger {
  margin-left: 0;
}
.cal-context.rescheduling {
  background: var(--pale);
  border-color: #c9d9c6;
  box-shadow: inset 4px 0 0 var(--brand);
}
.month-day.current-day {
  background: var(--pale);
  outline: 2px dashed var(--brand);
  outline-offset: -5px;
}
.month-day.current-day.selected {
  box-shadow: inset 0 0 0 2px #578251;
}
.month-day.current-day:hover:not(.muted):not(.empty) {
  background: #e6efe2;
}
.month-day .current-appt {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.legend-dot.current {
  background: var(--pale);
  border: 1.5px dashed var(--brand);
}
.time-slot.current {
  background: white;
  border: 1px dashed var(--brand);
  color: var(--brand);
  cursor: not-allowed;
}
.time-slot.current small {
  color: var(--muted);
}
.reschedule-compare {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px 12px;
  margin: 16px 0;
  font-size: 15px;
}
.reschedule-compare dt {
  color: #6d7d70;
  font-weight: 600;
}
.reschedule-compare dd {
  margin: 0;
}
.reschedule-compare s {
  color: #8b958c;
}
.time-slot.current:disabled {
  opacity: 1;
}
.cal-result-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.cal-result-actions .cal-btn {
  width: auto;
}

.month-picker-wrap {
  position: relative;
}
.cal-month-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.cal-month-toggle:hover,
.cal-month-toggle.open {
  background: #eef4ea;
  border-color: #d8e2d5;
}
.cal-month-toggle svg {
  color: #6b7d6d;
  transition: transform 0.15s;
}
.cal-month-toggle.open svg {
  transform: rotate(180deg);
}
.month-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 300px;
  padding: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(36, 55, 45, 0.16);
  font-size: 14px;
  font-weight: 500;
}
.mp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 16px;
}
.mp-head button {
  width: 32px;
  height: 32px;
  border: 1px solid #d8e2d5;
  border-radius: 7px;
  background: white;
  color: #4c6450;
  font-size: 16px;
  cursor: pointer;
}
.mp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.mp-month {
  position: relative;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f6f8f4;
  color: #2f4636;
  font: inherit;
  cursor: pointer;
}
.mp-month:hover {
  background: #e9f1e3;
}
.mp-month.active {
  background: var(--brand);
  color: white;
}
.mp-month.has-current::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px white;
}
.mp-month.active.has-current::after {
  background: white;
  box-shadow: none;
}
.mp-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.mp-jump {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.mp-jump:hover {
  background: #eef4ea;
}
.mp-jump.current {
  color: var(--brand);
}
.mp-jump.current:hover {
  background: var(--pale);
}
.mp-jump small {
  color: #7b887d;
  font-size: 12px;
}

.month-day .day-state {
  padding: 5px 10px;
  border: 1px solid #a9cfa0;
  background: #d5ead0;
  color: #285a39;
  font-size: 14px;
  font-weight: 600;
}
.month-day .day-state.few {
  border-color: #e3bd62;
  background: #fde4a8;
  color: #7a5410;
}
.month-day .day-state.full {
  border-color: #e2a596;
  background: #f7d6cd;
  color: #963f30;
}
.month-day.muted .day-state {
  border: 0;
  background: none;
  color: #5a6b5e;
  font-size: 13px;
  font-weight: 500;
}
.month-day.muted .num {
  color: #8a9486;
}
.month-day:disabled {
  opacity: 1;
  cursor: not-allowed;
}
.month-grid ~ .cal-legend {
  gap: 26px;
  color: #3f5045;
  font-size: 13px;
  font-weight: 500;
}
.month-grid ~ .cal-legend .legend-dot {
  width: 16px;
  height: 16px;
  border: 1.5px solid #7fb274;
  border-radius: 4px;
  background: #d5ead0;
}
.month-grid ~ .cal-legend .legend-dot.few {
  border-color: #d4a640;
  background: #fde4a8;
}
.month-grid ~ .cal-legend .legend-dot.full {
  border-color: #d48a78;
  background: #f7d6cd;
}
.month-grid ~ .cal-legend .legend-dot.off {
  border-color: #9aa79c;
  background: #eff2ed;
}
.month-grid ~ .cal-legend .legend-dot.current {
  border: 2px dashed var(--brand);
  background: var(--pale);
}

.stats a.stat,
.workspace-screen a.continue {
  text-decoration: none;
}
.stats a.stat:hover {
  border-color: var(--brand);
  background: #f9fcf8;
}
.stats a.stat:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.workspace-screen a.continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.detail-actions [hidden] {
  display: none;
}
#handoff-form .notify-row label {
  margin: 0;
}

.sign-in-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.login-card .security {
  margin-top: 24px;
}
.profile-options {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}
.notification-count {
  position: absolute;
  top: 3px;
  right: 0;
  padding: 2px 5px;
  border-radius: 10px;
  color: white;
  background: #a94235;
  font-size: 11px;
  line-height: 14px;
}
.topbar .iconbtn[hidden],
.notification-count[hidden] {
  display: none;
}
.notification-panel {
  position: fixed;
  inset: auto;
  width: min(360px, calc(100vw - 24px));
  max-height: min(430px, 65vh);
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  color: #24372d;
  box-shadow: 0 12px 32px rgb(36 55 45 / 16%);
}
.notification-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: #f4f7f1;
  border-bottom: 1px solid var(--border);
}
.notification-heading h2 {
  margin: 0;
  font-size: 18px;
}
.notification-summary,
.notification-link time {
  color: var(--muted);
  font-size: 13px;
}
.notification-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.notification-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;
}
.notification-link:hover,
.notification-link:focus-visible {
  background: #eff4ec;
}
.notification-list li:last-child .notification-link {
  border-bottom: 0;
}
.notification-link time {
  display: block;
  margin-top: 4px;
}
.notification-unread {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  background: #e8f2e4;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.notification-empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
}
.today-logo {
  flex-shrink: 0;
  object-fit: cover;
}

.clinicflow-viewport {
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
}
.screen:is(.workspace-screen, .auth-screen) {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.screen.workspace-screen {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  grid-template-rows: 80px minmax(0, 1fr) auto;
}
.screen.workspace-screen > .sidebar {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 1 / -1;
  width: auto;
  height: auto;
  min-height: 0;
  overflow: auto;
}
.screen.workspace-screen .brand-small {
  height: 80px;
  padding: 0 17px;
  font-size: 22px;
}
.screen.workspace-screen .nav {
  padding: 22px 17px;
  gap: 8px;
}
.screen.workspace-screen .nav a {
  height: 48px;
  padding: 0 19px;
}
.screen.workspace-screen > .topbar {
  position: relative;
  inset: auto;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  height: 80px;
  padding: 0 28px;
  gap: 16px;
}
.workspace-screen .topbar .search {
  width: min(650px, 100%);
}
.workspace-screen .clinic-clock {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.screen.workspace-screen > :is(.dashboard-main, .request-main, .appt-main, .cal-main, .z-main) {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 2;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
}
.workspace-screen > .page-bottom {
  position: static;
  grid-column: 2;
  grid-row: 3;
  padding: 5px 28px 8px;
}
.workspace-screen .stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.workspace-screen .stat {
  width: auto;
  height: auto;
  min-height: 96px;
  gap: 12px;
  padding: 12px;
}
.workspace-screen .stat-icon {
  flex-shrink: 0;
}
.workspace-screen a.stat::after {
  content: '→' / '';
  margin-left: auto;
  color: var(--brand);
  font-size: 16px;
}
.workspace-screen .stat-number {
  font-size: 33px;
  line-height: 36px;
}
.workspace-screen .stat-label {
  font-size: 14px;
  line-height: 19px;
}
.workspace-screen .work-area {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(235px, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.workspace-screen :is(.tasks, .activity) {
  width: auto;
  min-width: 0;
}
.workspace-screen .activity {
  margin-top: 0;
  border: 0;
  background: none;
}
.workspace-screen .work-area h2 {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  font-size: 23px;
  line-height: 30px;
}
.workspace-screen .activity-scroll {
  height: auto;
  max-height: 340px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.workspace-screen .event {
  padding: 12px 16px;
}
.workspace-screen .event:last-child {
  border-bottom: 0;
}
.workspace-screen .event p {
  line-height: 20px;
}
.workspace-screen .event p a {
  display: block;
}
.workspace-screen .event time {
  margin-top: 4px;
  color: var(--muted);
}
.workspace-screen :is(.task-head, .task-row) {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 0.78fr minmax(152px, 1.25fr) 112px;
  gap: 10px;
  padding: 0 14px;
}
.workspace-screen :is(.colpatient, .colowner, .colstatus, .colaction) {
  width: auto;
}
.workspace-screen .task-scroll {
  height: auto;
  max-height: 340px;
}
.workspace-screen .task-head {
  height: 47px;
}
.workspace-screen .task-row {
  height: auto;
  min-height: 65px;
  padding-block: 8px;
}
.workspace-screen .task-row .status {
  padding: 5px 8px;
}
.workspace-screen .patient-task {
  margin-top: 4px;
}
.workspace-screen .task-foot {
  padding: 12px 14px;
}
.workspace-screen .task-box {
  display: flex;
  flex-direction: column;
  max-height: 100%;
}
.workspace-screen .task-row .continue {
  width: 100%;
  min-width: auto;
}
.workspace-screen :is(.toolbar, .filter-chips, .detail-actions) {
  flex-wrap: wrap;
}
.workspace-screen .request-main > .toolbar {
  margin-top: 24px;
  gap: 12px;
}
.request-main .toolbar :is(.local-search, .filter-select, .new-request) {
  height: 48px;
}
.request-main .toolbar .local-search {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0 13px;
  gap: 10px;
}
.request-main .local-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px #dce8df;
}
.request-main .local-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
}
.request-main .local-search input:focus-visible {
  outline: none;
}
.request-main .local-search input::placeholder {
  color: var(--muted);
}
.request-main .toolbar .filter-select {
  width: 172px;
  padding: 0 36px 0 13px;
  background-position: right 11px center;
  background-size: 18px;
  color: var(--ink);
}
.request-main .toolbar .new-request {
  width: 155px;
  font-size: 15px;
}
.request-main .filter-chips {
  gap: 8px;
  margin-top: 16px;
}
.request-main .filter-chips .chip {
  gap: 8px;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 14px;
}
.request-main .chip-count {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 10px;
  background: #ffffffa6;
  text-align: center;
  font-size: 12px;
}
.request-main .filter-chips .chip[aria-pressed='true'] {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}
.request-main .filter-chips .chip-all[aria-pressed='true'] {
  background: var(--pale);
  color: var(--brand);
}
.workspace-screen .request-table {
  overflow-x: auto;
}
.workspace-screen :is(.request-head, .request-row) {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.1fr 0.7fr 1.3fr 1fr 106px;
  gap: 12px;
  padding: 0 16px;
}
.workspace-screen :is(.request-head, .request-scroll) {
  min-width: 900px;
}
.workspace-screen .request-scroll {
  height: auto;
  max-height: 420px;
}
.workspace-screen .request-row {
  min-height: 70px;
}
.workspace-screen :is(.request-head, .request-row) > div {
  width: auto;
  min-width: 0;
}
.workspace-screen .request-row .continue {
  width: 100%;
  min-width: 0;
}
.workspace-screen .detail-card {
  width: auto;
  min-width: 0;
  flex: 1;
}
.workspace-screen .history-note {
  overflow-wrap: anywhere;
}
.workspace-screen .handoff-panel {
  position: fixed;
  top: 80px;
  z-index: 3;
  height: calc(100dvh - 80px);
  overflow-y: auto;
}
.workspace-screen .handoff-panel .panel-actions {
  position: static;
  margin-top: 24px;
}
@media (max-width: 1140px) {
  .workspace-screen .work-area {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Front-desk status colours. Text names the state on every badge and filter. */
:root {
  --status-ready-bg: #e8f1e7;
  --status-ready-ink: #2e5940;
  --status-ready-edge: #c1d5c1;
  --status-waiting-bg: #edf1f4;
  --status-waiting-ink: #3d5564;
  --status-waiting-edge: #cdd8df;
  --status-action-bg: #fbf1dd;
  --status-action-ink: #75521f;
  --status-action-edge: #e5d1a7;
  --status-urgent-bg: #f8e8e5;
  --status-urgent-ink: #903f36;
  --status-urgent-edge: #e8bdb6;
  --status-neutral-bg: #eff1ee;
  --status-neutral-ink: #515d55;
  --status-neutral-edge: #d9ded9;
}
:is(.status, .z-badge, .chip).green,
.appt-status,
.zain-screen .z-chip[data-filter='clinic'],
.month-day .day-state,
.month-grid ~ .cal-legend .legend-dot {
  --badge-bg: var(--status-ready-bg);
  --badge-ink: var(--status-ready-ink);
  --badge-edge: var(--status-ready-edge);
}
:is(.status, .z-badge, .chip).blue,
.zain-screen .z-chip:is([data-filter='waiting'], [data-group='Contacted']) {
  --badge-bg: var(--status-waiting-bg);
  --badge-ink: var(--status-waiting-ink);
  --badge-edge: var(--status-waiting-edge);
}
:is(.status, .z-badge, .chip, .z-note).amber,
.status.yellow,
.appt-status.pending,
.appt-follow-up,
.zain-screen .z-chip:is([data-filter='absence'], [data-group='To contact']),
.month-day .day-state.few,
.month-grid ~ .cal-legend .legend-dot.few {
  --badge-bg: var(--status-action-bg);
  --badge-ink: var(--status-action-ink);
  --badge-edge: var(--status-action-edge);
}
:is(.status, .z-badge, .z-note).red,
.chip.danger,
.zain-screen .z-chip[data-filter='overdue'],
.stats .stat[data-request-filter='Overdue'] .stat-icon {
  --badge-bg: var(--status-urgent-bg);
  --badge-ink: var(--status-urgent-ink);
  --badge-edge: var(--status-urgent-edge);
}
:is(.status, .z-badge, .chip, .z-note).gray,
.appt-status.cancelled,
.zain-screen .z-chip[data-group='Done'],
.month-day .day-state:is(.full, .closed),
.month-grid ~ .cal-legend .legend-dot:is(.full, .off),
.stats .stat[data-empty] .stat-icon {
  --badge-bg: var(--status-neutral-bg);
  --badge-ink: var(--status-neutral-ink);
  --badge-edge: var(--status-neutral-edge);
}
.status:is(.green, .amber, .yellow, .blue, .red, .gray),
:is(.appt-status, .appt-status.pending, .appt-status.cancelled),
.appt-follow-up {
  background: var(--badge-bg);
  color: var(--badge-ink);
  box-shadow: inset 0 0 0 1px var(--badge-edge);
}
:is(.chip, .z-badge):is(.green, .blue, .amber, .red, .danger, .gray),
.z-note:is(.amber, .red, .gray),
.zain-screen .z-chip:is([data-filter='clinic'], [data-filter='waiting'], [data-filter='absence'], [data-filter='overdue'], [data-group='Contacted'], [data-group='To contact'], [data-group='Done']),
.month-day:not(.muted) .day-state,
.month-day.muted .day-state.closed,
.month-grid ~ .cal-legend .legend-dot:not(.current) {
  background: var(--badge-bg);
  color: var(--badge-ink);
  border-color: var(--badge-edge);
}
.month-day.muted .day-state:not(.closed) {
  color: var(--status-neutral-ink);
}
.stats .stat .stat-icon {
  --badge-bg: var(--status-action-bg);
  --badge-ink: var(--status-action-ink);
  background: var(--badge-bg);
  color: var(--badge-ink);
}
.appt-follow-up {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 12px;
}

/* ---------- Dropdowns: one larger chevron on every page instead of the browser's small arrow ---------- */
select,
select.filter-select,
.handoff-panel select.filter-select,
select.appt-select,
select.cancel-select,
select.filter-native,
.app-dialog select,
.z-modal label select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 52px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324372d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 22px;
  cursor: pointer;
}
/* Confirm appointment button */
.appt-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 47px;
  padding: 0 21px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #8fc07c;
  background: white;
  color: #1d4d33;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

/* Confirm appointment button hover */
.appt-confirm:hover {
  background: #eff5ea;
}

/* Keyboard navigation */
.appt-confirm:focus-visible {
  outline: 2px solid #1d4d33;
  outline-offset: 3px;
}

/* Secondary appointment button hover effects */
.appt-modal .appt-secondary {
  transition: background-color 0.15s ease;
}

.appt-modal .appt-secondary:hover {
  background: #eff5ea;
}

/* Cancellation button hover effect */
.appt-modal .appt-danger:not(.solid) {
  transition: background-color 0.15s ease;
}

.appt-modal .appt-danger:not(.solid):hover {
  background: #fbece8;
}

/* ========== Booking Notes ========== */

/* Booking notes heading and edit button */
.booking-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.booking-note-header h4 {
  margin: 0;
}

/* Preserve paragraphs and line breaks in saved notes */
#booking-notes-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 180px;
  overflow-y: auto;
}

/* Edit and add notes button */
.appt-note-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #c0d0c1;
  border-radius: 6px;
  background: white;
  color: #3b644c;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.appt-note-edit:hover {
  background: #eff5ea;
}

/* Booking notes text field */
.booking-notes-input {
  display: block;
  width: 100%;
  min-height: 110px;
  max-height: 180px;
  padding: 12px 15px;
  border: 1px solid #b7c9ba;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: 400 15px/1.6 Inter, Arial, sans-serif;
  resize: vertical;
}

.booking-notes-input::placeholder {
  color: var(--muted);
}

/* Editor button layout */
.booking-notes-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

/* Smaller secondary buttons inside the notes editor */
.booking-notes-actions .appt-secondary {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* Save notes button */
.appt-note-save {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #8fc07c;
  background: white;
  color: #1d4d33;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.appt-note-save:hover {
  background: #eff5ea;
}

/* Ensure hidden elements are not displayed */
.booking-note [hidden] {
  display: none !important;
}

/* ========== Appointment Date Filter ========== */

/* Calendar wrapper */
.appt-date-wrapper {
  position: relative;
  width: 360px;
  flex-shrink: 0;
}

/* Date selection button */
.appt-date-container {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  width: 100%;
  padding: 0 16px;
  background: white;
  border: 1px solid #bbcbbe;
  border-radius: 8px;
  cursor: pointer;
}

/* Appointment date label */
.appt-date-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* Currently selected date */
.appt-date-value {
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
}

/* Calendar icon */
.appt-date-icon {
  width: 24px;
  height: 24px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--ink);
}

/* ========== Calendar Dropdown ========== */

/* Calendar container */
.appt-calendar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  padding: 16px;
  background: white;
  border: 1px solid #bbcbbe;
  border-radius: 10px;
  box-shadow: 0 8px 24px #24372d20;
  z-index: 5;
}

.appt-calendar-popup[hidden] {
  display: none;
}

/* Month and navigation header */
.appt-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.appt-calendar-month {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

/* Previous and next month buttons */
.appt-calendar-navigation {
  display: flex;
  gap: 6px;
}

.appt-calendar-arrow {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.appt-calendar-arrow:hover {
  background: #eff5ea;
}

/* Calendar grid */
.appt-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

/* Weekday labels */
.appt-calendar-weekday {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 8px;
}

/* Individual calendar days */
.appt-calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

/* Hover over a calendar day */
.appt-calendar-day:hover {
  background: #eff5ea;
}

/* Currently selected calendar day */
.appt-calendar-day.selected {
  background: #cfe8c4;
  border-color: #8fc07c;
  color: #1d4d33;
  font-weight: 600;
}

/* Appointment indicator dot */
.appt-calendar-dot {
  display: block;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand);
}

/* Invisible dot maintains consistent date alignment */
.appt-calendar-dot.empty-dot {
  visibility: hidden;
}

/* Calendar indicator legend */
.appt-calendar-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* Balance the appointment filter widths */
.appt-filters .appt-search {
  flex: 1;
  width: auto;
  min-width: 280px;
}

.appt-filters select.appt-select {
  flex-shrink: 0;
}

/* ========== Calendar Month and Year Selection ========== */

.appt-calendar-month-year {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* Month and year dropdowns */
select.appt-calendar-select {
  height: 32px;
  padding: 0 27px 0 8px;
  border: 1px solid #c0d0c1;
  border-radius: 6px;
  background-color: white;
  background-size: 14px;
  background-position: right 7px center;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

#appt-month-select {
  width: 116px;
}

#appt-year-select {
  width: 80px;
}


/* ========== Calendar Footer ========== */

.appt-calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Override the previous legend spacing */
.appt-calendar-footer .appt-calendar-legend {
  margin: 0;
  padding: 0;
  border: none;
}

/* Today button */
.appt-calendar-today {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #c0d0c1;
  border-radius: 6px;
  background: white;
  color: #3b644c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.appt-calendar-today:hover {
  background: #eff5ea;
}

/* Highlight today's date */
.appt-calendar-day.today {
  border-color: var(--brand);
  font-weight: 600;
}

.workspace-screen > :is(.appt-main, .request-main:has(> .request-table), .cal-main:has(> .cal-layout)),
.screen.workspace-screen.zain-screen > .z-main:has(> .z-list-card) {
  display: flex;
  flex-direction: column;
}
.workspace-screen > :is(.appt-main, .request-main, .cal-main) > :not(.appt-table, .request-table, .cal-layout),
.screen.workspace-screen.zain-screen > .z-main > :not(.z-list-card) {
  flex-shrink: 0;
}
.workspace-screen :is(.appt-table, .request-table) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 160px;
}
.workspace-screen :is(.appt-table, .request-table) > :not(.appt-scroll, .request-scroll) {
  flex-shrink: 0;
}
.workspace-screen :is(.appt-scroll, .request-scroll) {
  height: auto;
  max-height: none;
  min-height: 0;
  flex: 1;
}
.workspace-screen .request-table {
  margin-top: 20px;
}
.workspace-screen .table-topline {
  padding-block: 14px;
}
.workspace-screen .cal-controlbar,
.workspace-screen .cal-context {
  flex-wrap: wrap;
  gap: 12px;
}
.workspace-screen .appt-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1.3fr)) repeat(2, minmax(0, 0.85fr));
  gap: 12px;
  margin-top: 22px;
}
.workspace-screen .appt-filters > * {
  width: 100%;
  min-width: 0;
}
.workspace-screen .appt-tabs {
  margin-top: 16px;
  height: 50px;
}
.workspace-screen .appt-table {
  margin-top: 16px;
  overflow-x: auto;
}
.workspace-screen :is(.appt-head, .appt-row) {
  display: grid;
  grid-template-columns: 0.85fr 1.35fr 1fr 0.75fr 1.15fr 150px;
  min-width: 800px;
  gap: 12px;
  padding-inline: 16px;
}
.workspace-screen .appt-head {
  height: 47px;
}
.workspace-screen .appt-row {
  height: auto;
  min-height: 74px;
  padding-block: 10px;
}
.workspace-screen :is(.appt-head, .appt-row) > div {
  width: auto;
  min-width: 0;
}
.workspace-screen .appt-scroll {
  min-width: 800px;
}

.workspace-screen .cal-head {
  margin-bottom: 16px;
}
.workspace-screen .cal-context {
  margin-bottom: 14px;
  padding: 12px 16px;
}
.workspace-screen .cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 23%, 282px);
  gap: 16px;
  flex: 1;
  min-height: 245px;
}
.workspace-screen .cal-layout > * {
  width: auto;
  min-width: 0;
  min-height: 0;
}
.workspace-screen :is(.cal-grid-box, .day-table) {
  display: flex;
  flex-direction: column;
}
.workspace-screen :is(.weekday-row, .day-table-head, .cal-legend, .selection-head, .selection-foot) {
  flex-shrink: 0;
}
.workspace-screen :is(.month-grid, .day-scroll, .selection-body) {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.workspace-screen .month-day {
  height: clamp(60px, 8.5dvh, 82px);
  padding: 8px;
}
.workspace-screen .month-day :is(.day-state, .current-appt) {
  white-space: normal;
}
.workspace-screen .month-grid ~ .cal-legend {
  flex-wrap: wrap;
  gap: 8px 16px;
  height: auto;
  min-height: 42px;
  padding-block: 8px;
}
.workspace-screen .selection-head {
  padding: 13px 15px;
}
.workspace-screen :is(.selection-body, .selection-foot) {
  padding: 15px;
}
.workspace-screen .day-scroll {
  height: auto;
}
.workspace-screen .day-colhead {
  min-width: 0;
  padding: 10px;
}
.workspace-screen .time-slot {
  white-space: normal;
  gap: 6px;
  padding-inline: 8px;
}

.screen.workspace-screen.zain-screen .z-patient-columns {
  grid-template-columns: minmax(245px, 0.75fr) minmax(0, 1.45fr);
  min-height: 0;
  gap: 16px;
}
.screen.workspace-screen.zain-screen .z-doctor-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: auto;
  gap: 16px;
}
.screen.workspace-screen.zain-screen :is(.z-tabs, .z-between, .z-week > div) {
  flex-wrap: wrap;
}
.screen.workspace-screen.zain-screen .z-table :is(th, td) {
  height: auto;
  padding: 13px 16px;
}
.screen.workspace-screen.zain-screen .z-main > .z-list-card {
  min-height: 160px;
}
.screen.workspace-screen.zain-screen .z-overlay {
  position: fixed;
  inset: 0;
}

.screen.auth-screen {
  display: grid;
  place-items: center;
  padding: 16px;
}
.screen.auth-screen:has(.login-brand) {
  grid-template-columns: 46% minmax(0, 1fr);
  padding: 0;
}
.auth-screen .login-brand {
  position: static;
  width: 100%;
  height: 100%;
  justify-content: center;
  padding: 20px;
  text-align: center;
}
.auth-screen .login-brand .real-logo {
  width: 220px;
  height: 148px;
  background-size: 220px;
}
.auth-screen .login-brand h1 {
  font-size: 44px;
  margin-top: 14px;
}
.auth-screen .login-brand .tagline {
  font-size: 17px;
  margin-top: 10px;
}
.auth-screen .process {
  margin-top: clamp(18px, 6dvh, 48px);
  gap: 16px;
}
.auth-screen .process-item {
  width: auto;
  gap: 8px;
  font-size: 15px;
}
.auth-screen .process-item svg {
  width: 36px;
  height: 36px;
}
.auth-screen :is(.login-card, .welcome-card) {
  position: static;
  width: min(500px, calc(100% - 32px));
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(20px, 4dvh, 36px);
}
.auth-screen .login-card h2 {
  margin-bottom: 20px;
}
.auth-screen .field {
  margin-top: 16px;
  gap: 8px;
}
.auth-screen :is(.login-card .input, .btn) {
  height: 46px;
}
.auth-screen .checkrow {
  margin: 16px 0 18px;
}
.auth-screen .welcome-card {
  width: min(500px, 100%);
}
.auth-screen .welcome-card h1 {
  margin-top: 15px;
  font-size: 29px;
}
.auth-screen :is(.signed-as, .role-row, .snapshot, .welcome-card .security, .welcome-card .btn, .switch) {
  margin-top: 14px;
}
.auth-screen .snapshot h2,
.auth-screen .snapshot-row {
  padding: 10px 14px;
}
.auth-screen .snapshot-row {
  font-size: 16px;
}
.auth-screen .screen-corner {
  bottom: 12px;
  right: 16px;
  pointer-events: none;
}

@media (max-width: 1050px) {
  .workspace-screen .cal-layout,
  .screen.workspace-screen.zain-screen :is(.z-patient-columns, .z-doctor-columns) {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-screen > .cal-main:has(> .cal-layout) {
    display: block;
  }
  .workspace-screen :is(.cal-grid-box, .day-table) {
    max-height: 450px;
  }
  .workspace-screen .appt-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .screen.auth-screen:has(.login-brand) {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-screen .login-brand {
    display: none;
  }
}

.rec-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}
.zain-screen .rec-heading {
  margin-bottom: 22px;
}
.zain-screen .z-main .rec-heading h1 {
  margin: 0;
}
.rec-help {
  min-height: 36px;
  padding: 0 12px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--brand);
  font-size: 14px;
  font-weight: 500;
}
.rec-help span {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
}
.rec-help:hover {
  background: var(--pale);
}

.rec-help-dialog .rec-topics {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.rec-topics li {
  padding: 12px 14px;
}
.rec-topics li + li {
  border-top: 1px solid var(--border);
}
.rec-topics p {
  margin: 3px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.rec-shortcuts {
  padding: 9px 2px 0;
  color: var(--brand);
}
.rec-shortcuts summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.rec-keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  margin: 0;
  font-size: 15px;
}
.rec-keys > div {
  display: flex;
  gap: 10px;
}
.rec-keys dd {
  margin: 0;
}

.cal-filter-summary {
  color: var(--muted);
  font-size: 14px;
}
.calendar-advanced .calendar-filter-intro {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}
.calendar-advanced .calendar-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.calendar-advanced form label {
  font-size: 14px;
  font-weight: 600;
}
.calendar-advanced select,
.slot-doctor select {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: white;
  color: var(--ink);
  font-weight: 400;
}
.calendar-filter-days {
  border: 0;
  padding: 0;
  margin: 16px 0 0;
}
.calendar-filter-days legend {
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}
.calendar-filter-days > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.calendar-advanced .calendar-filter-days label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}
.calendar-advanced .calendar-filter-days label:has(input:checked) {
  background: var(--status-ready-bg);
  border-color: var(--status-ready-edge);
}
.calendar-advanced .calendar-filter-days input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
}
.calendar-advanced .calendar-reset {
  margin-right: auto;
}
.slot-doctor {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  font-size: 13px;
}
.slot-doctor select {
  width: 100%;
  padding: 6px 37px 6px 9px;
  background-position: right 10px center;
  background-size: 17px;
}
.workspace-screen .month-day .day-state.full,
.workspace-screen .cal-legend .legend-dot.full {
  background: #f8e8e3;
  color: #833f33;
  border: 1px solid #deb0a4;
}
.workspace-screen .month-day .day-state.off,
.workspace-screen .cal-legend .legend-dot.off {
  background: transparent;
  color: var(--muted);
  border: 1px dashed #abb5ae;
}
.workspace-screen .month-day .day-state.closed,
.workspace-screen .cal-legend .legend-dot.closed {
  background: var(--status-waiting-bg);
  color: var(--status-waiting-ink);
  border: 1px solid var(--status-waiting-edge);
}
.workspace-screen .month-day .day-state:is(.off, .closed) {
  padding: 3px 6px;
  font-size: 12px;
}
.workspace-screen .week-row:has(.day-state.closed) .month-day {
  min-height: 84px;
}

@media (max-width: 850px) {
  .workspace-screen .month-day {
    height: 84px;
  }
  .calendar-patient-search {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .calendar-patient-results {
    grid-row: 2;
    grid-column: 1;
  }
}
