/* =========================
   VARIÁVEIS E RESET GLOBAL
   ========================= */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #ff9e00;
    --info: #4895ef;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 10px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    
    /* Cores para modo claro */
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
}

:root.dark-mode {
    /* Cores para modo escuro */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --text-primary: #e4e6eb;
    --text-secondary: #a8adb5;
    --border-color: #2d3748;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* =========================
   TIPOGRAFIA
   ========================= */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

button, input, select, textarea {
    font-family: 'Roboto', sans-serif;
}

/* =========================
   LAYOUT PRINCIPAL
   ========================= */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--bg-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
}

.toggle-sidebar-btn {
    order: -1;
    margin-right: 10px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    flex: 0 1 auto;
}

.logo i {
    color: var(--primary);
    font-size: 28px;
    animation: pulse 2s infinite;
}

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

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.toggle-sidebar-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 22px;
    cursor: pointer;
    padding: 5px 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-sidebar-btn:hover {
    color: var(--primary-dark);
    transform: scale(1.1);
}

.toggle-theme-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-theme-btn:hover {
    color: var(--primary-dark);
    transform: scale(1.1);
}

/* Main Layout */
.main-layout {
    display: flex;
    margin-top: 20px;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.sidebar.hidden {
    display: none;
    width: 0;
    padding: 0;
}

.main-layout {
    transition: all 0.3s ease;
}

.main-layout.sidebar-hidden {
    gap: 0;
}

.main-content {
    transition: all 0.3s ease;
}

.main-content.sidebar-hidden {
    flex: 1;
    width: 100%;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: var(--light-gray);
    padding-left: 18px;
}

.nav-item.active {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    font-weight: 500;
    border-left-color: var(--primary);
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 15px;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

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

.sidebar-btn.secondary:hover {
    background: rgba(67, 97, 238, 0.05);
}

/* =========================
   CONTEÚDO PRINCIPAL
   ========================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: var(--transition);
    color: var(--text-primary);
    position: relative;
    cursor: grab;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.card.card-hidden {
    background: rgba(0, 0, 0, 0.02);
    border: 2px dashed var(--border-color);
}

.card-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: var(--transition);
}

.card:hover .card-controls {
    opacity: 1;
}

.card-control-btn {
    background: rgba(67, 97, 238, 0.1);
    border: none;
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
}

.card-control-btn:hover {
    background: rgba(67, 97, 238, 0.2);
    transform: scale(1.1);
}

.card-control-btn.hidden-card {
    background: rgba(247, 37, 133, 0.1);
    color: var(--danger);
}

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

.card-title {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    margin: 10px 0;
}

.card-income .card-value {
    color: var(--success);
}

.card-expenses .card-value {
    color: var(--danger);
}

.card-initial .card-value {
    color: var(--info);
}

.card-initial .card-icon {
    background: rgba(73, 149, 239, 0.15);
    color: var(--info);
}

.card-balance .card-value {
    color: var(--primary);
}

.card-investments .card-value {
    color: var(--warning);
}

.card-projection .card-value {
    color: var(--secondary);
}

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

.card-income .card-icon {
    background: rgba(76, 201, 240, 0.15);
    color: var(--success);
}

.card-expenses .card-icon {
    background: rgba(247, 37, 133, 0.15);
    color: var(--danger);
}

.card-balance .card-icon {
    background: rgba(67, 97, 238, 0.15);
    color: var(--primary);
}

.card-investments .card-icon {
    background: rgba(255, 158, 0, 0.15);
    color: var(--warning);
}

.card-projection .card-icon {
    background: rgba(114, 9, 183, 0.15);
    color: var(--secondary);
}

.card-pending .card-value {
    color: var(--warning);
}

.card-pending .card-icon {
    background: rgba(255, 158, 0, 0.15);
    color: var(--warning);
}

.card-pending-expenses .card-value {
    color: var(--danger);
}

.card-pending-expenses .card-icon {
    background: rgba(247, 37, 133, 0.15);
    color: var(--danger);
}

.card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
}

.card-edit-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-edit-btn:hover {
    color: var(--primary-dark);
    transform: scale(1.2);
}

/* =========================
   GRÁFICOS E SEÇÕES
   ========================= */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chart-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    color: var(--text-primary);
    transition: var(--transition);
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
}

.chart-placeholder {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* =========================
    SEÇÃO FLUXO DE CAIXA
    ========================= */
.cash-flow-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    color: var(--text-primary);
    transition: var(--transition);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
}

.section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background: var(--border-color);
    border-color: var(--primary);
}

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

.action-btn.primary:hover {
    background: var(--primary-dark);
}

.action-btn.danger {
    color: var(--danger);
    border-color: var(--danger);
}

.action-btn.danger:hover {
    background: rgba(247, 37, 133, 0.1);
}

