/* PZ-Med schedules/timesheets dark-theme compatibility, 2026-08-30. */
html[data-theme="dark"] .schedule-page,
html[data-theme="dark"] .schedule-settings-page,
html[data-theme="dark"] .receiving-page,
html[data-theme="dark"] .timesheet-page {
  color: var(--theme-text, #effff9);
}

html[data-theme="dark"] .schedule-tabs,
html[data-theme="dark"] .schedule-matrix-card,
html[data-theme="dark"] .schedule-empty,
html[data-theme="dark"] .schedule-settings-intro,
html[data-theme="dark"] .schedule-settings-empty,
html[data-theme="dark"] .schedule-policy-card,
html[data-theme="dark"] .receiving-card,
html[data-theme="dark"] .receiving-empty,
html[data-theme="dark"] .schedule-dialog__panel {
  color: var(--theme-text, #effff9) !important;
  background: var(--theme-surface, #0d1915) !important;
  border-color: color-mix(in srgb, var(--theme-primary, #49ddb1) 18%, transparent) !important;
}

html[data-theme="dark"] .schedule-matrix thead th,
html[data-theme="dark"] .schedule-matrix__employee {
  color: var(--theme-text, #effff9) !important;
  background: var(--theme-surface, #0d1915) !important;
}

html[data-theme="dark"] .schedule-matrix-wrap,
html[data-theme="dark"] .schedule-policy-form,
html[data-theme="dark"] .schedule-shifts__table th,
html[data-theme="dark"] .schedule-shifts__table td,
html[data-theme="dark"] .schedule-matrix th,
html[data-theme="dark"] .schedule-matrix td {
  border-color: color-mix(in srgb, var(--theme-primary, #49ddb1) 12%, transparent) !important;
}

html[data-theme="dark"] .schedule-pattern-rules,
html[data-theme="dark"] .schedule-dialog__current,
html[data-theme="dark"] .schedule-cell.is-working {
  background: color-mix(in srgb, var(--theme-primary, #49ddb1) 7%, transparent) !important;
}

html[data-theme="dark"] .schedule-cell.is-unavailable {
  background: rgba(229, 132, 80, 0.12) !important;
}

html[data-theme="dark"] .schedule-cell__button {
  color: var(--theme-text, #effff9) !important;
}

html[data-theme="dark"] .schedule-cell__button:hover {
  background: color-mix(in srgb, var(--theme-primary, #49ddb1) 10%, transparent) !important;
}

html[data-theme="dark"] .schedule-tabs a,
html[data-theme="dark"] .schedule-policy-card > summary,
html[data-theme="dark"] .receiving-card__person h2,
html[data-theme="dark"] .receiving-card__person p,
html[data-theme="dark"] .receiving-card__time strong,
html[data-theme="dark"] .schedule-dialog__heading strong,
html[data-theme="dark"] .schedule-dialog label > span,
html[data-theme="dark"] .schedule-policy-grid label > span,
html[data-theme="dark"] .schedule-filters label > span,
html[data-theme="dark"] .receiving-filters label > span {
  color: var(--theme-text, #effff9) !important;
}

html[data-theme="dark"] .schedule-tabs a.is-active,
html[data-theme="dark"] .schedule-cell__button strong,
html[data-theme="dark"] .schedule-page__eyebrow,
html[data-theme="dark"] .schedule-settings-header > p,
html[data-theme="dark"] .receiving-header > p,
html[data-theme="dark"] .receiving-card.is-now .receiving-card__state {
  color: var(--theme-primary, #49ddb1) !important;
}

html[data-theme="dark"] .schedule-tabs a.is-active {
  background: color-mix(in srgb, var(--theme-primary, #49ddb1) 14%, transparent) !important;
}

html[data-theme="dark"] .schedule-page__header p,
html[data-theme="dark"] .schedule-matrix-card__heading span,
html[data-theme="dark"] .schedule-matrix-card__hint,
html[data-theme="dark"] .schedule-matrix thead th small,
html[data-theme="dark"] .schedule-matrix__employee small,
html[data-theme="dark"] .schedule-cell__no-reception,
html[data-theme="dark"] .schedule-cell__empty,
html[data-theme="dark"] .schedule-empty,
html[data-theme="dark"] .schedule-dialog__heading span,
html[data-theme="dark"] .schedule-dialog__current span,
html[data-theme="dark"] .schedule-dialog__help,
html[data-theme="dark"] .schedule-settings-header > span,
html[data-theme="dark"] .schedule-settings-intro span,
html[data-theme="dark"] .schedule-settings-intro p,
html[data-theme="dark"] .schedule-settings-empty,
html[data-theme="dark"] .schedule-policy-card > summary small,
html[data-theme="dark"] .schedule-shifts__heading span,
html[data-theme="dark"] .schedule-shifts__table th,
html[data-theme="dark"] .schedule-pattern-rules section > p,
html[data-theme="dark"] .receiving-header > span,
html[data-theme="dark"] .receiving-card__person span,
html[data-theme="dark"] .receiving-card__time span,
html[data-theme="dark"] .receiving-card__time small,
html[data-theme="dark"] .receiving-empty {
  color: var(--theme-text-muted, #a9beb7) !important;
}

html[data-theme="dark"] .schedule-page input,
html[data-theme="dark"] .schedule-page select,
html[data-theme="dark"] .schedule-settings-page input,
html[data-theme="dark"] .schedule-settings-page select,
html[data-theme="dark"] .receiving-page input,
html[data-theme="dark"] .receiving-page select,
html[data-theme="dark"] .schedule-dialog input,
html[data-theme="dark"] .schedule-dialog select,
html[data-theme="dark"] .timesheet-page input,
html[data-theme="dark"] .timesheet-page select,
html[data-theme="dark"] .timesheet-page textarea,
html[data-theme="dark"] .schedule-page .remote-select__input,
html[data-theme="dark"] .schedule-settings-page .remote-select__input,
html[data-theme="dark"] .receiving-page .remote-select__input {
  color: var(--theme-text, #effff9) !important;
  background: var(--theme-input-bg, #10221c) !important;
  border-color: color-mix(in srgb, var(--theme-primary, #49ddb1) 20%, transparent) !important;
  color-scheme: dark;
}

html[data-theme="dark"] .schedule-page input::placeholder,
html[data-theme="dark"] .schedule-settings-page input::placeholder,
html[data-theme="dark"] .receiving-page input::placeholder,
html[data-theme="dark"] .schedule-dialog input::placeholder,
html[data-theme="dark"] .timesheet-page input::placeholder {
  color: var(--theme-text-muted, #93aaa2) !important;
}

html[data-theme="dark"] .schedule-page option,
html[data-theme="dark"] .schedule-settings-page option,
html[data-theme="dark"] .receiving-page option,
html[data-theme="dark"] .schedule-dialog option,
html[data-theme="dark"] .timesheet-page option {
  color: var(--theme-text, #effff9);
  background: var(--theme-surface, #0d1915);
}

html[data-theme="dark"] .schedule-page .remote-select__dropdown,
html[data-theme="dark"] .schedule-settings-page .remote-select__dropdown,
html[data-theme="dark"] .receiving-page .remote-select__dropdown,
html[data-theme="dark"] .timesheet-page .remote-select__dropdown {
  color: var(--theme-text, #effff9) !important;
  background: var(--theme-surface, #0d1915) !important;
  border-color: color-mix(in srgb, var(--theme-primary, #49ddb1) 22%, transparent) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme="dark"] .schedule-page .remote-select__option,
html[data-theme="dark"] .schedule-settings-page .remote-select__option,
html[data-theme="dark"] .receiving-page .remote-select__option,
html[data-theme="dark"] .timesheet-page .remote-select__option {
  color: var(--theme-text, #effff9) !important;
  background: transparent !important;
}

html[data-theme="dark"] .schedule-page .remote-select__option:hover,
html[data-theme="dark"] .schedule-page .remote-select__option--active,
html[data-theme="dark"] .schedule-settings-page .remote-select__option:hover,
html[data-theme="dark"] .schedule-settings-page .remote-select__option--active,
html[data-theme="dark"] .receiving-page .remote-select__option:hover,
html[data-theme="dark"] .receiving-page .remote-select__option--active,
html[data-theme="dark"] .timesheet-page .remote-select__option:hover,
html[data-theme="dark"] .timesheet-page .remote-select__option--active {
  background: color-mix(in srgb, var(--theme-primary, #49ddb1) 12%, transparent) !important;
}

html[data-theme="dark"] .schedule-page .remote-select__empty,
html[data-theme="dark"] .schedule-settings-page .remote-select__empty,
html[data-theme="dark"] .receiving-page .remote-select__empty,
html[data-theme="dark"] .timesheet-page .remote-select__empty,
html[data-theme="dark"] .remote-select__option small {
  color: var(--theme-text-muted, #a9beb7) !important;
}

html[data-theme="dark"] .schedule-dialog {
  color-scheme: dark;
}

html[data-theme="dark"] .schedule-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68) !important;
}

/* The old timesheet page remains visually part of the new Schedules section. */
html[data-theme="dark"] .timesheet-page .schedule-tabs {
  color: var(--theme-text, #effff9) !important;
  background: var(--theme-surface, #0d1915) !important;
  border-color: color-mix(in srgb, var(--theme-primary, #49ddb1) 18%, transparent) !important;
}

/* Schedules styles that must be available before deferred JS runs, 2026-09-07. */

.schedule-work-view .schedule-cell__button > strong {
  display: none !important;
}

html.schedule-readonly-view .schedule-cell__button {
  cursor: default !important;
}

html.schedule-readonly-view .schedule-cell__button:disabled {
  opacity: 1 !important;
}

.timesheet-page .schedule-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(27, 82, 79, 0.12);
  border-radius: 14px;
  background: var(--card-bg, var(--theme-surface, #fff));
}

.timesheet-page .schedule-tabs a {
  padding: 9px 13px;
  border-radius: 9px;
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.timesheet-page .schedule-tabs a.is-active {
  color: #087c75;
  background: rgba(35, 140, 132, 0.12);
}

.timesheet-page .schedule-tabs__settings {
  margin-left: auto;
}

html[data-theme="dark"] .timesheet-page .schedule-tabs a.is-active {
  color: var(--theme-primary);
  background: var(--theme-primary-soft);
}

.pz-column-hidden,
.pz-field-hidden {
  display: none !important;
}

.schedule-policy-form.is-monthly-plan .schedule-shifts__table {
  min-width: 620px;
}

.schedule-policy-form.is-monthly-plan.is-reception-off .schedule-shifts__table {
  min-width: 430px;
}

.schedule-matrix-card__heading {
  align-items: center;
  min-height: 64px;
}

.schedule-matrix-card__hint {
  display: flex;
  min-height: 36px;
  align-items: center;
}

.schedule-matrix-card__actions {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-matrix-card__actions .schedule-matrix-card__hint {
  max-width: 440px;
  text-align: right;
}

.monthly-plan-toggle.is-active {
  box-shadow: 0 0 0 2px rgba(35, 140, 132, 0.12);
}

html.monthly-plan-mode .schedule-cell__button {
  cursor: crosshair !important;
}

html.monthly-plan-mode .schedule-cell__button:hover {
  background: rgba(35, 140, 132, 0.16) !important;
  box-shadow: inset 0 0 0 2px rgba(35, 140, 132, 0.35);
}

.monthly-plan-dialog__intro {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(35, 140, 132, 0.07);
}

.monthly-plan-dialog__intro span,
.monthly-plan-dialog__intro small {
  color: #68747d;
}

.monthly-plan-dialog__shifts {
  display: grid;
  gap: 8px;
}

.monthly-plan-shift {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(27, 82, 79, 0.14);
  border-radius: 11px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.monthly-plan-shift:hover,
.monthly-plan-shift.is-selected {
  border-color: rgba(35, 140, 132, 0.45);
  background: rgba(35, 140, 132, 0.08);
}

.monthly-plan-shift strong,
.monthly-plan-shift span {
  display: block;
}

.monthly-plan-shift span {
  color: #68747d;
  font-size: 12px;
}

.monthly-plan-shift__mark {
  color: #087c75;
  font-size: 12px;
  font-weight: 750;
}

.monthly-plan-clear {
  justify-self: start;
}

@media (max-width: 700px) {
  .timesheet-page .schedule-tabs__settings {
    margin-left: 0;
  }

  .schedule-matrix-card__actions {
    justify-content: flex-start;
  }

  .schedule-matrix-card__actions .schedule-matrix-card__hint {
    text-align: left;
  }
}


/* Targeted vacation UI refinements, 2026-09-05. */

/* Account page: desktop uses two independent vertical stacks. This avoids the
 * shared CSS Grid row height that previously pushed the theme card far down. */
@media (min-width: 981px) {
  .account-page > .account-left-column {
    grid-column: 1;
  }

  .account-page > .account-right-column {
    grid-column: 2;
  }
}

.account-page > .account-left-column,
.account-page > .account-right-column {
  display: grid;
  min-width: 0;
  gap: 20px;
  align-content: start;
}

.account-page > .account-left-column > .admin-section {
  min-width: 0;
  margin: 0;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff, #fbfefd);
  border: 1px solid var(--account-border);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 111, 105, 0.07);
}

.account-page > .account-left-column > .admin-section h2 {
  color: #184743;
}

@media (max-width: 980px) {
  .account-page > .account-left-column,
  .account-page > .account-right-column {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .account-page > .account-left-column > .admin-section {
    padding: 18px;
    border-radius: 16px;
  }
}

html[data-theme="dark"] .account-page > .account-left-column > .admin-section {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  box-shadow: var(--theme-shadow);
}

html[data-theme="dark"] .account-page > .account-left-column > .admin-section h2 {
  color: var(--theme-text);
}

/* Returned vacation wishes: do not keep the old light-yellow surface in the
 * dark theme. Specificity and stylesheet order are sufficient here. */
html[data-theme="dark"] .account-vacation-card .vacation-admin-comment {
  color: var(--theme-text);
  background:
    color-mix(
      in srgb,
      var(--theme-warning) 10%,
      var(--theme-surface)
    );
  border-color:
    color-mix(
      in srgb,
      var(--theme-warning) 42%,
      var(--theme-border)
    );
}

html[data-theme="dark"] .account-vacation-card .vacation-admin-comment strong {
  color: var(--theme-warning);
}

html[data-theme="dark"] .account-vacation-card .vacation-admin-comment p {
  color: var(--theme-text-secondary);
}

/* Management page: the outer admin section is enough; the filter itself
 * should not look like a second card nested inside it. */
.admin-section > .vacation-admin-filter {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Manual approved-vacation entry: make the expandable area a complete surface
 * instead of letting its white content run into the section edges. */
.admin-section > .vacation-manual-entry {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--theme-border, #d8e5e2);
  border-radius: 16px;
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 8px 24px rgba(15, 111, 105, 0.05);
}

.admin-section > .vacation-manual-entry > .vacation-manual-summary {
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
}

.admin-section > .vacation-manual-entry[open] > .vacation-manual-summary {
  border-bottom: 1px solid var(--theme-border, #d8e5e2);
}

.admin-section > .vacation-manual-entry > .vacation-manual-content {
  padding: 16px 18px 18px;
}

.vacation-manual-content > .text-muted {
  margin: 0 0 16px;
}

.vacation-manual-form {
  column-gap: 12px;
  row-gap: 16px;
}

.vacation-manual-form > .form-group,
.vacation-manual-form > .form-actions {
  min-width: 0;
  margin: 0 !important;
}

.vacation-manual-form > .form-actions {
  align-self: end;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.vacation-manual-form > .form-actions .btn {
  min-height: 48px;
  white-space: nowrap;
}

.vacation-manual-end {
  margin-top: 2px;
}

@media (max-width: 720px) {
  .admin-section > .vacation-manual-entry {
    border-radius: 14px;
  }

  .admin-section > .vacation-manual-entry > .vacation-manual-summary {
    padding: 14px 16px;
  }

  .admin-section > .vacation-manual-entry > .vacation-manual-content {
    padding: 14px 16px 16px;
  }

  .vacation-manual-form > .form-actions,
  .vacation-manual-form > .form-actions .btn {
    width: 100%;
  }
}

html[data-theme="dark"] .admin-section > .vacation-manual-entry {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  box-shadow: var(--theme-shadow);
}

html[data-theme="dark"]
  .admin-section
  > .vacation-manual-entry[open]
  > .vacation-manual-summary {
  border-bottom-color: var(--theme-border);
}

/* Public schedule now has year + subdivision + department + action. */
.vacation-public-filter {
  grid-template-columns:
    minmax(135px, 0.42fr)
    minmax(220px, 0.86fr)
    minmax(300px, 1.35fr)
    auto !important;
  align-items: end !important;
}

.vacation-public-filter > .form-group,
.vacation-public-filter > .form-actions {
  min-width: 0;
  margin: 0 !important;
}

.vacation-public-filter > .form-actions {
  align-self: end !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.vacation-public-filter > .form-actions .btn {
  min-height: 48px;
  height: 48px;
  white-space: nowrap;
}

/* Legend and reminder share one quiet horizontal strip. */
.vacation-public-legend-row {
  display: flex;
  margin: 10px 0 14px;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  flex-wrap: wrap;
}

.vacation-public-legend-row .vacation-schedule-legend {
  margin: 0 !important;
}

.vacation-public-reminder {
  margin: 0;
  color: var(--muted, var(--theme-text-muted, #7b8794));
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0.74;
}

.vacation-public-reminder a {
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vacation-public-reminder a:hover,
.vacation-public-reminder a:focus-visible {
  color: var(--theme-primary, #2aa889);
  opacity: 1;
}

@media (max-width: 1050px) {
  .vacation-public-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .vacation-public-filter > .form-actions {
    align-self: end !important;
  }
}

@media (max-width: 640px) {
  .vacation-public-filter {
    grid-template-columns: 1fr !important;
  }

  .vacation-public-filter > .form-actions,
  .vacation-public-filter > .form-actions .btn {
    width: 100%;
  }

  .vacation-public-legend-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

/* Dashboard follow-up: keep card borders visually even. The short accent rail
 * from the previous visual-polish pass is removed without changing card sizes,
 * borders or the dashboard grid. */
.dashboard-page .dashboard-card::before {
  display: none;
}

/* Latest algorithms use ordinary bullets. The previous outlined rectangle
 * looked like a missing image glyph. */
.dashboard-quick-algorithm-link::before {
  content: "•";
  top: 3px;
  left: 7px;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: var(--dashboard-info);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

/* Patient-accounting counters start at the same top line even when one label
 * wraps to two lines. */
.dashboard-quick-card--patients .dashboard-quick-metric {
  flex-direction: column;
  justify-content: flex-start;
}

.dashboard-quick-card--patients .dashboard-quick-metric strong {
  order: -1;
  line-height: 1.05;
}


/* Vacation request moved from account to the public vacation schedule. */
.vacation-public-request-action{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
  margin-left:auto;
}
.vacation-public-request-action>div{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.vacation-request-dialog{
  width:min(760px,calc(100vw - 32px));
  max-height:calc(100vh - 48px);
  padding:0;
  overflow:auto;
  color:var(--theme-text);
  background:var(--theme-surface);
  border:1px solid var(--theme-border);
  border-radius:14px;
  box-shadow:var(--theme-shadow-strong);
}
.vacation-request-dialog::backdrop{
  background:var(--theme-overlay);
}
.vacation-request-dialog__content{
  display:grid;
  gap:18px;
  padding:20px;
}
.vacation-request-dialog .vacation-request-periods{
  display:grid;
  gap:12px;
}
.vacation-request-dialog .vacation-request-row{
  padding:14px;
  background:var(--theme-surface-soft);
  border:1px solid var(--theme-border);
  border-radius:12px;
}
.vacation-request-dialog .vacation-request-row-hidden{
  display:none;
}
@media(max-width:760px){
  .vacation-public-request-action{
    width:100%;
    justify-content:stretch;
  }
  .vacation-public-request-action>.btn{
    width:100%;
  }
}


/* Vacation manual employee search: allow AJAX options to escape the
 * expandable card and paint above the following vacation schedule section. */
.vacation-manual-section{
  position:relative;
  z-index:30;
  overflow:visible !important;
}
.admin-section > .vacation-manual-entry[open]{
  position:relative;
  z-index:31;
  overflow:visible !important;
}
.admin-section > .vacation-manual-entry[open] > .vacation-manual-content,
.vacation-manual-entry[open] .vacation-manual-form,
.vacation-manual-entry[open] .vacation-manual-form > .form-group,
.vacation-manual-entry[open] .remote-select{
  overflow:visible !important;
}
.vacation-manual-entry[open] .remote-select{
  position:relative;
  z-index:60;
}
.vacation-manual-entry[open] .remote-select__dropdown{
  z-index:1600 !important;
}
