/* ==========================================================================
   DESIGN SYSTEM - LIGHT THEME (CLEAN & MODERN)
   ========================================================================== */

/* Base & Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    min-height: 100vh;
    color: #1e293b;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Light Base */
.card, .card-dashboard, .modal-content, .dropdown-menu, .offcanvas, .toast {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    color: #1e293b !important;
}

.dropdown-menu {
    z-index: 99999 !important;
}

.dropdown-item {
    color: #334155 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    padding: 0.55rem 1rem !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f1f5f9 !important;
    color: #0071e3 !important;
}

/* Force bg-white containers inside content/modals */
.content .bg-white, .modal-content .bg-white, .modal-body .bg-white {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

.content .bg-white *, .modal-content .bg-white * {
    color: inherit;
}

/* SweetAlert Light style */
.swal2-popup {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 24px !important;
    color: #0f172a !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1) !important;
}

.swal2-title {
    color: #0f172a !important;
    font-weight: 700 !important;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.swal2-html-container {
    color: #475569 !important;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.swal2-confirm {
    background-color: #0071e3 !important;
    border-radius: 12px !important;
    padding: 0.65rem 2rem !important;
    font-weight: 600 !important;
}

.swal2-cancel {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-radius: 12px !important;
    padding: 0.65rem 2rem !important;
    border: 1px solid #cbd5e1 !important;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    inset: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.splash-screen img {
    width: 90px;
    animation: pulse 1.6s infinite cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.95);
        opacity: 0.75;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 20px;
    z-index: 1;
    position: relative;
}

.login-container.active {
    display: flex;
}

.login-box {
    background: #ffffff !important;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08) !important;
    width: 100%;
    max-width: 440px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.login-box:hover {
    border-color: #cbd5e1;
}

.logo-pequena {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

/* Navbar - Modern Top Bar Header */
#mainNavbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

#mainNavbar .navbar-nav .nav-link {
    padding: 0.55rem 1rem;
    color: #64748b !important;
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: 0 !important;
    transition: all 0.2s ease;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
}

#mainNavbar .navbar-nav .nav-link i {
    font-size: 1.1rem;
    color: #64748b;
    transition: color 0.2s ease;
}

#mainNavbar .navbar-nav .nav-link:hover {
    color: #0f172a !important;
    background: transparent !important;
    border-bottom-color: #cbd5e1 !important;
}

#mainNavbar .navbar-nav .nav-link:hover i {
    color: #0f172a;
}

#mainNavbar .navbar-nav .nav-link.active {
    background: transparent !important;
    color: #0071e3 !important;
    border-bottom: 2px solid #0071e3 !important;
    font-weight: 600;
}

#mainNavbar .navbar-nav .nav-link.active i {
    color: #0071e3;
}

#mainNavbar .nav-link.text-danger {
    color: #ef4444 !important;
    border-bottom: 2px solid transparent !important;
}

#mainNavbar .nav-link.text-danger:hover {
    background: transparent !important;
    color: #dc2626 !important;
    border-bottom-color: #dc2626 !important;
}

.user-profile-badge {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease;
}

/* Main Content Area */
.content {
    margin-left: 0;
    padding-top: 85px;
    padding-bottom: 2rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    min-height: 100vh;
    background: #f8fafc;
    transition: padding 0.3s ease;
}

.main-header {
    border: none;
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

/* Forms & Inputs */
.form-label {
    color: #334155;
    font-weight: 500;
    font-size: 0.85rem;
}

.modal .form-label, 
.modal label {
    color: #334155 !important;
}

.form-control, .form-select {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.form-control::placeholder {
    color: #94a3b8 !important;
}

.form-control:focus, .form-select:focus {
    background: #ffffff !important;
    border-color: #0071e3 !important;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15) !important;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #64748b;
    z-index: 10;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: #0f172a;
}

/* Buttons */
.btn-primary {
    background: #0071e3 !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.btn-primary:hover {
    background: #0077ed !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.35) !important;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}




/* Dashboard Welcome */
.dashboard-welcome {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px;
    padding: 2.5rem;
    color: white;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.15) !important;
}

.card-stats {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
}

.card-stats:hover {
    transform: translateY(-4px);
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.icon-box.blue { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.icon-box.green { background: rgba(52, 199, 89, 0.1); color: #34c759; }
.icon-box.purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.icon-box.orange { background: rgba(255, 149, 0, 0.1); color: #ff9500; }

.quick-action-btn {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #334155;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    font-weight: 500;
}

.quick-action-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a;
    border-color: #0071e3 !important;
}

/* Modal Cadastro Empresa */
#modalCadastroEmpresa .modal-content {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 24px !important;
}

#modalCadastroEmpresa .modal-header {
    border-bottom: none !important;
    padding: 2.25rem 2.25rem 0.5rem 2.25rem !important;
}

#modalCadastroEmpresa .modal-body {
    padding: 0 2.25rem 2.25rem 2.25rem !important;
}

#modalCadastroEmpresa .alert-info {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1e40af !important;
    border-radius: 12px;
}

#modalCadastroEmpresa h6 {
    color: #0071e3 !important;
    font-weight: 600;
    margin-top: 1.5rem;
    font-size: 1rem;
}

