/* =====================================================
   ECONOMÍA PERSONAL
   Estilos generales
   ===================================================== */

:root {
    --primary: #1f6feb;
    --primary-dark: #1557b0;
    --background: #f4f6f8;
    --surface: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --positive: #16803c;
    --negative: #c62828;
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    --radius: 14px;
}


/* =====================================================
   GENERAL
   ===================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}

button {
    font-family: inherit;
}


/* =====================================================
   CABECERA
   ===================================================== */

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
}

.header p {
    margin: 4px 0 0;
    color: var(--text-light);
    font-size: 14px;
}


/* =====================================================
   CABECERA PRINCIPAL - INDEX
   ===================================================== */

.main-header {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            #102a43 0%,
            #1769aa 65%,
            #1f6feb 100%
        );
    border-bottom: none;
    color: white;
}

/* Decoración sutil */
.main-header::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -100px;
    top: -220px;
    border-radius: 50%;
    background: rgba(242, 140, 40, 0.18);
}

.main-header::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    left: 35%;
    bottom: -180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.main-header .header-content {
    position: relative;
    z-index: 1;
    padding-top: 28px;
    padding-bottom: 28px;
}

.main-header h1 {
    color: white;
    font-size: 30px;
    font-weight: 750;
    letter-spacing: -0.4px;
}

.main-header p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    margin-top: 6px;
}

.main-header .btn-logout {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    backdrop-filter: blur(4px);
}

.main-header .btn-logout:hover {
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(255, 255, 255, 0.55);
}


/* Solo CERRAR SESIÓN */

#logoutButton {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

#logoutButton:hover {
    background: #bb2d3b;
    border-color: #bb2d3b;
}


.main-header .header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.main-header .header-logo {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 14px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}


/* =====================================================
   BOTÓN CERRAR SESIÓN
   ===================================================== */

.btn-logout {
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    padding: 9px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-logout:hover {
    background: #f3f4f6;
}


/* =====================================================
   CONTENEDOR
   ===================================================== */

.container {
    width: min(1200px, calc(100% - 40px));
    margin: 30px auto 50px;
}


/* =====================================================
   RESUMEN
   ===================================================== */

.summary {
    margin-bottom: 28px;
}

.summary-main {
    background: var(--account-bg, var(--surface));
    border-radius: var(--radius);
    padding: 30px 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--account-border, var(--border));
}

.summary-main #accountName {
    font-size: 42px;
    font-weight: 800;
}

.summary-main span {
    display: block;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 6px;
}

.summary-main strong {
    font-size: 34px;
    font-weight: 700;
}


/* =====================================================
   SECCIONES
   ===================================================== */

.money-section {
    margin-bottom: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 20px;
}


.section-title > div {
    display: flex;
    align-items: center;
    gap: 12px;
}


.section-title.simple {
    margin-bottom: 14px;
}


.section-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 11px;
    box-shadow: var(--shadow);
    font-size: 21px;
    flex-shrink: 0;
}


.section-title h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #102a43;
}


.section-title p {
    margin: 4px 0 0;
    color: var(--text-light);
    font-size: 12px;
}


.section-title > strong {
    font-size: 18px;
    font-weight: 700;
    color: #102a43;
    white-space: nowrap;
}


/* =====================================================
   TARJETAS DE CUENTAS
   ===================================================== */

.accounts-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.account-card {
    background: var(--account-bg, var(--surface));
    border: 1px solid var(--account-border, var(--border));
    border-radius: 12px;
    padding: 22px;
    box-shadow:
        0 4px 12px rgba(16, 42, 67, 0.06);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
    cursor: pointer;
}


.account-card:hover {
    transform: translateY(-3px);
    border-color: #b8c4d1;
    box-shadow:
        0 9px 22px rgba(16, 42, 67, 0.11);
}


.account-name {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    color: #102a43;
}


.account-balance {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
    color: #102a43;
    letter-spacing: -0.3px;
}


.account-balance.negative {
    color: var(--negative);
}


.account-link {
    display: inline-block;
    margin-top: 18px;
    padding-top: 2px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}


.account-card:hover .account-link {
    text-decoration: underline;
}


/* =====================================================
   ESTADO DE CARGA
   ===================================================== */

.loading {
    color: var(--text-light);
    margin: 5px 0;
}


/* =====================================================
   MOVIMIENTOS
   ===================================================== */

.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    color: var(--text-light);
}


/* =====================================================
   PIE
   ===================================================== */

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 12px;
}

/* =====================================================
   FORMULARIO DE MOVIMIENTOS
   ===================================================== */

.hidden {
    display: none;
}

.transaction-form-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.form-header {
    margin-bottom: 22px;
}

.form-header h3 {
    margin: 0 0 4px;
    font-size: 20px;
}

