/* ========================================
   FINTECH PLATFORM - TEMA MERCURY
   Diseño limpio, minimalista y elegante
   ======================================== */

:root {
    /* ── BSPay · mesa de operaciones ────────────────────────────────────
       El producto es un escritorio de tesoreria: se leen tasas y se aprueban
       movimientos de dinero. La paleta busca instrumento, no landing.
       El acento es jade (liquidacion) y no un azul-violeta generico; los
       grises llevan sesgo verde para que acompañen al acento en vez de
       leerse como gris de plantilla. */

    --primary: #0E6E58;          /* jade: liquidacion, dinero que se mueve */
    --primary-dark: #0A5344;
    --primary-light: #149074;
    --secondary: #68736C;
    --success: #0E6E58;
    --warning: #B5761C;          /* laton: lo que espera decision */
    --danger: #A63A2C;           /* arcilla: lo que no prospero */
    --info: #2C6E8F;

    /* Fondos: papel frio con sesgo verde, elegido y no heredado */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F3F0;
    --bg-tertiary: #E9ECE6;
    --bg-card: #FFFFFF;
    --bg-sidebar: #10151A;       /* tinta, no indigo */
    --bg-sidebar-hover: #1A2229;

    --text-primary: #10151A;
    --text-secondary: #46514B;
    --text-muted: #68736C;
    --text-light: #FFFFFF;

    --border-color: #DCE0DA;

    /* Radios chicos: instrumento de precision, no pastilla */
    --border-radius: 4px;
    --border-radius-sm: 3px;
    --border-radius-lg: 6px;

    /* Sombras casi ausentes: la jerarquia la dan las lineas de 1px, no el
       desenfoque. Una sombra difusa en cada tarjeta emborrona la lectura
       cuando hay doce cifras en pantalla. */
    --shadow-sm: 0 1px 0 rgba(16,21,26,0.04);
    --shadow-md: 0 1px 2px rgba(16,21,26,0.06);
    --shadow-lg: 0 8px 24px rgba(16,21,26,0.10);
    --shadow-card: 0 1px 0 rgba(16,21,26,0.05);

    --transition: all 0.15s ease;

    /* Cifras en monoespaciada tabular: el trabajo es leer y comparar montos
       entre filas, y con digitos de ancho variable las columnas bailan. */
    --font-num: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar Mercury - Oscuro elegante */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-light);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* permite que flex-item se comprima y habilita scroll */
}

.sidebar-footer {
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item span {
    font-size: 14px;
    font-weight: 500;
}

/* Contenido principal */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    background: var(--bg-secondary);
    width: calc(100vw - 280px);
    max-width: calc(100vw - 280px);
    min-width: 0;
    overflow-x: hidden;
}

/* Header Mercury - Limpio */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.user-menu:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Contenido de páginas */
.page-content {
    padding: 32px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.page-section {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* ========================================
   TARJETAS Y COMPONENTES MERCURY
   ======================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: visible;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

/* Stats Cards Mercury */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card-header {
    grid-column: 1 / -1;
    padding: 12px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 8px;
}

.stat-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card-header h4 i {
    color: var(--primary);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Accent top borders por color */
.stat-card.accent-green  { border-top-color: var(--success); }
.stat-card.accent-blue   { border-top-color: var(--primary); }
.stat-card.accent-gold   { border-top-color: #F59E0B; }
.stat-card.accent-cyan   { border-top-color: var(--info); }
.stat-card.accent-teal   { border-top-color: #14B8A6; }
.stat-card.accent-purple { border-top-color: #a855f7; }
.stat-card.accent-yellow { border-top-color: var(--warning); }

/* Card morada VES: permite más espacio para números grandes */
.stat-card.accent-purple {
    border-top-color: #a855f7;
    padding: 20px 18px;
}
.stat-card.accent-purple .stat-label {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 12px;
    letter-spacing: 0.3px;
}
.stat-card.accent-purple .stat-value {
    font-size: 18px;
    word-break: break-word;
    line-height: 1.3;
}
.stat-card.accent-purple .stat-sub {
    font-size: 12px;
    white-space: normal;
    margin-top: 6px;
    line-height: 1.5;
    opacity: 0.75;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-icon.blue { 
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05)); 
    color: var(--primary); 
}
.stat-icon.green { 
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05)); 
    color: var(--success); 
}
.stat-icon.yellow { 
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05)); 
    color: var(--warning); 
}
.stat-icon.red { 
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05)); 
    color: var(--danger); 
}
.stat-icon.cyan { 
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05)); 
    color: var(--info); 
}
.stat-icon.gold { 
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05)); 
    color: #F59E0B; 
}
.stat-icon.teal { 
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.05)); 
    color: #14B8A6; 
}
.stat-icon.purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.05));
    color: #a855f7;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: 21px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.2;
}

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-sub a {
    color: var(--primary);
    text-decoration: none;
}

.stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* ===== Admin Dashboard Banner ===== */
.admin-dash-banner {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
    border-radius: var(--border-radius-lg);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(99,102,241,0.25);
    margin-bottom: 4px;
}

.admin-dash-banner-left h2 {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 3px 0;
}

.admin-dash-banner-left p {
    color: rgba(255,255,255,0.65);
    font-size: 12px;
    margin: 0;
}

