/* =========================================================
   پلنر کنکور ارشد — استایل (RTL، تم تیره/روشن، ریسپانسیو)
   ========================================================= */

:root[data-theme="dark"]{
  --bg:#0b0e1a; --bg2:#10152b;
  --card:rgba(255,255,255,.045); --card-solid:#131a31;
  --border:rgba(255,255,255,.09); --border-soft:rgba(255,255,255,.06);
  --text:#e8ebf5; --muted:#97a0b8;
  --accent:#2dd4bf; --accent-2:#a78bfa;
  --accent-soft:rgba(45,212,191,.13);
  --danger:#f87171; --warn:#fbbf24; --ok:#34d399;
  --input:rgba(255,255,255,.06);
  --topbar:rgba(11,14,26,.78);
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --hero-grad:linear-gradient(135deg,rgba(45,212,191,.16),rgba(167,139,250,.14));
}
:root[data-theme="light"]{
  --bg:#f2f5fb; --bg2:#e9edf7;
  --card:#ffffff; --card-solid:#ffffff;
  --border:#e2e8f3; --border-soft:#ebf0f9;
  --text:#1b2338; --muted:#5d6a86;
  --accent:#0d9488; --accent-2:#7c3aed;
  --accent-soft:rgba(13,148,136,.1);
  --danger:#dc2626; --warn:#d97706; --ok:#059669;
  --input:#f2f4fb;
  --topbar:rgba(242,245,251,.85);
  --shadow:0 8px 24px rgba(23,32,64,.08);
  --hero-grad:linear-gradient(135deg,rgba(13,148,136,.08),rgba(124,58,237,.07));
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  font-family:'Vazirmatn','Segoe UI',Tahoma,sans-serif;
  background:var(--bg); color:var(--text);
  min-height:100vh; line-height:1.75; font-size:15px;
  -webkit-font-smoothing:antialiased;
}
body::before{
  content:''; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(700px 420px at 88% -5%, rgba(45,212,191,.09), transparent 65%),
    radial-gradient(700px 420px at 8% 105%, rgba(167,139,250,.09), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}
::selection{ background:rgba(45,212,191,.3); }
button{ font:inherit; color:inherit; background:none; border:none; cursor:pointer; }
input,select,textarea{ font:inherit; }
a{ color:var(--accent); }

::-webkit-scrollbar{ width:9px; height:9px; }
::-webkit-scrollbar-thumb{ background:var(--border); border-radius:99px; }
::-webkit-scrollbar-track{ background:transparent; }

.hidden{ display:none !important; }
.muted{ color:var(--muted); }
.small{ font-size:.8rem; }
.container{ max-width:1180px; margin-inline:auto; padding-inline:16px; }

/* ---------- آیکون‌ها ---------- */
.ic{ width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle; }
.ic.sm{ width:14px; height:14px; }
.ic.lg{ width:30px; height:30px; }
.ic.xl{ width:38px; height:38px; }

/* ---------- دکمه‌ها ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px; justify-content:center;
  padding:10px 18px; border-radius:13px; font-weight:600; font-size:.88rem;
  border:1px solid var(--border); background:var(--input); color:var(--text);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
}
.btn:hover{ border-color:var(--accent); transform:translateY(-1px); }
.btn:active{ transform:translateY(0); }
.btn-primary{
  background:linear-gradient(135deg,#2dd4bf,#38bdf8);
  color:#052a33; border:none; box-shadow:0 6px 18px rgba(45,212,191,.25);
}
.btn-primary:hover{ box-shadow:0 8px 24px rgba(45,212,191,.35); }
.btn-danger{ background:rgba(248,113,113,.12); color:var(--danger); border:1px solid rgba(248,113,113,.35); }
.btn-danger:hover{ border-color:var(--danger); }
.btn-ghost{ background:transparent; }
.btn-sm{ padding:6px 13px; font-size:.8rem; border-radius:10px; }
.btn-lg{ padding:13px 22px; font-size:.95rem; width:100%; }
.btn.active{ border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }
.btn-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:11px; color:var(--muted);
  border:1px solid transparent; transition:all .15s;
}
.btn-icon:hover{ color:var(--text); background:var(--input); border-color:var(--border); }
.btn-icon.danger:hover{ color:var(--danger); background:rgba(248,113,113,.1); }
.btn-icon.sm{ width:28px; height:28px; border-radius:8px; }
.linklike{ color:var(--accent); font-size:.85rem; padding:6px 0; }
.linklike:hover{ text-decoration:underline; }

/* ---------- کارت‌ها ---------- */
.card{
  background:var(--card); border:1px solid var(--border); border-radius:18px;
  padding:18px; box-shadow:var(--shadow);
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
}
.card-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.card h2{ font-size:1rem; font-weight:700; }
.card h3{ font-size:.88rem; font-weight:700; }

/* ---------- فرم‌ها ---------- */
.inp{
  width:100%; background:var(--input); border:1px solid var(--border);
  border-radius:12px; padding:10px 14px; color:var(--text); outline:none;
  transition:border-color .15s, box-shadow .15s;
}
.inp:focus{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.inp:disabled{ opacity:.45; cursor:not-allowed; }
select.inp{ cursor:pointer; }
textarea.inp{ resize:vertical; min-height:70px; }
input[type="time"].inp{ cursor:pointer; }
.f-label{ display:block; font-size:.8rem; color:var(--muted); margin:12px 2px 5px; }
.form-err{ color:var(--danger); font-size:.82rem; margin-top:10px; }
.chk{ display:flex; align-items:center; gap:8px; font-size:.85rem; color:var(--muted); margin:12px 0 6px; cursor:pointer; }
.chk input{ accent-color:var(--accent); width:16px; height:16px; cursor:pointer; }
.jdate{ display:grid; grid-template-columns:1.1fr 1.3fr 1fr; gap:8px; }
.row{ display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }

/* ---------- نوار بالا ---------- */
.topbar{
  position:sticky; top:0; z-index:30;
  background:var(--topbar); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border-soft);
}
.topbar-in{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding-block:12px; }
.brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.logo{
  display:grid; place-items:center; width:44px; height:44px; border-radius:14px; flex:none;
  background:linear-gradient(135deg,rgba(45,212,191,.2),rgba(167,139,250,.2));
  color:var(--accent); border:1px solid var(--border);
}
.brand h1{ font-size:1.02rem; font-weight:800; line-height:1.4; white-space:nowrap; }
.top-actions{ display:flex; align-items:center; gap:8px; }
.pill{
  padding:7px 14px; border-radius:99px; font-size:.8rem; font-weight:700;
  background:var(--accent-soft); color:var(--accent); border:1px solid var(--border);
  white-space:nowrap;
}

/* ---------- تب‌ها ---------- */
.tabs{ display:flex; gap:8px; padding-block:12px 4px; overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar{ display:none; }
.tab-btn{
  display:inline-flex; align-items:center; gap:7px; white-space:nowrap;
  padding:9px 16px; border-radius:12px; font-size:.86rem; font-weight:600; color:var(--muted);
  border:1px solid transparent; transition:all .15s;
}
.tab-btn:hover{ color:var(--text); background:var(--input); }
.tab-btn.active{
  color:var(--accent); background:var(--accent-soft);
  border-color:var(--border);
}

/* ---------- پنل‌ها ---------- */
main{ padding-block:14px 30px; }
.tab-panel{ display:none; animation:fadein .25s ease; }
.tab-panel.active{ display:block; }
@keyframes fadein{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }

/* ---------- داشبورد ---------- */
.grid-dash{ display:grid; grid-template-columns:1.65fr 1fr; gap:16px; align-items:start; }
.col-main, .col-side{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.mini-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.mini{ padding:14px 16px; text-align:center; }
.mini-num{
  font-size:1.5rem; font-weight:800; line-height:1.3;
  background:linear-gradient(135deg,#2dd4bf,#a78bfa);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.mini-num.ok{ background:linear-gradient(135deg,#34d399,#2dd4bf); -webkit-background-clip:text; background-clip:text; }
.mini-num.warn{ background:linear-gradient(135deg,#fbbf24,#fb923c); -webkit-background-clip:text; background-clip:text; }

/* قهرمان شمارش معکوس */
.hero{ background:var(--hero-grad); padding:22px; border-radius:20px; }
.hero-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.hero-title{ font-size:1.15rem; font-weight:800; }
.badge-accent{
  padding:6px 13px; border-radius:99px; font-size:.8rem; font-weight:700;
  background:var(--accent-soft); color:var(--accent); border:1px solid var(--border);
}
.cd{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:16px; }
.cd-cell{
  text-align:center; background:var(--input); border:1px solid var(--border-soft);
  border-radius:14px; padding:14px 6px 10px;
}
.cd-num{
  display:block; font-size:clamp(1.7rem,4.5vw,2.4rem); font-weight:800; line-height:1.2;
  background:linear-gradient(135deg,#2dd4bf,#a78bfa);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  font-variant-numeric:tabular-nums;
}
.cd-lab{ font-size:.75rem; color:var(--muted); }
.hero-progress-wrap{ margin-top:16px; }
.hero-progress-label{ margin-top:6px; }
.hero-msg{
  margin-top:14px; padding:10px 14px; border-radius:12px; font-size:.88rem; font-weight:600;
  background:var(--accent-soft); color:var(--accent); border:1px dashed var(--accent);
}

/* نوار پیشرفت */
.bar{ height:10px; border-radius:99px; background:var(--input); overflow:hidden; }
.bar i{ display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,#2dd4bf,#38bdf8); transition:width .5s ease; }

/* افزودن سریع */
.quick{ display:grid; grid-template-columns:1.6fr 1.1fr .9fr auto; gap:9px; }
@media (max-width:820px){ .quick{ grid-template-columns:1fr 1fr; } .quick .btn{ grid-column:span 2; } }

/* لیست کارها */
.list{ display:flex; flex-direction:column; gap:10px; }
.task{
  display:flex; gap:12px; align-items:flex-start;
  background:var(--input); border:1px solid var(--border-soft); border-radius:14px;
  padding:13px 14px; transition:border-color .15s, opacity .2s;
}
.task:hover{ border-color:var(--border); }
.task.done{ opacity:.55; }
.task.done .task-title{ text-decoration:line-through; }
.task-body{ flex:1; min-width:0; }
.task-title{ font-weight:600; font-size:.92rem; word-break:break-word; }
.task-meta{ display:flex; flex-wrap:wrap; gap:6px; margin-top:7px; align-items:center; }
.task-notes{ font-size:.8rem; color:var(--muted); margin-top:7px; white-space:pre-wrap; word-break:break-word; }
.task-actions{ display:flex; gap:4px; flex:none; }
.ck{
  width:23px; height:23px; border-radius:50%; border:2px solid var(--muted); flex:none;
  display:grid; place-items:center; margin-top:2px; color:transparent; transition:all .15s;
}
.ck:hover{ border-color:var(--accent); }
.ck.on{ background:var(--accent); border-color:var(--accent); color:#052a33; }
.badge{
  padding:2px 10px; border-radius:99px; font-size:.72rem; font-weight:600;
  background:var(--input); border:1px solid var(--border); color:var(--muted);
}
.cat-chip{
  padding:2px 10px; border-radius:99px; font-size:.72rem; font-weight:600;
  color:var(--c); background:color-mix(in srgb, var(--c) 13%, transparent);
  border:1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.cat-study{ --c:#2dd4bf; } .cat-review{ --c:#a78bfa; } .cat-test{ --c:#fbbf24; }
.cat-project{ --c:#60a5fa; } .cat-class{ --c:#f472b6; } .cat-rest{ --c:#34d399; } .cat-other{ --c:#94a3b8; }
.prio{ font-size:.72rem; color:var(--muted); display:inline-flex; align-items:center; gap:5px; }
.prio::before{ content:''; width:7px; height:7px; border-radius:50%; background:var(--c); }
.prio-3{ --c:#f87171; } .prio-2{ --c:#fbbf24; } .prio-1{ --c:#94a3b8; }
.due{ font-size:.74rem; color:var(--muted); display:inline-flex; align-items:center; gap:4px; }
.due.over{ color:var(--danger); font-weight:600; }

/* خوش‌آمد */
.greet h2{ font-size:1.05rem; font-weight:800; }
.greet p{ margin-top:6px; font-size:.85rem; }
.quote-card p{ margin-top:8px; font-size:.92rem; font-weight:600; line-height:1.9; }
.quote-card .card-head{ margin-bottom:0; }
.streak-card{ display:flex; align-items:center; gap:14px; }
.streak-card .flame{
  display:grid; place-items:center; width:48px; height:48px; border-radius:14px; flex:none;
  background:rgba(251,191,36,.12); color:var(--warn); border:1px solid var(--border);
}

/* حالت خالی */
.empty{
  border:1.5px dashed var(--border); border-radius:14px; padding:26px 16px;
  text-align:center; color:var(--muted); font-size:.86rem;
}
.empty .ic{ opacity:.45; margin-bottom:6px; }
.empty.sm{ padding:14px 10px; font-size:.78rem; border:none; }

/* ---------- تب برنامه‌ها ---------- */
.toolbar{ margin-bottom:14px; display:flex; flex-direction:column; gap:12px; }
.chips{ display:flex; gap:7px; flex-wrap:wrap; }
.chip{
  padding:7px 15px; border-radius:99px; font-size:.8rem; font-weight:600; color:var(--muted);
  background:var(--input); border:1px solid var(--border-soft); transition:all .15s;
}
.chip:hover{ color:var(--text); }
.chip.active{ color:var(--accent); background:var(--accent-soft); border-color:var(--accent); }
.toolbar-row{ display:grid; grid-template-columns:1.6fr 1fr 1fr auto; gap:9px; align-items:center; }
.search{ position:relative; }
.search .ic{ position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--muted); width:16px; height:16px; }
.search .inp{ padding-right:38px; }
@media (max-width:900px){ .toolbar-row{ grid-template-columns:1fr 1fr; } }
@media (max-width:560px){ .toolbar-row{ grid-template-columns:1fr; } }
.plans-count{ font-size:.8rem; color:var(--muted); margin:2px 4px 10px; }

/* ---------- برنامه هفتگی ---------- */
.note-muted{ margin-bottom:14px; font-size:.85rem; color:var(--muted); padding:13px 16px; }
.week-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(168px,1fr)); gap:12px; }
.day-card{ padding:14px; display:flex; flex-direction:column; gap:10px; }
.day-head{ display:flex; align-items:center; justify-content:space-between; }
.blocks{ display:flex; flex-direction:column; gap:0; min-height:34px; }
.block{
  display:flex; align-items:center; gap:8px; padding:8px 2px;
  border-bottom:1px dashed var(--border-soft); font-size:.8rem;
}
.block:last-child{ border-bottom:none; }
.btime{ color:var(--accent); font-weight:700; font-size:.72rem; white-space:nowrap; font-variant-numeric:tabular-nums; }
.btitle{ flex:1; min-width:0; word-break:break-word; }
.block-form{ display:flex; flex-direction:column; gap:8px; border-top:1px solid var(--border-soft); padding-top:10px; }
.bf-times{ display:grid; grid-template-columns:1fr auto 1fr; gap:6px; align-items:center; }
.bf-actions{ display:flex; gap:8px; }

/* ---------- آمار ---------- */
.stats-top{ display:grid; grid-template-columns:auto 1fr; gap:16px; align-items:stretch; margin-bottom:16px; }
.donut-card{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; min-width:200px; }
.donut{
  width:150px; height:150px; border-radius:50%;
  background:conic-gradient(var(--accent) calc(var(--p,0)*1%), var(--input) 0);
  display:grid; place-items:center;
}
.donut-in{
  width:108px; height:108px; border-radius:50%; background:var(--card-solid);
  display:grid; place-items:center; font-weight:800; font-size:1.35rem;
  border:1px solid var(--border-soft);
}
.stats-mini{ align-content:stretch; }
.stats-mini .mini{ display:flex; flex-direction:column; justify-content:center; }
.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.bar-row{ margin-bottom:14px; }
.bar-row:last-child{ margin-bottom:0; }
.bar-head{ display:flex; justify-content:space-between; align-items:center; font-size:.83rem; font-weight:600; margin-bottom:6px; }
.dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-left:7px; }
.act{ display:flex; gap:10px; margin-top:14px; }
.act-col{ flex:1; display:flex; flex-direction:column; gap:8px; align-items:center; min-width:0; }
.act-track{ height:110px; width:100%; display:flex; align-items:flex-end; justify-content:center; }
.act-bar{
  width:min(70%,36px); height:calc(var(--h)*1%); min-height:3px; border-radius:8px 8px 4px 4px;
  background:linear-gradient(180deg,#2dd4bf,rgba(45,212,191,.2)); transition:height .4s ease;
}
.act-lab{ text-align:center; white-space:nowrap; }
@media (max-width:820px){ .stats-top{ grid-template-columns:1fr; } .two-col{ grid-template-columns:1fr; } }

/* ---------- تنظیمات ---------- */
.set-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
.danger-card{ border-color:rgba(248,113,113,.3); }
.danger-card h2{ color:var(--danger); }
@media (max-width:820px){ .set-grid{ grid-template-columns:1fr; } }

/* ---------- صفحه‌های ورود ---------- */
.auth-screen{ min-height:100vh; display:grid; place-items:center; padding:24px 16px; }
.auth-card{ width:min(430px,100%); padding:28px 24px; text-align:center; }
.auth-logo{
  display:grid; place-items:center; width:64px; height:64px; margin:0 auto 14px; border-radius:20px;
  background:linear-gradient(135deg,rgba(45,212,191,.2),rgba(167,139,250,.2));
  color:var(--accent); border:1px solid var(--border);
}
.auth-card h1{ font-size:1.25rem; font-weight:800; margin-bottom:6px; }
.auth-card > p{ font-size:.85rem; margin-bottom:8px; }
.auth-card .btn-lg{ margin-top:18px; }
.auth-card .linklike{ margin-top:10px; }

/* ---------- مودال ---------- */
.modal-overlay{
  position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:18px;
  background:rgba(5,8,18,.55); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
}
.modal{
  width:min(540px,100%); max-height:88vh; overflow:auto;
  background:var(--card-solid); border:1px solid var(--border); border-radius:20px;
  padding:22px; box-shadow:var(--shadow); animation:pop .22s ease;
}
@keyframes pop{ from{ opacity:0; transform:scale(.96) translateY(8px); } to{ opacity:1; transform:none; } }
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.modal-head h2{ font-size:1.02rem; font-weight:800; }
.modal .btn-lg{ margin-top:18px; }
.modal p{ font-size:.88rem; }
.help-steps{ margin:10px 0 0; padding-right:18px; display:flex; flex-direction:column; gap:7px; font-size:.85rem; color:var(--muted); }
.help-sec{ margin-top:16px; }
.help-sec h3{ font-size:.88rem; margin-bottom:4px; }

/* ---------- Toast ---------- */
#toasts{
  position:fixed; bottom:22px; left:50%; transform:translateX(-50%);
  display:flex; flex-direction:column; align-items:center; gap:8px; z-index:80; width:max-content; max-width:92vw;
}
.toast{
  padding:11px 20px; border-radius:13px; font-size:.85rem; font-weight:600;
  background:var(--card-solid); border:1px solid var(--accent); color:var(--text);
  box-shadow:var(--shadow); animation:toastin .3s ease; max-width:100%;
}
.toast.err{ border-color:var(--danger); }
.toast.out{ opacity:0; transform:translateY(8px); transition:all .3s; }
@keyframes toastin{ from{ opacity:0; transform:translateY(12px); } to{ opacity:1; transform:none; } }

/* ---------- فوتر ---------- */
footer{ padding:18px 16px 26px; text-align:center; color:var(--muted); font-size:.78rem; }

/* ---------- ریسپانسیو ---------- */
@media (max-width:960px){
  .grid-dash{ grid-template-columns:1fr; }
  .brand h1{ font-size:.95rem; }
  .pill{ font-size:.72rem; padding:6px 11px; }
}
@media (max-width:600px){
  .top-actions{ flex-wrap:wrap; justify-content:flex-end; row-gap:8px; }
  .top-actions .pill{ order:10; flex-basis:100%; white-space:normal; text-align:center; }
}
@media (max-width:480px){
  body{ font-size:14px; }
  .topbar-in{ padding-block:10px; }
  .brand .sub{ display:none; }
  .cd{ grid-template-columns:repeat(2,1fr); }
  .card{ padding:15px; border-radius:16px; }
  .hero{ padding:16px; }
}
