* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    color: #333;
    background: #f0f2f5;
}

/* LOGIN */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #1a3a5c;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    color: #1a3a5c;
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.login-subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* FORMULARIOS */
.campo {
    margin-bottom: 1.2rem;
}

.campo label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.campo input, .campo select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.campo input:focus, .campo select:focus {
    outline: none;
    border-color: #1a3a5c;
}

/* BOTONES */
.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: #1a3a5c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: #254d7a;
}

/* ALERTAS */
.alerta {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.alerta.error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6c2;
}

.alerta.ok {
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}
/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #1a3a5c;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
a.navbar-brand {
    text-decoration: none;
    color: white;
}
.navbar-brand {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    min-width: 130px;
}

/* MENÚ HORIZONTAL */
.nav-horizontal {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
}

.nav-link {
    color: #cce0f5;
    text-decoration: none;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: background 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* DROPDOWN CONFIGURACIÓN */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 160px;
    overflow: hidden;
    z-index: 2000;
    padding-top: 8px;
    margin-top: -8px;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.7rem 1.2rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.nav-dropdown-menu a:hover {
    background: #e8f0fb;
    color: #1a3a5c;
}

/* USUARIO Y SALIR */
.nav-usuario {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    padding-left: 1rem;
}

.nav-usuario span {
    color: #88aacc;
    font-size: 0.85rem;
}

/* HAMBURGER — solo visible en móvil */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
}

.nav-menu {
    display: none;
    position: fixed;
    top: 56px;
    right: 0;
    width: 240px;
    height: calc(100vh - 56px);
    background: #1a3a5c;
    flex-direction: column;
    padding: 1rem 0;
    box-shadow: -4px 0 12px rgba(0,0,0,0.2);
    z-index: 1500;
}

.nav-menu.activo {
    display: flex;
}

.nav-menu a {
    color: #cce0f5;
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    transition: background 0.2s;
}

.nav-menu a:hover {
    background: #254d7a;
    color: white;
}

.nav-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid #254d7a;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-footer span {
    color: #88aacc;
    font-size: 0.85rem;
}

.btn-logout {
    background: #c0392b;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem !important;
    text-decoration: none;
}

.btn-logout:hover {
    background: #e74c3c !important;
}

/* RESPONSIVE — móvil */
@media (max-width: 768px) {
    .nav-horizontal {
        display: none;
    }
    .hamburger {
        display: block;
    }
}

