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

        html, body {
            width: 100%;
            margin: 0;
            padding: 0;
            font-family: 'Lexend', system-ui, sans-serif;
        }

        body {
            background-color: #f5f5f5;
            display: flex;
            flex-direction: column;
        }

        /* Login Screen */
        .login-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #0f4550 0%, #1a6b7a 50%, #2a8fa3 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }

        .login-container.hidden {
            display: none;
        }

        .login-box {
            background-color: white;
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            width: 100%;
            max-width: 400px;
        }

        h1, h2 {
            font-family: 'Lexend', system-ui, sans-serif;
        }

        .login-box h2 {
            color: #0f4550;
            margin-bottom: 30px;
            text-align: center;
            font-size: 28px;
        }

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

        .login-form-group label {
            display: block;
            color: #555;
            margin-bottom: 8px;
            font-weight: 500;
            font-size: 14px;
        }

        .login-form-group input {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 6px;
            font-size: 16px;
            transition: border-color 0.3s;
            outline: none;
        }

        .login-form-group input:focus {
            border-color: #1a6b7a;
        }

        .login-button {
            width: 100%;
            padding: 12px;
            background: linear-gradient(135deg, #0f4550 0%, #1a6b7a 100%);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-top: 10px;
        }

        .login-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(15, 69, 80, 0.4);
        }

        .login-button:active {
            transform: translateY(0);
        }

        .app-content {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        .app-content.hidden {
            display: none;
        }

        .header {
            background-color: #0f4550;
            color: white;
            padding: 15px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .header h1 {
            font-size: 24px;
        }
        
        .balance-progress-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin: 0 20px;
            max-width: 400px;
        }
        
        .balance-label {
            font-size: 12px;
            font-weight: bold;
            margin-bottom: 6px;
            font-family: 'Lexend', system-ui, sans-serif;
            color: white;
            text-align: center;
        }
        
        .balance-progress-bar {
            width: 100%;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            height: 20px;
            overflow: hidden;
            position: relative;
            display: flex;
        }
        
        .balance-segment {
            height: 100%;
            transition: width 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .balance-segment.income-segment {
            background-color: #5a8fa3;
        }
        
        .balance-segment.expense-segment {
            background-color: #8a5a5a;
        }
        
        .balance-segment.saving-segment {
            background-color: #8a6a9a;
        }
        
        .balance-amount {
            font-size: 11px;
            font-weight: bold;
            margin-top: 4px;
            font-family: 'Lexend', system-ui, sans-serif;
            color: white;
            text-align: center;
        }

        .month-selector {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .month-selector label {
            font-weight: bold;
            font-family: 'Lexend', system-ui, sans-serif;
        }

        .month-selector select {
            padding: 8px 15px;
            font-size: 16px;
            border: none;
            border-radius: 4px;
            background-color: white;
            color: #0f4550;
            cursor: pointer;
        }
        
        .progress-bar-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin: 0 20px;
            max-width: 400px;
        }
        
        .progress-bar-label-top {
            font-size: 12px;
            font-weight: bold;
            margin-bottom: 6px;
            font-family: 'Lexend', system-ui, sans-serif;
            color: white;
            text-align: center;
        }
        
        .progress-bar-wrapper {
            width: 100%;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            height: 20px;
            overflow: hidden;
            position: relative;
        }
        
        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
            border-radius: 10px;
            transition: width 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 11px;
            font-weight: bold;
            min-width: 30px;
        }
        
        .progress-bar-label {
            position: absolute;
            width: 100%;
            height: 100%;
            font-family: 'Lexend', system-ui, sans-serif;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 11px;
            font-weight: bold;
            z-index: 1;
        }

        .container {
            flex: 1;
            padding: 32px;
        }
        
        .chart-container {
            margin-top: 40px;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            padding: 20px;
        }
        
        .chart-container h2 {
            margin-bottom: 20px;
            color: #0f4550;
            font-size: 18px;
        }
        
        .chart-wrapper {
            position: relative;
            height: 300px;
            width: 100%;
        }

        .available-balance {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            padding: 15px 20px;
            margin-bottom: 20px;
            font-family: 'Lexend', system-ui, sans-serif;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .available-label {
            font-weight: bold;
            font-size: 16px;
            color: #0f4550;
        }
        
        .available-amount {
            font-weight: bold;
            font-size: 18px;
            color: #1a6b7a;
        }

        .table-wrapper {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            overflow-x: auto;
            font-family: 'Lexend', system-ui, sans-serif;
        }
        
        .table-title {
            padding: 15px 20px;
            margin: 0;
            font-size: 18px;
            font-weight: bold;
            border-bottom: 2px solid;
            border-top-left-radius: 8px;
            border-top-right-radius: 8px;
        }
        
        /* Income Table (Azul sóbrio - baseado na paleta verde) */
        .income-table-wrapper {
            border: 2px solid #5a8fa3;
            margin-bottom: 40px;
        }
        
        .income-title {
            background-color: #3d6a7a;
            color: white;
            border-bottom: 1px solid #2d5a6a;
        }
        
        .income-table th {
            background-color: #3d6a7a;
            border: 1px solid #2d5a6a;
        }
        
        .income-table th.week-number {
            background-color: #2d5a6a;
        }
        
        .income-table th.day-of-week {
            background-color: #3d6a7a;
        }
        
        .income-table .value-input:focus {
            border-color: #5a8fa3;
        }
        
        /* Expense Table (Vermelho sóbrio - baseado na paleta verde) */
        .expense-table-wrapper {
            border: 2px solid #8a5a5a;
            margin-bottom: 40px;
        }
        
        .expense-title {
            background-color: #6a3d3d;
            color: white;
            border-bottom: 1px solid #5a2d2d;
        }
        
        .expense-table th {
            background-color: #6a3d3d;
            border: 1px solid #5a2d2d;
        }
        
        .expense-table th.week-number {
            background-color: #5a2d2d;
        }
        
        .expense-table th.day-of-week {
            background-color: #6a3d3d;
        }
        
        .expense-table .value-input:focus {
            border-color: #8a5a5a;
        }

        /* Savings Table (Roxo sóbrio - baseado na paleta verde) */
        .savings-table-wrapper {
            border: 2px solid #8a6a9a;
        }
        
        .savings-title {
            background-color: #6a4d7a;
            color: white;
            border-bottom: 1px solid #5a3d6a;
        }
        
        .savings-table th {
            background-color: #6a4d7a;
            border: 1px solid #5a3d6a;
        }
        
        .savings-table th.week-number {
            background-color: #5a3d6a;
        }
        
        .savings-table th.day-of-week {
            background-color: #6a4d7a;
        }
        
        .savings-table .value-input:focus {
            border-color: #8a6a9a;
        }
        
        .value-input {
            width: 80%;
            border: none;
            background: transparent;
            text-align: center;
            font-size: 12px;
            padding: 2px;
            outline: none;
            margin: 0 auto;
            display: block;
        }
        
        .value-input:focus {
            background-color: rgba(255, 255, 255, 0.8);
            border: 1px solid #5a8fa3;
            border-radius: 3px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: max-content;
            font-family: 'Lexend', system-ui, sans-serif;
        }

        th {
            color: white;
            padding: 8px 4px;
            text-align: center;
            font-weight: bold;
            font-family: 'Lexend', system-ui, sans-serif;
        }

        th:first-child {
            position: sticky;
            left: 0;
            z-index: 11;
            min-width: 200px;
            text-align: left;
            padding-left: 15px;
        }

        .habits-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }

        .hide-habits-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 12px;
            color: white;
            user-select: none;
        }

        .toggle-switch {
            position: relative;
            width: 40px;
            height: 20px;
            background-color: rgba(255, 255, 255, 0.3);
            border-radius: 10px;
            transition: background-color 0.3s;
        }

        .toggle-switch.active {
            background-color: #27ae60;
        }

        .toggle-slider {
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            background-color: white;
            border-radius: 50%;
            transition: transform 0.3s;
        }

        .toggle-switch.active .toggle-slider {
            transform: translateX(20px);
        }

        th.week-number {
            font-size: 11px;
            font-weight: normal;
            padding: 4px 4px;
            height: 20px;
            line-height: 1.2;
            color: white;
        }
        
        /* Cores específicas para week-number de cada tabela */
        .income-table th.week-number {
            background-color: #2d5a6a;
            border-bottom: 1px solid #3d6a7a;
        }
        
        .expense-table th.week-number {
            background-color: #5a2d2d;
            border-bottom: 1px solid #6a3d3d;
        }
        
        .savings-table th.week-number {
            background-color: #5a3d6a;
            border-bottom: 1px solid #6a4d7a;
        }
        
        /* Cores de week-start específicas por tabela */
        .income-table th.week-number.week-start {
            border-left: 2px solid #1d4a5a;
        }
        
        .income-table th.week-start,
        .income-table td.week-start {
            border-left: 2px solid #1d4a5a;
        }
        
        .income-table th.day-of-week.week-start {
            border-left: 2px solid #1d4a5a;
        }
        
        .expense-table th.week-number.week-start {
            border-left: 2px solid #4a1d2d;
        }
        
        .expense-table th.week-start,
        .expense-table td.week-start {
            border-left: 2px solid #4a1d2d;
        }
        
        .expense-table th.day-of-week.week-start {
            border-left: 2px solid #4a1d2d;
        }
        
        .savings-table th.week-number.week-start {
            border-left: 2px solid #4a2d5a;
        }
        
        .savings-table th.week-start,
        .savings-table td.week-start {
            border-left: 2px solid #4a2d5a;
        }
        
        .savings-table th.day-of-week.week-start {
            border-left: 2px solid #4a2d5a;
        }
        
        th.day-of-week {
            font-size: 10px;
            font-weight: normal;
            padding: 0px 4px;
            height: 16px;
            line-height: 1.2;
            border-top: 1px solid #ddd;
            color: white;
        }
        
        /* Cores específicas para day-of-week de cada tabela */
        .income-table th.day-of-week {
            background-color: #3d6a7a;
        }
        
        .expense-table th.day-of-week {
            background-color: #6a3d3d;
        }
        
        .savings-table th.day-of-week {
            background-color: #6a4d7a;
        }
        
        /* Borda superior do dia de hoje no header - cores específicas por tabela */
        .income-table th.day-of-week.today-column {
            border-top: 1px solid #3d6a7a;
        }

        .expense-table th.day-of-week.today-column {
            border-top: 1px solid #6a3d3d;
        }
        
        .savings-table th.day-of-week.today-column {
            border-top: 1px solid #6a4d7a;
        }

        td {
            padding: 0 4px;
            text-align: center;
            border: 1px solid #ddd;
            cursor: pointer;
            min-width: 80px;
            font-family: 'Lexend', system-ui, sans-serif;
            width: 80px;
            background-color: white;
            transition: background-color 0.2s;
        }

        td:first-child {
            position: sticky;
            left: 0;
            z-index: 9;
            background-color: #e0f0f5;
            font-weight: 500;
            text-align: left;
            padding: 6px 6px;
            cursor: default;
            min-width: 200px;
            width: auto;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        td.day-cell {
            position: relative;
        }

        td.day-cell:hover {
            background-color: #d4e8ed;
        }

        td.day-cell.today {
            background-color: #ffeab2 !important;
        }

        td.day-cell.completed.complete {
            background-color: #c8e6c9;
        }

        td.day-cell.completed.not-done {
            background-color: #ffcdd2;
        }

        td.day-cell.today.completed.complete {
            background-color: #aed581;
        }

        td.day-cell.today.completed.not-done {
            background-color: #ef9a9a;
        }

        td.day-cell.future {
            /* Removido cursor: not-allowed e opacity para permitir edição de dias futuros */
            background-color: #f5f5f5;
        }

        td.day-cell.future:hover {
            background-color: #e8e8e8 !important;
        }


        /* Destacar linhas do período atual */
        tr.current-period {
            background-color: #fff9c4 !important;
        }

        tr.current-period td:first-child {
            background-color: #fff9c4 !important;
        }

        /* Borda de 3px na coluna do dia de hoje - cores específicas por tabela */
        .income-table th.today-column {
            border-left: 3px solid #3d6a7a !important;
            border-right: 3px solid #3d6a7a !important;
        }
        
        .expense-table th.today-column {
            border-left: 3px solid #6a3d3d !important;
            border-right: 3px solid #6a3d3d !important;
        }
        
        .savings-table th.today-column {
            border-left: 3px solid #6a4d7a !important;
            border-right: 3px solid #6a4d7a !important;
        }

        td.today-column {
            border-left: 3px solid #f9ce5b !important;
            border-right: 3px solid #f9ce5b !important;
        }

        /* Removido ::after para não mostrar emoji */
        /* td.day-cell.completed.complete::after {
            content: '✅';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 16px;
        }

        /* Removido ::after para não mostrar emoji */
        /* td.day-cell.completed.not-done::after {
            content: '❌';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 12px;
            color: #2e7d32;
            font-weight: bold;
        } */

        /* td.day-cell.pending::after {
            content: '❔';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 16px;
            color: #666;
            font-weight: bold;
        } */

        .add-task-row {
            background-color: #f9f9f9;
        }

        .sum-row {
            background-color: #d4e8ed;
            font-weight: bold;
            font-size: 12px;
        }

        .sum-row td {
            padding: 0 4px;
            text-align: center;
            border: 1px solid #ddd;
            min-width: 80px;
            font-family: 'Lexend', system-ui, sans-serif;
            width: 80px;
            background-color: #d4e8ed;
            cursor: default;
        }

        .sum-row td:first-child {
            text-align: left;
            padding: 0 6px;
            font-size: 13px;
            color: #0f4550;
            border: none;
            min-width: 200px;
        }

        .percentage-row {
            background-color: #d4e8ed;
            font-weight: bold;
            font-size: 12px;
        }

        .percentage-row td {
            padding: 8px 4px;
            text-align: center;
            border: 1px solid #ddd;
            min-width: 30px;
            width: 30px;
            height: 35px;
            background-color: #d4e8ed;
            cursor: default;
        }

        .percentage-row td:first-child {
            text-align: left;
            padding-left: 10px;
            font-size: 13px;
            color: #0f4550;
            border: none;
        }

        .task-cell-content {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
        }

        .task-name {
            flex: 1;
            cursor: pointer;
            padding: 2px 4px;
            border-radius: 3px;
            font-size: 16px;
        }

        .task-name:hover {
            background-color: #e0e0e0;
        }

        .task-period-select {
            background: transparent;
            border: none;
            outline: none;
            cursor: pointer;
            font-size: 12px;
            color: transparent;
            padding: 0;
            margin: 0;
            width: 20px;
            min-width: 20px;
            font-weight: normal;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            overflow: hidden;
            text-overflow: clip;
            transition: width 0.2s, min-width 0.2s, color 0.2s;
            position: relative;
            z-index: 1;
        }
        
        .task-period-select:hover,
        .task-period-select:focus {
            width: auto;
            min-width: 120px;
            color: #666;
        }
        
        .task-period-select:hover + .period-display,
        .task-period-select:focus + .period-display {
            display: none !important;
        }
        
        .period-display {
            font-size: 12px;
            color: #666;
            pointer-events: none;
            position: absolute;
            left: 0;
            top: 0;
            width: 20px;
            text-align: center;
            z-index: 2;
            line-height: 1.2;
            transition: font-weight 0.2s;
        }
        
        .period-display.highlight {
            font-weight: bold;
        }

        .task-period-select:hover {
            color: #333;
        }

        .task-period-select option {
            background: white;
            color: #333;
            padding: 4px;
        }

        .task-name-edit {
            flex: 1;
            padding: 4px 6px;
            border: 2px solid #2a8fa3;
            border-radius: 4px;
            font-size: inherit;
            font-family: inherit;
            font-weight: inherit;
            outline: none;
        }

        .add-task-wrapper {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
        }

        .add-task-input {
            flex: 1;
            padding: 6px 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .add-task-button {
            width: 20px;
            height: 20px;
            background-color: #27ae60;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .add-task-button:hover {
            background-color: #229954;
        }

        .delete-task {
            width: 18px;
            height: 18px;
            background-color: #e74c3c;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .delete-task:hover {
            background-color: #c0392b;
        }

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

        .modal-overlay.show {
            display: flex;
        }

        .modal-content {
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            max-width: 400px;
            width: 90%;
        }

        .completion-buttons {
            display: flex;
            gap: 15px;
            margin: 20px 0;
        }

        .completion-button {
            flex: 1;
            padding: 15px 20px;
            font-size: 16px;
            font-weight: bold;
            border: 2px solid;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .completion-button.complete {
            background-color: #27ae60;
            color: white;
            border-color: #27ae60;
        }

        .completion-button.complete:hover {
            background-color: #229954;
            border-color: #229954;
        }

        .completion-button.not-done {
            background-color: #e74c3c;
            color: white;
            border-color: #e74c3c;
        }

        .completion-button.not-done:hover {
            background-color: #c0392b;
            border-color: #c0392b;
        }

        .completion-button.selected {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        #justificationContainer label {
            display: block;
            margin-bottom: 8px;
            color: #0f4550;
            font-weight: bold;
        }

        #justificationInput {
            width: 100%;
            padding: 10px;
            border: 2px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
        }

        #justificationInput:focus {
            outline: none;
            border-color: #e67921;
        }

        .modal-content h3 {
            margin-bottom: 15px;
            color: #0f4550;
        }

        .modal-content p {
            margin-bottom: 25px;
            color: #555;
        }

        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .modal-button {
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
        }

        .modal-button.confirm {
            background-color: #e74c3c;
            color: white;
        }

        .modal-button.confirm:hover {
            background-color: #c0392b;
        }

        #saveCompletionBtn {
            background-color: #1a6b7a;
            color: white;
        }

        #saveCompletionBtn:hover {
            background-color: #0f4550;
        }

        .modal-button.cancel {
            background-color: #95a5a6;
            color: white;
        }

        .modal-button.cancel:hover {
            background-color: #7f8c8d;
        }

        /* Coluna 💎 */
        .gem-column {
            text-align: center;
            font-size: 16px;
            min-width: 32px;
        }

        /* Textarea de incentivo */
        #incentiveText {
            width: 100%;
            padding: 15px;
            border: 2px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
            min-height: 150px;
            box-sizing: border-box;
        }

        #incentiveText:focus {
            outline: none;
            border-color: #e67921;
        }

        #incentiveEmoji:focus {
            outline: none;
            border-color: #e67921;
        }

        .emoji-quick-btn {
            padding: 7px 11px;
            border: 2px solid #ddd;
            border-radius: 4px;
            background-color: white;
            cursor: pointer;
            font-size: 18px;
            transition: all 0.2s;
            flex: 0 0 calc(25% - 4px);
            max-width: calc(25% - 4px);
            box-sizing: border-box;
        }

        .emoji-quick-btn:hover {
            background-color: #f0f0f0;
            border-color: #e67921;
            transform: scale(1.1);
        }

        /* Estilos para mobile */
        @media (max-width: 768px) {
            /* Esconder seletor de mês no mobile */
            .month-selector {
                display: none !important;
            }

            /* Esconder todas as colunas exceto a do dia de hoje e a coluna 💎 */
            th:not(.today-column):not(:first-child):not(.gem-column) {
                display: none;
            }

            td:not(:first-child):not(.today-column):not(.gem-column) {
                display: none;
            }

            /* Ajustar largura da tabela no mobile */
            table {
                width: 100%;
            }

            /* Ajustar padding no mobile */
            .container {
                padding: 14px;
            }
        }
