/* ============================================
   CRIPTOAZUL DASHBOARD CLIENTE - CSS CORRIGIDO FINAL
   Glassmorphism Premium - US$ 1B Valuation
   SEM WARNINGS NO CONSOLE
   ============================================ */

/* Reset e Base */
:root {
    --color-primary: #4A90D9;
    --color-primary-rgb: 0, 212, 170;
    --color-secondary: #2563EB;
    --color-secondary-rgb: 139, 92, 246;
    --color-success: #10b981;
    --color-success-rgb: 16, 185, 129;
    --color-error: #ef4444;
    --color-error-rgb: 239, 68, 68;
    --color-warning: #f59e0b;
    --color-warning-rgb: 245, 158, 11;
    --color-info: #3b82f6;
    --color-info-rgb: 59, 130, 246;

    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-light: rgba(255, 255, 255, 0.05);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.3);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* CORREÇÃO: Remover propriedades problemáticas */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
    position: relative;
    /* CORREÇÃO: Remover -moz-osx-font-smoothing */
    -webkit-font-smoothing: antialiased;
}

body.loaded {
    opacity: 1;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-normal);
    overflow: hidden;
    position: relative;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(var(--color-primary-rgb), 0.35);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(var(--color-primary-rgb), 0.08);
}

/* ============================================
   HEADER
   ============================================ */

.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    flex-wrap: nowrap;
    overflow: visible;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 140px;
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.logo-subtitle {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.1;
    margin-top: 1px;
    opacity: 0.9;
}

/* Navigation Desktop */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow: visible;
    margin: 0 0.5rem;
}

.nav-list {
    display: flex;
    gap: 0.2rem;
    list-style: none;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: visible;
    padding: 0;
}

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-normal);
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 36px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active .nav-link,
.nav-link.active {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
}

.nav-link i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    min-width: 150px;
    justify-content: flex-end;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.user-plan {
    font-size: 0.65rem;
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
    margin-top: 1px;
    line-height: 1.1;
}

/* Plan Badges */
.user-plan.plan-iniciante {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}
.user-plan.plan-profissional {
    color: #4A90D9;
    background: rgba(74, 144, 217, 0.1);
}
.user-plan.plan-trader {
    color: #2563EB;
    background: rgba(37, 99, 235, 0.1);
}
.user-plan.plan-empresas {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

/* Restricted Features (Access Control) */
.restricted-feature {
    position: relative;
    opacity: 0.6;
    pointer-events: auto !important; /* Allow clicking to show upgrade modal */
    cursor: not-allowed !important;
    transition: all 0.3s ease;
}

.restricted-feature::after {
    content: '\f023'; /* FontAwesome lock icon */
    font-family: 'Font Awesome 6 Free', 'FontAwesome';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: #f87171;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.restricted-feature:hover {
    opacity: 0.8;
}

.restricted-feature:hover::after {
    opacity: 1;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-normal);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-logo i {
    color: var(--color-primary);
    font-size: 1.5rem;
}

.mobile-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-normal);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.mobile-nav-list li.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    font-weight: 500;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-link.active {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.mobile-nav-link.text-error {
    color: var(--color-error);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
    position: relative;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(var(--color-primary-rgb), 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--color-primary);
}

.btn-refresh {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
    border: 1px solid rgba(59, 130, 246, 0.3);
    white-space: nowrap;
}

.btn-refresh:hover {
    background: rgba(59, 130, 246, 0.2);
}

.btn-refresh i {
    transition: transform var(--transition-normal);
}

.btn-refresh:active i {
    transform: rotate(180deg);
}

.last-update {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Premium Grid Override - maxima 2 colunas usando minmax alto */
div.metrics-grid.premium-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
}

.metric-card {
    padding: 0;
    position: relative;
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ===== Premium Card Components ===== */
.card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-top-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.card-top-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}
.card-top-link:hover { color: var(--color-primary); }

.card-inner {
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.card-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 4px;
}

.card-big-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-performance {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 16px;
}

/* Asset List */
.asset-list {
    display: flex;
    flex-direction: column;
}

.asset-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.asset-row:last-child { border-bottom: none; }

.asset-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.asset-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.asset-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.asset-qty {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.asset-value {
    font-weight: 600;
    text-align: right;
}

/* DARF Card */
.darf-icon-circle {
    width: 56px;
    height: 56px;
    background: rgba(74, 144, 217, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.darf-month-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.darf-status {
    font-size: 0.85rem;
    color: var(--color-primary);
    margin-bottom: 18px;
}

.darf-download-btn {
    width: 100%;
    max-width: 220px;
}

/* Tax Details */
.tax-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tax-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tax-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.tax-value {
    font-weight: 500;
    font-size: 0.85rem;
}

/* Allocation Section (Compacta) */
.allocation-section {
    margin-bottom: 2rem;
}

.allocation-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
    max-height: 280px;
    position: relative;
}

.allocation-chart-wrapper canvas {
    max-height: 260px;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-primary));
    background-size: 200% 100%;
    animation: shimmerBorder 3s ease-in-out infinite;
}

@keyframes shimmerBorder {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Animações de entrada staggered */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeSlideIn 0.6s ease-out forwards;
    opacity: 0;
}
.fade-in.delay-1 { animation-delay: 0.1s; }
.fade-in.delay-2 { animation-delay: 0.2s; }
.fade-in.delay-3 { animation-delay: 0.3s; }
.fade-in.delay-4 { animation-delay: 0.4s; }

.metric-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    min-width: 0;
}

