:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-hover-bg: rgba(30, 41, 59, 0.7);
    --sidebar-active-bg: rgba(13, 110, 253, 0.1);
    --sidebar-active-text: #fff;
    --content-bg: #f8fafc;
    --header-bg: rgba(255, 255, 255, 0.8);
    --surface-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base & Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--content-bg);
    color: var(--text-main);
    overflow-x: hidden;
}

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

.splash-screen img {
    width: 120px;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Login Container - Premium Modern Look */
.login-container {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    filter: blur(150px);
    opacity: 0.2;
    top: -100px;
    right: -100px;
}

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

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px) saturate(180%);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.logo-pequena {
    width: 100px;
    margin-bottom: 2rem;
    transition: var(--transition-base);
}

/* Sidebar - Premium Minimalist */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 270px;
    background: var(--sidebar-bg) !important;
    z-index: 1040;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-header {
    height: 85px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-sidebar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-header .fw-bold {
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.sidebar .nav {
    padding: 1rem 0.75rem;
}

.sidebar .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar .nav-link {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text) !important;
    font-size: 0.925rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-base);
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    transition: var(--transition-base);
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff !important;
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--primary-color) !important;
    font-weight: 600;
}

.sidebar .dropdown-menu {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-top: 0.25rem !important;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.sidebar .dropdown-item {
    color: var(--sidebar-text);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.sidebar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding-left: 1.5rem;
}

/* Main Content Area */
.content {
    margin-left: 270px;
    padding: 1.5rem 2rem;
    min-height: 100vh;
    background: var(--content-bg);
    transition: var(--transition-base);
}

.main-header {
    position: sticky;
    top: 1.25rem;
    z-index: 1000;
    height: 70px;
    background: var(--header-bg) !important;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.5rem;
    padding: 0 1.5rem !important;
    transition: var(--transition-base);
}

.main-header:hover {
    box-shadow: var(--shadow-md);
}

#header-profile-photo {
    transition: var(--transition-base);
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

/* Avatar Utility */
.avatar-inicial {
    width: 48px;
    height: 48px;
    min-width: 48px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
    transition: var(--transition-base);
}

.avatar-inicial.sm {
    width: 35px;
    height: 35px;
    min-width: 35px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.avatar-inicial.lg {
    width: 64px;
    height: 64px;
    min-width: 64px;
    font-size: 1.5rem;
    border-radius: 16px;
}

/* Forms & Inputs */
.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: #fff;
    font-size: 0.95rem;
    transition: var(--transition-base);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.08);
    background-color: #fff;
}

.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 10;
    color: var(--text-muted);
    transition: var(--transition-base);
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition-base);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
}

/* UI Components */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Overrides */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .main-header {
        position: relative;
        top: 0;
        margin-bottom: 1.5rem;
    }
}

/* UI Enhancements */
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

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

.glass-tab-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    display: inline-flex;
    border: 1px solid var(--border-color);
}

.glass-tab-nav .nav-link {
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 0.6rem 1.2rem !important;
    color: var(--text-muted) !important;
    transition: var(--transition-base);
}

.glass-tab-nav .nav-link.active {
    background: #fff !important;
    box-shadow: var(--shadow-sm) !important;
    color: var(--primary-color) !important;
}

.table-modern {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-modern thead th {
    border-bottom: none !important;
    background: transparent !important;
}

.table-modern tbody tr {
    background: #fff;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.table-modern tbody tr:hover {
    transform: scale(1.005);
    box-shadow: var(--shadow-md);
}

.table-modern td:first-child,
.table-modern th:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.table-modern td:last-child,
.table-modern th:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Perfect Alignments */
.d-flex.align-items-center {
    display: flex !important;
    align-items: center !important;
}

.gap-3 {
    gap: 1rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.fw-medium {
    font-weight: 500 !important;
}

/* Offcanvas Modernization */
.offcanvas {
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
}

.offcanvas-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.offcanvas-body {
    padding: 1.5rem;
    background: #fcfdfe;
}

/* Ocultar elementos com permissão por padrão (serão exibidos via JS) */
[data-perm] {
    display: none !important;
}