:root {
    --primary: #38B137;
    --primary-dark: #2a8c29;
    --secondary: #0a2e36;
    --dark: #111;
    --light: #f8f9fa;
    --gray: #6c757d;
    --dark-bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --gold: #FFD700;
    --gold-dark: #DAA520;
    --gold-light: rgba(255, 215, 0, 0.1);
    --hdr-h: 70px; /* fixed header height */
}

body.dashboard-page {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0a1a1f 0%, #0a0a0a 100%);
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 60px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Header (ATR-scoped) ===== */
.atr-header {
    width: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000;

    /* fixed */
    position: fixed !important;
    top: 0; left: 0; width: 100%;
    min-height: var(--hdr-h);
}

.atr-header.scrolled {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    background-color: rgba(10, 10, 10, 0.98);
}

.atr-header .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
}

.atr-header .logo img {
    height: 40px;
    width: auto;
}

.atr-nav {
    display: flex;
    align-items: center;
    position: relative;
}

#atr-menu {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#atr-menu li a {
    color: #ffffff;
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.3s ease;
}

#atr-menu li a:hover,
#atr-menu li a:focus,
#atr-menu li a.active {
    color: var(--primary);
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    transition: color 0.3s ease, transform .15s ease;
}

.menu-btn:hover,
.menu-btn:focus {
    color: var(--primary);
}

#atr-menu.show { display: flex; }