.admin-dash-banner-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 5px 12px;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.admin-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    animation: admin-pulse 2.5s ease infinite;
}

@keyframes admin-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
    50%       { opacity: 0.8; box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* ===== N58 Compact bar ===== */
.n58-compact-bar {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius-lg);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.n58-compact-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.n58-compact-title i { color: var(--primary); }

.n58-compact-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
    flex-shrink: 0;
}

.n58-compact-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.n58-compact-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.n58-compact-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
    overflow-wrap: break-word;
}

.n58-compact-badge {
    margin-left: auto;
}


/* ========================================
   TABLAS MERCURY
   ======================================== */

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

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.data-table tr:hover {
    background: var(--bg-secondary);
}

.data-table td {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   FORMULARIOS MERCURY
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Fix para iOS Safari */
select.form-control::-ms-expand {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    /* Estilos específicos para iOS */
    select.form-control {
        background-color: var(--bg-primary);
        border-radius: var(--border-radius-sm);
        min-height: 44px; /* iOS requiere al menos 44px para touch targets */
    }
}

/* ========================================
   BOTONES MERCURY
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon-xs {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 6px;
    flex-shrink: 0;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Admin actions en tablas */
.admin-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.admin-actions .btn {
    padding: 6px 10px;
}

/* ========================================
   BADGES Y ESTADOS
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-info { background: rgba(6, 182, 212, 0.1); color: var(--info); }
.badge-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.badge-sandbox {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 6px;
}

/* Fila sandbox en tabla de usuarios admin */
tr.sandbox-row {
    background: rgba(245, 158, 11, 0.04) !important;
    border-left: 3px solid #f59e0b;
    opacity: 0.92;
}
tr.sandbox-row:hover {
    background: rgba(245, 158, 11, 0.09) !important;
    opacity: 1;
}
tr.sandbox-row .user-avatar-sm {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #fff !important;
}
tr.sandbox-row .user-email {
    color: #92400e;
}

/* Toggle switch (sandbox) */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--border, #334155);
    border-radius: 24px;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #f59e0b; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ========================================
   MODALES MERCURY
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal,
.modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal,
.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
}

/* ========================================
   ALERTAS Y NOTIFICACIONES
   ======================================== */

.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: var(--info);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px 20px;
    min-width: 320px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   PÁGINA DE LOGIN MERCURY
   ======================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
}

.login-container { width: 100%; max-width: 440px; padding: 20px; }
.login-card { background: var(--bg-primary); border-radius: var(--border-radius-lg); padding: 48px 40px; box-shadow: 0 25px 50px rgba(0,0,0,0.25); }
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo { display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.login-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.login-subtitle { color: var(--text-muted); font-size: 14px; }

/* ========================================
   LOGIN SaaS SPLIT-SCREEN
   ======================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
}

/* ── Panel Izquierdo ── */
.lp-left {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #2e1065 0%, #3730a3 45%, #4f46e5 80%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 56px;
}

.lp-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

@keyframes float1 { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-28px) scale(1.04)} }
@keyframes float2 { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(22px) scale(0.96)} }

.lp-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.lp-orb-1 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(167,139,250,0.5), transparent 70%);
    top: -100px; right: -60px;
    animation: float1 9s ease-in-out infinite;
}

.lp-orb-2 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.45), transparent 70%);
    bottom: -70px; left: -50px;
    animation: float2 11s ease-in-out infinite;
}

.lp-hero {
    position: relative;
    z-index: 2;
    max-width: 400px;
}

.lp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 60px;
}

.lp-brand-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
}

