:root {
    --bg-dark: #0f1523;
    --bg-card: #161e2e;
    --bg-input: #1a2235;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #0ea5e9;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --border-color: #2e3b52;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* Chrome, Safari, Edge, Opera: Eliminar flechas de inputs numéricos */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox: Eliminar flechas de inputs numéricos */
input[type=number] {
    -moz-appearance: textfield;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    padding: 0 15px 70px 15px; /* Margen de respeto global a los lados y fondo */
    overflow-x: hidden;
    width: 100%;
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}
.btn-primary:hover {
    background-color: #2563eb;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background-color: var(--bg-card);
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.topbar-left {
    display: flex;
    gap: 12px;
}

/* Account Bar */
.account-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.account-name {
    font-weight: 500;
    color: var(--text-secondary);
}

.account-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Inputs & Selects */
.select-dropdown, input[type="text"], input[type="number"], input[type="password"], input[type="datetime-local"] {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
}
.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0 12px;
}
.search-box input {
    border: none;
    background: transparent;
    padding-left: 8px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}
.tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}
.tab.active {
    color: var(--text-primary);
}
.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--text-primary);
}
.badge {
    background-color: var(--bg-card);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 6px;
}

/* Bot Grid */
.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

/* Bot Card */
.bot-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}
.bot-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}
.pair {
    font-weight: 700;
    font-size: 18px;
}
.trade-type.venta { color: var(--accent-red); font-size: 12px; margin-left: 8px;}
.trade-type.compra { color: var(--accent-green); font-size: 12px; margin-left: 8px;}
.bot-status {
    color: var(--text-secondary);
    font-size: 12px;
}
.bot-id {
    font-weight: 600;
    font-size: 16px;
    display: block;
    text-align: right;
}

.bot-params {
    margin-bottom: 20px;
}
.param-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.param-val {
    color: var(--text-primary);
    font-weight: 500;
}

.bot-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}
.configured-badge {
    color: var(--accent-green);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Utils */
.text-cyan { color: var(--accent-blue); }

/* Stepper (Create Bot) */
.stepper-container {
    max-width: 800px;
    margin: 40px auto;
}
.stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}
.step.active {
    color: var(--text-primary);
}
.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.step.active .step-circle {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}
.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: var(--border-color);
    margin: 0 16px;
    margin-top: -24px;
}
.step-line.active {
    background-color: var(--accent-blue);
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
}
.card-header {
    margin-bottom: 24px;
}
.card-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
}
.card-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Toggle Switch */
.switch-container {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 12px;
    gap: 10px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3f4350;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-green);
}
input:checked + .slider:before {
    transform: translateX(20px);
}
.switch-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Mini Switch Perfecto y Alineado */
.mini-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    margin: 0;
}
.mini-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.mini-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #374151;
    transition: .3s ease;
    border-radius: 20px;
}
.mini-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: .3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
input:checked + .mini-slider {
    background-color: #10b981;
}
input:checked + .mini-slider:before {
    transform: translateX(16px);
}
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    background-color: #848e9c;
    transition: background-color 0.3s ease;
}
.status-dot.active {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

/* Animations & Premium Aesthetics */
@keyframes botCardEnter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }
    100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); }
}

.bot-card {
    background: linear-gradient(145deg, rgba(22, 30, 46, 0.9), rgba(15, 21, 35, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

/* Glass shine effect */
.bot-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.7s ease;
    z-index: 1;
    pointer-events: none;
}

.bot-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.4);
}

.bot-card:hover::before {
    left: 200%;
}