.filter-options {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

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

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

/* =========================
   TABELAS
   ========================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    color: var(--text-primary);
}

thead {
    background: var(--border-color);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    transition: var(--transition);
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--border-color);
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-paid {
    background: rgba(76, 201, 240, 0.15);
    color: var(--success);
}

.status-pending {
    background: rgba(255, 158, 0, 0.15);
    color: var(--warning);
}

.status-overdue {
    background: rgba(247, 37, 133, 0.15);
    color: var(--danger);
}

/* =========================
   MODAIS MODERNOS
   ========================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    color: var(--text-primary);
    transition: var(--transition);
}

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

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* =========================
   FORMULÁRIOS
   ========================= */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Roboto', sans-serif;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.radio-group, .checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.radio-group label, .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 400;
}

input[type="radio"], input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary);
}

/* =========================
   BOTÕES
   ========================= */
button {
    border: none;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 6px;
    font-weight: 500;
}

.btn {
    padding: 12px 24px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark);
}

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

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

.btn-danger:hover {
    background: #d91c5f;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* =========================
   ALERTAS
   ========================= */
.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.alert-success {
    background: rgba(76, 201, 240, 0.15);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-success strong {
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 158, 0, 0.15);
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

.alert-warning strong {
    color: var(--warning);
}

.alert-danger {
    background: rgba(247, 37, 133, 0.15);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-danger strong {
    color: var(--danger);
}

.alert-info {
    background: rgba(73, 149, 239, 0.15);
    color: var(--info);
    border-left: 4px solid var(--info);
}

.alert-info strong {
    color: var(--info);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
}

/* =========================
   TIMELINE
   ========================= */
.projection-timeline {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 20px;
}

.timeline-item {
    min-width: 150px;
    background: var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    color: var(--text-primary);
}

.timeline-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.1);
}

.timeline-item.active {
    background: rgba(67, 97, 238, 0.1);
    border-color: var(--primary);
}

.timeline-date {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-size: 12px;
}

.timeline-value {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

.timeline-value.positive {
    color: var(--success);
}

.timeline-value.negative {
    color: var(--danger);
}

/* =========================
   RESPONSIVIDADE
   ========================= */
@media (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: auto;
    }

    .sidebar.hidden {
        display: none;
    }

    .main-content.sidebar-hidden {
        width: 100%;
    }

    .logo h1 {
        font-size: 20px;
    }

    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .card-value {
        font-size: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-actions {
        width: 100%;
    }

    .action-btn {
        flex: 1;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .logo i {
        font-size: 24px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .sidebar-nav {
        gap: 2px;
    }

    .nav-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .nav-item i {
        font-size: 16px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 15px;
    }

    .card-value {
        font-size: 24px;
    }

    .section-title {
        font-size: 18px;
    }

    .projection-timeline {
        gap: 10px;
    }

    .timeline-item {
        min-width: 120px;
        padding: 12px;
    }

    .filter-options {
        flex-wrap: wrap;
    }

    .filter-btn {
        flex: 1;
        min-width: 80px;
    }
}

/* =========================
   UTILITÁRIOS
   ========================= */
.hidden {
    display: none !important;
}

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

.text-muted {
    color: var(--text-secondary);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

small {
    font-size: 12px;
    color: var(--text-secondary);
}

/* =========================
    MODAL STYLES
    ========================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.onboarding-progress-item {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--light-gray);
    transition: var(--transition);
}

.onboarding-progress-item.active {
    background: var(--primary);
    width: 20px;
    border-radius: 5px;
}

.onboarding-progress-item.completed {
    background: var(--success);
}

/* =========================
    PAGINAÇÃO
    ========================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding: 15px;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* =========================
    TABELAS RESPONSIVAS
    ========================= */
.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
}

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

/* =========================
    CHATBOT FLUTUANTE
    ========================= */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: 'Roboto', sans-serif;
    z-index: 500;
}

.chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.4);
    transition: var(--transition);
    position: relative;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.5);
}

.chatbot-toggle-btn:active {
    transform: scale(0.95);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    border-radius: 50%;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
    transition: var(--transition);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 16px;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-message {
    display: flex;
    margin-bottom: 10px;
}

.chatbot-message p {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 85%;
}

.bot-message p {
    background: var(--border-color);
    color: var(--text-primary);
}

.user-message {
    justify-content: flex-end;
}

.user-message p {
    background: var(--primary);
    color: white;
}

.chatbot-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    flex-shrink: 0;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
}

.chatbot-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

.chatbot-option-btn i {
    font-size: 18px;
    color: var(--primary);
}

.chatbot-option-btn:hover {
    background: var(--border-color);
    border-color: var(--primary);
    color: var(--primary);
}

.chatbot-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
}

.chatbot-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.chatbot-action-btn i {
    font-size: 16px;
}

.chatbot-action-btn:hover {
    background: var(--primary-dark);
    transform: translateX(2px);
}

.chatbot-action-btn.back {
    background: var(--light-gray);
    color: var(--text-primary);
}

.chatbot-action-btn.back:hover {
    background: var(--border-color);
}