.form-header p {
    margin: 0;
    color: var(--text-light);
    font-size: 13px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group > label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}


/* TIPO DE MOVIMIENTO */

.transaction-type {
    display: flex;
    gap: 12px;
}

.type-option {
    cursor: pointer;
}

.type-option input {
    display: none;
}

.type-option span {
    display: block;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 14px;
}

.type-option input:checked + span {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}


/* BOTONES */

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text);
}

.btn-secondary:hover {
    background: #e5e7eb;
}


/* ERROR */

.form-error {
    min-height: 20px;
    margin-top: 5px;
    color: var(--negative);
    font-size: 13px;
}


/* =====================================================
   LISTADO DE MOVIMIENTOS
   ===================================================== */

.transaction-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-info strong {
    font-size: 14px;
}

.transaction-info span {
    color: var(--text-light);
    font-size: 12px;
}

.transaction-amount {
    white-space: nowrap;
    font-size: 15px;
}

.transaction-amount.income {
    color: var(--positive);
}

.transaction-amount.expense {
    color: var(--negative);
}

.transaction-amount.debt {
    color: #2563eb;
}

.transaction-item.debt {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.transaction-item.debt .transaction-icon {
    background: #dbeafe;
    color: #2563eb;
}

/* =====================================================
   TRANSFERENCIAS
   ===================================================== */

.transaction-amount.transfer {
    color: #2563eb;
}

.transaction-item.transfer {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.transaction-item.transfer .transaction-icon {
    background: #dbeafe;
    color: #2563eb;
}


/* =====================================================
   ACCIONES DE MOVIMIENTOS
   ===================================================== */

.transaction-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-delete-transaction {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    opacity: 0.65;
    transition: 0.2s;
}

.btn-delete-transaction:hover {
    opacity: 1;
    transform: scale(1.1);
}

.btn-edit-transaction {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    opacity: 0.65;
    transition: 0.2s;
}

.btn-edit-transaction:hover {
    opacity: 1;
    transform: scale(1.1);
}


/* =====================================================
   ACCIONES RÁPIDAS
   ===================================================== */


.quick-action {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 17px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow:
        0 7px 24px rgba(0, 0, 0, 0.09);
}

.quick-action-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 11px;
    font-size: 21px;
}

.quick-action div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.quick-action strong {
    font-size: 15px;
}

.quick-action div span {
    color: var(--text-light);
    font-size: 13px;
}

/* =====================================================
   FILA SUPERIOR DEL DASHBOARD 
   ===================================================== */

.dashboard-top-row {
    display: grid;
    grid-template-columns:
        1fr
        1fr
        1fr;
    gap: 14px;
    margin-bottom: 28px;
    align-items: stretch;
}


/* Las acciones ocupan toda la altura */

.dashboard-top-row .quick-action {
    margin: 0;
}


/* El patrimonio también ocupa toda la altura */

.dashboard-top-row .dashboard-summary {
    margin: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.dashboard-top-row .summary-main {
    height: 100%;
    box-sizing: border-box;
}




/* =====================================================
   MOVIMIENTOS
   ===================================================== */

.transaction-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin-bottom: 10px;
    border: 1px solid #dfe3e8;
    border-radius: 12px;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


/* INGRESO */

.transaction-item:has(.transaction-icon.income) {
    background: #f0faf3;
    border-color: #cfe9d6;
}


/* GASTO */

.transaction-item:has(.transaction-icon.expense) {
    background: #fff4f4;
    border-color: #f0d2d2;
}


.transaction-item:has(.transaction-icon.income):hover {
    background: #e8f7ec;
}


.transaction-item:has(.transaction-icon.expense):hover {
    background: #ffeded;
}

.transaction-item:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06);
}


/* ICONO DEL MOVIMIENTO */

.transaction-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 21px;
    font-weight: 700;
}


.transaction-icon.income {
    background: #e8f7ec;
    color: #159447;
}


.transaction-icon.expense {
    background: #fdecec;
    color: #d93030;
}


/* INFORMACIÓN */

.transaction-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.transaction-info strong {
    color: #082b4c;
    font-size: 15px;
    font-weight: 700;
}


.transaction-info span {
    color: #64748b;
    font-size: 12px;
}


.transaction-info .transaction-notes {
    color: #8a94a3;
    font-size: 12px;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* IMPORTE Y BOTONES */

.transaction-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}


.transaction-amount {
    min-width: 105px;
    text-align: right;
    font-size: 16px;
    font-weight: 700;
}


.transaction-amount.income {
    color: #159447;
}


.transaction-amount.expense {
    color: #d93030;
}


/* BOTONES */

.btn-edit-transaction,
.btn-delete-transaction {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
}


.btn-edit-transaction:hover {
    background: #fff4d6;
}


.btn-delete-transaction:hover {
    background: #fdecec;
}

