/* style.css */

/* ====================================
   VARIÁVEIS CSS - TEMA CLARO E ESCURO
   ==================================== */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #fbbf24;
    --info-color: #3b82f6;

    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #111827;
    --text-secondary: #6b7280;

    --border-color: #e5e7eb;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #22c55e;
    --danger-color: #f97373;
    --warning-color: #fbbf24;
    --info-color: #38bdf8;

    --bg-primary: #020617;
    --bg-secondary: #0b1120;
    --bg-card: #0f172a;

    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;

    --border-color: #1f2937;

    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.7);
}

/* Corrigir ícone de calendário no modo escuro */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) brightness(1.2);
}

/* ====================================
   RESET E BASE
   ==================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* ====================================
   LOGIN SCREEN
   ==================================== */

#loginScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 16px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    padding: 32px 24px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 28px;
}

.logo-section h1 {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.logo-section p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    min-height: 44px;
}

.tab:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ====================================
   FORMS
   ==================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

[data-theme="dark"] .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* ====================================
   BUTTONS
   ==================================== */

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    letter-spacing: 0.3px;
    min-height: 48px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--text-secondary);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
    width: auto;
    min-height: 44px;
}

/* ====================================
   MAIN SCREEN
   ==================================== */

#mainScreen {
    display: none;
}

/* ====================================
   HEADER
   ==================================== */

header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 20px;
}

