body:has(.employee-calendar) { min-width: 760px; }
.employee-calendar .page-head { flex-wrap: wrap; }
.employee-calendar .page-head > div:first-child { flex: 1; min-width: 280px; }
.employee-calendar .page-head > .spacer { display: none; }
.ec-toolbar { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 22px 0 18px; }
.ec-toolbar label { display: flex; flex-direction: column; gap: 5px; color: var(--sub); font-size: 12px; }
.ec-toolbar select, .ec-toolbar input { height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 0 10px; color: var(--text); }
.ec-toolbar select { min-width: 220px; max-width: 100%; }
.ec-month-controls { display: flex; align-items: flex-end; gap: 10px; }
.ec-month-controls .seg, .ec-month-controls .btn { height: 34px; }
.ec-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ec-summary > div { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ec-summary span { color: var(--sub); font-size: 12px; }
.ec-summary b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ec-summary small { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.ec-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 12px; font-size: 12px; }
.ec-legend > span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; background: var(--line); }
.ec-legend > .work::before { background: var(--change-ink); }
.ec-legend > .rest::before { background: #728176; }
.ec-legend > .leave::before { background: #b46d76; }
.ec-legend > .trip::before { background: var(--warn); }
.ec-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: start; gap: 20px; }
.ec-month { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ec-weekdays, .ec-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ec-weekdays { background: var(--side); border-bottom: 1px solid var(--line); }
.ec-weekdays span { padding: 9px 10px; font-size: 12px; color: var(--sub); text-align: right; }
.ec-weekdays span:nth-last-child(-n+2) { color: var(--muted); }
.ec-day { display: flex; flex-direction: column; align-items: stretch; min-width: 0; min-height: 128px; padding: 9px; border: 0; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); border-radius: 0; background: #fff; text-align: left; font-size: 12px; cursor: pointer; }
.ec-day:nth-child(7n) { border-right: 0; }
.ec-day:nth-last-child(-n+7) { border-bottom: 0; }
.ec-day:hover { background: var(--hover); }
.ec-day.selected { position: relative; outline: 2px solid var(--brand); outline-offset: -2px; background: #fffef8; z-index: 1; }
.ec-day:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; z-index: 2; }
.ec-day-top { display: flex; align-items: center; justify-content: space-between; gap: 3px; margin-bottom: 8px; }
.ec-day-top b { font-weight: 500; }
.ec-day-top > span { font-size: 10px; color: var(--muted); }
.ec-day.today .ec-day-top b { padding: 0 5px; border-radius: 4px; background: var(--brand); color: var(--brand-ink); }
.ec-day-content { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.ec-shift { display: flex; flex-direction: column; gap: 1px; padding-left: 6px; border-left: 2px solid #adc3dd; line-height: 1.45; }
.ec-shift strong { font-weight: 500; overflow-wrap: anywhere; }
.ec-shift > span { color: var(--sub); font-size: 11px; }
.ec-shift.away strong { color: var(--change-ink); }
.ec-day-state { color: var(--muted); margin-top: 10px; }
.ec-day.rest { background: #fafbf9; }
.ec-day.rest .ec-day-state { color: #5b7363; }
.ec-event { border-radius: 3px; padding: 2px 5px; font-size: 11px; overflow-wrap: anywhere; }
.ec-event.leave { background: #fbf1f2; color: #8c5260; }
.ec-event.trip { background: var(--warn-soft); color: var(--warn); }
.ec-conflict { color: var(--warn); font-size: 10px; }
.ec-padding { background: #fafaf8; cursor: default; }
.ec-detail { position: sticky; top: 20px; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.ec-detail h2 { font-size: 15px; margin: 0 0 4px; }
.ec-detail h2 span { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
.ec-detail-item { border-top: 1px solid var(--line-soft); margin-top: 14px; padding-top: 12px; line-height: 1.8; }
.ec-detail-item p { margin-top: 6px; }
.ec-original { overflow-wrap: anywhere; margin-top: 4px; }
.ec-source-note { margin: 14px 0 0; }
.ec-load { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 260px; border: 1px solid var(--line); border-radius: var(--r); color: var(--muted); }
@media (max-width: 1350px) {
  .ec-layout { grid-template-columns: minmax(0, 1fr); }
  .ec-detail { display: none; }
}
@media (max-width: 1000px) {
  body:has(.employee-calendar) main { padding: 18px 20px 36px; }
  .ec-toolbar { gap: 12px; }
  .ec-toolbar select { min-width: 200px; }
  .ec-summary { gap: 8px; }
  .ec-summary > div { flex-direction: column; align-items: flex-start; padding: 9px 12px; }
  .ec-day { padding: 7px 5px; min-height: 124px; }
  .ec-shift { padding-left: 4px; }
  .ec-shift > span { font-size: 10px; }
}
