/* GymApp - Design System - No external dependencies */
@import url('fonts.css');

/* ══ LIGHT THEME (default) ══ */
:root {
  /* Brand */
  --primary:        #6366f1;
  --primary-d:      #4f46e5;
  --primary-l:      #eef2ff;
  --primary-light:  rgba(99,102,241,.08);
  --success:        #10b981;
  --success-l:      #ecfdf5;
  --danger:         #ef4444;
  --danger-l:       #fef2f2;
  --danger-dark:    #b91c1c;
  --warning:        #f59e0b;
  --warning-l:      #fffbeb;
  --warning-dark:   #92400e;
  --info:           #3b82f6;
  --info-l:         #eff6ff;

  /* Surfaces */
  --bg:             #f0f2f5;
  --card:           #ffffff;
  --card-alt:       #f8fafc;
  --card-bg:        #ffffff;
  --bg-card:        #ffffff;
  --bg-secondary:   #f8fafc;
  --border:         #e2e8f0;
  --text:           #1e293b;
  --text-2:         #334155;
  --text-muted:     #64748b;
  --muted:          #64748b;
  --muted-2:        #94a3b8;

  /* Gray scale */
  --gray-50:        #f8fafc;
  --gray-100:       #f1f5f9;
  --gray-200:       #e2e8f0;
  --gray-300:       #cbd5e1;
  --gray-400:       #94a3b8;
  --gray-500:       #64748b;
  --gray-600:       #475569;
  --gray-700:       #334155;
  --gray-800:       #1e293b;
  --gray-900:       #0f172a;

  /* Sidebar */
  --sidebar-bg:           #1e293b;
  --sidebar-border:       rgba(255,255,255,.08);
  --sidebar-text:         rgba(255,255,255,.72);
  --sidebar-active-bg:    #6366f1;
  --sidebar-active-text:  #fff;
  --sidebar-hover-bg:     rgba(255,255,255,.07);
  --sidebar-section:      rgba(255,255,255,.3);

  /* Misc */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 4px rgba(0,0,0,.06);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
  --font:           'Vazirmatn', 'Tahoma', sans-serif;
  --sidebar-w:      260px;
  --header-h:       60px;

  /* Input */
  --input-bg:       #ffffff;
  --input-border:   #e2e8f0;

  /* Table */
  --table-head-bg:    #f8fafc;
  --table-row-hover:  #f8fafc;
  --table-border:     #e2e8f0;
  --table-border-2:   #f1f5f9;
}

/* ══ DARK THEME — Neon Blue/Green ══ */
html[data-theme="dark"] {
  /* ══ NEON DARK PALETTE ══ */
  /* Primary — Electric Cyan */
  --primary:        #00f5ff;
  --primary-d:      #00c4d4;
  --primary-l:      rgba(0,245,255,.12);
  --primary-light:  rgba(0,245,255,.08);
  /* Success — Neon Green */
  --success:        #39ff88;
  --success-l:      rgba(57,255,136,.12);
  /* Danger — Hot Pink */
  --danger:         #ff4d6d;
  --danger-l:       rgba(255,77,109,.12);
  --danger-dark:    #ff1a3c;
  /* Warning — Electric Yellow */
  --warning:        #ffe600;
  --warning-l:      rgba(255,230,0,.11);
  --warning-dark:   #ccb800;
  /* Info — Electric Violet */
  --info:           #b06fff;
  --info-l:         rgba(176,111,255,.13);
  /* Extra neons for accents */
  --neon-blue:      #4d9fff;
  --neon-pink:      #ff3cac;
  --neon-mint:      #00ffc8;

  /* Surfaces — deep space */
  --bg:             #060b14;
  --card:           #0d1520;
  --card-alt:       #091018;
  --card-bg:        #0d1520;
  --bg-card:        #0d1520;
  --bg-secondary:   #091018;
  --border:         rgba(0,245,255,.1);
  --text:           #e8f4ff;
  --text-2:         #8fb3cc;
  --text-muted:     #4a6a82;
  --muted:          #4a6a82;
  --muted-2:        #2d4558;

  /* Gray scale — remapped to dark equivalents */
  --gray-50:        #091018;
  --gray-100:       rgba(0,245,255,.06);
  --gray-200:       rgba(0,245,255,.1);
  --gray-300:       rgba(0,245,255,.15);
  --gray-400:       #4a6a82;
  --gray-500:       #3a5268;
  --gray-600:       #8fb3cc;
  --gray-700:       #b8d0e0;
  --gray-800:       #d0e8f5;
  --gray-900:       #e8f4ff;

  /* Sidebar — deep navy */
  --sidebar-bg:           #040912;
  --sidebar-border:       rgba(0,245,255,.08);
  --sidebar-text:         rgba(200,230,255,.6);
  --sidebar-active-bg:    rgba(0,245,255,.12);
  --sidebar-active-text:  #00f5ff;
  --sidebar-hover-bg:     rgba(0,245,255,.06);
  --sidebar-section:      rgba(0,245,255,.3);

  /* Shadows — neon glow */
  --shadow-sm:      0 1px 4px rgba(0,0,0,.6), 0 0 0 1px rgba(0,245,255,.04);
  --shadow:         0 4px 20px rgba(0,0,0,.7), 0 0 0 1px rgba(0,245,255,.05);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.8), 0 0 30px rgba(0,245,255,.04), 0 0 0 1px rgba(0,245,255,.06);

  /* Input */
  --input-bg:       #091018;
  --input-border:   rgba(0,245,255,.18);

  /* Table */
  --table-head-bg:    #060b14;
  --table-row-hover:  rgba(0,245,255,.04);
  --table-border:     rgba(0,245,255,.08);
  --table-border-2:   rgba(0,245,255,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); direction: rtl; min-height: 100vh; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
img { max-width: 100%; }
button, input, select, textarea { font-family: var(--font); }

