:root {
    --monia-turquesa: #5EEAD4;
    --monia-verde-cana: #A3B899;
    --monia-turquesa-oscuro: #0F4C4A;
    --monia-amarillo: #FACC15;
}

body {
    background-color: #FFFFFF;
    color: var(--monia-turquesa-oscuro);
}

/* Auth (index.php) */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(180deg, var(--monia-turquesa) 0%, var(--monia-verde-cana) 100%);
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 40px rgba(15, 76, 74, 0.15);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-logo img {
    width: 56px;
    height: 56px;
}

.auth-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--monia-turquesa-oscuro);
    margin-bottom: 24px;
}

.input-field {
    width: 100%;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    margin-bottom: 12px;
}

.input-field:focus {
    outline: none;
    border-color: var(--monia-turquesa);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}

.form-error {
    background: #FEF2F2;
    color: #B91C1C;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

.btn-primary {
    width: 100%;
    background: var(--monia-turquesa-oscuro);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.92;
}

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #FFFFFF;
    color: #1F2937;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-google:hover {
    background: #F9FAFB;
}

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

.divider-with-text {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94A3B8;
    font-size: 13px;
    margin: 20px 0;
}

.divider-with-text::before,
.divider-with-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E2E8F0;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    margin-top: 20px;
    color: #64748B;
}

.auth-switch a {
    color: var(--monia-turquesa-oscuro);
    font-weight: 600;
    text-decoration: none;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    position: relative;
}

.topbar-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--monia-turquesa-oscuro);
    font-size: 20px;
    cursor: pointer;
    text-decoration: none;
}

.topbar-icon-btn:hover {
    background: #F1F5F9;
}

.topbar-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.topbar-balance-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #EF4444;
}

.topbar-balance-amount {
    font-size: 18px;
    font-weight: 700;
    color: #EF4444;
}

/* Month selector */
.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding-bottom: 12px;
}

.month-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: #F1F5F9;
    color: var(--monia-turquesa-oscuro);
    cursor: pointer;
}

.month-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #EEF2FF;
    color: var(--monia-turquesa-oscuro);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.month-pill-day {
    background: #FFFFFF;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

/* Dropdown / popover panel (profile menu, and future selects) */
.dropdown-panel {
    position: absolute;
    top: 56px;
    left: 12px;
    z-index: 40;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    padding: 8px;
    min-width: 220px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: #1F2937;
    text-decoration: none;
}

.dropdown-item:hover {
    background: #F1F5F9;
}

.dropdown-item-danger {
    color: #DC2626;
}

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    padding: 8px 4px;
    z-index: 30;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #94A3B8;
    text-decoration: none;
    padding: 4px;
}

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

.bottom-nav-item-active {
    color: var(--monia-turquesa-oscuro);
    font-weight: 700;
}

/* Mobile-first app shell: full-width on phones, a centered phone-width column on desktop */
html {
    background: #E2E8F0;
}

body {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

.bottom-nav,
.sheet-panel {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

body.has-bottom-nav {
    padding-bottom: 84px;
}

.page-content {
    padding: 8px 16px 24px;
}

/* Sub-tabs (Cuentas | Deudas | Mis finanzas) */
.sub-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
}

.sub-tab {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #64748B;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.sub-tab-active {
    background: var(--monia-turquesa-oscuro);
    color: #FFFFFF;
}

/* Account groups */
.account-group {
    margin-bottom: 28px;
}

.account-group-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--monia-turquesa-oscuro);
    margin-bottom: 12px;
    font-size: 15px;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 16px;
}

/* Entity pill */
.entity-pill,
.entity-pill-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.entity-pill-circle {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 20px;
    position: relative;
}

.entity-pill-circle-add {
    background: #F1F5F9;
    color: #94A3B8;
    border: 2px dashed #CBD5E1;
}

.entity-pill-crown {
    position: absolute;
    top: -6px;
    right: -4px;
    background: var(--monia-amarillo);
    color: #7C2D12;
    border-radius: 999px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.entity-pill-locked {
    opacity: 0.65;
}

.entity-pill-name {
    font-size: 12px;
    color: #334155;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-pill-amount {
    font-size: 12px;
    font-weight: 700;
    color: #64748B;
}

/* Entity color palette (fixed set, picked from the icon/color sheet) */
.entity-color-teal { background-color: #2DD4BF; }
.entity-color-green { background-color: #4ADE80; }
.entity-color-lime { background-color: #A3E635; }
.entity-color-amber { background-color: #FBBF24; }
.entity-color-orange { background-color: #FB923C; }
.entity-color-red { background-color: #F87171; }
.entity-color-rose { background-color: #FB7185; }
.entity-color-pink { background-color: #F472B6; }
.entity-color-purple { background-color: #C084FC; }
.entity-color-violet { background-color: #A78BFA; }
.entity-color-indigo { background-color: #818CF8; }
.entity-color-blue { background-color: #60A5FA; }
.entity-color-sky { background-color: #38BDF8; }
.entity-color-cyan { background-color: #22D3EE; }
.entity-color-gray { background-color: #94A3B8; }
.entity-color-brown { background-color: #B08968; }

/* Bottom sheet (add/edit account, and future create/edit forms) */
.sheet-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FFFFFF;
    border-radius: 20px 20px 0 0;
    padding: 12px 20px 24px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.14);
    z-index: 50;
    max-height: 85vh;
    overflow-y: auto;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #E2E8F0;
    margin: 0 auto 16px;
}

.sheet-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--monia-turquesa-oscuro);
    margin-bottom: 16px;
}

.sheet-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    margin-bottom: 6px;
    margin-top: 12px;
}

.btn-text-danger {
    width: 100%;
    background: none;
    border: none;
    color: #DC2626;
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    cursor: pointer;
}

/* Mis finanzas */
.net-worth-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, var(--monia-turquesa) 0%, var(--monia-verde-cana) 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    color: var(--monia-turquesa-oscuro);
    font-weight: 700;
}

.net-worth-amount {
    font-size: 28px;
    margin-top: 6px;
}

.net-worth-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 4px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
}

.net-worth-row-negative {
    color: #DC2626;
}

/* Install-to-home-screen onboarding step */
.install-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 76, 74, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 60;
}

.install-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 28px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
}

.install-logo {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
}

.install-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--monia-turquesa-oscuro);
    margin-bottom: 12px;
}

.install-text {
    font-size: 14px;
    color: #475569;
    margin-bottom: 20px;
    line-height: 1.5;
}

.install-dismiss {
    width: 100%;
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 14px;
    padding: 12px;
    margin-top: 4px;
    cursor: pointer;
}
