/* ═══════════════════════════════════════════════════════════
   QUANTUM AI — Panel de Control
   Tema oscuro tipo dashboard de trading profesional
   ═══════════════════════════════════════════════════════════ */

/* Fix: [hidden] attribute must win over any display rule */
[hidden] { display: none !important; }

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg-root:          #050d1a;
    --bg-card:          #0d1b35;
    --bg-card-border:   rgba(255,255,255,0.08);
    --bg-input:         #0a0f1f;
    --bg-input-focus:   #0f1630;
    --bg-modal:         #0d1b35;

    --color-active:     #3ccf91;
    --color-active-dim: rgba(60, 207, 145, 0.12);
    --color-paused:     #f8c12f;
    --color-paused-dim: rgba(248, 193, 47, 0.12);

    --btn-pause:        #e74c3c;
    --btn-pause-hover:  #c0392b;
    --btn-pause-dim:    rgba(231, 76, 60, 0.15);
    --btn-activate:     #27ae60;
    --btn-activate-hover: #219a52;
    --btn-activate-dim: rgba(39, 174, 96, 0.15);

    --text-primary:     #f1f5f9;
    --text-secondary:   #94a3b8;
    --text-muted:       #475569;
    --text-error:       #ff6b6b;

    --border:           rgba(255, 255, 255, 0.07);
    --border-focus:     rgba(59, 130, 246, 0.5);
    --glow-blue:        rgba(59, 130, 246, 0.15);

    --primary:          #3399ff;
    --primary-hover:    #2277ee;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.5);
    --shadow-btn:  0 4px 16px rgba(0, 0, 0, 0.35);
    --transition:  all 0.2s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background-color: var(--bg-root);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.screen {
    min-height: 100vh;
}

/* ════════════════════════════════════════════════════════════
   PANTALLA DE LOGIN
════════════════════════════════════════════════════════════ */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, #1a1f4a 0%, var(--bg-root) 70%);
}

/* Partículas decorativas */
.particles-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 8s infinite ease-in-out;
}

.particle-dot:nth-child(1) { top: 20%; left: 15%; animation-delay: 0s;   animation-duration: 7s;  }
.particle-dot:nth-child(2) { top: 70%; left: 80%; animation-delay: 1.5s; animation-duration: 9s;  }
.particle-dot:nth-child(3) { top: 40%; left: 60%; animation-delay: 3s;   animation-duration: 6s;  }
.particle-dot:nth-child(4) { top: 80%; left: 30%; animation-delay: 4.5s; animation-duration: 8s;  }
.particle-dot:nth-child(5) { top: 10%; left: 70%; animation-delay: 2s;   animation-duration: 10s; }

@keyframes float-particle {
    0%, 100% { opacity: 0; transform: translateY(0) scale(1); }
    50%       { opacity: 0.6; transform: translateY(-30px) scale(2); }
}

/* Login Box */
.login-container {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card), 0 0 60px rgba(99, 132, 255, 0.06);
    position: relative;
    z-index: 1;
}

/* Logo */
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px var(--primary));
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

/* Titles */
.login-title {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 36px;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Input wrapper for eye toggle */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    flex: 1;
    padding-right: 44px; /* espacio para el botón ojo */
}

.btn-eye {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.btn-eye:hover {
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    padding: 12px 16px;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.form-group select {
    appearance: none;
    cursor: pointer;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--glow-blue);
}

/* Error message */
.error-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text-error);
    font-size: 13px;
    padding: 10px 14px;
    text-align: center;
    animation: slide-down 0.2s ease;
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Login button */
.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, #4a6ef5 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 14px;
    transition: var(--transition);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #5d7fff 100%);
    box-shadow: 0 4px 20px rgba(99, 132, 255, 0.35);
    transform: translateY(-1px);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Back link */
.back-link {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 24px;
    text-align: center;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-secondary);
}


/* ════════════════════════════════════════════════════════════
   PANEL DE CONTROL
════════════════════════════════════════════════════════════ */
#panel-screen {
    display: flex;
    flex-direction: column;
    background: var(--bg-root);
}

.panel-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Panel Header ───────────────────────────────────────────── */
.panel-header {
    background: rgba(17, 20, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.panel-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.panel-badge {
    background: rgba(99, 132, 255, 0.12);
    border: 1px solid rgba(99, 132, 255, 0.2);
    border-radius: 20px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    text-transform: uppercase;
    display: none;
}

@media (min-width: 480px) {
    .panel-badge { display: inline-flex; }
}

.panel-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-email {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
}

@media (min-width: 520px) {
    .user-email { display: block; }
}

.btn-logout {
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
    padding: 8px 12px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
    color: var(--text-error);
}

/* ── Panel Main ─────────────────────────────────────────────── */
.panel-main {
    flex: 1;
    padding: 16px 16px 40px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 600px) {
    .panel-main { max-width: 700px; padding: 20px 24px 48px; }
}

@media (min-width: 960px) {
    .panel-main { max-width: 1100px; padding: 28px 40px 56px; }
}

@media (min-width: 1280px) {
    .panel-main { max-width: 1280px; padding: 32px 60px 64px; }
}

/* ── Status Card ────────────────────────────────────────────── */
.status-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.status-card-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 20px 24px;
}

.status-card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.live-badge {
    align-items: center;
    background: rgba(60, 207, 145, 0.08);
    border: 1px solid rgba(60, 207, 145, 0.2);
    border-radius: 20px;
    color: var(--color-active);
    display: flex;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
    padding: 4px 12px;
}

.live-dot {
    background: var(--color-active);
    border-radius: 50%;
    display: inline-block;
    height: 7px;
    width: 7px;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1;   transform: scale(1);   box-shadow: 0 0 0 0 rgba(60,207,145,0.6); }
    50%       { opacity: 0.7; transform: scale(0.9); box-shadow: 0 0 0 5px rgba(60,207,145,0); }
}

/* ── State Views ────────────────────────────────────────────── */
.state-view {
    padding: 0;
}

/* Loading */
.loading-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-ring {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

/* Error */
.error-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
}

.error-icon {
    font-size: 32px;
}

.error-view p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 280px;
}

