/* ==========================================================================
   views/index.css — Estilos exclusivos del Inicio (index.html)
   Prefijo de clases: hm-
   ========================================================================== */

/* ---------- Fondo superior ---------- */
.hm-hero-bg {
    height: 250px;
    overflow: hidden;
    background: radial-gradient(120% 120% at 0% 0%, #7E22CE 0%, #581C87 45%, #2E1065 100%);
    border-radius: 0 0 32px 32px;
}
.hm-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: .55;
}
.hm-orb-1 {
    width: 220px;
    height: 220px;
    right: -60px;
    top: -80px;
    background: #C084FC;
    animation: hm-float 9s ease-in-out infinite alternate;
}
.hm-orb-2 {
    width: 160px;
    height: 160px;
    left: -50px;
    bottom: -70px;
    background: #F472B6;
    opacity: .35;
    animation: hm-float 11s ease-in-out infinite alternate-reverse;
}
@keyframes hm-float {
    to { transform: translate(-20px, 25px) scale(1.08); }
}

/* ---------- Encabezado ---------- */
.hm-header {
    padding-top: 14px;
    padding-bottom: 18px;
    z-index: 5;
}
.hm-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hm-user-avatar {
    width: 46px;
    height: 46px;
    padding: 2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FCD34D, #F472B6, #A855F7);
}
.hm-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #4C1D95;
}
.hm-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.hm-greeting { color: var(--primary-300); }
.hm-user-name { color: var(--white); font-size: 17px; }

.hm-header .header-v3 .right a {
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
    transition: background .2s;
}
.hm-header .header-v3 .right a:active { background: rgba(255, 255, 255, .2); }
.hm-header .header-v3 .right a span { border-color: #581C87; top: 11px; right: 12px; }

/* ---------- Tarjetas resumen ---------- */
.hm-summary-swiper { overflow: visible; }
.hm-summary .swiper-slide { height: auto; }

.hm-card {
    height: 100%;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: linear-gradient(145deg, #A855F7 0%, #9333EA 45%, #7C3AED 100%);
    box-shadow: var(--app-shadow-lg);
}
.hm-card .top-card { margin-bottom: 16px; }
.hm-card .price { font-size: 30px; letter-spacing: -.5px; color: var(--white); }

.hm-card-dark {
    background: linear-gradient(145deg, #1E293B 0%, #121A26 100%);
    box-shadow: 0 24px 48px -20px rgba(15, 23, 42, .55);
}
.hm-card-dark .price { font-size: 26px; margin: 2px 0; }
.hm-muted { color: var(--greyscale-400); }

.hm-card-gold {
    background: linear-gradient(145deg, #F59E0B 0%, #EA580C 55%, #C2410C 100%);
    box-shadow: 0 24px 48px -20px rgba(234, 88, 12, .55);
}
.hm-card-gold .text,
.hm-card-gold .bottom-card span { color: rgba(255, 255, 255, .85); }

.hm-eye {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .16);
    color: var(--white);
    position: relative;
    z-index: 2;
}
.hm-eye .show-off { display: none; }
body.amounts-hidden .hm-eye .show-on { display: none; }
body.amounts-hidden .hm-eye .show-off { display: block; }

.hm-flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
    position: relative;
}
.hm-flow-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(6px);
    color: var(--white);
}
.hm-flow-item span.text-small { color: rgba(255, 255, 255, .75); }
.hm-flow-item p { color: var(--white); font-size: 15px; }
.hm-flow-ico {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hm-flow-ico.up { background: #DCFCE7; color: var(--c-green); }
.hm-flow-ico.down { background: #FFE4E6; color: var(--c-red); }

.hm-card .btn-my-report { position: relative; z-index: 2; }
.hm-card .btn-my-report span { color: var(--white); }

/* Anillo de presupuesto */
.hm-ring {
    position: relative;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
}
.hm-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hm-ring circle { fill: none; stroke-width: 3.4; }
.hm-ring-track { stroke: rgba(255, 255, 255, .1); }
.hm-ring-bar {
    stroke: #C084FC;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--p));
    animation: hm-ring-in 1.4s var(--app-ease) both;
}
@keyframes hm-ring-in { from { stroke-dashoffset: 100; } }
.hm-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 18px;
}

.hm-mini-bars {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}
.hm-mini-bars > div {
    display: grid;
    grid-template-columns: 70px 1fr;
    align-items: center;
    gap: 10px;
}
.hm-mini-bars span { color: var(--greyscale-300); }
.hm-mini-bars .ui-bar { background: rgba(255, 255, 255, .08); }

.hm-spark { width: 100%; height: 70px; margin: 8px 0 12px; }

/* Paginación */
.hm-dots.swiper-pagination {
    position: static;
    margin-top: 14px;
}
.hm-dots .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: var(--greyscale-300);
    opacity: 1;
    transition: all .3s var(--app-ease);
}
.hm-dots .swiper-pagination-bullet-active {
    width: 22px;
    border-radius: 999px;
    background: var(--primary);
}

/* ---------- Acciones rápidas ---------- */
.hm-actions .box-icon .icon {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    box-shadow: none;
    margin-left: auto;
    margin-right: auto;
}
.hm-actions .text { color: var(--greyscale-700); }

/* ---------- Encabezados de sección ---------- */
.page-home .heading-wg .title { font-size: 17px; }
.page-home .heading-wg a { font-size: 13px; font-weight: 600; }

/* ---------- Alertas ---------- */
.hm-alert {
    width: 172px;
    padding: 14px;
    border-radius: var(--app-radius);
    background: var(--white);
    box-shadow: var(--app-shadow);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--greyscale-100);
}
.hm-alert::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tone);
}
.hm-alert.is-danger  { --tone: var(--c-red);    --tone-bg: var(--c-red-bg); }
.hm-alert.is-warning { --tone: var(--c-orange); --tone-bg: var(--c-orange-bg); }
.hm-alert.is-info    { --tone: var(--c-blue);   --tone-bg: var(--c-blue-bg); }
.hm-alert p { color: var(--primary-base); font-size: 14px; line-height: 1.3; margin-top: 6px; }
.hm-alert .text-small { color: var(--greyscale-500); }
.hm-alert-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tone);
    background: var(--tone-bg);
}
.hm-alert-tag {
    position: absolute;
    top: 14px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--tone);
}