.first-load .bot-card {
    animation: botCardEnter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.first-load .bot-card:nth-child(1) { animation-delay: 0.05s; }
.first-load .bot-card:nth-child(2) { animation-delay: 0.15s; }
.first-load .bot-card:nth-child(3) { animation-delay: 0.25s; }
.first-load .bot-card:nth-child(4) { animation-delay: 0.35s; }
.first-load .bot-card:nth-child(5) { animation-delay: 0.45s; }

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn:active {
    transform: scale(0.92) translateY(0);
}

/* Switches & Toggles */
.switch-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.switch-container:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.slider {
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

input:checked + .slider {
    background: linear-gradient(90deg, #10b981, #059669);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.status-dot.active {
    animation: pulseGlow 2s infinite;
}

/* Modal animations */
@keyframes modalEnter {
    0% { opacity: 0; transform: scale(0.9) translateY(20px) rotateX(-10deg); }
    100% { opacity: 1; transform: scale(1) translateY(0) rotateX(0); }
}

#quick-edit-modal {
    backdrop-filter: blur(8px);
    transition: opacity 0.3s;
}

#quick-edit-modal .card {
    background: linear-gradient(145deg, rgba(22, 30, 46, 0.95), rgba(15, 21, 35, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalEnter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    transform-origin: center bottom;
}

/* Inputs */
input, select {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

input:focus, select:focus {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), 0 0 15px rgba(14, 165, 233, 0.1) !important;
    transform: translateY(-1px);
}

/* Tabs */
.tab {
    transition: color 0.3s, transform 0.2s;
}
.tab:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}
.tab.active::after {
    transition: all 0.3s ease;
    box-shadow: 0 -2px 10px var(--accent-blue);
    background-color: var(--accent-blue);
}

/* Navbar */
.nav-btn { background: transparent; border: 1px solid rgba(255,255,255,0.1); color: var(--text-secondary); padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: all 0.3s; font-weight: 600; font-size: 14px; backdrop-filter: blur(4px); }
.nav-btn:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-btn.active { background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(59,130,246,0.2)); border-color: rgba(14,165,233,0.4); color: var(--accent-blue); box-shadow: 0 0 15px rgba(14,165,233,0.1); }
@keyframes loadingBar { 0% { left: -40%; } 100% { left: 100%; } }

select { appearance: none; -webkit-appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: right 1rem top 50%; background-size: 0.65rem auto; }
select option { background-color: #0f1523; color: #f8fafc; padding: 12px; }

/* Radio Chips */
.chip-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip-label { position: relative; cursor: pointer; }
.chip-label input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.chip-content { display: block; padding: 10px 8px; text-align: center; border-radius: 8px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); color: var(--text-secondary); font-size: 13px; font-weight: 500; transition: all 0.3s; }
.chip-label:hover input ~ .chip-content { background: rgba(255,255,255,0.05); }
.chip-label input:checked ~ .chip-content { background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(59,130,246,0.2)); border-color: rgba(14,165,233,0.5); color: var(--accent-blue); box-shadow: 0 0 15px rgba(14,165,233,0.1); font-weight: 700; }

.chip-group-horizontal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE ADAPTATION)
   ========================================================================== */
@media (max-width: 768px) {
    .app-container {
        padding: 15px 20px !important; /* Más margen lateral para móviles */
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Topbar Navigation */
    .topbar {
        flex-direction: column !important;
        align-items: center !important; /* Centrado perfecto */
        gap: 15px !important;
        text-align: center;
    }
    
    .topbar > div:nth-child(2) {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .nav-btn {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
        font-size: 12px;
        padding: 8px;
    }
    
    /* Dashboard Grids */
    div[style*="grid-template-columns: repeat(3, 1fr)"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 2fr 1fr"],
    div[style*="grid-template-columns: repeat(4, 1fr)"],
    .bots-grid,
    #accounts-list-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        width: 100% !important;
    }
    
    /* Flexbox side-by-side elements */
    div[style*="display: flex; justify-content: space-between; gap: 20px;"] {
        flex-direction: column !important;
    }
    
    /* Oráculo y Calculadora Inputs */
    .chip-group-horizontal {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Títulos e info del Dashboard */
    div[style*="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;"],
    div[style*="display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;"] {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 15px !important;
    }
    
    /* Termómetro */
    div[style*="display: flex; justify-content: space-between; align-items: center; max-width: 600px;"] {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    div[style*="text-align: left; width: 45%;"],
    div[style*="text-align: right; width: 45%;"] {
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Cards */
    .bot-card {
        padding: 15px !important;
    }
    
    /* Select del dashboard */
    #dashAccountSelect {
        width: 100% !important;
    }
    
    /* Ocultar partículas en móviles para mejorar lectura y rendimiento */
    #particles-bg {
        display: none !important;
    }
}

/* Custom Dropdown select widget */
.custom-select-container {
    position: relative;
    user-select: none;
    z-index: 1000;
}
.custom-select-container.open {
    z-index: 1010 !important;
}
.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    height: 32px;
}
.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}
.custom-select-container.open .custom-select-trigger {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), 0 0 15px rgba(14, 165, 233, 0.1) !important;
}
.custom-select-arrow {
    font-size: 9px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    margin-left: 8px;
}
.custom-select-container.open .custom-select-arrow {
    transform: rotate(180deg);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: linear-gradient(145deg, rgba(22, 30, 46, 0.95), rgba(15, 21, 35, 0.98)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    display: none;
    max-height: 250px;
    overflow-y: auto;
    padding: 6px;
    z-index: 9999;
    animation: fadeInDropdown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.custom-select-container.open .custom-select-options {
    display: block;
}
.custom-select-option {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
}
.custom-select-option.selected {
    background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(59,130,246,0.2)) !important;
    color: var(--accent-blue) !important;
    font-weight: 700;
}
.custom-select-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Custom dialog backdrop */
.custom-dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 21, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.custom-dialog-card {
    background: linear-gradient(145deg, rgba(22, 30, 46, 0.95), rgba(15, 21, 35, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    text-align: center;
}
.custom-dialog-icon {
    font-size: 32px;
    margin-bottom: 16px;
    display: inline-block;
}
.custom-dialog-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}
.custom-dialog-message {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}
.custom-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.custom-dialog-btn {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.custom-dialog-btn-ok {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.custom-dialog-btn-ok:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-1px);
}
.custom-dialog-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}
.custom-dialog-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}
.btn-danger-action:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px #ef4444);
    transition: all 0.2s ease;
}