/* =====================================================
   COLORES DE LOS MOVIMIENTOS
   ===================================================== */

.transaction-item.income {
    background-color: #eefaf1;
    border-color: #c9e8d0;
}

.transaction-item.expense {
    background-color: #fff1f1;
    border-color: #f1cccc;
}

/* =====================================================
   ICONOS DE LOS ÚLTIMOS MOVIMIENTOS
   ===================================================== */

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.transaction-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: bold;
}

.transaction-item.income .transaction-icon {
    background-color: #e5f7eb;
    color: #16803c;
}

.transaction-item.expense .transaction-icon {
    background-color: #fdeaea;
    color: #d62828;
}

.transaction-item .transaction-info {
    flex: 1;
}

/* =====================================================
   FILTROS DE MOVIMIENTOS
   ===================================================== */

.transaction-filters {
    display: grid;
    grid-template-columns:
        minmax(220px, 1.7fr)
        minmax(150px, 1fr)
        minmax(180px, 1.2fr)
        minmax(150px, 1fr)
        minmax(150px, 1fr)
        auto;
    gap: 12px;
    align-items: end;
    margin: 18px 0 12px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-radius: 12px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.04);
}


/* GRUPOS */

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #536273;
}


/* CAMPOS */

.filter-group input,
.filter-group select {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #d7dde3;
    border-radius: 8px;
    background: #ffffff;
    color: #102a43;
    font-family: inherit;
    font-size: 14px;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #2474e8;
    box-shadow:
        0 0 0 3px rgba(36, 116, 232, 0.10);
}


/* BOTÓN LIMPIAR */

.btn-clear-filters {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #d7dde3;
    border-radius: 8px;
    background: #f7f8fa;
    color: #536273;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}


.btn-clear-filters:hover {
    background: #eef1f4;
    border-color: #c7ced6;
}


/* =====================================================
   RESUMEN DE MOVIMIENTOS
   ===================================================== */

.transaction-summary {
    display: grid;
    grid-template-columns:
        repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}


.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid #e0e4e8;
}


.summary-item .summary-label {
    font-size: 12px;
    color: #697586;
}


.summary-item strong {
    font-size: 14px;
    color: #102a43;
}


/* INGRESOS */

.summary-item.income {
    background: #f1fbf5;
    border-color: #c8ead4;
}


.summary-item.income strong {
    color: #008a3e;
}


/* GASTOS */

.summary-item.expense {
    background: #fff3f3;
    border-color: #f3cccc;
}


.summary-item.expense strong {
    color: #dc2626;
}


/* RESULTADO POSITIVO */

.summary-item.positive {
    background: #f4f8ff;
    border-color: #d3e1f5;
}


.summary-item.positive strong {
    color: #1769aa;
}


/* RESULTADO NEGATIVO */

.summary-item.negative {
    background: #fff3f3;
    border-color: #f3cccc;
}


.summary-item.negative strong {
    color: #dc2626;
}


/* =====================================================
   MOVIMIENTOS - AJUSTE FINAL
   ===================================================== */

.transaction-item {
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.transaction-item:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06);
}

/* =====================================================
   ACCIÓN RÁPIDA - TRANSFERENCIAS
   ===================================================== */

.quick-action {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #dfe3e8;
    border-radius: 12px;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.quick-action:hover {
    transform: translateY(-1px);
    border-color: #bfc7d1;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.06);
}

.quick-action-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f1f3f5;
    border-radius: 10px;
    font-size: 22px;
}

.quick-action-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.quick-action-content strong {
    font-size: 16px;
}

.quick-action-content span {
    color: #667085;
    font-size: 13px;
}

.quick-action-arrow {
    margin-left: auto;
    font-size: 20px;
    color: #667085;
}

/* =====================================================
   PATRIMONIO TOTAL
   ===================================================== */

.summary {
    margin-top: 28px;
}

.summary-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 28px 30px;
}

.summary-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-label span {
    font-size: 14px;
    color: #667085;
}

.summary-label small {
    font-size: 12px;
    color: #98a2b3;
}

.summary-main strong {
    font-size: 32px;
    font-weight: 700;
    color: #102a43;
    white-space: nowrap;
}

/* =====================================================
   ÚLTIMOS MOVIMIENTOS - INDEX
   ===================================================== */

#transactionsList .transaction-item {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

#transactionsList .transaction-item:last-child {
    margin-bottom: 0;
}

#transactionsList .transaction-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}


/* ICONO */

#transactionsList .transaction-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
}


/* INGRESOS */

#transactionsList .transaction-item.income {
    background: #effbf3;
    border: 1px solid #c8ecd4;
}

#transactionsList .transaction-item.income
.transaction-icon {
    background: #e1f7e8;
    color: #159447;
}


/* GASTOS */

