/* PMESC date & time picker (public/js/datepicker.js). Works on portal and public pages. */
.pm-dp { position: relative; display: block; width: 100%; }
.pm-dp-field {
  display: flex; align-items: center; gap: .6em; width: 100%; min-height: 46px; padding: .55em .85em;
  background: #fff; color: #123b5d; font: inherit; font-size: 1rem; text-align: left; cursor: pointer;
  border: 1px solid var(--color-border-input, #a29278); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.pm-dp-field:hover { border-color: #2f5d8a; }
.pm-dp-field:focus-visible, .pm-dp-field[aria-expanded="true"] { outline: none; border-color: #45b5e6; box-shadow: 0 0 0 3px rgba(69, 181, 230, .22); }
.pm-dp-field.is-empty .pm-dp-text { color: #5d7890; }
.pm-dp-field.is-invalid { border-color: #b3261e; box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.pm-dp-field:disabled { opacity: .55; cursor: not-allowed; }
.pm-dp-icon { display: inline-flex; color: #2f5d8a; }
.pm-dp-text { flex: 1; font-weight: 500; }
.pm-dp-error { color: #b3261e; font-weight: 600; font-size: .9rem; margin: .4em 0 0; }

.pm-dp-pop {
  position: absolute; z-index: 1000; top: calc(100% + 6px); left: 0; width: 320px; max-width: calc(100vw - 32px);
  background: #fff; color: #123b5d; border: 1px solid rgba(18, 59, 93, .12); border-radius: 14px;
  box-shadow: 0 18px 44px -12px rgba(18, 59, 93, .35), 0 2px 6px rgba(18, 59, 93, .08); padding: 14px;
  font-size: .95rem; line-height: 1.2;
}
.pm-dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pm-dp-month { margin: 0; font-weight: 700; font-size: 1.02rem; max-width: none; }
.pm-dp-nav { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: #f5f7f5; color: #123b5d; cursor: pointer; }
.pm-dp-nav:hover { background: #e5f5fc; }
.pm-dp-nav:disabled { opacity: .35; cursor: default; }
.pm-dp-nav:focus-visible, .pm-dp-day:focus-visible, .pm-dp-link:focus-visible, .pm-dp-done:focus-visible, .pm-dp-select:focus-visible { outline: 3px solid #2f5d8a; outline-offset: 1px; }
.pm-dp-grid { display: flex; flex-direction: column; gap: 2px; }
.pm-dp-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pm-dp-dowcell { text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5d7890; padding: 6px 0; }
.pm-dp-day { height: 40px; border: 0; border-radius: 10px; background: transparent; color: #123b5d; font: inherit; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; }
.pm-dp-day:hover:not(:disabled) { background: #e5f5fc; }
.pm-dp-day.is-outside { color: #9aabbb; }
.pm-dp-day.is-today { box-shadow: inset 0 0 0 1.5px #45b5e6; font-weight: 700; }
.pm-dp-day.is-selected, .pm-dp-day.is-selected:hover { background: #123b5d; color: #fff; font-weight: 700; box-shadow: none; }
.pm-dp-day:disabled { color: #c3ccd4; cursor: not-allowed; }
.pm-dp-time { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(18, 59, 93, .1); }
.pm-dp-time-label { font-weight: 700; margin-right: auto; }
.pm-dp-select {
  appearance: none; -webkit-appearance: none; min-width: 58px; height: 38px; padding: 0 26px 0 10px; font: inherit; font-weight: 600; color: #123b5d;
  border: 1px solid rgba(18, 59, 93, .2); border-radius: 9px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%232f5d8a' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
}
.pm-dp-foot { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.pm-dp-link { border: 0; background: none; color: #2f5d8a; font: inherit; font-weight: 600; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pm-dp-link:hover { background: #f5f7f5; }
.pm-dp-done { margin-left: auto; border: 0; background: #2f5d8a; color: #fff; font: inherit; font-weight: 700; padding: 9px 18px; border-radius: 9px; cursor: pointer; }
.pm-dp-done:hover { background: #123b5d; }
@media (max-width: 639px) {
  .pm-dp-pop { position: fixed; left: 50%; top: auto; bottom: 16px; transform: translateX(-50%); width: min(360px, calc(100vw - 24px)); }
}

/* PMESC file picker (public/js/filepicker.js) */
.pm-fp { position: relative; display: block; border: 1.5px dashed rgba(47, 93, 138, .45); border-radius: 12px; background: #f7fafc; min-height: 96px; transition: border-color .15s, background .15s, box-shadow .15s; }
.pm-fp:hover, .pm-fp.is-drag { border-color: #2f5d8a; background: #e5f5fc; }
.pm-fp.is-focus { border-style: solid; border-color: #45b5e6; box-shadow: 0 0 0 3px rgba(69, 181, 230, .22); }
.pm-fp.has-file { border-style: solid; border-color: rgba(58, 155, 104, .6); background: #f1f8f4; }
.pm-fp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.pm-fp-face { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px; text-align: center; color: #123b5d; min-height: 96px; }
.pm-fp-icon { color: #2f5d8a; }
.pm-fp-main { font-size: .95rem; }
.pm-fp-link { color: #2f5d8a; font-weight: 700; text-decoration: underline; text-underline-offset: .15em; }
.pm-fp-types { font-size: .78rem; color: #4a6378; letter-spacing: .03em; }
.pm-fp-chosen { display: flex; align-items: center; gap: 10px; padding: 14px 16px; min-height: 96px; color: #123b5d; flex-wrap: wrap; }
.pm-fp-file { color: #318257; display: inline-flex; }
.pm-fp-name { font-weight: 700; overflow-wrap: anywhere; flex: 1; min-width: 40%; }
.pm-fp-size { color: #4a6378; font-size: .85rem; }
.pm-fp-change { color: #2f5d8a; font-weight: 600; font-size: .85rem; text-decoration: underline; }

/* Stage 4.10: PMESC dropdown (public/js/selectpicker.js) */
.pm-sel { position: relative; }
.pm-sel-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; clip: rect(0 0 0 0); }
.pm-sel-btn {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 10px 12px; border: 1px solid #a29278; border-radius: 6px; background: #fff; color: #123b5d;
  font: inherit; font-size: 1rem; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.pm-sel-btn:hover { border-color: #2f5d8a; }
.pm-sel-btn:focus-visible, .pm-sel.is-open .pm-sel-btn { outline: 2px solid transparent; border-color: #45b5e6; box-shadow: 0 0 0 1px #45b5e6, 0 0 0 4px rgba(69, 181, 230, .22); }
.pm-sel-btn[aria-invalid="true"] { border-color: #b3261e; }
.pm-sel-btn:disabled { background: #f1f3f5; color: #6b7f8f; cursor: not-allowed; }
.pm-sel-btn.is-placeholder .pm-sel-text { color: #4a6378; }
.pm-sel-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-sel-chev { flex: none; color: #4d6c86; transition: transform .15s; }
.pm-sel.is-open .pm-sel-chev { transform: rotate(180deg); }
.pm-sel-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid #d0d8df; border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(18, 59, 93, .45);
  max-height: min(18rem, 50vh); overflow-y: auto; min-width: 12rem;
}
.pm-sel.is-up .pm-sel-list { top: auto; bottom: calc(100% + 6px); }
.pm-sel-opt { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem .6rem 2rem; border-radius: 8px; color: #123b5d; cursor: pointer; position: relative; line-height: 1.35; }
.pm-sel-opt.is-active { background: #eaf4fb; }
.pm-sel-opt[aria-selected="true"] { font-weight: 700; }
.pm-sel-opt[aria-selected="true"]::before { content: ""; position: absolute; left: .7rem; top: 50%; width: 11px; height: 6px; border-left: 2px solid #2f5d8a; border-bottom: 2px solid #2f5d8a; transform: translateY(-70%) rotate(-45deg); }
.pm-sel-opt[aria-disabled="true"] { color: #94a7b6; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .pm-sel-chev, .pm-sel-btn { transition: none; } }
