/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Theme Colors - Inspired by ResultadosHunter */
    --bg-primary: #0a0f1c;
    --bg-secondary: #1a1f2e;
    --bg-card: #1e2333;
    --bg-hover: #252a3a;

    --text-primary: #ffffff;
    --text-secondary: #b8bcc8;
    --text-muted: #6b7280;

    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #fbbf24;
    --accent-purple: #8b5cf6;

    --border-color: #2d3344;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px; /* Reduzido de 16px padrão */
}

.container {
    max-width: 1260px; /* Reduzido de 1400px */
    margin: 0 auto;
    padding: 0 25px; /* Reduzido de 30px */
}

/* Header */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.45rem 0; /* Reduzido de 0.5rem */
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(26, 31, 46, 0.95);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1260px; /* Reduzido de 1400px */
    margin: 0 auto;
    padding: 0 18px; /* Reduzido de 20px */
}

.logo-section h1 {
    font-size: 1.125rem; /* Reduzido de 1.25rem */
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    color: var(--text-secondary);
    font-weight: 400;
}

.last-update {
    font-size: 0.7rem; /* Reduzido de 0.75rem */
    color: var(--text-muted);
    margin-top: 0.225rem; /* Reduzido de 0.25rem */
}

/* Stats Section */
.stats-section {
    padding: 1.8rem 0; /* Reduzido de 2rem */
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.9rem; /* Reduzido de 1rem */
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px; /* Reduzido de 12px */
    padding: 1.35rem; /* Reduzido de 1.5rem */
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-blue);
}

.stat-card.positive::before {
    background: var(--accent-green);
}

.stat-card.negative::before {
    background: var(--accent-red);
}

.stat-label {
    font-size: 0.7rem; /* Reduzido de 0.75rem */
    color: var(--text-secondary);
    margin-bottom: 0.45rem; /* Reduzido de 0.5rem */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.45rem; /* Reduzido de 1.625rem */
    font-weight: 700;
    margin-bottom: 0.45rem; /* Reduzido de 0.5rem */
}

.stat-change {
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    display: flex;
    align-items: center;
    gap: 0.225rem; /* Reduzido de 0.25rem */
}

.stat-change.positive {
    color: var(--accent-green);
}

.stat-change.negative {
    color: var(--accent-red);
}

/* Filters Section */
.filters-section {
    padding: 1.35rem 0; /* Reduzido de 1.5rem */
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.filters-wrapper {
    display: flex;
    gap: 0.9rem; /* Reduzido de 1rem */
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.225rem; /* Reduzido de 0.25rem */
    min-width: 135px; /* Reduzido de 150px */
}

.filter-group label {
    font-size: 0.7rem; /* Reduzido de 0.75rem */
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 0.45rem; /* Reduzido de 0.5rem */
}

.date-inputs span {
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    color: var(--text-secondary);
}

.filter-select, .filter-input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.9rem; /* Reduzido de 0.5rem 1rem */
    border-radius: 7px; /* Reduzido de 8px */
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    cursor: pointer;
    transition: var(--transition);
}

/* Multi-select dropdown */
.multi-select-dropdown {
    position: relative;
    width: 162px; /* Reduzido de 180px */
}