/* SUBMENÚ CONFIGURACIÓN (hamburger) */
.nav-grupo {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-grupo-titulo {
    color: #88aacc;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.85rem 1.5rem 0.3rem;
    display: block;
}

.nav-sub {
    display: block;
    width: 100%;
    padding-left: 2.2rem !important;
    font-size: 0.95rem !important;
}

/* CONTENIDO PRINCIPAL */
.contenido {
    margin-top: 56px;
    padding: 1.5rem;
}
/* SUBMENÚ CONFIGURACIÓN */
.nav-grupo {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-grupo-titulo {
    color: #88aacc;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.85rem 1.5rem 0.3rem;
    display: block;
}

.nav-sub {
    display: block;
    width: 100%;
    padding-left: 2.2rem !important;
    font-size: 0.95rem !important;
}
/* LAYOUT DOS PANELES */
.config-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.panel-grupos {
    width: 220px;
    min-width: 220px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.panel-cuentas {
    flex: 1;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    min-height: 300px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    background: #1a3a5c;
    color: white;
}

.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.btn-add {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-add:hover {
    background: rgba(255,255,255,0.35);
}

/* LISTA GRUPOS */
.lista-grupos {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lista-grupos li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.2rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.lista-grupos li:hover {
    background: #f5f8fc;
}

.lista-grupos li.activo {
    background: #e8f0fb;
    border-left: 3px solid #1a3a5c;
}

.lista-grupos li a:first-child {
    text-decoration: none;
    color: #333;
    flex: 1;
    font-size: 0.95rem;
}

.lista-grupos li.activo a:first-child {
    font-weight: 600;
    color: #1a3a5c;
}

/* LISTA CUENTAS */
.lista-cuentas {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lista-cuentas li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.lista-cuentas li:hover {
    background: #f5f8fc;
}

.cuenta-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cuenta-nombre {
    font-size: 0.95rem;
    color: #333;
}

.cuenta-saldo {
    font-size: 0.85rem;
    color: #1a8a4a;
    font-weight: 600;
}

/* ACCIONES */
.acciones {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.lista-grupos li:hover .acciones,
.lista-cuentas li:hover .acciones {
    opacity: 1;
}

.acciones a {
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
}

.vacio {
    padding: 2rem;
    color: #aaa;
    text-align: center;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .config-layout {
        flex-direction: column;
    }
    .panel-grupos {
        width: 100%;
        min-width: unset;
    }
}
/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal h3 {
    margin: 0 0 1.5rem;
    color: #1a3a5c;
    font-size: 1.2rem;
}

.modal-botones {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-secondary {
    padding: 0.65rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #555;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #f5f5f5;
}
/* ÁRBOL DE CUENTAS */
.page-toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.btn-secondary-btn {
    padding: 0.65rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #555;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary-btn:hover {
    background: #f5f5f5;
}

.arbol {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.grupo-bloque {
    border-bottom: 1px solid #f0f0f0;
}

.grupo-bloque:last-child {
    border-bottom: none;
}

.grupo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1a3a5c;
    color: white;
}

.arrow-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    transition: transform 0.2s;
}

.grupo-nombre {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.badge {
    font-size: 11px;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 2px 7px;
    border-radius: 10px;
}

.grupo-acciones {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}

.grupo-header:hover .grupo-acciones {
    opacity: 1;
}

.grupo-acciones button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.grupo-acciones button:hover {
    background: rgba(255,255,255,0.3);
}

.cuentas-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cuenta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 36px;
    border-bottom: 0.5px solid #f0f0f0;
    background: white;
    transition: background 0.15s;
}

.cuenta-item:last-child {
    border-bottom: none;
}

.cuenta-item:hover {
    background: #f5f8fc;
}

.drag-handle {
    color: #bbb;
    cursor: grab;
    font-size: 14px;
}

.drag-handle:active {
    cursor: grabbing;
}

.cuenta-nombre {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.cuenta-saldo {
    font-size: 13px;
    color: #1a8a4a;
    font-weight: 600;
    min-width: 100px;
    text-align: right;
}

.cuenta-saldo.negativo {
    color: #c0392b;
}

.cuenta-acciones {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.cuenta-item:hover .cuenta-acciones {
    opacity: 1;
}

.cuenta-acciones button {
    background: none;
    border: 0.5px solid #ddd;
    color: #777;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.cuenta-acciones button:hover {
    background: #f0f0f0;
}
/* CONTENIDO CENTRADO */
.contenido-central {
    max-width: 800px;
    margin: 0 auto;
}
/* BADGES CATEGORÍAS */
.tipo-badge {
    font-size: 11px;
    background: #e8f0fb;
    color: #1a3a5c;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 4px;
}

.signo-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.signo-badge.ingreso {
    background: #eafaf1;
    color: #1a8a4a;
}

.signo-badge.gasto {
    background: #fdecea;
    color: #c0392b;
}

.signo-badge.ambos {
    background: #f5f5f5;
    color: #777;
}
/* LAYOUT MOVIMIENTOS */
.mov-layout {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    height: calc(100vh - 80px);
}

/* SIDEBAR */
.mov-sidebar {
    width: 200px;
    min-width: 200px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.sidebar-header {
    padding: 0.9rem 1rem;
    background: #1a3a5c;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.ver-todas {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: #1a3a5c;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.ver-todas:hover, .ver-todas.activa {
    background: #e8f0fb;
    font-weight: 600;
}

.sidebar-grupo {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-grupo-header {
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #254d7a;
    background: #d0e4f7;
    border-bottom: 1px solid #b8d4ee;
}
.sidebar-grupo-saldo {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a3a5c;
}

.sidebar-cuenta {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem 0.5rem 1.2rem;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.sidebar-cuenta:hover {
    background: #f5f8fc;
}

.sidebar-cuenta.activa {
    background: #e8f0fb;
    border-left: 3px solid #1a3a5c;
}

.sidebar-cuenta-nombre {
    font-size: 0.85rem;
    color: #333;
}

.sidebar-cuenta-saldo {
    font-size: 0.8rem;
    color: #1a8a4a;
    font-weight: 600;
}

.sidebar-cuenta-saldo.negativo {
    color: #c0392b;
}

/* ZONA CENTRAL */
.mov-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 0;
}

/* PERÍODO */
.periodo-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: white;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.periodo-btn {
    color: #1a3a5c;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.periodo-btn:hover {
    background: #e8f0fb;
}

.periodo-actual {
    font-weight: 600;
    font-size: 1rem;
    color: #1a3a5c;
    min-width: 160px;
    text-align: center;
    text-transform: capitalize;
}

/* TOOLBAR */
.mov-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.filtros-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filtros-form select {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
}

/* TABLA */
.mov-tabla-wrapper {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.saldo-inicial, .saldo-final {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    color: #555;
    background: #f8f8f8;
    border-bottom: 1px solid #f0f0f0;
}

.saldo-final {
    border-top: 1px solid #f0f0f0;
    border-bottom: none;
}

.mov-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.mov-tabla thead th {
    background: #1a3a5c;
    color: white;
    padding: 0.7rem 1rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.85rem;
}

.mov-tabla tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.mov-tabla tbody tr:hover {
    background: #f5f8fc;
}

.mov-tabla tbody tr:last-child {
    border-bottom: none;
}

.mov-tabla td {
    padding: 0.65rem 1rem;
    color: #333;
}

.mov-tabla .fecha {
    white-space: nowrap;
    color: #777;
    font-size: 0.85rem;
}

.mov-tabla .importe {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.mov-tabla .importe.ingreso {
    color: #1a8a4a;
}

.mov-tabla .importe.gasto {
    color: #c0392b;
}

.text-right {
    text-align: right;
}

.acciones-mov {
    white-space: nowrap;
    text-align: right;
    opacity: 0;
    transition: opacity 0.15s;
}

.mov-tabla tbody tr:hover .acciones-mov {
    opacity: 1;
}

.acciones-mov button {
    background: none;
    border: 0.5px solid #ddd;
    color: #777;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 3px;
}

.acciones-mov button:hover {
    background: #f0f0f0;
}

/* RESUMEN */
.mov-resumen {
    display: flex;
    gap: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0.9rem 1.2rem;
}

.resumen-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
}

.resumen-label {
    font-size: 0.78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resumen-valor {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.resumen-valor.positivo { color: #1a8a4a; }
.resumen-valor.negativo { color: #c0392b; }

/* MODAL ANCHO */
.modal-wide {
    max-width: 580px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.campo-ancho {
    grid-column: span 2;
}

/* RESPONSIVE */
@media (max-width: 700px) {
    .mov-layout {
        flex-direction: column;
        height: auto;
    }
    .mov-sidebar {
        width: 100%;
        min-width: unset;
        max-height: 200px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .campo-ancho {
        grid-column: span 1;
    }
}
/* PERÍODO TABS */
.periodo-centro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.periodo-tabs {
    display: flex;
    gap: 0.3rem;
}

.periodo-tab {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    text-decoration: none;
    color: #888;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.periodo-tab:hover {
    background: #e8f0fb;
    color: #1a3a5c;
}

.periodo-tab.activo {
    background: #1a3a5c;
    color: white;
    border-color: #1a3a5c;
}
.th-link {
    color: white;
    text-decoration: none;
}
.th-link:hover {
    text-decoration: underline;
}
/* DASHBOARD */
.total-patrimonio {
    background: #1a3a5c;
    color: white;
    padding: 1rem;
    text-align: center;
    border-radius: 10px 10px 0 0;
}

.patrimonio-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.75;
    margin-bottom: 4px;
}

.patrimonio-valor {
    font-size: 1.3rem;
    font-weight: 700;
}

.vista-tabs {
    display: flex;
    gap: 4px;
}

.vista-tab {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    border: 1px solid #ddd;
    transition: all 0.2s;
    background: white;
}

.vista-tab:hover {
    background: #e8f0fb;
    color: #1a3a5c;
}

.vista-tab.activo {
    background: #e8f0fb;
    color: #1a3a5c;
    border-color: #1a3a5c;
    font-weight: 600;
}

/* TARJETAS RESUMEN */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.dash-card {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dash-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 4px;
}

.dash-card-valor {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.dash-card.ingresos .dash-card-valor { color: #1a8a4a; }
.dash-card.gastos .dash-card-valor { color: #c0392b; }
.dash-card.balance .dash-card-valor { color: #1a3a5c; }
.dash-card-valor.negativo { color: #c0392b !important; }

/* PANEL PRINCIPAL */
.dash-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.dash-grupo {
    border-bottom: 1px solid #f0f0f0;
}

.dash-grupo:last-child {
    border-bottom: none;
}

.dash-grupo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f5f8fc;
    cursor: pointer;
    transition: background 0.15s;
}

.dash-grupo-header:hover {
    background: #e8f0fb;
}

.dash-arrow {
    font-size: 11px;
    color: #1a3a5c;
    width: 12px;
}

.dash-grupo-nombre {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1a3a5c;
}

.dash-grupo-total {
    font-size: 13px;
    font-weight: 700;
    color: #c0392b;
}

.dash-items {
    padding: 4px 0;
}

.dash-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px 6px 30px;
    border-top: 0.5px solid #f5f5f5;
    gap: 10px;
}


.dash-item-nombre {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.dash-barra {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.dash-barra-fill {
    height: 100%;
    border-radius: 3px;
    background: #c0392b;
    transition: width 0.3s;
}

.dash-barra-fill.ingreso {
    background: #1a8a4a;
}

.dash-item-importe {
    font-size: 13px;
    font-weight: 600;
    color: #c0392b;
    text-align: right;
    min-width: 100px;
}
.dash-item-importe.ingreso {
    color: #1a8a4a;
}
/* DASHBOARD MASTER-DETAIL */
.dash-detail-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.dash-master {
    width: 300px;
    min-width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.dash-detail {
    flex: 1;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 300px;
    overflow: hidden;
}

.dash-detail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #aaa;
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
}

.dash-detail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #888;
}

.dash-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    background: #1a3a5c;
    color: white;
    font-size: 0.9rem;
}

.dash-detail-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.dash-detail-tabla thead th {
    background: #f5f8fc;
    padding: 0.6rem 1rem;
    text-align: left;
    color: #555;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    font-size: 0.8rem;
}

.dash-detail-tabla tbody tr {
    border-bottom: 0.5px solid #f0f0f0;
    transition: background 0.15s;
}

.dash-detail-tabla tbody tr:hover {
    background: #f5f8fc;
}

.dash-detail-tabla td {
    padding: 0.6rem 1rem;
    color: #333;
}

.dash-item.clicable {
    cursor: pointer;
    transition: background 0.15s;
}

.dash-item.clicable:hover {
    background: #f0f5ff;
}

.dash-item.activo {
    background: #e8f0fb;
    border-left: 3px solid #1a3a5c;
}

.btn-edit-mini {
    background: none;
    border: 0.5px solid #ddd;
    color: #777;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

.btn-edit-mini:hover {
    background: #f0f0f0;
}
.dash-grupo-total.ingreso {
    color: #1a8a4a;
}

.dash-grupo-total.diferencia {
    font-size: 1rem;
}
/* IMPORTACIÓN */
.import-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.banco-info {
    background: #e8f0fb;
    color: #1a3a5c;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 0.8rem;
}

.select-mini {
    width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.82rem;
}

.fila-duplicado {
    background: #fff8f0;
    opacity: 0.7;
}

.estado-badge {
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.estado-badge.completada {
    background: #eafaf1;
    color: #1a8a4a;
}

.estado-badge.pendiente {
    background: #fef9e7;
    color: #e67e22;
}

.estado-badge.error {
    background: #fdecea;
    color: #c0392b;
}
.regla-inactiva td {
    opacity: 0.4;
}
.estado-badge.ia {
    background: #f0e6ff;
    color: #6b21a8;
}