.btn-retry {
    background: rgba(99, 132, 255, 0.1);
    border: 1px solid rgba(99, 132, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    transition: var(--transition);
    margin-top: 4px;
}

.btn-retry:hover {
    background: rgba(99, 132, 255, 0.18);
    border-color: rgba(99, 132, 255, 0.35);
}

/* ── Status Indicator ───────────────────────────────────────── */
.status-indicator {
    align-items: center;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    transition: var(--transition);
}

.status-indicator.is-active {
    background: var(--color-active-dim);
    border: 1px solid rgba(60, 207, 145, 0.2);
}

.status-indicator.is-paused {
    background: var(--color-paused-dim);
    border: 1px solid rgba(248, 193, 47, 0.2);
}

.status-icon {
    font-size: 36px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px currentColor);
}

.status-text-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-label {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.status-indicator.is-active  .status-label { color: var(--color-active); }
.status-indicator.is-paused  .status-label { color: var(--color-paused); }

.status-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* ── Info Grid ──────────────────────────────────────────────── */
.info-grid {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: grid;
    gap: 0;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 28px;
    overflow: hidden;
}

.info-item {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
}

.info-item:nth-child(2n) {
    border-right: none;
}

.info-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.info-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.info-value.mono {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.5px;
    color: var(--primary);
}

.info-value.money {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

/* Magic number row with eye toggle */
.magic-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-eye-sm {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 3px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.btn-eye-sm:hover { color: var(--text-secondary); }

/* ── P&L Indicator ──────────────────────────────────────────── */
.pnl-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

.pnl-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.pnl-values {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pnl-amount {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pnl-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
}

.pnl-indicator.is-positive {
    border-color: rgba(60, 207, 145, 0.2);
    background: rgba(60, 207, 145, 0.04);
}
.pnl-indicator.is-positive .pnl-amount { color: var(--color-active); }
.pnl-indicator.is-positive .pnl-badge {
    background: rgba(60, 207, 145, 0.12);
    color: var(--color-active);
}

.pnl-indicator.is-negative {
    border-color: rgba(231, 76, 60, 0.2);
    background: rgba(231, 76, 60, 0.04);
}
.pnl-indicator.is-negative .pnl-amount { color: var(--btn-pause); }
.pnl-indicator.is-negative .pnl-badge {
    background: rgba(231, 76, 60, 0.12);
    color: var(--btn-pause);
}

.pnl-indicator.is-neutral {
    border-color: var(--border);
}
.pnl-indicator.is-neutral .pnl-amount { color: var(--text-primary); }
.pnl-indicator.is-neutral .pnl-badge {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}

/* ── Chart Card ─────────────────────────────────────────────── */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    margin-top: 16px;
    overflow: hidden;
}

.chart-card-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 20px 24px;
}

.chart-card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.chart-range-label {
    color: var(--text-muted);
    font-size: 12px;
}

.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.chart-container {
    padding: 16px 20px 20px;
    height: 240px;
    position: relative;
}

@media (min-width: 480px) {
    .chart-container { height: 280px; }
}

.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

/* ── Action Zone ────────────────────────────────────────────── */
.action-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.btn-toggle {
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    min-width: 240px;
    padding: 16px 32px;
    transition: var(--transition);
    text-transform: uppercase;
}

.btn-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-toggle.is-pause {
    background: linear-gradient(135deg, var(--btn-pause) 0%, #c0392b 100%);
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.3);
    color: #fff;
}

.btn-toggle.is-pause:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--btn-pause-hover) 0%, #a93226 100%);
    box-shadow: 0 6px 28px rgba(231, 76, 60, 0.45);
    transform: translateY(-2px);
}

.btn-toggle.is-activate {
    background: linear-gradient(135deg, var(--btn-activate) 0%, #219a52 100%);
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.3);
    color: #fff;
}

.btn-toggle.is-activate:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--btn-activate-hover) 0%, #1e8449 100%);
    box-shadow: 0 6px 28px rgba(39, 174, 96, 0.45);
    transform: translateY(-2px);
}

.btn-toggle:active:not(:disabled) {
    transform: translateY(0) !important;
}

.action-hint {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    max-width: 320px;
    line-height: 1.5;
}

/* ── Manuales de Instalación ──────────────────────────────────── */
.manuales-section {
    margin-top: 16px;
}

.manuales-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.manuales-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 520px) {
    .manuales-grid { grid-template-columns: 1fr; }
}

