/* Compact attendance controls, shared by the daily list and absence forms. */
.employee-worktime-table { min-width: 860px; }
.employee-worktime-table th:nth-child(4) { width: 185px; }
.employee-worktime-table th:nth-child(5) { width: 110px; }
.employee-worktime-table th:nth-child(6) { width: 210px; }
.attendance-compact-menu {
  position: fixed; z-index: 3250; box-sizing: border-box;
  width: min(278px, calc(100vw - 20px)); max-height: calc(100dvh - 20px);
  overflow-y: auto; padding: 4px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--dropdown-bg); color: var(--ink);
  box-shadow: var(--shadow-dropdown);
}
.attendance-compact-menu__item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-sizing: border-box; width: 100%; min-height: 35px; margin: 0;
  padding: 7px 9px; border: 0; border-radius: 4px;
  background: transparent; color: var(--ink); text-align: left;
  font: inherit; font-size: 12px; cursor: pointer; text-decoration: none;
}
.attendance-compact-menu__item:hover,
.attendance-compact-menu__item:focus-visible { background: var(--dropdown-hover-bg); color: var(--ink); }
.attendance-compact-menu__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.attendance-compact-menu__item:disabled { opacity: .5; cursor: default; }
.attendance-compact-menu__item.is-danger { color: var(--bad); }
.attendance-compact-menu__period { padding: 7px 9px; color: var(--muted-strong); font-size: 11px; }
.attendance-compact-menu__divider { margin: 4px 0; border: 0; border-top: 1px solid var(--border-subtle); }
.attendance-compact-menu__notice { margin: 5px 9px 8px; font-size: 12px; line-height: 1.4; color: var(--muted-strong); }
.attendance-compact-note { position: relative; display: block; width: 190px; max-width: 100%; }
.employee-worktime-table .attendance-compact-note input { width: 100%; padding-right: 29px; box-sizing: border-box; }
.attendance-compact-note__indicator {
  position: absolute; top: 5px; right: 4px; display: flex; align-items: center;
  justify-content: center; width: 23px; height: 23px; min-height: 0;
  padding: 0; margin: 0; border: 0; background: transparent;
  color: var(--accent-strong); font-size: 14px; line-height: 1;
}
.attendance-compact-note__indicator[data-state="idle"],
.attendance-compact-note__indicator[data-state="pending"] { visibility: hidden; }
.attendance-compact-note__indicator[data-state="saving"]::before {
  content: ""; width: 12px; height: 12px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: attendance-note-spin .7s linear infinite;
}
.attendance-compact-note__indicator[data-state="error"],
.attendance-compact-note__indicator[data-state="conflict"] { color: var(--bad); }
.attendance-compact-note__message { display: block; margin-top: 4px; color: var(--bad); font-size: 11px; line-height: 1.35; white-space: normal; }
.attendance-compact-note__retry { padding: 3px 0; border: 0; background: transparent; color: var(--accent-strong); font-size: 11px; text-decoration: underline; cursor: pointer; }
.attendance-compact-work-total { display: block; font-weight: 700; white-space: nowrap; }
.attendance-compact-period { display: block; font-size: 11px; color: var(--muted-strong); margin-top: 3px; }
.attendance-compact-absence-total { display: block; margin-top: 3px; color: var(--muted-strong); font-size: 11px; font-weight: 500; white-space: nowrap; }
.attendance-compact-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes attendance-note-spin { to { transform: rotate(360deg); } }
.attendance-compact-confirm .app-modal__dialog { width: min(450px, calc(100vw - 24px)); }
.attendance-compact-confirm .app-modal__head { padding: 14px 16px 11px; }
.attendance-compact-confirm .app-modal__head h2 { font-size: 17px; line-height: 1.3; }
.attendance-compact-confirm .app-modal__body { padding: 14px 16px 16px; font-size: 13px; line-height: 1.5; }
.attendance-compact-confirm__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.attendance-compact-confirm .button { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.attendance-compact-confirm .is-danger { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.app-modal:has([data-employee-absence-form], [data-employee-absence-cancel-form]) .app-modal__dialog {
  width: min(450px, calc(100vw - 24px)); max-height: calc(100dvh - 28px);
  background: var(--modal-bg); color: var(--ink); border-color: var(--border);
}
.app-modal:has([data-employee-absence-form], [data-employee-absence-cancel-form]) .app-modal__head { padding: 14px 16px 11px; }
.app-modal:has([data-employee-absence-form], [data-employee-absence-cancel-form]) .app-modal__head h2 { font-size: 17px; line-height: 1.3; }
.app-modal:has([data-employee-absence-form], [data-employee-absence-cancel-form]) .app-modal__body { padding: 14px 16px 16px; }
[data-employee-absence-form], [data-employee-absence-cancel-form] {
  width: 100%; max-width: 520px; box-sizing: border-box; margin: 0;
  padding: 0; border: 0; background: transparent; color: var(--ink);
}
[data-employee-absence-form] label { font-size: 12px; font-weight: 600; }
[data-employee-absence-form] input:not([type="checkbox"]):not([type="hidden"]):not([type="file"]),
[data-employee-absence-form] select, [data-employee-absence-form] textarea {
  width: 100%; box-sizing: border-box; min-width: 0; min-height: 38px;
  padding: 8px 9px; border: 1px solid var(--input-border); border-radius: 5px;
  background: var(--input-bg); color: var(--input-text);
  font: inherit; font-size: 12px; font-weight: 400;
}
[data-employee-absence-form] textarea { min-height: 65px; resize: vertical; }
[data-employee-absence-form] .modal-form-actions,
[data-employee-absence-cancel-form] .modal-form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
[data-employee-absence-form] .modal-form-actions button,
[data-employee-absence-cancel-form] .modal-form-actions button { min-height: 36px; padding: 7px 12px; font-size: 12px; }
[data-employee-absence-form] details summary { cursor: pointer; color: var(--muted-strong); font-size: 12px; }
[data-employee-absence-form] .document-dropzone { min-height: 0; padding: 11px; border-radius: 5px; }
[data-employee-absence-form] .document-dropzone__title { font-size: 12px; }
[data-employee-absence-form] .document-dropzone__hint { font-size: 11px; }
[data-employee-absence-form] .errorlist { margin: 4px 0 0; padding-left: 16px; color: var(--bad); font-size: 12px; }
.employee-absence-person { margin: 0 0 13px; font-size: 12px; color: var(--muted-strong); }
.employee-absence-person strong, .employee-absence-person small { display: block; }
.employee-absence-person strong { color: var(--ink); font-size: 13px; }
.employee-absence-person small { margin-top: 3px; }
.employee-absence-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.employee-absence-field { display: grid; gap: 5px; min-width: 0; margin: 0; }
.employee-absence-full { grid-column: 1 / -1; }
.employee-absence-options { margin-top: 12px; }
.employee-absence-options[open] > :not(summary) { margin-top: 10px; }
.employee-absence-note-slot, .employee-absence-reason-slot { display: grid; gap: 5px; margin: 0; }
.employee-absence-date-heading { margin: 0; font-size: 12px; color: var(--muted-strong); }
.employee-absence-hour-hint { margin: 7px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted-strong); }
.employee-absence-preview-details { margin: 10px 0 0; font-size: 11px; color: var(--muted-strong); }
.employee-absence-preview-details .employee-absence-workday-preview { margin: 8px 0 0; padding: 10px; font-size: 12px; }
.employee-absence-preview-details .employee-absence-workday-preview strong { font-size: 12px; line-height: 1.4; }
.employee-absence-submit-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.employee-absence-cancel-period { margin: 5px 0 0; font-size: 12px; color: var(--muted-strong); }
.employee-absence-cancel-warning { margin-top: 14px; font-size: 13px; line-height: 1.6; color: var(--muted-strong); }
.attendance-compact-menu[hidden], .attendance-compact-confirm[hidden],
.attendance-compact-note[hidden], .attendance-compact-note__message[hidden],
.attendance-compact-note__retry[hidden], .attendance-compact-note [hidden], [data-employee-absence-form] [hidden],
[data-employee-absence-cancel-form] [hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .attendance-compact-note__indicator[data-state="saving"]::before { animation-duration: 1.5s; } }
@media (max-width: 600px) {
  [data-employee-absence-form] input:not([type="checkbox"]), [data-employee-absence-form] select,
  [data-employee-absence-form] textarea { font-size: 16px; }
}

.employee-absence-page { max-width: 550px; padding: 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--modal-bg); }
.employee-absence-validation { margin: 10px 0 0; font-size: 12px; color: var(--bad); }

.employee-absence-reason-slot:empty { display: none; }
.employee-worktime-partial-absence { color: var(--warn); }
:root[data-theme="dark"] .employee-worktime-month .employee-worktime-month-day.is-absence { border-color: #315b78; background: #142536; }
:root[data-theme="dark"] .employee-worktime-month .employee-worktime-month-day.is-absence strong,
:root[data-theme="dark"] .employee-worktime-month .employee-worktime-month-day.is-absence small { color: #a8d8f2; }