#transactionsList .transaction-item.expense {
    background: #fff1f1;
    border: 1px solid #f4cccc;
}

#transactionsList .transaction-item.debt {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

#transactionsList .transaction-item.expense
.transaction-icon {
    background: #ffe5e5;
    color: #e33434;
}

#transactionsList .transaction-item.debt .transaction-icon {
    background: #dbeafe;
    color: #2563eb;
}


/* INFORMACIÓN */

#transactionsList .transaction-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
}

#transactionsList .transaction-info strong {
    font-size: 14px;
    font-weight: 700;
}

#transactionsList .transaction-info span {
    color: var(--text-light);
    font-size: 12px;
}

#transactionsList .transaction-info em {
    color: var(--text-light);
    font-size: 12px;
    font-style: italic;
}


/* IMPORTE */

#transactionsList .transaction-actions {
    text-align: right;
    white-space: nowrap;
}

#transactionsList .transaction-income {
    color: var(--positive);
    font-size: 15px;
}

#transactionsList .transaction-expense {
    color: var(--negative);
    font-size: 15px;
}

#transactionsList .transaction-debt {
    color: #2563eb;
    font-size: 15px;
}

/* =====================================================
   AJUSTE FINAL - MOVIMIENTOS DEL INDEX
   ===================================================== */

#transactionsList .transaction-item {
    text-align: left;
}

#transactionsList .transaction-info {
    text-align: left;
    align-items: flex-start;
}

#transactionsList .transaction-info strong,
#transactionsList .transaction-info span,
#transactionsList .transaction-info em {
    text-align: left;
}


/* =====================================================
   NÚMEROS ROJOS DEL TOTAL DE LAS DEUDAS
   ===================================================== */

.section-title .debt-total {
    color: var(--negative);
}


/* =====================================================
   COLORES DE LAS CUENTAS
   ===================================================== */

/* Nombre de cuenta */
#accountName {
    font-size: 32px;
    font-weight: 700;
}


/* Coche — azul */
body[data-account="Coche"] .summary {
    background: #eff6ff;
    border-color: #bfdbfe;
}


/* Hipoteca — granate */
body[data-account="Hipoteca"] .summary {
    background: #fdf2f4;
    border-color: #e8b4bd;
}


/* Nómina — rojo */
body[data-account="Nómina"] .summary {
    background: #fff1f2;
    border-color: #fecdd3;
}


/* Efectivo — marrón */
body[data-account="Efectivo"] .summary {
    background: #faf5ef;
    border-color: #e7d5c2;
}


/* Ahorro Naranja — naranja */
body[data-account="Ahorro Naranja"] .summary {
    background: #fff7ed;
    border-color: #fed7aa;
}


/* Ahorro Verde — verde */
body[data-account="Ahorro Verde"] .summary {
    background: #f0fdf4;
    border-color: #bbf7d0;
}


/* Ahorro Hogar — dorado */
body[data-account="Ahorro Hogar"] .summary {
    background: #fffbeb;
    border-color: #fde68a;
}


/* Ahorro Coche — turquesa */
body[data-account="Ahorro Coche"] .summary {
    background: #ecfeff;
    border-color: #a5f3fc;
}


/* Emergencias — ámbar */
body[data-account="Emergencias"] .summary {
    background: #fff7ed;
    border-color: #fdba74;
}


/* Plan 1 — violeta */
body[data-account="Plan 1"] .summary {
    background: #faf5ff;
    border-color: #d8b4fe;
}


/* Plan 2 — índigo */
body[data-account="Plan 2"] .summary {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* =====================================================
   COLORES DE LA TARJETA DE CUENTA
   ===================================================== */

.summary.account-color-blue {
    background: #eff6ff !important;
    border-color: #bfdbfe;
}

.summary.account-color-burgundy {
    background: #fdf2f4 !important;
    border-color: #e8b4bd;
}

.summary.account-color-red {
    background: #fff1f2 !important;
    border-color: #fecdd3;
}

.summary.account-color-brown {
    background: #faf5ef !important;
    border-color: #e7d5c2;
}

.summary.account-color-orange {
    background: #fff7ed !important;
    border-color: #fed7aa;
}

.summary.account-color-green {
    background: #f0fdf4 !important;
    border-color: #bbf7d0;
}

.summary.account-color-gold {
    background: #fffbeb !important;
    border-color: #fde68a;
}

.summary.account-color-turquoise {
    background: #ecfeff !important;
    border-color: #a5f3fc;
}

.summary.account-color-amber {
    background: #fff7ed !important;
    border-color: #fdba74;
}

.summary.account-color-purple {
    background: #faf5ff !important;
    border-color: #d8b4fe;
}

.summary.account-color-indigo {
    background: #eef2ff !important;
    border-color: #c7d2fe;
}

.summary.account-color-default {
    background: var(--surface);
}


/* =====================================================================
   PATRIMONIO TOTAL — BANDA INFORMATIVA
   ===================================================================== */


.summary-main {
    padding: 9px 24px;
    min-height: 0;
    border-radius: 8px;
    box-shadow: none;
}

.summary-main .summary-label {
    gap: 0;
}

.summary-main .summary-label span {
    font-size: 12px;
}

.summary-main .summary-label small {
    font-size: 10px;
}

.summary-main strong {
    font-size: 25px;
}

/* =====================================================================
   FORMULARIO DE TRANSFERENCIAS — DISEÑO COMPACTO
   ===================================================================== */

#transferFormContainer {
    padding: 24px;
}

