/* ERP form controls · compact Fluent-style baseline */
.erp-controls{width:100%;padding:var(--ui-space-4);box-sizing:border-box}
.erp-controls__heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}
.erp-controls__heading h1{font-size:18px;font-weight:650;margin:0}
.erp-controls__heading p{font-size:12px;color:var(--ui-color-text-secondary);margin:3px 0 0}
.erp-controls__grid{display:grid;grid-template-columns:repeat(2,minmax(280px,1fr));gap:12px}
.erp-controls__section{border:1px solid var(--ui-color-border);border-radius:4px;background:var(--ui-color-surface-1);padding:12px;min-width:0}
.erp-controls__section h2{font-size:14px;margin:0 0 12px;font-weight:650}
.erp-field{display:grid;gap:5px;min-width:0;margin:0 0 12px}
.erp-field>label{font-size:12px;font-weight:600}
.erp-field__hint{font-size:11px;color:var(--ui-color-text-secondary)}
.erp-field input,.erp-field select{height:32px;min-width:0;width:100%;box-sizing:border-box;padding:5px 9px;border-radius:4px;border:1px solid var(--ui-color-border);background:var(--ui-color-surface-1);color:var(--ui-color-text);font:inherit;font-size:12px}
.erp-field input:focus,.erp-field select:focus{border-color:var(--ui-color-focus);outline:1px solid var(--ui-color-focus);outline-offset:-1px;box-shadow:none}
.erp-field input:disabled,.erp-field select:disabled{opacity:.6;cursor:not-allowed}
.erp-choice{position:relative;min-width:0}
/* The native select stores the form value only, including while disabled. */
.erp-field .erp-choice>select,.erp-field .erp-choice>select:disabled{position:absolute;width:1px;height:1px;min-width:0;min-height:0;margin:0;padding:0;border:0;appearance:none;opacity:0;clip-path:inset(50%);pointer-events:none}
.erp-choice__input-row{display:flex;position:relative;align-items:center}
.erp-choice__input-row input{padding-right:58px}
.erp-choice__actions{position:absolute;right:4px;display:flex;gap:1px}
.erp-choice__actions button,.erp-picker > [data-erp-picker-trigger]{border:0;background:transparent;color:var(--ui-color-text-secondary);border-radius:4px;width:25px;height:25px;cursor:pointer;display:grid;place-items:center;font-size:14px}
.erp-choice__actions button:hover,.erp-picker > [data-erp-picker-trigger]:hover{background:var(--ui-color-surface-hover)}
.erp-choice__options{position:absolute;z-index:40;left:0;right:0;top:calc(100% + 3px);max-height:210px;overflow-y:auto;border:1px solid var(--ui-color-border);border-radius:4px;background:var(--ui-color-surface-1);box-shadow:0 5px 16px #0002;padding:3px;scrollbar-width:thin;scrollbar-color:transparent transparent;scrollbar-gutter:stable}
.erp-choice__options[hidden]{display:none}
.erp-choice__options:hover{scrollbar-color:#aeb8c4 transparent}
.erp-choice__option{display:block;width:100%;text-align:left;padding:7px 9px;border:0;border-radius:4px;background:transparent;color:var(--ui-color-text);font:inherit;font-size:12px;cursor:pointer}
.erp-choice__option:hover,.erp-choice__option.is-active{background:var(--ui-color-surface-hover)}
.erp-choice__option[aria-selected="true"]{background:var(--ui-color-accent-subtle);color:var(--ui-color-accent);font-weight:600}
.erp-choice__option:disabled{opacity:.5;cursor:not-allowed}
.erp-choice__empty{padding:10px;color:var(--ui-color-text-secondary);font-size:12px}
.erp-choice__count{font-size:11px;color:var(--ui-color-text-secondary);margin-top:4px}
.erp-picker{display:flex;position:relative;align-items:center}
.erp-picker input{padding-right:36px;color-scheme:light}
.erp-picker > [data-erp-picker-trigger]{position:absolute;right:5px}
.erp-controls__feedback{min-height:24px;color:var(--ui-color-text-secondary);font-size:12px}
@media(max-width:740px){.erp-controls{padding:8px}.erp-controls__grid{grid-template-columns:1fr}.erp-controls__section{padding:10px}}

/* Fixed-size SVG command buttons aligned to the input's right edge. */
.erp-choice__actions{right:5px;gap:2px;align-items:center}
.erp-choice__actions button,.erp-picker > [data-erp-picker-trigger]{width:26px;height:26px;padding:0;flex:none}
.erp-choice__actions button svg,.erp-picker > [data-erp-picker-trigger] svg{width:16px;height:16px;display:block;stroke:currentColor}
.erp-choice__actions button:focus-visible,.erp-picker > [data-erp-picker-trigger]:focus-visible{outline:1px solid var(--ui-color-focus);outline-offset:-1px}
.erp-choice__input-row input{padding-right:67px}
.erp-choice__actions [data-erp-choice-toggle]{border-left:1px solid var(--ui-color-border);border-radius:0 3px 3px 0}
.erp-picker input{padding-right:38px}
.erp-picker[data-erp-picker] > input[type="date"]::-webkit-calendar-picker-indicator,
.erp-picker[data-erp-picker] > input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.erp-picker[data-erp-picker] > input[type="time"]::-webkit-calendar-picker-indicator{opacity:0;pointer-events:none;width:0;margin:0}
.erp-picker > [data-erp-picker-trigger]{right:5px;z-index:1}
/* In-house date/calendar popup; native input keeps form validation and submission. */
.erp-calendar{position:absolute;z-index:80;top:calc(100% + 4px);right:0;width:284px;max-width:min(284px,calc(100vw - 32px));box-sizing:border-box;background:var(--ui-color-surface-1);border:1px solid var(--ui-color-border);border-radius:4px;padding:10px;box-shadow:0 8px 25px #0002;color:var(--ui-color-text);font-size:12px}
.erp-calendar[hidden]{display:none}
.erp-calendar__heading{display:grid;grid-template-columns:30px minmax(0,1fr) 30px;align-items:center;gap:4px;margin-bottom:8px}
.erp-calendar__heading strong{text-align:center;font-weight:650}
.erp-calendar button{cursor:pointer;color:var(--ui-color-text);font:inherit;border-radius:4px}
.erp-calendar__heading button{height:28px;border:0;background:transparent;font-size:22px}
.erp-calendar__heading button:hover{background:var(--ui-color-surface-hover)}
.erp-calendar__weekdays,.erp-calendar__days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));text-align:center;gap:2px}
.erp-calendar__weekdays{color:var(--ui-color-text-secondary);font-size:10px;margin-bottom:5px}
.erp-calendar__weekdays span{padding:4px 0}
.erp-calendar__days button{height:32px;padding:0;background:transparent;border:1px solid transparent}
.erp-calendar__days button:hover:not(:disabled){background:var(--ui-color-surface-hover)}
.erp-calendar__days button[aria-pressed="true"]{background:var(--ui-color-accent);color:#fff}
.erp-calendar__days button.is-today:not([aria-pressed="true"]){border-color:var(--ui-color-accent)}
.erp-calendar__days button:disabled{opacity:.25;cursor:not-allowed}
.erp-calendar__footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;border-top:1px solid var(--ui-color-border);padding-top:9px;margin-top:9px}
.erp-calendar__footer>button{min-height:28px;padding:4px 9px;border:1px solid var(--ui-color-border);background:var(--ui-color-surface-1)}
.erp-calendar__footer>button:hover{background:var(--ui-color-surface-hover)}
.erp-calendar__footer>.erp-calendar__apply{background:var(--ui-color-accent);color:#fff;border-color:var(--ui-color-accent)}
.erp-calendar__time{display:flex;align-items:center;gap:5px;margin-right:auto;font-size:11px}
.erp-calendar__time input{height:28px;width:100px;padding:2px 4px;font-size:12px}

/* Calendar popup buttons must not inherit the absolute picker-trigger rule. */
.erp-picker .erp-calendar button {
  position: static;
  inset: auto;
  z-index: auto;
  display: inline-grid;
  place-items: center;
  width: auto;
  min-width: 0;
  height: auto;
  font-size: 12px;
}
.erp-picker .erp-calendar__heading > button { width: 30px; height: 28px; font-size: 20px; }
.erp-picker .erp-calendar__days button { width: 100%; height: 32px; }
.erp-picker .erp-calendar__footer > button { display: inline-flex; height: 28px; }
.erp-picker .erp-calendar__weekdays,
.erp-picker .erp-calendar__days { width: 100%; }
.erp-picker .erp-calendar__time input {
  width: 86px; min-width: 0; height: 28px; padding: 2px 5px;
}

/* Three equal header zones, with independent quick month/year selection. */
.erp-calendar__heading {
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 30px;
  align-items:center;
  gap:4px;
}
.erp-calendar__title {display:flex;align-items:center;justify-content:center;gap:2px;min-width:0}
.erp-picker .erp-calendar__title-button {
  position:static;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:28px;
  width:auto;
  padding:2px 4px;
  font-size:13px;
  font-weight:650;
  border:1px solid transparent;
  background:transparent;
  border-radius:4px;
}
.erp-calendar__title-button:hover,.erp-calendar__title-button[aria-pressed="true"] {background:var(--ui-color-surface-hover)}
.erp-calendar__title-button:focus-visible,.erp-calendar__choices button:focus-visible {outline:2px solid var(--ui-color-focus);outline-offset:-2px}
.erp-calendar__weekdays[hidden],.erp-calendar__days[hidden],.erp-calendar__choices[hidden] {display:none!important}
.erp-calendar__choices {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;min-height:201px;align-content:start}
.erp-picker .erp-calendar__choices button {position:static;width:100%;min-height:43px;padding:6px 3px;border:1px solid transparent;background:transparent;border-radius:4px;font-size:12px}
.erp-calendar__choices button:hover:not(:disabled){background:var(--ui-color-surface-hover)}
.erp-calendar__choices button[aria-pressed="true"]{color:var(--ui-color-accent);background:var(--ui-color-accent-subtle);font-weight:650}
.erp-calendar__choices button:disabled{opacity:.3;cursor:not-allowed}

/* Header contract: only arrow buttons are 30px. Month/year must size to text. */
.erp-picker .erp-calendar__heading {
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  width: 100%;
}
.erp-picker .erp-calendar__title {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 4px;
}
.erp-picker .erp-calendar__heading .erp-calendar__title > .erp-calendar__title-button {
  position: static;
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: 28px;
  padding: 2px 4px;
  line-height: 1.2;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
  border: 1px solid transparent;
}
.erp-picker .erp-calendar__heading > button { justify-self: center; }

/* DateTimePicker: prevent localized AM/PM text and native clock affordance clipping. */
.erp-picker .erp-calendar__footer {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}
.erp-picker .erp-calendar__time {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 5px;
  margin-right: auto;
  white-space: nowrap;
}
.erp-picker .erp-calendar__time input[type="time"] {
  box-sizing: border-box;
  flex: 1 1 132px;
  width: 132px;
  min-width: 125px;
  max-width: none;
  height: 30px;
  padding: 3px 6px;
  font-size: 12px;
}
.erp-picker .erp-calendar__footer > button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.erp-picker .erp-calendar:has(.erp-calendar__time) {
  width: 330px;
  max-width: min(330px, calc(100vw - 20px));
}

/* Opt-in modal choice popup: top layer, viewport-constrained and scrollable. */
.erp-choice__options--floating{
    position:fixed;inset:auto;margin:0;box-sizing:border-box;max-height:320px;
    overscroll-behavior:contain;scrollbar-color:#aeb8c4 transparent;
}
.erp-choice[data-floating-options="true"] [aria-multiselectable="true"] .erp-choice__option{
    display:flex;align-items:center;gap:9px;min-height:30px;
}
.erp-choice[data-floating-options="true"] [aria-multiselectable="true"] .erp-choice__option::before{
    content:"";display:inline-flex;align-items:center;justify-content:center;
    box-sizing:border-box;width:16px;height:16px;flex:0 0 16px;
    border:1px solid var(--ui-color-border);border-radius:3px;
    background:var(--ui-color-surface-1);color:white;font-size:12px;line-height:1;
}
.erp-choice[data-floating-options="true"] [aria-multiselectable="true"] .erp-choice__option[aria-selected="true"]::before{
    content:"\2713";background:var(--ui-color-accent);border-color:var(--ui-color-accent);
}
