.cuentas-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-info h1 {
    font-size: 2rem;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-info p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.content-grid.with-history {
    grid-template-columns: 1fr 400px;
}

@media (max-width: 1024px) {
    .content-grid.with-history {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-with-back {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box input {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    width: 250px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: #ffffff; /* Texto más brillante/oscuro sobre fondo oscuro */
    font-weight: 400;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Map in Cuentas */
.account-map-container {
    height: 250px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

#accountMap {
    height: 100%;
    width: 100%;
    background: #1a1a1a;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-icon.delete:hover {
    background: #dc3545;
    border-color: #dc3545;
}

/* History Card & Timeline */
.history-card {
    display: flex;
    flex-direction: column;
    max-height: 800px;
    animation: slideInRight 0.3s ease;
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.history-filters {
    margin-bottom: 1.5rem;
}

.history-filters select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.6rem;
    border-radius: 8px;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    width: 16px;
    height: 16px;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    z-index: 1;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    display: block;
}

.timeline-title {
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Base Styles (Ensuring consistency) */
:root {
    --primary-color: #1a73e8;
    --card-bg: #1e1e1e;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-muted: #9aa0a6;
    --text-light: #e8eaed;
    --input-bg: #2d2d2d;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.badge {
    background: rgba(26, 115, 232, 0.2);
    color: #8ab4f8;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border-color);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.text-center { text-align: center; }
.text-error { color: #dc3545; }
