/* ===== DASHBOARD MODERN DESIGN ===== */
/* Baseado no design moderno com sidebar azul escuro */
/* Estilos aplicados globalmente para todas as páginas que usam header/footer do dashboard */

:root {
    /* Cores do design */
    --sidebar-bg: #1a1f3a;
    --sidebar-text: #ffffff;
    --sidebar-accent: #dc3545;
    --sidebar-teal: #20c997;
    --content-bg: #f5f5f5;
    --content-header: #e9ecef;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    
    /* Cores de destaque */
    --red: #dc3545;
    --teal: #20c997;
    --blue-dark: #1a1f3a;
    --gray-light: #e9ecef;
    --gray-medium: #adb5bd;
}

/* ===== LAYOUT PRINCIPAL ===== */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--content-bg) !important;
    overflow-x: hidden;
}

/* Garantir que o body tenha o fundo correto quando usar dashboard */
body:has(.dashboard-wrapper) {
    background-color: var(--content-bg) !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

.dashboard-wrapper {
    display: flex !important;
    min-height: 100vh !important;
    width: 100% !important;
}

/* ===== SIDEBAR ===== */
.dashboard-sidebar {
    width: 280px !important;
    background-color: var(--sidebar-bg) !important;
    color: var(--sidebar-text);
    position: fixed !important;
    height: 100vh !important;
    left: 0;
    top: 0;
    z-index: 1000 !important;
    overflow-y: auto;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.dashboard-sidebar.collapsed {
    width: 80px;
}

.dashboard-sidebar.collapsed .sidebar-logo-text,
.dashboard-sidebar.collapsed .sidebar-section-title,
.dashboard-sidebar.collapsed .sidebar-menu-link span:not(:first-child) {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.dashboard-sidebar.collapsed .sidebar-logo {
    justify-content: center;
    padding: 1rem;
}

.dashboard-sidebar.collapsed .sidebar-menu-link {
    justify-content: center;
    padding: 1rem;
}

.dashboard-sidebar.collapsed .sidebar-menu-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

.dashboard-sidebar::-webkit-scrollbar {
    width: 6px;
}

.dashboard-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.dashboard-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===== PERFIL DO USUÁRIO NA SIDEBAR (em todas as páginas) ===== */
.sidebar-user-profile {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 120px;
    justify-content: center;
}

.sidebar-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #4a5568;
    border: 2px solid #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.sidebar-user-avatar i {
    font-size: 1.5rem;
    color: #ffffff;
}

.sidebar-user-info {
    width: 100%;
}

.sidebar-user-name {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    word-break: break-word;
}

/* Quando sidebar colapsada, esconder texto do usuário */
.dashboard-sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.dashboard-sidebar.collapsed .sidebar-user-profile {
    padding: 1rem;
    min-height: auto;
}

.dashboard-sidebar.collapsed .sidebar-user-avatar {
    margin-bottom: 0;
}

/* Logo */
.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-logo:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.logo-geometric {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-red {
    width: 20px;
    height: 20px;
    background-color: var(--sidebar-accent);
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 4px 0 0 0;
}

.logo-teal {
    width: 20px;
    height: 20px;
    background-color: var(--sidebar-teal);
    position: absolute;
    bottom: 0;
    right: 0;
    border-radius: 0 0 4px 0;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sidebar-text);
    margin: 0;
    line-height: 1.2;
}

.sidebar-logo-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.2;
}

/* Seção PAGES */
.sidebar-section {
    padding: 1rem 1.5rem 0.5rem;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sidebar-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

/* Menu Items */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.sidebar-menu-link span:first-child {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.sidebar-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-menu-link.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-left: 3px solid var(--sidebar-accent) !important;
    padding-left: calc(1.5rem - 3px) !important;
    font-weight: 600;
}

.sidebar-menu-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Badge NEW */
.sidebar-badge {
    background-color: var(--sidebar-accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.dashboard-content {
    flex: 1 !important;
    margin-left: 280px !important;
    min-height: 100vh;
    display: flex !important;
    flex-direction: column !important;
    transition: margin-left 0.3s ease;
    width: calc(100% - 280px) !important;
    box-sizing: border-box !important;
    position: relative;
}

.dashboard-sidebar.collapsed ~ .dashboard-content {
    margin-left: 80px;
}

/* Header do conteúdo */
.dashboard-header {
    background-color: var(--content-header);
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.dashboard-header-left,
.dashboard-header-right {
    padding-left: 2rem;
    padding-right: 2rem;
}

.dashboard-header-right {
    padding-right: 2rem;
}

.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: none;
    align-items: center;
    justify-content: center;
}

.dashboard-header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dashboard-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dashboard-notification {
    position: relative;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.dashboard-chat-icon {
    position: relative;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.dashboard-chat-icon:hover {
    background-color: var(--gray-light);
    color: var(--sidebar-bg);
    transform: translateY(-2px);
}

.dashboard-chat-icon i {
    font-size: 1.25rem;
}

.dashboard-chat-icon.has-notifications {
    color: var(--sidebar-bg);
    animation: pulse-chat 2s infinite;
}

@keyframes pulse-chat {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.dashboard-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--sidebar-accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--content-header);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Área de conteúdo */
.dashboard-main {
    flex: 1;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
    background-color: var(--content-bg);
}

/* Garantir que o container dentro do dashboard-main funcione corretamente */
.dashboard-main .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Garantir que container-fluid dentro do dashboard-main ocupe toda largura */
.dashboard-main .container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Garantir que header e footer sempre ocupem toda largura */
.dashboard-content .dashboard-header,
.dashboard-content .dashboard-footer {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
}

.dashboard-content {
    width: calc(100% - 280px) !important;
    box-sizing: border-box !important;
}

/* Garantir que elementos dentro do dashboard-content funcionem corretamente */
.dashboard-content .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.dashboard-content .form-section {
    margin-bottom: 1.5rem;
}

.dashboard-content .card {
    margin-bottom: 1.5rem;
}

/* ===== CARDS E WIDGETS ===== */
.dashboard-grid-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1200px) {
    .dashboard-grid-row:first-child {
        grid-template-columns: 1fr 1fr 1.5fr 1fr;
    }
    
    .dashboard-grid-row:nth-child(2) {
        grid-template-columns: 1.5fr 1fr 1fr;
    }
    
    .dashboard-grid-row:nth-child(3) {
        grid-template-columns: 1.5fr 1fr 1fr;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Donut Chart Card */
.donut-chart-card {
    text-align: center;
}

.donut-chart-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-chart-container canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.donut-chart {
    width: 100%;
    height: 100%;
}

.donut-chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.donut-chart-center-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.donut-chart-center-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.25rem 0 0 0;
}

/* Large Donut Chart */
.large-donut-card {
    text-align: center;
}

.large-donut-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.large-donut-container canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.large-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--card-bg);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.donut-needle {
    width: 3px;
    height: 80px;
    background: var(--text-primary);
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(180deg);
    border-radius: 2px;
}

/* Bar Chart Card */
.bar-chart-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bar-chart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bar-chart-item:last-child {
    margin-bottom: 0;
}

.bar-chart-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 120px;
    flex-shrink: 0;
}

.bar-chart-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.bar-chart-bar {
    flex: 1;
    height: 24px;
    background-color: var(--gray-light);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.bar-chart-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.bar-chart-fill.red {
    background-color: var(--red);
}

.bar-chart-fill.teal {
    background-color: var(--teal);
}

/* Star Rating Card */
.star-rating-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.star-rating-item {
    text-align: center;
}

.star-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.star-icon.teal {
    color: var(--teal);
}

.star-icon.red {
    color: var(--red);
}

.star-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

/* Progress Bar Card */
.progress-card {
    position: relative;
}

.progress-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.progress-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0 1rem 0;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background-color: var(--gray-light);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-bar-fill.red {
    background-color: var(--red);
}

.progress-bar-fill.teal {
    background-color: var(--teal);
}

/* Data Card */
.data-card {
    display: flex;
    flex-direction: column;
}

.data-card-totals {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
}

.data-total-item {
    flex: 1;
}

.data-total-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.data-total-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.data-total-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Data Card with Icon */
.data-card-icon {
    display: flex;
    flex-direction: column;
}

.data-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.data-card-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.data-card-icon-box.red {
    background-color: var(--red);
    color: white;
}

.data-card-icon-box i {
    font-size: 1.5rem;
}

.data-card-content {
    flex: 1;
}

.mini-bar-chart {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 50px;
}

.mini-bar {
    width: 12px;
    border-radius: 2px 2px 0 0;
}

.mini-bar.gray {
    background-color: var(--gray-medium);
    height: 30px;
}

.mini-bar.red {
    background-color: var(--red);
    height: 40px;
}

.mini-bar.teal {
    background-color: var(--teal);
    height: 25px;
}

/* Text Block Card */
.text-block-card {
    display: flex;
    flex-direction: column;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d3563 100%);
    padding: 2rem;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d3563 100%);
    padding: 2.5rem;
    text-align: center;
    color: white;
}

.login-logo {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.login-body {
    padding: 2rem;
}

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

.login-form .form-control {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.login-form .form-control:focus {
    border-color: var(--sidebar-bg);
    box-shadow: 0 0 0 0.2rem rgba(26, 31, 58, 0.25);
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d3563 100%);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 31, 58, 0.3);
    color: white;
}

/* ===== RESPONSIVIDADE ===== */
/* Já movido para seção de responsividade global abaixo */

@media (max-width: 768px) {
    .dashboard-main {
        padding: 1rem;
    }
    
    .dashboard-header {
        padding: 1rem;
    }
    
    .dashboard-header-title {
        font-size: 1rem;
    }
    
    .dashboard-user {
        font-size: 0.85rem;
    }
    
    .donut-chart-container {
        width: 150px;
        height: 150px;
    }
}

/* ===== UTILITÁRIOS ===== */
.text-red { color: var(--red) !important; }
.text-teal { color: var(--teal) !important; }
.bg-red { background-color: var(--red) !important; }
.bg-teal { background-color: var(--teal) !important; }

/* ===== COMPATIBILIDADE COM PÁGINAS EXISTENTES ===== */
/* Cards antigos agora usam o novo estilo - aplicado globalmente */
.card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    margin-bottom: 1.5rem !important;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px) !important;
}

.card-body {
    padding: 1.5rem !important;
}

.card-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin-bottom: 0.75rem !important;
}