.lp-brand-name {
    font-size: 19px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.lp-headline {
    font-size: 48px;
    font-weight: 900;
    color: white;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
}

.lp-headline-accent {
    background: linear-gradient(90deg, #c4b5fd, #f9a8d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lp-desc {
    font-size: 16px;
    color: rgba(255,255,255,0.60);
    line-height: 1.75;
    margin-bottom: 44px;
    max-width: 340px;
}

/* Pills de features */
.lp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lp-partners {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lp-partners-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

.lp-partners-logos {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lp-partner-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
    opacity: 0.70;
    transition: opacity 0.2s;
}

.lp-partner-logo:hover {
    opacity: 1;
}

/* En móvil los logos van en el panel derecho (fondo claro) — usar colores originales del SVG */
.lp-partner-logo--colored {
    filter: none;
    opacity: 0.80;
}

.lp-partner-logo--colored:hover {
    opacity: 1;
}

/* Ocultar el bloque de partners del panel derecho en desktop */
.lp-partners--mobile {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* El label en el panel derecho va oscuro para fondo claro */
.lp-partners--mobile .lp-partners-label {
    color: rgba(0,0,0,0.35);
}

.lp-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    letter-spacing: 0.1px;
}

.lp-pill i {
    font-size: 11px;
    opacity: 0.8;
}

/* ── Panel Derecho ── */
.lp-right {
    flex: 1;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
}

.lp-form-wrap {
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 44px 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

.lp-form-header {
    margin-bottom: 36px;
}

.lp-form-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.lp-form-sub {
    font-size: 14px;
    color: var(--text-muted);
}

.lp-field {
    margin-bottom: 20px;
}

.lp-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.lp-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.lp-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}

.lp-input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 40px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.lp-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: var(--bg-primary);
}

.lp-input::placeholder { color: var(--text-muted); }

.lp-eye-btn {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 44px;
    background: none; border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}

.lp-eye-btn:hover { color: var(--text-primary); }

.lp-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.lp-link:hover { text-decoration: underline; }

@keyframes lp-btn-shine {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

.lp-btn-submit {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    background: linear-gradient(90deg, #3730a3, #4f46e5, #818cf8, #4f46e5, #3730a3);
    background-size: 200% auto;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    gap: 10px;
    transition: box-shadow 0.2s, transform 0.1s;
    animation: lp-btn-shine 3s linear infinite;
}

.lp-btn-submit:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    transform: translateY(-1px);
}

.lp-btn-submit:active { transform: translateY(0); }

.lp-footer-note {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Branding móvil — oculto en desktop */
.lp-mobile-brand {
    display: none;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .login-page {
        flex-direction: column;
        min-height: 100vh;
        /* Mismo degradado que el panel izquierdo en desktop */
        background: linear-gradient(150deg, #2e1065 0%, #3730a3 45%, #4f46e5 80%, #6366f1 100%);
    }

    .lp-left { display: none; }

    .lp-right {
        flex: 1;
        width: 100%;
        min-height: 100vh;
        padding: 48px 20px 40px;
        background: transparent;
        align-items: flex-start;
        justify-content: flex-start;
    }

    /* Branding visible en móvil */
    .lp-mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 32px;
    }

    .lp-mobile-brand .lp-brand-name {
        font-size: 20px;
        font-weight: 700;
        color: white;
        letter-spacing: -0.3px;
    }

    .lp-mobile-brand .lp-brand-icon {
        width: 40px; height: 40px;
        background: rgba(255,255,255,0.15);
        border: 1px solid rgba(255,255,255,0.25);
        border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        backdrop-filter: blur(6px);
    }

    /* Tarjeta del formulario: glassmorphism */
    .lp-form-wrap {
        max-width: 100%;
        background: rgba(255,255,255,0.10);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255,255,255,0.20);
        border-radius: 20px;
        padding: 32px 24px;
        box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    }

    /* Textos del formulario sobre fondo oscuro */
    .lp-form-title {
        font-size: 22px;
        color: white;
    }

    .lp-form-sub {
        color: rgba(255,255,255,0.65);
    }

    .lp-label {
        color: rgba(255,255,255,0.80);
    }

    .lp-input {
        font-size: 16px;
        height: 50px;
        background: rgba(255,255,255,0.12);
        border-color: rgba(255,255,255,0.20);
        color: white;
    }

    .lp-input::placeholder {
        color: rgba(255,255,255,0.40);
    }

    .lp-input:focus {
        border-color: rgba(255,255,255,0.60);
        box-shadow: 0 0 0 3px rgba(255,255,255,0.10);
        background: rgba(255,255,255,0.15);
    }

    .lp-input-icon {
        color: rgba(255,255,255,0.55);
    }

    .lp-eye-btn {
        color: rgba(255,255,255,0.55);
    }

    .lp-eye-btn:hover {
        color: white;
    }

    .lp-link {
        color: #c4b5fd;
    }

    /* "¿No tienes cuenta?" */
    .lp-form-wrap form > div span {
        color: rgba(255,255,255,0.55) !important;
    }

    .lp-btn-submit {
        height: 52px;
        font-size: 16px;
    }

    /* Error box */
    #loginError {
        background: rgba(254,226,226,0.15) !important;
        border-color: rgba(252,165,165,0.40) !important;
        color: #fca5a5 !important;
    }

    /* Logos partners sobre fondo oscuro — blancos */
    .lp-partners--mobile {
        display: flex;
        margin-top: 24px;
        padding-top: 20px;
        border-top: 1px solid rgba(255,255,255,0.15);
    }

    .lp-partners--mobile .lp-partners-label {
        color: rgba(255,255,255,0.45);
    }

    .lp-partner-logo--colored {
        filter: brightness(0) invert(1);
        opacity: 0.70;
    }

    /* Footer note */
    .lp-footer-note {
        margin-top: 24px;
        color: rgba(255,255,255,0.40);
    }

    .lp-footer-note i {
        color: rgba(255,255,255,0.40);
    }
}

@media (max-width: 400px) {
    .lp-right {
        padding: 36px 14px 32px;
    }

    .lp-form-wrap {
        padding: 28px 18px;
        border-radius: 16px;
    }
}

/* ========================================
   MÓDULO DE TRANSFERENCIAS
   ======================================== */

.transfer-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

.transfer-form-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.transfer-preview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    position: sticky;
    top: 100px;
    height: fit-content;
    box-shadow: var(--shadow-card);
}

.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-label {
    color: var(--text-muted);
    font-size: 14px;
}

.preview-value {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.preview-total {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    margin: 20px -24px -24px;
    padding: 24px;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.preview-total .preview-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.preview-total .preview-value {
    font-size: 28px;
    color: white;
}

/* Wallet Balance Display */
.wallet-balance {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.wallet-balance-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.wallet-balance-value {
    font-size: 36px;
    font-weight: 700;
    color: white;
}

.wallet-balance-currency {
    font-size: 18px;
    opacity: 0.9;
    margin-left: 8px;
}

/* ========================================
   PANEL DE ADMINISTRACIÓN
   ======================================== */

.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.fx-rate-display {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
    border-radius: var(--border-radius-lg);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.fx-info h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.fx-value {
    font-size: 36px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.fx-unit {
    font-size: 15px;
    opacity: 0.7;
    font-weight: 400;
}

/* User Management */
.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-details {
    flex: 1;
}

.user-email {
    font-weight: 500;
    color: var(--text-primary);
}

.user-name {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   HISTORIAL DE TRANSACCIONES
   ======================================== */

.transaction-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.transaction-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.transaction-icon.outgoing {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.transaction-icon.incoming {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.transaction-details {
    flex: 1;
}

.transaction-recipient {
    font-weight: 500;
    color: var(--text-primary);
}

.transaction-date {
    font-size: 12px;
    color: var(--text-muted);
}

.transaction-amount {
    text-align: right;
    font-weight: 600;
}

.transaction-amount.outgoing {
    color: var(--danger);
}

.transaction-amount.incoming {
    color: var(--success);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
    .transfer-container {
        grid-template-columns: 1fr;
        padding-bottom: 80px;
    }
    
    /* En mobile, ocultar el preview del grid (se usa la barra flotante separada) */
    .transfer-preview {
        display: none !important;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    transition: color 0.2s;
}

.mobile-menu-toggle:hover {
    color: var(--primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        height: 100vh;
        height: 100dvh; /* descuenta barra del navegador */
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 8px;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-dash-banner {
        flex-wrap: wrap;
        padding: 14px 16px;
    }

    .n58-compact-bar {
        gap: 10px;
        padding: 10px 14px;
    }

    .n58-compact-divider {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .page-content {
        padding: 4px;
    }
    
    .card {
        padding: 8px;
        margin-left: -2px;
        margin-right: -2px;
        border-radius: 12px;
    }
    
    .card-header {
        padding: 12px 8px;
    }
    
    .card-body {
        padding: 12px 8px;
    }
    
    .transaction-item {
        padding: 10px 6px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .user-menu {
        padding: 6px 12px;
    }
    
    .user-info {
        display: none;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 16px;
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .page-content {
        padding: 8px;
    }
    
    .card {
        padding: 12px;
        border-radius: 8px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    /* Login responsive */
    .login-container {
        padding: 16px;
    }
    
    .login-card {
        padding: 24px 20px;
    }
    
    .login-title {
        font-size: 22px;
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    /* Transfer container */
    .transfer-preview {
        display: none;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--text-primary); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none !important; }

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-muted);
}

/* ========================================
   SECCIÓN MIS WALLETS
   ======================================== */

/* Balance Total Card */
.wallet-total-balance {
    margin-bottom: 32px;
}

.total-balance-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
    color: white;
}

.total-balance-content {
    flex: 1;
}

.total-balance-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.total-balance-label i {
    font-size: 16px;
}

.total-balance-value {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 4px;
}

.total-balance-subtitle {
    font-size: 14px;
    opacity: 0.8;
}

.total-balance-actions {
    display: flex;
    gap: 12px;
}

.total-balance-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(4px);
}

.total-balance-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.total-balance-actions .btn-primary {
    background: white;
    color: var(--primary);
    border: none;
}

.total-balance-actions .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Wallets Grid */
.wallets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

/* Wallet Card */
.wallet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.wallet-card-usd::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.wallet-card-ves::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.wallet-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.wallet-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.wallet-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.wallet-card-usd .wallet-card-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--success);
}

.wallet-card-ves .wallet-card-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: var(--warning);
}

.wallet-card-balance {
    margin-bottom: 20px;
}

.wallet-card-balance-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.wallet-card-balance-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wallet-card-balance-equivalent {
    font-size: 14px;
    color: var(--text-muted);
}

.wallet-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.wallet-card-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wallet-card-info-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-card-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.wallet-card-actions {
    display: flex;
    gap: 8px;
}

.wallet-card-actions .btn {
    flex: 1;
}

/* Account Info Grid */
.account-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.account-info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.account-info-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.account-info-icon.blue {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    color: var(--primary);
}

.account-info-icon.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--success);
}

.account-info-icon.yellow {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: var(--warning);
}

.account-info-icon.cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
    color: var(--info);
}

.account-info-content {
    flex: 1;
}

.account-info-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.account-info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Movements List */
.movements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.movement-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.movement-item:hover {
    background: var(--bg-tertiary);
}

.movement-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.movement-icon.incoming {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--success);
}

.movement-icon.outgoing {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: var(--danger);
}

.movement-details {
    flex: 1;
}

.movement-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.movement-date {
    font-size: 12px;
    color: var(--text-muted);
}

.movement-amount {
    font-size: 16px;
    font-weight: 600;
}

.movement-amount.incoming {
    color: var(--success);
}

.movement-amount.outgoing {
    color: var(--danger);
}

.movements-empty-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed var(--primary);
    border-radius: var(--border-radius);
    color: var(--primary);
    font-size: 13px;
    margin-top: 16px;
}

.empty-state-sm {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

.empty-state-sm i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.empty-state-sm p {
    font-size: 14px;
}

/* Responsive Wallets */
@media (max-width: 768px) {
    .total-balance-card {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    
    .total-balance-actions {
        width: 100%;
        justify-content: center;
    }
    
    .wallets-grid {
        grid-template-columns: 1fr;
    }
    
    .account-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   N58 BANK BALANCES (CUENTA PADRE)
   ======================================== */

.n58-balances {
    margin-bottom: 24px;
}

.n58-balances-header {
    margin-bottom: 16px;
}

.n58-balances-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.n58-balances-header i {
    color: var(--primary);
}

.n58-balances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.n58-balance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.n58-balance-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.n58-currency {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.n58-account {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.n58-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.n58-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.n58-details span {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Color morado para iconos de banco */
.stat-icon.purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.05));
    color: #a855f7;
}

/* ========================================
   TRANSACTION DETAILS MODAL
   ======================================== */

.transaction-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    padding: 20px;
}

.detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Report Filters Bar */
.report-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.rf-dates {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rf-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rf-field label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.rf-field .form-control {
    width: 148px;
    height: 36px;
    font-size: 13px;
    padding: 0 10px;
}

.rf-field select.form-control {
    width: 160px;
}

.rf-presets {
    display: flex;
    gap: 5px;
    align-items: flex-end;
}

.rf-preset {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0 13px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    height: 36px;
    transition: all 0.15s;
    white-space: nowrap;
}

.rf-preset:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.rf-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-left: auto;
}

.rf-actions .btn-sm {
    height: 36px;
    font-size: 13px;
    padding: 0 14px;
}

/* Legacy filters-bar (keep for compatibility) */
.filters-bar {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
}

/* Table responsive */
.table-responsive,
.table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
}

.table-responsive table,
.table-container table {
    min-width: 600px;
    width: max-content;
    table-layout: auto;
}

/* Limitar ancho de columnas largas */
.table-responsive table th:nth-child(4),
.table-responsive table td:nth-child(4) {
    max-width: 150px;
    min-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-responsive table td:nth-child(4) div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-responsive::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Tabla de depósitos del cliente - 7 columnas compactas */
#depositsTable .table-responsive table {
    min-width: 780px;
    width: 100%;
    table-layout: fixed;
}

#depositsTable .table-responsive table th:nth-child(1),
#depositsTable .table-responsive table td:nth-child(1) { width: 13%; } /* Fecha */
#depositsTable .table-responsive table th:nth-child(2),
#depositsTable .table-responsive table td:nth-child(2) { width: 16%; } /* Monto */
#depositsTable .table-responsive table th:nth-child(3),
#depositsTable .table-responsive table td:nth-child(3) { width: 9%; } /* Moneda */
#depositsTable .table-responsive table th:nth-child(4),
#depositsTable .table-responsive table td:nth-child(4) { width: 12%; } /* Estado */
#depositsTable .table-responsive table th:nth-child(5),
#depositsTable .table-responsive table td:nth-child(5) {
    width: 22%;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
} /* Descripción */
#depositsTable .table-responsive table th:nth-child(6),
#depositsTable .table-responsive table td:nth-child(6) { width: 14%; } /* Comprobante */
#depositsTable .table-responsive table th:nth-child(7),
#depositsTable .table-responsive table td:nth-child(7) {
    width: 14%;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
} /* ID/Referencia */

/* Historial de movimientos - scroll horizontal */
#transactionHistory {
    display: block;
}

#transactionHistory .hist-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
}

#transactionHistory .table-responsive {
    display: block;
    min-width: 100%;
}

