/* Print employee file dialog: sliding period selector and selectable section cards. */

.overlay.print-file-overlay {
  align-items: center;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(460px 340px at 85% 12%, rgba(108, 123, 255, .42), transparent 70%),
    radial-gradient(420px 320px at 10% 88%, rgba(176, 138, 240, .38), transparent 70%),
    rgba(20, 24, 40, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html[data-theme="dark"] .overlay.print-file-overlay {
  background:
    radial-gradient(460px 340px at 85% 12%, rgba(108, 123, 255, .26), transparent 70%),
    radial-gradient(420px 320px at 10% 88%, rgba(176, 138, 240, .24), transparent 70%),
    rgba(6, 8, 16, .68);
}

.modal.print-file {
  --pf-h: 52px;
  --pf-radius: 18px;
  --pf-gap: 16px;
  --pf-ink: var(--text1, #17213c);
  --pf-soft: #4b5573;
  --pf-edge: rgba(255, 255, 255, .85);
  --pf-panel: rgba(255, 255, 255, .46);
  --pf-ctl: linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(237, 234, 253, .8));
  --pf-ctl-edge: rgba(255, 255, 255, .95);
  --pf-ring: rgba(140, 128, 214, .22);
  width: 100%;
  max-width: 820px;
  margin: auto;
  display: grid;
  gap: var(--pf-gap);
  padding: 24px;
  overflow: visible;
  max-height: none;
  border: 1px solid var(--pf-edge);
  border-radius: 28px;
  color: var(--pf-ink);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .3), transparent 45%),
    rgba(255, 255, 255, .55);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    0 30px 70px rgba(40, 50, 110, .3),
    inset 0 1px 0 rgba(255, 255, 255, .7);
  container-type: inline-size;
  animation: pfPop .7s cubic-bezier(.2, .9, .3, 1.1) both;
}

html[data-theme="dark"] .modal.print-file {
  --pf-ink: #f2f5ff;
  --pf-soft: #b9c3db;
  --pf-edge: rgba(255, 255, 255, .14);
  --pf-panel: rgba(255, 255, 255, .05);
  --pf-ctl: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(160, 150, 255, .07));
  --pf-ctl-edge: rgba(255, 255, 255, .14);
  --pf-ring: rgba(170, 160, 255, .2);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .1), transparent 45%),
    rgba(20, 26, 46, .6);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, .6),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.print-file > * {
  animation: pfRise .55s cubic-bezier(.2, .9, .3, 1.1) both;
}

.print-file > *:nth-child(3) { animation-delay: .08s; }
.print-file .pf-actions { animation-delay: .16s; }

@keyframes pfPop {
  from {
    opacity: 0;
    transform: translateY(28px) scale(.95);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes pfRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- head ---------- */
.print-file .pf-head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}

.print-file .pf-icon {
  position: relative;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  font-size: 28px;
  background: linear-gradient(145deg, #8f84f0, #5069dc 60%, #4f9ff0);
  box-shadow:
    0 10px 22px rgba(80, 105, 220, .4),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}

.print-file .pf-icon i {
  animation: pfPaper 3s ease-in-out infinite;
}

.print-file .pf-icon::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(110, 125, 240, .5);
  border-radius: 22px;
  animation: pfRing 2.4s ease-out infinite;
}

@keyframes pfPaper {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-3px); }
  70% { transform: translateY(1px); }
}

@keyframes pfRing {
  from {
    transform: scale(.92);
    opacity: .9;
  }
  to {
    transform: scale(1.22);
    opacity: 0;
  }
}

.print-file .pf-title {
  flex: 1;
  min-width: 0;
}

.print-file .pf-title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.print-file .pf-title span {
  display: block;
  color: var(--pf-soft);
  font-size: 13px;
}

.print-file .pf-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--pf-ctl-edge);
  border-radius: var(--pf-radius);
  color: var(--pf-soft);
  background: var(--pf-ctl);
  box-shadow: 0 0 0 1px var(--pf-ring), inset 0 1px 0 rgba(255, 255, 255, .8);
  font-size: 20px;
  cursor: pointer;
  transition: transform .2s ease;
}

.print-file .pf-close:hover {
  transform: rotate(90deg);
}