/* Formulários - aplicado globalmente para todas as páginas */
.form-section {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.section-header {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin-bottom: 1.25rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 2px solid var(--sidebar-bg) !important;
}

.section-header i {
    color: var(--sidebar-bg) !important;
}

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

.form-control,
.form-select {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sidebar-bg) !important;
    box-shadow: 0 0 0 0.2rem rgba(26, 31, 58, 0.25) !important;
    outline: none !important;
}

.form-label {
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.9rem !important;
}

/* Tabelas - aplicado globalmente para todas as páginas */
.table {
    background-color: var(--card-bg) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 0 !important;
}

.table thead {
    background-color: var(--sidebar-bg) !important;
    color: white !important;
}

.table thead th {
    border: none !important;
    padding: 1rem !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

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

.table tbody tr:hover {
    background-color: var(--gray-light);
    transition: background-color 0.2s ease;
}

.table-responsive {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Botões - Garantir prioridade sobre main.css */
.dashboard-wrapper .btn,
.dashboard-content .btn,
.container .btn,
body .btn {
    border-radius: 8px;
    padding: 0.625rem 1.25rem !important;
    font-weight: 500;
    font-size: 0.9rem !important;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
    color: white;
}

.btn-primary:hover {
    background-color: #2d3563;
    border-color: #2d3563;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 31, 58, 0.3);
}

.btn-info {
    background-color: var(--teal);
    border-color: var(--teal);
    color: white;
}

.btn-info:hover {
    background-color: #1aa179;
    border-color: #1aa179;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(32, 201, 151, 0.3);
}

.btn-danger {
    background-color: var(--red);
    border-color: var(--red);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #c82333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-secondary {
    background-color: var(--gray-medium);
    border-color: var(--gray-medium);
    color: white;
}

.btn-secondary:hover {
    background-color: #8a95a5;
    border-color: #8a95a5;
    color: white;
}

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

.btn-lg {
    padding: 0.625rem 1.25rem !important;
    font-size: 0.95rem !important;
}

/* Botões outline */
.btn-outline-primary {
    border: 2px solid var(--sidebar-bg);
    color: var(--sidebar-bg);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--sidebar-bg);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 31, 58, 0.3);
}

