/* ============================================================
   مسیر علم — استایل مشترک تمام صفحات
   ============================================================ */

  /* ============ Design tokens ============ */
  :root{
    --bg:#F6F3EC;
    --surface:#FFFFFF;
    --surface-alt:#EFEAE0;
    --ink:#1C2331;
    --ink-soft:#5B6472;
    --ink-faint:#93989F;
    --border:#E4DFD2;
    --gold:#DE9F35;
    --gold-deep:#B87F1F;
    --gold-bg:#FBF0DC;
    --teal:#1B8A80;
    --teal-deep:#136A62;
    --teal-bg:#E1F3F0;
    --navy:#233A5E;
    --navy-deep:#162944;
    --success:#2E9E5B;
    --success-bg:#E3F5EA;
    --danger:#D6584F;
    --danger-bg:#FBEAE8;
    --locked:#C7CBD1;
    --locked-bg:#EDEDEE;
    --shadow:rgba(35,58,94,0.14);
    --focus:#136A62;
    --radius-sm:10px;
    --radius-md:16px;
    --radius-lg:26px;
    --font:'Vazirmatn',Tahoma,'Segoe UI',sans-serif;
    --line-grad: linear-gradient(to bottom, var(--gold), var(--teal));
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg:#10151F;
      --surface:#171E2B;
      --surface-alt:#1D2536;
      --ink:#ECEEF3;
      --ink-soft:#A7B0C0;
      --ink-faint:#6B7480;
      --border:#2A3346;
      --gold:#F0B84C;
      --gold-deep:#D69B2E;
      --gold-bg:#3A2E14;
      --teal:#39C2B6;
      --teal-deep:#22948B;
      --teal-bg:#123330;
      --navy:#4A6E9F;
      --navy-deep:#2C4468;
      --success:#3FBE79;
      --success-bg:#173325;
      --danger:#E67872;
      --danger-bg:#3A1E1E;
      --locked:#3A4256;
      --locked-bg:#1B2130;
      --shadow:rgba(0,0,0,0.45);
      --focus:#39C2B6;
    }
  }
  :root[data-theme="dark"]{
    --bg:#10151F;
    --surface:#171E2B;
    --surface-alt:#1D2536;
    --ink:#ECEEF3;
    --ink-soft:#A7B0C0;
    --ink-faint:#6B7480;
    --border:#2A3346;
    --gold:#F0B84C;
    --gold-deep:#D69B2E;
    --gold-bg:#3A2E14;
    --teal:#39C2B6;
    --teal-deep:#22948B;
    --teal-bg:#123330;
    --navy:#4A6E9F;
    --navy-deep:#2C4468;
    --success:#3FBE79;
    --success-bg:#173325;
    --danger:#E67872;
    --danger-bg:#3A1E1E;
    --locked:#3A4256;
    --locked-bg:#1B2130;
    --shadow:rgba(0,0,0,0.45);
    --focus:#39C2B6;
  }

  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    font-family:var(--font);
    background:var(--bg);
    color:var(--ink);
    min-height:100vh;
    -webkit-font-smoothing:antialiased;
  }
  button{font-family:inherit;}
  :focus-visible{outline:3px solid var(--focus); outline-offset:2px; border-radius:6px;}

  .app-shell{
    max-width:560px;
    margin:0 auto;
    min-height:100vh;
    background:var(--bg);
    position:relative;
    display:flex;
    flex-direction:column;
  }

  /* ============ Header ============ */
  .app-header{
    position:sticky; top:0; z-index:40;
    background:var(--navy);
    color:#fff;
    box-shadow:0 2px 14px var(--shadow);
  }
  :root[data-theme="dark"] .app-header, .app-header{ background:linear-gradient(135deg,var(--navy),var(--navy-deep,#14233A)); }
  .header-row{
    display:flex; align-items:center; gap:10px;
    padding:14px 16px;
  }
  .icon-btn{
    width:38px; height:38px; border-radius:12px;
    border:1px solid rgba(255,255,255,0.25);
    background:rgba(255,255,255,0.08);
    color:#fff; font-size:18px; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
    transition:background .15s ease, transform .15s ease;
  }
  .icon-btn:hover{background:rgba(255,255,255,0.18);}
  .icon-btn:active{transform:scale(0.94);}
  .header-title-wrap{flex:1; min-width:0;}
  .header-title{
    font-size:16.5px; font-weight:700; line-height:1.3;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .header-subtitle{
    font-size:12.5px; color:rgba(255,255,255,0.72); margin-top:2px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .points-chip{
    display:flex; align-items:center; gap:5px;
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.25);
    padding:7px 12px; border-radius:999px;
    font-weight:700; font-size:14px; flex-shrink:0;
  }
  .points-chip .star-ic{font-size:14px;}
  .progress-bar-wrap{
    height:5px; background:rgba(255,255,255,0.18); overflow:hidden;
  }
  .progress-bar-fill{
    height:100%; background:linear-gradient(90deg,var(--gold),#F4C978);
    width:0%; transition:width .4s ease;
    border-radius:0 0 0 4px;
  }

  /* ============ Layout / main ============ */
  main{flex:1; padding:20px 16px 48px;}
  .screen{animation:fadeIn .25s ease;}
  @keyframes fadeIn{from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);}}
  @media (prefers-reduced-motion: reduce){
    .screen{animation:none;}
    *{animation-duration:0.001ms !important; transition-duration:0.001ms !important;}
  }

  /* ============ Hero / stats card ============ */
  .hero-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:20px;
    margin-bottom:22px;
    box-shadow:0 6px 20px var(--shadow);
  }
  .hero-eyebrow{
    display:inline-flex; align-items:center; gap:6px;
    font-size:12.5px; color:var(--teal-deep); font-weight:700;
    background:var(--teal-bg); padding:5px 11px; border-radius:999px;
    margin-bottom:12px;
  }
  .hero-title{font-size:21px; font-weight:800; margin:0 0 6px; line-height:1.45;}
  .hero-desc{font-size:14px; color:var(--ink-soft); margin:0 0 16px; line-height:1.85;}
  .stats-row{display:flex; gap:8px; flex-wrap:wrap;}
  .stat-item{
    flex:1; min-width:76px;
    background:var(--surface-alt); border-radius:var(--radius-sm);
    padding:10px 8px; text-align:center;
  }
  .stat-num{font-size:17px; font-weight:800; color:var(--navy); display:block;}
  :root[data-theme="dark"] .stat-num{color:var(--gold);}
  .stat-label{font-size:11.5px; color:var(--ink-soft); margin-top:2px; display:block;}

  .continue-btn{
    margin-top:16px; width:100%;
  }

  /* ============ Timeline ============ */
  .timeline{position:relative; padding-inline-end:2px;}
  .step{
    position:relative; display:flex; gap:14px;
    padding-bottom:26px;
  }
  .step:last-child{padding-bottom:4px;}
  .step-line{
    position:absolute; top:52px; bottom:-4px; right:27px;
    width:3px; z-index:0;
    background-image:repeating-linear-gradient(to bottom, var(--step-line-color,var(--border)) 0 7px, transparent 7px 14px);
  }
  .step:last-child .step-line{display:none;}
  .step-marker{
    position:relative; z-index:1;
    width:56px; height:56px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; font-size:22px; font-weight:800;
    border:none; cursor:pointer; color:#fff;
    background:var(--locked); box-shadow:0 3px 10px var(--shadow);
    transition:transform .15s ease;
  }
  .step-marker:active{transform:scale(0.93);}
  .step-marker.locked{background:var(--locked); color:var(--ink-faint); cursor:not-allowed;}
  .step-marker.available{
    background:linear-gradient(150deg,var(--gold),var(--gold-deep));
    box-shadow:0 0 0 5px var(--gold-bg), 0 4px 14px var(--shadow);
  }
  .step-marker.available::after{
    content:''; position:absolute; inset:-8px; border-radius:50%;
    border:2px solid var(--gold); opacity:.55;
    animation:pulseRing 2.2s ease-out infinite;
  }
  @keyframes pulseRing{0%{transform:scale(0.85); opacity:.6;} 100%{transform:scale(1.28); opacity:0;}}
  .step-marker.done{background:linear-gradient(150deg,var(--teal),var(--teal-deep));}
  .step-marker.exam{background:linear-gradient(150deg,var(--navy),#152238);}
  .step-marker.exam.available{background:linear-gradient(150deg,var(--gold),var(--gold-deep));}
  .step-marker.cert{background:linear-gradient(150deg,#B98A2E,#8C6415);}
  .step-body{flex:1; min-width:0; padding-top:6px;}
  .step-title{font-size:15px; font-weight:700; margin:0 0 4px; color:var(--ink);}
  .step-title.locked-text{color:var(--ink-faint);}
  .step-meta{font-size:12.5px; color:var(--ink-soft); margin:0 0 6px;}
  .step-stars{font-size:14px; letter-spacing:2px;}
  .star{color:var(--locked);}
  .star.filled{color:var(--gold);}
  .step-status-tag{
    display:inline-block; font-size:11.5px; font-weight:700;
    padding:3px 9px; border-radius:999px; margin-top:2px;
  }
  .tag-locked{background:var(--locked-bg); color:var(--ink-faint);}
  .tag-available{background:var(--gold-bg); color:var(--gold-deep);}
  .tag-done{background:var(--success-bg); color:var(--success);}
  .tag-soon{background:var(--locked-bg); color:var(--ink-faint);}
  .tag-guest{background:var(--danger-bg); color:var(--danger);}

  /* ============ Buttons ============ */
  .btn{
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    padding:13px 20px; border-radius:14px; font-size:15px; font-weight:700;
    border:none; cursor:pointer; transition:transform .12s ease, opacity .12s ease;
  }
  .btn:active{transform:scale(0.97);}
  .btn-block{width:100%;}
  .btn-primary{background:linear-gradient(135deg,var(--teal),var(--teal-deep)); color:#fff; box-shadow:0 6px 16px rgba(19,106,98,0.3);}
  .btn-primary:disabled{opacity:.5; cursor:not-allowed;}
  .btn-gold{background:linear-gradient(135deg,var(--gold),var(--gold-deep)); color:#fff; box-shadow:0 6px 16px rgba(184,127,31,0.3);}
  .btn-secondary{background:var(--surface-alt); color:var(--ink); border:1px solid var(--border);}
  .btn-ghost{background:transparent; color:var(--teal-deep); border:1px solid var(--teal);}
  .btn-danger-ghost{background:transparent; color:var(--danger); border:1px solid var(--danger);}

  /* ============ Lesson / intro screen ============ */
  .lesson-card{
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--radius-lg); padding:22px; margin-bottom:18px;
    box-shadow:0 6px 20px var(--shadow);
  }
  .lesson-icon{
    width:52px; height:52px; border-radius:16px;
    background:var(--teal-bg); color:var(--teal-deep);
    display:flex; align-items:center; justify-content:center;
    font-size:26px; margin-bottom:14px;
  }
  .lesson-kicker{font-size:12.5px; font-weight:700; color:var(--teal-deep); margin-bottom:6px;}
  .lesson-title{font-size:20px; font-weight:800; margin:0 0 14px; line-height:1.5;}
  .lesson-para{font-size:14.5px; line-height:2; color:var(--ink); margin:0 0 14px;}
  .lesson-para:last-child{margin-bottom:0;}

  /* ============ Quiz ============ */
  .quiz-progress-row{
    display:flex; align-items:center; justify-content:space-between;
    margin-bottom:14px; font-size:13px; color:var(--ink-soft); font-weight:700;
  }
  .quiz-dots{display:flex; gap:5px;}
  .quiz-dot{width:8px; height:8px; border-radius:50%; background:var(--border);}
  .quiz-dot.answered{background:var(--teal);}
  .quiz-dot.current{background:var(--gold); width:18px; border-radius:5px;}
  .question-card{
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--radius-lg); padding:20px; margin-bottom:16px;
    box-shadow:0 6px 20px var(--shadow);
  }
  .question-text{font-size:16.5px; font-weight:700; line-height:1.7; margin:0;}
  .options-list{display:flex; flex-direction:column; gap:10px; margin-top:4px;}
  .option-btn{
    display:flex; align-items:center; gap:10px; text-align:right;
    padding:14px 15px; border-radius:14px; border:1.5px solid var(--border);
    background:var(--surface); color:var(--ink); font-size:14.5px; font-weight:600;
    cursor:pointer; line-height:1.6; transition:border-color .12s ease, background .12s ease;
  }
  .option-btn:hover:not(:disabled){border-color:var(--teal);}
  .option-letter{
    width:26px; height:26px; border-radius:50%; background:var(--surface-alt);
    display:flex; align-items:center; justify-content:center; font-size:12.5px; font-weight:800;
    flex-shrink:0; color:var(--ink-soft);
  }
  .option-btn.correct{background:var(--success-bg); border-color:var(--success); color:var(--success);}
  .option-btn.correct .option-letter{background:var(--success); color:#fff;}
  .option-btn.incorrect{background:var(--danger-bg); border-color:var(--danger); color:var(--danger);}
  .option-btn.incorrect .option-letter{background:var(--danger); color:#fff;}
  .option-btn:disabled{cursor:default;}
  .option-btn:disabled:not(.correct):not(.incorrect){opacity:.55;}
  .explanation-box{
    margin-top:14px; padding:14px 15px; border-radius:12px;
    background:var(--surface-alt); font-size:13.5px; line-height:1.9; color:var(--ink-soft);
    border-inline-start:4px solid var(--teal);
  }
  .explanation-box strong{color:var(--ink); font-weight:700;}

  /* ============ Completion screen ============ */
  .complete-wrap{text-align:center; padding:12px 4px 4px;}
  .complete-badge{
    width:104px; height:104px; border-radius:50%; margin:0 auto 18px;
    background:linear-gradient(150deg,var(--gold),var(--gold-deep));
    display:flex; align-items:center; justify-content:center; font-size:46px;
    box-shadow:0 10px 28px rgba(184,127,31,0.35);
    position:relative;
  }
  .complete-title{font-size:22px; font-weight:800; margin:0 0 8px;}
  .complete-sub{font-size:14.5px; color:var(--ink-soft); margin:0 0 22px;}
  .stars-big{font-size:34px; letter-spacing:8px; margin-bottom:18px;}
  .score-card{
    background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);
    padding:16px; margin-bottom:22px; display:flex; justify-content:space-around;
    box-shadow:0 6px 18px var(--shadow);
  }
  .score-item{text-align:center;}
  .score-num{font-size:19px; font-weight:800; color:var(--navy); display:block;}
  :root[data-theme="dark"] .score-num{color:var(--gold);}
  .score-label{font-size:12px; color:var(--ink-soft);}
  .confetti-layer{position:absolute; inset:0; overflow:visible; pointer-events:none;}
  .confetti-piece{
    position:absolute; top:50%; left:50%; font-size:16px;
    animation:confettiPop 1.1s ease-out forwards;
  }
  @keyframes confettiPop{
    0%{transform:translate(-50%,-50%) rotate(0) scale(0.6); opacity:1;}
    100%{transform:translate(var(--dx),var(--dy)) rotate(var(--rot)) scale(1); opacity:0;}
  }

  /* ============ Certificate ============ */
  .cert-name-field{
    background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);
    padding:16px; margin-bottom:18px; box-shadow:0 6px 18px var(--shadow);
  }
  .cert-name-field label{font-size:13.5px; font-weight:700; display:block; margin-bottom:8px;}
  .cert-name-field input{
    width:100%; padding:12px 14px; border-radius:10px; border:1.5px solid var(--border);
    font-family:inherit; font-size:14.5px; background:var(--bg); color:var(--ink);
  }
  .certificate{
    background:var(--surface);
    border-radius:var(--radius-lg);
    padding:6px;
    box-shadow:0 10px 30px var(--shadow);
    margin-bottom:20px;
  }
  .certificate-inner{
    border:2.5px solid var(--gold);
    border-radius:20px;
    padding:26px 20px;
    text-align:center;
    position:relative;
    background:
      radial-gradient(circle at 12% 12%, var(--gold-bg) 0, transparent 40%),
      radial-gradient(circle at 88% 88%, var(--teal-bg) 0, transparent 40%);
  }
  .cert-corner{position:absolute; width:20px; height:20px; border:2.5px solid var(--gold);}
  .cert-corner.tl{top:8px; right:8px; border-bottom:none; border-left:none;}
  .cert-corner.tr{top:8px; left:8px; border-bottom:none; border-right:none;}
  .cert-corner.bl{bottom:8px; right:8px; border-top:none; border-left:none;}
  .cert-corner.br{bottom:8px; left:8px; border-top:none; border-right:none;}
  .cert-emblem{font-size:34px; margin-bottom:6px;}
  .cert-kicker{font-size:12px; letter-spacing:1px; color:var(--ink-soft); font-weight:700; margin-bottom:14px;}
  .cert-heading{font-size:14px; color:var(--ink-soft); margin-bottom:6px;}
  .cert-name{font-size:24px; font-weight:800; color:var(--navy); margin-bottom:14px; word-break:break-word;}
  :root[data-theme="dark"] .cert-name{color:var(--gold);}
  .cert-line{font-size:13.5px; color:var(--ink-soft); line-height:1.9;}
  .cert-course{font-weight:800; color:var(--ink); font-size:15.5px; margin:6px 0 14px;}
  .cert-footer-row{display:flex; justify-content:space-between; margin-top:18px; font-size:11.5px; color:var(--ink-faint);}

  /* ============ Toast & modal ============ */
  #toastRoot{position:fixed; bottom:20px; left:50%; transform:translateX(-50%); z-index:200; display:flex; flex-direction:column; gap:8px; align-items:center; width:100%; padding:0 16px; pointer-events:none;}
  .toast{
    background:var(--navy); color:#fff; padding:12px 18px; border-radius:14px;
    font-size:13.5px; font-weight:600; box-shadow:0 8px 22px var(--shadow);
    animation:toastIn .2s ease, toastOut .2s ease 2.4s forwards;
    max-width:400px; text-align:center;
  }
  @keyframes toastIn{from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);}}
  @keyframes toastOut{to{opacity:0; transform:translateY(-6px);}}
  .modal-overlay{
    position:fixed; inset:0; background:rgba(15,20,30,0.55); z-index:300;
    display:flex; align-items:center; justify-content:center; padding:20px;
  }
  .modal-card{
    background:var(--surface); border-radius:var(--radius-lg); padding:22px;
    max-width:380px; width:100%; box-shadow:0 20px 50px rgba(0,0,0,0.3);
  }
  .modal-title{font-size:17px; font-weight:800; margin:0 0 10px;}
  .modal-text{font-size:14px; color:var(--ink-soft); line-height:1.8; margin:0 0 20px;}
  .modal-actions{display:flex; gap:10px;}
  .modal-actions .btn{flex:1;}

  .section-heading{font-size:13px; font-weight:700; color:var(--ink-soft); margin:26px 0 12px;}
  .footer-note{text-align:center; font-size:12px; color:var(--ink-faint); margin-top:30px; line-height:1.9;}
  .footer-note button{background:none; border:none; color:var(--teal-deep); font-weight:700; cursor:pointer; font-size:12px; font-family:inherit; text-decoration:underline; padding:0;}

/* ============================================================
   صفحات ورود و راه‌اندازی (Auth)
   ============================================================ */
.auth-body{min-height:100vh; display:flex; align-items:center; justify-content:center;}
.auth-wrap{width:100%; max-width:400px; padding:20px;}
.auth-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:34px 26px;
  box-shadow:0 14px 38px var(--shadow); text-align:center;
}
.auth-emblem{
  width:64px; height:64px; border-radius:18px; margin:0 auto 16px;
  background:linear-gradient(150deg,var(--gold),var(--gold-deep));
  display:flex; align-items:center; justify-content:center; font-size:30px; color:#fff;
}
.auth-title{font-size:22px; font-weight:800; margin:0 0 4px;}
.auth-sub{font-size:13.5px; color:var(--ink-soft); margin:0 0 22px; line-height:1.8;}
.auth-form{text-align:right;}
.form-group{margin-bottom:14px;}
.form-group label{display:block; font-size:13px; font-weight:700; margin-bottom:6px; color:var(--ink);}
.form-group input, .form-group select{
  width:100%; padding:12px 14px; border-radius:10px; border:1.5px solid var(--border);
  font-family:inherit; font-size:14.5px; background:var(--bg); color:var(--ink);
}
.form-hint{font-size:11.5px; color:var(--ink-faint); margin-top:5px;}
.form-check{display:flex; align-items:center; gap:8px; margin-bottom:14px; font-size:13.5px;}
.auth-footnote{font-size:12px; color:var(--ink-faint); margin-top:20px; line-height:1.9;}
.alert-error{background:var(--danger-bg); color:var(--danger); padding:11px 14px; border-radius:10px; font-size:13.5px; margin-bottom:16px; text-align:right; line-height:1.8;}
.alert-success{background:var(--success-bg); color:var(--success); padding:11px 14px; border-radius:10px; font-size:13.5px; margin-bottom:16px; text-align:right; line-height:1.8;}
.alert-info{background:var(--teal-bg); color:var(--teal-deep); padding:11px 14px; border-radius:10px; font-size:13.5px; margin-bottom:16px; text-align:right; line-height:1.8;}

/* ============================================================
   منوی کاربر (هدر داشبورد)
   ============================================================ */
.user-menu{position:relative;}
.user-menu > summary{
  list-style:none; cursor:pointer;
}
.user-menu > summary::-webkit-details-marker{display:none;}
.user-menu-panel{
  position:absolute; top:46px; left:0; z-index:60;
  background:var(--surface); border:1px solid var(--border); border-radius:14px;
  padding:8px; min-width:190px; box-shadow:0 14px 34px var(--shadow);
  display:flex; flex-direction:column; gap:2px;
}
.user-menu-name{
  padding:9px 11px; font-size:12.5px; font-weight:700; color:var(--ink-soft);
  border-bottom:1px solid var(--border); margin-bottom:4px;
}
.user-menu-panel a{
  padding:9px 11px; border-radius:9px; font-size:13.5px; font-weight:600;
  color:var(--ink); text-decoration:none; display:block;
}
.user-menu-panel a:hover{background:var(--surface-alt);}

/* ============================================================
   پنل مدیریت (Admin)
   ============================================================ */
.admin-wrap{max-width:760px; margin:0 auto; padding:20px 16px 60px;}
.admin-section{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:22px; margin-bottom:22px; box-shadow:0 6px 20px var(--shadow);
}
.admin-section h2{font-size:16.5px; font-weight:800; margin:0 0 16px;}
.form-row{display:flex; gap:10px; flex-wrap:wrap;}
.form-row .form-group{flex:1; min-width:150px;}
.table-wrap{overflow-x:auto; border-radius:14px; border:1px solid var(--border);}
table.data-table{width:100%; border-collapse:collapse; font-size:13.5px; min-width:520px;}
table.data-table th, table.data-table td{
  padding:11px 12px; text-align:right; border-bottom:1px solid var(--border); white-space:nowrap;
}
table.data-table th{background:var(--surface-alt); font-weight:700; color:var(--ink-soft); font-size:12.5px;}
table.data-table tr:last-child td{border-bottom:none;}
.badge-admin{
  display:inline-block; font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px;
  background:var(--gold-bg); color:var(--gold-deep);
}
.badge-student{
  display:inline-block; font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px;
  background:var(--teal-bg); color:var(--teal-deep);
}
.btn-sm{padding:8px 14px; font-size:12.5px; border-radius:10px;}
.admin-topbar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 16px; background:var(--navy); color:#fff;
}
.admin-topbar a{color:#fff; text-decoration:none; font-size:13.5px; font-weight:700;
  background:rgba(255,255,255,0.12); border:1px solid rgba(255,255,255,0.25);
  padding:8px 14px; border-radius:10px;}
.admin-topbar .title{font-size:16px; font-weight:800;}
form.inline-form{display:inline;}

/* ============================================================
   فهرست دوره‌ها (صفحه‌ی اصلی/کاتالوگ)
   ============================================================ */
.course-card{
  display:flex; align-items:center; gap:14px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:16px;
  margin-bottom:12px; cursor:pointer;
  box-shadow:0 4px 16px var(--shadow);
  transition:transform .12s ease, border-color .12s ease;
}
.course-card:hover{border-color:var(--teal);}
.course-card:active{transform:scale(0.99);}
.course-card-icon{
  width:52px; height:52px; border-radius:16px; flex-shrink:0;
  background:var(--teal-bg); display:flex; align-items:center; justify-content:center;
  font-size:26px;
}
.course-card-body{flex:1; min-width:0;}
.course-card-title{font-size:15.5px; font-weight:800; margin-bottom:3px;}
.course-card-subtitle{font-size:12.5px; color:var(--ink-soft); margin-bottom:8px; line-height:1.7;}
.course-card-meta{display:flex; gap:6px; flex-wrap:wrap;}
.course-card-arrow{font-size:20px; color:var(--ink-faint); flex-shrink:0;}
.course-card-locked{opacity:0.72;}
.course-card-locked .course-card-icon{background:var(--locked-bg); filter:grayscale(0.4);}

.course-card-continue{background:linear-gradient(135deg, var(--teal-bg), var(--surface));}
.course-card-progress-row{display:flex; align-items:center; gap:10px;}
.progress-bar-wrap-flat{
  flex:1; height:7px; background:var(--surface-alt); border-radius:999px; overflow:hidden;
}
.progress-bar-wrap-flat .progress-bar-fill{
  height:100%; background:linear-gradient(90deg,var(--gold),var(--teal)); border-radius:999px;
}
.course-card-pct{font-size:12.5px; font-weight:700; color:var(--teal-deep); flex-shrink:0;}

/* ============================================================
   سطح و XP (کارت خانه)
   ============================================================ */
.level-row{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px;
  margin-bottom:16px;
}
.level-badge{
  display:inline-flex; align-items:center; gap:6px;
  background:linear-gradient(135deg,var(--gold-bg),var(--teal-bg));
  color:var(--navy); font-weight:800; font-size:13px;
  padding:7px 14px; border-radius:999px; border:1px solid var(--border);
}
:root[data-theme="dark"] .level-badge{color:var(--gold);}
.level-next{font-size:12px; color:var(--ink-soft); font-weight:600;}

/* ============================================================
   هدف هفتگی
   ============================================================ */
.weekly-goal-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:18px; margin-bottom:18px; box-shadow:0 6px 18px var(--shadow);
}
.weekly-goal-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
.weekly-goal-title{font-size:14.5px; font-weight:800;}
.weekly-goal-count{font-size:13px; font-weight:700; color:var(--teal-deep);}
.weekly-goal-desc{font-size:12.5px; color:var(--ink-soft); margin:10px 0 0; line-height:1.8;}

/* ============================================================
   بانک اشتباهات (کارت روی خانه)
   ============================================================ */
.mistake-bank-card{cursor:default;}
.mistake-bank-card .btn{flex-shrink:0;}

/* ============================================================
   نشان‌ها (Badges)
   ============================================================ */
.badge-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(84px,1fr)); gap:10px;
  margin-bottom:22px;
}
.badge-item{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);
  padding:14px 8px; text-align:center; box-shadow:0 4px 14px var(--shadow); cursor:pointer;
}
.badge-item.locked{opacity:0.5;}
.badge-item.earned{border-color:var(--gold); background:linear-gradient(160deg,var(--gold-bg),var(--surface));}
.badge-icon{font-size:26px; margin-bottom:6px;}
.badge-name{font-size:11px; font-weight:700; color:var(--ink); line-height:1.5;}

