/* Importação de fontes modernas do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');

/* Variáveis globais */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --sidebar-width: 280px;
    --header-height: 70px;
    --footer-height: 60px;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --border-radius: 16px;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --sidebar-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
    --transition-speed: 0.3s;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

/* Estilos Base */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
    color: #1e293b;
    background-color: #f1f5f9;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Layout Principal */
.container-fluid {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

.row {
    flex: 1;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: #1e293b;
    /* Slate 800 */
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--sidebar-shadow);
    font-family: var(--font-primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 2rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 100%;
    padding: 0.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
}

/* Logo Container */
.logo-container {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.logo-container img {
    max-width: 120px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 10px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
}

.logo-container h4 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Menu Links */
.nav-link {
    color: #94a3b8;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border-radius: 12px;
    margin: 4px 15px;
    font-weight: 500;
    font-size: 0.925rem;
}

.nav-link i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    font-size: 1.1rem;
    transition: transform var(--transition-speed);
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover i {
    transform: scale(1.15);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.nav-link.active i {
    color: white;
}

/* Toggle Sidebar Button */
#sidebarCollapse {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1050;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: white;
    color: var(--primary-color);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

#sidebarCollapse:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--footer-height));
    overflow-x: hidden;
    margin-bottom: var(--footer-height);
    transition: all var(--transition-speed) ease-in-out;
}

/* Content Wrapper */
.content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
}

.content-wrapper h2 {
    font-family: var(--font-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.content-wrapper h2 .page-title {
    font-weight: 700;
    color: var(--primary-color);
}

.content-wrapper h2 .divider {
    margin: 0 10px;
    opacity: 0.5;
}

.content-wrapper h2 .system-title {
    font-size: 0.9rem;
    opacity: 0.6;
    font-weight: 500;
}

/* Cards do Dashboard */
.card {
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: white;
    height: auto;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.08), 0 8px 8px -5px rgba(0, 0, 0, 0.03);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.card-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Dashboard Card Stats */
.dashboard-card {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed);
    z-index: 1;
}

.dashboard-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: -1;
}

.dashboard-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.dashboard-card .card-icon {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    bottom: 20px;
    color: white;
}

.dashboard-card .stat-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.dashboard-card .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 8px;
}

.dashboard-card .stat-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

/* Cores dos Cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

/* Gráficos */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    max-height: 300px;
    margin: 0 auto;
}

/* Formulários */
.form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    font-family: var(--font-primary);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(106, 17, 203, 0.25);
}

.form-control:hover {
    border-color: #adb5bd;
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
    color: #6c757d;
}

.input-group-text i {
    width: 16px;
    text-align: center;
}

/* Botões */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    box-shadow: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a0fb5 0%, #1565C0 100%);
}

/* Tabelas */
.table {
    --bs-table-hover-bg: rgba(106, 17, 203, 0.05);
    margin-bottom: 0;
}

.table thead {
    background-color: rgba(106, 17, 203, 0.1);
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    border-bottom: none;
    padding: 1rem;
    vertical-align: middle;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
}

.table-striped>tbody>tr:nth-of-type(odd) {
    --bs-table-accent-bg: rgba(106, 17, 203, 0.02);
}

/* DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1.5rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 1.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 0.5rem 1rem;
}

.dataTables_wrapper .dataTables_length select {
    margin: 0 0.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    margin: 0 3px;
    border-radius: 6px;
    border: none !important;
    background: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-gradient) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(106, 17, 203, 0.1) !important;
    color: var(--primary-color) !important;
}

/* Footer */
.footer {
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
    height: var(--footer-height);
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1030;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 0.85rem;
    color: #6c757d;
}

.footer-brand,
.footer-email,
.footer-contact {
    color: #6c757d;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.footer-brand:hover,
.footer-email:hover,
.footer-contact:hover {
    color: var(--primary-color);
}

.footer-divider {
    margin: 0 10px;
    color: #adb5bd;
}

/* Perfil de Usuário */
.profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.profile-pic-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.profile-pic-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.profile-pic-placeholder-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 32px;
    margin: 0 auto;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Dropdown Menu do Usuário */
.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 0.5rem 0;
}

.dropdown-header {
    background-color: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: rgba(106, 17, 203, 0.05);
    transform: translateX(5px);
}

.dropdown-item.text-danger:hover {
    background-color: #dc3545;
    color: white !important;
}

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

#userMenu {
    border: 1px solid #e0e0e0;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 8px;
    background-color: white;
    display: flex;
    align-items: center;
}

#userMenu:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

/* Alertas */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

.alert-success {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.alert-warning {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f39c12;
}

.alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideInDown 0.5s ease-out;
}

/* Responsividade */
@media (max-width: 992px) {
    .content-wrapper h2 {
        font-size: 1.3rem;
    }

    .content-wrapper h2 .system-title {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 250px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }

    #sidebarCollapse {
        display: flex;
    }

    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
    }

    .sidebar.active {
        margin-left: 0;
        box-shadow: var(--sidebar-shadow);
    }

    .content-wrapper h2 {
        font-size: 1.2rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .content-wrapper h2 .system-title {
        font-size: 0.7rem;
        margin-top: 5px;
    }

    .content-wrapper h2 .divider {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        gap: 2px;
        font-size: 0.75rem;
    }

    .footer-divider {
        display: none;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .form-control {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Utilidades para controle de altura */
.card-compact {
    height: auto !important;
}

.card-compact .card-body {
    padding: 1rem !important;
}

/* Ajuste para cards em grid */
.row.g-4>[class*="col-"]>.card,
.row.g-3>[class*="col-"]>.card {
    height: auto;
    margin-bottom: 0;
}

/* Extra small text utility */
.extra-small {
    font-size: 0.7rem;
}

/* Gradiente escuro para overlay de imagens */
.bg-gradient-dark {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}