#transferFormContainer .form-header {
    margin-bottom: 18px;
}

#transferFormContainer .form-header h3 {
    margin-bottom: 4px;
}

#transferFormContainer .form-header p {
    margin: 0;
}

#transferForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

#transferForm .form-group {
    margin: 0;
}

#transferForm .form-group label {
    margin-bottom: 6px;
}

#transferForm .form-group input,
#transferForm .form-group select,
#transferForm .form-group textarea {
    padding: 10px 12px;
}

#transferForm .form-group textarea {
    min-height: 70px;
    resize: vertical;
}

/* Botones y mensajes ocupan todo el ancho */
#transferForm #transferError,
#transferForm .form-actions {
    grid-column: 1 / -1;
}

#transferForm .form-actions {
    margin-top: 2px;
}


/* =====================================================
   DASHBOARD
   ===================================================== */

.dashboard-summary {
    margin-bottom: 20px;
}


.dashboard-month {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}


.dashboard-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}


.dashboard-month-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text);
}


.dashboard-month-header p {
    margin: 5px 0 0;
    color: var(--text-light);
    font-size: 14px;
}


.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}


.dashboard-metric {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fafbfc;
}


.dashboard-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    flex-shrink: 0;
}


.dashboard-metric-label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}


.dashboard-metric strong {
    display: block;
    font-size: 20px;
    font-weight: 750;
}


.dashboard-metric.income .dashboard-metric-icon {
    background: #dcfce7;
}


.dashboard-metric.income strong {
    color: var(--positive);
}


.dashboard-metric.expense .dashboard-metric-icon {
    background: #fee2e2;
}


.dashboard-metric.expense strong {
    color: var(--negative);
}


.dashboard-metric.result .dashboard-metric-icon {
    background: #dbeafe;
}


.dashboard-metric.result strong {
    color: var(--primary);
}


.dashboard-metric.result.negative strong {
    color: var(--negative);
}


/* =====================================================
   ESTADÍSTICAS
   ===================================================== */

.statistics-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}


.statistics-section-header {
    margin-bottom: 20px;
}


.statistics-section-header > div {
    display: flex;
    align-items: center;
    gap: 12px;
}


.statistics-section-header .section-icon {
    font-size: 26px;
}


.statistics-section-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text);
}


.statistics-section-header p {
    margin: 5px 0 0;
    color: var(--text-light);
    font-size: 14px;
}


.statistics-chart {
    min-height: 280px;
    border-radius: 12px;
    background: #fafbfc;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}


.statistics-placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 40px 20px;
}


.statistics-placeholder span {
    display: block;
    font-size: 42px;
    margin-bottom: 12px;
}


.statistics-placeholder p {
    margin: 0;
    font-size: 14px;
}


/* =====================================================
   ACCIONES RÁPIDAS — DISEÑO COMPACTO
   ===================================================== */

.dashboard-top-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
    align-items: stretch;
}


/* -----------------------------------------------------
   BOTONES
   ----------------------------------------------------- */

.dashboard-top-row .quick-action {
    min-height: 92px;
    margin: 0;
    padding: 16px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}


/* -----------------------------------------------------
   ICONOS
   ----------------------------------------------------- */

.dashboard-top-row .quick-action-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-radius: 12px;
    background: #f3f4f6;
    font-size: 25px;
    line-height: 1;
}


/* -----------------------------------------------------
   TEXTO
   ----------------------------------------------------- */

.dashboard-top-row .quick-action-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}


/* -----------------------------------------------------
   EFECTO AL PASAR EL RATÓN
   ----------------------------------------------------- */

.dashboard-top-row .quick-action:hover {
    transform: translateY(-2px);
    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.09);
    border-color: #cbd5e1;
}


.dashboard-top-row .quick-action:active {
    transform: translateY(0);
}


/* -----------------------------------------------------
   COLORES DE CADA ACCIÓN
   ----------------------------------------------------- */

