/* www/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #bef227;
    --primary-hover: #a8d620;
    --dark-bg: #2b2b2b;
    --secondary-color: #444444;
    /* Eliminado rosa/roxo em conformidade com o Purple Ban */
    --background-color: #f7f9f8;
    --card-background: #ffffff;
    --text-color: #2b2b2b;
    --text-muted: #8c8c8c;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --border-radius: 24px;
    --border-radius-sm: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --gradient-lime: linear-gradient(180deg, #e8f5c8 0%, #d4edb0 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-logo {
    margin-bottom: 40px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background-color: var(--secondary-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-item {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8c8c8c;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s ease;
    background-color: transparent;
}

.nav-item:hover {
    background-color: #e8e8e8;
    color: var(--dark-bg);
}

.nav-item.active {
    background-color: var(--dark-bg);
    color: white;
}

/* ========== MAIN WRAPPER ========== */
.main-wrapper {
    flex: 1;
    margin-left: 80px;
    padding: 30px 40px;
    max-width: calc(100% - 80px);
    overflow-x: hidden;
    /* Prevent edge overflow */
}

/* ========== HEADER ========== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.header-title h1 span {
    font-weight: 500;
    color: var(--text-muted);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tabs {
    display: flex;
    background-color: #f0f2f1;
    border-radius: 12px;
    padding: 4px;
}

.tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--text-color);
}

.tab.active {
    background-color: var(--card-background);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-add {
    width: 44px;
    height: 44px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 12px;
    color: var(--dark-bg);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-add:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(190, 242, 39, 0.3);
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background-color: var(--dark-bg);
    color: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.month-selector {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 15px;
    width: 220px;
    z-index: 1000;
    display: none;
    /* Controlled by JS */
    color: var(--text-color);
}

.month-selector.active {
    display: block;
}

.month-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.month-selector-header button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.month-selector-header button:hover {
    color: var(--primary-color);
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.month-item {
    padding: 8px;
    text-align: center;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.month-item:hover {
    background-color: #f5f5f5;
}

.month-item.active {
    background-color: var(--primary-color);
    color: var(--dark-bg);
}

.date-filter i {
    font-size: 12px;
}

/* ========== DASHBOARD CONTENT ========== */
.dashboard-content {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 25px;
    margin-bottom: 30px;
    width: 100%;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

/* ========== CHART SECTION ========== */
.chart-section {
    background: var(--gradient-lime);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 4px solid white;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-header h3 {
    margin-bottom: 0 !important;
}

.meta-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.4);
    padding: 6px 12px;
    border-radius: 12px;
}

.meta-input-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-color);
}

.meta-input-group input {
    width: 90px;
    background: transparent;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-color);
    outline: none;
}

.meta-input-group button {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: transform 0.2s;
}

.meta-input-group button:hover {
    transform: scale(1.1);
}

.chart-container {
    flex: 1;
    width: 100%;
    min-height: 180px;
    /* Garantir um mínimo para não sumir */
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    gap: 12px;
}

.bar {
    flex: 1;
    background-color: var(--primary-color);
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 10px;
    transition: all 0.3s ease;
    min-height: 40px;
    position: relative;
}

.bar span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    position: absolute;
    bottom: -25px;
}

.bar.active {
    background-color: #9bc91f;
}

/* ========== SUMMARY SECTION ========== */
.summary-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents CSS Grid blowout from scrollable children */
}

.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.summary-card {
    background-color: var(--card-background);
    padding: 20px 24px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow);
}

.summary-card .card-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.summary-card .card-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 4px;
}

.summary-card .card-sub {
    font-size: 11px;
    color: #b0b0b0;
}

.summary-card.highlight .card-amount {
    color: var(--success-color);
}

.summary-card.negative .card-amount {
    color: #ff3399;
}

.summary-card.negative .card-amount {
    color: #ff3399;
}

.distribution-legend {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-color);
}