.new-badge-row{display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-bottom:20px;}
.new-badge-chip{
  display:flex; align-items:center; gap:6px;
  background:linear-gradient(135deg,var(--gold-bg),var(--teal-bg));
  border:1px solid var(--gold); border-radius:999px; padding:8px 14px;
}
.new-badge-icon{font-size:17px;}
.new-badge-name{font-size:12.5px; font-weight:800; color:var(--navy);}
:root[data-theme="dark"] .new-badge-name{color:var(--gold);}

/* ============================================================
   کارت‌های اسلایدی جلسه (Story-style intro)
   ============================================================ */
.slide-dots{margin-bottom:16px;}
.fun-fact-box{
  margin-top:4px; padding:16px; border-radius:14px;
  background:linear-gradient(160deg,var(--gold-bg),var(--surface-alt));
  border:1px solid var(--gold);
}
.fun-fact-label{font-size:12.5px; font-weight:800; color:var(--gold-deep); margin-bottom:8px;}
.fun-fact-text{font-size:14.5px; line-height:2; color:var(--ink); margin:0;}
.slide-nav-row{display:flex; gap:10px; margin-top:18px;}
.slide-nav-row .btn{flex:1;}
.slide-nav-row .btn:disabled{opacity:0.4; cursor:not-allowed;}