.dashboard-top-row .quick-action-income {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.dashboard-top-row .quick-action-income .quick-action-icon {
    background: #dcfce7;
}


.dashboard-top-row .quick-action-expense {
    border-color: #fecaca;
    background: #fef2f2;
}

.dashboard-top-row .quick-action-expense .quick-action-icon {
    background: #fee2e2;
}


.dashboard-top-row .quick-action:nth-child(3) {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.dashboard-top-row .quick-action:nth-child(3) .quick-action-icon {
    background: #dbeafe;
}


.dashboard-top-row .quick-action:nth-child(4) {
    border-color: #ddd6fe;
    background: #f5f3ff;
}

.dashboard-top-row .quick-action:nth-child(4) .quick-action-icon {
    background: #ede9fe;
}

/* =====================================================
   ICONOS PROPIOS — ACCIONES RÁPIDAS
   ===================================================== */

.dashboard-top-row .quick-action-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-top-row .quick-action-icon img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
}

/* =====================================================
   FORMULARIO RÁPIDO DE INGRESOS / GASTOS
   ===================================================== */

.quick-transaction-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.quick-transaction-modal.hidden {
    display: none;
}

.quick-transaction-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.quick-transaction-dialog {
    position: relative;
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: 20px auto;
    background: var(--surface);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

/* CABECERA */

.quick-transaction-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-dark)
    );
    color: white;
    border-radius: 18px 18px 0 0;
}

.quick-transaction-header > div {
    display: flex;
    align-items: center;
    gap: 14px;
}

.quick-transaction-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 24px;
}

.quick-transaction-header h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.2;
}

.quick-transaction-header p {
    margin: 5px 0 0;
    font-size: 13px;
    opacity: 0.88;
}

.quick-transaction-close {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: white;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.quick-transaction-close:hover {
    background: rgba(255, 255, 255, 0.25);
}


/* CUERPO DEL FORMULARIO */

#quickTransactionForm {
    padding: 24px;
}

.quick-transaction-field {
    margin-bottom: 18px;
}

.quick-transaction-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.quick-transaction-field input,
.quick-transaction-field select,
.quick-transaction-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.quick-transaction-field textarea {
    resize: vertical;
    min-height: 80px;
}

.quick-transaction-field input:focus,
.quick-transaction-field select:focus,
.quick-transaction-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}


/* DOS COLUMNAS */

.quick-transaction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}


/* ERROR */

.quick-transaction-error {
    min-height: 20px;
    margin: -4px 0 10px;
    color: var(--negative);
    font-size: 13px;
}


/* BOTONES */

.quick-transaction-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.quick-transaction-actions button {
    min-width: 120px;
}

/* =========================================
   PATRIMONIO NETO ACTUAL
   ========================================= */

.statistics-patrimony {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.statistics-patrimony .statistics-section-header {
    margin-bottom: 0;
}

.statistics-patrimony-value {
    flex-shrink: 0;
    text-align: right;
}

.statistics-patrimony-value strong {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

/* =========================================
   FILTROS DE MOVIMIENTOS PLEGABLES EN MÓVIL
   ========================================= */

.transaction-filters-wrapper {
    width: 100%;
}

.toggle-transaction-filters {
    display: none;
}

/* =====================================================
   GRÁFICO DE GASTOS POR CATEGORÍA
   ===================================================== */

.statistics-category-chart {
    min-height: 220px;
    overflow: hidden;
}


/* =====================================================
   FORMULARIO DE CATEGORÍAS
   ===================================================== */

.category-form-container {
    margin-top: 30px;
    margin-bottom: 40px;
}

.category-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    max-width: 700px;
}

.category-form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.category-form-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
}

.category-form-header p {
    margin: 6px 0 0;
    color: var(--text-light);
    font-size: 14px;
}


.category-form-header .btn-secondary {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
}


.category-form-card .form-group {
    margin-bottom: 18px;
}

.category-form-card label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--text);
}


.category-form-card input,
.category-form-card select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.category-form-card input:focus,
.category-form-card select:focus {
    outline: none;
    border-color: #2878e5;
    box-shadow: 0 0 0 3px rgba(40, 120, 229, 0.12);
}


.category-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}


.category-form-actions button {
    min-width: 140px;
}


.category-form-card .form-error {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 5px;
    min-height: 20px;
}

/* =====================================================
   ACCIONES DE CATEGORÍAS
   ===================================================== */

