/* =============================================================================
   ADX custom dropdown + date picker — LIGHT skin for front (public) + /panel.
   The admin (body.adx) keeps its own DARK rules (admin-design-tokens.blade.php)
   which win by higher specificity. These unscoped rules style the same controls
   on light surfaces. Floating panels are appended to <body>, so they need
   unscoped selectors here. Loaded only on front + panel layouts.
   ========================================================================== */
:root {
    --adxl-brand: var(--brand-primary-base, #0e82fd);
    --adxl-surface: #ffffff;
    --adxl-surface-2: #f1f5f9;
    --adxl-line: #e2e8f0;
    --adxl-line-2: #cbd5e1;
    --adxl-ink: #0f172a;
    --adxl-muted: #94a3b8;
}

/* floating layer */
.adx-floats { position: fixed; z-index: 1090; }

/* ---- custom select ---- */
.adxs { position: relative; }
select.adxs-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; min-height: 0 !important; opacity: 0 !important; pointer-events: none !important; }
.adxs__control { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 0 10px; background: #F2F2F2 !important; border: 1px solid var(--adxl-line-2); border-radius: 6px; color: var(--adxl-ink); font-size: 13px; cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s; }
.adxs__control:hover { border-color: var(--adxl-brand); }
/* Prominent keyboard focus so a tabbed-to dropdown clearly looks selected */
.adxs__control:focus, .adxs__control:focus-visible { outline: 0; border-color: var(--adxl-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--adxl-brand) 28%, transparent); }
.adxs.is-open .adxs__control { border-color: var(--adxl-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--adxl-brand) 16%, transparent); }
.adxs__control:disabled { opacity: .55; cursor: not-allowed; }
.adxs__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adxs__label.is-placeholder { color: var(--adxl-muted); }
.adxs__caret { color: var(--adxl-muted); font-size: 11px; transition: transform .15s; }
.adxs.is-open .adxs__caret { transform: rotate(180deg); }