/* ---------- panels ---------- */
.print-file .pf-panel {
  display: grid;
  gap: var(--pf-gap);
  padding: 20px;
  border: 1px solid var(--pf-edge);
  border-radius: 24px;
  background: var(--pf-panel);
}

.print-file .pf-panel-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

.print-file .pf-panel-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, var(--a), var(--b));
  font-size: 18px;
}

.print-file .pf-count {
  margin-inline-start: auto;
  padding: 3px 12px;
  border: 1px solid rgba(80, 105, 220, .3);
  border-radius: 999px;
  color: #3b57c8;
  background: rgba(80, 105, 220, .14);
  font-size: 12px;
  font-weight: 700;
}

.print-file .pf-panel-head > .pf-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: auto;
  height: auto;
  min-height: 26px;
  box-shadow: none;
  white-space: nowrap;
}

html[data-theme="dark"] .print-file .pf-count {
  color: #a9b9ff;
}

/* ---------- period selector ---------- */
.print-file .pf-range {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 5px;
  border: 1px solid var(--pf-ctl-edge);
  border-radius: var(--pf-radius);
  background: var(--pf-ctl);
  box-shadow: 0 0 0 1px var(--pf-ring), inset 0 1px 0 rgba(255, 255, 255, .75);
}

.print-file .pf-range-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  inset-inline-start: 5px;
  width: calc((100% - 10px) / 3);
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(120deg, #6c7bff, #7a55f0);
  box-shadow:
    0 10px 22px rgba(108, 123, 255, .38),
    inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.1);
}

.print-file .pf-range:has(.pf-range-option:nth-of-type(2) input:checked) .pf-range-indicator {
  transform: translateX(-100%);
}

.print-file .pf-range:has(.pf-range-option:nth-of-type(3) input:checked) .pf-range-indicator {
  transform: translateX(-200%);
}

.print-file .pf-range-indicator::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70px;
  width: 46px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg);
  animation: pfSheen 3.4s ease-in-out infinite;
}

.print-file .pf-range-option {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 14px;
  color: var(--pf-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: color .3s ease;
}

.print-file .pf-range-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.print-file .pf-range-option i {
  font-size: 17px;
}

.print-file .pf-range-option:has(input:checked) {
  color: #fff;
}

.print-file .pf-range-option:has(input:focus-visible) {
  outline: 3px solid rgba(80, 105, 220, .45);
  outline-offset: -3px;
}

@keyframes pfSheen {
  60%, 100% { left: 120%; }
}

.print-file .pf-custom:not([hidden]) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  animation: pfRise .4s cubic-bezier(.2, .9, .3, 1.1) both;
}

.print-file .pf-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.print-file .pf-field > span {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.print-file .pf-field > span i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #5069dc;
  background: rgba(80, 105, 220, .16);
  font-size: 14px;
}

.print-file .date-picker-field {
  height: var(--pf-h);
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid var(--pf-ctl-edge);
  border-radius: var(--pf-radius);
  color: var(--pf-ink);
  background: var(--pf-ctl);
  box-shadow: 0 0 0 1px var(--pf-ring), inset 0 1px 0 rgba(255, 255, 255, .75);
}

.print-file .date-picker-field > i {
  color: var(--pf-soft);
  font-size: 19px;
}

/* ---------- section cards ---------- */
.print-file .pf-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.print-file .pf-option {
  --t: #4f7be8;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--t) 20%, var(--pf-edge));
  border-radius: 20px;
  color: var(--pf-ink);
  background: var(--pf-ctl);
  box-shadow: 0 0 0 1px var(--pf-ring), inset 0 1px 0 rgba(255, 255, 255, .75);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.1), box-shadow .3s ease, border-color .3s ease, background .3s ease, opacity .3s ease;
  animation: pfRise .5s cubic-bezier(.2, .9, .3, 1.1) both;
}

.print-file .pf-option:nth-child(2) { animation-delay: .04s; }
.print-file .pf-option:nth-child(3) { animation-delay: .08s; }
.print-file .pf-option:nth-child(4) { animation-delay: .12s; }
.print-file .pf-option:nth-child(5) { animation-delay: .16s; }
.print-file .pf-option:nth-child(6) { animation-delay: .2s; }

.print-file .pf-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.print-file .pf-option:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--t) 50%, transparent);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--t) 24%, transparent);
}

.print-file .pf-option:active {
  transform: translateY(0) scale(.97);
}

