/* AUNOR Web · pickers (premium-pickers.js). Loaded after premium-theme.css.

   Menus, calendars and time columns share one surface: white, a hairline,
   a soft shadow, 14px corners. The chosen value is the night petrol with
   white text, the same pair the portal uses for a selected card; the row
   under the pointer is the mist grey. On a phone they come up as a sheet. */

/* ------------------------------------------------ closed fields ----- */
select.pk-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2356676e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px 15px;
  text-overflow: ellipsis;
}
select.pk-select[aria-expanded="true"],
.pk-trigger[aria-expanded="true"] {
  border-color: #1f6f8b;
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.16);
}
.team-status-console select.pk-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.team-board li select.pk-select,
.team-unassigned select.pk-select,
.team-kit-editor select.pk-select,
.skill-roster select.pk-select {
  padding-right: 24px !important;
  background-position: right 6px center;
  background-size: 12px 12px;
}

/* The real date/time input stays in the form for its value and the
   browser's validation, out of sight; the button takes its place. */
input.pk-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}
.pk-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 9em;
  min-height: 42px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--hairline-strong, var(--hairline-strong));
  border-radius: 10px;
  color: var(--ink, var(--ink));
  background: var(--paper, var(--paper));
  font: 400 14px/1.4 var(--body, system-ui);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.pk-trigger[hidden] { display: none; }
