/* Janata UI: custom select + date picker */
:root { --ui-accent: #2E9E44; --ui-accent-2: #1E6B35; --ui-soft: #f0fdf4; --ui-line: #e6e9ee; --ui-ink: #0f172a; --ui-muted: #64748b; --ui-radius: 14px; }
.ui-select, .ui-date { position: relative; display: block; width: 100%; min-width: 0; }
.ui-native { position: absolute !important; left: 0; bottom: 0; width: 100% !important; height: 1px !important; min-height: 0 !important; opacity: 0 !important; pointer-events: none !important; padding: 0 !important; border: 0 !important; }

.ui-trigger { display: flex !important; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; background-color: #fff; }
.ui-trigger .ui-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-ink); }
.ui-trigger.ui-placeholder .ui-val { color: #94a3b8; }
.ui-chev { display: grid; place-items: center; flex: none; width: 18px; height: 18px; color: var(--ui-muted); transition: transform .2s; }
.ui-chev svg, .ui-search svg, .ui-opt svg, .ui-date-btn svg, .ui-nav svg { width: 100%; height: 100%; }
.ui-select.open .ui-chev { transform: rotate(180deg); color: var(--ui-accent); }
.ui-select.open .ui-trigger, .ui-date.open .ui-date-input { border-color: var(--ui-accent) !important; box-shadow: 0 0 0 3px rgba(46, 158, 68, .14); }
.ui-select.disabled .ui-trigger, .ui-date-input:disabled { opacity: .55; cursor: not-allowed; background: #f8fafc; }
.ui-select.invalid .ui-trigger, .ui-date.invalid .ui-date-input { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }

.ui-panel { position: fixed; z-index: 120; max-width: min(420px, calc(100vw - 16px)); background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: 0 18px 48px -12px rgba(15, 23, 42, .22), 0 2px 6px rgba(15, 23, 42, .06); padding: 6px; font-size: 14.5px; color: var(--ui-ink); animation: ui-in .14s ease-out; }
.ui-panel[hidden] { display: none; }
@keyframes ui-in { from { opacity: 0; transform: translateY(-4px) } }
.ui-sheet-bar { display: none; }
.ui-search { display: flex; align-items: center; gap: 8px; margin: 2px 2px 6px; padding: 0 10px; height: 40px; border: 1px solid var(--ui-line); border-radius: 10px; background: #f8fafc; color: var(--ui-muted); }
.ui-search[hidden] { display: none; }
.ui-search svg { width: 16px; height: 16px; flex: none; }
.ui-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ui-ink); height: 100%; }
.ui-search:focus-within { border-color: var(--ui-accent); background: #fff; }
.ui-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; outline: 0; overscroll-behavior: contain; }
.ui-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; line-height: 1.35; }
.ui-opt span { flex: 1; }
.ui-opt svg { width: 16px; height: 16px; flex: none; color: var(--ui-accent); visibility: hidden; }
.ui-opt.act { background: #f1f5f9; }
.ui-opt.sel { background: var(--ui-soft); color: var(--ui-accent-2); font-weight: 600; }
.ui-opt.sel svg { visibility: visible; }
.ui-opt.dis { opacity: .45; cursor: not-allowed; }
.ui-opt[hidden], .ui-group[hidden] { display: none; }
.ui-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ui-muted); }
.ui-empty { margin: 0; padding: 14px 10px; text-align: center; color: var(--ui-muted); font-size: 14px; }

/* date */
.ui-date-input { padding-right: 44px !important; cursor: pointer; }
.ui-date-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--ui-muted); cursor: pointer; }
.ui-date-btn:hover, .ui-date.open .ui-date-btn { background: var(--ui-soft); color: var(--ui-accent); }
.ui-cal { width: 300px; padding: 12px; }
.ui-cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ui-nav { display: grid; place-items: center; width: 34px; height: 34px; padding: 8px; border: 1px solid var(--ui-line); border-radius: 10px; background: #fff; color: var(--ui-ink); cursor: pointer; }
.ui-nav:hover { border-color: var(--ui-accent); color: var(--ui-accent); }
.ui-cal-title { flex: 1; display: flex; justify-content: center; gap: 4px; }
.ui-cal-title select { appearance: none; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ui-ink); padding: 6px 6px; border-radius: 8px; cursor: pointer; }
.ui-cal-title select:hover { background: #f1f5f9; }
.ui-cal-days, .ui-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.ui-cal-days b { font-size: 11.5px; font-weight: 600; color: var(--ui-muted); padding: 4px 0; }
.ui-cal-grid button { aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 14px; color: var(--ui-ink); cursor: pointer; }
.ui-cal-grid button:hover { background: #f1f5f9; }
.ui-cal-grid button.today { box-shadow: inset 0 0 0 1px var(--ui-accent); color: var(--ui-accent); font-weight: 600; }
.ui-cal-grid button.sel { background: linear-gradient(180deg, #36A852, #1E6B35); color: #fff; font-weight: 600; box-shadow: none; }
.ui-cal-grid button:disabled { opacity: .3; cursor: not-allowed; background: none; }
.ui-time { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ui-line); font-size: 13.5px; color: var(--ui-muted); }
.ui-time input { border: 1px solid var(--ui-line); border-radius: 9px; height: 36px; padding: 0 10px; font: inherit; color: var(--ui-ink); }
.ui-cal-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ui-line); }
.ui-cal-foot button { border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--ui-accent); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.ui-cal-foot button[data-act=clear] { color: var(--ui-muted); }
.ui-cal-foot button:hover { background: #f1f5f9; }

/* mobile bottom sheet */
.ui-backdrop { position: fixed; inset: 0; z-index: 119; background: rgba(11, 31, 20, .45); opacity: 0; transition: opacity .2s; }
.ui-backdrop.on { opacity: 1; }
.ui-panel.ui-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; min-width: 0 !important; border-radius: 20px 20px 0 0; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); animation: ui-up .22s ease-out; }
.ui-sheet .ui-sheet-bar { display: block; width: 40px; height: 4px; margin: 2px auto 10px; border-radius: 4px; background: #cbd5e1; }
.ui-sheet .ui-list { max-height: 55vh; }
.ui-sheet .ui-opt { padding: 13px 12px; font-size: 15.5px; }
.ui-sheet .ui-search { height: 46px; }
.ui-sheet.ui-cal { width: 100%; }
.ui-sheet .ui-cal-grid button { font-size: 15.5px; }
@keyframes ui-up { from { transform: translateY(100%) } }
@media (prefers-reduced-motion: reduce) { .ui-panel, .ui-panel.ui-sheet { animation: none; } }
