/* ==============================================
   DASHBOARD STYLES
   Dùng design tokens từ global.css
   ============================================== */

/* Dashboard body spacing */
body.dashboard-body {
    padding: 20px;
}

/* ==================
   HEADER
   ================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
    gap: 10px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -1px;
    margin: 0;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==================
   GRID LAYOUT
   ================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ==================
   CARDS
   ================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-title {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 28px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.card-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
    transition: color 0.3s ease;
}

/* ==================
   COLORS
   ================== */
.positive {
    color: var(--color-success);
}

.negative {
    color: var(--color-danger);
}

.pnl-positive {
    background: rgba(63, 185, 80, 0.15);
    color: var(--color-success);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
}

.pnl-negative {
    background: rgba(248, 81, 73, 0.15);
    color: var(--color-danger);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
}

/* ==================
   FNG GAUGE
   ================== */
.fng-bar {
    height: 8px;
    background: linear-gradient(to right, var(--color-danger), var(--color-warning), var(--color-success));
    border-radius: 4px;
    margin-top: 15px;
    position: relative;
}

.fng-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: -4px;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: left var(--transition-slow);
}

/* ==================
   TABLES
   ================== */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-default);
}

th {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 14px;
}

/* ==================
   BUTTONS
   ================== */
.btn {
    background: var(--color-info);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-base);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all var(--transition-base);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-ghost.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid transparent;
    opacity: 0.8;
    transition: all var(--transition-base);
}

.btn-danger-ghost:hover {
    opacity: 1;
    background: rgba(248, 81, 73, 0.1);
}

/* ==================
   STATUS INDICATORS
   ================== */
.update {
    color: var(--text-secondary);
    font-size: 12px;
}

.dca-active {
    color: var(--color-success);
    font-weight: bold;
}

.dca-wait {
    color: var(--color-warning);
}

/* ==================
   LANGUAGE SWITCHER
   ================== */
.lang-switcher {
    display: flex;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.lang-btn:hover {
    opacity: 0.8;
}

.lang-btn.active {
    background: var(--color-primary-bg);
    opacity: 1;
    color: var(--text-primary);
}

/* ==================
   STATUS ALERT BAR
   ================== */
.status-alert-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
    animation: alertPulse 3s ease-in-out infinite;
}

.status-alert-bar.alert-active {
    background: linear-gradient(90deg, rgba(63, 185, 80, 0.12) 0%, rgba(63, 185, 80, 0.06) 50%, rgba(63, 185, 80, 0.12) 100%);
    border-color: rgba(63, 185, 80, 0.25);
    color: var(--color-success);
}

.status-alert-bar.alert-waiting {
    background: linear-gradient(90deg, rgba(210, 153, 34, 0.12) 0%, rgba(210, 153, 34, 0.06) 50%, rgba(210, 153, 34, 0.12) 100%);
    border-color: rgba(210, 153, 34, 0.25);
    color: var(--color-warning);
}

.status-alert-bar.alert-off {
    background: rgba(139, 148, 158, 0.08);
    border-color: rgba(139, 148, 158, 0.15);
    color: var(--text-secondary);
    animation: none;
}

@keyframes alertPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

.status-alert-bar .alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    animation: dotBlink 1.5s ease-in-out infinite;
}

.alert-active .alert-dot {
    background: var(--color-success);
}

.alert-waiting .alert-dot {
    background: var(--color-warning);
}

.alert-off .alert-dot {
    background: var(--text-secondary);
    animation: none;
}

@keyframes dotBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ==================
   EMPTY STATE / ONBOARDING
   ================== */
.empty-state-onboarding {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 28px;
}

.empty-state-onboarding h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-onboarding p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

.onboarding-steps {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.onboarding-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 200px;
    transition: all var(--transition-base);
}

.onboarding-step:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.onboarding-step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary-bg);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.onboarding-step .step-icon {
    font-size: 28px;
}

.onboarding-step .step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.onboarding-step .step-desc {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1; /* Đẩy button xuống đáy */
}