.manual-card {
    background: linear-gradient(135deg, rgba(212,175,55,0.07) 0%, rgba(212,175,55,0.02) 100%);
    border: 1px solid rgba(212,175,55,0.22);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manual-card-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.manual-card-text {
    flex: 1;
}

.manual-card-text h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.manual-card-text p {
    font-size: 0.79rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.manual-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-manual {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn-manual-view {
    background: rgba(212,175,55,0.08);
    border: 1px solid rgba(212,175,55,0.3);
    color: #d4af37;
}
.btn-manual-view:hover {
    background: rgba(212,175,55,0.16);
    border-color: #d4af37;
}

.btn-manual-download {
    background: transparent;
    border: 1px solid rgba(212,175,55,0.15);
    color: var(--text-secondary);
}
.btn-manual-download:hover {
    background: rgba(212,175,55,0.09);
    border-color: rgba(212,175,55,0.35);
    color: #d4af37;
}

/* ── Disclaimer ─────────────────────────────────────────────── */
.panel-disclaimer {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
    margin-top: 20px;
    text-align: center;
    padding: 0 8px;
}


/* ════════════════════════════════════════════════════════════
   MODAL DE CONFIRMACIÓN
════════════════════════════════════════════════════════════ */
.modal-overlay {
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 24px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
    animation: fade-in 0.15s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: var(--bg-modal);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 380px;
    padding: 36px 32px;
    text-align: center;
    width: 100%;
    animation: scale-in 0.2s ease;
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.93); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-icon {
    font-size: 40px;
    line-height: 1;
}

.modal-title {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.modal-body {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    max-width: 280px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

.btn-modal-cancel,
.btn-modal-confirm {
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex: 1;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    transition: var(--transition);
}

.btn-modal-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-modal-confirm {
    border: none;
    color: #fff;
}

.btn-modal-confirm.is-danger {
    background: linear-gradient(135deg, var(--btn-pause), var(--btn-pause-hover));
    box-shadow: 0 2px 12px rgba(231, 76, 60, 0.3);
}

.btn-modal-confirm.is-danger:hover {
    background: linear-gradient(135deg, var(--btn-pause-hover), #a93226);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.45);
}

.btn-modal-confirm.is-success {
    background: linear-gradient(135deg, var(--btn-activate), var(--btn-activate-hover));
    box-shadow: 0 2px 12px rgba(39, 174, 96, 0.3);
}

.btn-modal-confirm.is-success:hover {
    background: linear-gradient(135deg, var(--btn-activate-hover), #1e8449);
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.45);
}


/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .login-container {
        padding: 36px 24px;
    }

    .status-card-header {
        padding: 16px 18px;
    }

    .state-view {
        padding: 18px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-item:nth-child(2n) {
        border-right: none;
    }

    .info-item {
        border-right: none;
    }

    .info-item:last-child {
        border-bottom: none;
    }

    .info-item:nth-last-child(-n+2) {
        border-bottom: 1px solid var(--border);
    }

    .info-item:last-child {
        border-bottom: none;
    }

    .btn-toggle {
        min-width: unset;
        width: 100%;
    }

    .modal-box {
        padding: 28px 20px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }
}


/* ════════════════════════════════════════════════════════════
   VPS — BOTÓN EN EL HEADER
════════════════════════════════════════════════════════════ */
.btn-vps-header {
    align-items: center;
    background: rgba(60, 207, 145, 0.07);
    border: 1px solid rgba(60, 207, 145, 0.2);
    border-radius: var(--radius-sm);
    color: var(--color-active);
    cursor: pointer;
    display: flex;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
    padding: 8px 12px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-vps-header:hover {
    background: rgba(60, 207, 145, 0.14);
    border-color: rgba(60, 207, 145, 0.35);
    box-shadow: 0 0 12px rgba(60, 207, 145, 0.12);
}

.btn-vps-header.is-connected {
    background: rgba(60, 207, 145, 0.12);
    border-color: rgba(60, 207, 145, 0.3);
    box-shadow: 0 0 10px rgba(60, 207, 145, 0.1);
}


/* ════════════════════════════════════════════════════════════
   VPS — SECCIÓN PRINCIPAL
════════════════════════════════════════════════════════════ */
.vps-section {
    background: var(--bg-card);
    border: 1px solid rgba(60, 207, 145, 0.18);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card), 0 0 40px rgba(60, 207, 145, 0.04);
    margin-bottom: 16px;
    overflow: hidden;
}

/* Header */
.vps-section-hdr {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 24px;
}

.vps-section-title {
    align-items: center;
    display: flex;
    gap: 10px;
}

.vps-cloud-icon { font-size: 20px; }

.vps-section-title h2 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

/* Health badge */
.vps-health-badge {
    align-items: center;
    border-radius: 20px;
    display: flex;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
    padding: 4px 12px;
}

.vps-health-badge.health-ok {
    background: rgba(60, 207, 145, 0.08);
    border: 1px solid rgba(60, 207, 145, 0.2);
    color: var(--color-active);
}

.vps-health-badge.health-warn {
    background: rgba(248, 193, 47, 0.08);
    border: 1px solid rgba(248, 193, 47, 0.2);
    color: var(--color-paused);
}

/* Métricas */
.vps-metrics-grid {
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 500px) {
    .vps-metrics-grid { grid-template-columns: repeat(5, 1fr); }
}

.vps-metric {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
}

.vps-metric:last-child { border-right: none; }

@media (max-width: 499px) {
    .vps-metric:nth-child(even)    { border-right: none; }
    .vps-metric:nth-child(-n+4)    { border-bottom: 1px solid var(--border); }
    .vps-metric:last-child         { border-bottom: none; }
}

.vps-metric-lbl {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.vps-metric-val {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.vps-metric-val.is-gain { color: var(--color-active); }
.vps-metric-val.is-loss { color: var(--btn-pause); }

/* Toggle panel */
.vps-toggle-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    padding: 16px 24px;
}

.vps-toggle-status {
    align-items: center;
    display: flex;
    gap: 12px;
}

.vps-panel-icon { font-size: 20px; }

.vps-panel-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vps-panel-txt strong {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.vps-panel-txt span {
    color: var(--text-secondary);
    font-size: 12px;
}

.btn-vps-toggle {
    align-items: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    flex-shrink: 0;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
    padding: 10px 18px;
    transition: var(--transition);
}

.btn-vps-toggle.is-running {
    background: var(--btn-pause-dim);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: var(--btn-pause);
}

.btn-vps-toggle.is-running:hover {
    background: rgba(231, 76, 60, 0.2);
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.15);
}

.btn-vps-toggle.is-stopped {
    background: var(--btn-activate-dim);
    border: 1px solid rgba(39, 174, 96, 0.2);
    color: var(--btn-activate);
}

.btn-vps-toggle.is-stopped:hover {
    background: rgba(39, 174, 96, 0.2);
    box-shadow: 0 0 12px rgba(39, 174, 96, 0.15);
}

/* Gráfico VPS */
.vps-chart-wrap  { border-bottom: 1px solid var(--border); }
.vps-orders-wrap { border-bottom: 1px solid var(--border); }

.vps-chart-hdr,
.vps-orders-hdr,
.vps-services-hdr {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 16px 24px 8px;
}

.vps-chart-hdr h3,
.vps-orders-hdr h3,
.vps-services-hdr h3 {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.vps-chart-body {
    height: 200px;
    padding: 4px 16px 16px;
    position: relative;
}

@media (min-width: 480px) {
    .vps-chart-body { height: 240px; }
}

/* Órdenes */
.vps-orders-badge {
    background: rgba(99, 132, 255, 0.1);
    border: 1px solid rgba(99, 132, 255, 0.15);
    border-radius: 20px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
}

.vps-orders-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 24px 16px;
}

.vps-order-item {
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 9px 12px;
}

.vps-order-type {
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    text-transform: uppercase;
}

.vps-order-type.buy  { background: rgba(60,207,145,0.12); color: var(--color-active); }
.vps-order-type.sell { background: rgba(231,76,60,0.12);  color: var(--btn-pause); }

.vps-order-symbol {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    min-width: 64px;
}

.vps-order-detail {
    color: var(--text-muted);
    font-size: 12px;
}

.vps-order-pnl {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

.vps-order-pnl.pos  { color: var(--color-active); }
.vps-order-pnl.neg  { color: var(--btn-pause); }
.vps-order-pnl.zero { color: var(--text-secondary); }

.vps-order-status {
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 2px 7px;
    text-transform: uppercase;
}

.vps-order-status.open   { background: rgba(99,132,255,0.1); color: var(--primary); }
.vps-order-status.closed { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* Servicios */
.vps-services-wrap { padding-bottom: 0; }

.vps-services-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, 1fr);
    padding: 4px 24px 20px;
}

@media (min-width: 500px) {
    .vps-services-grid { grid-template-columns: repeat(4, 1fr); }
}

.vps-service {
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 8px;
    text-align: center;
}

.svc-dot {
    border-radius: 50%;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.svc-dot.ok   { background: var(--color-active); box-shadow: 0 0 6px rgba(60,207,145,0.5); }
.svc-dot.warn { background: var(--color-paused); }
.svc-dot.err  { background: var(--btn-pause); }

.svc-name {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.svc-val {
    font-size: 11px;
    font-weight: 600;
}

.svc-val.ok   { color: var(--color-active); }
.svc-val.warn { color: var(--color-paused); }
.svc-val.err  { color: var(--btn-pause); }
.svc-val.stop { color: var(--text-secondary); }

/* Fila desconectar */
.vps-disconnect-row {
    align-items: center;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 24px;
}

.btn-vps-disconnect {
    background: rgba(231, 76, 60, 0.07);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: var(--radius-sm);
    color: var(--btn-pause);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 7px 14px;
    transition: var(--transition);
}

.btn-vps-disconnect:hover {
    background: rgba(231, 76, 60, 0.14);
    border-color: rgba(231, 76, 60, 0.3);
}

.vps-connected-info {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.vps-connected-info strong {
    color: var(--text-secondary);
}

.vps-disconnect-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-vps-edit {
    background: rgba(99, 132, 255, 0.07);
    border: 1px solid rgba(99, 132, 255, 0.25);
    border-radius: var(--radius-sm);
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 7px 14px;
    transition: var(--transition);
}

.btn-vps-edit:hover {
    background: rgba(99, 132, 255, 0.14);
    border-color: rgba(99, 132, 255, 0.4);
}

.vps-edit-box {
    max-width: 420px;
    width: 100%;
}


/* ════════════════════════════════════════════════════════════
   VPS — WIZARD MODAL
════════════════════════════════════════════════════════════ */
.vps-wizard-box {
    max-width: 460px;
    gap: 0;
    padding: 0;
    text-align: left;
}

/* Indicador de pasos */
.vps-steps-indicator {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 20px 32px;
}

.vps-step-dot {
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    display: flex;
    font-size: 11px;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    transition: var(--transition);
    width: 28px;
    flex-shrink: 0;
}

.vps-step-dot.active {
    background: rgba(99, 132, 255, 0.14);
    border-color: var(--primary);
    color: var(--primary);
}

.vps-step-dot.done {
    background: rgba(60, 207, 145, 0.14);
    border-color: var(--color-active);
    color: var(--color-active);
}

.vps-step-line {
    background: var(--border);
    flex: 1;
    height: 2px;
    max-width: 48px;
}

/* Paneles de cada paso */
.vps-step-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px 32px 32px;
}

.vps-notice-box {
    background: rgba(248, 193, 47, 0.07);
    border: 1px solid rgba(248, 193, 47, 0.2);
    border-radius: var(--radius-sm);
    color: var(--color-paused);
    font-size: 13px;
    line-height: 1.5;
    padding: 12px 14px;
}

.vps-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Panel de conexión */
.vps-connecting-panel {
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
}

#vps-connecting-content {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.vps-success-icon {
    font-size: 44px;
    margin-bottom: 4px;
}

/* Botón primary (azul) para modales */
.btn-modal-confirm.is-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4a6ef5 100%);
    box-shadow: 0 2px 12px rgba(99, 132, 255, 0.3);
}

.btn-modal-confirm.is-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #5d7fff 100%);
    box-shadow: 0 4px 16px rgba(99, 132, 255, 0.45);
}


/* ════════════════════════════════════════════════════════════
   AVISO — PANEL LOCAL PAUSADO POR VPS
════════════════════════════════════════════════════════════ */.local-paused-notice {
    align-items: center;
    background: rgba(60, 207, 145, 0.05);
    border: 1px solid rgba(60, 207, 145, 0.18);
    border-radius: var(--radius-lg);
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px 20px;
}

.lpn-icon {
    flex-shrink: 0;
    font-size: 22px;
}

.lpn-txt {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lpn-txt strong {
    color: var(--color-active);
    font-size: 14px;
    font-weight: 600;
}

.lpn-txt span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}


/* ════════════════════════════════════════════════════════════
   MODAL VPS — NO AUTORIZADO
════════════════════════════════════════════════════════════ */
.vps-noauth-box {
    max-width: 400px;
    gap: 16px;
}

.noauth-contacts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.noauth-contact-btn {
    align-items: center;
    border-radius: var(--radius-sm);
    border: 1px solid;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    transition: var(--transition);
    justify-content: center;
}

.noauth-wa {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.3);
    color: #25d366;
}
.noauth-wa:hover {
    background: rgba(37, 211, 102, 0.2);
    box-shadow: 0 0 14px rgba(37, 211, 102, 0.15);
}

.noauth-email {
    background: rgba(99, 132, 255, 0.08);
    border-color: rgba(99, 132, 255, 0.2);
    color: var(--primary);
}
.noauth-email:hover {
    background: rgba(99, 132, 255, 0.15);
    box-shadow: 0 0 14px rgba(99, 132, 255, 0.12);
}

/* Fila de redes sociales en modal noauth */
.noauth-social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.noauth-social-btn {
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    gap: 8px;
    justify-content: center;
    padding: 10px 12px;
    text-decoration: none;
    transition: var(--transition);
}

.noauth-social-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

/* ════════════════════════════════════════════════════════════
   CHART PERIOD FILTER BUTTONS
════════════════════════════════════════════════════════════ */
.chart-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-period-btns {
    display: flex;
    gap: 3px;
}

.btn-period {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    padding: 5px 10px;
    transition: var(--transition);
}

.btn-period:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-period.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.chart-daterange {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    width: 100%;
}

.daterange-sep {
    color: var(--text-muted);
    font-size: 13px;
}

.date-input {
    background: var(--card-bg, #0d0f24);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    padding: 5px 8px;
    transition: var(--transition);
}

.date-input:focus {
    border-color: var(--primary);
    outline: none;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

.btn-apply-range {
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 14px;
    transition: var(--transition);
}

.btn-apply-range:hover {
    opacity: 0.85;
}

/* VPS chart header when it has period buttons */
.vps-chart-hdr {
    flex-wrap: wrap;
    gap: 8px;
}

/* ════════════════════════════════════════════════════════════
   AUTH MODE TOGGLE (login / registro)
════════════════════════════════════════════════════════════ */
.auth-mode-toggle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
    text-align: center;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.link-btn:hover { color: var(--primary-hover); }

/* ════════════════════════════════════════════════════════════
   CAPITAL % COLORS (info-value modifiers)
════════════════════════════════════════════════════════════ */
.money-pos { color: var(--color-active); }
.money-neg { color: var(--btn-pause); }

/* ════════════════════════════════════════════════════════════
   VPS IA AGRESIVA TOGGLE SWITCH
════════════════════════════════════════════════════════════ */
.vps-ia-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.vps-ia-switch {
    cursor: pointer;
    display: inline-block;
    height: 22px;
    position: relative;
    width: 42px;
}

.vps-ia-switch input {
    height: 0;
    opacity: 0;
    width: 0;
}

.vps-ia-slider {
    background: var(--bg-card-border);
    border-radius: 22px;
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: var(--transition);
}

.vps-ia-slider::before {
    background: var(--text-muted);
    border-radius: 50%;
    bottom: 3px;
    content: "";
    height: 16px;
    left: 3px;
    position: absolute;
    transition: var(--transition);
    width: 16px;
}

.vps-ia-group {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 12px 14px;
}

.vps-ia-label {
    font-weight: 700;
    font-size: 15px;
    color: #f59e0b;
}

.vps-ia-switch input:checked + .vps-ia-slider {
    background: #f59e0b;
}

.vps-ia-switch input:checked + .vps-ia-slider::before {
    background: #fff;
    transform: translateX(20px);
}

/* ── Quantum Payments Card ──────────────────────────────────── */
.quantum-card {
    background: linear-gradient(135deg, rgba(60, 207, 145, 0.04) 0%, rgba(99, 102, 241, 0.04) 100%);
    border: 1px solid rgba(60, 207, 145, 0.18);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
}

.quantum-card-hdr {
    align-items: center;
    border-bottom: 1px solid rgba(60, 207, 145, 0.12);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 12px 16px;
}

.quantum-card-title {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.quantum-badge {
    background: rgba(60, 207, 145, 0.12);
    border-radius: 20px;
    color: var(--color-active);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    text-transform: uppercase;
}

.quantum-rows {
    display: flex;
    flex-direction: column;
}

.quantum-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
}

.quantum-row:last-child { border-bottom: none; }

.quantum-row--fee {
    background: rgba(60, 207, 145, 0.04);
}

.quantum-lbl {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.quantum-lbl small {
    color: var(--color-active);
    font-size: 10px;
    margin-left: 3px;
    opacity: 0.85;
}

.quantum-val {
    color: var(--text-primary);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.quantum-fee {
    color: var(--color-active);
    font-size: 14px;
}

.quantum-note {
    border-top: 1px solid rgba(60, 207, 145, 0.10);
    color: var(--text-muted);
    font-size: 11px;
    padding: 8px 16px;
    text-align: center;
}

/* ════════════════════════════════════════════════════════════
   TABS NAVIGATION
════════════════════════════════════════════════════════════ */
.panel-tabs-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(99, 132, 255, 0.08);
    color: var(--text-primary);
}

.tab-btn.tab-active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(99, 132, 255, 0.35);
}

.tab-panel {
    display: none;
}

.tab-panel.tab-panel-active {
    display: block;
}

/* ════════════════════════════════════════════════════════════
   HERO METRICS
════════════════════════════════════════════════════════════ */
.hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0.6;
}

.hero-card:hover {
    border-color: rgba(99, 132, 255, 0.3);
}

.hero-card-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.hero-card-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.hero-card-pnl .hero-card-value { color: var(--color-active); }
.hero-card-pnl::before           { background: linear-gradient(90deg, var(--color-active), transparent); }

.hero-card-dd .hero-card-value   { color: var(--btn-pause); }
.hero-card-dd::before            { background: linear-gradient(90deg, var(--btn-pause), transparent); }

/* ════════════════════════════════════════════════════════════
   CHART CARD — amplified prominence
════════════════════════════════════════════════════════════ */
.chart-card {
    margin-bottom: 20px;
}

/* ════════════════════════════════════════════════════════════
   TOGGLE BUTTON — compact
════════════════════════════════════════════════════════════ */
.btn-toggle.btn-toggle-compact {
    font-size: 14px;
    font-weight: 600;
    padding: 11px 28px;
    min-width: 160px;
    width: auto;
    letter-spacing: 0.5px;
}

/* ════════════════════════════════════════════════════════════
   CONFIG TAB
════════════════════════════════════════════════════════════ */
.tab-config-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.config-coming-soon {
    background: var(--bg-card);
    border: 1px dashed var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 36px 24px;
    text-align: center;
}

.config-cs-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.config-coming-soon h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.config-coming-soon p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ════════════════════════════════════════════════════════════
   LOG TAB
════════════════════════════════════════════════════════════ */
.log-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
}

.log-empty-icon {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.log-empty-state h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.log-empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ════════════════════════════════════════════════════════════
   HISTORIAL — Barra de resumen
════════════════════════════════════════════════════════════ */
.hist-summary-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
}

.hist-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 20px;
    flex: 1;
}

.hist-summary-divider {
    width: 1px;
    align-self: stretch;
    background: var(--border);
}

.hist-summary-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.hist-summary-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.hist-pos { color: var(--color-active) !important; }
.hist-neg { color: var(--btn-pause)    !important; }

/* Loading */
.hist-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 40px 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Vacío */
.hist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
}

.hist-empty-icon { font-size: 36px; opacity: 0.5; }

/* Tabla */
.hist-table thead tr {
    background: rgba(255, 255, 255, 0.025);
}

.hist-table th {
    padding: 11px 14px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.9px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--bg-card-border);
    white-space: nowrap;
}

.hist-table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.hist-table tbody tr:last-child td { border-bottom: none; }

.hist-table tbody tr:hover {
    background: rgba(99, 132, 255, 0.04);
}

/* Celda fecha */
.hist-td-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.hist-date {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.hist-time {
    color: var(--text-muted);
    font-size: 11px;
}

/* Símbolo */
.hist-symbol {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Badge BUY / SELL */
.hist-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 3px 9px;
    border-radius: 5px;
    text-transform: uppercase;
}

.hist-type-buy      { background: rgba(60, 207, 145, 0.14); color: var(--color-active); }
.hist-type-sell     { background: rgba(231, 76,  60,  0.14); color: var(--btn-pause);   }
.hist-type-deposito { background: rgba(99, 179, 237, 0.18); color: #63b3ed; }
.hist-type-retiro   { background: rgba(246, 173, 85,  0.18); color: #f6ad55; }

/* Fila de movimiento (depósito / retiro) */
.hist-row-mov { background: rgba(255, 255, 255, 0.015); }
.hist-row-mov:hover { background: rgba(255, 255, 255, 0.04); }
.hist-mov-ticket { font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Mono */
.hist-td-mono {
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Profit */
.hist-td-profit {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hist-profit-pos  { color: var(--color-active); }
.hist-profit-neg  { color: var(--btn-pause); }
.hist-profit-zero { color: var(--text-secondary); }

/* Balance */
.hist-td-balance {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

/* ════════════════════════════════════════════════════════════
   HISTORIAL TAB (legacy)
════════════════════════════════════════════════════════════ */
.historial-wrap {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.historial-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-card-border);
}

.historial-hdr h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.historial-table-wrap {
    overflow-x: auto;
}

.historial-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.historial-table thead tr {
    background: rgba(255, 255, 255, 0.02);
}

.historial-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--bg-card-border);
    white-space: nowrap;
}

.historial-table td {
    padding: 12px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.historial-table tbody tr:hover {
    background: rgba(99, 132, 255, 0.04);
}

.historial-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px !important;
    font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — tabs
════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .panel-tabs-nav {
        gap: 2px;
        padding: 3px;
    }
    .tab-btn {
        font-size: 11px;
        padding: 8px 6px;
        gap: 4px;
    }
    .tab-btn svg {
        display: none;
    }
    .hero-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-card-value {
        font-size: 20px;
    }
}

/* ════════════════════════════════════════════════════════════
   VPS SECTION — tabs integration fixes
════════════════════════════════════════════════════════════ */

/* Space between VPS header and tabs nav */
.vps-section-hdr {
    margin-bottom: 16px;
}

/* VPS chart as card-style: override legacy border-bottom */
.chart-card.vps-chart-wrap {
    border-bottom: none;
    margin-bottom: 16px;
}

/* VPS chart header inherits chart-card-header layout */
.chart-card-header.vps-chart-hdr h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* VPS chart body inside card */
.chart-card .vps-chart-body {
    padding: 8px 16px 16px;
    height: 260px;
}

@media (max-width: 600px) {
    .chart-card .vps-chart-body { height: 200px; }
}


/* ════════════════════════════════════════════════════════════
   DESKTOP — Distribución ampliada (≥ 1024px)
════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {

    /* Panel principal: ocupa casi toda la pantalla */
    .panel-main {
        max-width: 1400px;
        padding: 40px 48px;
    }

    /* Header más espacioso */
    .panel-header {
        padding: 18px 48px;
    }

    /* Gráfico VPS más alto en desktop */
    .chart-card .vps-chart-body {
        height: 380px;
    }

    /* Valores de las métricas hero más grandes */
    .hero-card-value {
        font-size: 32px;
    }

    .hero-card {
        padding: 24px 22px;
    }

    /* Historial: tabla con más espacio */
    .historial-table th,
    .historial-table td {
        padding: 14px 20px;
    }

    /* Info grid: 3 columnas en desktop */
    .info-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .info-item:nth-child(3n) {
        border-right: none;
    }

    .info-item:nth-child(2n) {
        border-right: 1px solid var(--border);
    }

    /* Config tab: 2 columnas */
    .tab-config-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    /* Servicios del VPS: más columnas */
    .vps-services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Layout 2 columnas en el tab General del VPS */
    #vps-tab-general {
        display: grid;
        grid-template-columns: 1fr 380px;
        grid-template-rows: auto auto auto;
        column-gap: 24px;
        align-items: start;
    }

    /* Hero metrics ocupa toda la fila superior */
    #vps-tab-general .hero-metrics {
        grid-column: 1 / -1;
    }

    /* Gráfico en la columna izquierda */
    #vps-tab-general .chart-card.vps-chart-wrap {
        grid-column: 1;
        margin-bottom: 0;
    }

    /* Toggle + órdenes en la columna derecha, en columna */
    #vps-tab-general .vps-toggle-row {
        grid-column: 2;
        grid-row: 2;
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        margin-bottom: 0;
        background: var(--bg-card);
    }

    #vps-tab-general .vps-orders-wrap {
        grid-column: 2;
        grid-row: 3;
        border: 1px solid var(--border);
        border-bottom: none;
        border-radius: var(--radius-md);
        overflow: hidden;
        margin-top: 16px;
        background: var(--bg-card);
    }

    /* Ajustar padding dentro del VPS section en desktop */
    .vps-section-hdr {
        padding: 24px 32px;
    }

    .tabs-group {
        padding: 0 4px;
    }

    /* Login centrado: mantenerlo como está, no expandir */
    .login-container {
        max-width: 440px;
    }
}


