/* Compact work calendar: geometry only, booking coordinates use the shared hour height. */
.month-board {
  --overview-name-width: 116px;
  --overview-day-width: 76px;
  grid-template-columns: var(--overview-name-width) repeat(var(--overview-days), minmax(var(--overview-day-width), 1fr));
  min-width: calc(var(--overview-name-width) + var(--overview-days) * var(--overview-day-width));
}
.month-board .employee-name { padding: 8px; gap: 5px; flex-direction: column; align-items: flex-start; }
.month-board .employee-name > span { width: 32px; height: 32px; flex: 0 0 32px; }
.month-board .employee-name strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.month-board .month-cell { min-height: 76px; padding: 8px 6px; }
.month-board .month-cell > span { font-size: 14px; }
.month-board .month-cell > small { font-size: 12px; }
.month-board .month-day, .month-board .month-corner { padding: 8px 4px; }
.month-board .month-day span { font-size: 14px; }
.month-day.weekend, .mobile-date-strip button.weekend:not(.selected), .batch-days .weekend { background: #fae5e2; color: #923c35; }
.datebar-actions { display: flex; align-items: center; gap: 8px; }
#batch-shifts { margin: 0; min-height: 44px; }
.batch-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.batch-days > span { text-align: center; font-size: 13px; }
.batch-days button { min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); font: 500 16px Montserrat, sans-serif; }
.batch-days button[aria-pressed="true"] { background: #c43d34; color: white; outline: 2px solid #3c2f2c; outline-offset: -3px; font-weight: 700; }
.batch-time { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.batch-time input { min-width: 0; }
#batch-shift-form > button { min-height: 44px; }
.modal-card:has(#batch-shift-form) > .close { min-width: 44px; min-height: 44px; right: 0; top: 0; }
.batch-days button:focus-visible { outline: 3px solid #3c2f2c; outline-offset: -3px; }
[data-batch-error]:not(:empty) { color: #8b302a; padding: 12px; background: #fde8e5; }
@media (max-width: 720px) {
  .datebar-actions { display: contents; }
  #batch-shifts { display: none; }
  #today { min-height: 44px; }
  .month-board { --overview-name-width: 80px; --overview-day-width: 44px; }
  .month-board .employee-name { padding: 6px 4px; }
  .month-board .employee-name strong { font-size: 12px; line-height: 14px; font-weight: 500; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .month-board .month-day strong, .month-board .month-day span { font-size: 12px; line-height: 16px; }
  .month-board .month-corner { font-size: 10px; padding: 8px 2px; }
  .month-board .month-cell { padding: 6px 2px; min-width: 0; min-height: 76px; text-align: center; overflow-wrap: anywhere; }
  .month-board .month-cell > span, .month-board .month-cell > small { font-size: 12px; line-height: 15px; }
  .month-board .month-cell > strong { font-size: 16px; margin-top: 3px; }
  .month-board .shift-hours > span { display: block; }
  .month-board .shift-hours .time-separator { display: none; }
  .month-board .off-label, .month-board .free-label { font-size: 0 !important; }
  .month-board .off-label::after { content: "Вых."; font-size: 12px; }
  .month-board .free-label::after { content: "—"; font-size: 12px; }
  #employee-filter { min-width: 0; width: 100%; max-width: 100%; }
  :root { --day-hour-height: 56px; }
  .day-board { grid-template-columns: 50px repeat(var(--staff-count), minmax(160px, 1fr)); min-width: calc(50px + var(--staff-count) * 160px); }
  .calendar-frame { container-type: inline-size; }
  body[data-calendar-density="compact"] .day-board {
    --compact-staff-width: calc((100vw - 70px) / 3);
    grid-template-columns: 44px repeat(var(--staff-count), minmax(var(--compact-staff-width), 1fr));
    min-width: calc(44px + var(--staff-count) * var(--compact-staff-width));
  }
  @supports (width: 1cqw) {
    body[data-calendar-density="compact"] .day-board { --compact-staff-width: calc((100cqw - 44px) / 3); }
  }
  body[data-calendar-density="compact"] .staff-head { flex-direction: column; justify-content: flex-start; gap: 0; padding: 2px; min-width: 0; text-align: center; }
  body[data-calendar-density="compact"] .staff-head > div { width: 100%; min-width: 0; }
  body[data-calendar-density="compact"] .staff-head strong { font-size: 12px; font-weight: 500; line-height: 14px; min-height: 28px; white-space: normal; }
  body[data-calendar-density="compact"] .staff-name-line { display: block; min-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body[data-calendar-density="compact"] .single-name .staff-name-line:first-child { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  body[data-calendar-density="compact"] .single-name .staff-name-line:last-child { display: none; }
  body[data-calendar-density="compact"] .staff-head:not(.closed) small { display: none; }
  body[data-calendar-density="compact"] .staff-head > .staff-avatar { width: 44px; height: 44px; min-width: 44px; max-width: 44px; min-height: 44px; max-height: 44px; flex-basis: 44px; }
  body[data-calendar-density="compact"] .staff-head > .staff-avatar { background: transparent; padding: 6px; }
  body[data-calendar-density="compact"] .staff-avatar img { inset: 6px; width: 32px; height: 32px; }
  body[data-calendar-density="compact"] .staff-avatar .avatar-fallback { background: #f0d7d2; border-radius: 50%; }
  body[data-calendar-density="compact"] .staff-avatar.editable::after { right: 5px; bottom: 5px; }
  body[data-calendar-density="compact"] .day-corner { padding: 4px 1px; }
  body[data-calendar-density="compact"] .day-corner > span { display: none; }
  body[data-calendar-density="compact"] .day-time { padding: 8px 2px; }
  body[data-calendar-density="compact"] .day-event { left: 2px; right: 2px; padding-left: 4px; padding-right: 3px; }
  .day-corner, .staff-head { min-height: 58px; padding: 6px; }
  .staff-head { gap: 6px; }
  .mobile-date-strip { margin: 8px 0; gap: 4px; }
  .mobile-date-strip button { min-height: 48px; padding: 4px; }
  .datebar { margin-top: 12px; margin-bottom: 12px; }
  .density-switch button { min-height: 44px; }
  #batch-shift-form input, #batch-shift-form select, #copy-form input { font-size: 16px; }
  .batch-days { grid-template-columns: repeat(7, minmax(44px, 1fr)); overflow-x: auto; padding: 2px; }
}
@media (max-width: 360px) {
  .modal:has(#batch-shift-form) { padding: 0; }
  .modal-card:has(#batch-shift-form) { padding: 6px; }
  .batch-days { gap: 0; padding: 0; }
}