/* ---------- Módulos ---------- */
.hm-modules {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.hm-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 4px 12px;
    border-radius: 18px;
    background: var(--white);
    border: 1px solid var(--greyscale-100);
    transition: transform .15s var(--app-ease), box-shadow .2s;
}
.hm-module:active { transform: scale(.95); }
.hm-module-ico {
    color: var(--tone);
    background-color: var(--tone-bg);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.hm-module-name {
    font-size: 12px;
    color: var(--primary-base);
    line-height: 1.2;
}
.hm-module-meta {
    font-size: 10.5px;
    color: var(--greyscale-500);
    margin-top: 2px;
    white-space: nowrap;
}

/* ---------- Panel genérico de la vista ---------- */
.hm-panel {
    padding: 18px;
    border-radius: var(--app-radius);
    background: var(--white);
    box-shadow: var(--app-shadow);
}
.hm-panel .title { color: var(--black); font-size: 17px; }

/* Gastos */
.hm-spend-total p {
    font-size: 26px;
    color: var(--primary-base);
    letter-spacing: -.5px;
}
.hm-stack {
    display: flex;
    gap: 4px;
    height: 12px;
    margin: 12px 0 16px;
}
.hm-stack span {
    border-radius: 999px;
    background: var(--tone);
    transition: flex-grow .6s var(--app-ease);
}
.hm-legend {
    display: grid;
    gap: 12px;
}
.hm-legend li {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hm-legend .hm-legend-ico {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hm-legend .hm-legend-name { flex: 1; font-weight: 600; color: var(--primary-base); font-size: 14px; }
.hm-legend .hm-legend-pct { font-size: 12px; color: var(--greyscale-500); margin-right: 4px; }
.hm-legend .hm-legend-amt { font-weight: 600; color: var(--primary-base); font-size: 14px; }

/* ---------- Semana / Agenda ---------- */
.hm-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}
.hm-day {
    border: 0;
    padding: 10px 0;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--greyscale-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all .25s var(--app-ease);
}
.hm-day small { font-size: 11px; color: var(--greyscale-500); text-transform: capitalize; }
.hm-day strong { font-size: 16px; color: var(--primary-base); }
.hm-day i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: transparent;
}
.hm-day.has-event i { background: var(--primary); }
.hm-day.active {
    background: var(--primary-base);
    border-color: var(--primary-base);
    box-shadow: 0 8px 18px -8px rgba(18, 26, 38, .6);
}
.hm-day.active small { color: var(--greyscale-400); }
.hm-day.active strong { color: var(--white); }
.hm-day.active.has-event i { background: #FCD34D; }

.hm-events { display: grid; gap: 10px; }
.hm-event {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--greyscale-100);
    animation: app-slide-up .4s var(--app-ease) both;
}
.hm-event-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hm-event-body { flex: 1; min-width: 0; }
.hm-event-body p { color: var(--primary-base); font-size: 14px; }
.hm-event-body span { color: var(--greyscale-500); }
.hm-event-amt { font-weight: 700; color: var(--primary-base); font-size: 14px; }
.hm-empty {
    text-align: center;
    padding: 18px;
    border-radius: 16px;
    background: var(--greyscale-50);
    color: var(--greyscale-500);
    font-size: 13px;
}

/* ---------- Vehículos ---------- */
.hm-cars-swiper { overflow: visible; }
.hm-car {
    display: block;
    padding: 16px;
    border-radius: var(--app-radius);
    background: var(--white);
    box-shadow: var(--app-shadow);
    color: var(--primary-base);
}
.hm-car-ico {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hm-car-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    color: var(--greyscale-600);
}
.hm-car-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--greyscale-200);
}
.hm-car-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hm-car-grid .ico { color: var(--primary); margin-bottom: 2px; }
.hm-car-grid p { font-size: 14px; }

