:root {
    --bg-dark: #0a0a0c;
    --bg-panel: rgba(18, 18, 22, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    
    --color-long: #10b981;  /* Emerald */
    --color-short: #ef4444; /* Red */
    --color-spread: #fbbf24; /* Amber */
    --color-primary: #6366f1; /* Indigo */
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-blur: blur(12px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: var(--color-primary);
    top: -200px;
    left: -100px;
    animation: drift 20s infinite alternate ease-in-out;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: var(--color-spread);
    bottom: -150px;
    right: -100px;
    animation: drift 25s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 50px); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fox-emoji {
    font-size: 2.5rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Filters */
.filters {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    background: var(--bg-panel);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: var(--backdrop-blur);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group input,
.filter-group select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    width: 120px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--color-primary);
}

.filter-group select option {
    background: var(--bg-dark);
    color: white;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    height: 35px;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-icon {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    width: 35px;
    height: 35px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Exchange Filter Bar */
.exchange-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    padding: 0.6rem 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: var(--backdrop-blur);
}

.exchange-filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-right: 0.25rem;
}

.exchange-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.exchange-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    transition: all 0.18s ease;
}

.exchange-chip:hover {
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    background: rgba(99, 102, 241, 0.1);
}

.exchange-chip input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    flex-shrink: 0;
    transition: background 0.18s;
}

.exchange-chip input[type="checkbox"]:checked {
    background: var(--color-primary);
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.6);
}

.exchange-chip:has(input:checked) {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.12);
    color: #c7c8fb;
}

.exchange-filter-actions {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.chip-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chip-btn:hover {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.4);
    color: #fff;
}

.update-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-long);
    border-radius: 50%;
}

.pulse {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Grids & Cards */
.arb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
}

.arb-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s;
}

