/* ───────── Mensualia · estilos base ───────── */
:root {
    --m-primario: #0f766e;
    --m-primario-osc: #115e59;
    --m-primario-claro: #ccfbf1;
    --m-acento: #f59e0b;
    --m-texto: #0f172a;
    --m-suave: #64748b;
    --m-borde: #e2e8f0;
    --m-fondo: #f8fafc;
    --m-ok: #16a34a;
    --m-alerta: #d97706;
    --m-error: #dc2626;
    --bs-primary: var(--m-primario);
    --bs-link-color: var(--m-primario);
    --bs-link-hover-color: var(--m-primario-osc);
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--m-texto);
    background: var(--m-fondo);
}

a, .btn-link { color: var(--m-primario); }

.btn-primary {
    --bs-btn-bg: var(--m-primario);
    --bs-btn-border-color: var(--m-primario);
    --bs-btn-hover-bg: var(--m-primario-osc);
    --bs-btn-hover-border-color: var(--m-primario-osc);
    --bs-btn-active-bg: var(--m-primario-osc);
    --bs-btn-disabled-bg: var(--m-primario);
    --bs-btn-disabled-border-color: var(--m-primario);
}
.btn-outline-primary {
    --bs-btn-color: var(--m-primario);
    --bs-btn-border-color: var(--m-primario);
    --bs-btn-hover-bg: var(--m-primario);
    --bs-btn-hover-border-color: var(--m-primario);
    --bs-btn-active-bg: var(--m-primario-osc);
}
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }
.btn-acento { background: var(--m-acento); border-color: var(--m-acento); color: #1f1300; font-weight: 600; }
.btn-acento:hover { background: #d97706; border-color: #d97706; color: #1f1300; }

.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, .25);
}

h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid var(--m-error); }
.validation-message { color: var(--m-error); font-size: .875rem; }

.marca { font-weight: 800; letter-spacing: -.02em; color: var(--m-primario); text-decoration: none; }
.marca-logo { display: inline-flex; align-items: center; gap: .45rem; line-height: 1; }
.marca-icono { flex-shrink: 0; }
.marca-texto { font-weight: 800; letter-spacing: -.03em; }
.marca-texto span { color: var(--m-acento); }

