/* =========================================
1. FUENTES Y VARIABLES
========================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --bg: #111827;
    --surface: #1f2937;
    --surface2: #263244;
    --border: #374151;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --primary: #14b8a6;
    --primary-dark: #0f766e;
    --danger: #f87171;
    --green: #34d399;
    --amber: #fbbf24;
    --radius: 18px;
}

/* =========================================
2. CONFIGURACIÓN GENERAL
========================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1,
h2,
h3 {
    font-family: Manrope, sans-serif;
    line-height: 1.2;
    margin: 0 0 10px;
}

h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
}

h2 {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.05rem;
}

p {
    margin: 0 0 12px;
}

.hidden {
    display: none !important;
}

.muted,
.small {
    color: var(--muted);
}

.small {
    font-size: .82rem;
}

/* =========================================
3. TEXTOS Y ETIQUETAS
========================================= */

.eyebrow,
.nav-label {
    font-size: .72rem;
    letter-spacing: .12em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

label {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.field {
    min-width: 0;
}

.message {
    font-size: .88rem;
    color: var(--amber);
    margin: 7px 0;
}

/* =========================================
4. BOTONES
========================================= */

.button {
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 11px 16px;
    font: 600 .95rem 'DM Sans', sans-serif;
    cursor: pointer;
    transition: transform .15s, background .15s;
}

.button:hover {
    transform: translateY(-1px);
}

.primary {
    background: var(--primary);
    color: #062d2a;
}

.primary:hover {
    background: #2dd4bf;
}

.secondary {
    background: #183b40;
    color: #a7f3e9;
    border-color: #245b60;
}

.ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.full {
    width: 100%;
}

.icon-button {
    background: transparent;
    border: 1px solid var(--border);
    color: #fca5a5;
    border-radius: 9px;
    padding: 8px 10px;
    cursor: pointer;
}

/* =========================================
5. CAMPOS Y FORMULARIOS
========================================= */

input,
select {
    width: 100%;
    background: #111827;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font: inherit;
    min-height: 44px;
}

input:focus,
select:focus,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* =========================================
6. PANELES Y TARJETAS
========================================= */

.panel,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

/* =========================================
7. INICIO DE SESIÓN Y BIENVENIDA
========================================= */

.login-screen,
.verse-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at top, #1e3a45 0, transparent 50%),
        var(--bg);
}

.login-card,
.verse-card {
    width: min(100%, 440px);
    padding: 34px;
    background: rgba(31, 41, 55, .95);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 24px 70px #0003;
}

.login-card h1 {
    margin-bottom: 8px;
}

.login-card label {
    margin-top: 18px;
}

.login-card .button {
    margin-top: 10px;
}

.login-card .small {
    margin-top: 16px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--primary);
    color: #062d2a;
    font-family: Manrope, sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 22px;
}

.verse-card {
    text-align: center;
    padding: 44px 34px;
}

.verse-card .brand-mark {
    margin: 0 auto 22px;
}

.verse-card blockquote {
    font-family: Manrope, sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    margin: 28px 0 14px;
}

.verse-reference {
    color: var(--primary);
    margin-bottom: 26px;
}

/* =========================================
8. ESTRUCTURA PRINCIPAL
========================================= */

.app-shell {
    min-height: 100vh;
}

/* =========================================
9. BARRA LATERAL
========================================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    background: #151e2c;
    border-right: 1px solid var(--border);
    padding: 25px 16px;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    font-family: Manrope, sans-serif;
    font-weight: 800;
    margin: 0 8px 40px;
}

.brand small {
    display: block;
    color: var(--muted);
    font: 400 .75rem 'DM Sans', sans-serif;
    margin-top: 3px;
}

.small-mark {
    width: 38px;
    height: 38px;
    font-size: .9rem;
    margin: 0;
    border-radius: 12px;
    flex-shrink: 0;
}

.nav-label {
    padding-left: 10px;
    color: #718096;
}

.main-nav {
    display: grid;
    gap: 7px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    border: 0;
    background: transparent;
    color: #b9c2d0;
    padding: 12px 13px;
    text-align: left;
    border-radius: 11px;
    font: 600 .92rem 'DM Sans', sans-serif;
    cursor: pointer;
}

.nav-link span {
    width: 20px;
    text-align: center;
    font-size: 1.15rem;
}

.nav-link:hover,
.nav-link.active {
    background: #173b40;
    color: #a7f3e9;
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-bottom .small {
    overflow-wrap: anywhere;
    margin: 0 0 12px 6px;
}

/* =========================================
10. CONTENIDO PRINCIPAL
========================================= */

.main-content {
    margin-left: 250px;
    padding: 30px clamp(18px, 4vw, 48px) 20px;
    max-width: 1600px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.topbar .eyebrow {
    margin-bottom: 5px;
}

.status-pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: .78rem;
    white-space: nowrap;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 6px;
}

/* =========================================
11. PANEL DE BIENVENIDA
========================================= */

