/* ui-controls.css — custom select & datetime picker styles */
  /* custom select / datetime */
  .ui-select, .ui-date {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    min-width: 110px;
  }
  .ui-select-btn, .ui-date-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    text-align: left;
  }
  .ui-select-btn:hover, .ui-date-btn:hover,
  .ui-select.open .ui-select-btn, .ui-date.open .ui-date-btn {
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(59,130,246,.15);
  }
  .ui-select-btn .label, .ui-date-btn .label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
  }
  .ui-select-btn .label.placeholder,
  .ui-date-btn .label.placeholder { color: var(--muted2); }
  .ui-caret {
    color: var(--muted2);
    font-size: 10px;
    flex: 0 0 auto;
  }
  .ui-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-height: 240px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15,23,42,.12);
    z-index: 80;
    padding: 4px;
  }
  .ui-menu.hidden { display: none !important; }
  .ui-option {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
  }
  .ui-option:hover { background: #f3f4f6; }
  .ui-option.active {
    background: var(--primary-soft);
    color: #1d4ed8;
    font-weight: 500;
  }
  .ui-date-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15,23,42,.12);
    z-index: 80;
    padding: 10px;
  }
  .ui-date-panel.hidden { display: none !important; }
  .ui-date-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }
  .ui-date-hd strong { font-size: 13px; }
  .ui-date-hd .nav {
    display: flex; gap: 4px;
  }
  .ui-date-hd .nav button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    width: 28px; height: 28px;
    cursor: pointer;
  }
  .ui-date-hd .nav button:hover { border-color: var(--primary); }
  .ui-cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
  }
  .ui-cal .dow {
    text-align: center;
    font-size: 11px;
    color: var(--muted2);
    padding: 4px 0;
  }
  .ui-cal .day {
    border: 0;
    background: transparent;
    border-radius: 6px;
    height: 30px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
  }
  .ui-cal .day:hover { background: #f3f4f6; }
  .ui-cal .day.muted { color: var(--muted2); }
  .ui-cal .day.selected {
    background: var(--primary);
    color: #fff;
  }
  .ui-cal .day.today:not(.selected) {
    box-shadow: inset 0 0 0 1px var(--primary);
    color: #1d4ed8;
  }
  .ui-time {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
  }
  .ui-time label { font-size: 12px; color: var(--muted); }
  .ui-time input {
    width: 56px;
    text-align: center;
  }
  .ui-date-ft {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }
  .ui-date-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
  }
  .ui-date-quick button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
  }
  .ui-date-quick button:hover { border-color: var(--primary); color: #1d4ed8; }
  .native-hidden {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }


    .ui-date-panel {
      position: fixed;
      left: 12px; right: 12px; top: auto; bottom: calc(var(--bottom-h) + 12px + env(safe-area-inset-bottom));
      width: auto;
      max-height: 80dvh;
      overflow: auto;
      padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    .ui-menu {
      max-height: 40dvh;
    }