.legend-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-value {
    font-weight: 700;
}

/* ========== TABLE SECTION ========== */
.table-section {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    margin-bottom: 0;
}

.btn-add-small {
    padding: 10px 16px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-add-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(190, 242, 39, 0.3);
}

.table-wrapper {
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
    padding: 16px 12px;
    text-align: left;
    font-size: 14px;
}

.transactions-table th {
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid #f0f2f1;
    white-space: nowrap;
}

.transactions-table td {
    border-bottom: 1px solid #f7f9f8;
    color: var(--text-color);
}

.transactions-table tbody tr:last-child td {
    border-bottom: none;
}

.transactions-table tbody tr:hover {
    background-color: #fafbfa;
}

.btn-delete {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background-color: #fff1f0;
    color: var(--danger-color);
}

/* Empty State */
.empty-state td {
    padding: 60px 20px;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
}

.empty-message i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-message p {
    margin-bottom: 20px;
}

.btn-add-first {
    padding: 12px 24px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-first:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(190, 242, 39, 0.3);
}

/* Category Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.badge-purple {
    background-color: #f3e8ff;
    color: #9333ea;
}

.badge-pink {
    background-color: #fce7f3;
    color: #db2777;
}

.badge-yellow {
    background-color: #fef9c3;
    color: #ca8a04;
}

.badge-orange {
    background-color: #ffedd5;
    color: #ea580c;
}

.badge-green {
    background-color: #dcfce7;
    color: #16a34a;
}

.badge-blue {
    background-color: #dbeafe;
    color: #2563eb;
}

.badge-red {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge-cyan {
    background-color: #cffafe;
    color: #0891b2;
}

.badge-indigo {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.badge-gray {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f0f2f1;
    color: var(--text-color);
}

.form-row {
    margin-bottom: 20px;
}

.form-row.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background-color: #f7f9f8;
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background-color: white;
    border-color: var(--primary-color);
}

.valor-parcela-display {
    padding: 14px 16px;
    background-color: #e8f5c8;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    background-color: #f0f2f1;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background-color: #e8e8e8;
}

.btn-save {
    flex: 1;
    padding: 14px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(190, 242, 39, 0.3);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .summary-section {
        order: -1;
    }

    .summary-cards {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .summary-card {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .main-wrapper {
        margin-left: 60px;
        padding: 20px;
        max-width: calc(100% - 60px);
    }

    .nav-item,
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .header-title h1 {
        font-size: 22px;
    }

    .tabs {
        display: flex;
        overflow-x: auto;
    }

    .tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .form-row.two-cols {
        grid-template-columns: 1fr;
    }
}

/* ========== STATUS BADGES ========== */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.status-pago {
    background-color: #dcfce7;
    color: #16a34a;
}

.status-apagar {
    background-color: #fef9c3;
    color: #ca8a04;
}

.status-atraso {
    background-color: #fee2e2;
    color: #dc2626;
}

/* ========== CARTÕES LIST ========== */
.cartoes-list {
    max-height: 240px;
    overflow-y: auto;
}

.cartao-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: #fafbfa;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.cartao-item:hover {
    background: #f0f2f1;
}

.cartao-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
}

.cartao-info i {
    font-size: 18px;
}

.text-muted {
    color: #b0b0b0;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* ========== TABLE ACTIONS ========== */
.actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-edit {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.btn-edit:hover {
    color: #3b82f6;
    background: #eff6ff;
}

/* ========== HEADER LEFT ========== */
/* ========== HEADER LEFT ========== */
.header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    min-width: 0;
}

/* ========== PERSON SWITCHER ========== */
.person-switcher-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.person-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.no-pessoas {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.person-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.person-avatar img,
.person-avatar .avatar-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    transition: all 0.25s ease;
    background-color: #e8e8e8;
}

.person-avatar .avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
}

.person-avatar.active img,
.person-avatar.active .avatar-initials {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(190, 242, 39, 0.3);
}

