/* Custom styles for BI Supabase - Brand Colors */

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #DCDCDC 100%);
    color: #2B2B2A;
    line-height: 1.6;
    min-height: 100vh;
}

.main-content {
    padding-bottom: 2rem;
}

.card {
    box-shadow: 0 8px 25px rgba(43, 43, 42, 0.08);
    border: none;
    border-radius: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(43, 43, 42, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%);
    color: white;
    border-bottom: 3px solid #05FE84;
    padding: 1.2rem 1.5rem;
    border-top-left-radius: 1rem !important;
    border-top-right-radius: 1rem !important;
}

.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: linear-gradient(135deg, #DCDCDC 0%, #f0f0f0 100%);
    color: #2B2B2A;
    font-weight: 600;
    padding: 1.2rem;
    border-bottom: 2px solid #05FE84;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(220, 220, 220, 0.3);
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(5, 254, 132, 0.05);
    transform: scale(1.001);
}

/* Estilo para linha de totalizadores */
tr.table-dark td {
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%) !important;
    color: white !important;
    font-weight: 600;
    border-top: 3px solid #05FE84;
}

/* Header principal com design da marca - ATUALIZADO */
header,
.header-brand {
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%) !important;
    border-bottom: 4px solid #05FE84 !important;
    box-shadow: 0 4px 20px rgba(43, 43, 42, 0.15) !important;
    position: relative;
    z-index: 1000;
    overflow: visible !important;
    padding: 2rem 0 !important;
    margin-bottom: 2rem !important;
}

/* Override do estilo inline do header */
header.bg-primary[style],
.header-brand[style] {
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%) !important;
}

header .container,
.header-brand .container {
    overflow: visible !important;
}

header h1,
.header-brand h1 {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700 !important;
    font-size: 2.5rem !important;
    margin-bottom: 0.5rem !important;
}

header p,
.header-brand p {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 1.1rem !important;
    margin-bottom: 0 !important;
    font-weight: 400 !important;
}

header .fas.fa-chart-line,
.header-brand .fas.fa-chart-line {
    color: #05FE84 !important;
    text-shadow: 0 2px 4px rgba(5, 254, 132, 0.3);
}

/* Navbar styling - CORRIGIDO DROPDOWN */
.navbar {
    overflow: visible !important;
}

.navbar-nav {
    overflow: visible !important;
}

.navbar-nav .nav-item {
    position: relative;
    overflow: visible !important;
}

.navbar-nav .nav-link {
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin: 0 0.2rem;
}

.navbar-nav .nav-link:hover {
    background: rgba(5, 254, 132, 0.2);
    color: #05FE84 !important;
    transform: translateY(-1px);
}

/* DROPDOWN MENU - CORRIGIDO POSICIONAMENTO */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(5, 254, 132, 0.3) !important;
    border-radius: 0.8rem !important;
    box-shadow: 0 15px 40px rgba(43, 43, 42, 0.2) !important;
    min-width: 280px !important;
    padding: 0.5rem 0 !important;
    z-index: 1050 !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    margin-top: 0.5rem !important;
}

.dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(5, 254, 132, 0.3);
}

.dropdown-menu::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 21px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid rgba(255, 255, 255, 0.98);
}

.dropdown-item {
    color: #2B2B2A !important;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.8rem 1.5rem !important;
    border-radius: 0.4rem;
    margin: 0.2rem 0.5rem;
}

.dropdown-item:hover {
    background: rgba(5, 254, 132, 0.1) !important;
    color: #2B2B2A !important;
    transform: translateX(3px);
}

.dropdown-item:focus {
    background: rgba(5, 254, 132, 0.1) !important;
    color: #2B2B2A !important;
}

.dropdown-item i {
    color: #05FE84;
    margin-right: 0.5rem;
}

.dropdown-divider {
    border-color: rgba(5, 254, 132, 0.2) !important;
    margin: 0.5rem 0 !important;
}

/* Badge styling inside dropdown */
.dropdown-item .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    margin: 0.1rem;
}

.dropdown-item .badge.bg-light {
    background-color: rgba(5, 254, 132, 0.1) !important;
    color: #2B2B2A !important;
    border: 1px solid rgba(5, 254, 132, 0.3);
}

/* Badge no header para role do usuário */
.navbar-nav .badge.bg-danger {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%) !important;
    color: white !important;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
    font-weight: 600;
    text-shadow: none;
}

.navbar-nav .badge.bg-primary {
    background: linear-gradient(135deg, #05FE84 0%, #00d16a 100%) !important;
    color: #2B2B2A !important;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
    font-weight: 700;
    text-shadow: none;
}

footer {
    border-top: 1px solid rgba(220, 220, 220, 0.5);
    padding: 2rem 0;
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%);
    color: rgba(255, 255, 255, 0.9) !important;
    margin-top: 3rem;
}

footer h5 {
    color: white !important;
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.form-control, .form-select {
    border-radius: 0.6rem;
    padding: 0.8rem 1.2rem;
    border: 2px solid rgba(220, 220, 220, 0.5);
    box-shadow: none;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
}

.form-control:focus, .form-select:focus {
    border-color: #05FE84;
    box-shadow: 0 0 0 0.3rem rgba(5, 254, 132, 0.15);
    background-color: white;
    transform: translateY(-1px);
}

.date-picker {
    background-color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2305FE84' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 18px;
}

/* Custom Flatpickr Styling - Brand Colors */
.flatpickr-calendar {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(5, 254, 132, 0.3) !important;
    border-radius: 1rem !important;
    box-shadow: 0 15px 40px rgba(43, 43, 42, 0.15) !important;
    font-family: 'Poppins', sans-serif !important;
}

.flatpickr-calendar::before,
.flatpickr-calendar::after {
    border-bottom-color: rgba(5, 254, 132, 0.3) !important;
}

.flatpickr-months {
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%) !important;
    border-radius: 1rem 1rem 0 0 !important;
    border-bottom: 3px solid #05FE84 !important;
}