/* ============================================================
   تب‌های پایه (صفحه‌ی کاتالوگ)
   ============================================================ */
.grade-tabs{
  display:flex; gap:6px; overflow-x:auto; padding:5px;
  background:var(--surface-alt); border-radius:999px; margin-bottom:18px;
  border:1px solid var(--border);
}
.grade-tabs::-webkit-scrollbar{display:none;}
.grade-tab{
  flex-shrink:0; border:none; background:transparent; color:var(--ink-soft);
  font-family:inherit; font-size:13.5px; font-weight:700; padding:9px 18px;
  border-radius:999px; cursor:pointer; transition:background .15s ease, color .15s ease;
  white-space:nowrap;
}
.grade-tab:hover{color:var(--ink);}
.grade-tab.active{
  background:linear-gradient(135deg,var(--gold),var(--gold-deep)); color:#fff;
  box-shadow:0 4px 12px rgba(184,127,31,0.3);
}
.grade-panel{animation:fadeIn .2s ease;}

.site-footer-note{
  text-align:center; margin-top:30px; padding-top:20px; border-top:1px solid var(--border);
}
.site-footer-note p{margin:4px 0; font-size:12.5px; color:var(--ink-faint);}
.site-footer-url{font-weight:700; color:var(--teal-deep) !important; letter-spacing:0.5px;}