#transactionHistory .table-responsive table {
    min-width: 900px;
    white-space: nowrap;
    border-collapse: collapse;
    table-layout: auto;
}

/* Vista admin: 12 columnas → ancho mánimo mayor */
#transactionHistory .table-responsive.history-admin-view table {
    min-width: 1300px;
}

#transactionHistory th,
#transactionHistory td {
    padding: 10px 12px;
    white-space: nowrap;
}

/* Limitar columnas de texto largo */
#transactionHistory td:nth-child(3),  /* Cliente */
#transactionHistory td:nth-child(4)   /* Destinatario */ {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tablas admin con muchas columnas - necesitan más ancho */
#adminTransactionsTable .table-responsive table,
#adminTransactionsReportTable .table-responsive table,
#adminDepositsTable .table-responsive table {
    min-width: 1400px;
}

/* Solicitudes de carga (operadora y admin) - 10 columnas */
#adminBalanceRequestsList .table-responsive table {
    min-width: 1200px;
}

#operatorRequestsList .table-responsive table {
    min-width: 900px;
}

/* Asegurar scroll en todos los contenedores de tabla */
#adminBalanceRequestsList,
#operatorRequestsList,
#adminTransactionsTable,
#adminTransactionsReportTable,
#adminDepositsTable,
#depositsTable,
#usersTable,
#beneficiariesTable {
    overflow-x: auto;
    max-width: 100%;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