.category-parent,
.category-child {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.category-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.category-actions button {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.category-actions .btn-edit-category:hover {
    background: #eef5ff;
    border-color: #3b82f6;
}

.category-actions .btn-delete-category:hover {
    background: #fff1f2;
    border-color: #ef4444;
}


/* =====================================================
   ACCESO A GESTIÓN DE CATEGORÍAS
   ===================================================== */

.categories-access {
    margin: 14px 0 28px;
}

.categories-access-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--text);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.categories-access-link:hover {
    background: rgba(23, 105, 170, 0.08);
    transform: translateX(2px);
}

.categories-access-icon {
    font-size: 18px;
}

.categories-access-link strong {
    color: var(--primary);
    font-size: 14px;
}

.categories-access-link small {
    display: inline;
    margin-left: 4px;
    color: var(--text-light);
    font-size: 13px;
}

.categories-access-arrow {
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
}







/* =================================================================================================================================
   RESPONSIVE
   ================================================================================================================================ */

@media (max-width: 850px) {

    .accounts-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 600px) {

    .header-content {
        padding: 18px;
        align-items: flex-start;
    }

    .header h1 {
        font-size: 21px;
    }

    .main-header .header-logo {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .main-header .header-brand {
        gap: 10px;
    }

    .btn-logout {
        font-size: 13px;
        padding: 8px 10px;
    }

    .container {
        width: calc(100% - 24px);
        margin-top: 20px;
    }

    .summary-main {
        padding: 20px;
    }

    .summary-main strong {
        font-size: 28px;
    }

    .section-title {
        align-items: flex-end;
    }

    .section-title h2 {
        font-size: 18px;
    }

    .section-title > strong {
        font-size: 17px;
    }

    .accounts-grid {
        grid-template-columns: 1fr;
    }

    .main-header .header-content {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .main-header .header-logo {
        width: 44px;
        height: 44px;
    }

    .main-header h1 {
        font-size: 20px;
        line-height: 1.15;
    }

    .main-header p {
        font-size: 13px;
        line-height: 1.3;
        margin-top: 4px;
    }

    .summary-main {
        padding: 9px 16px;
    }

    .summary-main strong {
        font-size: 23px;
    }

    #transferForm {
        grid-template-columns: 1fr;
    }

    #transferForm #transferError,
    #transferForm .form-actions {
        grid-column: auto;
    }

}


/* RESPONSIVE  TRANSFERENCIAS — AJUSTE MÓVIL */

@media (max-width: 600px) {

    /* Evita que Chrome aumente automáticamente los textos */
    body {
        -webkit-text-size-adjust: 100%;
    }

    /* Encabezado */
    .main-header .header-content {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .main-header .header-logo {
        width: 44px;
        height: 44px;
    }

    .main-header h1 {
        font-size: 20px;
        line-height: 1.15;
    }

    .main-header p {
        font-size: 13px;
        line-height: 1.3;
        margin-top: 4px;
    }

    /* Cabeceras de las secciones */
    .section-title h2 {
        font-size: 18px;
    }

    .section-title p {
        font-size: 12px;
    }

    .section-title .btn-primary {
        font-size: 13px;
        padding: 10px 12px;
    }

    /* Formulario */
    #transferFormContainer {
        padding: 18px;
    }

    #transferFormContainer .form-header h3 {
        font-size: 20px;
    }

    #transferFormContainer .form-header p {
        font-size: 13px;
    }

    #transferForm {
        gap: 12px;
    }

    #transferForm .form-group label {
        font-size: 14px;
    }

    #transferForm .form-group input,
    #transferForm .form-group select,
    #transferForm .form-group textarea {
        font-size: 14px;
        padding: 10px 11px;
    }

    #transferForm .form-group textarea {
        min-height: 65px;
    }

    #transferForm .form-actions {
        margin-top: 4px;
    }

        /* TARJETAS DE CUENTAS — MÁS COMPACTAS EN MÓVIL */

    .account-card {
        padding: 13px 16px;
    }

    .account-name {
        margin-bottom: 5px;
        font-size: 15px;
    }

    .account-balance {
        font-size: 21px;
    }

}

@media (max-width: 600px) {

    /* CABECERA DE LA SECCIÓN */

    .money-section .section-title.simple {
        gap: 10px;
    }

    .money-section .section-title.simple > div {
        min-width: 0;
    }

    .money-section .section-title h2 {
        font-size: 17px;
        line-height: 1.15;
        margin: 0;
    }

    .money-section .section-title p {
        font-size: 11px;
        line-height: 1.25;
        margin-top: 3px;
    }

    .money-section .section-title .section-icon {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .money-section .section-title .btn-primary {
        font-size: 12px;
        line-height: 1.2;
        padding: 9px 11px;
        white-space: nowrap;
    }


    /* FORMULARIO */

    #transferFormContainer {
        padding: 16px;
    }

    #transferFormContainer .form-header {
        margin-bottom: 14px;
    }

    #transferFormContainer .form-header h3 {
        font-size: 19px;
        line-height: 1.2;
    }

    #transferFormContainer .form-header p {
        font-size: 12px;
        margin-top: 3px;
    }

    #transferForm {
        gap: 9px;
    }

    #transferForm .form-group label {
        font-size: 13px;
        margin-bottom: 4px;
    }

    #transferForm .form-group input,
    #transferForm .form-group select {
        height: 44px;
        min-height: 44px;
        padding: 8px 11px;
        font-size: 14px;
    }

    #transferForm .form-group textarea {
        min-height: 58px;
        padding: 8px 11px;
        font-size: 14px;
    }

    #newTransferButton {
        font-size: 12px;
        padding: 9px 12px;
        white-space: nowrap;
    }

    #transferFormContainer {
        margin-top: 8px;
    }

}