/* ---------- Metas ---------- */
.hm-goals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.hm-goal {
    padding: 14px;
    border-radius: var(--app-radius);
    background: var(--white);
    border: 1px solid var(--greyscale-100);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.hm-goal p { color: var(--primary-base); font-size: 14px; line-height: 1.25; margin-top: 4px; }
.hm-goal .ui-bar { margin-top: 6px; }
.hm-goal-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hm-goal-pct {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 13px;
    color: var(--primary-base);
}

/* ---------- Insight ---------- */
.hm-insight {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border-radius: var(--app-radius);
    background: linear-gradient(135deg, #F5F3FF, #FDF2F8);
    border: 1px solid #EDE9FE;
}
.hm-insight-ico {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: linear-gradient(135deg, #A855F7, #EC4899);
}
.hm-insight p { color: var(--primary-base); font-size: 14px; margin-bottom: 2px; }
.hm-insight span { color: var(--greyscale-600); }

/* ---------- Movimientos (ajustes a la plantilla) ---------- */
.page-home .wg-transaction-history .list { padding-bottom: calc(130px + var(--app-safe-bottom)); }
.page-home .box-transaction-item.style-icon .icon { border-radius: 14px; }
.page-home .box-transaction-item .price.is-in { color: var(--c-green); }
.page-home .box-transaction-item .price.is-out { color: var(--primary-base); }

/* ---------- Búsqueda ---------- */
.hm-search .modal-content { min-height: 360px; }

/* ---------- Pantallas grandes: la app se centra como móvil ---------- */
@media (min-width: 768px) {
    .hm-modules { grid-template-columns: repeat(8, 1fr); }
    .hm-alert { width: 210px; }
}

.hm-day:hover { background-color: var(--white); border-color: var(--greyscale-100); }
.hm-day.active:hover { background-color: var(--primary-base); border-color: var(--primary-base); }