/* ===== Footer ===== */
.atr-footer {
    background: #080808;
    padding: 80px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.atr-footer .footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

.atr-footer .footer-logo {
    flex: 1;
    min-width: 300px;
}

.atr-footer .footer-logo img {
    height: 40px;
    width: auto;
    margin-bottom: 20px;
}

.atr-footer .footer-logo p {
    color: #aaa;
    margin-bottom: 12px;
    max-width: 400px;
}

.atr-footer .footer-contact {
    margin-top: 20px;
    font-weight: 500;
    color: #aaa;
}

.atr-footer .footer-socials {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.atr-footer .footer-socials a {
    color: #aaa;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.atr-footer .footer-socials a:hover,
.atr-footer .footer-socials a:focus {
    color: var(--primary);
}

.atr-footer .footer-links {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.atr-footer .footer-links > div {
    min-width: 180px;
}

.atr-footer .footer-links h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #fff;
}

.atr-footer .footer-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.atr-footer .footer-links ul li {
    margin-bottom: 12px;
}

.atr-footer .footer-links ul li a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
}

.atr-footer .footer-links ul li a:hover,
.atr-footer .footer-links ul li a:focus {
    color: var(--primary);
}

.atr-footer .copyright {
    text-align: left;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #777;
    font-size: 0.9rem;
}

/* Responsive Footer */
@media (max-width: 767.98px) {
    .atr-footer { padding: 60px 0 25px; }

    .atr-footer .footer-content {
        flex-direction: column;
        gap: 30px;
        max-width: 100%;
    }

    .atr-footer .footer-links {
        flex-direction: column;
        gap: 30px;
        max-width: 100%;
    }

    .atr-footer .copyright { text-align: center; }
}

/* ===== General Dashboard Styles ===== */
body.dashboard-page a { color: var(--primary); }
body.dashboard-page a:hover { color: var(--primary-dark); }

body.dashboard-page main { padding-top: 120px; }

body.dashboard-page .breadcrumbs {
    background: rgba(10, 46, 54, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

body.dashboard-page .breadcrumbs h2 { color: #fff; }

body.dashboard-page .breadcrumbs ol li,
body.dashboard-page .breadcrumbs ol li a {
    color: rgba(255, 255, 255, 0.75);
}

.dashboard-section {
    padding: 60px 0 40px;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 0.6s ease-out;
}

.dashboard-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.dashboard-header p,
.dashboard-header .last-update {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
}

.status-indicator {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.status-indicator .badge {
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-online {
    background: rgba(56, 177, 55, 0.15) !important;
    color: var(--primary) !important;
    border-color: rgba(56, 177, 55, 0.4) !important;
    box-shadow: 0 0 12px rgba(56, 177, 55, 0.3);
}

.status-offline {
    background: rgba(220, 53, 69, 0.15) !important;
    color: #ff6b6b !important;
    border-color: rgba(220, 53, 69, 0.4) !important;
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.2);
}

.status-demo {
    background: rgba(13, 110, 253, 0.15) !important;
    color: #0d6efd !important;
    border-color: rgba(13, 110, 253, 0.4) !important;
    box-shadow: 0 0 12px rgba(13, 110, 253, 0.25);
}

.drawdown-offline {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: color 0.3s ease;
}

#time-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    list-style: none;
    padding: 0;
}

#time-filter-tabs .nav-link {
    display: inline-block;
    padding: 10px 26px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

#time-filter-tabs .nav-link:hover {
    color: #fff;
    border-color: rgba(56, 177, 55, 0.4);
}

#time-filter-tabs .nav-link.active {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(56, 177, 55, 0.35);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(56, 177, 55, 0.1) 0%, rgba(10, 46, 54, 0.6) 100%);
    border-radius: 18px;
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.35);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: rgba(56, 177, 55, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.8rem;
}

.stat-card h5 {
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.stat-card .stat-value.profit-positive { color: var(--primary); }
.stat-card .stat-value.profit-negative { color: #ff6b6b; }

.stat-card.drawdown {
    background: linear-gradient(135deg, rgba(255, 87, 108, 0.15) 0%, rgba(255, 143, 193, 0.05) 100%);
    border-color: rgba(255, 87, 108, 0.2);
}

.stat-card.drawdown .stat-icon {
    background: rgba(255, 87, 108, 0.15);
    color: #ff6b81;
}

.stat-card .stat-note {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.dashboard-card {
    background: rgba(18, 18, 18, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(6px);
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: rgba(56, 177, 55, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-card-header i {
    font-size: 1.5rem;
    color: var(--primary);
}

.dashboard-card-header h5 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 600;
}

.dashboard-card-body { padding: 25px; }

.chart-container {
    position: relative;
    height: 360px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.account-card .dashboard-card-header { background: rgba(17, 153, 142, 0.15); }
.account-card .dashboard-card-header i { color: #38ef7d; }

.account-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.account-detail {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.account-detail .label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 6px;
}

.account-detail .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.account-detail .value span { font-weight: inherit; }

.info-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(56, 177, 55, 0.12);
    border: 1px solid rgba(56, 177, 55, 0.35);
    border-radius: 16px;
    padding: 18px 22px;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
}

.info-banner i {
    font-size: 1.4rem;
    color: var(--primary);
}

footer#footer {
    background: #080808;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.65);
}
footer#footer a { color: var(--primary); }

/* ===== Responsive ===== */
@media (max-width: 992px) {
    body.dashboard-page main { padding-top: 110px; }
    .account-details { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    #time-filter-tabs { flex-direction: column; gap: 12px; }
    #time-filter-tabs .nav-link { text-align: center; }
    .chart-container { height: 300px; }
    .dashboard-card-header { flex-direction: column; align-items: flex-start; }
    .status-indicator { flex-direction: column; }
}

@media (max-width: 480px) {
    .dashboard-header h2 { font-size: 1.8rem; }
    .stat-card { padding: 20px; }
    .dashboard-card-body { padding: 20px; }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Mobile / tablet drawer (ATR-scoped) ===== */
@media (max-width: 992px) {
  .atr-header .menu-btn {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff; font-size: 20px; cursor: pointer;
  }

  .atr-header .atr-nav ul#atr-menu {
    display: none !important;
    position: fixed !important;
    top: var(--hdr-h) !important;
    left: 0; right: 0;
    flex-direction: column;
    gap: 8px;
    background: rgba(10,10,10,0.98);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 14px 16px 18px;
    max-height: calc(100vh - var(--hdr-h));
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
  }

  .atr-header .atr-nav ul#atr-menu.show {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .atr-header .atr-nav ul#atr-menu li { margin: 0; width: 100%; }
  .atr-header .atr-nav ul#atr-menu li a {
    display: block; width: 100%;
    padding: 12px 10px; border-radius: 8px;
    color: #fff; text-decoration: none;
    transition: background .15s ease, color .15s ease;
  }
  .atr-header .atr-nav ul#atr-menu li a:hover {
    background: rgba(56,177,55,0.12);
    color: var(--primary);
  }

  body.dashboard-page main { padding-top: calc(var(--hdr-h) + 60px) !important; }
}

/* iOS: scroll fluide dans le drawer */
@supports (-webkit-touch-callout: none) {
  .atr-header .atr-nav ul#atr-menu { -webkit-overflow-scrolling: touch; }
}

/* Empêche le scroll du body quand le menu est ouvert */
body.no-scroll { overflow: hidden !important; }
/* === Burger icon color fix === */
.atr-header .menu-btn,
.atr-header .menu-btn i {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important; /* iOS/Safari */
}

.atr-header .menu-btn.open i {
  color: var(--primary) !important;         /* quand le menu est ouvert */
  -webkit-text-fill-color: var(--primary) !important;
}

/* même en état scrolled, on garde le blanc par défaut */
.atr-header.scrolled .menu-btn i {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