.multi-select-header {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 2.25rem 0.45rem 0.9rem; /* Reduzido */
    border-radius: 7px; /* Reduzido de 8px */
    font-size: 0.73rem; /* Reduzido de 0.8125rem */
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    appearance: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-select-header:hover {
    border-color: var(--accent-blue);
}

.multi-select-header.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.multi-select-arrow {
    position: absolute;
    right: 0.9rem; /* Reduzido de 1rem */
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent; /* Reduzido */
    border-right: 3.5px solid transparent; /* Reduzido */
    border-top: 4.5px solid var(--text-secondary); /* Reduzido */
    transition: transform 0.3s;
    pointer-events: none;
}

.multi-select-header.active .multi-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.multi-select-options {
    position: absolute;
    top: calc(100% + 3.5px); /* Reduzido de 4px */
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 7px; /* Reduzido de 8px */
    z-index: 100;
    max-height: 360px; /* Reduzido de 400px */
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.multi-select-option {
    display: flex;
    align-items: center;
    padding: 0.36rem 0.68rem; /* Reduzido */
    cursor: pointer;
    transition: var(--transition);
}

.multi-select-option:hover {
    background-color: var(--bg-hover);
}

.multi-select-option input[type="checkbox"] {
    margin-right: 0.45rem; /* Reduzido de 0.5rem */
    cursor: pointer;
    width: 12.5px; /* Reduzido de 14px */
    height: 12.5px; /* Reduzido de 14px */
    flex-shrink: 0;
}

.multi-select-option span {
    font-size: 0.68rem; /* Reduzido de 0.75rem */
    color: var(--text-primary);
}

.filter-select:hover, .filter-input:hover {
    border-color: var(--accent-blue);
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-input[type="date"] {
    font-family: inherit;
    color-scheme: dark;
}

.btn-reset {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem; /* Reduzido */
    border-radius: 7px; /* Reduzido de 8px */
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-end;
}

.btn-reset:hover {
    background-color: var(--bg-card);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Display Toggle Buttons */
.display-toggle {
    display: flex;
    gap: 0.3rem;
    background-color: rgba(255, 255, 255, 0.02);
    padding: 0.25rem;
    border-radius: 7px;
    border: 1px solid var(--border-color);
}

.toggle-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.toggle-btn .toggle-icon {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.toggle-btn .toggle-text {
    font-size: 0.65rem;
    white-space: nowrap;
}

.toggle-btn:hover:not(.active) {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Main Content */
.main-content {
    padding: 1.8rem 0 3.6rem; /* Reduzido */
    min-height: calc(100vh - 180px); /* Reduzido de 200px */
}

/* Tabs */
.tabs {
    background-color: var(--bg-card);
    border-radius: 10px; /* Reduzido de 12px */
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.tab-button {
    flex: 1;
    padding: 0.9rem; /* Reduzido de 1rem */
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

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

.tab-button.active {
    color: var(--accent-blue);
    background-color: var(--bg-card);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
}

.tabs-content {
    padding: 1.8rem; /* Reduzido de 2rem */
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Charts */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); /* Reduzido de 400px */
    gap: 1.8rem; /* Reduzido de 2rem */
    margin-bottom: 1.8rem; /* Reduzido de 2rem */
}

.chart-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px; /* Reduzido de 12px */
    padding: 1.35rem; /* Reduzido de 1.5rem */
    position: relative;
    min-height: 315px; /* Reduzido de 350px */
    height: 315px; /* Reduzido de 350px */
    display: flex;
    flex-direction: column;
}

.chart-container.large {
    grid-column: 1 / -1;
    min-height: 405px; /* Reduzido de 450px */
    height: 405px; /* Reduzido de 450px */
}

.chart-container h3 {
    font-size: 0.9rem; /* Reduzido de 1rem */
    font-weight: 600;
    margin-bottom: 0.9rem; /* Reduzido de 1rem */
    color: var(--text-primary);
    flex-shrink: 0;
}

.chart-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

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

/* Make legend items look clickable and properly aligned */
.chart-container .chartjs-legend li {
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
}

.chart-container .chartjs-legend li:hover {
    opacity: 0.7;
}

/* Ensure legend box is properly aligned */
.chart-container .chartjs-legend li span {
    display: inline-flex !important;
    align-items: center !important;
    height: auto !important;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.68rem; /* Reduzido de 0.75rem */
    margin-top: 1.8rem; /* Reduzido de 2rem */
}

.metric-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-color);
    border-radius: 7px; /* Reduzido de 8px */
    padding: 0.68rem; /* Reduzido de 0.75rem */
    text-align: center;
}

.metric-label {
    font-size: 0.63rem; /* Reduzido de 0.7rem */
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.225rem; /* Reduzido de 0.25rem */
    line-height: 1.2;
}

.metric-value {
    font-size: 1.125rem; /* Reduzido de 1.25rem */
    font-weight: 700;
    color: var(--text-primary);
}

/* Traders Grid */
.traders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); /* Reduzido de 280px */
    gap: 1.35rem; /* Reduzido de 1.5rem */
    margin-bottom: 1.8rem; /* Reduzido de 2rem */
}

.trader-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px; /* Reduzido de 12px */
    padding: 1.35rem; /* Reduzido de 1.5rem */
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}


.trader-card:hover {
    transform: translateY(-3.5px); /* Reduzido de -4px */
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-blue);
}

.trader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem; /* Reduzido de 1rem */
}

.trader-info-wrapper {
    display: flex;
    flex-direction: column;
}

.trader-name {
    font-size: 1rem; /* Reduzido de 1.125rem */
    font-weight: 600;
}

.trader-mobile-info {
    display: none;
}

.trader-badge {
    padding: 0.225rem 0.68rem; /* Reduzido */
    border-radius: 18px; /* Reduzido de 20px */
    font-size: 0.68rem; /* Reduzido de 0.75rem */
    font-weight: 600;
}