@media (max-width: 768px) {
    .n58-balances-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-bar .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-bar .form-group {
        margin-right: 0 !important;
        margin-bottom: 8px;
    }
    
    .detail-grid {        grid-template-columns: 1fr;
    }
}

/* ========================================
   TABS
   ======================================== */

.tabs {
    width: 100%;
}

.tab-header {
    display: flex;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 7px;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 7px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   SUMMARY CARDS
   ======================================== */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.summary-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.summary-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-card .summary-value {
    color: var(--primary);
}

/* ========================================
   SKELETON LOADER (shimmer)
   ======================================== */

@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.skel {
    background: linear-gradient(90deg,
        var(--border-color) 25%,
        var(--bg-secondary) 50%,
        var(--border-color) 75%
    );
    background-size: 1200px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 5px;
}

.skel-text {
    height: 13px;
    display: block;
}

.skel-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* ========================================
   REPORT METRIC CARDS (modern)
   ======================================== */

.rpt-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.rpt-metric {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.15s;
}

.rpt-metric:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.rpt-metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.rpt-metric-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.rpt-metric-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.rpt-metric-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========================================
   REPORT TABLE (modern)
   ======================================== */

.rpt-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rpt-table thead th {
    background: var(--bg-secondary);
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    text-align: left;
}

.rpt-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.rpt-table tbody tr:last-child td {
    border-bottom: none;
}

.rpt-table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.04);
}

