/* ===================================
   DATAMAP BI - STYLES MODERNOS
   Design moderno, fluido e atraente
   =================================== */

/* === VARIÁVEIS DE CORES === */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-gradient-hover: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --sidebar-bg: #1e293b;
    --sidebar-header-bg: #0f172a;
    --sidebar-hover: #334155;
    --sidebar-active: #475569;
    --content-bg: #f8fafc;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET E BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--content-bg);
    color: #1e293b;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT WRAPPER === */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* === SIDEBAR === */
#sidebar {
    min-width: 280px;
    max-width: 280px;
    background: var(--sidebar-bg);
    color: #fff;
    transition: var(--transition);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

#sidebar.active {
    margin-left: -280px;
}

#sidebar .sidebar-header {
    padding: 25px 20px;
    background: var(--sidebar-header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

#sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sidebar .sidebar-header h3 i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
}

#sidebar ul.components {
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar ul.components::-webkit-scrollbar {
    width: 6px;
}

#sidebar ul.components::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#sidebar ul.components::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#sidebar ul.components::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#sidebar ul li {
    margin: 5px 15px;
}

#sidebar ul li a {
    padding: 12px 18px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
    border-radius: 10px;
    position: relative;
    font-weight: 500;
}

#sidebar ul li a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

#sidebar ul li a:hover {
    color: #fff;
    background: var(--sidebar-hover);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#sidebar ul li.active > a,
#sidebar ul li a[aria-expanded="true"] {
    color: #fff;
    background: var(--sidebar-active);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#sidebar ul li.active > a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
}

a[data-bs-toggle="collapse"] {
    position: relative;
}

.dropdown-toggle::after {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    transition: var(--transition);
}

a[aria-expanded="true"] .dropdown-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

ul ul a {
    font-size: 0.9rem !important;
    padding-left: 50px !important;
    background: transparent !important;
    margin-left: 0 !important;
}

ul ul a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(0) !important;
}

ul ul a.active {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #fff !important;
}

/* === CONTENT AREA === */
#content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    transition: var(--transition);
    margin-left: 280px;
}

#content.expanded {
    margin-left: 0;
}

/* === NAVBAR === */
.navbar {
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 30px;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .navbar-text {
    color: #64748b;
    font-size: 0.95rem;
}

.navbar .navbar-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Botão de toggle sidebar */
#sidebarCollapse {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 1.2rem;
    cursor: pointer;
}

#sidebarCollapse:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#sidebarCollapse:active {
    transform: scale(0.98);
}

/* === CARDS === */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    transition: var(--transition);
    background: #fff;
    overflow: hidden;
}

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

.card-header {
    background: var(--primary-gradient);
    color: #fff;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 20px 25px;
    border: none;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

.card-title {
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 15px;
}

.card-text {
    color: #64748b;
}

/* === BUTTONS === */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    border: none;
}

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

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: #64748b;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border: none;
    color: #fff;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline-danger {
    border: 2px solid #ef4444;
    color: #ef4444;
    background: transparent;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-light {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-light:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* === FORM ELEMENTS === */
.form-control,
.form-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
    display: block;
}

.input-group-text {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control:not(:first-child) {
    border-radius: 0 8px 8px 0;
}

.input-group .form-control:first-child {
    border-radius: 8px 0 0 8px;
}

/* === CHARTS === */
.chart-container {
    position: relative;
    min-height: 400px;
    padding: 20px;
}

.filter-container {
    background: #fff;
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e2e8f0;
}

/* === LOADING === */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--primary-color);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

/* === ALERTS === */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 15px 20px;
    box-shadow: var(--card-shadow);
}

.alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.alert-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.alert-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
}

/* === TABLES === */
.table {
    margin-bottom: 0;
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead {
    background: #f8fafc;
}

.table thead th {
    border-top: none;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 15px;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table td {
    padding: 15px;
    vertical-align: middle;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

.table tbody tr:first-child td {
    border-top: none;
}

.table tbody tr:last-child td {
    border-bottom: 1px solid #e2e8f0;
}

.bg-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

.border-info {
    border: 2px solid #06b6d4 !important;
}

.table tbody tr:last-child td {
    border-bottom: 1px solid #e2e8f0;
}

/* === BADGES === */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.85rem;
}

.badge.bg-primary {
    background: var(--primary-gradient) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
}

/* === MODALS === */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    background: var(--primary-gradient);
    color: #fff;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 20px 25px;
    border: none;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 1;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.3;
    display: block;
}

.empty-state p {
    font-size: 1.1rem;
    color: #64748b;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -280px;
        position: fixed;
        height: 100vh;
        z-index: 1050;
    }
    
    #sidebar.active {
        margin-left: 0;
    }
    
    #content {
        margin-left: 0;
    }
    
    .navbar {
        padding: 12px 15px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .chart-container {
        min-height: 300px;
        padding: 15px;
    }
    
    .container-fluid {
        padding: 15px;
    }
    
    .container-fluid h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .table thead th,
    .table td {
        padding: 10px;
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 8px 20px;
        font-size: 0.875rem;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.4s ease-out;
}

/* === SCROLLBAR CUSTOM === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* === UTILITY CLASSES === */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: var(--card-shadow) !important;
}

.shadow {
    box-shadow: var(--card-shadow-hover) !important;
}

.rounded-lg {
    border-radius: var(--border-radius) !important;
}

/* === CONTAINER FLUID === */
.container-fluid {
    padding: 30px;
}

.container-fluid h2 {
    color: #1e293b;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 2rem;
}

.container-fluid h2.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.container-fluid .text-muted {
    color: #64748b !important;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    display: block;
}

.container-fluid h2 {
    color: #1e293b;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 2rem;
}