.arb-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.asset-badge {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.yield-info {
    text-align: right;
}

.spread {
    color: var(--color-spread);
    font-size: 1.25rem;
    font-weight: 700;
}

.apy {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* Legs (Long / Short) */
.legs-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leg {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
    border-left: 3px solid transparent;
}

.leg.long {
    border-left-color: var(--color-long);
}

.leg.short {
    border-left-color: var(--color-short);
}

.leg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exchange-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.exchange-info span.type {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.long .type { background: rgba(16, 185, 129, 0.15); color: var(--color-long); }
.short .type { background: rgba(239, 68, 68, 0.15); color: var(--color-short); }

.exchange-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
    transition: color 0.2s, border-color 0.2s;
}

.exchange-link:hover {
    color: #63b3ed;
    border-bottom-color: #63b3ed;
}

.rate {
    font-weight: 600;
    font-family: monospace;
    font-size: 1.05rem;
}

.rate.positive { color: var(--color-short); } /* Positive rate means you pay (bad for long, good for short) */
.rate.negative { color: var(--color-long); }

.leg-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.stat span:first-child {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.7;
}

.stat span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* Chart Area */
.chart-container {
    height: 180px;
    width: 100%;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1rem;
}

/* States */
.hidden { display: none !important; }

.loading-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
    color: var(--text-secondary);
    gap: 1rem;
}

.empty-state h2 { color: white; }
.empty-state .emoji { font-size: 3rem; }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    header { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .filters { width: 100%; flex-wrap: wrap; }
    .arb-grid { grid-template-columns: 1fr; }
}

/* Calculator Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.hidden {
    display: none !important;
}
.modal-content {
    background: #1a202c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}
.close-btn {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.5rem;
    cursor: pointer;
}
.close-btn:hover {
    color: #fff;
}
.calc-top {
    margin-bottom: 20px;
}
.calc-rates {
    display: flex;
    gap: 15px;
}
.calc-leg {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}
.calc-inputs input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
}
.calc-results {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #cbd5e0;
}
.calc-btn-container {
    margin-left: 10px;
}
.calc-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.calc-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}


 / *   T a b s   &   M o n i t o r   B u t t o n   * / 
 . t a b s   {   m a r g i n - l e f t :   2 0 p x ;   } 
 . t a b - b t n   {   b a c k g r o u n d :   t r a n s p a r e n t ;   b o r d e r :   1 p x   s o l i d   r g b a ( 2 5 5 , 2 5 5 , 2 5 5 , 0 . 2 ) ;   c o l o r :   # f f f ;   p a d d i n g :   6 p x   1 2 p x ;   b o r d e r - r a d i u s :   6 p x ;   c u r s o r :   p o i n t e r ;   f o n t - s i z e :   0 . 9 r e m ;   t r a n s i t i o n :   0 . 2 s ;   } 
 . t a b - b t n . a c t i v e ,   . t a b - b t n : h o v e r   {   b a c k g r o u n d :   v a r ( - - p r i m a r y - c o l o r ) ;   b o r d e r - c o l o r :   v a r ( - - p r i m a r y - c o l o r ) ;   } 
 . m o n i t o r - b t n   {   b a c k g r o u n d :   t r a n s p a r e n t ;   b o r d e r :   n o n e ;   f o n t - s i z e :   1 . 2 r e m ;   c u r s o r :   p o i n t e r ;   o p a c i t y :   0 . 5 ;   t r a n s i t i o n :   0 . 2 s ;   } 
 . m o n i t o r - b t n . a c t i v e   {   o p a c i t y :   1 ;   c o l o r :   # f f c a 2 8 ;   } 
 . m o n i t o r - b t n : h o v e r   {   o p a c i t y :   0 . 8 ;   t r a n s f o r m :   s c a l e ( 1 . 1 ) ;   } 
  
 

/* Tabs */
.tabs {
    display: flex;
    background: rgba(0,0,0,0.4);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.tabs .tab {
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
}
.tabs .tab:hover { color: white; background: rgba(255,255,255,0.05); }
.tabs .tab.active { background: var(--color-primary); color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* Monitor Button */
.monitor-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    padding: 4px 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.monitor-btn.active { 
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
}
.monitor-btn:hover { 
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.15);
}

/* Stats Page */
.stats-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}
.stats-controls .filter-group {
    margin-bottom: 0;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-summary-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    backdrop-filter: var(--backdrop-blur);
}
.stat-summary-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #63b3ed;
    margin-bottom: 4px;
}
.stat-summary-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stats-chart-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    backdrop-filter: var(--backdrop-blur);
}
.stats-chart-card h3 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #a0aec0;
    font-weight: 600;
}
.stats-chart-card canvas {
    height: 260px !important;
}
.stats-chart-full {
    grid-column: 1 / -1;
}
.stats-chart-full canvas {
    height: 200px !important;
}

.stats-table-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    backdrop-filter: var(--backdrop-blur);
}
.stats-table-card h3 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #a0aec0;
    font-weight: 600;
}
.stats-table-wrapper {
    overflow-x: auto;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.stats-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #a0aec0;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.stats-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: #e2e8f0;
    white-space: nowrap;
}
.stats-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