/* ── Layout ──────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; z-index: 200; transition: transform .3s; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { padding: 8px 16px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-section); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: var(--sidebar-text); cursor: pointer; border: none; background: none; width: 100%; text-align: right; font-family: var(--font); font-size: .9rem; transition: .15s; text-decoration: none; }
.nav-item:hover { background: var(--sidebar-hover-bg); color: #fff; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.nav-item .icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-profile-card:hover { background: rgba(255,255,255,.05) !important; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--sidebar-border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; overflow: hidden; flex-shrink: 0; }
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-username { font-size: .85rem; font-weight: 500; }
.sidebar-role { font-size: .72rem; color: rgba(255,255,255,.5); }

.main-content { margin-right: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--header-h); background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 100; }
/* ── Topbar 360 Sport Brand ── */
.topbar-brand { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0; user-select: none; }
.topbar-brand-360 {
  font-size: 1.35rem; font-weight: 900; letter-spacing: -.02em;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-brand-sport {
  font-size: 1.05rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(135deg, #10b981, #06b6d4, #3b82f6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: 5px;
}
/* Dark mode — neon brand */
html[data-theme="dark"] .topbar-brand-360 {
  background: linear-gradient(135deg, #00f5ff, #b06fff, #ff3cac);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(0,245,255,.35));
}
html[data-theme="dark"] .topbar-brand-sport {
  background: linear-gradient(135deg, #39ff88, #00f5ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(57,255,136,.3));
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.page-body { flex: 1; padding: 24px; }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card-title { font-size: 1rem; font-weight: 600; flex: 1; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--card-alt); border-radius: 0 0 var(--radius) var(--radius); }

/* ── Stats ───────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-icon.purple { background: var(--primary-l); }
.stat-icon.green  { background: var(--success-l); }
.stat-icon.orange { background: var(--warning-l); }
.stat-icon.blue   { background: var(--info-l); }
.stat-icon.red    { background: var(--danger-l); }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); border: none; font-family: var(--font); font-size: .875rem; font-weight: 500; cursor: pointer; transition: .15s; min-height: 44px; white-space: nowrap; }
.btn-sm  { padding: 7px 14px; font-size: .8rem; min-height: 36px; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--card-alt); color: var(--text); }
.btn-icon { padding: 10px; min-height: 44px; width: 44px; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; color: var(--text-2); }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control { width: 100%; padding: 11px 14px; border: 1.5px solid var(--input-border); border-radius: var(--radius-sm); font-family: var(--font); font-size: .9rem; color: var(--text); background: var(--input-bg); outline: none; transition: .2s; min-height: 44px; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 36px; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:600px) { .form-row { grid-template-columns: 1fr; } }
.check-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 12px 14px; text-align: right; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--table-border); background: var(--table-head-bg); }
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--table-border-2); font-size: .875rem; vertical-align: middle; }
tbody tr:hover { background: var(--table-row-hover); }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: 6px; }

/* ── Badges / Pills ──────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-primary { background: var(--primary-l); color: var(--primary-d); }
.badge-success { background: var(--success-l); color: #065f46; }
.badge-danger  { background: var(--danger-l);  color: #991b1b; }
.badge-warning { background: var(--warning-l); color: #92400e; }
.badge-info    { background: var(--info-l);    color: #1e40af; }
.badge-gray    { background: var(--gray-100);  color: var(--gray-600); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: .875rem; line-height: 1.6; margin-bottom: 16px; border-width: 1px; border-style: solid; }
.alert-success { background: var(--success-l); color: #065f46; border-color: #6ee7b7; }
.alert-danger  { background: var(--danger-l);  color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: var(--warning-l); color: #92400e; border-color: #fcd34d; }
.alert-info    { background: var(--info-l);    color: #1e40af; border-color: #93c5fd; }
.alert-medical { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }

/* ── Exercise check items (athlete view) ─────────────────── */
.exercise-item { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; transition: .2s; background: var(--card); }
.exercise-item.done { background: var(--success-l); border-color: #6ee7b7; }
.exercise-tick { width: 52px; height: 52px; border-radius: 50%; border: 2.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; cursor: pointer; transition: .2s; flex-shrink: 0; background: var(--card); }
.exercise-tick:hover { border-color: var(--success); background: var(--success-l); }
.exercise-item.done .exercise-tick { border-color: var(--success); background: var(--success); color: #fff; }
.exercise-name { font-weight: 600; font-size: 1rem; }
.exercise-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.exercise-warning { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; color: #92400e; background: var(--warning-l); padding: 2px 8px; border-radius: 20px; margin-top: 4px; }

/* ── Progress bar ────────────────────────────────────────── */
.progress { height: 8px; background: var(--border); border-radius: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 8px; transition: width .4s; }
.progress-bar.success { background: var(--success); }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: .9rem; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

/* ── Notification bell ───────────────────────────────────── */
.notif-btn { position: relative; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid #fff; }

/* ── Gym picker ──────────────────────────────────────────── */
.gym-picker-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 16px; }
.gym-card { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; transition: .2s; }
.gym-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.gym-card .gym-logo { width: 64px; height: 64px; border-radius: 12px; margin: 0 auto 12px; background: var(--primary-l); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; overflow: hidden; }
.gym-card .gym-logo img { width: 100%; height: 100%; object-fit: cover; }
.gym-card .gym-name { font-weight: 600; font-size: 1rem; }
.gym-card .gym-role { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ── Session timer ───────────────────────────────────────── */
.session-timer { background: linear-gradient(135deg,var(--primary),var(--primary-d)); color: #fff; border-radius: var(--radius); padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.timer-display { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-label { font-size: .8rem; opacity: .8; }

/* ── Weight chart container ──────────────────────────────── */
.chart-wrap { position: relative; height: 280px; }

/* ── Leaderboard ─────────────────────────────────────────── */
.leader-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.leader-rank { width: 28px; text-align: center; font-weight: 700; color: var(--muted); }
.leader-rank.top1 { color: #eab308; }
.leader-rank.top2 { color: var(--gray-400); }
.leader-rank.top3 { color: #cd7c2e; }
.leader-pts { margin-right: auto; font-weight: 600; color: var(--primary); }

/* ── Switch gym button ───────────────────────────────────── */
.switch-gym-btn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,.1); color: var(--sidebar-text); font-size: .8rem; cursor: pointer; border: none; font-family: var(--font); transition: .2s; }
.switch-gym-btn:hover { background: rgba(255,255,255,.2); }

/* ── Mobile ──────────────────────────────────────────────── */
.menu-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: 8px; color: var(--text); }
@media(max-width: 768px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-right: 0; }
  .menu-toggle { display: flex; }
  .page-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199; }
  .sidebar-overlay.show { display: block; }
}

/* ── Utilities ───────────────────────────────────────────── */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-small { font-size: .8rem; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media(max-width:600px) { .grid-2,.grid-3 { grid-template-columns: 1fr; } }
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: .9rem; }

/* ══════════════════════════════════════════════════════════════════
   DARK MODE — supplemental overrides (neon palette)
   ══════════════════════════════════════════════════════════════════ */

/* Sidebar active item — neon accent border */
html[data-theme="dark"] .nav-item.active {
  box-shadow: inset 3px 0 0 var(--primary);
}
html[data-theme="dark"] .nav-item:hover {
  color: #fff;
}

/* Buttons */
html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #00f5ff, #00c4d4);
  color: #060b14;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(0,245,255,.3);
}
html[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #00c4d4, #0090a0);
  box-shadow: 0 0 24px rgba(0,245,255,.5);
}
html[data-theme="dark"] .btn-success {
  background: linear-gradient(135deg, #39ff88, #00d45a);
  color: #060b14;
  font-weight: 700;
}
html[data-theme="dark"] .btn-success:hover {
  box-shadow: 0 0 20px rgba(57,255,136,.45);
}
html[data-theme="dark"] .btn-ghost:hover {
  background: rgba(0,245,255,.06);
  color: #00f5ff;
}

/* Badges */
html[data-theme="dark"] .badge-primary { background: rgba(0,245,255,.13); color: #00f5ff; border: 1px solid rgba(0,245,255,.2); }
html[data-theme="dark"] .badge-success { background: rgba(57,255,136,.13); color: #39ff88; border: 1px solid rgba(57,255,136,.2); }
html[data-theme="dark"] .badge-danger  { background: rgba(255,77,109,.13); color: #ff4d6d; border: 1px solid rgba(255,77,109,.2); }
html[data-theme="dark"] .badge-warning { background: rgba(255,230,0,.11); color: #ffe600; border: 1px solid rgba(255,230,0,.18); }
html[data-theme="dark"] .badge-info    { background: rgba(176,111,255,.13); color: #b06fff; border: 1px solid rgba(176,111,255,.2); }
html[data-theme="dark"] .badge-gray    { background: rgba(255,255,255,.06); color: #6a8aa0; }

/* Alerts */
html[data-theme="dark"] .alert-success { background: rgba(57,255,136,.08); color: #39ff88; border-color: rgba(57,255,136,.2); }
html[data-theme="dark"] .alert-danger  { background: rgba(255,77,109,.08); color: #ff4d6d; border-color: rgba(255,77,109,.2); }
html[data-theme="dark"] .alert-warning { background: rgba(255,230,0,.07); color: #ffe600; border-color: rgba(255,230,0,.18); }
html[data-theme="dark"] .alert-info    { background: rgba(176,111,255,.08); color: #b06fff; border-color: rgba(176,111,255,.2); }
html[data-theme="dark"] .alert-medical { background: rgba(255,120,50,.07); color: #ff7832; border-color: rgba(255,120,50,.18); }

/* Stat icons */
html[data-theme="dark"] .stat-icon.purple { background: rgba(0,245,255,.1); }
html[data-theme="dark"] .stat-icon.green  { background: rgba(57,255,136,.1); }
html[data-theme="dark"] .stat-icon.orange { background: rgba(255,230,0,.1); }
html[data-theme="dark"] .stat-icon.blue   { background: rgba(77,159,255,.1); }
html[data-theme="dark"] .stat-icon.red    { background: rgba(255,77,109,.1); }

/* Progress bar — neon gradient */
html[data-theme="dark"] .progress-bar {
  background: linear-gradient(90deg, #00f5ff, #39ff88, #b06fff);
  box-shadow: 0 0 8px rgba(0,245,255,.4);
}

/* Session timer */
html[data-theme="dark"] .session-timer {
  background: linear-gradient(135deg, #030f1c, #061828);
  border: 1px solid rgba(0,245,255,.15);
  box-shadow: 0 0 30px rgba(0,245,255,.08);
}

/* Exercise done state */
html[data-theme="dark"] .exercise-item.done {
  background: rgba(57,255,136,.06);
  border-color: rgba(57,255,136,.2);
}
html[data-theme="dark"] .exercise-tick:hover {
  border-color: var(--success);
  background: rgba(57,255,136,.1);
}
html[data-theme="dark"] .exercise-item.done .exercise-tick {
  border-color: var(--success);
  background: var(--success);
  color: #060b14;
}

/* Card hover glow */
html[data-theme="dark"] .card:hover {
  border-color: rgba(0,245,255,.15);
  box-shadow: 0 4px 24px rgba(0,0,0,.7), 0 0 20px rgba(0,245,255,.06);
}

/* Gym picker */
html[data-theme="dark"] .gym-card:hover {
  border-color: #00f5ff;
  box-shadow: 0 0 28px rgba(0,245,255,.18);
}
html[data-theme="dark"] .gym-card .gym-logo {
  background: var(--primary-l);
}

/* Leaderboard */
html[data-theme="dark"] .leader-item { border-bottom-color: var(--border); }
html[data-theme="dark"] .leader-pts  { color: var(--primary); text-shadow: 0 0 10px rgba(0,245,255,.5); }

/* Select dropdown arrow for dark */
html[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300f5ff' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
}

/* Form focus neon glow */
html[data-theme="dark"] .form-control:focus {
  border-color: #00f5ff;
  box-shadow: 0 0 0 3px rgba(0,245,255,.14), 0 0 12px rgba(0,245,255,.08);
}

/* Scrollbar */
html[data-theme="dark"] ::-webkit-scrollbar { width: 5px; height: 5px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #060b14; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(0,245,255,.2); border-radius: 3px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,245,255,.4); }

/* Selection highlight */
html[data-theme="dark"] ::selection {
  background: rgba(0,245,255,.18);
  color: #e8f4ff;
}

/* ── Pro/subscription pages ── */
html[data-theme="dark"] .pro-hero {
  background: linear-gradient(135deg, #040d1a, #071830, #04180f);
  border: 1px solid rgba(0,245,255,.15);
  box-shadow: inset 0 0 100px rgba(0,245,255,.02);
}
html[data-theme="dark"] .pro-card:hover {
  border-color: #00f5ff;
  box-shadow: 0 0 30px rgba(0,245,255,.14);
}
html[data-theme="dark"] .pro-active-banner {
  background: linear-gradient(135deg, #052a18, #083a22);
  box-shadow: 0 0 24px rgba(57,255,136,.12);
}

/* ══ THEME TOGGLE BUTTON — NEON DARK STATE ══ */
html[data-theme="dark"] .tt-btn {
  background: rgba(0,245,255,.08);
  border-color: rgba(0,245,255,.22);
  color: rgba(200,240,255,.85);
}
html[data-theme="dark"] .tt-btn:hover {
  background: rgba(0,245,255,.14);
  border-color: rgba(0,245,255,.4);
  color: #00f5ff;
  box-shadow: 0 0 16px rgba(0,245,255,.15);
}

/* Icons swap */
html[data-theme="dark"] .tt-sun  { opacity: 0; transform: rotate(90deg) scale(.6); }
html[data-theme="dark"] .tt-moon { opacity: 1; transform: rotate(0deg) scale(1); position: relative; pointer-events: auto; }

/* Track glows */
html[data-theme="dark"] .tt-track {
  background: rgba(0,245,255,.18);
  border-color: rgba(0,245,255,.32);
  box-shadow: 0 0 12px rgba(0,245,255,.18);
}

/* Thumb slides to left in dark */
html[data-theme="dark"] .tt-thumb {
  transform: translateX(-18px);
  background: linear-gradient(135deg, #00f5ff, #00c4d4);
  box-shadow: 0 0 16px rgba(0,245,255,.7), 0 1px 4px rgba(0,0,0,.4);
}
html[data-theme="dark"] .tt-thumb-sun  { opacity: 0; }
html[data-theme="dark"] .tt-thumb-moon { opacity: 1; }

/* Text changes */
html[data-theme="dark"] .tt-text::before { content: 'تم روشن'; }

/* ── Dark mode: sidebar active item neon border ── */
html[data-theme="dark"] .nav-item.active {
  box-shadow: inset 3px 0 0 var(--primary), 0 0 12px rgba(0,245,255,.05);
}

/* ── Topbar dark ── */
html[data-theme="dark"] .topbar {
  border-bottom-color: rgba(0,245,255,.08);
  box-shadow: 0 1px 20px rgba(0,0,0,.5);
}



/* ══════════════════════════════════════════════════════════════════
   DARK MODE — COMPREHENSIVE MODULE OVERRIDES
   Override hardcoded inline styles in all module views
   ══════════════════════════════════════════════════════════════════ */

/* ── Global element resets ── */
html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

/* ── All divs/spans with inline bg colors — catch-all for light surfaces ── */
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .page-body {
  background: var(--bg);
}

/* ── Tables ── */
html[data-theme="dark"] table { color: var(--text); }
html[data-theme="dark"] th { background: var(--table-head-bg) !important; color: var(--text-2) !important; border-color: var(--table-border) !important; }
html[data-theme="dark"] td { border-color: var(--table-border) !important; color: var(--text) !important; }
html[data-theme="dark"] tr:hover td { background: var(--table-row-hover) !important; }
html[data-theme="dark"] .table th { background: var(--table-head-bg) !important; color: var(--text-2) !important; }
html[data-theme="dark"] .table td { background: transparent !important; color: var(--text) !important; border-color: var(--table-border) !important; }

/* ── Cards and panels ── */
html[data-theme="dark"] .card { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] .card-header { border-bottom-color: rgba(0,245,255,.08) !important; background: transparent !important; }
html[data-theme="dark"] .card-footer { background: var(--card-alt) !important; border-top-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] .card-title { color: var(--text) !important; }

/* ── Stat cards ── */
html[data-theme="dark"] .stat-card { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] .stat-value { color: var(--text) !important; }
html[data-theme="dark"] .stat-label { color: var(--muted) !important; }

/* ── List items and rows with inline border-bottom ── */
html[data-theme="dark"] [style*="border-bottom:1px solid #e2e8f0"],
html[data-theme="dark"] [style*="border-bottom: 1px solid #e2e8f0"],
html[data-theme="dark"] [style*="border-bottom:1px solid var(--gray-100)"],
html[data-theme="dark"] [style*="border-bottom: 1px solid var(--gray-100)"] {
  border-bottom-color: rgba(0,245,255,.07) !important;
}
html[data-theme="dark"] [style*="border-bottom:1px solid var(--border)"],
html[data-theme="dark"] [style*="border-bottom: 1px solid var(--border)"] {
  border-bottom-color: rgba(0,245,255,.07) !important;
}

/* ── Light background surfaces (inline styles) ── */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"] {
  background: var(--card) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f1f5f9"],
html[data-theme="dark"] [style*="background: #f1f5f9"],
html[data-theme="dark"] [style*="background:#f0f2f5"],
html[data-theme="dark"] [style*="background:#f0f9ff"],
html[data-theme="dark"] [style*="background:#f0fdf4"],
html[data-theme="dark"] [style*="background:#eff6ff"] {
  background: var(--card-alt) !important;
  color: var(--text) !important;
}

/* ── Inline light-colored status backgrounds ── */
html[data-theme="dark"] [style*="background:#eef2ff"],
html[data-theme="dark"] [style*="background: #eef2ff"],
html[data-theme="dark"] [style*="background:#e0f2fe"] {
  background: rgba(0,245,255,.08) !important;
  color: #00f5ff !important;
}
html[data-theme="dark"] [style*="background:#ecfdf5"],
html[data-theme="dark"] [style*="background:#f0fdf4"],
html[data-theme="dark"] [style*="background:#dcfce7"] {
  background: rgba(57,255,136,.08) !important;
  color: #39ff88 !important;
}
html[data-theme="dark"] [style*="background:#fef2f2"],
html[data-theme="dark"] [style*="background:#fee2e2"],
html[data-theme="dark"] [style*="background:#fff5f5"] {
  background: rgba(255,77,109,.08) !important;
  color: #ff4d6d !important;
}
html[data-theme="dark"] [style*="background:#fffbeb"],
html[data-theme="dark"] [style*="background:#fef9c3"],
html[data-theme="dark"] [style*="background:#fff7ed"],
html[data-theme="dark"] [style*="background:#fef3c7"] {
  background: rgba(255,230,0,.08) !important;
  color: #ffe600 !important;
}
html[data-theme="dark"] [style*="background:#eff6ff"] {
  background: rgba(77,159,255,.08) !important;
  color: #4d9fff !important;
}
html[data-theme="dark"] [style*="background:#e2e8f0"],
html[data-theme="dark"] [style*="background:#f1f5f9"] {
  background: rgba(0,245,255,.06) !important;
  color: var(--text) !important;
}

/* ── Inline text colors — light mode dark text ── */
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color:#374151"],
html[data-theme="dark"] [style*="color:#334155"] { color: var(--text) !important; }

html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color:#64748b"],
html[data-theme="dark"] [style*="color:#94a3b8"] { color: var(--text-2) !important; }

/* ── Inline primary colors — keep but remap ── */
html[data-theme="dark"] [style*="color:#6366f1"],
html[data-theme="dark"] [style*="color: #6366f1"],
html[data-theme="dark"] [style*="color:#4f46e5"],
html[data-theme="dark"] [style*="color:#4338ca"],
html[data-theme="dark"] [style*="color:#1d4ed8"] { color: var(--primary) !important; }

html[data-theme="dark"] [style*="color:#10b981"],
html[data-theme="dark"] [style*="color:#16a34a"],
html[data-theme="dark"] [style*="color:#15803d"],
html[data-theme="dark"] [style*="color:#065f46"],
html[data-theme="dark"] [style*="color:#059669"],
html[data-theme="dark"] [style*="color:#22c55e"],
html[data-theme="dark"] [style*="color:#34d399"] { color: var(--success) !important; }

html[data-theme="dark"] [style*="color:#ef4444"],
html[data-theme="dark"] [style*="color:#dc2626"],
html[data-theme="dark"] [style*="color:#b91c1c"],
html[data-theme="dark"] [style*="color:#991b1b"] { color: var(--danger) !important; }

html[data-theme="dark"] [style*="color:#f59e0b"],
html[data-theme="dark"] [style*="color:#d97706"],
html[data-theme="dark"] [style*="color:#b45309"],
html[data-theme="dark"] [style*="color:#92400e"],
html[data-theme="dark"] [style*="color:#854d0e"],
html[data-theme="dark"] [style*="color:#ea580c"],
html[data-theme="dark"] [style*="color:#c2410c"] { color: var(--warning) !important; }

/* ── Forms ── */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--muted-2) !important; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(0,245,255,.13) !important;
}
html[data-theme="dark"] label { color: var(--text-2) !important; }

/* ── Modal / overlay panels ── */
html[data-theme="dark"] .modal,
html[data-theme="dark"] [class*="modal"],
html[data-theme="dark"] [class*="panel"],
html[data-theme="dark"] [class*="dialog"] {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: rgba(0,245,255,.1) !important;
}

/* ── Headings and text in cards ── */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 { color: var(--text) !important; }

html[data-theme="dark"] p,
html[data-theme="dark"] span:not([class*="badge"]):not([class*="btn"]):not([class*="icon"]) {
  color: inherit;
}

/* ── Tabs ── */
html[data-theme="dark"] .tab,
html[data-theme="dark"] [class*="tab-"] {
  background: transparent;
  color: var(--text-2);
}
html[data-theme="dark"] [class*="tab-"].active,
html[data-theme="dark"] [class*="tab-"][aria-selected="true"] {
  background: rgba(0,245,255,.1) !important;
  color: var(--primary) !important;
  border-color: rgba(0,245,255,.25) !important;
}

/* ── Sections with gray backgrounds (pattern in gym/athlete views) ── */
html[data-theme="dark"] [style*="background:rgba(0,0,0,"] { /* keep dark overlays */ }
html[data-theme="dark"] [style*="background:linear-gradient"] { /* keep gradients mostly */ }

/* ── Specific module patterns ── */
/* Row items in lists */
html[data-theme="dark"] [style*="padding:12px 20px;border-bottom"] {
  color: var(--text) !important;
}
/* Info boxes */
html[data-theme="dark"] [style*="border-radius"][style*="background:#e"] {
  background: var(--card-alt) !important;
}
/* Inline bg:#f on any div that looks like a card/panel */
html[data-theme="dark"] div[style*="background:#f"]:not([style*="background:#ff"]) {
  background: var(--card-alt) !important;
  color: var(--text) !important;
}

/* ── Metric/number display blocks ── */
html[data-theme="dark"] .metric,
html[data-theme="dark"] [class*="metric"],
html[data-theme="dark"] [class*="count"],
html[data-theme="dark"] [class*="number"] {
  color: var(--text) !important;
}

/* ── Section dividers / hr ── */
html[data-theme="dark"] hr { border-color: rgba(0,245,255,.08) !important; }

/* ── Notification / info rows ── */
html[data-theme="dark"] .notif,
html[data-theme="dark"] [class*="notif"],
html[data-theme="dark"] [class*="alert"]:not(.alert-success):not(.alert-danger):not(.alert-warning):not(.alert-info) {
  background: var(--card-alt) !important;
  border-color: rgba(0,245,255,.1) !important;
  color: var(--text) !important;
}

/* ── Athlete / Coach views — specific wrappers ── */
html[data-theme="dark"] .section-header,
html[data-theme="dark"] .page-header,
html[data-theme="dark"] .list-header {
  background: transparent !important;
  color: var(--text) !important;
  border-bottom-color: rgba(0,245,255,.08) !important;
}

/* ── Charts (Chart.js canvas bg) ── */
html[data-theme="dark"] canvas { filter: none; }

/* ── Scrollable inner panels ── */
html[data-theme="dark"] [style*="overflow"][style*="background:#fff"],
html[data-theme="dark"] [style*="overflow"][style*="background: #fff"] {
  background: var(--card) !important;
}

/* ── Progress / meter elements ── */
html[data-theme="dark"] progress,
html[data-theme="dark"] meter {
  background: var(--gray-100);
  border-color: var(--border);
}

/* ── Specific inline border colors used in views ── */
html[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
html[data-theme="dark"] [style*="border: 1px solid #e2e8f0"],
html[data-theme="dark"] [style*="border:1px solid #e"],
html[data-theme="dark"] [style*="border-color:#e2e8f0"] {
  border-color: rgba(0,245,255,.1) !important;
}

/* ── Inline box-shadow removal on dark ── */
html[data-theme="dark"] [style*="box-shadow:0 1px 3px rgba(0,0,0,.05)"],
html[data-theme="dark"] [style*="box-shadow:0 2px 4px rgba(0,0,0,.05)"] {
  box-shadow: var(--shadow-sm) !important;
}

/* ── Special: inline style background:#f59e0b (warning buttons) ── */
html[data-theme="dark"] [style*="background:#f59e0b"],
html[data-theme="dark"] [style*="background: #f59e0b"] {
  background: rgba(255,230,0,.15) !important;
  color: var(--warning) !important;
  border: 1px solid rgba(255,230,0,.25) !important;
}
html[data-theme="dark"] [style*="background:#10b981"],
html[data-theme="dark"] [style*="background: #10b981"],
html[data-theme="dark"] [style*="background:#16a34a"],
html[data-theme="dark"] [style*="background:#22c55e"] {
  background: rgba(57,255,136,.15) !important;
  color: var(--success) !important;
}
html[data-theme="dark"] [style*="background:#ef4444"],
html[data-theme="dark"] [style*="background: #ef4444"],
html[data-theme="dark"] [style*="background:#dc2626"] {
  background: rgba(255,77,109,.15) !important;
  color: var(--danger) !important;
}
html[data-theme="dark"] [style*="background:#6366f1"],
html[data-theme="dark"] [style*="background: #6366f1"] {
  background: rgba(0,245,255,.12) !important;
  color: var(--primary) !important;
}

/* ── Inline color on important text ── */
html[data-theme="dark"] [style*="color:#e2e8f0"],
html[data-theme="dark"] [style*="color:#f1f5f9"],
html[data-theme="dark"] [style*="color:#f8fafc"] { color: var(--text) !important; }

/* ── Btn outline in dark ── */
html[data-theme="dark"] .btn-outline {
  border-color: rgba(0,245,255,.25) !important;
  color: var(--primary) !important;
  background: transparent !important;
}
html[data-theme="dark"] .btn-outline:hover {
  background: rgba(0,245,255,.08) !important;
  border-color: var(--primary) !important;
}

/* ── Empty state ── */
html[data-theme="dark"] .empty-state { color: var(--muted) !important; }
html[data-theme="dark"] .empty-state p { color: var(--muted) !important; }

/* ── Text utilities ── */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary { color: var(--text-muted) !important; }
html[data-theme="dark"] .text-small { color: var(--text-2) !important; }
html[data-theme="dark"] .text-primary { color: var(--primary) !important; }
html[data-theme="dark"] .text-success { color: var(--success) !important; }
html[data-theme="dark"] .text-danger  { color: var(--danger) !important; }
html[data-theme="dark"] .text-warning { color: var(--warning) !important; }

/* ── Inline color:#fef3c7 (light warning text) ── */
html[data-theme="dark"] [style*="color:#fef3c7"] { color: var(--warning) !important; }
html[data-theme="dark"] [style*="color:#f87171"] { color: var(--danger) !important; }

/* ── Subtle colored wrappers ── */
html[data-theme="dark"] [style*="padding"][style*="border-radius"][style*="background:#f"] {
  background: var(--card-alt) !important;
  border-color: rgba(0,245,255,.08) !important;
}

/* ══════════════════════════════════════════════════════════════════
   DARK MODE — MODULE-SPECIFIC CLASS OVERRIDES
   Covers inline <style> blocks in module view files
   ══════════════════════════════════════════════════════════════════ */

/* ── athlete/today.php ── */
html[data-theme="dark"] .set-badge { background: rgba(0,245,255,.1) !important; color: #00f5ff !important; }
html[data-theme="dark"] .set-input-label { background: rgba(0,245,255,.1) !important; color: #00f5ff !important; }
html[data-theme="dark"] .set-input { background: var(--input-bg) !important; border-color: var(--input-border) !important; color: var(--text) !important; }
html[data-theme="dark"] .set-input:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(0,245,255,.13) !important; }
html[data-theme="dark"] .sets-count-btn { background: var(--card-alt) !important; border-color: rgba(0,245,255,.15) !important; color: var(--text) !important; }
html[data-theme="dark"] .sets-count-btn.active { border-color: var(--primary) !important; background: rgba(0,245,255,.15) !important; color: var(--primary) !important; }

/* ── shared/league.php ── */
html[data-theme="dark"] .league-tabs { background: var(--card-alt) !important; }
html[data-theme="dark"] .league-row { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] .league-row.is-me { background: rgba(0,245,255,.07) !important; border-color: rgba(0,245,255,.25) !important; }
html[data-theme="dark"] .l-avatar,
html[data-theme="dark"] .podium-avatar { background: rgba(0,245,255,.1) !important; color: var(--primary) !important; border-color: rgba(0,245,255,.2) !important; }

/* ── shared/profile.php ── */
html[data-theme="dark"] .profile-section { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] .role-tab { background: var(--card) !important; border-color: rgba(0,245,255,.12) !important; color: var(--text-2) !important; }
html[data-theme="dark"] .role-tab:hover { background: rgba(0,245,255,.06) !important; border-color: rgba(0,245,255,.25) !important; color: var(--primary) !important; }
html[data-theme="dark"] .profile-avatar-edit { background: var(--primary) !important; border-color: var(--card) !important; color: #060b14 !important; }
html[data-theme="dark"] .toggle-slider { background: rgba(0,245,255,.2) !important; }

/* ── shared/badge & modals ── */
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .award-sheet { background: var(--card) !important; border-color: rgba(0,245,255,.1) !important; }
html[data-theme="dark"] .awarded-tag { background: rgba(255,230,0,.15) !important; color: var(--warning) !important; }

/* ── coach/exercises.php ── */
html[data-theme="dark"] .ex-card { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] .ex-card:hover { border-color: rgba(0,245,255,.25) !important; box-shadow: 0 0 16px rgba(0,245,255,.06) !important; }
html[data-theme="dark"] .filter-chip { background: var(--card-alt) !important; border-color: rgba(0,245,255,.12) !important; color: var(--text-2) !important; }
html[data-theme="dark"] .filter-chip.active { background: rgba(0,245,255,.12) !important; border-color: var(--primary) !important; color: var(--primary) !important; }

/* ── coach/assessments.php ── */
html[data-theme="dark"] .assess-athlete-card { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] .assess-athlete-card:hover { border-color: rgba(0,245,255,.25) !important; }
html[data-theme="dark"] .metric-mini-bar { background: rgba(0,245,255,.1) !important; }

/* ── shared/certificate & general box ── */
html[data-theme="dark"] .box { background: var(--card) !important; }
html[data-theme="dark"] .badge-ok { background: rgba(57,255,136,.1) !important; color: #39ff88 !important; }
html[data-theme="dark"] .badge-err { background: rgba(255,77,109,.1) !important; color: #ff4d6d !important; }

/* ── checkout / payment ── */
html[data-theme="dark"] .checkout-card { background: var(--card) !important; }
html[data-theme="dark"] .amount-box { background: var(--card-alt) !important; border-color: rgba(0,245,255,.1) !important; }
html[data-theme="dark"] .timer-bar { background: rgba(255,230,0,.06) !important; border-color: rgba(255,230,0,.18) !important; }
html[data-theme="dark"] .timer-progress { background: rgba(255,230,0,.18) !important; }

/* ── admin/users.php & gym/athletes.php ── */
html[data-theme="dark"] .user-row,
html[data-theme="dark"] .athlete-row { background: var(--card) !important; border-color: rgba(0,245,255,.07) !important; }
html[data-theme="dark"] .user-row:hover,
html[data-theme="dark"] .athlete-row:hover { background: var(--table-row-hover) !important; }

/* ── Session timer ── */
html[data-theme="dark"] .session-timer { background: linear-gradient(135deg, #030f1c, #061828) !important; border: 1px solid rgba(0,245,255,.15) !important; }
html[data-theme="dark"] .timer-display { color: var(--primary) !important; text-shadow: 0 0 20px rgba(0,245,255,.5) !important; }

/* ── Athlete dashboard hero slider ── */
html[data-theme="dark"] .hero-slider-wrapper { box-shadow: 0 8px 30px rgba(0,0,0,.6) !important; }

/* ── AI coach view ── */
html[data-theme="dark"] .ai-msg,
html[data-theme="dark"] [class*="message"],
html[data-theme="dark"] [class*="bubble"] { background: var(--card-alt) !important; color: var(--text) !important; border-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] [class*="user-msg"],
html[data-theme="dark"] [class*="self-msg"] { background: rgba(0,245,255,.1) !important; color: var(--text) !important; }

/* ── Pro/subscription pages ── */
html[data-theme="dark"] .plan-badge { background: rgba(0,245,255,.15) !important; color: var(--primary) !important; }

/* ── Badge celebration overlay ── */
html[data-theme="dark"] #badge-celebration { background: rgba(6,11,20,.92) !important; }
html[data-theme="dark"] .badge-celebrate-box { background: var(--card) !important; border: 1px solid rgba(0,245,255,.15) !important; box-shadow: 0 0 60px rgba(0,245,255,.1) !important; }

/* ── General: any white/light card-like wrapper not caught above ── */
html[data-theme="dark"] .card,
html[data-theme="dark"] [class$="-card"]:not([class*="stat-"]) {
  background: var(--card);
  border-color: rgba(0,245,255,.08);
  color: var(--text);
}
html[data-theme="dark"] [class$="-box"]:not([class*="login-"]):not([class*="checker-"]) {
  background: var(--card);
  border-color: rgba(0,245,255,.08);
  color: var(--text);
}


/* ══════════════════════════════════════════════════════════════════
   DARK MODE — ALL MODULE CLASSES (auto-generated from view scan)
   ══════════════════════════════════════════════════════════════════ */

/* Assessment views */
html[data-theme="dark"] .assess-hero,
html[data-theme="dark"] .assess-hero-athlete { color: #e8f4ff !important; }
html[data-theme="dark"] .assess-athlete-card { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }
html[data-theme="dark"] .assess-metric-bar,
html[data-theme="dark"] .metric-bar,
html[data-theme="dark"] .metric-mini-bar { background: rgba(0,245,255,.1) !important; }
html[data-theme="dark"] .assess-metric-label,
html[data-theme="dark"] .metric-lbl { color: var(--text-muted) !important; }
html[data-theme="dark"] .assess-metric-val { color: var(--text) !important; }
html[data-theme="dark"] .metric-cell { background: var(--card-alt) !important; }
html[data-theme="dark"] .tab-btn { color: var(--muted) !important; }
html[data-theme="dark"] .tab-btn.active { color: var(--primary) !important; border-bottom-color: var(--primary) !important; }
html[data-theme="dark"] .badge-card { background: var(--card) !important; }
html[data-theme="dark"] .badge-type-header { color: var(--text) !important; border-bottom-color: rgba(0,245,255,.1) !important; }
html[data-theme="dark"] .awarded-tag { background: rgba(255,230,0,.15) !important; color: var(--warning) !important; }
html[data-theme="dark"] .modal-box { background: var(--card) !important; }

/* Timeline */
html[data-theme="dark"] .timeline-body { background: var(--card-alt) !important; }
html[data-theme="dark"] .timeline-dot { color: var(--primary) !important; box-shadow: 0 0 12px rgba(0,245,255,.3) !important; }

/* Coach views */
html[data-theme="dark"] .coach-hero,
html[data-theme="dark"] .coach-athlete-hero,
html[data-theme="dark"] .gym-athlete-hero { color: #e8f4ff !important; }
html[data-theme="dark"] .av-sm,
html[data-theme="dark"] .athlete-mini-avatar { color: var(--text) !important; border-color: rgba(0,245,255,.15) !important; background: rgba(0,245,255,.1) !important; }
html[data-theme="dark"] .info-label { color: var(--text-muted) !important; }
html[data-theme="dark"] .award-sheet { background: var(--card) !important; }

/* League */
html[data-theme="dark"] .league-header { color: #e8f4ff !important; }
html[data-theme="dark"] .league-tabs { background: var(--card-alt) !important; }
html[data-theme="dark"] .ltab { background: var(--card) !important; color: var(--text) !important; border-color: rgba(0,245,255,.1) !important; }
html[data-theme="dark"] .ltab.active { background: rgba(0,245,255,.12) !important; color: var(--primary) !important; border-color: rgba(0,245,255,.25) !important; }
html[data-theme="dark"] .l-avatar { background: rgba(0,245,255,.1) !important; color: var(--primary) !important; }
html[data-theme="dark"] .l-level,
html[data-theme="dark"] .rank-num { color: var(--muted) !important; }
html[data-theme="dark"] .podium-avatar { background: rgba(0,245,255,.1) !important; color: var(--primary) !important; border-color: rgba(0,245,255,.2) !important; }

/* Payment & checkout */
html[data-theme="dark"] .checkout-card,
html[data-theme="dark"] .cb-card,
html[data-theme="dark"] .success-modal { background: var(--card) !important; color: var(--text) !important; }
html[data-theme="dark"] .checkout-header { background: linear-gradient(135deg, #040912, #070f22) !important; color: #e8f4ff !important; }
html[data-theme="dark"] .amount-box,
html[data-theme="dark"] .gym-info { background: var(--card-alt) !important; border-color: rgba(0,245,255,.1) !important; }
html[data-theme="dark"] .gym-name,
html[data-theme="dark"] .toman,
html[data-theme="dark"] .value { color: var(--text) !important; }
html[data-theme="dark"] .gym-sub,
html[data-theme="dark"] .label,
html[data-theme="dark"] .unit,
html[data-theme="dark"] .amount-rial,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .redirect-note { color: var(--text-muted) !important; }
html[data-theme="dark"] .timer-bar { background: rgba(255,230,0,.06) !important; border-color: rgba(255,230,0,.18) !important; }
html[data-theme="dark"] .timer-countdown { color: var(--warning) !important; }
html[data-theme="dark"] .timer-progress { background: rgba(255,230,0,.15) !important; }
html[data-theme="dark"] .timer-progress-fill { background: var(--warning) !important; }
html[data-theme="dark"] .plan-badge { background: rgba(0,245,255,.12) !important; color: var(--primary) !important; }
html[data-theme="dark"] .plan-activated { background: rgba(57,255,136,.08) !important; color: var(--success) !important; }
html[data-theme="dark"] .status-pill { background: rgba(57,255,136,.12) !important; color: var(--success) !important; }
html[data-theme="dark"] .receipt-label { color: var(--text-2) !important; }
html[data-theme="dark"] .checking-spinner { color: var(--primary) !important; }
html[data-theme="dark"] .pay-btn { background: linear-gradient(135deg,#00f5ff,#00c4d4) !important; color: #060b14 !important; box-shadow: 0 8px 20px rgba(0,245,255,.3) !important; }

/* Finance */
html[data-theme="dark"] .debtw { background: rgba(255,230,0,.07) !important; color: var(--warning) !important; }

/* Profile */
html[data-theme="dark"] .profile-hero,
html[data-theme="dark"] .pub-hero { color: #e8f4ff !important; }
html[data-theme="dark"] .profile-section { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }

/* Pro pages */
html[data-theme="dark"] .pro-hero { color: #e8f4ff !important; }
html[data-theme="dark"] .pro-badge,
html[data-theme="dark"] .pro-tab,
html[data-theme="dark"] .pro-card-btn,
html[data-theme="dark"] .pro-plan-buy,
html[data-theme="dark"] .pro-lock-badge { color: var(--text) !important; }
html[data-theme="dark"] .pro-indicator { background: linear-gradient(135deg,rgba(255,230,0,.2),rgba(255,180,0,.15)) !important; color: var(--warning) !important; }
html[data-theme="dark"] .status-expired { background: rgba(255,77,109,.1) !important; color: var(--danger) !important; }
html[data-theme="dark"] .sub-hero { color: #e8f4ff !important; }
html[data-theme="dark"] .recommend-badge,
html[data-theme="dark"] .plan-buy-btn { color: #060b14 !important; }

/* Membership expired */
html[data-theme="dark"] .tag { background: rgba(255,77,109,.1) !important; color: var(--danger) !important; border-color: rgba(255,77,109,.2) !important; }
html[data-theme="dark"] .tag-dot { background: var(--danger) !important; }

/* Admin users */
html[data-theme="dark"] .plan-tag-gym { background: rgba(0,245,255,.1) !important; color: var(--primary) !important; }
html[data-theme="dark"] .plan-tag-coach { background: rgba(57,255,136,.1) !important; color: var(--success) !important; }
html[data-theme="dark"] .plan-tag-athlete { background: rgba(255,230,0,.1) !important; color: var(--warning) !important; }
html[data-theme="dark"] .plan-tag-pro_gym { background: rgba(0,245,255,.12) !important; color: var(--primary) !important; }
html[data-theme="dark"] .plan-tag-pro_coach { background: rgba(57,255,136,.12) !important; color: var(--success) !important; }
html[data-theme="dark"] .plan-tag-pro_athlete { background: rgba(255,230,0,.12) !important; color: var(--warning) !important; }
html[data-theme="dark"] .user-pro-avatar { background: var(--primary) !important; color: #060b14 !important; }
html[data-theme="dark"] .role-tab { background: var(--card-alt) !important; border-color: rgba(0,245,255,.1) !important; color: var(--text-2) !important; }
html[data-theme="dark"] .role-tab:hover { background: rgba(0,245,255,.06) !important; color: var(--primary) !important; }
html[data-theme="dark"] .role-tab.active { background: var(--primary) !important; color: #060b14 !important; border-color: var(--primary) !important; }

/* AI coach chat */
html[data-theme="dark"] .msg-user { color: #e8f4ff !important; }

/* Level avatar */
html[data-theme="dark"] .level-av { background: linear-gradient(135deg, #00f5ff, #00c4d4) !important; color: #060b14 !important; }

/* Subscription */
html[data-theme="dark"] .days-warn { color: var(--warning) !important; }
html[data-theme="dark"] .badge-active,
html[data-theme="dark"] .badge-paid { background: rgba(57,255,136,.1) !important; color: var(--success) !important; }


/* ══════════════════════════════════════════════════════════════════
   DARK MODE — INLINE STYLE OVERRIDES FOR SPECIFIC ELEMENTS
   ══════════════════════════════════════════════════════════════════ */

/* Table rows with inline backgrounds */
html[data-theme="dark"] tr[style*="background:#f8fafc"],
html[data-theme="dark"] tr[style*="background: #f8fafc"] {
  background: var(--table-head-bg) !important;
}
html[data-theme="dark"] tr[style*="border-bottom"] {
  border-bottom-color: rgba(0,245,255,.07) !important;
}

/* Admin badges page - golden badge card */
html[data-theme="dark"] .badge-card[style*="background:linear-gradient"][style*="fffbeb"] {
  background: linear-gradient(135deg, rgba(255,230,0,.08), rgba(255,180,0,.05)) !important;
  border-color: rgba(255,230,0,.2) !important;
}
html[data-theme="dark"] .badge-card[style*="background:#f8fafc"] {
  background: var(--card-alt) !important;
  border-color: rgba(0,245,255,.08) !important;
}
html[data-theme="dark"] .badge-criteria { color: var(--text-muted) !important; }
html[data-theme="dark"] .btype-tag { background: rgba(0,245,255,.1) !important; color: var(--primary) !important; }

/* Exercise badge (inline dynamic styles) */
html[data-theme="dark"] .ex-badge[style*="background:#f1f5f9"] {
  background: rgba(255,255,255,.06) !important;
  color: var(--text-2) !important;
}
html[data-theme="dark"] .ex-badge[style*="background:#eef2ff"] {
  background: rgba(0,245,255,.1) !important;
  color: var(--primary) !important;
}
html[data-theme="dark"] .ex-badge[style*="background:#fff7ed"] {
  background: rgba(255,100,0,.1) !important;
  color: #ff8c42 !important;
}

/* info-row labels */
html[data-theme="dark"] .info-row span[style*="color:#64748b"] { color: var(--text-muted) !important; }
html[data-theme="dark"] .info-value[style*="color:#f87171"] { color: var(--danger) !important; }
html[data-theme="dark"] [style*="color:#64748b"]:not(button):not(a) { color: var(--text-muted) !important; }

/* card-header gradients — keep gradients, just fix color if needed */
html[data-theme="dark"] .card-header[style*="background:linear-gradient"] { color: #e8f4ff !important; }
html[data-theme="dark"] .card-title[style*="color:#fff"] { color: #e8f4ff !important; }

/* Challenge results card */
html[data-theme="dark"] .card[style*="background:linear-gradient"][style*="color:#fff"] { color: #e8f4ff !important; }

/* Inline .badge-card active/coach styles */
html[data-theme="dark"] .badge-card { background: var(--card) !important; border-color: rgba(0,245,255,.08) !important; }

/* background:var(--gray-50) used in athlete dashboard week view */
html[data-theme="dark"] [style*="background: var(--gray-50)"],
html[data-theme="dark"] [style*="background:var(--gray-50)"] {
  background: var(--card-alt) !important;
}

/* div elements with box-shadow but light bg in athlete dashboard */
html[data-theme="dark"] [style*="background: var(--gray-50)"][style*="border-radius"] {
  background: var(--card-alt) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Specific: month/week athlete cards */
html[data-theme="dark"] [style*="box-shadow: 0 2px 8px rgba(0,0,0,0.05)"][style*="background"] {
  background: var(--card) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* ── FINAL CATCH-ALL: any element with inline background that looks light ──
   These use attribute selectors for the most common patterns.
   Note: [style*=] selectors work even when theme changes at runtime   */

/* Pure white backgrounds */
html[data-theme="dark"] [style*="background:#fff;"],
html[data-theme="dark"] [style*="background: #fff;"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"] {
  background-color: var(--card) !important;
}

/* Light gray backgrounds */
html[data-theme="dark"] [style*="background:#f8fafc;"],
html[data-theme="dark"] [style*="background:#fafafa;"],
html[data-theme="dark"] [style*="background:#f9fafb;"] {
  background: var(--card-alt) !important;
}

/* Dark text on light bg inline */
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color: #1e293b"] { color: var(--text) !important; }
html[data-theme="dark"] [style*="color:#374151"],
html[data-theme="dark"] [style*="color: #374151"] { color: var(--text) !important; }


/* ══════════════════════════════════════════════════════════════════
   AD SLIDER COMPONENT — کامپوننت اسلایدر تبلیغاتی
   ══════════════════════════════════════════════════════════════════ */
.ad-slider-wrap { border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }

.ad-slider-viewport {
  position: relative; width: 100%; overflow: hidden;
  border-radius: 16px; background: var(--card-alt);
  cursor: grab; user-select: none;
}
.ad-slider-viewport:active { cursor: grabbing; }

/* Strip: LTR so translateX works predictably inside RTL page */
.ad-slider-strip {
  display: flex; height: 100%; direction: ltr;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94);
  will-change: transform;
}

.ad-slide-item {
  flex: 0 0 100%; width: 100%; height: 100%;
  position: relative; overflow: hidden;
}
.ad-slide-link { display: block; width: 100%; height: 100%; }
.ad-slide-img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

/* Dots */
.ad-dots-bar {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; z-index: 5;
  background: rgba(0,0,0,.28); backdrop-filter: blur(6px);
  padding: 5px 10px; border-radius: 20px;
}
.ad-dot {
  width: 7px; height: 7px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.45); transition: background .25s, width .3s;
  padding: 0; flex-shrink: 0;
}
.ad-dot.active { background: #fff; width: 20px; border-radius: 3px; }

/* Progress bar */
.ad-prog-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,.12); z-index: 5;
}
.ad-prog-fill {
  height: 100%; background: rgba(255,255,255,.7);
  animation: adProg linear infinite; transform-origin: left;
}
@keyframes adProg { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Caption */
.ad-slide-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 32px 18px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: #fff; font-size: .88rem; font-weight: 600; pointer-events: none;
  direction: rtl; text-align: right;
}

/* Dark mode */
html[data-theme="dark"] .ad-dot.active { background: #00f5ff; box-shadow: 0 0 8px rgba(0,245,255,.8); }
html[data-theme="dark"] .ad-prog-fill  { background: rgba(0,245,255,.75); }
html[data-theme="dark"] .ad-slider-wrap { box-shadow: var(--shadow-lg), 0 0 24px rgba(0,245,255,.05); }