.chatbot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    max-height: 350px;
    overflow-y: auto;
    flex-shrink: 0;
}

.chatbot-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
}

.chatbot-list-item:hover {
    background: var(--border-color);
    border-color: var(--primary);
}

.chatbot-list-item-info {
    flex: 1;
    min-width: 0;
}

.chatbot-list-item-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chatbot-list-item-value {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.chatbot-list-item-value.positive {
    color: var(--success);
    font-weight: 600;
}

.chatbot-list-item-value.negative {
    color: var(--danger);
    font-weight: 600;
}

.chatbot-list-item-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.chatbot-list-item-action {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition);
}

.chatbot-list-item-action:hover {
    background: var(--primary);
    color: white;
}

.chatbot-list-item-action.danger {
    background: rgba(247, 37, 133, 0.1);
    color: var(--danger);
}

.chatbot-list-item-action.danger:hover {
    background: var(--danger);
    color: white;
}

/* Scrollbar customizado */
.chatbot-messages::-webkit-scrollbar,
.chatbot-options::-webkit-scrollbar,
.chatbot-list::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track,
.chatbot-options::-webkit-scrollbar-track,
.chatbot-list::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb,
.chatbot-options::-webkit-scrollbar-thumb,
.chatbot-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover,
.chatbot-options::-webkit-scrollbar-thumb:hover,
.chatbot-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* Responsividade */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        max-width: 400px;
    }

    .chatbot-options {
        grid-template-columns: 1fr;
    }
}

/* =========================
    CARD VISIBILITY TOGGLES
    ========================= */
.card-toggle-option {
    transition: var(--transition);
}

.card-toggle-option label {
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.card-toggle-option label:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}

.card-toggle-option label[style*="opacity: 0.6"] {
    opacity: 0.6 !important;
}

.card-toggle-option input[type="checkbox"]:not(:checked) ~ div {
    opacity: 0.7;
}

.card-toggle-option input[type="checkbox"] {
    accent-color: var(--primary);
    flex-shrink: 0;
}

.card-toggle-option input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================
    SETTINGS TABS
    ========================= */
.settings-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.settings-tab:hover {
    color: var(--primary);
}

.settings-tab.active {
    color: var(--primary);
}

.settings-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.settings-tab-content {
    animation: fadeIn 0.3s ease;
}

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

/* =========================
   PROFILE MODAL
   ========================= */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.profile-modal.active {
    opacity: 1;
    visibility: visible;
}

.profile-modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    color: var(--text-primary);
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(114, 9, 183, 0.1));
}

.profile-modal-header h2 {
    margin: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}

.profile-modal-header i {
    font-size: 28px;
}

.profile-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
}

.profile-modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    padding: 0;
}

.profile-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.profile-tab-btn:hover {
    color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}

.profile-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.profile-tab-btn i {
    font-size: 16px;
}

/* Tab Content */
.profile-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.profile-tab-content.active {
    display: block;
}

/* Profile Sections */
.profile-section {
    margin-bottom: 25px;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Avatar Display */
.profile-avatar-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 25px;
}

.avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.avatar-large.avatar-image {
    overflow: hidden;
}

.avatar-large.avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.avatar-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.avatar-large-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Forms */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background: var(--bg-secondary);
}

.form-group small {
    font-size: 12px;
    margin-top: 4px;
}

/* Avatar Options */
.avatar-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.avatar-option-group {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
}

.avatar-option-group h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Color Picker */
.color-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-option.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Preferences */
.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.preference-item:hover {
    background: rgba(67, 97, 238, 0.05);
}

.preference-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.preference-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition);
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Security Items */
.security-item {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.security-item:hover {
    background: rgba(67, 97, 238, 0.05);
}

.security-item.danger {
    border-left: 4px solid var(--danger);
}

.security-item-header {
    flex: 1;
}

.security-item-header h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.security-item-header p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.security-section-divider {
    height: 1px;
    background: var(--border-color);
    margin: 25px 0;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

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

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}

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

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(247, 37, 133, 0.3);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
    color: var(--text-primary);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-form {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.modal-actions button {
    flex: 1;
}

/* Dark Mode Support */
body.dark-mode .profile-modal-content {
    background: var(--bg-secondary);
}

body.dark-mode .profile-modal-header {
    border-bottom-color: var(--border-color);
}

body.dark-mode .profile-tabs {
    border-bottom-color: var(--border-color);
}

body.dark-mode .profile-avatar-display {
    background: var(--bg-primary);
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

/* Responsiveness */
@media (max-width: 768px) {
    .profile-modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 20px 20px 0 0;
    }

    .profile-tabs {
        overflow-x: auto;
    }

    .profile-tab-btn {
        min-width: 120px;
    }

    .profile-avatar-display {
        flex-direction: column;
        text-align: center;
    }

    .color-picker {
        grid-template-columns: repeat(3, 1fr);
    }

    .security-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .preference-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .toggle-switch {
        margin-top: 10px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}
