/* ==========================================================================
   EcoSistem Design System 2026 — High Aesthetic Enterprise Standard
   ========================================================================== */

:root {
    /* Tipografía */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Tokens de Color en Modo Claro */
    --bg-main: #f8fafc;
    --card-surface: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --primary-color: #059669;
    --primary-hover: #047857;
    --accent-color: #10b981;
    /* Superficie de tarjetas/modales en modo claro (evita fondos transparentes) */
    --bs-card-bg: #ffffff;
}

/* Helpers de opacidades extendidas compatibles con Bootstrap 5 */
.bg-opacity-15 {
    --bs-bg-opacity: 0.15 !important;
}
.bg-opacity-20 {
    --bs-bg-opacity: 0.20 !important;
}

[data-bs-theme="dark"] {
    /* Tokens de Color en Modo Oscuro (Deep Luxury Obsidian) */
    --bg-main: #090e17;
    --card-surface: #111827;
    --card-surface-elevated: #1e293b;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #10b981;
    --primary-hover: #34d399;
    --bs-body-bg: #090e17;
    --bs-card-bg: #111827;
    --bs-tertiary-bg: #1e293b;
    --bs-border-color: rgba(255, 255, 255, 0.08);
    --bs-body-color: #f8fafc;
    --bs-secondary-color: #94a3b8;
}

/* Base */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-main) !important;
    background-image:
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.06) 0px, transparent 45%),
        radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.05) 0px, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[data-bs-theme="dark"] body {
    background-image:
        radial-gradient(at 10% 0%, rgba(16, 185, 129, 0.11) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(37, 99, 235, 0.09) 0px, transparent 50%);
}

/* Tipografía de Alto Nivel */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.font-monospace, .badge-mono, .price-display {
    font-family: var(--font-mono) !important;
}

.extra-small {
    font-size: 0.75rem !important;
}

/* NAVBAR LUXURY GLASS & FLOATING PILL DOCK */
.navbar-custom {
    background: linear-gradient(180deg, rgba(4, 47, 46, 0.97) 0%, rgba(6, 36, 28, 0.95) 100%) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(16, 185, 129, 0.18);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
    padding: 0.45rem 1rem;
    min-height: 66px;
    z-index: 1080 !important;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: 1.08rem;
    color: #ffffff !important;
}

/* Contenedor tipo cápsula flotante para los módulos centrales en escritorio */
@media (min-width: 992px) {
    .nav-center-dock {
        background: rgba(0, 0, 0, 0.22);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 9999px;
        padding: 0.24rem 0.32rem;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
    }
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.36rem 0.68rem !important;
    border-radius: 9999px;
    margin: 0 1px;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    white-space: nowrap !important;
    border: 1px solid transparent;
}

.navbar-nav .nav-link i {
    font-size: 0.95rem;
    color: #34d399;
    opacity: 0.85;
    transition: transform 0.18s ease, opacity 0.18s ease, color 0.18s ease;
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.09);
}

.navbar-nav .nav-link:hover i {
    opacity: 1;
    transform: translateY(-1px);
}

.navbar-nav .nav-link.show {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(52, 211, 153, 0.35);
}

.navbar-nav .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.38) 0%, rgba(5, 150, 105, 0.52) 100%);
    border-color: rgba(52, 211, 153, 0.45);
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.28);
}

.navbar-nav .nav-link.active i {
    color: #a7f3d0 !important;
    opacity: 1;
}

/* DROPDOWNS ESTRUCTURADOS CON SECCIONES E ICONOS */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 1.1rem;
    background: var(--card-surface);
    box-shadow: 0 22px 45px -12px rgba(0, 0, 0, 0.45);
    padding: 0.6rem;
    margin-top: 9px !important;
    animation: slideUp 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1090 !important;
}

.dropdown-section-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0.42rem 0.75rem 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.38rem;
    opacity: 0.85;
    white-space: nowrap !important;
}

.dropdown-item {
    font-weight: 600;
    font-size: 0.84rem;
    border-radius: 0.65rem;
    padding: 0.48rem 0.85rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    white-space: nowrap !important;
}

.dropdown-item .nav-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    background: rgba(16, 185, 129, 0.1);
    transition: transform 0.15s ease, background 0.15s ease;
}

.dropdown-item:hover .nav-icon-box {
    transform: scale(1.06);
}