.metric-icon {
    width: 40px;
    height: 40px;
    background: rgba(var(--color-primary-rgb), 0.1);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.metric-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
}

/* Flash animation para updates de valor */
@keyframes flashGreen {
    0% { color: var(--color-primary); text-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.5); }
    100% { color: var(--text-primary); text-shadow: none; }
}
.flash-update {
    animation: flashGreen 1.5s ease-out;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.metric-trend.positive {
    color: var(--color-success);
}

.metric-trend.negative {
    color: var(--color-error);
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    padding: 1.5rem;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    flex-shrink: 0;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.time-btn {
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 40px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.time-btn:hover,
.time-btn.active {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.chart-content {
    flex: 1;
    position: relative;
    min-height: 250px;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.chart-content canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    position: relative !important;
}

/* Transactions Section */
.transactions-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.view-all:hover {
    gap: 0.75rem;
}

.transactions-table-container {
    width: 100%;
    overflow: hidden;
}

.transactions-table {
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

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

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

.transactions-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.transactions-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.02);
}

.transactions-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color-light);
    white-space: nowrap;
}

.asset-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.asset-info i {
    font-size: 1.25rem;
    color: var(--color-warning);
}

.tx-type {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.tx-type.buy {
    background: rgba(var(--color-success-rgb), 0.1);
    color: var(--color-success);
    border: 1px solid rgba(var(--color-success-rgb), 0.3);
}

.tx-type.sell {
    background: rgba(var(--color-error-rgb), 0.1);
    color: var(--color-error);
    border: 1px solid rgba(var(--color-error-rgb), 0.3);
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    min-width: 90px;
    text-align: center;
}

.status.completed {
    background: rgba(var(--color-success-rgb), 0.1);
    color: var(--color-success);
    border: 1px solid rgba(var(--color-success-rgb), 0.3);
}

.status.pending {
    background: rgba(var(--color-warning-rgb), 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(var(--color-warning-rgb), 0.3);
}

/* API Status Section */
.api-status-section {
    margin-bottom: 2rem;
}

.api-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.5rem;
}

.api-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.api-icon {
    width: 50px;
    height: 50px;
    background: rgba(var(--color-primary-rgb), 0.1);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

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

.api-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.api-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.api-status.online {
    color: var(--color-success);
}

.api-status.offline {
    color: var(--color-error);
}

.api-status i {
    font-size: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Quick Actions */
.quick-actions-section {
    margin-top: 3rem;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

.quick-action:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.action-icon {
    width: 50px;
    height: 50px;
    background: rgba(var(--color-primary-rgb), 0.1);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.action-info {
    flex: 1;
}

.action-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.action-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.action-arrow {
    color: var(--text-secondary);
    transition: transform var(--transition-normal);
}

.quick-action:hover .action-arrow {
    transform: translateX(5px);
    color: var(--color-primary);
}

/* Footer */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    min-width: 0;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: right;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablet (768px para baixo) */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .user-details {
        display: none;
    }

    .logo {
        min-width: auto;
        flex: 1;
    }

    .logo-text h1 {
        font-size: 1.25rem;
    }

    .logo-subtitle {
        font-size: 0.7rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .page-actions {
        width: 100%;
        justify-content: space-between;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    div.metrics-grid.premium-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: 0;
    }

    .card-top-bar {
        padding: 0.875rem 1.25rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-inner {
        padding: 1rem 1.25rem;
    }

    .card-big-value {
        font-size: 1.75rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .metric-value {
        font-size: 1.75rem;
    }

    .charts-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .chart-container {
        min-height: 300px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .chart-actions {
        width: 100%;
        justify-content: space-between;
    }

    .time-btn {
        flex: 1;
        text-align: center;
    }

    .api-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .footer-right {
        align-items: flex-start;
        width: 100%;
    }

    .footer-links {
        justify-content: flex-start;
    }

    .footer-copyright {
        text-align: left;
    }

    /* Fix text clipping on mobile */
    .glass-card {
        overflow: visible;
    }

    .metric-trend {
        white-space: normal;
        word-break: break-word;
        flex-wrap: wrap;
    }

    .metric-title {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    /* Chart legend wrapping */
    .chart-content canvas,
    .portfolio-chart-container canvas {
        max-width: 100%;
    }
}

/* Mobile (480px para baixo) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .main-header {
        padding: 0.75rem 0;
    }

    .logo-text h1 {
        font-size: 1.2rem;
    }

    .logo-subtitle {
        font-size: 0.65rem;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .btn-text {
        display: none;
    }

    .btn-refresh {
        padding: 0.5rem;
        width: 44px;
        height: 44px;
    }

    .last-update {
        font-size: 0.8rem;
        flex: 1;
        justify-content: flex-end;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-header {
        margin-bottom: 0.75rem;
    }

    .metric-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .metric-trend {
        font-size: 0.8rem;
    }

    .chart-container {
        padding: 1rem;
        min-height: 280px;
    }

    .chart-header h3 {
        font-size: 1.1rem;
    }

    .chart-actions {
        gap: 0.25rem;
    }

    .time-btn {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
        min-width: 35px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .transactions-table th,
    .transactions-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .tx-type,
    .status {
        min-width: 60px;
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .api-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .api-card {
        padding: 1rem;
    }

    .api-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .api-info h4 {
        font-size: 0.9rem;
    }

    .api-info p {
        font-size: 0.8rem;
    }

    .main-footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }

    .footer-logo {
        font-size: 1.25rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .mobile-nav {
        width: 280px;
    }

    .mobile-nav-header {
        padding: 1rem;
    }

    .mobile-nav-list {
        padding: 1rem;
    }

    .mobile-nav-link {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
}

/* Small Mobile (360px para baixo) */
@media (max-width: 360px) {
    .container {
        padding: 0 0.75rem;
    }

    .logo-text h1 {
        font-size: 1.1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .metric-value {
        font-size: 1.25rem;
    }

    .mobile-nav {
        width: 100%;
        right: -100%;
    }
}

/* ============================================
   ANIMAÇÕES E UTILITÁRIOS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
}

/* Utilities */
.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 2rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

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

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

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--color-success);
}

.text-error {
    color: var(--color-error);
}

.text-warning {
    color: var(--color-warning);
}

.text-info {
    color: var(--color-info);
}

/* Touch targets otimizados para mobile */
@media (max-width: 768px) {

    .btn,
    .nav-link,
    .time-btn,
    .api-card,
    .menu-toggle,
    .mobile-close,
    .mobile-nav-link,
    .view-all {
        min-height: 44px;
        min-width: 44px;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }
}

/* Prevenir seleção de texto */
.btn,
.time-btn,
.menu-toggle,
.mobile-close {
    user-select: none;
    -webkit-user-select: none;
}

/* Melhorar legibilidade em mobile */
@media (max-width: 768px) {

    h1,
    h2,
    h3,
    h4,
    .metric-value {
        letter-spacing: -0.02em;
    }
}

/* Print styles */
@media print {

    .main-header,
    .main-footer,
    .page-actions,
    .btn,
    .menu-toggle,
    .mobile-nav {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .glass-card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }
}

/* Modal de Transação */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.transaction-details {
    display: grid;
    gap: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.detail-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

.btn-view {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-view:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.1);
}

/* CORREÇÃO: Remover seletor inválido da linha 1517 */
/* Se houver algum seletor problemático, ele será removido nesta versão */

/* Animações para notificações */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.loading-logo {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}