/* Employee-only presentation. No administrator or print table rules change. */
body.employee-portal :is(.employee-calendar-shared-card, .employee-leave-editor, .employee-plans-editor-card, .employee-roster-date-card) {
  box-sizing: border-box; min-width: 0; padding: 16px 18px; border: 1px solid #b8c9d2; border-radius: 11px; background: #fff;
}
.employee-calendar-shared-card, .employee-plans-editor-card { margin-bottom: 15px; }
.employee-calendar-forecast-notice { margin: 12px 0 0; color: #804623; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.employee-calendar-controls { min-width: 0; }
.employee-calendar-controls > .employee-calendar-upcoming-details:not([hidden]) { margin-bottom: 15px; }
.employee-plans-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 15px; }
body.employee-portal :is(#my-calendar-leave-date-value, #my-calendar-plans-date-label, [data-roster-date-label]) { margin-top: 0; padding-top: 0; border-top: 0; }
#my-calendar-plans-details:empty + .employee-plans-form { margin-top: 0; }
.employee-plans-form > p:not(.employee-leave-selected-date) { margin: 0; }
.employee-plans-form > label { min-width: 0; color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1.6; }
.employee-plans-form textarea { display: block; width: 100%; min-width: 0; height: auto; min-height: 0; padding: 8px 10px; resize: vertical; font: inherit; font-size: 14px; color: var(--ink); line-height: 1.5; }
.employee-plans-warning { color: #804623; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.employee-plans-range-toggle { display: flex; align-items: center; gap: 7px; }
.employee-plans-form > .employee-plans-range-toggle { color: #163f52; font-size: 18px; font-variant-numeric: tabular-nums; }
.employee-plans-range-toggle input { width: auto; min-height: 0; }
#my-calendar-plans-end-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; max-width: 300px; }
#my-calendar-plans-end { display: block; box-sizing: border-box; min-width: 0; width: 100%; }
.employee-plan-card { grid-template-columns: minmax(0, 1fr); }
.employee-leave-detail-card { grid-template-columns: minmax(0, 1fr); }
.employee-calendar-upcoming-entry .employee-leave-detail-label { min-height: 32px; padding: 7px 48px 7px 10px; border-right: 0; border-bottom: 1px solid #ac8adc; }
.employee-plan-card-label { position: relative; min-height: 32px; padding: 7px 106px 7px 10px; border-right: 0; border-bottom: 1px solid #bdd5ca; }
.employee-plan-actions { position: absolute; top: 3px; bottom: 3px; right: 6px; display: flex; align-items: center; gap: 5px; }
.employee-plan-actions button { min-width: 0; min-height: 0; height: 100%; max-height: 26px; margin: 0; padding: 1px 7px; font-size: 11px; line-height: 1; font-weight: 800; white-space: nowrap; -webkit-text-size-adjust: none; text-size-adjust: none; }
.employee-plan-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 5px 0 0; }
.employee-plan-period { margin: 0; color: #416554; font-size: 12px; overflow-wrap: anywhere; }
/* Align plan detail copy with duty details; preserve sizes and other plan surfaces. */
@media screen {
  body.employee-portal .employee-plan-card > .employee-calendar-upcoming-entry-content > :is(.employee-plan-period, .employee-plan-text) {
    color: #405b68; font-weight: 700; line-height: 1.6;
  }
}
/* Match detail cards to the existing calendar tags without changing geometry. */
@media screen {
  body.employee-portal .employee-calendar-upcoming-entry.additions.has-additions {
    --detail-tag-background: #f0e9ff;
    --detail-tag-border: #ac8adc;
    --detail-tag-heading: #63329d;
    background: var(--detail-tag-background);
    border-color: var(--detail-tag-border);
  }
  body.employee-portal .employee-calendar-upcoming-entry.additions.has-additions.manual {
    --detail-tag-background: #fff0e2;
    --detail-tag-border: #e49c63;
    --detail-tag-heading: #aa400a;
  }
  body.employee-portal .employee-calendar-upcoming-entry.additions.has-additions.employee-plan-card {
    --detail-tag-background: #ddf2e2;
    --detail-tag-border: #6baa7e;
    --detail-tag-heading: #205b37;
  }
  body.employee-portal .employee-calendar-upcoming-entry.additions.has-additions > .employee-calendar-upcoming-entry-label {
    background: var(--detail-tag-background);
    border-color: var(--detail-tag-border);
    color: var(--detail-tag-heading);
  }
  body.employee-portal .employee-calendar-upcoming-entry.additions.has-additions .employee-calendar-upcoming-duty-heading > strong {
    color: var(--detail-tag-heading);
  }
}
.employee-plans-history-card .data-table { min-width: 0; table-layout: fixed; width: 100%; }
.employee-plans-history-card .data-table th:first-child { width: 28%; }
.employee-plans-history-card .data-table th:last-child { width: 104px; }
.employee-plans-history-card .data-table td { overflow-wrap: anywhere; }
.employee-month-grid .employee-month-plan-week td { height: var(--plan-week-height, 90px); }
.employee-month-grid .employee-month-plan-week td button { min-height: var(--plan-week-height, 90px); }
/* The full date cell remains tappable, including the area under a spanning band. */
.employee-month-grid .employee-month-plan-week td button::after { content: ""; position: absolute; inset: 0; }
.employee-month-grid .employee-month-plan-week td.today::after { z-index: 2; }
.employee-month-plan-tag { position: absolute; z-index: 1; pointer-events: none; left: 3px; top: var(--plan-top, calc(var(--plan-lane) * 22px + 60px)); box-sizing: border-box; width: calc(var(--plan-span) * 100% + (var(--plan-span) - 1) * 1px - 6px); min-height: 20px; padding: 0 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border: 1px solid #6baa7e; border-radius: 4px; background: #ddf2e2; color: #205b37; font-size: 11px; font-weight: 800; line-height: 1.6; text-align: left; }
.employee-month-leave-range-tag { border-color: #ac8adc; background: #f0e9ff; color: #63329d; }
#my-calendar-leave-range-controls .employee-leave-range-toggle { display: flex; gap: 7px; color: #163f52; font-size: 18px; font-weight: 800; line-height: 1.6; font-variant-numeric: tabular-nums; }
#my-calendar-leave-range-controls .employee-leave-range-toggle input { width: auto; flex: 0 0 auto; }
#my-calendar-leave-range-controls { grid-column: 1 / -1; min-width: 0; margin-top: 12px; }
#my-calendar-leave-end-field { display: grid; gap: 5px; max-width: 300px; margin-top: 8px; }
#my-calendar-leave-end { box-sizing: border-box; width: 100%; min-width: 0; }
.employee-leave-range-hint { margin: 7px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
#my-calendar-leave-range-hint { grid-column: 1 / -1; }
.employee-month-grid td .employee-month-duty.off-weekly,
.employee-month-grid td.today:not(.selected) .employee-month-duty.off-weekly { color: #2559cb; }
.employee-month-grid td .employee-month-duty.off-public,
.employee-month-grid td.today:not(.selected) .employee-month-duty.off-public { color: #c22536; }
.employee-month-grid td.selected .employee-month-duty.off-weekly { color: #19499e; background: #e7efff; border-radius: 3px; padding-inline: 2px; }
.employee-month-grid td.selected .employee-month-duty.off-public { color: #a51c2b; background: #ffe8e9; border-radius: 3px; padding-inline: 2px; }
/* Only unselected, non-today trailing dates are muted. Keep badge backgrounds,
   borders, basis marks, dimensions and hit targets unchanged. */
@media screen {
  body.employee-portal .employee-calendar-shared-card td.adjacent-month:not(.selected):not(.today) button:not(:disabled) .employee-month-day { color: #586a79; }
  body.employee-portal .employee-calendar-shared-card td.adjacent-month.sunday:not(.selected):not(.today) button:not(:disabled) .employee-month-day { color: #db697e; }
  body.employee-portal .employee-calendar-shared-card td.adjacent-month.saturday:not(.selected):not(.today) button:not(:disabled) .employee-month-day { color: #668bdb; }
  body.employee-portal .employee-calendar-shared-card td.adjacent-month:not(.selected):not(.today) .employee-month-duty:not(.off) { color: #3f788c; }
  body.employee-portal .employee-calendar-shared-card td.adjacent-month:not(.selected):not(.today) .employee-month-duty.off-weekly { color: #3f6dd1; }
  body.employee-portal .employee-calendar-shared-card td.adjacent-month:not(.selected):not(.today) .employee-month-duty.off-public { color: #c93f4e; }
  body.employee-portal .employee-calendar-shared-card td.adjacent-month:not(.selected):not(.today) .employee-month-duty.off-designated { color: #788390; }
  body.employee-portal .employee-calendar-shared-card td.adjacent-month:not(.selected):not(.today) .employee-month-badge.manual { color: #b35322; }
  body.employee-portal .employee-calendar-shared-card td.adjacent-month:not(.selected):not(.today) .employee-month-badge.leave { color: #7f57af; }
  body.employee-portal .employee-calendar-shared-card .employee-month-plan-tag { --employee-band-ink: #205b37; --employee-band-muted-ink: #447557; }
  body.employee-portal .employee-calendar-shared-card .employee-month-leave-range-tag { --employee-band-ink: #63329d; --employee-band-muted-ink: #7f57af; }
  @supports ((background-clip: text) or (-webkit-background-clip: text)) {
    body.employee-portal .employee-calendar-shared-card .employee-month-plan-tag.has-muted-month-text {
      /* The bottom, transparent image preserves the existing background color
         across the entire box. Only the top image is clipped to the letters. */
      background-image: var(--employee-band-text-paint), linear-gradient(transparent, transparent);
      background-origin: border-box;
      -webkit-background-clip: text, border-box;
      background-clip: text, border-box;
      -webkit-text-fill-color: transparent;
    }
  }
}
@media (max-width: 760px) {
  body.employee-portal :is(.employee-calendar-shared-card, .employee-leave-editor, .employee-plans-editor-card, .employee-roster-date-card) { padding: 13px; }
  .employee-plans-form .employee-calendar-form-actions { display: flex; flex-wrap: wrap; }
  .employee-plans-form .employee-calendar-form-actions button { min-width: 0; flex: 1; }
  .employee-plans-form textarea { font-size: 16px; }
}
.employee-plan-history-only > :not(#my-calendar-plans-date-label):not(#my-calendar-plans-history-note) {
  display: none !important;
}