/* ============================================================
   صفحه‌ی «درباره و پشتیبانی»
   ============================================================ */
.about-screen{max-width:460px; margin:0 auto; text-align:center;}
.about-logo-box{
  width:110px; height:110px; margin:10px auto 18px; border-radius:26px;
  background:var(--surface); border:3px solid var(--gold);
  display:flex; align-items:center; justify-content:center; flex-direction:column;
  font-size:15px; font-weight:800; color:var(--gold-deep); line-height:1.7;
  box-shadow:0 10px 26px var(--shadow);
}
.about-brand-title{font-size:19px; font-weight:800; margin:0 0 6px;}
.about-support-line{font-size:13.5px; color:var(--ink-soft); margin:0 0 18px;}
.about-social-row{display:flex; justify-content:center; gap:12px; margin-bottom:26px;}
.about-social-btn{
  width:46px; height:46px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--surface); border:1.5px solid var(--border); font-size:19px; text-decoration:none;
  box-shadow:0 4px 12px var(--shadow);
}
.about-links-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:8px; margin-bottom:26px; text-align:right; box-shadow:0 6px 18px var(--shadow);
}
.about-links-title{font-size:12.5px; font-weight:700; color:var(--ink-faint); padding:10px 14px 4px;}
.about-link-row{
  display:block; padding:13px 14px; border-radius:12px; text-decoration:none;
  color:var(--ink); font-weight:700; font-size:14px;
}
.about-link-row:hover{background:var(--surface-alt);}
.about-section{text-align:right; margin-bottom:22px; padding:18px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);}
.about-section h2{font-size:15px; font-weight:800; margin:0 0 10px;}
.about-section p{font-size:13.5px; line-height:2; color:var(--ink-soft); margin:0 0 8px;}
.about-contact-number{font-weight:800; font-size:16px; color:var(--teal-deep); direction:ltr; text-align:right;}
.about-draft-notice{background:var(--gold-bg); color:var(--gold-deep); padding:10px 12px; border-radius:10px; font-size:12.5px !important;}
.about-badges-row{display:flex; justify-content:center; margin-bottom:10px;}
.about-badge-placeholder{
  display:flex; align-items:center; gap:10px; background:var(--surface-alt);
  border:1px dashed var(--border); border-radius:14px; padding:12px 16px; max-width:280px;
}
.about-badge-icon{font-size:24px;}
.about-badge-text{font-size:11.5px; color:var(--ink-soft); text-align:right; line-height:1.7;}
.about-badge-text span{color:var(--ink-faint); font-size:10.5px;}

/* ============================================================
   نوار پیمایش پایین صفحه (Bottom Navigation)
   ============================================================ */
body.has-bottom-nav{ padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
.bottom-nav{
  position:fixed; bottom:0; left:0; right:0; z-index:60;
  display:flex; max-width:560px; margin:0 auto;
  background:var(--surface); border-top:1px solid var(--border);
  box-shadow:0 -6px 18px var(--shadow);
  padding-bottom:env(safe-area-inset-bottom, 0px);
}
.bottom-nav-item{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:9px 4px 8px; text-decoration:none; color:var(--ink-faint);
  font-size:10.5px; font-weight:700;
}
.bottom-nav-icon{font-size:20px; line-height:1;}
.bottom-nav-item.active{color:var(--teal-deep);}
:root[data-theme="dark"] .bottom-nav-item.active{color:var(--gold);}