.dropdown-item.active .nav-icon-box {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

/* MEGA-MENÚ DE 2 COLUMNAS CON MICRO-DESCRIPCIONES (ESTÁNDAR STRIPE / VERCEL) */
@media (min-width: 992px) {
    .mega-dropdown-menu {
        min-width: 530px !important;
        padding: 0.75rem !important;
    }
    .mega-grid-2col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .mega-col-divider {
        border-left: 1px solid var(--border-color);
        padding-left: 0.5rem;
    }
}

.mega-item-content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.mega-item-title {
    font-weight: 700;
    font-size: 0.83rem;
    color: var(--text-primary);
}

.dropdown-item.active .mega-item-title,
.dropdown-item.active .mega-item-desc {
    color: #ffffff !important;
}

.mega-item-desc {
    font-size: 0.69rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.82;
    margin-top: 2px;
}

.mega-dropdown-footer {
    margin-top: 0.55rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

/* BRAND + TENANT SWITCHER INTEGRADO (ESTILO VERCEL / LINEAR) */
.brand-tenant-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    padding: 0.2rem 0.35rem 0.2rem 0.25rem;
    transition: all 0.18s ease;
}

.brand-tenant-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(52, 211, 153, 0.4);
}

.brand-switcher-trigger {
    background: rgba(14, 165, 233, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc !important;
    border-radius: 9999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.brand-switcher-trigger:hover {
    background: rgba(14, 165, 233, 0.28);
    color: #ffffff !important;
}

/* BOTÓN DE ACCIÓN RÁPIDA 1-CLIC: TERMINAL POS (LEY DE FITTS) */
.btn-pos-quick {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    border: 1px solid rgba(52, 211, 153, 0.55);
    border-radius: 9999px;
    padding: 0.32rem 0.78rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
    transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-pos-quick:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.48);
    color: #ffffff !important;
}

/* BOTONES DE CONTROL EN LA BARRA DERECHA (ALERTAS, ADMIN/SAAS, TEMA) */
.nav-control-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.18s ease;
    position: relative;
}

.nav-control-icon-btn:hover,
.nav-control-icon-btn.show,
.nav-control-icon-btn.active-control {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(52, 211, 153, 0.55);
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* CARDS PREMIUM */
.card {
    background-color: var(--card-surface);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: rgba(16, 185, 129, 0.3);
}

.hover-lift {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease !important;
}

.hover-lift:hover {
    transform: translateY(-3px) scale(1.01) !important;
}

/* KPI CARDS (DASHBOARD) */
.kpi-card {
    border: none !important;
    border-radius: 1.25rem !important;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.3);
}

.kpi-card .kpi-icon-bg {
    position: absolute;
    right: -8px;
    bottom: -10px;
    font-size: 4.5rem;
    opacity: 0.15;
    transform: rotate(-12deg);
    pointer-events: none;
}

/* Evitar que en modo oscuro se borren los fondos degradados de los KPI */
[data-bs-theme="dark"] .kpi-card {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* LOTE & ANIMAL CARDS */
.lote-card, .animal-card {
    background: var(--card-surface);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.lote-card:hover, .animal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.25);
    border-color: rgba(16, 185, 129, 0.4);
}

.img-zoom-wrapper {
    position: relative;
    overflow: hidden;
    height: 190px;
    border-bottom: 1px solid var(--border-color);
}

.img-zoom-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.lote-card:hover .img-zoom-wrapper img,
.animal-card:hover .img-zoom-wrapper img {
    transform: scale(1.06);
}

/* BADGES FLOTANTES */
.badge-float {
    position: absolute;
    top: 12px;
    z-index: 10;
}