.btn-outline-secondary {
    border: 2px solid var(--gray-medium);
    color: var(--gray-medium);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--gray-medium);
    color: white;
}

.btn-outline-warning {
    border: 2px solid #ffc107;
    color: #ffc107;
    background-color: transparent;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    color: #212529;
}

.btn-outline-info {
    border: 2px solid var(--teal);
    color: var(--teal);
    background-color: transparent;
}

.btn-outline-info:hover {
    background-color: var(--teal);
    color: white;
}

/* Botões corporativos (compatibilidade) */
.btn-corporate-primary {
    background-color: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
    color: white;
    border-radius: 8px;
    padding: 0.625rem 1.25rem !important;
    font-weight: 500;
    font-size: 0.9rem !important;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-corporate-primary:hover {
    background-color: #2d3563;
    border-color: #2d3563;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 31, 58, 0.3);
}

.btn-corporate-secondary {
    background-color: var(--gray-medium);
    border-color: var(--gray-medium);
    color: white;
    border-radius: 8px;
    padding: 0.625rem 1.25rem !important;
    font-weight: 500;
    font-size: 0.9rem !important;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-corporate-secondary:hover {
    background-color: #8a95a5;
    border-color: #8a95a5;
    color: white;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--red);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--teal);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* Badges */
.badge {
    border-radius: 6px;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.bg-primary {
    background-color: var(--sidebar-bg) !important;
}

.bg-success {
    background-color: #28a745 !important;
}

.bg-danger {
    background-color: var(--red) !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.bg-info {
    background-color: var(--teal) !important;
}

/* Modais */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background-color: var(--sidebar-bg);
    color: white;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem;
}

.modal-header .modal-title {
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

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

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 0 0 12px 12px;
}

/* Headers específicos de módulos */
.corporate-header,
.fod-header {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d3563 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.corporate-header h1,
.fod-header h1 {
    margin: 0;
    font-weight: 700;
    font-size: 1.75rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.corporate-header p,
.fod-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    color: white;
}

/* Input Groups */
.input-group-text {
    background-color: var(--gray-light);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
}

/* Material Items */
.material-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.material-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--sidebar-bg);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Checkbox Groups */
.checkbox-group {
    background-color: var(--gray-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.form-check-input:checked {
    background-color: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
}

/* Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* File Input */
.form-control[type="file"] {
    padding: 0.5rem;
}

.form-control[type="file"]::-webkit-file-upload-button {
    background-color: var(--sidebar-bg);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-right: 1rem;
    cursor: pointer;
    font-weight: 500;
}

.form-control[type="file"]::-webkit-file-upload-button:hover {
    background-color: #2d3563;
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
}

.page-link {
    color: var(--sidebar-bg);
    border-color: var(--border-color);
    padding: 0.5rem 0.75rem;
}

.page-link:hover {
    background-color: var(--gray-light);
    border-color: var(--sidebar-bg);
    color: var(--sidebar-bg);
}

.page-item.active .page-link {
    background-color: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--sidebar-bg);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

/* Container adjustments */
.container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ===== FOOTER ===== */
.dashboard-footer {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.dashboard-footer .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    margin: 0 !important;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--sidebar-accent) 0%, var(--sidebar-teal) 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.footer-text h5 {
    margin: 0;
    font-weight: 600;
    color: var(--sidebar-text);
    font-size: 0.95rem;
}

.footer-text small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

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

.dashboard-footer p {
    margin: 0;
    color: var(--sidebar-text);
    font-size: 0.9rem;
}

/* ===== RESPONSIVIDADE DE TABELAS ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.table-responsive table {
    min-width: 100%;
    width: max-content;
    margin-bottom: 0;
}

/* ===== GARANTIR RESPONSIVIDADE EM TODAS AS TABELAS ===== */
/* Regra global para todas as tabelas */
table {
    max-width: 100%;
}

/* Forçar scroll horizontal em tabelas grandes */
.table-responsive,
div[class*="table-responsive"],
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.table-responsive table,
div[class*="table-responsive"] table,
.table-wrapper table {
    width: 100%;
    min-width: max-content;
}

/* Tabelas específicas */
#fodTable,
#infraTable,
#reportTable,
#monitTable,
#censoTable,
#asaTable {
    min-width: 1000px;
}

/* Forçar quebra de linha em células longas em mobile */
@media (max-width: 768px) {
    .table-responsive,
    div[class*="table-responsive"] {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    .table-responsive table,
    div[class*="table-responsive"] table {
        display: table;
        width: 100%;
        min-width: max-content;
        white-space: nowrap;
    }
    
    .table-responsive th,
    .table-responsive td,
    table th,
    table td {
        min-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Tabelas específicas com muitas colunas */
    #fodTable,
    #infraTable,
    #reportTable,
    #monitTable,
    #censoTable,
    #asaTable {
        font-size: 0.75rem;
        min-width: 900px;
    }
    
    #fodTable th,
    #fodTable td,
    #infraTable th,
    #infraTable td,
    #reportTable th,
    #reportTable td,
    #monitTable th,
    #monitTable td,
    #censoTable th,
    #censoTable td,
    #asaTable th,
    #asaTable td {
        padding: 0.4rem 0.3rem;
        font-size: 0.75rem;
        min-width: 80px;
    }
}

/* ===== CARDS DE FAUNA MELHORADOS ===== */
.fauna-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, #f8f9fa 100%) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    margin-bottom: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.fauna-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sidebar-bg) 0%, var(--teal) 100%);
}

.fauna-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--sidebar-bg);
}

