/**
 * ORBIS — refinado global de <select> e inputs de fecha/hora.
 * Sin transform ni animaciones que desplacen el control (evita “saltos” al abrir el <select>).
 * La lista desplegable del <select> y el popup de fecha siguen siendo nativos del navegador.
 */

:root {
    --orbis-c-border: rgba(54, 90, 104, 0.22);
    --orbis-c-border-focus: rgba(74, 127, 144, 0.55);
    --orbis-c-surface: #ffffff;
    --orbis-c-shadow: 0 8px 22px rgba(43, 74, 85, 0.08), 0 1px 4px rgba(43, 74, 85, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --orbis-c-shadow-focus: 0 0 0 3px rgba(143, 211, 227, 0.35), 0 10px 26px rgba(54, 90, 104, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    --orbis-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23365a68' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

html[data-theme="dark"] {
    --orbis-c-border: rgba(148, 163, 184, 0.28);
    --orbis-c-border-focus: rgba(143, 211, 227, 0.45);
    --orbis-c-surface: rgba(15, 23, 42, 0.55);
    --orbis-c-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --orbis-c-shadow-focus: 0 0 0 3px rgba(56, 189, 248, 0.28), 0 12px 32px rgba(0, 0, 0, 0.4);
    --orbis-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238fd3e3' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* ——— Select (solo el control cerrado; la lista es del SO) ——— */
body select:not([multiple]) {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    min-height: 2.55rem;
    padding: 0.5rem 2.75rem 0.5rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--orbis-c-border);
    background-color: var(--orbis-c-surface);
    background-image: var(--orbis-chevron);
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 1.1rem 1.1rem;
    box-shadow: var(--orbis-c-shadow);
    font: inherit;
    color: inherit;
    cursor: pointer;
    vertical-align: middle;
    transition: box-shadow 0.22s ease, border-color 0.2s ease, background-color 0.2s ease;
}

body select:not([multiple]):hover {
    border-color: var(--orbis-c-border-focus);
    box-shadow: 0 10px 26px rgba(43, 74, 85, 0.1), 0 2px 8px rgba(43, 74, 85, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body select:not([multiple]):focus {
    outline: none;
    border-color: var(--orbis-c-border-focus);
    box-shadow: var(--orbis-c-shadow-focus);
}

body select:not([multiple]):disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

body select:not([multiple])::-ms-expand {
    display: none;
}

/* ——— Fecha / hora ——— */
body input[type="date"],
body input[type="datetime-local"],
body input[type="time"],
body input[type="month"] {
    box-sizing: border-box;
    min-height: 2.55rem;
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--orbis-c-border);
    background-color: var(--orbis-c-surface);
    box-shadow: var(--orbis-c-shadow);
    font: inherit;
    color: inherit;
    color-scheme: light;
    vertical-align: middle;
    transition: box-shadow 0.22s ease, border-color 0.2s ease;
}

html[data-theme="dark"] body input[type="date"],
html[data-theme="dark"] body input[type="datetime-local"],
html[data-theme="dark"] body input[type="time"],
html[data-theme="dark"] body input[type="month"] {
    color-scheme: dark;
}

body input[type="date"]:hover,
body input[type="datetime-local"]:hover,
body input[type="time"]:hover,
body input[type="month"]:hover {
    border-color: var(--orbis-c-border-focus);
    box-shadow: 0 10px 26px rgba(43, 74, 85, 0.1), 0 2px 8px rgba(43, 74, 85, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body input[type="date"]:focus,
body input[type="datetime-local"]:focus,
body input[type="time"]:focus,
body input[type="month"]:focus {
    outline: none;
    border-color: var(--orbis-c-border-focus);
    box-shadow: var(--orbis-c-shadow-focus);
}

body input[type="date"]::-webkit-calendar-picker-indicator,
body input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body input[type="time"]::-webkit-calendar-picker-indicator,
body input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.55;
    padding: 0.3rem;
    margin-right: 0.1rem;
    border-radius: 8px;
    transition: opacity 0.2s ease, background 0.2s ease;
}

body input[type="date"]:hover::-webkit-calendar-picker-indicator,
body input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
body input[type="time"]:hover::-webkit-calendar-picker-indicator,
body input[type="month"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
    background: rgba(143, 211, 227, 0.16);
}

/* Sin scale en foco: evita micro-reflows junto al picker */

/* ——— Campos .field (texto, etc.) ——— */
body .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="date"]):not([type="datetime-local"]):not([type="time"]):not([type="month"]),
body .field textarea {
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid var(--orbis-c-border);
    box-shadow: 0 6px 18px rgba(43, 74, 85, 0.06), 0 1px 3px rgba(43, 74, 85, 0.04);
    transition: box-shadow 0.22s ease, border-color 0.2s ease;
}

body .field textarea {
    min-height: 5.5rem;
}

body .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="date"]):not([type="datetime-local"]):not([type="time"]):not([type="month"]):focus,
body .field textarea:focus {
    outline: none;
    border-color: var(--orbis-c-border-focus);
    box-shadow: var(--orbis-c-shadow-focus);
}

/* Etiqueta: solo color (el letter-spacing movía el layout) */
body .field:focus-within .field-label {
    transition: color 0.2s ease;
    color: var(--primary, #365a68);
}

/* ——— Agenda ——— */
body .schedule-page .schedule-toolbar select:not([multiple]),
body .schedule-toolbar select:not([multiple]) {
    min-width: min(240px, 100%);
    background-color: var(--orbis-c-surface);
    box-shadow: var(--orbis-c-shadow);
    border: 1px solid var(--orbis-c-border);
}

body .schedule-goto-date input[type="date"] {
    min-height: 2.45rem;
    border-radius: 11px;
    border: 1px solid var(--orbis-c-border);
    box-shadow: var(--orbis-c-shadow);
    background-color: var(--orbis-c-surface);
}

body .actions-inline select:not([multiple]) {
    min-height: 2.3rem;
    padding-top: 0.38rem;
    padding-bottom: 0.38rem;
    border-radius: 10px;
    box-shadow: 0 5px 14px rgba(43, 74, 85, 0.07), 0 1px 3px rgba(43, 74, 85, 0.04);
}

body .settings-form select:not([multiple]) {
    box-shadow: var(--orbis-c-shadow);
    border-color: var(--orbis-c-border);
}