.onboarding-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
}

.onboarding-btn:hover {
    background: rgba(63, 185, 80, 0.1);
    color: var(--color-success);
    border-color: var(--color-success);
    transform: translateY(-1px);
}

/* Trạng thái hoàn thành */
.onboarding-step.completed {
    border-color: var(--color-success) !important;
    background: rgba(63, 185, 80, 0.04) !important;
}

.onboarding-step.completed .step-number {
    background: var(--color-success) !important;
    color: #fff !important;
    font-size: 0 !important; /* Ẩn số */
}

.onboarding-step.completed .step-number::before {
    content: "✓";
    font-size: 16px;
    font-weight: bold;
}

.onboarding-step.completed .onboarding-btn {
    background: rgba(63, 185, 80, 0.2) !important;
    color: var(--color-success) !important;
    border-color: var(--color-success) !important;
    pointer-events: none; /* Khóa bấm lại */
}

/* ==================
   UPGRADE CTA BANNER
   ================== */
.upgrade-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.08) 0%, rgba(63, 185, 80, 0.08) 100%);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.upgrade-cta .cta-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.upgrade-cta .cta-text strong {
    color: var(--color-info);
}

.upgrade-cta .cta-btn {
    padding: 6px 16px;
    background: var(--color-info);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.upgrade-cta .cta-btn:hover {
    background: #4a9eff;
    box-shadow: 0 0 12px rgba(88, 166, 255, 0.3);
    transform: translateY(-1px);
}

/* ==================
   HERO CARD STATS ROW
   ================== */
.hero-stats-row {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-stat-value {
    font-size: 14px;
    font-weight: 600;
}

/* ==================
   SKELETON CARD LOADING
   ================== */
.card.is-loading .card-value,
.card.is-loading .card-sub {
    background: linear-gradient(90deg, var(--border-default) 25%, rgba(255, 255, 255, 0.05) 50%, var(--border-default) 75%);
    background-size: 200% 100%;
    animation: skeleton-slide 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent !important;
    min-width: 80px;
    min-height: 1em;
    user-select: none;
}

.card.is-loading .card-value *,
.card.is-loading .card-sub * {
    color: transparent !important;
}

/* ==================
   LAST UPDATED BADGE
   ================== */
.last-updated-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
}

.last-updated-badge .live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    animation: dotBlink 1.5s ease-in-out infinite;
}

/* ==================
   SECTION GROUPS
   ================== */
.section-group {
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-default);
}

.section-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
}

.section-header .section-icon {
    font-size: 18px;
}

/* ==================
   HERO GRID (Portfolio Overview)
   ================== */
.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.hero-grid .card {
    border: 1px solid var(--border-default);
}

.hero-grid .card:first-child {
    background: linear-gradient(135deg, #161b22 0%, #1a2332 100%);
    border: 1px solid rgba(63, 185, 80, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-grid .card:first-child::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(63, 185, 80, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-grid .card:first-child .card-value {
    font-size: 34px;
    font-weight: 700;
}

/* ==================
   SIGNAL GRID (Market Signals)
   ================== */
.signal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 0;
}

/* ==================
   TOOLTIP
   ================== */
.tooltip-trigger {
    position: relative;
    cursor: help;
}

/* Thêm gạch chân cho Tooltip dạng text (ví dụ tiêu đề bảng) */
span.tooltip-trigger:not(.help-icon) {
    border-bottom: 1px dotted var(--text-secondary);
}

/* Biểu tượng dấu hỏi (?) chuẩn UX */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 10px;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    color: var(--text-secondary);
    margin-left: 5px;
    vertical-align: middle;
    font-style: normal;
    font-weight: bold;
    background: rgba(255,255,255,0.03);
    transition: all 0.2s ease;
}

.help-icon:hover {
    color: var(--color-info);
    border-color: var(--color-info);
    background: rgba(88, 166, 255, 0.08);
}

.tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #161b22;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    border: 1px solid var(--border-default);
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    width: max-content;
    max-width: 250px;
    text-align: left;
    white-space: normal;
    line-height: 1.5;
}

/* Tam giác mũi tên */
.tooltip-trigger::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border-width: 6px;
    border-style: solid;
    border-color: var(--border-default) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.tooltip-trigger:hover::after,
.tooltip-trigger:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==================
   RESPONSIVE SCALING
   ================== */
@media (max-width: 768px) {
    .card-value {
        font-size: 24px;
    }
}

/* ==================
   COLLAPSIBLE SECTIONS
   ================== */
details.collapsible-section {
    margin-bottom: 20px;
}

details.collapsible-section>summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    list-style: none;
    user-select: none;
    transition: all var(--transition-base);
}