.person-avatar:hover img,
.person-avatar:hover .avatar-initials {
    transform: scale(1.08);
}

.person-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.person-avatar.active .person-label {
    color: var(--text-color);
    font-weight: 700;
}

.person-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger-color);
    color: white;
    border: 2px solid white;
    font-size: 8px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.person-avatar:hover .person-remove {
    display: flex;
}

.btn-add-pessoa {
    width: 44px;
    height: 44px;
    margin-bottom: 19px;
    border-radius: 50%;
    background: var(--dark-bg);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-add-pessoa:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========== LOGOUT BUTTON ========== */
.btn-logout {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.btn-logout:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

/* ========== PHOTO UPLOAD ZONE ========== */
.photo-upload-zone {
    width: 100%;
    height: 200px;
    background: #f0f2f1;
    border-radius: 16px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}

.photo-upload-zone:hover {
    background: #e8e8e8;
}

.photo-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
}

.photo-preview i {
    font-size: 28px;
}

.photo-preview span {
    font-size: 14px;
    font-weight: 500;
}

/* ========== RESPONSIVE: PERSON SWITCHER ========== */
@media (max-width: 768px) {

    .person-avatar img,
    .person-avatar .avatar-initials {
        width: 40px;
        height: 40px;
    }

    .btn-add-pessoa {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .person-label {
        font-size: 10px;
    }
}

.table-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ========== TOGGLE SWITCH ========== */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary-color, #bef227);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.recorrente-fields {
    margin-top: 4px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* ========== BADGES & STATUS ========== */
.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-status.pago {
    background: rgba(138, 204, 43, 0.15);
    color: #6a9c21;
}

.badge-status.a_pagar {
    background: rgba(232, 232, 232, 0.5);
    color: #888;
}

.badge-status.em_atraso {
    background: rgba(255, 51, 153, 0.1);
    color: #ff3399;
}

.badge-status.mensal {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark-bg);
}

.badge-status.unica {
    background: rgba(138, 204, 43, 0.1);
    color: var(--text-color);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f0f2f1;
    color: var(--text-muted);
}

/* Base Mobile Elements (Hidden by default, shown in media queries) */
.btn-hamburger {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #f0f2f1;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.mobile-avatar {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    padding: 2px;
    overflow: hidden;
    cursor: pointer;
    background: white;
}

.mobile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-avatar .avatar-initials {
    width: 100%;
    height: 100%;
    background: #f0f2f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-color);
    border-radius: 50%;
}

/* Hide Mobile Quick Actions by default */
.mobile-quick-actions {
    display: none;
}

/* ========== GLOBAL RESPONSIVENESS ========== */
@media (max-width: 1024px) {
    .main-wrapper {
        padding: 20px 25px;
    }
}

@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0;
        padding: 15px;
        max-width: 100%;
    }

    .sidebar {
        display: none;
    }

    /* Header Mobile Adjustments */
    .dashboard-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        margin-bottom: 20px;
        gap: 10px;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
    }

    .btn-hamburger {
        display: flex;
    }

    .header-title h1 {
        font-size: 18px;
        white-space: nowrap;
    }

    .header-title h1 span {
        display: inline;
        /* Garantir que o nome do usuário apareça */
    }

    .mobile-avatar {
        display: flex;
    }

    .header-right-desktop,
    .btn-logout-desktop {
        display: none;
    }

    .header-controls {
        display: none;
        /* Hide tabs/date filter from header on mobile, move to drawer or below? */
    }

    .summary-cards {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 15px;
        /* Alinhamento do snap */
        gap: 12px;
        padding: 10px 15px 25px 15px !important;
        /* Alinhado com o site (15px) */
        margin: 0 -15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .summary-cards::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .summary-card {
        flex: 0 0 55% !important;
        /* Largura reduzida para caber quase 2 cards */
        scroll-snap-align: start;
        margin-bottom: 0 !important;
        padding: 12px 16px !important;
        min-width: auto !important;
        /* Remove restrição de largura mínima */
    }

    .summary-card:first-child {
        display: none !important;
    }

    .summary-section h3 {
        margin-bottom: 5px;
    }

    .mobile-quick-actions {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 25px;
        padding-top: 10px;
    }

    .desktop-only-title {
        display: none !important;
    }

    .mqa-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mqa-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-muted);
    }

    .mqa-select-wrapper {
        position: relative;
        background: #f0f2f1;
        border-radius: 12px;
        padding: 6px 14px;
        display: flex;
        align-items: center;
    }

    .mqa-select {
        appearance: none;
        -webkit-appearance: none;
        background: transparent;
        border: none;
        font-family: 'Outfit', sans-serif;
        font-size: 13px;
        font-weight: 700;
        color: var(--text-color);
        padding-right: 20px;
        outline: none;
    }

    .mqa-select-wrapper i {
        position: absolute;
        right: 12px;
        font-size: 10px;
        color: var(--text-muted);
        pointer-events: none;
    }

    .mqa-amount-container {
        text-align: center;
        padding: 5px 0;
    }

    #mqa-main-amount {
        font-size: 42px;
        font-weight: 800;
        letter-spacing: -1px;
        color: var(--text-color);
        line-height: 1.1;
    }

    #mqa-main-subtitle {
        font-size: 13px;
        color: var(--text-muted);
        margin-top: 4px;
        font-weight: 500;
    }

    .mqa-actions-row {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 5px;
    }

    .mqa-action-btn {
        background: transparent;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }

    .mqa-icon-wrapper {
        width: 54px;
        height: 54px;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        transition: transform 0.2s;
    }

    .mqa-action-btn:active .mqa-icon-wrapper {
        transform: scale(0.95);
    }

    .mqa-icon-wrapper.success {
        background: rgba(46, 204, 113, 0.1);
        color: var(--success-color);
    }

    .mqa-icon-wrapper.danger {
        background: rgba(231, 76, 60, 0.1);
        color: var(--danger-color);
    }

    .mqa-icon-wrapper.primary {
        background: #f0f2f1;
        color: var(--text-color);
    }

    .mqa-action-btn span {
        font-family: 'Outfit', sans-serif;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-color);
    }
}