#modalCadastroEmpresa hr {
    border-top: 1px solid #e2e8f0 !important;
    opacity: 1;
}

#modalCadastroEmpresa .btn-close {
    background-color: #f1f5f9;
    border-radius: 50%;
    opacity: 0.8;
    padding: 0.6rem;
    transition: all 0.2s ease;
}

#modalCadastroEmpresa .btn-close:hover {
    background-color: #e2e8f0;
    opacity: 1;
}

/* Select2 overrides */
.select2-container,
.select2-container * {
    color: #0f172a;
}

.select2-container--default .select2-selection--single {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    height: auto !important;
    padding: 0.45rem 0.6rem !important;
    color: #0f172a !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0f172a !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #64748b !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
}

.select2-dropdown {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    z-index: 99999 !important;
}

.select2-search--dropdown .select2-search__field {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 0.4rem 0.6rem !important;
}

.select2-results__option {
    color: #0f172a !important;
    padding: 0.6rem 1rem !important;
}

.select2-container--default .select2-results__option--selectable {
    color: #0f172a !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0071e3 !important;
    color: #ffffff !important;
}

.select2-container--default .select2-selection--multiple {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* Tables refinement - Light Theme */
.table, .table-hover, .table-light, .table-striped {
    color: #1e293b !important;
    margin-bottom: 0;
    background-color: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: #1e293b !important;
}

.table *, .table tbody, .table thead, .table tr, .table td, .table th {
    background-color: transparent !important;
    color: #1e293b !important;
}

.table thead th, .table-light th, .table thead.table-light th {
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600;
    color: #475569 !important;
}

.table-hover tbody tr:hover, .table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
    background-color: #f1f5f9 !important;
    cursor: pointer;
}

.table td, .table th {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 1.1rem 0.85rem !important;
}

/* Touch Scroll e Responsividade de Tabelas */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    border-radius: 16px;
    overflow-x: auto !important;
    width: 100%;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Dispositivos Móveis (< 992px) */
@media (max-width: 991.98px) {
    .content {
        margin-left: 0 !important;
        padding-top: 80px !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-bottom: 1.5rem !important;
    }

    #conteudoPrincipal {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: calc(100% - 1rem) !important;
    }

    .modal-content {
        border-radius: 18px !important;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 1.25rem !important;
    }
}

/* Dispositivos Pequenos (< 768px) */
@media (max-width: 767.98px) {
    .login-box {
        padding: 2rem 1.5rem !important;
        border-radius: 20px !important;
    }

    .dashboard-welcome {
        padding: 1.5rem !important;
        border-radius: 16px !important;
    }

    .card-stats {
        padding: 1rem !important;
    }

    .table td, .table th {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem !important;
        white-space: nowrap;
    }

    .table td.text-wrap, .table th.text-wrap {
        white-space: normal !important;
    }

    .btn-group, .d-flex.gap-2, .d-flex.gap-3 {
        flex-wrap: wrap;
    }

    .form-control, .form-select {
        font-size: 0.9rem;
        padding: 0.6rem 0.85rem;
    }
}

/* Dispositivos Extra Pequenos (< 576px) */
@media (max-width: 575.98px) {
    #mobile-header {
        padding: 0.75rem 1rem !important;
        border-radius: 14px !important;
    }

    .login-container {
        padding: 10px !important;
    }
}