.fauna-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--sidebar-bg);
    transition: transform 0.3s ease;
}

.fauna-card:hover .card-icon {
    transform: scale(1.05);
}

.fauna-card .card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.fauna-card .btn {
    margin-top: 0.5rem !important;
    flex: 1;
    min-width: 100px;
    font-size: 0.8rem !important;
    padding: 0.4rem 0.75rem !important;
    white-space: nowrap;
}

.fauna-card .d-flex.gap-2 {
    margin-top: 0.75rem;
    width: 100%;
}

/* ===== FILTROS DE CONSULTA COMPACTOS ===== */
.consulta-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.consulta-filters .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.consulta-filters .form-control,
.consulta-filters .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

@media (max-width: 1200px) {
    .consulta-filters {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

/* ===== DASHBOARD ESTILIZADO ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, #f8f9fa 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sidebar-bg) 0%, var(--teal) 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--sidebar-bg);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--sidebar-bg);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ===== RESPONSIVIDADE GLOBAL ===== */
@media (max-width: 992px) {
    .dashboard-sidebar {
        transform: translateX(-100%) !important;
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0) !important;
    }
    
    .dashboard-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .dashboard-menu-toggle {
        display: flex;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .consulta-filters {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .consulta-filters {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        font-size: 0.85rem;
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    .table-responsive table {
        min-width: 100%;
        width: max-content;
        display: table;
        margin-bottom: 0;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        white-space: nowrap;
        min-width: 100px;
    }
    
    /* Forçar scroll horizontal em tabelas grandes */
    .table-responsive {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .dashboard-footer {
        padding: 1rem 0;
        text-align: center;
    }
    
    .footer-brand {
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .dashboard-footer .text-md-end {
        text-align: center !important;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .dashboard-main {
        padding: 1rem;
    }
    
    .dashboard-header {
        padding: 1rem;
    }
    
    .dashboard-header-title {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
        min-width: 80px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .fauna-card {
        padding: 1rem;
    }
    
    .fauna-card .card-icon {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .fauna-card .card-title {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .fauna-card .btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
        min-width: 90px;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .fauna-card {
        padding: 1rem;
    }
    
    .fauna-card .card-icon {
        font-size: 1.5rem;
    }
    
    .fauna-card .card-title {
        font-size: 0.8rem;
    }
}

