/* Calcavera Admin UI compatibility fixes — Phase 4.01d
   Native form controls, especially <select>/<option> on Windows Chrome, do not
   reliably inherit Tailwind text/background colors. Keep their palette explicit. */

.admin-shell {
    color-scheme: dark;
}

.admin-shell input,
.admin-shell textarea,
.admin-shell select {
    color: #f8fafc;
    caret-color: #f8fafc;
}

.admin-shell select {
    color-scheme: dark;
    background-color: #111722;
}

/* Native dropdown popup items. Explicit colors prevent white-on-white menus. */
.admin-shell select option,
.admin-shell select optgroup {
    background-color: #111722 !important;
    color: #f8fafc !important;
}

.admin-shell select option:disabled {
    color: #64748b !important;
}

.admin-shell input::placeholder,
.admin-shell textarea::placeholder {
    color: #64748b;
    opacity: 1;
}

.admin-shell input:-webkit-autofill,
.admin-shell input:-webkit-autofill:hover,
.admin-shell input:-webkit-autofill:focus,
.admin-shell textarea:-webkit-autofill,
.admin-shell select:-webkit-autofill {
    -webkit-text-fill-color: #f8fafc;
    -webkit-box-shadow: 0 0 0 1000px #111722 inset;
    box-shadow: 0 0 0 1000px #111722 inset;
    caret-color: #f8fafc;
    transition: background-color 9999s ease-out 0s;
}

/* Make native controls visibly interactive even without hover. */
.admin-shell select:focus,
.admin-shell input:focus,
.admin-shell textarea:focus {
    outline: none;
    border-color: rgba(129, 140, 248, .55) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

/* Improve contrast for browser-provided date/time/list controls. */
.admin-shell input[type="date"],
.admin-shell input[type="time"],
.admin-shell input[type="datetime-local"],
.admin-shell input[type="number"] {
    color-scheme: dark;
}

/* Firefox-specific native dropdown readability. */
@-moz-document url-prefix() {
    .admin-shell select,
    .admin-shell select option,
    .admin-shell select optgroup {
        background-color: #111722 !important;
        color: #f8fafc !important;
    }
}