.print-file .pf-option:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--t) 55%, transparent);
  outline-offset: 2px;
}

.print-file .pf-option-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--t) 62%, #fff), var(--t));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--t) 38%, transparent);
  font-size: 22px;
  transition: filter .3s ease, transform .4s cubic-bezier(.2, 1.6, .4, 1);
}

.print-file .pf-option:hover .pf-option-icon {
  transform: scale(1.08) rotate(-6deg);
}

.print-file .pf-option-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  line-height: 1.35;
}

.print-file .pf-option-check {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid color-mix(in srgb, var(--t) 40%, transparent);
  border-radius: 10px;
  color: transparent;
  background: transparent;
  font-size: 16px;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .35s cubic-bezier(.2, 1.6, .4, 1);
}

.print-file .pf-option:not(:has(input:checked)) {
  opacity: .82;
}

.print-file .pf-option:not(:has(input:checked)) .pf-option-icon {
  filter: grayscale(.55) saturate(.7);
}

.print-file .pf-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--t) 55%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--t) 20%, transparent), color-mix(in srgb, var(--t) 5%, transparent) 80%),
    var(--pf-ctl);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--t) 20%, transparent),
    0 14px 28px color-mix(in srgb, var(--t) 20%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .75);
}

.print-file .pf-option:has(input:checked) .pf-option-check {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--t) 62%, #fff), var(--t));
  transform: scale(1.05);
}

.print-file .pf-option:has(input:checked) .pf-option-check i {
  animation: pfPip .4s cubic-bezier(.2, 1.6, .4, 1);
}

@keyframes pfPip {
  from { transform: scale(0) rotate(-40deg); }
  to { transform: none; }
}

/* ---------- actions ---------- */
.overlay .modal.print-file .modal-actions.pf-actions {
  display: flex;
  gap: 12px;
  margin: 0;
  padding-top: 0;
}

.overlay .modal.print-file .modal-actions.pf-actions .btn {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  width: auto;
  height: var(--pf-h);
  margin: 0;
  padding: 0 28px;
  border-radius: var(--pf-radius);
  font-size: 15px;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.1);
}

.overlay .modal.print-file .modal-actions.pf-actions .btn:hover:not(:disabled) {
  transform: translateY(-3px);
}

.overlay .modal.print-file .modal-actions.pf-actions .btn-primary {
  min-width: 240px;
  border: 0;
  color: #fff;
  background: linear-gradient(120deg, #6c7bff, #7a55f0, #4f9ff0, #6c7bff);
  background-size: 250% 100%;
  animation: pfFlow 6s linear infinite;
  box-shadow:
    0 14px 28px rgba(108, 123, 255, .4),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}

.overlay .modal.print-file .modal-actions.pf-actions .btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80px;
  width: 60px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg);
  animation: pfSheen 3.2s ease-in-out infinite;
}

.overlay .modal.print-file .modal-actions.pf-actions .btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  animation: none;
}

@keyframes pfFlow {
  to { background-position: 250% 0; }
}

.overlay .modal.print-file .modal-actions.pf-actions .btn-ghost {
  min-width: 140px;
  border: 1px solid var(--pf-ctl-edge);
  color: var(--pf-ink);
  background: var(--pf-ctl);
  box-shadow: 0 0 0 1px var(--pf-ring), inset 0 1px 0 rgba(255, 255, 255, .75);
}

/* ---------- narrower ---------- */
@container (max-width: 699px) {
  .print-file .pf-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overlay .modal.print-file .modal-actions.pf-actions {
    flex-direction: column-reverse;
  }

  .overlay .modal.print-file .modal-actions.pf-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

@container (max-width: 459px) {
  .print-file .pf-custom:not([hidden]) {
    grid-template-columns: 1fr;
  }

  .print-file .pf-option {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    text-align: center;
  }

  .print-file .pf-option-check {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    width: 24px;
    height: 24px;
  }

  .print-file .pf-range-option {
    font-size: 13px;
    padding: 4px;
  }

  .print-file .pf-range-option i {
    display: none;
  }
}

@media (max-width: 520px) {
  .modal.print-file {
    padding: 16px;
  }

  .print-file .pf-panel {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal.print-file,
  .print-file *,
  .print-file *::after {
    animation: none !important;
    transition: none !important;
  }
}