/* ════════════════════════════════════════════════════════════
   NOTIFICACIONES
════════════════════════════════════════════════════════════ */

/* ── Campana en el header ──────────────────────────────────── */
.btn-notif {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-notif:hover {
    background: rgba(99, 132, 255, 0.1);
    border-color: rgba(99, 132, 255, 0.25);
    color: var(--primary);
}

.btn-notif.has-unread {
    color: var(--primary);
    border-color: rgba(99, 132, 255, 0.3);
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-root);
    line-height: 1;
    pointer-events: none;
}

/* ── Panel lateral (drawer) ────────────────────────────────── */
.notif-panel {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    justify-content: flex-end;
}

.notif-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fade-in 0.2s ease;
}

.notif-drawer {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border-left: 1px solid var(--bg-card-border);
    width: 100%;
    max-width: 400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: slide-in-right 0.25s ease;
    overflow: hidden;
}

@keyframes slide-in-right {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.notif-drawer-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: rgba(17, 20, 42, 0.98);
}

.notif-drawer-hdr h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.notif-drawer-hdr-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-notif-new {
    background: rgba(99, 132, 255, 0.12);
    border: 1px solid rgba(99, 132, 255, 0.25);
    border-radius: var(--radius-sm);
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-notif-new:hover {
    background: rgba(99, 132, 255, 0.22);
}

.btn-notif-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-notif-close:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
    color: var(--text-error);
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.notif-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 64px 24px;
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.6;
}