details.collapsible-section>summary::-webkit-details-marker {
    display: none;
}

details.collapsible-section>summary::after {
    content: '▸';
    margin-left: auto;
    font-size: 14px;
    transition: transform 0.2s ease;
}

details.collapsible-section[open]>summary::after {
    transform: rotate(90deg);
}

details.collapsible-section>summary:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
}

details.collapsible-section>.collapsible-content {
    padding-top: 16px;
}

/* ==================
   CHARTS
   ================== */
.chart-container {
    position: relative;
    height: 250px;
    margin-top: 20px;
}

/* ==================
   MANUAL TRADING FORM
   ================== */
.manual-form {
    display: grid;
    gap: 10px;
    align-items: end;
}

.manual-form-buy {
    grid-template-columns: 1fr 1fr 1fr 80px 80px auto;
}

.manual-form-sell {
    grid-template-columns: 1fr 1fr 1fr auto;
}

.manual-form input,
.manual-form select {
    width: 100%;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 14px;
    transition: border-color var(--transition-fast);
}

.manual-form input:focus,
.manual-form select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.manual-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Manual Trade Header */
.manual-trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.manual-trade-tabs {
    display: flex;
    gap: 10px;
}

/* ==================
   USER INFO SECTION
   ================== */
.user-info-section {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-default);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--color-info);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.user-email {
    font-size: 11px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-plan-badge {
    font-size: 9px;
    color: #fff;
    background: var(--text-secondary);
    padding: 1px 6px;
    border-radius: 3px;
    width: fit-content;
    text-transform: uppercase;
    font-weight: 600;
}

/* ==================
   SKELETON LOADING
   ================== */
.card.loading .card-value,
.card.loading .card-sub {
    background: linear-gradient(90deg, var(--border-default) 25%, rgba(255, 255, 255, 0.05) 50%, var(--border-default) 75%);
    background-size: 200% 100%;
    animation: skeleton-slide 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent !important;
    min-width: 80px;
    min-height: 1em;
}

@keyframes skeleton-slide {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==================
   RESPONSIVE - MOBILE
   ================== */
@media (max-width: 768px) {
    body.dashboard-body {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    h1 {
        font-size: 20px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hero-grid .card:first-child .card-value {
        font-size: 28px;
    }

    .signal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .card {
        padding: 15px;
    }

    .card-value {
        font-size: 22px;
    }

    /* Tables - horizontal scroll */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 12px;
        min-width: 500px;
    }

    th,
    td {
        padding: 8px 5px;
        white-space: nowrap;
    }

    /* DCA + Capital tables inside collapsible sections */
    details.collapsible-section .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    details.collapsible-section table {
        min-width: 500px;
    }

    /* Onboarding steps stack on mobile */
    .onboarding-steps {
        flex-direction: column;
        align-items: center;
    }

    .onboarding-step {
        width: 100%;
        max-width: 300px;
    }

    /* Upgrade CTA stack on mobile */
    .upgrade-cta {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    /* Alert bar wrap on mobile */
    .status-alert-bar {
        flex-wrap: wrap;
        font-size: 12px;
        padding: 8px 14px;
    }

    /* Hero stats row compact */
    .hero-stats-row {
        gap: 10px;
    }

    .hero-stat-label {
        font-size: 10px;
    }

    .hero-stat-value {
        font-size: 12px;
    }

    .btn {
        padding: 10px 20px;
    }

    /* Manual trading form - stack vertically */
    .manual-form-buy,
    .manual-form-sell {
        grid-template-columns: 1fr 1fr;
    }

    .manual-form-buy>div:nth-child(1),
    .manual-form-buy>div:nth-child(2),
    .manual-form-buy>div:nth-child(3) {
        grid-column: span 1;
    }

    .manual-form-buy>button,
    .manual-form-sell>button {
        grid-column: 1 / -1;
    }

    /* Hide elements on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* User info compact */
    .user-info-section {
        padding: 4px 8px;
    }

    .user-email {
        max-width: 80px;
    }

    /* Nav links as mobile menu */
    .nav-links-mobile {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(11, 14, 17, 0.97);
        z-index: 90;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        backdrop-filter: blur(10px);
    }

    .nav-links-mobile.open {
        display: flex;
    }

    .nav-links-mobile a,
    .nav-links-mobile button {
        font-size: 18px;
        padding: 12px 32px;
    }
}

/* ==================
   LITE/PRO MODE TOGGLE
   ================== */
.mode-toggle {
    display: flex;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.mode-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.6;
    font-family: var(--font-family);
    letter-spacing: 0.3px;
}

.mode-btn:hover {
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.04);
}

.mode-btn.active {
    background: var(--color-primary-bg);
    opacity: 1;
    color: var(--color-primary);
}

/* Visibility rules */
[data-mode="pro"] {
    transition: opacity 0.3s ease, max-height 0.4s ease;
}

body.lite-mode [data-mode="pro"] {
    display: none !important;
}

[data-mode="lite"] {
    display: none;
    transition: opacity 0.3s ease, max-height 0.4s ease;
}

body.lite-mode [data-mode="lite"] {
    display: block !important;
}

/* Admin Impersonate Banner */
.impersonate-banner {
    background-color: var(--color-danger, #ea4335);
    color: #fff;
    text-align: center;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.impersonate-banner strong {
    color: #fff;
    font-weight: 700;
}

.impersonate-banner button {
    background: #fff;
    color: var(--color-danger, #ea4335);
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.impersonate-banner button:hover {
    background: #f1f1f1;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .impersonate-banner {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
}

/* Lite mode: hero-grid chỉ hiện 2 card đầu */
body.lite-mode .hero-grid {
    grid-template-columns: 1fr 1fr;
}

/* ==================
   LITE SENTIMENT BAR
   ================== */
.lite-sentiment {
    margin-bottom: 20px;
}

.lite-sentiment .lite-sentiment-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.lite-sentiment .lite-sentiment-label strong {
    color: var(--text-primary);
    font-size: 15px;
}

.lite-sentiment-track {
    position: relative;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, #e74c3c, #e67e22, #f1c40f, #2ecc71);
    overflow: visible;
}

.lite-sentiment-thumb {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: -4px;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: left 0.8s ease;
    z-index: 2;
}

.lite-sentiment-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================
   LITE RECENT TRADES
   ================== */
.lite-trades-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.lite-trade-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s ease;
}

.lite-trade-card:hover {
    border-color: var(--border-hover);
}

.lite-trade-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lite-trade-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.lite-trade-badge.buy {
    background: rgba(63, 185, 80, 0.15);
    color: var(--color-success);
}

.lite-trade-badge.sell {
    background: rgba(248, 81, 73, 0.15);
    color: var(--color-danger);
}

.lite-trade-info .lite-trade-symbol {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.lite-trade-info .lite-trade-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.lite-trade-right {
    text-align: right;
}

.lite-trade-price {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    font-family: monospace;
}

.lite-trade-amount {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ==================
   LITE EXPLAIN & CTA
   ================== */
.lite-explain-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-family);
    margin-bottom: 10px;
}

.lite-explain-btn:hover {
    border-color: var(--color-primary);
    background: rgba(63, 185, 80, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(63, 185, 80, 0.1);
}

.lite-cta-pro {
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-family);
}

.lite-cta-pro:hover {
    border-color: var(--color-info);
    color: var(--color-info);
    background: rgba(88, 166, 255, 0.06);
}

/* Lite mode tip banner */
.lite-tip-banner {
    text-align: center;
    padding: 12px 16px;
    background: rgba(63, 185, 80, 0.08);
    border: 1px solid rgba(63, 185, 80, 0.15);
    border-radius: var(--radius-lg);
    color: var(--color-success);
    font-size: 13px;
    margin-top: 16px;
    line-height: 1.5;
}

/* ==================
   LITE MODE RESPONSIVE
   ================== */
/* ==================
   LITE MODE RESPONSIVE
   ================== */
@media (max-width: 768px) {
    body.lite-mode .hero-grid {
        grid-template-columns: 1fr;
    }

    .mode-toggle {
        order: -1;
    }
}

/* ==================
   LITE NEW COMPONENTS (MỚI)
   ================== */

/* 1. Quick Actions */
.lite-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.lite-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lite-action-btn:hover {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-2px);
}

.lite-action-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.lite-action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* 2. Price Card (Watchlist) */
.lite-price-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    border: 1px solid var(--border-default);
    transition: transform 0.2s ease;
}

.lite-price-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.lite-coin-icon {
    width: 32px;
    height: 32px;
    background: #f1c40f;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

/* 3. DCA Progress */
.lite-dca-card {
    border-left: 4px solid #2ecc71;
}

.lite-progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.lite-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 4. Pro CTA */
.lite-pro-cta {
    margin-bottom: 16px;
}

.lite-cta-pro {
    width: 100%;
    padding: 12px;
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lite-cta-pro:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-1px);
}

/* Animation cho Emoji */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-4px);}
    60% {transform: translateY(-2px);}
}

@media (max-width: 480px) {
    .card-value {
        font-size: 18px;
    }

    /* Mobile: card-based table layout */
    .mobile-card-table table,
    .mobile-card-table thead {
        display: none;
    }

    table {
        font-size: 11px;
    }

    th,
    td {
        padding: 6px 3px;
    }

    .signal-grid {
        grid-template-columns: 1fr;
    }

    /* Manual trading form - full stack */
    .manual-form-buy,
    .manual-form-sell {
        grid-template-columns: 1fr;
    }

    /* Collapsible summary text smaller */
    details.collapsible-section>summary {
        font-size: 13px;
        padding: 12px 14px;
    }

    details.collapsible-section table {
        min-width: 420px;
    }
}

/* =========================================
   UX NÂNG CAO LITE (SPARKLINE, BLUR, BOTTOM SHEET)
   ========================================= */

.blurred-amount {
    filter: blur(5px);
    opacity: 0.7 !important;
    user-select: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.lite-bottom-sheet {
    border-radius: 24px 24px 0 0 !important;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
}

@media (max-width: 600px) {
    .lite-bottom-sheet {
        margin: 0 !important;
        width: 100% !important;
    }
}

/* =========================================
   MOBILE NARROW SCREEN FIXES (UX)
   ========================================= */

/* Ẩn row thống kê của bản Pro khi đang dùng Lite để không tràn chữ */
body.lite-mode .hero-stats-row {
    display: none !important;
}

@media (max-width: 380px) {
    .lite-action-label {
        font-size: 10px;
    }
    .lite-trade-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px !important;
    }
    .lite-sentiment-labels {
        font-size: 9px;
    }
    /* Chống tràn giá BTC khi màn siêu hẹp (234px) */
    .lite-price-card > div,
    .lite-rsi-card > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .lite-price-card > div > div:last-child,
    .lite-rsi-card > div > div:last-child {
        text-align: left !important;
        align-self: flex-start;
    }
}