/* ───────── Gráfico de cobranza (paleta validada: cobrado #0d9488, por cobrar #d97706) ───────── */
:root { --g-cobrado: #0d9488; --g-pendiente: #d97706; --g-grid: #e2e8f0; }
.grafico .leyenda { display: flex; gap: 1rem; font-size: .8rem; color: var(--m-suave); }
.punto { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .35rem; vertical-align: baseline; }
.barras { display: flex; align-items: flex-end; gap: .75rem; height: 190px; padding-top: 1.4rem; border-bottom: 1px solid var(--g-grid); }
.columna { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; outline: none; }
.columna .pila { width: min(46px, 100%); display: flex; flex-direction: column; gap: 2px; }
.columna .seg { min-height: 2px; }
.columna .seg:first-child { border-radius: 4px 4px 0 0; }
.columna .seg.cobrado { background: var(--g-cobrado); }
.columna .seg.pendiente { background: var(--g-pendiente); }
.columna .mes { position: absolute; bottom: -1.5rem; font-size: .75rem; color: var(--m-suave); text-transform: capitalize; }
.columna.actual .mes { color: var(--m-texto); font-weight: 600; }
.columna .etiqueta-valor { font-size: .75rem; font-weight: 600; color: var(--m-texto); margin-bottom: .25rem; }
.columna .tooltip-g { display: none; position: absolute; bottom: calc(100% - 1rem); left: 50%; transform: translateX(-50%); z-index: 5; background: #fff; border: 1px solid var(--m-borde); border-radius: .5rem; padding: .5rem .65rem; font-size: .78rem; white-space: nowrap; box-shadow: 0 6px 18px rgba(15,23,42,.12); }
.columna:hover .tooltip-g, .columna:focus .tooltip-g { display: block; }
.columna:hover .pila, .columna:focus .pila { filter: brightness(1.08); }
.grafico details { margin-top: 1.9rem !important; }

/* ───────── Panel en móvil ───────── */
@media (max-width: 860px) {
    .app-sidebar { position: sticky; top: 0; z-index: 20; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .app-sidebar::-webkit-scrollbar { display: none; }
    .app-sidebar .nav-link { white-space: nowrap; }
    .kpi .valor { font-size: 1.35rem; }
    .barras { gap: .4rem; height: 160px; }
}

/* ───────── App (panel) ───────── */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
    width: 240px; flex-shrink: 0; background: #0b3b38; color: #d1fae5;
    display: flex; flex-direction: column; padding: 1.25rem .75rem;
}
.app-sidebar .marca { color: #fff; font-size: 1.4rem; padding: 0 .75rem 1.25rem; display: block; }
.app-sidebar .nav-link {
    color: #a7f3d0; border-radius: .5rem; padding: .55rem .75rem; display: flex; gap: .6rem; align-items: center;
    background: none; border: 0; width: 100%; text-align: left;
}
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-sidebar .nav-link.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.app-sidebar .pie { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: .75rem; font-size: .85rem; }
.app-main { flex: 1; min-width: 0; }
.app-top { background: #fff; border-bottom: 1px solid var(--m-borde); padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
.app-content { padding: 1.5rem; max-width: 1200px; }

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { width: 100%; flex-direction: row; flex-wrap: nowrap; align-items: center; padding: .5rem; gap: .25rem; }
    .app-sidebar .marca { padding: 0 .5rem; font-size: 1.15rem; flex-shrink: 0; }
    .app-sidebar .nav-link { width: auto; padding: .4rem .6rem; font-size: .9rem; }
    .app-sidebar .pie { margin: 0; border: 0; padding: 0; display: flex; flex-shrink: 0; }
    .app-sidebar .pie a.nav-link { display: none; } /* en móvil se oculta el email del usuario; queda "Cerrar sesión" */
    .app-content { padding: 1rem; }
}

.tarjeta { background: #fff; border: 1px solid var(--m-borde); border-radius: .75rem; padding: 1.25rem; }
.kpi .etiqueta { color: var(--m-suave); font-size: .85rem; font-weight: 500; }
.kpi .valor { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.kpi .sub { font-size: .8rem; color: var(--m-suave); }
.progreso { height: .5rem; background: var(--m-borde); border-radius: 1rem; overflow: hidden; }
.progreso > div { height: 100%; background: var(--m-ok); }

.tabla { width: 100%; background: #fff; border: 1px solid var(--m-borde); border-radius: .75rem; overflow-x: auto; }
.tabla .dropdown-menu { position: absolute; }
.tabla table { margin: 0; }
.tabla th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--m-suave); font-weight: 600; background: #f1f5f9; }
.tabla td, .tabla th { vertical-align: middle; padding: .65rem .85rem; }

.estado { display: inline-block; padding: .15rem .55rem; border-radius: 1rem; font-size: .78rem; font-weight: 600; }
.estado-pagado { background: #dcfce7; color: #166534; }
.estado-pendiente { background: #fef3c7; color: #92400e; }
.estado-vencido { background: #fee2e2; color: #991b1b; }

.banner-prueba { background: #fffbeb; border-bottom: 1px solid #fde68a; color: #78350f; padding: .5rem 1.5rem; font-size: .9rem; }
.banner-expirada { background: #fef2f2; border-bottom: 1px solid #fecaca; color: #7f1d1d; }

.checklist li { padding: .4rem 0; }
.checklist .hecho { color: var(--m-ok); text-decoration: line-through; }

.panel-lateral { background: #fff; border: 1px solid var(--m-borde); border-radius: .75rem; padding: 1.25rem; }

/* ───────── Landing ───────── */
.landing { background: #fff; }
.landing-nav { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--m-borde); }
.hero { padding: 5rem 0 4rem; background: radial-gradient(1200px 500px at 80% -10%, #ccfbf1 0%, transparent 60%), #fff; }
.hero h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
.hero .lead { font-size: 1.2rem; color: #334155; }
.pildora { display: inline-block; background: var(--m-primario-claro); color: var(--m-primario-osc); font-weight: 600; font-size: .85rem; padding: .3rem .8rem; border-radius: 2rem; }
.seccion { padding: 4.5rem 0; }
.seccion-gris { background: var(--m-fondo); }
.seccion h2 { font-weight: 800; letter-spacing: -.03em; }
.icono-feature { width: 44px; height: 44px; border-radius: .6rem; background: var(--m-primario-claro); color: var(--m-primario-osc); display: grid; place-items: center; font-size: 1.3rem; }
.plan { border: 1px solid var(--m-borde); border-radius: 1rem; padding: 2rem; background: #fff; height: 100%; display: flex; flex-direction: column; }
.plan.destacado { border: 2px solid var(--m-primario); box-shadow: 0 10px 30px rgba(15,118,110,.12); position: relative; }
.plan.destacado::before { content: "Más elegido"; position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); background: var(--m-primario); color: #fff; font-size: .75rem; font-weight: 700; padding: .2rem .8rem; border-radius: 1rem; }
.plan .precio { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.plan li { padding: .3rem 0; }
.plan li::before { content: "✓ "; color: var(--m-ok); font-weight: 700; }
.mock { background: #fff; border: 1px solid var(--m-borde); border-radius: 1rem; box-shadow: 0 20px 50px rgba(15,23,42,.10); padding: 1rem; }
.mock .fila { display: flex; justify-content: space-between; align-items: center; padding: .55rem .25rem; border-bottom: 1px solid #f1f5f9; font-size: .92rem; }
.burbuja { background: #dcf8c6; border-radius: .75rem .75rem .75rem 0; padding: .75rem 1rem; font-size: .9rem; max-width: 340px; box-shadow: 0 2px 6px rgba(0,0,0,.06); white-space: pre-line; }
.landing-footer { background: #0b3b38; color: #a7f3d0; padding: 2.5rem 0; }
.landing-footer a { color: #d1fae5; }

/* ───────── Auth ───────── */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.auth-top { padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid var(--m-borde); }
.auth-content { flex: 1; padding: 2rem 1rem; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1.5rem;
    color: white;
}
.blazor-error-boundary::after { content: "Ocurrió un error."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

#blazor-error-ui {
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