/* ── Items de notificación ─────────────────────────────────── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: rgba(99, 132, 255, 0.05); }

.notif-item.unread { background: rgba(99, 132, 255, 0.04); }

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.notif-item-thumb {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--bg-input);
}

.notif-item-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: rgba(99, 132, 255, 0.1);
    border: 1px solid rgba(99, 132, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notif-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.notif-item-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Modal ver notificación ────────────────────────────────── */
.notif-view-box {
    max-width: 480px;
    text-align: left;
    align-items: flex-start;
    gap: 10px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 28px;
}

.notif-view-box::-webkit-scrollbar { width: 4px; }
.notif-view-box::-webkit-scrollbar-track { background: transparent; }
.notif-view-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.notif-view-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 4px;
}

.notif-view-fecha {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -2px;
}

.notif-view-desc {
    font-size: 13px !important;
    font-style: italic;
    border-left: 3px solid var(--primary);
    padding-left: 12px !important;
    margin-left: 0 !important;
    color: var(--text-secondary) !important;
    max-width: 100% !important;
}

.notif-view-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    width: 100%;
}

/* ── Modal crear notificación ──────────────────────────────── */
.notif-create-box {
    max-width: 480px;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
    padding: 32px 28px;
}

.notif-create-box .modal-title {
    align-self: flex-start;
    text-align: left;
}