.welcome-panel {
    background: linear-gradient(115deg, #153b43, #1f2937 72%);
    border: 1px solid #28545a;
    border-radius: 22px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.welcome-panel h2 {
    font-size: 1.7rem;
}

.welcome-panel p:last-child {
    color: #c5d4dc;
    margin: 0;
    max-width: 560px;
}

.welcome-icon {
    font-size: 3.3rem;
    color: var(--primary);
    padding: 0 20px;
}

/* =========================================
12. ENCABEZADOS DE SECCIÓN
========================================= */

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 28px 0 16px;
}

.section-heading p {
    margin: 0;
}

.compact-heading {
    margin-top: 28px;
}

.compact-heading h2 {
    margin: 0;
}

/* =========================================
13. ESTADÍSTICAS
========================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.stat-card p {
    font-size: .88rem;
    color: var(--muted);
    margin: 10px 0 4px;
}

.stat-card strong {
    font: 800 1.9rem Manrope, sans-serif;
    overflow-wrap: anywhere;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #173b40;
    color: #5eead4;
}

.stat-icon.amber {
    background: #46371b;
    color: var(--amber);
}

.stat-icon.green {
    background: #173d34;
    color: var(--green);
}

/* =========================================
14. FORMULARIOS EN CUADRÍCULA
========================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.span-2 {
    grid-column: span 2;
}

/* =========================================
15. LISTA DE TAREAS Y MOVIMIENTOS
========================================= */

.task-list,
.money-list {
    display: grid;
    gap: 10px;
}

.task-item,
.money-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 15px;
}

.task-check {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.task-main,
.money-main {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.task-item.done .task-title {
    text-decoration: line-through;
    color: var(--muted);
}

.task-meta,
.money-meta {
    font-size: .8rem;
    color: var(--muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* =========================================
16. PRIORIDADES
========================================= */

.priority {
    font-size: .72rem;
    border-radius: 999px;
    padding: 3px 8px;
    background: #374151;
    color: #d1d5db;
}

.priority.high {
    background: #4b3518;
    color: #fcd34d;
}

.priority.urgent {
    background: #4c2028;
    color: #fda4af;
}

/* =========================================
17. MENSAJES Y ESTADOS VACÍOS
========================================= */

.empty-state {
    text-align: center;
    padding: 28px;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: 14px;
    margin-top: 12px;
}

.notice {
    padding: 14px 16px;
    border: 1px solid #45616a;
    background: #172b36;
    color: #c7dce3;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: .92rem;
}

/* =========================================
18. ECONOMÍA
========================================= */

.money-amount {
    font-weight: 800;
    font-family: Manrope, sans-serif;
    white-space: nowrap;
}

.money-amount.income {
    color: var(--green);
}

.money-amount.expense {
    color: #fca5a5;
}

.money-kind {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}

/* =========================================
19. CONFIGURACIÓN Y PIE DE PÁGINA
========================================= */

.settings-panel {
    display: grid;
    gap: 20px;
    max-width: 680px;
}

.footer {
    text-align: center;
    color: #64748b;
    font-size: .78rem;
    margin: 45px 0 8px;
}

/* =========================================
20. ANIMACIONES
========================================= */

.page-section {
    animation: appear .2s ease;
}

@keyframes appear {
    from {
        opacity: .5;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
21. TAMAÑOS DE TEXTO
========================================= */

body.font-large {
    font-size: 18px;
}

body.font-xlarge {
    font-size: 20px;
}

body.font-large input,
body.font-large select,
body.font-xlarge input,
body.font-xlarge select {
    font-size: 1em;
}

/* =========================================
22. TABLET Y PANTALLAS MEDIANAS
========================================= */

@media (max-width: 950px) {
    .sidebar {
        width: 215px;
    }

    .main-content {
        margin-left: 215px;
        padding: 24px 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

/* =========================================
23. CELULARES
========================================= */

@media (max-width: 700px) {
    .sidebar {
        position: relative;
        width: auto;
        inset: auto;
        padding: 14px;
    }

    .brand {
        margin: 0 4px 15px;
    }

    .nav-label {
        margin-bottom: 7px;
    }

    .main-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-link {
        font-size: .82rem;
        padding: 10px 8px;
        gap: 7px;
    }

    .sidebar-bottom {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 14px;
    }

    .sidebar-bottom .small {
        flex: 1;
        margin: 0;
    }

    .sidebar-bottom .button {
        width: auto;
    }

    .main-content {
        margin: 0;
        padding: 20px 14px;
    }

    .welcome-panel {
        padding: 22px;
    }

    .welcome-icon {
        display: none;
    }

    .status-pill {
        white-space: normal;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card strong {
        font-size: 1.45rem;
    }

    .section-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .money-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .money-amount {
        margin-left: auto;
    }

    .verse-card,
    .login-card {
        padding: 28px 22px;
    }
}

/* =========================================
24. CELULARES PEQUEÑOS
========================================= */

@media (max-width: 390px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-nav {
        grid-template-columns: 1fr 1fr;
    }

    .nav-link {
        font-size: .76rem;
    }
}

/* ========================================= 25. ACCESIBILIDAD ========================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition: none !important;
    }
}