/* Premium Custom Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Force vertical scrollbar and enable smooth scrolling */
html, body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important; /* iOS Momentum Scrolling */
    scroll-behavior: smooth;
    height: auto !important;
    min-height: 100% !important;
}

/* Hide text in buttons when the screen width drops to prevent overflowing cards */
@media (max-width: 1200px) {
    .btn-text {
        display: none;
    }
}

/* ==========================================================================
   ADVANCED MOBILE UX OPTIMIZATIONS (PHONE PORTRAIT/LANDSCAPE COMFORT)
   ========================================================================== */
@media (max-width: 768px) {
    /* Touch target & sizing enhancements */
    .btn, .nav-btn {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Make tables responsive with horizontal scrolling */
    .bot-card table, table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
    }
    
    /* Banesco bot controls button layout on mobile */
    .bot-controls-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .bot-controls-row button {
        width: 100% !important;
        margin: 0 !important;
        height: 44px !important;
        font-size: 13px !important;
        padding: 8px !important;
    }
    
    /* Float widget positioning */
    #floating-calculator-panel {
        width: calc(100vw - 30px) !important;
        max-width: 350px !important;
        bottom: 80px !important;
        left: 15px !important;
    }
    #floating-termometro-popup {
        width: calc(100vw - 30px) !important;
        max-width: 320px !important;
        bottom: 80px !important;
        right: 15px !important;
    }
    #floating-calculator-badge,
    #floating-termometro-badge {
        padding: 10px 20px !important;
        font-size: 14px !important;
        height: 42px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

@media (max-width: 600px) {
    /* Ocultar barra superior y controles en móviles */
    .topbar > div:nth-child(2),
    .header-controls {
        display: none !important;
    }
    
    /* Terminal Console responsiveness */
    #bb-terminal {
        height: 180px !important;
        font-size: 10.5px !important;
    }
    
    /* Inputs sizing for easier tapping & prevent auto zoom on focus in iOS */
    input[type="text"], input[type="number"], input[type="password"], select {
        padding: 10px 12px !important;
        font-size: 16px !important; 
    }
}

/* ==========================================
   MOBILE WEB APP STYLING (PREMIUM NATIVE-LOOK)
   ========================================== */

/* Show bottom navigation bar and hide desktop top header options on mobile */
.mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 65px !important;
    background: rgba(15, 21, 35, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    z-index: 999999 !important;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    user-select: none;
}

.mobile-nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    gap: 4px;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mobile-nav-item * {
    pointer-events: none;
}