.notif-create-form {
    width: 100%;
    margin: 8px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.notif-create-box textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    padding: 12px 14px;
    resize: vertical;
    transition: border-color 0.2s;
    line-height: 1.5;
    min-height: 100px;
}

.notif-create-box textarea:focus {
    border-color: var(--border-focus);
    outline: none;
    background: var(--bg-input-focus);
}


/* ═══════════════════════════════════════════════════════════════
   PAGINACIÓN HISTORIAL
═══════════════════════════════════════════════════════════════ */
.hist-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--bg-card-border);
}

.btn-hist-page {
    background: var(--bg-card, #1e2433);
    border: 1px solid var(--bg-card-border, rgba(255,255,255,0.08));
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn-hist-page:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
}

.btn-hist-page:disabled {
    opacity: 0.35;
    cursor: default;
}

.hist-page-info {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 52px;
    text-align: center;
}


/* ═══════════════════════════════════════════════════════════════
   VISUALIZADORES (tab Configuración)
═══════════════════════════════════════════════════════════════ */
.visualizadores-section {
    background: var(--bg-card, #1e2433);
    border: 1px solid var(--bg-card-border, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.visualizadores-hdr h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.visualizadores-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.add-viewer-form {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.viewer-email-input {
    flex: 1;
    background: var(--bg-input, rgba(255,255,255,0.05));
    border: 1px solid var(--bg-card-border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 12px;
    outline: none;
    transition: border-color 0.2s;
}

.viewer-email-input:focus {
    border-color: var(--border-focus, #4f8ef7);
}

.btn-add-viewer {
    background: var(--color-primary, #4f8ef7);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.btn-add-viewer:hover { opacity: 0.85; }

.viewer-form-msg {
    font-size: 12px;
    margin-bottom: 8px;
}

.viewers-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.viewers-empty {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.viewer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--bg-card-border, rgba(255,255,255,0.06));
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.viewer-email-txt {
    color: var(--text-primary);
    word-break: break-all;
}

.btn-remove-viewer {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
    margin-left: 8px;
}

.btn-remove-viewer:hover {
    color: var(--color-danger, #e53e3e);
    background: rgba(229,62,62,0.1);
}


/* ════════════════════════════════════════════════════════════
   REDISEÑO v2 — Nuevo Front Panel
   ════════════════════════════════════════════════════════════ */

/* ── Header nuevo ─────────────────────────────────────────── */
.panel-header {
    background: #080f1e;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.panel-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    text-decoration: none;
}

.panel-brand .logo-icon {
    font-size: 20px;
    line-height: 1;
}

.panel-brand .logo-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.panel-badge { display: none; }

/* ── Main nav tabs (en el header) ──────────────────────────── */
.main-nav-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
}

.main-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.main-nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.main-nav-btn.main-nav-active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.main-nav-btn svg { flex-shrink: 0; }

/* ── User avatar ────────────────────────────────────────────── */
.user-avatar-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3399ff, #00cc77);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    flex-shrink: 0;
}

.user-avatar-initials {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Main tab panels ─────────────────────────────────────────── */
.main-tab-panel { display: block; }
.main-tab-panel[hidden] { display: none !important; }

/* ── Status bar strip ────────────────────────────────────────── */
.status-bar-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 180, 100, 0.08);
    border: 1px solid rgba(0, 180, 100, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
}

.status-bar-strip.is-paused {
    background: rgba(248, 193, 47, 0.06);
    border-color: rgba(248, 193, 47, 0.2);
}

.sbs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-active);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(60,207,145,0.6);
}

.status-bar-strip.is-paused .sbs-dot {
    background: var(--color-paused);
    box-shadow: 0 0 6px rgba(248,193,47,0.6);
}

.sbs-label {
    font-weight: 600;
    color: var(--color-active);
    font-size: 13px;
}

.status-bar-strip.is-paused .sbs-label { color: var(--color-paused); }

.sbs-desc {
    color: var(--text-secondary);
    font-size: 12px;
}

/* ── Hero balance card ────────────────────────────────────────── */
.hero-balance-card {
    background: linear-gradient(135deg, #0d1b35 0%, #0a1628 60%, #0d1f3a 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.hero-balance-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hbc-left {
    flex: 1;
    min-width: 0;
}

.hbc-eyebrow {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.hbc-balance {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Rajdhani', var(--font);
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 400px) {
    .hbc-balance { font-size: 38px; }
}

.hbc-hide-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.hbc-hide-btn:hover { color: var(--text-primary); }

/* Resultado total (pnl-indicator reutilizado) */
.pnl-indicator.hbc-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pnl-indicator.hbc-right .hbc-eyebrow {
    display: block;
    margin-bottom: 4px;
}

.hbc-pnl-amount {
    font-size: 22px;
    font-weight: 700;
    font-family: 'Rajdhani', var(--font);
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.pnl-indicator.is-positive .hbc-pnl-amount { color: var(--color-active); }
.pnl-indicator.is-negative .hbc-pnl-amount { color: var(--btn-pause); }
.pnl-indicator.is-neutral  .hbc-pnl-amount { color: var(--text-secondary); }

.hbc-pnl-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    align-self: flex-start;
}

.pnl-indicator.is-positive .hbc-pnl-badge {
    background: rgba(60,207,145,0.15);
    color: var(--color-active);
}

.pnl-indicator.is-negative .hbc-pnl-badge {
    background: rgba(231,76,60,0.15);
    color: var(--btn-pause);
}

.pnl-indicator.is-neutral .hbc-pnl-badge {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}

.hbc-since {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.hbc-illustration {
    font-size: 36px;
    opacity: 0.7;
    flex-shrink: 0;
    align-self: center;
    display: none;
}

@media (min-width: 480px) {
    .hbc-illustration { display: block; }
}

/* ── Metrics grid 2x2 ─────────────────────────────────────────── */
.metrics-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.mgc {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
}

.mgc--accent {
    border-color: rgba(0,180,80,0.2);
    background: linear-gradient(135deg, #0a2212 0%, #0d2a18 100%);
}

.mgc-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
}

.mgc-icon-neutral {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}

.mgc-icon-green {
    background: rgba(60,207,145,0.12);
    color: var(--color-active);
}

.mgc-icon-blue {
    background: rgba(59,130,246,0.12);
    color: var(--primary);
}

.mgc-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.3;
}

.mgc-value {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Rajdhani', var(--font);
    color: var(--text-primary);
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.mgc--accent .mgc-value { color: var(--color-active); }

/* ── New chart header ────────────────────────────────────────── */
.chart-card-v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.chart-card-v2-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-info-icon {
    font-size: 12px;
    color: var(--text-muted);
    cursor: help;
}

/* ── Action buttons row ─────────────────────────────────────── */
.action-btns-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 10px;
    margin-top: 16px;
    margin-bottom: 8px;
}

.btn-action-main,
.btn-action-sec {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 14px;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
    min-height: 60px;
}

.btn-action-main {
    background: linear-gradient(135deg, #1a4aaa 0%, #3399ff 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(51,153,255,0.3);
}

.btn-action-main:hover {
    background: linear-gradient(135deg, #2255bb 0%, #44aaff 100%);
    box-shadow: 0 4px 24px rgba(51,153,255,0.45);
}

.btn-action-main.is-active-state {
    background: rgba(231,76,60,0.18);
    color: var(--btn-pause);
    border: 1px solid rgba(231,76,60,0.3);
}

.btn-action-main.is-active-state:hover {
    background: rgba(231,76,60,0.28);
}

.btn-action-sec {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-action-sec:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.12);
}

.abt-content {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.abt-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.abt-texts { display: flex; flex-direction: column; gap: 1px; }

.abt-title {
    font-size: 13px;
    font-weight: 600;
    display: block;
    line-height: 1.2;
}

.abt-sub {
    font-size: 10px;
    opacity: 0.7;
    display: block;
    line-height: 1.2;
}

/* ── Safety line ─────────────────────────────────────────────── */
.safety-line {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 8px 0 16px;
}

/* ── Advanced info (hidden) ────────────────────────────────────── */
.advanced-info[hidden] { display: none !important; }

/* ── Tab: Aprender ───────────────────────────────────────────── */
.aprender-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 4px 0;
}

.aprender-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.aprender-pdf-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aprender-pdf-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.aprender-pdf-icon {
    width: 40px;
    height: 40px;
    background: rgba(59,130,246,0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.aprender-pdf-info { flex: 1; min-width: 0; }

.aprender-pdf-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.aprender-pdf-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.aprender-pdf-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-aprender {
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-aprender-view {
    background: rgba(59,130,246,0.12);
    color: var(--primary);
    border: 1px solid rgba(59,130,246,0.2);
}

.btn-aprender-view:hover {
    background: rgba(59,130,246,0.2);
}

.btn-aprender-dl {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-aprender-dl:hover {
    background: rgba(255,255,255,0.09);
    color: var(--text-primary);
}

.aprender-yt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (min-width: 540px) {
    .aprender-yt-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.aprender-yt-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.15s;
}

.aprender-yt-card:hover {
    border-color: rgba(255,0,0,0.3);
    transform: translateY(-2px);
}

.aprender-yt-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.aprender-yt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aprender-yt-thumb--gradient {
    background: linear-gradient(135deg, #0d1a3e 0%, #1a2a6c 50%, #0a0f1f 100%);
}

.aprender-yt-thumb--gradient2 {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

.aprender-yt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(255,0,0,0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}

.aprender-yt-info {
    padding: 10px 10px 12px;
}

.aprender-yt-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aprender-yt-ch {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.aprender-yt-channel-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,0,0,0.06);
    border: 1px solid rgba(255,0,0,0.15);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    margin-top: 4px;
}

.aprender-yt-channel-link:hover {
    background: rgba(255,0,0,0.1);
}

/* (panel-main definido arriba en el bloque original) */

/* ── Responsive: nav tabs en mobile ──────────────────────────── */
@media (max-width: 480px) {
    .main-nav-tabs {
        gap: 1px;
        padding: 2px;
    }

    .main-nav-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .main-nav-btn span.nav-label { display: none; }
    .main-nav-btn { padding: 6px 8px; }
}

/* ── Logout btn sm ───────────────────────────────────────────── */
.btn-logout-sm {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font);
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.btn-logout-sm:hover {
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

/* hide old header items we're replacing */
.panel-badge,
.user-email { display: none !important; }

/* ── Tab section title ────────────────────────────────────── */
.tab-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.tab-section-title svg { color: var(--primary); }

/* ── Main tab panels: visible indicator ──────────────────────── */
.main-tab-panel {
    min-height: 200px;
    padding-top: 4px;
}

/* ── Ensure hidden works on main tabs ──────────────────────── */
#tab-historial[hidden],
#tab-aprender[hidden] { display: none !important; }

/* ── nav active state más obvio ─────────────────────────────── */
.main-nav-btn.main-nav-active {
    background: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(59,130,246,0.4);
}

/* ── Layout PC: dos columnas en pantallas anchas ────────────── */
@media (min-width: 960px) {
    /* Header más cómodo en PC */
    .panel-header {
        padding: 0 40px;
        height: 60px;
    }

    /* Tab principal en PC: hero card ocupa todo el ancho,
       métricas en fila de 4, gráfico y botones en dos columnas */
    .metrics-grid-2x2 {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero-balance-card {
        padding: 28px 32px;
    }

    .hbc-balance {
        font-size: 44px;
    }

    /* Botones de acción más amplios */
    .action-btns-row {
        grid-template-columns: 3fr 2fr;
        max-width: 640px;
    }

    /* PDF cards en fila */
    .aprender-pdf-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .aprender-pdf-card {
        flex: 1;
        min-width: 280px;
    }

    /* YouTube grid más columnas */
    .aprender-yt-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .panel-header { padding: 0 60px; }

    .aprender-yt-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Arreglo: el panel-main en PC no debe quedar cortado ──── */
@media (min-width: 960px) {
    .panel-wrapper {
        max-width: 100%;
    }
}