.header-logo h1 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-user {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.header-user strong {
    color: var(--text-primary);
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.icon-btn {
    padding: 10px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

/* ====================================
   NOTIFICATION
   ==================================== */

.notification {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: 400px;
    margin-left: auto;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    font-weight: 600;
    font-size: 14px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    background: var(--success-color);
    color: white;
}

.notification.error {
    background: var(--danger-color);
    color: white;
}

.notification.info {
    background: var(--info-color);
    color: white;
}

/* ====================================
   SUMMARY CARDS
   ==================================== */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card.income {
    border-left-color: var(--success-color);
}

.card.expense {
    border-left-color: var(--danger-color);
}

.card.savings {
    border-left-color: var(--primary-color);
}

.card.emergency {
    border-left-color: var(--info-color);
}

.card.investment {
    border-left-color: var(--warning-color);
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    word-break: break-word;
}

/* ====================================
   CARD SALDO REAL
   ==================================== */

.card.real-balance {
  border-left-color: #a855f7; /* roxo/violeta para diferenciar */
  position: relative;
  overflow: hidden;
}

.card.real-balance::after {
  content: "incl. futuras";
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Garantir que o valor do Saldo Real não seja sobrescrito pelo CSS geral */
.card.real-balance .card-value {
  transition: color 0.3s ease;
}

/* No mobile, ajustar grid para 2 colunas mantendo 6 cards */
@media (max-width: 480px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ====================================
   SECTIONS
   ==================================== */

.section {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

/* ====================================
   TRANSACTIONS LIST
   ==================================== */

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border-left: 4px solid;
    transition: all 0.3s ease;
    gap: 12px;
}

.transaction-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.transaction-item.income {
    border-left-color: var(--success-color);
}

.transaction-item.expense {
    border-left-color: var(--danger-color);
}

.transaction-item.emergency,
.transaction-item.reserve-in {
    border-left-color: var(--info-color);
}

.transaction-item.reserve-out {
    border-left-color: #f59e0b;
}

.transaction-item.investment,
.transaction-item.investment-in {
    border-left-color: var(--warning-color);
}

.transaction-item.investment-out {
    border-left-color: #f97316;
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-desc {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    word-break: break-word;
}

.transaction-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.transaction-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--warning-color);
    color: white;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.transaction-amount.positive {
    color: var(--success-color);
}

.transaction-amount.negative {
    color: var(--danger-color);
}

.transaction-actions {
    display: flex;
    gap: 6px;
}

.edit-btn,
.delete-btn {
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.delete-btn:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    font-weight: 500;
}

/* ====================================
   RESERVE & INVESTMENT
   ==================================== */

.reserve-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.reserve-input-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.reserve-input-group .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ====================================
   CHART
   ==================================== */

.chart-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.chart-period {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 180px;
    text-align: center;
}

.chart-view-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chart-view-toggle .btn-sm.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    min-height: 280px;
}

.chart-empty-message {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

.chart-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
}

.chart-summary-item {
    text-align: center;
}

.chart-summary-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-summary-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    word-break: break-word;
}

/* ====================================
   QUICK NOTES
   ==================================== */

#quickNotes {
    width: 100%;
    min-height: 130px;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
    resize: vertical;
    transition: all 0.3s ease;
}

#quickNotes:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ====================================
   CALCULATOR
   ==================================== */

.calculator {
    max-width: 380px;
    margin: 0 auto;
}

.calc-display {
    width: 100%;
    padding: 18px;
    font-size: 28px;
    font-weight: 700;
    text-align: right;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
}

.calc-btn:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.calc-btn:active {
    transform: scale(0.95);
}

.calc-btn.operator {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.calc-btn.operator:hover {
    background: var(--primary-dark);
}

.calc-btn.clear {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.calc-btn.clear:hover {
    background: #dc2626;
}

.calc-btn.equals {
    grid-column: span 2;
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.calc-btn.equals:hover {
    background: #16a34a;
}

/* ====================================
   MODAL
   ==================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 18px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.modal-info {
    background: var(--info-color);
    color: white;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px;
    border-top: 2px solid var(--border-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-group label {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

/* ====================================
   RESPONSIVE - TABLETS (max-width: 768px)
   ==================================== */

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }

    .header-logo h1 {
        font-size: 22px;
    }

    .header-user {
        font-size: 13px;
        flex: 1;
        text-align: center;
    }

    .header-actions {
        justify-content: flex-end;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .section {
        padding: 18px 16px;
        border-radius: 12px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .transaction-item {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px 14px;
    }

    .transaction-info {
        flex: 1 1 100%;
        margin-bottom: 8px;
    }

    .transaction-amount {
        flex: 1;
    }

    .transaction-actions {
        width: auto;
        justify-content: flex-end;
    }

    .chart-controls {
        gap: 10px;
    }

    .chart-period {
        font-size: 15px;
        min-width: 160px;
    }

    .chart-container {
        min-height: 250px;
    }

    .reserve-actions {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .login-card {
        padding: 28px 20px;
        max-width: 100%;
    }

    .logo-section h1 {
        font-size: 28px;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 16px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 18px;
    }

    .modal-header h2 {
        font-size: 18px;
    }
}

/* ====================================
   RESPONSIVE - MOBILE (max-width: 480px)
   Otimizado para Android (360px - 430px)
   ==================================== */

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 12px;
    }

    header {
        padding: 12px 0;
        margin-bottom: 16px;
    }

    .header-content {
        padding: 0 12px;
        gap: 8px;
    }

    .header-logo h1 {
        font-size: 20px;
    }

    .header-user {
        font-size: 12px;
    }

    .icon-btn {
        padding: 8px;
        font-size: 16px;
        min-width: 40px;
        min-height: 40px;
    }

    .notification {
        top: 12px;
        right: 12px;
        left: 12px;
        padding: 12px 16px;
        font-size: 13px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

    .card {
        padding: 14px;
        border-radius: 12px;
    }

    .card-title {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .card-value {
        font-size: 20px;
    }

    .section {
        padding: 16px 12px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .section-title {
        font-size: 17px;
        margin-bottom: 14px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group select {
        padding: 11px 12px;
        font-size: 14px;
        min-height: 44px;
    }

    .btn {
        padding: 12px 18px;
        font-size: 15px;
        min-height: 46px;
    }

    .btn-sm {
        padding: 9px 14px;
        font-size: 13px;
        min-height: 42px;
    }

    .transaction-item {
        padding: 12px;
        gap: 10px;
    }

    .transaction-desc {
        font-size: 13px;
        gap: 5px;
    }

    .transaction-date {
        font-size: 11px;
    }

    .transaction-amount {
        font-size: 15px;
    }

    .transaction-badge {
        font-size: 9px;
        padding: 2px 5px;
    }

    .edit-btn,
    .delete-btn {
        padding: 7px 9px;
        font-size: 15px;
        min-width: 42px;
        min-height: 42px;
    }

    .empty-state {
        padding: 40px 16px;
    }

    .empty-state-icon {
        font-size: 48px;
    }

    .empty-state p {
        font-size: 14px;
    }

    .reserve-input-group {
        gap: 8px;
    }

    .chart-controls {
        gap: 8px;
        margin-bottom: 14px;
    }

    .chart-period {
        font-size: 14px;
        min-width: 140px;
    }

    .chart-view-toggle {
        gap: 8px;
        margin-bottom: 16px;
    }

    .chart-container {
        min-height: 220px;
        margin-bottom: 16px;
    }

    .chart-empty-message {
        padding: 30px 12px;
        font-size: 14px;
    }

    .chart-summary {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding-top: 14px;
    }

    .chart-summary-label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .chart-summary-value {
        font-size: 16px;
    }

    #quickNotes {
        min-height: 120px;
        padding: 12px;
        font-size: 14px;
    }

    .calculator {
        max-width: 100%;
    }

    .calc-display {
        font-size: 24px;
        padding: 14px;
        margin-bottom: 12px;
    }

    .calc-buttons {
        gap: 8px;
    }

    .calc-btn {
        padding: 14px;
        font-size: 16px;
        min-height: 52px;
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .logo-section {
        margin-bottom: 24px;
    }

    .logo-section h1 {
        font-size: 26px;
    }

    .logo-section p {
        font-size: 13px;
    }

    .tabs {
        gap: 6px;
        margin-bottom: 20px;
    }

    .tab {
        padding: 11px 14px;
        font-size: 14px;
        min-height: 42px;
    }

    .modal-content {
        border-radius: 14px;
    }

    .modal-header {
        padding: 16px 18px;
    }

    .modal-header h2 {
        font-size: 17px;
    }

    .modal-close {
        font-size: 26px;
        width: 40px;
        height: 40px;
    }

    .modal-body {
        padding: 18px;
    }

    .modal-info {
        padding: 10px 12px;
        font-size: 12px;
        margin-bottom: 16px;
    }

    .modal-footer {
        padding: 16px 18px;
        gap: 8px;
    }

    .checkbox-group {
        margin-top: 14px;
    }

    .checkbox-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .checkbox-group label {
        font-size: 14px;
    }
}

/* ====================================
   CATEGORIAS
   ==================================== */

/* ====================================
   CATEGORIAS — MINIMALISTA
   ==================================== */

.category-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cat-filter-btn {
  padding: 5px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 30px;
  width: auto;
}

.cat-filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.cat-filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* GRID LADO A LADO */
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--border-color);
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 36px;
}

.category-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.category-item.cat-expense {
  border-left-color: var(--danger-color);
}

.category-item.cat-income {
  border-left-color: var(--success-color);
}

.category-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.category-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-type-badge {
  display: none; /* esconde no grid — borda já indica o tipo */
}

.category-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cat-default-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Botão excluir menor */
.category-item .delete-btn {
  padding: 2px 4px;
  font-size: 13px;
  min-width: 26px;
  min-height: 26px;
  border: none;
  background: transparent;
}

.category-item .delete-btn:hover {
  background: var(--danger-color);
  border-radius: 6px;
}

/* Badge de categoria nas transações */
.transaction-cat-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(99, 102, 241, 0.2);
  white-space: nowrap;
}

/* Mobile: 2 colunas */
@media (max-width: 480px) {
  .category-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  .category-item {
    padding: 5px 8px;
    min-height: 32px;
  }

  .category-name {
    font-size: 11px;
  }

  .cat-filter-btn {
    padding: 4px 11px;
    font-size: 11px;
    min-height: 28px;
  }
}