/* Control Cuidados - Unified Palette */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #f0f4f8;
    --bg-card: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --primary: #2b6cb0;
    --primary-hover: #2c5282;
    --expense: #c05621;
    --income: #2c7a7b;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --bg-card-gradient: #edf2f7;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

body {
    font-family: "Outfit", sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 480px;
    padding: 16px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---- Top Navigation Tab Bar (Pills) ---- */
.tab-bar {
    display: flex;
    background: #e8edf5;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
    gap: 4px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.25s ease;
    flex: 1;
    font-family: "Outfit", sans-serif;
}

.tab-btn i {
    font-size: 20px;
}

.tab-btn.active {
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-btn#tabBtnFinanzas.active {
    color: var(--primary);
}

.tab-btn#tabBtnTurnos.active {
    color: #4f46e5;
}

/* Tab Content */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.tab-content.active {
    display: flex;
}

/* ---- Header ---- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.user-info h1 {
    font-size: 22px;
    font-weight: 700;
}

.title-finanzas {
    color: var(--primary);
}

.title-turnos {
    color: #4f46e5;
}

.icon-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.25);
}

/* ---- Balance Cards ---- */
.balance-card {
    border-radius: 24px;
    padding: 22px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Finanzas Specific Balance Card */
.balance-card-finanzas {
    background: linear-gradient(145deg, #ffffff, #edf5ff);
    border-color: #dbeafe;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.08);
}

.balance-card-finanzas .balance-header {
    color: #1e40af;
}

.balance-card-finanzas .balance-header i {
    color: #2563eb;
    font-size: 20px;
}

.balance-card-finanzas h2.balance-amount {
    font-size: 28px;
    font-weight: 700;
    margin: 10px 0 4px;
    color: #1e3a8a;
    letter-spacing: -0.5px;
    display: inline-block;
    transition: all 0.3s ease;
}

.balance-status-detail {
    font-size: 12.5px;
    color: #3b82f6;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.balance-status-detail i {
    font-size: 15px;
    color: #2563eb;
}

.balance-card-finanzas .balance-details {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(219, 234, 254, 0.9);
    padding-top: 14px;
}

.balance-card-finanzas .income-summary,
.balance-card-finanzas .expense-summary {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.balance-card-finanzas .income-summary i { color: var(--income); font-size: 22px; }
.balance-card-finanzas .expense-summary i { color: var(--expense); font-size: 22px; }

.balance-card-finanzas .income-summary div,
.balance-card-finanzas .expense-summary div {
    display: flex;
    flex-direction: column;
}

.balance-card-finanzas .income-summary span,
.balance-card-finanzas .expense-summary span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-card-finanzas .income-summary strong {
    color: var(--income);
    font-size: 14.5px;
    font-weight: 700;
}

.balance-card-finanzas .expense-summary strong {
    color: var(--expense);
    font-size: 14.5px;
    font-weight: 700;
}

/* Turnos Specific Card */
.balance-card-turnos {
    background: linear-gradient(145deg, var(--bg-card), #f3e8ff);
    border-color: #e9d5ff;
    box-shadow: 0 4px 18px rgba(126, 34, 206, 0.08);
}

.balance-card-turnos .balance-header {
    color: #7e22ce;
}

.balance-card-turnos .balance-header i {
    color: #7e22ce;
    font-size: 20px;
}

.balance-card-turnos h3 {
    margin-top: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #7e22ce;
}

.balance-card-turnos p {
    font-size: 13px;
    color: #9333ea;
    margin-top: 4px;
}

/* ---- Action Buttons ---- */
.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    font-family: "Outfit", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--expense);
    color: #fff;
    box-shadow: 0 4px 15px rgba(192, 86, 33, 0.25);
}

.btn-primary:hover {
    background: #a04a1a;
    box-shadow: 0 6px 18px rgba(192, 86, 33, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--income);
    color: #fff;
    box-shadow: 0 4px 15px rgba(44, 122, 123, 0.25);
}

.btn-secondary:hover {
    background: #256b6c;
    box-shadow: 0 6px 18px rgba(44, 122, 123, 0.35);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
    background: var(--primary);
    color: #fff;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(43, 108, 176, 0.25);
    font-family: "Outfit", sans-serif;
}

.btn-full:hover {
    background: var(--primary-hover);
}

/* ---- Reminders ---- */
.reminders {
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reminders.hidden {
    display: none;
}

.reminder-card {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.reminder-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.reminder-text {
    flex: 1;
}

.reminder-text strong {
    display: block;
    font-size: 14px;
    color: #d97706;
}

.reminder-text p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-sm {
    background: #f59e0b;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    font-family: "Outfit", sans-serif;
    transition: background 0.2s;
}

.btn-sm:hover {
    background: #d97706;
}

/* ---- Transactions ---- */
.transactions-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
}

.section-header span {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.transaction-item:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

.tx-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tx-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.tx-icon.income {
    background: rgba(44, 122, 123, 0.1);
    color: var(--income);
}

.tx-icon.expense {
    background: rgba(192, 86, 33, 0.1);
    color: var(--expense);
}

.tx-details h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.tx-details p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.tx-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.btn-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.tx-amount {
    font-size: 15px;
    font-weight: 700;
}

.tx-amount.income { color: var(--income); }
.tx-amount.expense { color: var(--expense); }

.tx-person {
    font-size: 11px;
    color: var(--text-muted);
    display: inline-block;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.delete-btn {
    background: rgba(192, 86, 33, 0.07);
    color: var(--text-muted);
    border: none;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: rgba(192, 86, 33, 0.18);
    color: var(--expense);
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 14px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px dashed var(--border-color);
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 480px;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.close-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background: #e2e8f0;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-family: "Outfit", sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.12);
}

/* ---- Utilities ---- */
.text-income { color: var(--income); }
.text-expense { color: var(--expense); }

/* ---- Turnos Tab Single Action Button ---- */
.btn-turnos {
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
    flex: 1;
}

.btn-turnos:hover {
    background: #4338ca;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

/* ---- Edit Button ---- */
.edit-btn {
    background: rgba(43, 108, 176, 0.08);
    color: var(--primary);
    border: none;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.edit-btn:hover {
    background: rgba(43, 108, 176, 0.18);
    transform: scale(1.1);
}

/* ---- Google Calendar Action Button ---- */
.cal-btn {
    background: rgba(26, 115, 232, 0.1);
    color: #1a73e8;
    border: none;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cal-btn:hover {
    background: #1a73e8;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.35);
}

#calendarSettingsBtn:hover {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* ---- Mobile Responsive Fine-tuning ---- */
@media (max-width: 420px) {
    .balance-card-finanzas {
        padding: 18px 16px;
    }
    .balance-card-finanzas h2.balance-amount {
        font-size: 24px;
    }
    .balance-card-finanzas .balance-details {
        gap: 8px;
    }
    .balance-card-finanzas .income-summary,
    .balance-card-finanzas .expense-summary {
        padding: 7px 10px;
        gap: 6px;
    }
    .balance-card-finanzas .income-summary strong,
    .balance-card-finanzas .expense-summary strong {
        font-size: 13.5px;
    }
    .tx-amount {
        font-size: 14.5px;
    }
}