.trader-badge.positive {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.trader-badge.negative {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.trader-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.68rem; /* Reduzido de 0.75rem */
}

.trader-stat {
    display: flex;
    flex-direction: column;
}

.trader-stat-label {
    font-size: 0.68rem; /* Reduzido de 0.75rem */
    color: var(--text-muted);
    margin-bottom: 0.225rem; /* Reduzido de 0.25rem */
}

.trader-stat-value {
    font-size: 0.9rem; /* Reduzido de 1rem */
    font-weight: 600;
    color: var(--text-primary);
}

/* Table */
.table-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px; /* Reduzido de 12px */
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.35rem; /* Reduzido de 1.5rem */
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    font-size: 1rem; /* Reduzido de 1.125rem */
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 0.9rem; /* Reduzido de 1rem */
    align-items: center;
}

.search-input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.9rem; /* Reduzido */
    border-radius: 7px; /* Reduzido de 8px */
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    width: 180px; /* Reduzido de 200px */
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-export {
    background: var(--bg-card);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 0.45rem 1.35rem; /* Reduzido */
    border-radius: 7px; /* Reduzido de 8px */
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-export:hover {
    background: var(--accent-green);
    color: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

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

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

.trades-table th {
    background-color: var(--bg-card);
    padding: 0.9rem; /* Reduzido de 1rem */
    text-align: center;
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trades-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.trades-table th.sortable:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sort-icon {
    display: inline-block;
    margin-left: 0.25rem;
    opacity: 0.7;
    font-size: 0.7rem;
}


.trades-table td {
    padding: 0.9rem; /* Reduzido de 1rem */
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    text-align: center;
}

.trades-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.trade-gain {
    color: var(--accent-green);
    font-weight: 600;
}

.trade-loss {
    color: var(--accent-red);
    font-weight: 600;
}

.trade-neutral {
    color: var(--text-muted);
}

.trade-ongoing {
    color: var(--text-muted);
}

.status-badge {
    display: inline-block;
    padding: 0.225rem 0.68rem; /* Reduzido */
    border-radius: 18px; /* Reduzido de 20px */
    font-size: 0.68rem; /* Reduzido de 0.75rem */
    font-weight: 500;
}

.status-badge.gain {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.status-badge.loss {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.status-badge.empate {
    background-color: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

.status-badge.ongoing {
    background-color: rgba(251, 191, 36, 0.1);
    color: var(--accent-yellow);
    border: 1px solid rgba(251, 191, 36, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Pagination */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.35rem; /* Reduzido */
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 0.45rem; /* Reduzido de 0.5rem */
}

.page-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.9rem; /* Reduzido */
    border-radius: 5.5px; /* Reduzido de 6px */
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    background-color: var(--bg-hover);
    border-color: var(--accent-blue);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Timeline Stats */
.timeline-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); /* Reduzido de 250px */
    gap: 0.9rem; /* Reduzido de 1rem */
    margin-top: 1.8rem; /* Reduzido de 2rem */
}

.timeline-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 7px; /* Reduzido de 8px */
    padding: 0.9rem; /* Reduzido de 1rem */
}

.timeline-stat-label {
    font-size: 0.8rem; /* Reduzido de 0.875rem */
    color: var(--text-muted);
    margin-bottom: 0.45rem; /* Reduzido de 0.5rem */
}

.timeline-stat-value {
    font-size: 1.125rem; /* Reduzido de 1.25rem */
    font-weight: 600;
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.8rem 0; /* Reduzido de 2rem */
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.8rem; /* Reduzido de 0.875rem */
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

@media (max-width: 768px) {
    .stats-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255,255,255,0.02) 100%);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        min-height: auto;
    }

    .stat-card .stat-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
        margin-bottom: 0;
        text-align: left;
        font-weight: 500;
        color: var(--text-primary);
    }

    .stat-card .stat-info {
        display: flex;
        align-items: center;
    }

    .stat-card .stat-subtitle {
        font-size: 0.625rem;
        color: var(--text-secondary);
        margin-top: 0.1rem;
    }

    .stat-card .stat-subtitle.positive {
        color: var(--accent-green);
    }

    .stat-card .stat-subtitle.negative {
        color: var(--accent-red);
    }

    .stat-card .stat-value {
        font-size: 1rem;
        margin-bottom: 0;
        text-align: right;
        font-weight: 700;
        white-space: nowrap;
    }

    /* Remove old stat-change styles in mobile */
    .stat-card .stat-change {
        display: none;
    }

    .stat-card.positive .stat-value,
    .stat-card.negative .stat-value {
        font-size: 1.125rem;
    }

    /* Metrics cards as rows in mobile */
    .metrics-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin: 1.5rem -0.5rem 0 -0.5rem;
    }

    .metric-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        text-align: left;
    }

    .metric-label {
        font-size: 0.75rem;
        margin-bottom: 0;
        flex: 1;
    }

    .metric-value {
        font-size: 1.125rem;
        font-weight: 600;
        text-align: right;
    }

    .chart-grid {
        grid-template-columns: 1fr;
        margin: 0 -0.5rem;
    }

    .chart-container {
        min-height: 350px;
        height: 350px;
        margin: 0.5rem 0;
        padding: 1rem;
    }

    .chart-container.large {
        min-height: 400px;
        height: 400px;
    }

    .chart-wrapper {
        height: calc(100% - 2rem);
    }

    .chart-container canvas {
        max-height: 100% !important;
    }


    .filters-wrapper {
        gap: 0.75rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .tabs-header {
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 1 1 50%;
    }

    .tabs-content {
        padding: 1rem;
    }

    .traders-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin: 0 -0.5rem;
    }

    .trader-card {
        padding: 0.75rem 1rem;
        background: var(--bg-card);
        border-radius: 8px;
        min-height: auto;
    }

    .trader-card:hover {
        transform: none;
        box-shadow: none;
    }

    .trader-header {
        margin-bottom: 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    .trader-info-wrapper {
        flex: 1;
    }

    .trader-name {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .trader-mobile-info {
        display: flex;
        gap: 1rem;
        font-size: 0.625rem;
        color: var(--text-muted);
    }

    .trader-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        white-space: nowrap;
    }

    .trader-stats {
        display: none;
    }

    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .table-actions {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .table-pagination {
        flex-direction: column;
        gap: 1rem;
    }

    /* Timeline stats as rows in mobile */
    .timeline-stats {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin: 1rem -0.5rem 0 -0.5rem;
    }

    .timeline-stat-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: var(--bg-card);
    }

    .timeline-stat-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
    }

    .timeline-stat-info {
        display: flex;
    }

    .timeline-stat-subtitle {
        font-size: 0.625rem;
        color: var(--text-muted);
    }

    .timeline-stat-label {
        font-size: 0.75rem;
        margin-bottom: 0;
        flex: 1;
    }

    .timeline-stat-value {
        font-size: 1rem;
        text-align: right;
    }

    /* Smaller text in details table */
    .container {
        padding: 0 15px;
    }

    .table-container {
        margin: 0 -0.9rem;
        border-radius: 8px;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .trades-table {
        min-width: 750px;
        table-layout: fixed;
    }

    .trades-table th {
        font-size: 0.625rem;
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
        text-align: center;
    }

    .trades-table th:nth-child(1),
    .trades-table td:nth-child(1) {
        width: 75px; /* Data */
        text-align: center;
    }

    .trades-table th:nth-child(2),
    .trades-table td:nth-child(2) {
        width: 85px; /* Trader */
        text-align: center;
    }

    .trades-table th:nth-child(3),
    .trades-table td:nth-child(3) {
        width: 85px; /* Ativo */
        text-align: center;
    }

    .trades-table th:nth-child(4),
    .trades-table td:nth-child(4) {
        width: 90px; /* Tipo */
        text-align: center;
    }

    .trades-table th:nth-child(5),
    .trades-table td:nth-child(5) {
        width: 60px; /* Lado */
        text-align: center;
    }

    .trades-table th:nth-child(6),
    .trades-table td:nth-child(6) {
        width: 95px; /* Entrada */
        text-align: center;
    }

    .trades-table th:nth-child(7),
    .trades-table td:nth-child(7) {
        width: 95px; /* Saída */
        text-align: center;
    }

    .trades-table th:nth-child(8),
    .trades-table td:nth-child(8) {
        width: 85px; /* Resultado */
        text-align: center;
    }

    .trades-table th:nth-child(9),
    .trades-table td:nth-child(9) {
        width: 80px; /* Status */
        text-align: center;
    }

    .trades-table td {
        font-size: 0.7rem;
        padding: 0.6rem 0.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }

    .status-badge {
        font-size: 0.5rem;
        padding: 0.125rem 0.25rem;
        white-space: nowrap;
        display: inline-block;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s ease-in-out infinite;
}

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

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    border: 1px solid var(--border-color);
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}