.rpt-user {
    display: flex;
    align-items: center;
    gap: 9px;
}

.rpt-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.rpt-user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.rpt-user-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.rpt-amount {
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rpt-amount-green { color: #10b981; }
.rpt-amount-red   { color: var(--danger); }
.rpt-amount-blue  { color: var(--primary); }
.rpt-amount-muted { color: var(--text-secondary); font-weight: 500; }

/* ========================================
   TABLE CONTAINER FOR REPORTS
   ======================================== */

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    /* overflow-x auto y no "overflow: hidden": esta regla es la ultima del
       archivo, asi que un hidden aca pisaba el scroll horizontal declarado mas
       arriba y recortaba TODA tabla ancha sin dejar forma de ver el resto. */
    overflow-x: auto;
    overflow-y: hidden;
}

.table-container .table {
    margin-bottom: 0;
}

/* ========================================
   RESPONSIVE TABS
   ======================================== */

@media (max-width: 768px) {
    .tab-header {
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 10px 14px;
        font-size: 13px;
        flex: 1;
        min-width: fit-content;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .summary-value {
        font-size: 24px;
    }
    
    /* Tablas responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        margin: 0 -4px;
        padding: 0 4px;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    /* Cards ocupan más ancho en móvil */
    .card {
        margin: 0 -4px 16px -4px;
        border-radius: 8px;
    }
    
    .content-wrapper {
        padding: 12px 8px;
    }
    
    /* Formularios */
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    /* Botones */
    .btn-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .data-table {
        min-width: 100%;
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* Ocultar columnas menos importantes en móvil */
    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        display: none;
    }
}

/* ========================================
   RECENT TRANSACTIONS LIST
   ======================================== */

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.transaction-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.transaction-info { flex: 1; }
.transaction-recipient { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.transaction-date { font-size: 12px; color: var(--text-muted); }
.transaction-amount-status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.transaction-amount { font-weight: 600; color: var(--text-primary); }
.transaction-status { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.transaction-status.status-success { background: rgba(16,185,129,0.1); color: var(--success); }
.transaction-status.status-warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.transaction-status.status-danger  { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ===== Transacciones Recientes Dashboard ===== */
.recent-tx-list {
    display: flex;
    flex-direction: column;
}

.recent-tx-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.recent-tx-row:last-child { border-bottom: none; }

.recent-tx-row:hover { background: var(--bg-secondary); border-radius: 8px; padding-left: 8px; padding-right: 8px; }

.rtx-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(99,102,241,0.04));
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.rtx-main {
    flex: 1;
    min-width: 0;
}

.rtx-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rtx-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.rtx-bank {
    font-weight: 500;
    color: var(--text-secondary);
}

.rtx-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.rtx-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.rtx-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 8px;
    border-radius: 20px;
}

.rtx-badge-success { background: rgba(16,185,129,0.1);  color: var(--success); }
.rtx-badge-warning { background: rgba(245,158,11,0.1);  color: var(--warning); }
.rtx-badge-danger  { background: rgba(239,68,68,0.1);   color: var(--danger);  }
.rtx-badge-muted   { background: var(--bg-tertiary);     color: var(--text-muted); }
/* ========================================
   RESULTADO DE TRANSFERENCIA
   ======================================== */
.transfer-result-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.result-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.result-header {
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.result-header.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.result-header.failed {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.result-header.pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.result-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-subtitle {
    font-size: 16px;
    opacity: 0.95;
}

.result-body {
    padding: 30px;
}

.result-amount {
    text-align: center;
    padding: 25px 0;
    border-bottom: 2px dashed var(--border-color);
    margin-bottom: 25px;
}

.amount-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.amount-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
}

.amount-usd {
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.result-reference {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    text-align: center;
}

.reference-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.reference-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.result-details {
    display: grid;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.result-actions {
    padding: 30px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-actions .btn-lg {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-top: 20px;
}

.error-message-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 8px;
}

.error-message-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .transfer-result-container {
        padding: 10px;
    }
    
    .result-header {
        padding: 30px 20px;
    }
    
    .result-icon {
        font-size: 48px;
    }
    
    .result-title {
        font-size: 22px;
    }
    
    .amount-value {
        font-size: 36px;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .detail-value {
        text-align: left;
    }
}

/* ========================================
   DEPOSIT METHODS - CARGAR SALDO
   ======================================== */

.deposit-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.deposit-method-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.deposit-method-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.deposit-method-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: white;
    box-shadow: var(--shadow-md);
}

.deposit-method-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.deposit-method-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.deposit-method-info {
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.7;
    font-weight: 500;
}

.deposit-method-fee {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.fee-free {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.4);
}

.fee-paid {
    background: rgba(230, 126, 34, 0.15);
    color: #e67e22;
    border: 1px solid rgba(230, 126, 34, 0.4);
}

.deposit-method-card .btn {
    width: 100%;
    font-weight: 600;
}

.deposit-method-card:hover .btn {
    transform: scale(1.05);
}

/* Historial de solicitudes */
#depositRequestsList {
    min-height: 200px;
}

.deposit-request-item {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.deposit-request-info {
    flex: 1;
}

.deposit-request-method {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.deposit-request-date {
    font-size: 12px;
    color: var(--text-muted);
}

.deposit-request-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.deposit-request-status.pending {
    background: var(--warning);
    color: white;
}

.deposit-request-status.approved {
    background: var(--success);
    color: white;
}

.deposit-request-status.rejected {
    background: var(--danger);
    color: white;
}

/* Responsive Styles for Quick Actions */
.quick-actions-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    flex: 1;
    min-width: 140px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .quick-actions-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .quick-action-btn {
        width: 100%;
        min-width: auto;
    }
    
    .quick-action-btn span {
        display: inline;
    }
}

/* ========================================
   ACCIONES DE FILA
   ======================================== */

/* Una sola accion PRIMARIA por fila —el paso que sigue— y el resto en tono
   bajo. Con tres botones solidos compitiendo, el operador tiene que leer los
   tres para saber cual corresponde; asi lo ve de un vistazo. */
.row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.row-actions .btn {
    padding: 7px 12px;
    font-size: 12.5px;
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
    border-radius: 7px;
}

/* Secundarias: contorno, sin relleno. Presentes pero sin pelear por la vista. */
.btn-quiet {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.btn-quiet:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Rechazar es destructivo: se mantiene apagado hasta que el mouse lo toca, y
   recien ahi se tiñe. Evita que un boton rojo permanente arrastre el clic. */
.btn-quiet-danger {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.btn-quiet-danger:hover {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
    border-color: var(--danger);
}

@media (max-width: 900px) {
    /* En pantallas angostas las etiquetas secundarias se van y quedan los
       iconos; la primaria conserva su texto. */
    .row-actions .btn-quiet .lbl,
    .row-actions .btn-quiet-danger .lbl { display: none; }
    .row-actions .btn-quiet,
    .row-actions .btn-quiet-danger { padding: 7px 9px; }
}


/* ========================================
   LOGIN — columna unica sobre tinta
   ======================================== */

/* Se descarta la pantalla partida con degradado: el que entra no necesita que
   lo convenzan, ya es usuario. Una columna sola, centrada, sin adornos que
   compitan con los dos campos que importan. */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #10151A;
    padding: 32px 20px;
}

.lg-col { width: 100%; max-width: 348px; }

.lg-brand { display: flex; align-items: center; gap: 10px; }
/* Sin filtro: la marca trae sus colores. Con brightness(0) invert(1) el
   cuadrado jade y la B blanca quedaban del mismo blanco y no se veia la letra. */
.lg-mark { width: 26px; height: 26px; object-fit: contain; }
.lg-name {
    color: #F2F3F0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
}

/* El par de divisas identifica el sistema mejor que un eslogan: quien entra
   viene a operar USDT contra bolivares. */
.lg-pair {
    display: flex; align-items: baseline; gap: 10px;
    margin: 28px 0 34px; padding-bottom: 14px;
    border-bottom: 1px solid #232B31;
}
.lg-pair-label {
    color: #6E7C74; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.lg-pair-value {
    margin-left: auto; color: #149074;
    font-family: var(--font-num); font-size: 13px; letter-spacing: 0.04em;
}

.lg-form { display: flex; flex-direction: column; gap: 20px; }
.lg-field { display: flex; flex-direction: column; gap: 7px; }

.lg-label {
    color: #8B978F; font-size: 11px; letter-spacing: 0.11em; text-transform: uppercase;
}

/* Campos con linea inferior, no cajas rellenas: menos peso visual y el foco
   se lee de inmediato. */
.lg-input {
    width: 100%; background: transparent; border: none;
    border-bottom: 1px solid #2B343B;
    color: #F2F3F0; font-size: 15px; padding: 7px 0;
    transition: border-color 0.15s ease;
}
.lg-input::placeholder { color: #4A5560; }
.lg-input:focus { outline: none; border-bottom-color: #149074; }
.lg-input:-webkit-autofill,
.lg-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #F2F3F0;
    -webkit-box-shadow: 0 0 0 1000px #10151A inset;
}

.lg-input-wrap { position: relative; }
.lg-input-wrap .lg-input { padding-right: 34px; }
.lg-eye {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #5C6870; cursor: pointer;
    padding: 4px; font-size: 13px;
}
.lg-eye:hover { color: #8B978F; }

.lg-submit {
    margin-top: 6px; width: 100%; padding: 12px;
    background: #0E6E58; color: #fff; border: none; border-radius: 3px;
    font-size: 14px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer;
    transition: background 0.15s ease;
}
.lg-submit:hover { background: #149074; }
.lg-submit:focus-visible { outline: 2px solid #149074; outline-offset: 2px; }

.lg-error {
    display: flex; align-items: center; gap: 9px;
    background: rgba(166,58,44,0.12); border: 1px solid rgba(166,58,44,0.35);
    color: #E08877; border-radius: 3px; padding: 10px 12px; font-size: 13px;
}
.lg-error[hidden] { display: none; }

.lg-links { display: flex; justify-content: space-between; gap: 12px; }
.lg-link { color: #6E7C74; font-size: 12.5px; text-decoration: none; }
.lg-link:hover { color: #149074; }

.lg-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-top: 40px; padding-top: 16px; border-top: 1px solid #1D242A;
}
.lg-tls { color: #4F5A54; font-size: 11.5px; display: flex; align-items: center; gap: 6px; }
.lg-partner { height: 15px; opacity: 0.4; filter: grayscale(1) brightness(2.4); }

@media (max-width: 420px) {
    .lg-pair { margin: 22px 0 26px; }
    .lg-foot { flex-direction: column; align-items: flex-start; gap: 10px; }
}


/* ========================================
   DASHBOARD — jerarquia por peso, no por tarjeta
   ======================================== */

/* Antes eran ~10 tarjetas iguales, cada una con su icono de color y su sombra.
   Todas pesaban lo mismo, asi que no habia primera lectura: para saber como
   viene el dia habia que leer las diez. Ahora la cifra principal manda y el
   resto vive en una tira densa, separada por lineas de 1px en vez de por
   sombras. Es la diagramacion de un tablero de operaciones, no de una galeria
   de widgets. */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0;
    background: var(--border-color);       /* las lineas son el fondo que asoma */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--bg-card);
    border: none;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    padding: 16px 18px;
    display: block;
    position: relative;
    transition: background 0.15s ease;
}
.stat-card:hover { background: var(--bg-secondary); transform: none; box-shadow: none; }

/* El acento vuelve como una barra fina a la izquierda. Ocupa 2px en vez de
   un circulo de 44px con icono, que era ruido repetido diez veces. */
.stat-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
    background: transparent;
}
.stat-card.accent-green::before  { background: var(--success); }
.stat-card.accent-blue::before   { background: var(--info); }
.stat-card.accent-gold::before   { background: var(--warning); }
.stat-card.accent-cyan::before   { background: var(--primary-light); }
.stat-card.accent-teal::before   { background: var(--primary); }
.stat-card.accent-purple::before { background: var(--text-secondary); }
.stat-card.accent-yellow::before { background: var(--warning); }

/* Los iconos de color se retiran: con diez tarjetas competian entre si y
   ninguno aportaba informacion que el rotulo no diera. */
.stat-card .stat-icon { display: none; }

.stat-card .stat-label {
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 7px;
}

.stat-card .stat-value {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.stat-card .stat-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 5px;
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-sub a { color: var(--primary); text-decoration: none; }
.stat-card .stat-sub a:hover { text-decoration: underline; }

/* La cifra que define el dia ocupa el ancho completo y va al doble de cuerpo.
   Se selecciona como hermana del saludo y no con :first-child, porque el
   saludo se renderiza DENTRO de la grilla y ocupa esa posicion: con
   :first-child la regla no llegaba a aplicarse nunca. */
.admin-dash-banner + .stat-card {
    grid-column: 1 / -1;
    padding: 22px 20px;
}
.admin-dash-banner + .stat-card .stat-value { font-size: 38px; letter-spacing: -0.02em; }
.admin-dash-banner + .stat-card .stat-label { font-size: 11px; }

/* Encabezado: se saca el bloque de color y queda una linea de texto con el
   estado del sistema a la derecha. */
/* El saludo tambien es hijo de la grilla, asi que necesita ocupar la fila
   entera y traer su propio fondo: si queda transparente, lo que se ve es el
   color de las lineas de la grilla como un bloque gris. */
.admin-dash-banner {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    background: var(--bg-card); border: none; box-shadow: none;
    padding: 16px 20px; margin: 0;
}
.admin-dash-banner h2 {
    font-size: 19px; font-weight: 600; color: var(--text-primary);
    margin: 0; letter-spacing: -0.01em;
}
.admin-status-pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-muted); border-radius: 3px;
    padding: 5px 10px; font-size: 11.5px; letter-spacing: 0.04em;
}
.admin-status-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--success);
}

/* Las tarjetas de contenido tambien pierden el desenfoque */
.card {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: none;
}
.card-header {
    border-bottom: 1px solid var(--border-color);
}
.card-title {
    font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
}

/* Cualquier cifra de tabla se lee alineada */
.data-table td { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid .stat-card:first-child .stat-value { font-size: 30px; }
}