.badge-float.badge-left {
    left: 12px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-float.badge-right {
    right: 12px;
}

/* POS & COMPONENTES COMERCIALES */
.pos-header-premium {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    border-radius: 1.5rem;
    padding: 2rem 2.25rem;
    box-shadow: 0 10px 30px -10px rgba(6, 78, 59, 0.5);
    margin-bottom: 1.75rem;
}

.pos-bar-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .pos-bar-glass {
    background: rgba(17, 24, 39, 0.88) !important;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* BÚSQUEDA Y FILTROS */
.sticky-search {
    position: sticky;
    top: 86px;
    z-index: 990;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .sticky-search {
    background: rgba(17, 24, 39, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
}

/* ANIMACIONES */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SCROLLBAR PREMIUM */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* GLASS CARD & TABLES */
.glass-card {
    background: var(--card-surface);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .glass-card {
    background: rgba(17, 24, 39, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: inherit;
}

[data-bs-theme="dark"] .table {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

/* HIGH-CONTRAST DARK MODE ENGINE */
[data-bs-theme="dark"] .text-dark:not(.badge.bg-warning):not(.badge.bg-info) {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #f8fafc !important;
}

/* ==========================================================================
   SISTEMA DE DISEÑO UNIVERSAL: FORMULARIOS, INPUTS Y SELECTS (MODO CLARO Y OSCURO)
   ========================================================================== */

/* Modo Claro: Inputs perfectamente definidos, con bordes visibles, contraste profesional y profundidad de campo */
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select,
html:not([data-bs-theme="dark"]) .form-control,
html:not([data-bs-theme="dark"]) .form-select {
    background-color: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
    border-radius: 0.65rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    font-weight: 500;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

/* Neutralizar bg-light, bg-body-tertiary y border-0 en inputs en modo claro */
[data-bs-theme="light"] .form-control.border-0,
[data-bs-theme="light"] .form-select.border-0,
html:not([data-bs-theme="dark"]) .form-control.border-0,
html:not([data-bs-theme="dark"]) .form-select.border-0,
[data-bs-theme="light"] .form-control.bg-light,
[data-bs-theme="light"] .form-select.bg-light,
html:not([data-bs-theme="dark"]) .form-control.bg-light,
html:not([data-bs-theme="dark"]) .form-select.bg-light,
[data-bs-theme="light"] .form-control.bg-body-tertiary,
[data-bs-theme="light"] .form-select.bg-body-tertiary,
html:not([data-bs-theme="dark"]) .form-control.bg-body-tertiary,
html:not([data-bs-theme="dark"]) .form-select.bg-body-tertiary {
    background-color: #f8fafc !important;
    border: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

/* Neutralizar text-white en inputs y selects en modo claro */
[data-bs-theme="light"] .form-control.text-white,
[data-bs-theme="light"] .form-select.text-white,
html:not([data-bs-theme="dark"]) .form-control.text-white,
html:not([data-bs-theme="dark"]) .form-select.text-white,
[data-bs-theme="light"] input.text-white,
[data-bs-theme="light"] select.text-white,
html:not([data-bs-theme="dark"]) input.text-white,
html:not([data-bs-theme="dark"]) select.text-white {
    color: #0f172a !important;
}

/* Hover y Focus en Modo Claro */
[data-bs-theme="light"] .form-control:hover,
[data-bs-theme="light"] .form-select:hover,
html:not([data-bs-theme="dark"]) .form-control:hover,
html:not([data-bs-theme="dark"]) .form-select:hover {
    border-color: #64748b !important;
}

[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select:focus,
html:not([data-bs-theme="dark"]) .form-control:focus,
html:not([data-bs-theme="dark"]) .form-select:focus {
    background-color: #ffffff !important;
    border-color: #059669 !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22), inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

/* Botones secundarios / cancelar en Modo Claro */
[data-bs-theme="light"] .btn-light,
html:not([data-bs-theme="dark"]) .btn-light {
    background-color: #f1f5f9 !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #334155 !important;
}
[data-bs-theme="light"] .btn-light:hover,
html:not([data-bs-theme="dark"]) .btn-light:hover {
    background-color: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Labels y Textos de formulario en Modo Claro */
[data-bs-theme="light"] .form-label,
html:not([data-bs-theme="dark"]) .form-label {
    color: #0f172a !important;
    font-weight: 600;
}

/* Placeholders nítidos y legibles en Modo Claro */
[data-bs-theme="light"] .form-control::placeholder,
html:not([data-bs-theme="dark"]) .form-control::placeholder,
[data-bs-theme="light"] textarea.form-control::placeholder,
html:not([data-bs-theme="dark"]) textarea.form-control::placeholder {
    color: #64748b !important;
    opacity: 0.95 !important;
}

/* Input group addon (iconos $ / calendario) en Modo Claro */
[data-bs-theme="light"] .input-group-text,
html:not([data-bs-theme="dark"]) .input-group-text {
    background-color: #f8fafc !important;
    border: 1.5px solid #94a3b8 !important;
    color: #475569 !important;
    font-weight: 600;
}

.input-group > .input-group-text:first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Tarjetas y superficies en Modo Claro con delimitación nítida */
[data-bs-theme="light"] .card,
html:not([data-bs-theme="dark"]) .card {
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.04) !important;
}

/* Menús Desplegables en ambos temas */
[data-bs-theme="light"] .dropdown-menu,
html:not([data-bs-theme="dark"]) .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    color: #0f172a !important;
}

[data-bs-theme="light"] .dropdown-item,
html:not([data-bs-theme="dark"]) .dropdown-item {
    color: #334155 !important;
}

[data-bs-theme="light"] .dropdown-item:hover,
html:not([data-bs-theme="dark"]) .dropdown-item:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

/* Dropdowns <select> y sus <option> en ambos temas */
select.form-select option,
select.form-control option {
    background-color: #ffffff !important;
    color: #0f172a !important;
    padding: 6px 10px;
}

[data-bs-theme="dark"] select.form-select option,
[data-bs-theme="dark"] select.form-control option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: rgba(15, 23, 42, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.2) !important;
}

[data-bs-theme="dark"] .form-floating > .form-control,
[data-bs-theme="dark"] .form-floating > .form-select {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #94a3b8 !important;
}

/* STAT-CARDS DE LOTES Y FICHAS TÉCNICAS */
.stat-card {
    padding: 1.15rem 1rem;
    border-radius: 1.15rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

[data-bs-theme="dark"] .stat-card.bg-light,
[data-bs-theme="dark"] .stat-card.bg-body-tertiary {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* RADIO CARDS COSECHA & OPCIONES */
.radio-card-choice {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color) !important;
}

.radio-card-choice:hover {
    border-color: rgba(16, 185, 129, 0.4) !important;
    background-color: rgba(16, 185, 129, 0.03);
}

.radio-card-choice.active,
.radio-card-choice:has(.form-check-input:checked) {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.08) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

/* RÓTULOS, ETIQUETAS Y FICHAS IMPRIMIBLES (SIEMPRE ALTO CONTRASTE NEGRO SOBRE BLANCO) */
.rotulo-printable-card,
#rotuloPrintableArea,
#rotuloAnimalPrintableArea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    --bs-body-color: #0f172a !important;
    --bs-heading-color: #0f172a !important;
    --bs-secondary-color: #475569 !important;
    --bs-tertiary-color: #64748b !important;
    --bs-table-color: #0f172a !important;
    --bs-table-bg: #ffffff !important;
    --bs-table-border-color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .rotulo-printable-card,
[data-bs-theme="dark"] #rotuloPrintableArea,
[data-bs-theme="dark"] #rotuloAnimalPrintableArea {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

[data-bs-theme="dark"] .rotulo-printable-card .text-dark,
[data-bs-theme="dark"] #rotuloPrintableArea .text-dark,
[data-bs-theme="dark"] #rotuloAnimalPrintableArea .text-dark {
    color: #0f172a !important;
}

[data-bs-theme="dark"] .rotulo-printable-card .text-muted,
[data-bs-theme="dark"] .rotulo-printable-card .text-secondary,
[data-bs-theme="dark"] #rotuloPrintableArea .text-muted,
[data-bs-theme="dark"] #rotuloPrintableArea .text-secondary,
[data-bs-theme="dark"] #rotuloAnimalPrintableArea .text-muted,
[data-bs-theme="dark"] #rotuloAnimalPrintableArea .text-secondary {
    color: #475569 !important;
}

[data-bs-theme="dark"] .rotulo-printable-card table,
[data-bs-theme="dark"] #rotuloPrintableArea table,
[data-bs-theme="dark"] #rotuloAnimalPrintableArea table {
    color: #0f172a !important;
    --bs-table-color: #0f172a !important;
}

[data-bs-theme="dark"] .rotulo-printable-card table td,
[data-bs-theme="dark"] #rotuloPrintableArea table td,
[data-bs-theme="dark"] #rotuloAnimalPrintableArea table td {
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

/* ==========================================================================
   COMMAND PALETTE (OMNISEARCH CTRL+K) & NEXT-GEN HUD COMPONENTS
   ========================================================================== */
.omnisearch-trigger-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 9999px;
    padding: 0.34rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.omnisearch-trigger-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(16, 185, 129, 0.65);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.kbd-shortcut {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.35rem;
    padding: 0.08rem 0.38rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #a7f3d0;
    white-space: nowrap;
}

/* Adaptación global de tablas y botones en Modo Oscuro (evita franjas blancas o texto negro invisible) */
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > th,
[data-bs-theme="dark"] .table-light > td,
[data-bs-theme="dark"] thead.table-light th {
    --bs-table-bg: rgba(16, 185, 129, 0.08) !important;
    --bs-table-color: #cbd5e1 !important;
    background-color: rgba(16, 185, 129, 0.08) !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .btn-outline-dark {
    --bs-btn-color: #e2e8f0;
    --bs-btn-border-color: rgba(226, 232, 240, 0.35);
    --bs-btn-hover-bg: #e2e8f0;
    --bs-btn-hover-color: #0f172a;
    color: #e2e8f0 !important;
    border-color: rgba(226, 232, 240, 0.35) !important;
}

[data-bs-theme="dark"] .btn-outline-dark:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.omnisearch-modal .modal-content {
    background: var(--card-surface);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 1.35rem;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.55), 0 0 30px rgba(16, 185, 129, 0.15);
    overflow: hidden;
}

.omnisearch-input-wrap {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(16, 185, 129, 0.04);
}

.omnisearch-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 100%;
    outline: none;
}

.omnisearch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.68rem 1rem;
    border-radius: 0.85rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.15s ease;
    cursor: pointer;
}

.omnisearch-item:hover,
.omnisearch-item.active-item {
    background: rgba(16, 185, 129, 0.12);
    color: var(--text-primary);
    transform: translateX(3px);
}

/* MOBILE QUICK DOCK (PWA FIELD EXPERIENCE) */
.mobile-bottom-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: rgba(6, 36, 28, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(16, 185, 129, 0.25);
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.3);
}

.mobile-dock-link {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
    transition: all 0.18s ease;
}

.mobile-dock-link i {
    font-size: 1.15rem;
}

.mobile-dock-link.active,
.mobile-dock-link:hover {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: 68px;
    }
}




/* Placeholders en inputs monospace deben usar tipografía sans legible y sin espaciado distorsionado */
input.font-monospace::placeholder,
.font-monospace input::placeholder,
input[type="number"].font-monospace::placeholder {
    font-family: var(--font-sans) !important;
    font-weight: 500 !important;
    letter-spacing: normal !important;
    font-size: 0.9rem !important;
}

/* Blindaje de bordes para tarjetas ejecutivas de workspace en Modo Claro */
[data-bs-theme="light"] .card-workspace-luxury,
html:not([data-bs-theme="dark"]) .card-workspace-luxury,
[data-bs-theme="light"] .info-tile,
html:not([data-bs-theme="dark"]) .info-tile,
[data-bs-theme="light"] .catalog-item-card,
html:not([data-bs-theme="dark"]) .catalog-item-card,
[data-bs-theme="light"] .ticket-panel-luxury,
html:not([data-bs-theme="dark"]) .ticket-panel-luxury {
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04) !important;
}

/* Insignias de Estado con Alto Contraste adaptativo (WCAG AA) */
.badge-status-paid {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #047857 !important;
    border: 1px solid rgba(5, 150, 105, 0.3) !important;
}

[data-bs-theme="dark"] .badge-status-paid {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

.badge-status-pending {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #b45309 !important;
    border: 1px solid rgba(217, 119, 6, 0.35) !important;
}

[data-bs-theme="dark"] .badge-status-pending {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

/* En Modo Claro, elevar contraste de texto amarillo y azul en badges */
[data-bs-theme="light"] .badge.text-warning,
html:not([data-bs-theme="dark"]) .badge.text-warning {
    color: #b45309 !important;
    background-color: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(217, 119, 6, 0.25) !important;
}

[data-bs-theme="light"] .badge.text-info,
html:not([data-bs-theme="dark"]) .badge.text-info {
    color: #0369a1 !important;
    background-color: rgba(14, 165, 233, 0.12) !important;
    border-color: rgba(14, 165, 233, 0.25) !important;
}

/* Botones .btn-light en Modo Oscuro (evita botones blancos linterna) */
[data-bs-theme="dark"] .btn-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .btn-light:hover {
    background-color: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}
