:root {
    --color-primary: #2563eb;
    --color-success: #10b981;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #0f172a;
    --color-muted: #64748b;
    --color-border: #dbe5f1;
    --color-sidebar: #0f172a;
    --color-sidebar-soft: rgba(148, 163, 184, 0.16);
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 18px 32px rgba(15, 23, 42, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;600&display=swap');

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--color-text);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 28%),
        radial-gradient(circle at left 18%, rgba(16, 185, 129, 0.08), transparent 20%),
        var(--color-bg);
    font-family: "Space Grotesk", sans-serif;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100vh;
    padding: 28px 22px;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.14) 0%, transparent 22%),
        var(--color-sidebar);
    color: #fff;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #2563eb, #10b981);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.sidebar-brand-title,
.sidebar-brand-subtitle,
.sidebar-user-name,
.sidebar-user-role {
    margin: 0;
}

.sidebar-brand-title {
    font-size: 1.02rem;
    font-weight: 700;
}

.sidebar-brand-subtitle {
    margin-top: 4px;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.88rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    text-decoration: none;
    border-radius: 16px;
    color: rgba(226, 232, 240, 0.88);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.sidebar-link:hover {
    transform: translateX(3px);
    background: rgba(37, 99, 235, 0.12);
    color: #ffffff;
}

.sidebar-link.is-active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.28), rgba(16, 185, 129, 0.12));
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.sidebar-user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-weight: 700;
    color: var(--color-text);
    background: linear-gradient(135deg, #dbeafe, #dcfce7);
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-name {
    font-size: 0.96rem;
    font-weight: 600;
}

.sidebar-user-role {
    margin-top: 4px;
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.68);
}

.sidebar-link-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

.sidebar-link-danger:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #ffffff;
}

.content {
    padding: 24px;
}

.content-shell {
    width: min(100%, 1480px);
    margin: 0 auto;
}

.card {
    background: var(--color-surface);
    border: 1px solid rgba(219, 229, 241, 0.9);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.content h1,
.content h2,
.content h3 {
    margin-top: 0;
    color: var(--color-text);
}

.content p {
    color: #334155;
}

.content form {
    display: grid;
    gap: 12px;
}

.content label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
}

.content input,
.content select,
.content textarea,
.table-search input,
.table-filter input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 12px 14px;
    background: #ffffff;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.content input:focus,
.content select:focus,
.content textarea:focus,
.table-search input:focus,
.table-filter input:focus {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.content button,
.pagination-bar button {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.content button:hover,
.pagination-bar button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.18);
}

.action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.button-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.18);
}