.mobile-nav-item .icon {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.mobile-nav-item.active {
    color: var(--accent-blue);
}

.mobile-nav-item.active .icon {
    transform: translateY(-2px) scale(1.1);
    filter: drop-shadow(0 0 5px rgba(14, 165, 233, 0.4));
}

/* Mobile Settings Sheet / Drawer */
.mobile-sheet {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000000 !important;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-sheet.active {
    visibility: visible;
    opacity: 1;
}

.mobile-sheet-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-sheet-content {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    max-height: 80%;
    overflow-y: auto;
    transition: bottom 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}

.mobile-sheet.active .mobile-sheet-content {
    bottom: 0;
}

.mobile-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.mobile-sheet-handle {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.mobile-sheet-header h3 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.mobile-sheet-header .close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sheet-toggles-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.sheet-control-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: white;
}

.sheet-buttons-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-sheet {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: white;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.btn-sheet:active {
    background: rgba(255, 255, 255, 0.1);
}

.btn-sheet.logout-btn {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
}

/* Responsividad para pantallas pequeñas */
body {
    padding-bottom: 180px !important; /* Espacio holgado para no chocar con la barra de navegación ni botones flotantes */
}

.main-view {
    padding-bottom: 160px !important;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 200px !important; /* Espacio extra en dispositivos móviles */
    }
    
    /* Ocultar barra superior en mobile */
    .topbar > div:nth-child(2),
    .topbar > div:nth-child(3) {
        display: none !important;
    }
    
    .topbar {
        margin-bottom: 20px !important;
        padding: 10px 0 !important;
    }

    .mobile-bottom-nav {
        display: flex !important;
    }
}

@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.glow-btn {
    animation: pulse-danger 1.5s infinite;
}

/* ==========================================================================
   SISTEMA DE DISEÑO FINTECH $100,000 LUXURY UI DESIGN SYSTEM
   ========================================================================== */

/* 1. Iluminación Ambiental Mesh Gradient de Fondo */
body::before {
    content: '';
    position: fixed;
    top: -15%;
    left: -10%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.07) 0%, rgba(15, 21, 35, 0) 70%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -15%;
    right: -10%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(15, 21, 35, 0) 70%);
    pointer-events: none;
    z-index: -1;
}

/* 2. Tarjetas y Paneles Glassmorphic con Borde Metálico Fino */
.bot-card, .account-bar, #global-capital-header > div > div {
    background: linear-gradient(145deg, rgba(22, 30, 46, 0.92), rgba(15, 21, 35, 0.96)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* 3. Estilos de Inputs y Dropdowns de Alta Calidad */
.select-dropdown, input[type="text"], input[type="number"], input[type="password"], input[type="datetime-local"] {
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 8px !important;
    color: #f8fafc !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-variant-numeric: tabular-nums;
}

.select-dropdown:focus, input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="datetime-local"]:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 0 15px rgba(59, 130, 246, 0.2) !important;
    background: rgba(15, 23, 42, 0.98) !important;
}

/* 4. Botones de Navegación Superior Elegantes */
.nav-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateY(-1px) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.12)) !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
    color: #60a5fa !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.25) !important;
}

/* 5. Tabla de Historial con Filas de Cristal Fluido */
.hover-row {
    transition: all 0.2s ease !important;
}

.hover-row:hover {
    background: rgba(59, 130, 246, 0.07) !important;
    transform: scale(1.002);
}

/* 6. Barra de Navegación Inferior Móvil Estilo iOS Glass App */
.mobile-bottom-nav {
    background: rgba(11, 17, 31, 0.92) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7) !important;
}

.mobile-nav-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mobile-nav-item.active {
    color: #38bdf8 !important;
}

.mobile-nav-item.active .mobile-nav-icon {
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6)) !important;
    transform: translateY(-2px) scale(1.1) !important;
}

/* 7. Tipografía Monospaciada para Cifras de Capital */
#g-capital-free, #g-capital-locked, #g-capital-appeals, #g-capital-banesco, #g-capital-total, .val-moneda {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.4px;
}

/* 8. Barra Lateral de Desplazamiento Visible, Estilizada y Ergonómica */
html, body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin !important;
    scrollbar-color: #38bdf8 rgba(15, 23, 42, 0.9) !important;
    -ms-overflow-style: auto !important;
}

::-webkit-scrollbar {
    width: 10px !important;
    height: 10px !important;
    background: rgba(15, 23, 42, 0.85) !important;
    display: block !important;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.8) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%) !important;
    border-radius: 10px !important;
    border: 2px solid rgba(15, 23, 42, 0.9) !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6) !important;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #38bdf8 100%) !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 1) !important;
}

::-webkit-scrollbar-thumb:active {
    background: #0ea5e9 !important;
}

