/**
 * AbsenteismoController v2.0 - Main Styles
 * Design baseado nos princípios Cole/CRAP
 */

:root {
    /* Cores Principais da Empresa (Azul Marinho e Verde Oliva) */
    --primary: #1a237e;
    --primary-dark: #0d47a1;
    --primary-light: #3949ab;
    --primary-lighter: #5c6bc0;
    --primary-darkest: #000051;
    
    --secondary: #556B2F;
    --secondary-dark: #4a5d23;
    --secondary-light: #6B8E23;
    --secondary-lighter: #808000;
    
    --success: #556B2F;
    --warning: #6B8E23;
    --danger: #4a5d23;
    --info: #1a237e;
    
    /* Cores Neutras */
    --background: #F5F7FA;
    --surface: #FFFFFF;
    --surface-hover: #F8F9FA;
    
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-disabled: #BDBDBD;
    
    --border: #E0E0E0;
    --divider: #EEEEEE;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    
    /* Tamanhos */
    --sidebar-width: 340px;
    --header-height: 64px;
    
    /* Transições */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== TEMA ESCURO ==================== */
[data-theme="dark"] {
    /* Cores Principais (mantém as mesmas para consistência) */
    --primary: #1a237e;
    --primary-dark: #0d47a1;
    --primary-light: #3949ab;
    --primary-lighter: #5c6bc0;
    --primary-darkest: #000051;
    
    --secondary: #556B2F;
    --secondary-dark: #4a5d23;
    --secondary-light: #6B8E23;
    --secondary-lighter: #808000;
    
    --success: #556B2F;
    --warning: #6B8E23;
    --danger: #4a5d23;
    --info: #1a237e;
    
    /* Cores Neutras - Tema Escuro Profissional */
    /* Fundo: Preto escuro | Cards: Cinza escuro | Texto: Cinza claro/Branco */
    --background: #000000;
    --surface: #1a1a1a;
    --surface-hover: #2a2a2a;
    
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-disabled: #707070;
    
    --border: #333333;
    --divider: #2a2a2a;
    
    /* Sombras mais suaves no tema escuro */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.6);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.7);
}

[data-theme="dark"] {
    background: var(--background) !important;
}

[data-theme="dark"] html {
    background: var(--background) !important;
}