.flatpickr-month {
    color: white !important;
    fill: white !important;
}

.flatpickr-current-month {
    color: white !important;
}

.flatpickr-current-month .cur-month,
.flatpickr-current-month .cur-year {
    color: white !important;
    font-weight: 600 !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: white !important;
    fill: white !important;
    transition: all 0.3s ease !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    color: #05FE84 !important;
    fill: #05FE84 !important;
    transform: scale(1.1) !important;
}

.flatpickr-weekdays {
    background: rgba(220, 220, 220, 0.2) !important;
}

.flatpickr-weekday {
    color: #2B2B2A !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

.flatpickr-day {
    color: #2B2B2A !important;
    border-radius: 0.4rem !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    margin: 1px !important;
}

.flatpickr-day:hover {
    background: rgba(5, 254, 132, 0.2) !important;
    color: #2B2B2A !important;
    transform: scale(1.05) !important;
}

.flatpickr-day.selected {
    background: linear-gradient(135deg, #05FE84 0%, #00d16a 100%) !important;
    color: #2B2B2A !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 10px rgba(5, 254, 132, 0.4) !important;
}

.flatpickr-day.today {
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%) !important;
    color: white !important;
    font-weight: 600 !important;
}

.flatpickr-day.today:hover {
    background: linear-gradient(135deg, #434341 0%, #2B2B2A 100%) !important;
    color: white !important;
}

.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: linear-gradient(135deg, #05FE84 0%, #00d16a 100%) !important;
    color: #2B2B2A !important;
    font-weight: 700 !important;
}

.flatpickr-day.inRange {
    background: rgba(5, 254, 132, 0.15) !important;
    color: #2B2B2A !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: rgba(43, 43, 42, 0.4) !important;
}

.flatpickr-day.disabled {
    color: rgba(43, 43, 42, 0.3) !important;
}

.flatpickr-time {
    border-top: 2px solid rgba(5, 254, 132, 0.3) !important;
}

.flatpickr-time-separator,
.flatpickr-am-pm {
    color: #2B2B2A !important;
    font-weight: 600 !important;
}

.numInput {
    color: #2B2B2A !important;
    font-weight: 600 !important;
}

/* Dropdown para mês/ano */
.flatpickr-monthDropdown-months,
.flatpickr-monthDropdown-month {
    background: white !important;
    color: #2B2B2A !important;
    border: 1px solid rgba(5, 254, 132, 0.3) !important;
    border-radius: 0.4rem !important;
}

.flatpickr-monthDropdown-months:hover,
.flatpickr-monthDropdown-month:hover {
    background: rgba(5, 254, 132, 0.1) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        max-width: none !important;
        margin-top: 0 !important;
    }
}

/* Custom colors for metrics */
.positive-value {
    color: #05FE84;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(5, 254, 132, 0.2);
}

.negative-value {
    color: #ff4757;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 71, 87, 0.2);
}

/* Chart container styling */
.chart-container {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(220, 220, 220, 0.3);
    border-radius: 0.8rem !important;
    transition: all 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(43, 43, 42, 0.1);
}

canvas {
    max-width: 100%;
    border-radius: 0.6rem;
    padding: 1rem;
    background: transparent;
}

/* Modern buttons */
.btn {
    border-radius: 0.6rem;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%);
    border: 2px solid #2B2B2A;
    color: white;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #05FE84 0%, #00d16a 100%);
    border-color: #05FE84;
    color: #2B2B2A;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(5, 254, 132, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #05FE84 0%, #00d16a 100%);
    border: 2px solid #05FE84;
    color: #2B2B2A;
    font-weight: 700;
}

.btn-success:hover, .btn-success:focus {
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%);
    border-color: #2B2B2A;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(43, 43, 42, 0.3);
}

/* Filter buttons */
.btn-filter {
    margin-right: 0.6rem;
    margin-bottom: 0.6rem;
    background: rgba(220, 220, 220, 0.6);
    border: 2px solid rgba(220, 220, 220, 0.8);
    color: #2B2B2A;
    backdrop-filter: blur(5px);
}

.btn-filter:hover, .btn-filter:focus {
    background: rgba(220, 220, 220, 0.9);
    border-color: #05FE84;
    color: #2B2B2A;
    transform: translateY(-2px);
}

.btn-filter.active {
    background: linear-gradient(135deg, #05FE84 0%, #00d16a 100%);
    border-color: #05FE84;
    color: #2B2B2A;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(5, 254, 132, 0.3);
}

/* Nav tabs styling */
.nav-tabs {
    border-bottom: 2px solid rgba(220, 220, 220, 0.5);
}

.nav-tabs .nav-link {
    border-radius: 0.6rem 0.6rem 0 0;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #2B2B2A;
    border: 2px solid transparent;
    background: rgba(220, 220, 220, 0.3);
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: #05FE84;
    background: rgba(5, 254, 132, 0.1);
    transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #2B2B2A 0%, #434341 100%);
    border-color: #2B2B2A;
    border-bottom: 3px solid #05FE84;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(43, 43, 42, 0.2);
}

/* Loading spinner customization */
.spinner-border {
    color: #05FE84 !important;
}

/* Alert customization */
.alert-info {
    background: linear-gradient(135deg, rgba(5, 254, 132, 0.1) 0%, rgba(220, 220, 220, 0.1) 100%);
    border: 1px solid rgba(5, 254, 132, 0.3);
    color: #2B2B2A;
    border-radius: 0.6rem;
}