.pk-trigger > svg { flex: none; color: var(--quiet, var(--quiet)); }
.pk-trigger > svg:last-child { width: 15px; height: 15px; color: var(--muted, var(--muted)); }
/* width: 0 keeps a long date from widening the grid column it sits in. */
.pk-trigger-text { flex: 1 1 auto; width: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pk-trigger-text.is-placeholder { color: #8d9ca2; }
.pk-trigger:hover:not(:disabled) { border-color: #9fb0b6; }
.pk-trigger:focus-visible { outline: none; border-color: #1f6f8b; box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.16); }
.pk-trigger.is-invalid { border-color: var(--alarm, #d9362c); box-shadow: 0 0 0 3px rgba(217, 54, 44, 0.14); }
.pk-trigger:disabled { opacity: 0.55; cursor: not-allowed; }
.route-stop-row .pk-trigger,
.vehicle-document-row .pk-trigger { min-height: 38px; padding: 7px 10px; }

/* --------------------------------------------------------- panel ----- */
.pk-panel {
  position: fixed;
  inset: auto;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  max-width: calc(100vw - 16px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hairline, var(--hairline));
  border-radius: 14px;
  color: var(--ink, var(--ink));
  background: var(--paper, var(--paper));
  box-shadow: 0 18px 48px rgba(19, 36, 44, 0.18), 0 2px 6px rgba(19, 36, 44, 0.06);
  font: 400 14px/1.4 var(--body, system-ui);
  letter-spacing: normal;
  text-transform: none;
  animation: pk-in 140ms ease-out;
}
.pk-panel:focus { outline: none; }
.pk-panel[data-side="above"] { animation-name: pk-in-above; }
.pk-panel::backdrop { background: transparent; }
@keyframes pk-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes pk-in-above { from { opacity: 0; transform: translateY(4px); } }

.pk-panel button {
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}
.pk-panel button:disabled { cursor: not-allowed; }
.pk-panel button:focus-visible { outline: 2px solid #1f6f8b; outline-offset: 1px; }
.pk-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px !important;
  color: var(--muted, var(--muted)) !important;
}
.pk-icon-button:hover { color: var(--ink, var(--ink)) !important; background: var(--mist, var(--mist)) !important; }

/* Search */
.pk-search { position: relative; flex: none; padding: 10px 10px 8px; border-bottom: 1px solid var(--hairline, var(--hairline)); }
.pk-search > svg { position: absolute; top: 50%; left: 22px; color: var(--quiet, var(--quiet)); transform: translateY(-50%); pointer-events: none; }
.pk-panel .pk-search input {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 8px 12px 8px 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink, var(--ink));
  background: var(--mist, var(--mist));
  font: 400 14px/1.3 var(--body, system-ui);
  box-shadow: none;
}
.pk-panel .pk-search input:focus { border-color: #1f6f8b; background: var(--paper); box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.14); }
.pk-panel .pk-search input::-webkit-search-cancel-button { cursor: pointer; }

/* Options */
.pk-options {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
}
.pk-options:focus { outline: none; }
.pk-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.pk-option-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pk-option.is-active { background: var(--mist, var(--mist)); }
.pk-option.is-selected { color: var(--night, var(--ink-13242c, #13242c)); background: var(--tint-eaf4f1, #eaf4f1); font-weight: 600; }
.pk-option.is-selected.is-active { background: var(--tint-dcede7, #dcede7); }
.pk-option.is-placeholder { color: var(--quiet, var(--quiet)); }
.pk-option[aria-disabled="true"] { color: #aab6bb; cursor: not-allowed; background: none; }
.pk-option mark { padding: 0; color: inherit; background: rgba(31, 111, 139, 0.14); border-radius: 3px; font-weight: 600; }
.pk-check { display: grid; flex: none; color: var(--ok, #2f8f6e); }
.pk-group { padding: 10px 10px 4px; color: var(--quiet, var(--quiet)); font: 600 12px/1.2 var(--body, system-ui); }
.pk-empty { margin: 0; padding: 22px 16px; color: var(--muted, var(--muted)); text-align: center; }

/* Footer */
.pk-foot {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--hairline, var(--hairline));
}
.pk-panel .pk-link { padding: 7px 10px; border-radius: 8px; color: var(--night, var(--ink-13242c, #13242c)); font-weight: 600; font-size: 13px; }
.pk-panel .pk-link:hover { background: var(--mist, var(--mist)); }
.pk-panel .pk-link-quiet { color: var(--muted, var(--muted)); font-weight: 500; }
.pk-panel .pk-primary { margin-left: auto; padding: 8px 16px; border-radius: 9px; color: #fff; background: var(--night, #13242c); font-weight: 600; font-size: 13px; }
.pk-panel .pk-primary:hover { background: var(--night-3, #264350); }

/* ------------------------------------------------------ calendar ----- */
.pk-date-body { display: flex; min-height: 0; overflow-y: auto; }
.pk-cal { flex: none; width: 300px; max-width: 100%; padding: 12px 12px 10px; }
.pk-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 6px; }
.pk-panel .pk-cal-title { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; font-weight: 600; font-size: 14.5px; }
.pk-panel .pk-cal-title:hover { background: var(--mist, var(--mist)); }
.pk-cal-title > svg { color: var(--muted, var(--muted)); }
.pk-weekdays, .pk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.pk-weekdays span { padding: 4px 0 6px; color: var(--quiet, var(--quiet)); font: 600 11.5px/1 var(--body, system-ui); text-align: center; }
.pk-panel .pk-day {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.pk-panel .pk-day:hover:not(:disabled) { background: var(--mist, var(--mist)); }
.pk-panel .pk-day.is-outside { color: #a7b3b8; }
.pk-panel .pk-day.is-today { font-weight: 600; box-shadow: inset 0 0 0 1px var(--night, #13242c); }
.pk-panel .pk-day.is-selected { color: #fff; background: var(--night, #13242c); font-weight: 600; }
.pk-panel .pk-day:disabled { color: #c9d2d5; background: none; }
.pk-grid-12 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 4px; }
.pk-panel .pk-cell { height: 46px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.pk-panel .pk-cell:hover:not(:disabled) { background: var(--mist, var(--mist)); }
.pk-panel .pk-cell.is-focus { box-shadow: inset 0 0 0 1px var(--hairline-strong, var(--hairline-strong)); }
.pk-panel .pk-cell.is-today { font-weight: 600; }
.pk-panel .pk-cell.is-selected { color: #fff; background: var(--night, #13242c); font-weight: 600; }
.pk-panel .pk-cell:disabled { color: #c9d2d5; background: none; }

/* ----------------------------------------------------------- time ----- */
.pk-time { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; }
.pk-time-panel .pk-time { width: 100%; }
.pk-time-inline { flex: 1; border-left: 1px solid var(--hairline, var(--hairline)); }
.pk-panel .pk-time-entry {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--hairline-strong, var(--hairline-strong));
  border-radius: 10px;
  color: var(--ink, var(--ink));
  background: var(--paper);
  font: 600 20px/1 var(--body, system-ui);
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}
.pk-panel .pk-time-entry:focus { border-color: #1f6f8b; box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.14); }
.pk-panel .pk-time-entry.is-invalid { border-color: var(--alarm, #d9362c); box-shadow: 0 0 0 3px rgba(217, 54, 44, 0.14); }
.pk-time-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pk-time-cols.has-meridiem { grid-template-columns: 1fr 1fr 0.9fr; }
.pk-col-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pk-col-label { color: var(--quiet, var(--quiet)); font: 600 11.5px/1 var(--body, system-ui); text-align: center; }
.pk-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 212px;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 10px;
  background: var(--mist, var(--mist));
  scrollbar-width: thin;
}
.pk-col-meridiem { height: auto; max-height: 212px; }
.pk-panel .pk-col button { flex: none; min-height: 34px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.pk-panel .pk-col button:hover:not(:disabled) { background: var(--paper); }
.pk-panel .pk-col button.is-selected { color: #fff; background: var(--night, #13242c); font-weight: 600; }
.pk-panel .pk-col button:disabled { color: #b9c4c8; }

/* -------------------------------------------------------- sheet ----- */
.pk-panel.pk-sheet {
  top: auto !important;
  right: 0;
  bottom: 0;
  left: 0 !important;
  width: 100% !important;
  max-width: none;
  max-height: 85vh !important;
  border-width: 1px 0 0;
  border-radius: 18px 18px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: pk-sheet-in 200ms ease-out;
}
.pk-panel.pk-sheet::backdrop { background: rgba(8, 18, 23, 0.45); }
.pk-backdrop { position: fixed; inset: 0; z-index: 9999; background: rgba(8, 18, 23, 0.45); }
@keyframes pk-sheet-in { from { transform: translateY(24px); opacity: 0.6; } }
.pk-sheet-grip { flex: none; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--hairline-strong, var(--hairline-strong)); }
.pk-sheet-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 6px 18px; }
.pk-sheet-head strong { overflow: hidden; font: 600 16px/1.3 var(--body, system-ui); text-overflow: ellipsis; white-space: nowrap; }
.pk-sheet .pk-option { min-height: 46px; }
.pk-sheet .pk-date-body { flex-direction: column; }
.pk-sheet .pk-cal { width: 100%; }
.pk-panel.pk-sheet .pk-day { height: 44px; }
.pk-sheet .pk-time-inline { border-top: 1px solid var(--hairline, var(--hairline)); border-left: 0; }
.pk-sheet .pk-col { height: 196px; }
.pk-sheet .pk-foot { padding: 10px 14px; }

@media (prefers-reduced-motion: reduce) {
  .pk-panel, .pk-panel.pk-sheet { animation: none; }
}