.interval-badge {
    display: inline-block;
    background: rgba(99, 179, 237, 0.15);
    color: #63b3ed;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 4px;
}
.base-chip {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    padding: 2px 8px;
 / *   T a b s   &   M o n i t o r   B u t t o n   * / 
 . t a b s   {   m a r g i n - l e f t :   2 0 p x ;   } 
 . t a b - b t n   {   b a c k g r o u n d :   t r a n s p a r e n t ;   b o r d e r :   1 p x   s o l i d   r g b a ( 2 5 5 , 2 5 5 , 2 5 5 , 0 . 2 ) ;   c o l o r :   # f f f ;   p a d d i n g :   6 p x   1 2 p x ;   b o r d e r - r a d i u s :   6 p x ;   c u r s o r :   p o i n t e r ;   f o n t - s i z e :   0 . 9 r e m ;   t r a n s i t i o n :   0 . 2 s ;   } 
 . t a b - b t n . a c t i v e ,   . t a b - b t n : h o v e r   {   b a c k g r o u n d :   v a r ( - - p r i m a r y - c o l o r ) ;   b o r d e r - c o l o r :   v a r ( - - p r i m a r y - c o l o r ) ;   } 
 . m o n i t o r - b t n   {   b a c k g r o u n d :   t r a n s p a r e n t ;   b o r d e r :   n o n e ;   f o n t - s i z e :   1 . 2 r e m ;   c u r s o r :   p o i n t e r ;   o p a c i t y :   0 . 5 ;   t r a n s i t i o n :   0 . 2 s ;   } 
 . m o n i t o r - b t n . a c t i v e   {   o p a c i t y :   1 ;   c o l o r :   # f f c a 2 8 ;   } 
 . m o n i t o r - b t n : h o v e r   {   o p a c i t y :   0 . 8 ;   t r a n s f o r m :   s c a l e ( 1 . 1 ) ;   } 
  
 

/* Tabs */
.tabs {
    display: flex;
    background: rgba(0,0,0,0.4);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.tabs .tab {
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
}
.tabs .tab:hover { color: white; background: rgba(255,255,255,0.05); }
.tabs .tab.active { background: var(--color-primary); color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* Monitor Button */
.monitor-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    padding: 4px 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.monitor-btn.active { 
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
}
.monitor-btn:hover { 
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.15);
}

/* Stats Page */
.stats-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}
.stats-controls .filter-group {
    margin-bottom: 0;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-summary-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    backdrop-filter: var(--backdrop-blur);
}
.stat-summary-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #63b3ed;
    margin-bottom: 4px;
}
.stat-summary-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stats-chart-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    backdrop-filter: var(--backdrop-blur);
}
.stats-chart-card h3 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #a0aec0;
    font-weight: 600;
}
.stats-chart-card canvas {
    height: 260px !important;
}
.stats-chart-full {
    grid-column: 1 / -1;
}
.stats-chart-full canvas {
    height: 200px !important;
}

.stats-table-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    backdrop-filter: var(--backdrop-blur);
}
.stats-table-card h3 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #a0aec0;
    font-weight: 600;
}
.stats-table-wrapper {
    overflow-x: auto;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.stats-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #a0aec0;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.stats-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: #e2e8f0;
    white-space: nowrap;
}
.stats-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

.interval-badge {
    display: inline-block;
    background: rgba(99, 179, 237, 0.15);
    color: #63b3ed;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 4px;
}
.base-chip {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-right: 4px;
    margin-bottom: 2px;
}
.base-chip small {
    color: #a0aec0;
}

} /* END OF @media (max-width: 768px) */

/* Trading Journal Premium Redesign */
.journal-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.journal-form-card {
    background: linear-gradient(145deg, rgba(30,41,59,0.7) 0%, rgba(15,23,42,0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

.journal-form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0.5;
}

.journal-form-card h3 {
    margin: 0 0 2rem 0;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.journal-form-card h3::before {
    content: '📝';
    font-size: 1.2rem;
}

.journal-form .form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
}

.journal-form .form-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-col {
    background: rgba(15,23,42,0.6);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-col:hover {
    transform: translateY(-2px);
}

.form-col h4 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.long-col {
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.05);
}
.long-col h4::after {
    content: 'LONG';
    font-size: 0.7rem;
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-long);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.short-col {
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.05);
}
.short-col h4::after {
    content: 'SHORT';
    font-size: 0.7rem;
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-short);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.journal-form .filter-group label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.journal-form input, .journal-form select {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #f8fafc;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.journal-form input:focus, .journal-form select:focus {
    background: rgba(0,0,0,0.5);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.long-col input:focus, .long-col select:focus {
    border-color: var(--color-long);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.short-col input:focus, .short-col select:focus {
    border-color: var(--color-short);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.readonly-input {
    background: rgba(255,255,255,0.02) !important;
    color: #cbd5e0 !important;
    border-color: rgba(255,255,255,0.02) !important;
    font-weight: 600;
    font-family: monospace;
    font-size: 1.1rem !important;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
}

.total-pnl-display {
    font-size: 1.1rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.total-pnl-display span {
    font-size: 2rem;
    font-weight: 800;
    font-family: monospace;
    letter-spacing: -0.05em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.submit-btn {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4338ca 100%);
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.submit-btn:active {
    transform: translateY(1px);
}

.journal-table-card {
    background: linear-gradient(145deg, rgba(30,41,59,0.7) 0%, rgba(15,23,42,0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.journal-table-card h3 {
    margin: 0 0 1.5rem 0;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}