/* ========== DRAWER (MOBILE MENU) ========== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    /* Aumentado para garantir sobreposição */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 2001;
    /* Aumentado para garantir sobreposição */
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
    /* Oculto por padrão para evitar layout quebrado */
    flex-direction: column;
    padding: 0;
}

/* Mostrar drawer apenas em mobile via media query */
@media (max-width: 768px) {
    .drawer {
        display: flex;
    }
}

.drawer.active {
    left: 0;
}

.drawer-header {
    padding: 30px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f0f2f1;
}

.drawer-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.drawer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    padding: 2px;
    overflow: hidden;
    background: white;
}

.drawer-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.drawer-avatar .avatar-initials {
    width: 100%;
    height: 100%;
    background: #f0f2f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-color);
    border-radius: 50%;
}

.drawer-user-info h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-color);
}

.drawer-logout {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.drawer-logout:hover {
    color: var(--danger-color);
}

.btn-close-drawer {
    background: #f0f2f1;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close-drawer:hover {
    background: var(--dark-bg);
    color: white;
}

.drawer-nav {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 16px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.drawer-item:hover {
    background: #f7f9f8;
}

.drawer-item.active {
    background: #f0f2f1;
    font-weight: 700;
}

.drawer-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
}

.drawer-item.active .drawer-icon-box {
    background: var(--dark-bg);
    color: white;
}

.drawer-divider {
    height: 1px;
    background: #f0f2f1;
    margin: 15px 16px;
}

/* Ocultar gráfico no mobile, conforme solicitado */
@media (max-width: 768px) {
    .chart-section {
        display: none !important;
    }
}