.button-link-secondary {
    background: linear-gradient(135deg, #0f172a, #334155);
}

.button-link:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.is-hidden {
    display: none;
}

.content table {
    width: 100%;
    border-collapse: collapse;
}

.content thead {
    background: #eff6ff;
}

.content th,
.content td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table-shell {
    margin-top: 14px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.tabla-cuentas {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-cuentas thead th {
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #cbd5e1;
}

.tabla-cuentas tbody tr {
    transition: background-color 0.18s ease;
}

.tabla-cuentas tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

.tabla-cuentas tbody tr:hover {
    background: #eaf2ff;
}

.cuenta-nombre {
    font-weight: 600;
    color: #0f172a;
}

.monto {
    font-family: "IBM Plex Mono", monospace;
    white-space: nowrap;
}

.monto-actual {
    color: #0b7a52;
    font-weight: 600;
}

.badge-tipo {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.badge-banco {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.badge-billetera-digital {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.badge-efectivo {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.badge-otro {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.badge-ingreso {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.badge-gasto {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.tabla-transacciones {
    width: 100%;
    min-width: 880px;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-transacciones thead th {
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #cbd5e1;
}

.tabla-transacciones tbody tr {
    transition: background-color 0.18s ease;
}

.tabla-transacciones tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

.tabla-transacciones tbody tr:hover {
    background: #eaf2ff;
}

.fecha-transaccion {
    white-space: nowrap;
    font-family: "IBM Plex Mono", monospace;
    color: #334155;
}

.categoria-transaccion {
    font-weight: 600;
    color: #0f172a;
}

.descripcion-transaccion {
    color: #334155;
}

.monto-ingreso {
    color: #166534;
    font-weight: 700;
}

.monto-gasto {
    color: #b91c1c;
    font-weight: 700;
}

.tabla-presupuestos {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-presupuestos thead th {
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #cbd5e1;
}

.tabla-presupuestos tbody tr {
    transition: background-color 0.18s ease;
}

.tabla-presupuestos tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

.tabla-presupuestos tbody tr:hover {
    background: #eaf2ff;
}

.categoria-presupuesto {
    font-weight: 600;
    color: #0f172a;
}

.monto-restante {
    color: #0b7a52;
    font-weight: 700;
}

.avance-cell {
    display: grid;
    gap: 8px;
    min-width: 130px;
}

.avance-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.avance-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #10b981);
}

.avance-texto {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    font-family: "IBM Plex Mono", monospace;
}

.tabla-metas {
    width: 100%;
    min-width: 960px;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-metas thead th {
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #cbd5e1;
}

.tabla-metas tbody tr {
    transition: background-color 0.18s ease;
}

.tabla-metas tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

.tabla-metas tbody tr:hover {
    background: #eaf2ff;
}

.meta-nombre {
    font-weight: 600;
    color: #0f172a;
}

.monto-ahorrado {
    color: #0b7a52;
    font-weight: 700;
}

.meta-action-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 250px;
}

.meta-action-form input {
    padding: 10px 12px;
    border-radius: 12px;
}

.meta-action-form button {
    padding: 10px 14px;
    white-space: nowrap;
}

.tabla-deudas {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-deudas thead th {
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #cbd5e1;
}

.tabla-deudas tbody tr {
    transition: background-color 0.18s ease;
}

.tabla-deudas tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

.tabla-deudas tbody tr:hover {
    background: #eaf2ff;
}

.deuda-nombre {
    font-weight: 600;
    color: #0f172a;
}

.monto-deuda-pendiente {
    color: #b91c1c;
    font-weight: 700;
}

.badge-estado {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.badge-estado-pendiente {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.badge-estado-pagada {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.deuda-action-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 250px;
}

.deuda-action-form input {
    padding: 10px 12px;
    border-radius: 12px;
}

.deuda-action-form button {
    padding: 10px 14px;
    white-space: nowrap;
}

.deuda-pagada-label {
    font-weight: 600;
    color: #166534;
}

.tabla-reportes {
    width: 100%;
    min-width: 560px;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-reportes thead th {
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #cbd5e1;
}

.tabla-reportes tbody tr {
    transition: background-color 0.18s ease;
}

.tabla-reportes tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

.tabla-reportes tbody tr:hover {
    background: #eaf2ff;
}

.categoria-reporte {
    font-weight: 600;
    color: #0f172a;
}

.tabla-vacia {
    text-align: center;
    color: var(--color-muted);
    padding: 22px;
    font-style: italic;
}

@media (max-width: 768px) {
    .table-shell {
        border-radius: 12px;
    }

    .tabla-cuentas th,
    .tabla-cuentas td {
        padding: 12px 10px;
    }
}

.alerta {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.alerta-rojo {
    background: #fee2e2;
    color: #991b1b;
}

.alerta-amarillo {
    background: #fef3c7;
    color: #92400e;
}

.alerta-verde {
    background: #dcfce7;
    color: #166534;
}

.recomendacion-exito{
    background:#dcfce7;
    padding:12px;
    border-radius:10px;
    margin-bottom:10px;
}

.recomendacion-advertencia{
    background:#fef3c7;
    padding:12px;
    border-radius:10px;
    margin-bottom:10px;
}

.recomendacion-peligro{
    background:#fee2e2;
    padding:12px;
    border-radius:10px;
    margin-bottom:10px;
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 25px;
}

.kpi-card {
    background: white;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.kpi-card h4 {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.kpi-card p {
    font-size: 26px;
    font-weight: bold;
    margin: 10px 0 0;
    color: #111827;
}

/* Modern login screen */
body.login-page {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 12% 10%, #e8f2ff 0%, #f8fafc 52%);
    color: #0f172a;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(15px, 0.95vw, 20px);
    overflow-x: hidden;
}

.auth-layout {
    width: min(96vw, 1460px);
    max-width: 1460px;
    margin: clamp(10px, 2vw, 20px) auto;
    display: grid;
    gap: clamp(12px, 1.6vw, 18px);
}

.auth-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-logo {
    width: clamp(44px, 3vw, 62px);
    height: clamp(44px, 3vw, 62px);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.auth-name {
    margin: 0;
    font-size: clamp(34px, 3.1vw, 58px);
    font-weight: 700;
    color: #0f172a;
}

.auth-slogan {
    margin: 2px 0 0;
    font-size: clamp(20px, 2vw, 42px);
    color: #2563eb;
    font-weight: 500;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
    gap: clamp(10px, 1.1vw, 18px);
    border-radius: clamp(16px, 1.6vw, 28px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
}

.auth-left,
.auth-right {
    padding: clamp(18px, 2.1vw, 30px);
}

.auth-left {
    background: linear-gradient(160deg, #f8fbff 0%, #eef5ff 100%);
    border-right: 0;
    display: grid;
    align-content: start;
    gap: clamp(14px, 1.3vw, 20px);
}

.student-panel {
    position: relative;
    min-height: clamp(240px, 24vw, 360px);
    border-radius: clamp(14px, 1.4vw, 24px);
    background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 100%);
    border: 1px solid #bfdbfe;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.student-orbit {
    width: clamp(120px, 12vw, 170px);
    height: clamp(120px, 12vw, 170px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 35%, #ffffff 0%, #dbeafe 70%);
    box-shadow: 0 0 0 12px rgba(37, 99, 235, 0.08);
}

.student-emoji {
    font-size: clamp(52px, 4.8vw, 74px);
}

.float-chip {
    position: absolute;
    font-size: clamp(11px, 0.95vw, 16px);
    font-weight: 600;
    padding: clamp(5px, 0.6vw, 9px) clamp(8px, 0.9vw, 13px);
    border-radius: 999px;
    color: #0f172a;
    border: 1px solid #bfdbfe;
    background: #ffffff;
}

.chip-1 {
    top: 16px;
    left: 16px;
}

.chip-2 {
    top: 16px;
    right: 16px;
    border-color: #86efac;
    background: #ecfdf5;
}

.chip-3 {
    bottom: 16px;
    right: 16px;
}

.chip-4 {
    bottom: 16px;
    left: 16px;
}

.mini-report {
    position: absolute;
    right: clamp(10px, 2vw, 24px);
    top: clamp(56px, 7vw, 78px);
    width: clamp(128px, 14vw, 200px);
    border-radius: clamp(10px, 1vw, 14px);
    border: 1px solid #cbd5e1;
    background: #0f172a;
    padding: 10px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
}

.mini-report p {
    margin: 0 0 8px;
    font-size: clamp(10px, 0.8vw, 13px);
    color: #e2e8f0;
}

.mini-report span {
    display: block;
    height: 7px;
    border-radius: 999px;
    margin-bottom: 6px;
    background: linear-gradient(90deg, #2563eb, #10b981);
}

.mini-report span:last-child {
    margin-bottom: 0;
    width: 65%;
}

.auth-left h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.1;
    color: #0f172a;
}

.left-subtitle {
    margin: 0;
    font-size: clamp(18px, 1.25vw, 24px);
    line-height: 1.5;
    color: #334155;
    max-width: 28ch;
}

.benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(8px, 0.8vw, 12px);
}

.benefit-grid article {
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #ffffff;
    padding: clamp(9px, 1vw, 14px) clamp(10px, 1vw, 16px);
    font-weight: 500;
    font-size: clamp(15px, 0.95vw, 18px);
    color: #1e293b;
}

.auth-right {
    display: grid;
    align-content: center;
    gap: clamp(12px, 1.4vw, 20px);
    background: #ffffff;
}

.login-card {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    border-radius: clamp(14px, 1.4vw, 24px);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
    padding: clamp(24px, 3vw, 34px);
    text-align: center;
}

.login-card h2 {
    margin: 0;
    font-size: clamp(40px, 2.9vw, 54px);
    color: #0f172a;
}

.login-card p {
    margin: 12px 0 0;
    color: #334155;
    font-size: clamp(18px, 1vw, 21px);
    line-height: 1.55;
}

.google-btn {
    margin-top: 24px;
    height: clamp(56px, 3.8vw, 68px);
    border-radius: 14px;
    display: inline-flex;
    width: min(100%, 460px);
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: clamp(18px, 1.1vw, 22px);
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(90deg, #2563eb, #10b981);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.google-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(16, 185, 129, 0.24);
}

.security-note {
    margin-top: 14px;
    font-size: clamp(14px, 0.9vw, 17px);
    color: #64748b;
}

.right-description {
    margin: 0 auto;
    width: 100%;
    text-align: center;
    color: #334155;
    font-size: clamp(14px, 1vw, 19px);
    line-height: 1.6;
}

.auth-footer {
    text-align: center;
    font-size: clamp(13px, 0.8vw, 15px);
    color: #64748b;
    padding-bottom: 6px;
}

@media (max-width: 1200px) {
    .auth-layout {
        width: calc(100% - 16px);
        max-width: 100%;
    }

    .auth-left {
        border-bottom: 1px solid #dbe7ff;
    }

    .auth-right {
        align-content: start;
    }

    .right-description {
        text-align: left;
    }
}

@media (min-width: 1120px) {
    .auth-left {
        border-right: 1px solid #dbe7ff;
        border-bottom: 0;
    }
}

@media (max-width: 1024px) {
    .auth-layout {
        width: calc(100% - 16px);
    }

    .auth-left,
    .auth-right {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .auth-layout {
        margin: 10px auto;
        gap: 12px;
    }

    .auth-name {
        font-size: clamp(22px, 7vw, 34px);
    }

    .auth-slogan {
        font-size: clamp(14px, 5vw, 24px);
    }

    .student-panel {
        min-height: 210px;
    }

    .mini-report {
        right: 12px;
        top: 62px;
        width: 132px;
    }

    .float-chip {
        font-size: 11px;
        padding: 5px 8px;
    }

    .benefit-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 20px 16px;
    }

    .auth-footer {
        padding-bottom: 2px;
    }
}

@media (max-width: 460px) {
    .chip-3,
    .chip-4 {
        display: none;
    }

    .auth-layout {
        width: calc(100% - 12px);
    }
}

.flash {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: bold;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
    font-weight: 700;
}

.dashboard-shell {
    display: grid;
    gap: 22px;
    padding-bottom: 16px;
}

.dashboard-topbar,
.dashboard-hero,
.dashboard-card,
.kpi-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(219, 229, 241, 0.94);
    box-shadow: var(--shadow-card);
}

.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 28px 30px;
    border-radius: var(--radius-xl);
}

.dashboard-topbar h1,
.dashboard-hero-copy h2,
.section-heading h3 {
    margin: 0;
}

.dashboard-subtitle,
.hero-highlight-card p,
.smart-alert p,
.advice-item p,
.movement-main-cell p,
.goal-card p {
    margin: 0;
    color: var(--color-muted);
}

.dashboard-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-date-chip,
.dashboard-icon-btn,
.dashboard-profile-card,
.hero-chip {
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.9);
}

.dashboard-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    color: var(--color-muted);
}

.dashboard-date-chip svg,
.dashboard-icon-btn svg,
.hero-chip svg,
.kpi-icon-wrap svg,
.table-search svg,
.movement-icon svg,
.advice-item span:first-child,
.alert-icon svg {
    width: 18px;
    height: 18px;
}

.dashboard-icon-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--color-text);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.34);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.notification-dot {
    position: absolute;
    top: 11px;
    right: 11px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--color-danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.dashboard-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px 9px 9px;
    border-radius: 18px;
    min-width: 280px;
}

.dashboard-profile-card img,
.dashboard-avatar-fallback {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    object-fit: cover;
}

.dashboard-avatar-fallback {
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
}

.dashboard-profile-card strong,
.dashboard-profile-card span {
    display: block;
}

.dashboard-profile-card span {
    margin-top: 4px;
    color: var(--color-muted);
    font-size: 0.86rem;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: 1.4fr 0.85fr;
    gap: 20px;
    padding: 30px;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.06)),
        rgba(255, 255, 255, 0.94);
}

.dashboard-hero-copy {
    display: grid;
    align-content: center;
    gap: 14px;
}

.dashboard-hero-copy h2 {
    font-size: clamp(1.9rem, 2vw, 2.8rem);
    max-width: 16ch;
}

.dashboard-hero-copy p {
    margin: 0;
    max-width: 58ch;
    color: #334155;
    line-height: 1.65;
}

.hero-chip {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
}

.hero-highlight-card {
    display: grid;
    gap: 14px;
    align-content: end;
    padding: 24px;
    border-radius: 24px;
    min-height: 210px;
    color: #ffffff;
    background:
        radial-gradient(circle at top left, rgba(191, 219, 254, 0.28), transparent 32%),
        linear-gradient(145deg, #0f172a, #1e3a8a);
}

.hero-highlight-card span {
    display: block;
    color: rgba(226, 232, 240, 0.72);
}

.hero-highlight-card strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(2rem, 2vw, 2.8rem);
}

.hero-highlight-card p {
    color: rgba(226, 232, 240, 0.82);
    line-height: 1.65;
}

.dashboard-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 0;
}

.kpi-panel {
    --accent: var(--color-primary);
    --accent-soft: rgba(37, 99, 235, 0.12);
    display: grid;
    gap: 14px;
    padding: 22px;
    border-radius: 24px;
}

.accent-blue {
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.12);
}

.accent-green {
    --accent: #10b981;
    --accent-soft: rgba(16, 185, 129, 0.12);
}

.accent-rose {
    --accent: #f97316;
    --accent-soft: rgba(249, 115, 22, 0.12);
}

.accent-slate {
    --accent: #334155;
    --accent-soft: rgba(51, 65, 85, 0.12);
}

.accent-amber {
    --accent: #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.14);
}

.accent-violet {
    --accent: #7c3aed;
    --accent-soft: rgba(124, 58, 237, 0.14);
}

.kpi-panel-top,
.section-heading,
.goal-card-top,
.section-heading-split,
.table-controls,
.movement-main-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.kpi-panel-top p,
.section-heading p:first-child,
.goal-card-top span,
.table-filter span {
    margin: 0;
}

.kpi-panel-top p {
    color: var(--color-muted);
    font-size: 0.92rem;
}

.kpi-panel-top strong {
    display: block;
    margin-top: 8px;
    font-size: 1.78rem;
}

.kpi-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: var(--accent-soft);
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.kpi-trend span {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.kpi-trend small {
    color: var(--color-muted);
}

.kpi-trend-positive span {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.kpi-trend-negative span {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
}

.kpi-trend-neutral span {
    color: #475569;
    background: rgba(148, 163, 184, 0.14);
}

.sparkline {
    color: var(--accent);
    height: 42px;
}

.sparkline svg {
    width: 100%;
    height: 100%;
}

.sparkline polyline {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
    gap: 22px;
}

.dashboard-card {
    padding: 26px;
    border-radius: var(--radius-lg);
}

.chart-card canvas {
    width: 100% !important;
    height: 300px !important;
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h3 {
    font-size: 1.22rem;
}

.section-heading-split {
    flex-wrap: wrap;
}

.alert-list,
.advice-list {
    display: grid;
    gap: 12px;
}

.smart-alert,
.advice-item,
.goal-card {
    border: 1px solid rgba(219, 229, 241, 0.9);
    border-radius: 18px;
    background: #ffffff;
}

.smart-alert {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 16px;
}

.smart-alert strong,
.goal-card strong,
.movement-main-cell strong {
    display: block;
    margin-bottom: 6px;
}

.smart-alert-badge {
    width: 12px;
    min-height: 100%;
    border-radius: 999px;
    background: var(--color-primary);
}

.tone-success .smart-alert-badge {
    background: var(--color-success);
}

.tone-warning .smart-alert-badge {
    background: var(--color-warning);
}

.tone-danger .smart-alert-badge {
    background: var(--color-danger);
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.goal-card {
    padding: 18px;
}

.goal-card-top span,
.goal-card small {
    color: var(--color-muted);
}

.progress-bar {
    height: 10px;
    margin: 14px 0 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
}

.advice-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 16px;
}

.advice-item span:first-child {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.1);
}

.table-controls {
    flex-wrap: wrap;
}

.table-search,
.table-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: #ffffff;
}

.table-search {
    min-width: 320px;
    flex: 1 1 320px;
}

.table-search input,
.table-filter input {
    border: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.table-shell {
    overflow-x: auto;
}

.modern-table {
    min-width: 880px;
}

.modern-table thead {
    background: transparent;
}

.modern-table th {
    padding: 14px 0 16px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
}

.modern-table td {
    padding: 18px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.72);
    vertical-align: middle;
}

.movement-main-cell {
    justify-content: flex-start;
}

.movement-main-cell p {
    margin-top: 4px;
    font-size: 0.88rem;
}

.movement-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
}

.movement-icon-ingreso {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.movement-icon-gasto {
    color: #c2410c;
    background: rgba(249, 115, 22, 0.14);
}

.type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.type-badge-ingreso {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.type-badge-gasto {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.amount-cell {
    font-weight: 700;
}

.amount-cell-ingreso {
    color: #047857;
}

.amount-cell-gasto {
    color: #b91c1c;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 18px;
}

.pagination-bar button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.empty-state-card {
    display: grid;
    gap: 8px;
    padding: 22px;
    border-radius: 18px;
    text-align: left;
    border: 1px dashed #cbd5e1;
    color: var(--color-muted);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.32), rgba(236, 253, 245, 0.28));
}

.empty-state-inline {
    margin: 10px 0;
}

@media (max-width: 1320px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .chart-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 20px;
        gap: 20px;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .content {
        padding: 18px;
    }

    .dashboard-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .dashboard-profile-card {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .dashboard-kpis,
    .goals-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-topbar,
    .dashboard-hero,
    .dashboard-card,
    .card {
        padding: 20px;
    }

    .table-search,
    .table-filter {
        width: 100%;
    }

    .pagination-bar {
        flex-direction: column;
    }
}