/* Shared calendar, time and select controls use the console's palette. */
.styled-field { position: relative; display: inline-flex; align-items: stretch; width: 100%; min-width: 0; max-width: 100%; vertical-align: middle; color: var(--text); text-align: left; }
.styled-field .styled-field-native { display: none !important; }
.styled-field [hidden] { display: none !important; }
.styled-field [data-styled-proxy], .styled-field .sfield-trigger, .styled-field .sfield-input { min-width: 0; max-width: 100%; }
.styled-field button { font: inherit; }
.styled-field :is(button, input):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.styled-field :is([aria-invalid="true"]) { border-color: var(--red); }
.styled-field .sfield-select-trigger { width: 100%; min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 11px; border: 1px solid #d5dfef; border-radius: 7px; background: #fff; color: var(--text); text-align: left; }
.styled-field .sfield-select-trigger:hover:not(:disabled) { border-color: #8ebdff; background: #fbfdff; }
.styled-field-open .sfield-select-trigger { border-color: var(--blue); box-shadow: 0 0 0 2px #1677ff12; }
.sfield-select-value { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
.sfield-select-arrow { width: 16px; height: 16px; flex: 0 0 16px; display: grid; place-items: center; line-height: 0; color: var(--muted); transform: rotate(-90deg); transform-origin: center; transition: transform .15s; }
.sfield-select-arrow svg { display: block; width: 16px; height: 16px; }
.styled-field-open .sfield-select-arrow { transform: rotate(0deg); }
.styled-field-popup { position: fixed; inset: auto; margin: 0; width: max-content; max-width: calc(100vw - 16px); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); box-shadow: 0 10px 38px #233c6124, 0 2px 6px #233c610c; overflow: auto; overscroll-behavior: contain; font-size: 13px; text-align: left; z-index: 1500; }
.styled-field-popup[hidden] { display: none !important; }
.styled-field-popup::backdrop { background: transparent; }
.sfield-select-popup { padding: 6px; width: 280px; }
.sfield-select-list { max-height: 260px; overflow: auto; overscroll-behavior: contain; padding: 2px; }
.styled-field-popup .sfield-select-option { display: flex; gap: 8px; align-items: center; width: 100%; min-height: 34px; padding: 8px 10px; border: 0; border-radius: 6px; background: #fff; color: var(--text); text-align: left; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
.styled-field-popup .sfield-select-option:hover:not([aria-disabled="true"]), .sfield-select-option.is-active { background: var(--panel); }
.styled-field-popup .sfield-select-option[aria-selected="true"] { background: #eaf3ff; color: #1265d6; }
.styled-field-popup .sfield-select-option[aria-disabled="true"] { color: #a2adbc; cursor: not-allowed; }
.sfield-select-group-label { padding: 7px 10px; color: var(--muted); font-size: 12px; }
.sfield-select-group-label { font-weight: 600; border-top: 1px solid var(--line); }
.sfield-select-check { flex: 0 0 16px; color: var(--blue); }
.sfield-select-empty { padding: 18px 12px; color: var(--muted); text-align: center; }
.styled-date-time { flex-wrap: wrap; border: 1px solid #d5dfef; border-radius: 7px; background: #fff; }
.styled-date-time:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px #1677ff12; }
.styled-date-time:has(.sfield-date-text[aria-invalid="true"]) { border-color: var(--red); }
.styled-date-time .sfield-date-text { flex: 1 1 110px; width: 100%; min-width: 0; min-height: 32px; padding: 6px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text); }
.styled-date-time .sfield-date-text:focus-visible { outline-offset: -3px; }
.styled-date-time .sfield-date-open { flex: 0 0 auto; align-self: stretch; min-height: 32px; padding: 4px 10px; border: 0; border-left: 1px solid var(--line); border-radius: 0 7px 7px 0; background: var(--panel); color: #526783; font-size: 12px; }
.styled-date-time .sfield-date-open:hover:not(:disabled) { background: var(--active); color: var(--blue); }
.sfield-date-popup { width: 310px; }
.sfield-calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 10px; }
.styled-field-popup .sfield-calendar-heading input { width: 58px; min-width: 0; height: 30px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); text-align: center; }
.styled-field-popup .sfield-calendar-heading .sfield-calendar-month { width: 42px; }
.sfield-calendar-weekdays, .sfield-calendar-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.sfield-calendar-weekdays { padding: 3px 0 7px; color: var(--muted); text-align: center; }
.sfield-calendar-row + .sfield-calendar-row { margin-top: 3px; }
.styled-field-popup .sfield-date-action { min-height: 30px; padding: 5px 9px; border: 0; border-radius: 7px; background: var(--panel); color: #526783; }
.styled-field-popup .sfield-date-action:hover:not(:disabled) { background: var(--active); color: var(--blue); }
.styled-field-popup .sfield-calendar-day { min-width: 0; min-height: 32px; padding: 5px 0; background: #fff; color: var(--text); text-align: center; }
.styled-field-popup .sfield-calendar-day[aria-current="date"] { color: var(--blue); box-shadow: inset 0 0 0 1px #9dc5ff; }
.styled-field-popup .sfield-calendar-day[aria-selected="true"] { background: var(--blue); color: #fff; box-shadow: none; }
.styled-field-popup .sfield-calendar-day:disabled { opacity: .4; cursor: not-allowed; }
.sfield-clock { display: flex; gap: 10px; padding-top: 12px; }
.sfield-time-part { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.styled-field-popup .sfield-time-number { width: 100%; min-width: 0; height: 38px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 18px; text-align: center; }
.sfield-date-error { max-width: 100%; margin: 8px 0 0; font-size: 12px; color: var(--red); overflow-wrap: anywhere; }
.sfield-date-error:empty { display: none; }
.styled-date-time > .sfield-date-error { flex: 0 0 100%; padding: 0 9px 7px; margin-top: 0; }
.styled-select { flex-wrap: wrap; }
.styled-select > .sfield-select-error { flex: 0 0 100%; margin: 5px 0 0; color: var(--red); font-size: 12px; overflow-wrap: anywhere; }
.sfield-date-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.styled-field-popup .sfield-date-confirm { background: var(--blue); color: #fff; }
.styled-field-popup .sfield-date-confirm:hover:not(:disabled) { background: #4091ff; color: #fff; }
.gantt-date-control .styled-date-time { width: 228px; }
.styled-date-time:has(input:disabled), .styled-select:has(.sfield-select-trigger:disabled) { background: #f5f7fa; }
.filterbar .styled-select { width: auto; min-width: 120px; max-width: 230px; }
.filterbar .styled-select:has(select.wide) { width: 230px; }
.pager .styled-select { flex: 0 0 112px; width: 112px; }
.backup-restore-row > .styled-select { flex: 1 1 220px; width: auto; }
.workflow-graph-route > .styled-select { flex: 1 0 100%; }
.workflow-node-controls .styled-select { width: auto; max-width: 280px; }
@media (max-width: 640px) { .filterbar .styled-select, .filterbar .styled-select:has(select.wide) { flex: 1 1 auto; width: 100%; max-width: 100%; } .gantt-date-control .styled-date-time { width: min(228px, 100%); } }
@media (prefers-reduced-motion: reduce) { .sfield-select-arrow { transition: none; } }