.adxs__panel { display: none; background: var(--adxl-surface); border: 1px solid var(--adxl-line); border-radius: 8px; box-shadow: 0 12px 36px rgba(15, 23, 42, .14); overflow: hidden; min-width: 160px; }
.adxs__panel.is-open { display: block; }
.adxs__search { padding: 7px; border-bottom: 1px solid var(--adxl-line); }
.adxs__searchinput { width: 100%; height: 30px; background: var(--adxl-surface-2); border: 1px solid var(--adxl-line-2); border-radius: 6px; color: var(--adxl-ink); font-size: 12.5px; padding: 0 9px; outline: none; }
.adxs__searchinput:focus { border-color: var(--adxl-brand); }
.adxs__list { max-height: 260px; overflow-y: auto; padding: 5px; }
.adxs__opt { padding: 7px 9px; border-radius: 6px; font-size: 13px; color: var(--adxl-ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adxs__opt:hover, .adxs__opt.is-active { background: var(--adxl-surface-2); }
.adxs__opt.is-selected { color: var(--adxl-brand); font-weight: 600; }
.adxs__opt.is-selected::after { content: '✓'; float: right; color: var(--adxl-brand); }
.adxs__opt.is-disabled { color: var(--adxl-muted); cursor: not-allowed; }

/* multi-select chips */
.adxs--multi .adxs__control { flex-wrap: wrap; min-height: 38px; padding: 4px 8px; gap: 4px; }
.adxs--multi .adxs__label { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; white-space: normal; }
.adxs__chip { display: inline-flex; align-items: center; gap: 5px; background: color-mix(in srgb, var(--adxl-brand) 12%, #fff); color: var(--adxl-brand); border: 1px solid color-mix(in srgb, var(--adxl-brand) 35%, #fff); border-radius: 999px; padding: 1px 8px; font-size: 12px; line-height: 1.6; }
.adxs__chipx { cursor: pointer; font-size: 13px; line-height: 1; opacity: .7; }
.adxs__chipx:hover { opacity: 1; }

/* ---- custom date picker ---- */
input.adxd-input { cursor: pointer; }
.adxd { display: none; width: 280px; background: var(--adxl-surface); border: 1px solid var(--adxl-line); border-radius: 12px; box-shadow: 0 18px 50px rgba(15, 23, 42, .18); padding: 14px; }
.adxd.is-open { display: block; }
.adxd__hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.adxd__title { font-size: 14px; font-weight: 500; color: var(--adxl-ink); background: transparent; border: 0; cursor: pointer; padding: 4px 10px; border-radius: 8px; line-height: 1; }
.adxd__title:not(.adxd__title--static):hover { background: var(--adxl-surface-2); color: var(--adxl-brand); }
.adxd__title--static { cursor: default; }
.adxd__grid.adxd__grid--cells { grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.adxd__cell { border: 0; background: transparent; color: var(--adxl-ink); border-radius: 8px; font-size: 13px; cursor: pointer; padding: 12px 4px; }
.adxd__cell:hover { background: var(--adxl-surface-2); }
.adxd__cell.is-today { box-shadow: inset 0 0 0 1px var(--adxl-line-2); }
.adxd__cell.is-sel { background: var(--adxl-brand) !important; color: #fff !important; }
.adxd__cell.is-disabled, .adxd__cell:disabled { opacity: .3; cursor: not-allowed; pointer-events: none; }
.adxd__nav { width: 30px; height: 30px; border-radius: 8px; background: var(--adxl-surface-2); border: 1px solid var(--adxl-line-2); color: var(--adxl-ink); cursor: pointer; font-size: 14px; line-height: 1; }
.adxd__nav:hover { background: var(--adxl-line); }
.adxd__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.adxd__dow { text-align: center; font-size: 11px; color: var(--adxl-muted); padding: 5px 0; font-weight: 600; }
.adxd__day { aspect-ratio: 1; border: 0; background: transparent; color: var(--adxl-ink); border-radius: 8px; font-size: 13px; cursor: pointer; }
.adxd__day:hover { background: var(--adxl-surface-2); }
.adxd__day.is-empty { visibility: hidden; cursor: default; }
.adxd__day.is-today { box-shadow: inset 0 0 0 1px var(--adxl-line-2); }
.adxd__day.is-inrange { background: color-mix(in srgb, var(--adxl-brand) 14%, transparent); border-radius: 0; }
.adxd__day.is-sel { background: var(--adxl-brand) !important; color: #fff !important; font-weight: 400; }
.adxd__day.is-disabled, .adxd__day:disabled { opacity: .3; cursor: not-allowed; pointer-events: none; }
.adxd__time { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--adxl-line); }
.adxd__time label { font-size: 12px; color: var(--adxl-muted); }
.adxd__timeinput { flex: 1; height: 34px; background: var(--adxl-surface-2); border: 1px solid var(--adxl-line-2); border-radius: 7px; color: var(--adxl-ink); padding: 0 10px; font-size: 13px; }
.adxd__foot { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--adxl-line); }
.adxd__foot button { flex: 1; height: 34px; border-radius: 8px; font-size: 13px; font-weight: 400; cursor: pointer; border: 1px solid var(--adxl-line-2); }
.adxd__clear { background: var(--adxl-surface-2); color: var(--adxl-ink); }
.adxd__apply { background: var(--adxl-brand); color: #fff; border-color: var(--adxl-brand); }

/* ---- custom time picker (ADX.Time) ---- */
input.adxt-input { cursor: pointer; }
.adxt { display: none; width: 264px; background: var(--adxl-surface); border: 1px solid var(--adxl-line); border-radius: 14px; box-shadow: 0 18px 50px rgba(15, 23, 42, .18); padding: 14px; }
.adxt.is-open { display: block; }
.adxt__head { text-align: center; margin-bottom: 10px; }
.adxt__big { font-size: 23px; font-weight: 600; color: var(--adxl-ink); letter-spacing: .01em; }
.adxt__cols { display: flex; align-items: flex-start; gap: 7px; justify-content: center; }
.adxt__colwrap { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.adxt__colwrap--ap { flex: 0 0 52px; }
.adxt__lab { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--adxl-muted); font-weight: 600; text-align: center; margin-bottom: 5px; }
.adxt__sep { font-size: 20px; font-weight: 600; color: var(--adxl-muted); align-self: center; padding-top: 16px; }
.adxt__col { height: 152px; overflow-y: auto; scroll-snap-type: y proximity; display: flex; flex-direction: column; gap: 2px; padding: 4px; background: var(--adxl-surface-2); border-radius: 10px; }
.adxt__col::-webkit-scrollbar { width: 6px; }
.adxt__col::-webkit-scrollbar-thumb { background: var(--adxl-line-2); border-radius: 6px; }
.adxt__item { scroll-snap-align: center; border: 0; background: transparent; color: var(--adxl-ink); font-size: 14px; padding: 7px 0; border-radius: 7px; cursor: pointer; text-align: center; transition: background .1s; }
.adxt__item:hover { background: var(--adxl-line); }
.adxt__item.is-sel { background: var(--adxl-brand); color: #fff; font-weight: 600; }
.adxt__ap { display: flex; flex-direction: column; gap: 6px; }
.adxt__ap button { border: 1px solid var(--adxl-line-2); background: var(--adxl-surface); color: var(--adxl-ink); border-radius: 8px; padding: 9px 0; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .1s; }
.adxt__ap button.is-sel { background: var(--adxl-brand); border-color: var(--adxl-brand); color: #fff; }
.adxt__foot { display: flex; gap: 6px; margin-top: 12px; }
.adxt__btn { flex: 1; border: 1px solid var(--adxl-line-2); background: var(--adxl-surface); color: var(--adxl-ink); border-radius: 8px; padding: 8px; font-size: 12.5px; cursor: pointer; }
.adxt__btn:hover { background: var(--adxl-surface-2); }
.adxt__btn--primary { background: var(--adxl-brand); border-color: var(--adxl-brand); color: #fff; }
.adxt__btn--primary:hover { filter: brightness(.96); }
/* admin dark surface support */
body.adx .adxt { background: var(--adx-surface, #161616); border-color: var(--adx-line, #2a2a2a); }
body.adx .adxt__big, body.adx .adxt__item { color: var(--adx-strong, #f4f4f4); }
body.adx .adxt__col { background: var(--adx-surface-2, #1f1f1f); }