@media (max-width: 600px) {

    /* Cabecera de Nueva transferencia */
    .section-title.simple {
        align-items: center;
        gap: 10px;
    }

    .section-title.simple > div {
        flex: 1;
        min-width: 0;
    }

    #newTransferButton {
        width: auto;
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 12px;
        padding: 9px 12px;
    }

}

/* RESPONSIVE FORMULARIO DE MOVIMIENTOS */

@media (max-width: 600px) {

    .transaction-type {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

}


/* RESPONSIVE MOVIMIENTOS */

@media (max-width: 600px) {

    .transaction-item {
        align-items: flex-start;
        padding: 13px;
        flex-direction: column;
        gap: 8px;
    }

    .transaction-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: 18px;
    }

    .transaction-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .transaction-amount {
        min-width: auto;
        width: 100%;
        text-align: right;
        font-size: 15px;
    }

}

/* RESPONSIVE FILTROS DE MOVIMIENTOS */

@media (max-width: 1050px) {

    .transaction-filters {
        grid-template-columns:
            repeat(3, 1fr);
    }

    .search-group {
        grid-column:
            span 2;
    }

    .btn-clear-filters {
        width: 100%;
    }


    .transaction-summary {
        grid-template-columns:
            repeat(2, 1fr);
    }

}


@media (max-width: 700px) {
    .transaction-filters {
        grid-template-columns:
            1fr;
        gap: 10px;
    }

    .transaction-summary {
        display: none;
    }

    .search-group {
        grid-column:
            span 1;
    }


    .transaction-summary {
        grid-template-columns:
            1fr;
    }

    .summary-item {
        padding:
            11px 13px;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-month {
        padding: 20px;
    }

    .statistics-section {
        padding: 20px;
    }

    .statistics-chart {
        min-height: 240px;
    }

    .statistics-category-chart {
        min-height: 260px;
    }

}

/* RESPONSIVE DASHBOARD */

@media (max-width: 700px) {

    .dashboard-top-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .dashboard-top-row .quick-action {
        min-height: 88px;
        padding: 14px 10px;
    }

    .dashboard-top-row .quick-action-icon {
        width: 40px;
        height: 40px;
        font-size: 23px;
    }

    .dashboard-top-row .quick-action-label {
        font-size: 13px;
    }

}

/* RESPONSIVE PATRIMONIO NETO ACTUAL*/

@media (max-width: 700px) {

    .statistics-patrimony {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .statistics-patrimony-value {
        width: 100%;
        text-align: left;
    }

    .statistics-patrimony-value strong {
        font-size: 26px;
    }

}


@media (max-width: 800px) {

    .dashboard-top-row {
        grid-template-columns: 1fr;
    }

}


/* =====================================================
   ACCIONES RÁPIDAS — 4 EN UNA FILA EN MÓVIL
   ===================================================== */

@media (max-width: 800px) {

    .dashboard-top-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .dashboard-top-row .quick-action {
        min-height: 82px;
        padding: 10px 4px;
        gap: 4px;
    }

    .dashboard-top-row .quick-action-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .dashboard-top-row .quick-action-icon img {
        width: 38px;
        height: 38px;
    }

    .dashboard-top-row .quick-action-label {
        font-size: 11px;
        white-space: nowrap;
    }

}

/* RESPONSIVE FORMULARIO RÁPIDO INGRESOS/GASTOS */

@media (max-width: 600px) {

    .quick-transaction-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        margin: 10px auto;
    }

    .quick-transaction-header {
        padding: 18px;
    }

    #quickTransactionForm {
        padding: 18px;
    }

    .quick-transaction-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .quick-transaction-actions {
        flex-direction: column-reverse;
    }

    .quick-transaction-actions button {
        width: 100%;
    }

}

/* RESPONSIVE FILTROS MOVIMIENTOS CUENTAS */

@media (max-width: 700px) {

    .toggle-transaction-filters {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    .transaction-filters-wrapper .transaction-filters {
        display: none;
        margin-top: 10px;
    }

    .transaction-filters-wrapper.open .transaction-filters {
        display: grid;
    }

}

/* RESPONSIVE FORMULARIO DE CATEGORÍAS */

@media (max-width: 700px) {

    .category-form-card {
        padding: 20px;
    }

    .category-form-actions {
        flex-direction: column;
    }

    .category-form-actions button {
        width: 100%;
    }

}