[data-theme="dark"] body {
    background: var(--background) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .container {
    background: var(--background) !important;
}

[data-theme="dark"] .card {
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

/* Garante que texto dentro dos cards seja visível */
[data-theme="dark"] .card *:not(.btn):not(.badge) {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .card p,
[data-theme="dark"] .card span:not(.badge),
[data-theme="dark"] .card div:not(.card-icon):not(.btn) {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .card-value {
    color: #ffffff !important;
}

[data-theme="dark"] .card-title {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .card-label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .table {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table thead {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table thead th {
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .table tbody tr {
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table tbody tr:hover {
    background: var(--surface-hover) !important;
}

[data-theme="dark"] .table tbody td {
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .btn-secondary {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--border) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .sidebar-header {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .sidebar-logo {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sidebar-subtitle {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .header {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .header-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-item {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-item:hover {
    background: var(--surface-hover) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .nav-item.active {
    background: var(--primary) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .filter-input,
[data-theme="dark"] .search-input {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-content {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-header h2 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .badge {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .progress-bar {
    background: var(--surface-hover) !important;
}

[data-theme="dark"] .upload-zone {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .file-selected {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .content {
    background: var(--background) !important;
}

[data-theme="dark"] .main-content {
    background: var(--background) !important;
}

/* Garante que todos os containers principais usem o fundo escuro */
[data-theme="dark"] section,
[data-theme="dark"] article,
[data-theme="dark"] .section {
    background: var(--background) !important;
}

[data-theme="dark"] .filters {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .filter-label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-container {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .cards-grid {
    background: var(--background) !important;
}

[data-theme="dark"] label {
    color: var(--text-primary) !important;
}

/* Garante que todos os textos sejam visíveis no tema escuro */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span:not(.badge):not(.btn *):not(.nav-item *),
[data-theme="dark"] strong,
[data-theme="dark"] em,
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] li {
    color: var(--text-primary) !important;
}

/* Garante que inputs e selects tenham fundo escuro e texto claro */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .form-group label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-secondary {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div {
    color: inherit;
}

[data-theme="dark"] .column-filter {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .current-client-banner {
    background: var(--surface-hover) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-primary {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

[data-theme="dark"] .btn-success {
    background: var(--success) !important;
    color: #ffffff !important;
    border-color: var(--success) !important;
}

[data-theme="dark"] .btn-warning {
    background: var(--warning) !important;
    color: #ffffff !important;
    border-color: var(--warning) !important;
}

[data-theme="dark"] .btn-danger {
    background: var(--danger) !important;
    color: #ffffff !important;
    border-color: var(--danger) !important;
}

[data-theme="dark"] .btn-info {
    background: var(--info) !important;
    color: #ffffff !important;
    border-color: var(--info) !important;
}

[data-theme="dark"] .stats-card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .stats-value {
    color: #ffffff !important;
}

[data-theme="dark"] .stats-label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .periodo-selector {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .periodo-box {
    background: var(--surface-hover) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .periodo-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .upload-history {
    background: var(--surface) !important;
}

[data-theme="dark"] .cliente-card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .cliente-card:hover {
    background: var(--surface-hover) !important;
}

[data-theme="dark"] .cliente-nome {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .cliente-meta {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .cliente-status-chip {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .alert {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-success {
    background: rgba(85, 107, 47, 0.2) !important;
    border-color: var(--success) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger {
    background: rgba(74, 93, 35, 0.2) !important;
    border-color: var(--danger) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .alert-warning {
    background: rgba(107, 142, 35, 0.2) !important;
    border-color: var(--warning) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .alert-info {
    background: rgba(26, 35, 126, 0.2) !important;
    border-color: var(--info) !important;
    color: #ffffff !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== LAYOUT ==================== */

.container {
    display: flex;
    min-height: 100vh;
}

.main-page.no-sidebar {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 40px 48px 48px;
}

[data-theme="dark"] .main-page.no-sidebar {
    background: var(--background) !important;
}

.clientes-body {
    min-height: 100vh;
    background: var(--background);
}

[data-theme="dark"] .clientes-body {
    background: var(--background) !important;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.sidebar-scroll {
    flex: 1;
    overflow: hidden;
    background: var(--surface);
    padding-bottom: 8px;
}

.sidebar-scroll-inner {
    height: 100%;
    overflow-y: auto;
}

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

.sidebar-scroll-inner::-webkit-scrollbar-thumb {
    background: rgba(26, 35, 126, 0.18);
    border-radius: 999px;
}

.sidebar-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-bottom: 1px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-brand-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #fff;
}

.sidebar-brand-info strong {
    font-size: 16px;
    letter-spacing: 0.04em;
}

.sidebar-brand-info span {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    background: rgba(255,255,255,0.08);
}

.sidebar-header-cta:hover {
    background: rgba(255,255,255,0.18);
}

.sidebar-current-client {
    padding: 20px 24px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-current-client.empty {
    opacity: 0.85;
}

.sidebar-current-client-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.client-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--divider);
    color: var(--primary);
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.client-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.client-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.client-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
}

.client-info strong {
    font-size: 14px;
    color: var(--text-primary);
}

.client-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-current-client .btn {
    align-self: stretch;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    justify-content: center;
    gap: 6px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid rgba(26, 35, 126, 0.08);
    transition: var(--transition);
    background: rgba(26, 35, 126, 0.04);
    font-size: 13px;
}

.nav-item:hover {
    background: rgba(26, 35, 126, 0.1);
    color: var(--primary);
    border-color: rgba(26, 35, 126, 0.18);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(26,35,126,0.96), rgba(57,73,171,0.92));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 26px rgba(26, 35, 126, 0.26);
}

/* Roda de Ouro: Dashboard em preto */
.nav-item.active.roda-ouro-dashboard {
    background: linear-gradient(135deg, rgba(0,0,0,0.96), rgba(20,20,20,0.92));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
}

.nav-item.active.roda-ouro-dashboard .nav-item-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.nav-item.active.roda-ouro-dashboard .nav-item-chevron {
    color: rgba(255,255,255,0.85);
}

/* Roda de Ouro: Sidebar completo em preto */
.sidebar.roda-ouro-sidebar {
    background: #000000 !important;
    border-right-color: #1a1a1a !important;
}

.sidebar.roda-ouro-sidebar .sidebar-scroll {
    background: #000000 !important;
}

.sidebar.roda-ouro-sidebar .sidebar-scroll-inner {
    background: #000000 !important;
}

.sidebar.roda-ouro-sidebar .sidebar-scroll-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2) !important;
}

.sidebar.roda-ouro-sidebar .sidebar-header {
    background: linear-gradient(135deg, #000000, #1a1a1a) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar.roda-ouro-sidebar .sidebar-brand-icon {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}

.sidebar.roda-ouro-sidebar .sidebar-brand-info {
    color: #fff !important;
}

.sidebar.roda-ouro-sidebar .sidebar-current-client {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    background: #000000 !important;
}

.sidebar.roda-ouro-sidebar .client-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar.roda-ouro-sidebar .client-info strong {
    color: #fff !important;
}

.sidebar.roda-ouro-sidebar .client-meta {
    color: rgba(255, 255, 255, 0.6) !important;
}

.sidebar.roda-ouro-sidebar .nav-item {
    color: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.sidebar.roda-ouro-sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.sidebar.roda-ouro-sidebar .nav-item.active {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.96), rgba(40, 40, 40, 0.92)) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.5) !important;
}

.sidebar.roda-ouro-sidebar .nav-item-icon {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.sidebar.roda-ouro-sidebar .nav-item.active .nav-item-icon {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}

.sidebar.roda-ouro-sidebar .nav-item-chevron {
    color: rgba(255, 255, 255, 0.4) !important;
}

.sidebar.roda-ouro-sidebar .nav-item:hover .nav-item-chevron {
    opacity: 0.7 !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar.roda-ouro-sidebar .nav-item.active .nav-item-chevron {
    opacity: 1 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar.roda-ouro-sidebar .sidebar-bottom {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4)) !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar.roda-ouro-sidebar .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.sidebar.roda-ouro-sidebar .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Converplast: Sidebar completo em azul */
.sidebar.converplast-sidebar {
    background: #1a237e !important;
    border-right-color: #0d47a1 !important;
}

.sidebar.converplast-sidebar .sidebar-scroll {
    background: #1a237e !important;
}

.sidebar.converplast-sidebar .sidebar-scroll-inner {
    background: #1a237e !important;
}

.sidebar.converplast-sidebar .sidebar-scroll-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3) !important;
}

.sidebar.converplast-sidebar .sidebar-header {
    background: linear-gradient(135deg, #1a237e, #0d47a1) !important;
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}

.sidebar.converplast-sidebar .sidebar-brand-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.sidebar.converplast-sidebar .sidebar-brand-info {
    color: #fff !important;
}

.sidebar.converplast-sidebar .sidebar-current-client {
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
    background: #1a237e !important;
}

.sidebar.converplast-sidebar .client-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

.sidebar.converplast-sidebar .client-info strong {
    color: #fff !important;
}

.sidebar.converplast-sidebar .client-meta {
    color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar.converplast-sidebar .nav-item {
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar.converplast-sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.sidebar.converplast-sidebar .nav-item.active {
    background: linear-gradient(135deg, rgba(26, 35, 126, 0.95), rgba(13, 71, 161, 0.9)) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 14px 26px rgba(26, 35, 126, 0.4) !important;
}

.sidebar.converplast-sidebar .nav-item-icon {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar.converplast-sidebar .nav-item.active .nav-item-icon {
    background: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
}

.sidebar.converplast-sidebar .nav-item-chevron {
    color: rgba(255, 255, 255, 0.5) !important;
}

.sidebar.converplast-sidebar .nav-item:hover .nav-item-chevron {
    opacity: 0.8 !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.sidebar.converplast-sidebar .nav-item.active .nav-item-chevron {
    opacity: 1 !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.sidebar.converplast-sidebar .sidebar-bottom {
    background: linear-gradient(180deg, rgba(26, 35, 126, 0.9), rgba(13, 71, 161, 0.7)) !important;
    border-top-color: rgba(255, 255, 255, 0.15) !important;
}

.sidebar.converplast-sidebar .btn-secondary {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.sidebar.converplast-sidebar .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.nav-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(26, 35, 126, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.nav-item.active .nav-item-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.nav-item-text {
    display: flex;
    flex-direction: column;
}

.nav-item-title {
    font-size: 13px;
    font-weight: 600;
}

.nav-item-chevron {
    font-size: 12px;
    opacity: 0.35;
}

.nav-item:hover .nav-item-chevron {
    opacity: 0.6;
}

.nav-item.active .nav-item-chevron {
    opacity: 0.8;
    color: rgba(255,255,255,0.85);
}

.sidebar-bottom {
    padding: 18px 24px 24px;
    border-top: 1px solid var(--divider);
    background: linear-gradient(180deg, rgba(26, 35, 126, 0.05), rgba(26, 35, 126, 0.0));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-user {
    background: var(--surface);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid var(--divider);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(26, 35, 126, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 13px;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
}

.sidebar-user strong {
    font-size: 14px;
    color: var(--text-primary);
}

.btn-full {
    margin-left: auto;
    width: auto;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    background: var(--background);
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .main-content {
    background: var(--background) !important;
}

.header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: var(--shadow-sm);
    position: relative;
    flex-shrink: 0;
}

.header-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user-widget {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 14px;
    padding: 8px 12px;
    box-shadow: var(--shadow-sm);
}

.clientes-header {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .clientes-header {
        margin-bottom: 16px;
    }
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(26, 35, 126, 0.12);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-user-text strong {
    font-size: 14px;
    color: var(--text-primary);
}

.header-user-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-login-btn,
.header-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.content {
    padding: 32px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

[data-theme="dark"] .content {
    background: var(--background) !important;
}

/* Footer */
.main-content footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: auto;
    flex-shrink: 0;
}

[data-theme="dark"] .main-content footer {
    background: var(--surface) !important;
    border-top-color: var(--border) !important;
    color: var(--text-secondary) !important;
}

/* ==================== CARDS ==================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background: var(--surface);
    background-color: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.card-icon.primary { background: rgba(25, 118, 210, 0.1); color: var(--primary); }
.card-icon.success { background: rgba(76, 175, 80, 0.1); color: var(--success); }
.card-icon.warning { background: rgba(255, 152, 0, 0.1); color: var(--warning); }
.card-icon.danger { background: rgba(244, 67, 54, 0.1); color: var(--danger); }
.card-icon.info { background: rgba(33, 150, 243, 0.1); color: var(--info); }

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-variation {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.card-variation.positive {
    color: var(--success);
}

.card-variation.negative {
    color: var(--danger);
}

.card-variation.neutral {
    color: var(--text-secondary);
}

/* ==================== CHARTS ==================== */

.chart-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: visible;
    min-width: 0; /* Permite que o container encolha */
}

.chart-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--divider);
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.chart-wrapper {
    position: relative;
    overflow: visible;
    min-width: 0; /* Permite que o wrapper encolha */
    width: 100%;
    height: 300px;
}

.chart-wrapper.large {
    height: 400px;
}

/* ==================== BUTTONS ==================== */

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #43A047;
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== FILTERS ==================== */

.filters {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.filters:hover {
    box-shadow: var(--shadow-lg);
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label i {
    font-size: 12px;
    color: var(--primary);
}

.filter-input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--surface);
    width: 100%;
}

.filter-input:hover {
    border-color: var(--primary-light);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.multiselect-trigger:hover {
    border-color: var(--primary-light) !important;
    box-shadow: 0 2px 4px rgba(26, 35, 126, 0.1);
}

.multiselect-trigger:active {
    transform: translateY(1px);
}

.filter-actions .btn {
    transition: all 0.3s ease;
}

.filter-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

/* ==================== INSIGHTS ==================== */

.insights-section {
    margin-bottom: 28px;
}

.insights-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
}

.insights-title i {
    color: #FF9800;
    font-size: 24px;
}

.insights-container {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.insight-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 26px 24px;
    border-left: 6px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.insight-card.alerta { border-left-color: var(--danger); }
.insight-card.atencao { border-left-color: var(--warning); }
.insight-card.positivo { border-left-color: var(--success); }
.insight-card.info { border-left-color: var(--info); }
.insight-card.tendencia { border-left-color: #FF9800; }

.insight-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.insight-icon {
    font-size: 38px;
    line-height: 1;
}

.insight-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.insight-titulo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.insight-descricao {
    font-size: 15px;
    color: var(--text-secondary);
}

.insight-recomendacao {
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(26, 35, 126, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-recomendacao i {
    color: var(--primary);
}

@media (max-width: 768px) {
    .insights-container {
        grid-template-columns: 1fr;
    }
}

/* ==================== TABLES ==================== */

.table-container {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--surface-hover);
}

.table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--divider);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--divider);
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================== MOBILE MENU ==================== */

.mobile-menu-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .header {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .header-title {
        flex: 1;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 16px;
    }
    
    .header {
        padding: 0 16px;
        min-height: 56px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Botões maiores para mobile */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    /* Inputs maiores para mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Evita zoom no iOS */
        padding: 12px 16px;
    }
    
    /* Tabelas responsivas */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    /* Cards com padding menor */
    .card {
        padding: 16px;
    }
    
    /* Gráficos responsivos */
    .chart-container {
        height: 300px !important;
    }
    
    /* Filtros empilhados */
    .filters-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }
    
    /* Multiselect maior */
    .multiselect-trigger {
        min-height: 44px;
    }
    
    /* Alertas dropdown menor */
    .alertas-dropdown {
        width: calc(100vw - 32px) !important;
        max-width: 400px;
        right: 16px !important;
    }
    
    /* Sidebar mais estreita em mobile */
    .sidebar {
        width: 280px;
        max-width: 85vw;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 8px !important;
    }
    
    .btn-print-header span {
        display: none;
    }
    
    .btn-print-header {
        padding: 10px !important;
        min-width: 44px;
    }
    
    .content {
        padding: 12px;
    }
    
    .card {
        padding: 12px;
    }
}

/* ==================== UTILITIES ==================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none; }

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--divider);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mensagens de sem dados */
.no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-style: italic;
    background: var(--background);
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* ==================== MODAL ==================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== ALERTS ==================== */

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.alert-error {
    background-color: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

.alert-warning {
    background-color: #fff3e0;
    border: 1px solid #ff9800;
    color: #e65100;
}

.alert-info {
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1565c0;
}

.alert i {
    font-size: 20px;
}

/* ==================== BADGES ==================== */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-secondary {
    background-color: var(--text-secondary);
    color: white;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-danger {
    background-color: var(--danger);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: white;
}

.badge-info {
    background-color: var(--info);
    color: white;
}

/* ==================== FORMS ==================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--surface);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.form-control::placeholder {
    color: var(--text-disabled);
}

.form-control:disabled {
    background: var(--surface-hover);
    cursor: not-allowed;
}

/* ==================== IMPRESSÃO / PDF ==================== */
@media print {
    /* Reset geral */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Esconde sidebar, header, botões */
    .sidebar,
    .header,
    .filters,
    .btn-print-header,
    button:not(.no-print),
    .nav-item,
    .sidebar-nav {
        display: none !important;
    }

    /* Layout para impressão */
    body {
        margin: 0;
        padding: 20px;
        background: white !important;
        font-size: 12pt;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Cards e métricas */
    .card {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 16px;
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .cards-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
        margin-bottom: 20px;
    }

    /* Gráficos */
    .chart-container {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        padding: 16px;
        background: white;
    }

    .chart-wrapper {
        height: auto !important;
        min-height: 300px;
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Títulos */
    .chart-title {
        font-size: 14pt;
        margin-bottom: 8px;
        color: #1a237e;
    }

    .chart-subtitle {
        font-size: 10pt;
        color: #666;
        margin-bottom: 12px;
    }

    /* Insights */
    .insights-section {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 20px;
    }

    .insights-container {
        background: #f9f9f9;
        padding: 16px;
        border: 1px solid #ddd;
    }

    /* Quebras de página */
    .chart-container:nth-child(2n) {
        page-break-after: auto;
    }

    /* Evita quebrar gráficos */
    .chart-wrapper canvas {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Cores e fundos */
    .card-icon {
        background: #f5f5f5 !important;
    }

    .card-value {
        color: #1a237e !important;
    }
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: var(--primary);
    color: white;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.text-center {
    text-align: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* ==================== RESPONSIVE IMPROVEMENTS ==================== */

/* Notebooks e Tablets grandes (1024px - 1366px) */
@media (max-width: 1366px) and (min-width: 1025px) {
    .content {
        padding: 24px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .sidebar {
        width: 300px;
    }
    
    .main-content {
        margin-left: 300px;
    }
}

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .content {
        padding: 20px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 700px;
    }
    
    .toolbar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .card {
        padding: 20px;
    }
}

/* Melhorias para telas pequenas de notebook (1280px - 1440px) */
@media (max-width: 1440px) and (min-width: 1281px) {
    .content {
        padding: 28px;
    }
    
    .cards-grid {
        gap: 20px;
    }
}

/* Ajustes para tabelas em todas as telas */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 12px 8px;
        white-space: nowrap;
    }
}

/* Modais responsivos */
@media (max-width: 768px) {
    .modal {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 20px auto !important;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content {
        padding: 16px !important;
    }
    
    .modal-header {
        padding: 12px 16px !important;
        font-size: 18px !important;
    }
    
    .modal-body {
        padding: 16px !important;
    }
    
    .modal-footer {
        padding: 12px 16px !important;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Toolbar responsivo */
@media (max-width: 1024px) {
    .toolbar {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px;
    }
    
    .toolbar > div {
        flex: 1 1 100%;
        min-width: 0;
    }
    
    .toolbar > div:last-child {
        flex: 1 1 auto;
    }
}

/* Formulários responsivos */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Gráficos responsivos */
@media (max-width: 1024px) {
    .chart-container {
        height: 300px !important;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 250px !important;
    }
}

/* Cards de estatísticas responsivos */
@media (max-width: 1024px) {
    .stats-card {
        padding: 16px;
    }
    
    .stats-value {
        font-size: 24px;
    }
    
    .stats-label {
        font-size: 12px;
    }
}

/* Header responsivo */
@media (max-width: 1024px) {
    .header-actions {
        gap: 8px;
    }
    
    .header-user-text {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-actions {
        gap: 4px;
    }
    
    .header-user-info {
        display: none;
    }
}

/* Sidebar melhorias */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    }
}

/* Melhorias gerais para notebooks */
@media (max-width: 1600px) and (min-width: 1025px) {
    .content {
        padding: 28px;
    }
    
    .container {
        max-width: 100%;
    }
}

/* Ajustes específicos para gráficos do dashboard */
@media (max-width: 1440px) {
    /* Grid de gráficos em coluna única em telas menores */
    #graficosConverplast > div[style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    
    #graficosConverplast > div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .chart-container {
        overflow: visible;
        width: 100%;
        max-width: 100%;
    }
    
    .chart-wrapper {
        overflow: visible;
        max-width: 100%;
        width: 100%;
    }
    
    .chart-wrapper canvas {
        max-width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 1366px) {
    /* Notebooks padrão - gráficos em coluna única */
    #graficosConverplast > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .chart-wrapper {
        height: 320px !important;
    }
}

@media (max-width: 1280px) {
    /* Em notebooks menores, gráficos em coluna única */
    #graficosConverplast > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .chart-wrapper {
        height: 300px !important;
    }
}

@media (max-width: 1024px) {
    /* Tablets - gráficos em coluna única */
    #graficosConverplast > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .chart-wrapper {
        height: 280px !important;
    }
    
    .chart-container {
        margin-bottom: 20px;
    }
}

/* Garante que todos os gráficos sejam responsivos */
#graficosConverplast > div {
    display: grid !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

#graficosConverplast .chart-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#graficosConverplast .chart-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#graficosConverplast canvas {
    max-width: 100% !important;
    height: auto !important;
}

