/* أكاديمية ركن القرآن — RTL mobile-first */
:root{
  --green:#0b6b4f; --green-dark:#064e3b; --green-light:#e6f2ec;
  --gold:#c9a227; --gold-light:#f7eecb;
  --beige:#f8f4e9; --card:#ffffff; --ink:#14231f; --muted:#6b7b74;
  --line:#e3ded0; --red:#b3261e; --red-light:#fdeceb;
  --radius:16px; --shadow:0 2px 10px rgba(20,35,31,.06);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:'Cairo',system-ui,-apple-system,'Segoe UI',Tahoma,sans-serif;
  background:var(--beige); color:var(--ink); font-size:16px; line-height:1.55;
  padding-bottom:84px; direction:rtl;
}
button,input,select,textarea{font-family:inherit; font-size:1rem}
button{cursor:pointer; border:none; background:none; color:inherit}
h1,h2,h3,h4{margin:0; font-weight:700}
.hidden{display:none !important}

/* header */
.app-header{
  position:sticky; top:0; z-index:20;
  background:linear-gradient(135deg,var(--green-dark),var(--green));
  color:#fff; padding:14px 16px 16px; border-radius:0 0 22px 22px;
  box-shadow:0 4px 16px rgba(6,78,59,.25);
}
.app-header .row{display:flex; align-items:center; justify-content:space-between; gap:10px}
.brand{display:flex; align-items:center; gap:10px; min-width:0}
.brand .mark{
  width:38px;height:38px;border-radius:12px;background:rgba(255,255,255,.14);
  display:grid;place-items:center;font-size:20px;border:1px solid rgba(255,255,255,.25)
}
.brand h1{font-size:1.02rem; line-height:1.2}
.brand .sub{font-size:.72rem; opacity:.82; font-weight:400}
.icon-btn{
  width:36px;height:36px;border-radius:12px;background:rgba(255,255,255,.14);
  display:grid;place-items:center;color:#fff;font-size:16px;border:1px solid rgba(255,255,255,.2)
}
.rate-strip{
  margin-top:12px;display:flex;align-items:center;justify-content:space-between;gap:8px;
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.18);
  border-radius:12px; padding:8px 12px; font-size:.78rem
}
.rate-strip b{font-weight:700}
.rate-strip button{color:#fff;text-decoration:underline;font-size:.75rem;opacity:.95}

/* tabs */
.tabbar{
  position:fixed; bottom:0; right:0; left:0; z-index:30;
  background:#fff; border-top:1px solid var(--line);
  display:flex; padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow:0 -2px 14px rgba(20,35,31,.06)
}
.tabbar button{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
  font-size:.66rem; color:var(--muted); padding:6px 2px; border-radius:12px
}
.tabbar button .ico{font-size:1.15rem; line-height:1}
.tabbar button.active{color:var(--green); background:var(--green-light); font-weight:700}

main{padding:14px 14px 8px; max-width:720px; margin:0 auto}
.section-title{font-size:.9rem; color:var(--muted); margin:18px 2px 8px; font-weight:700}
.section-title:first-child{margin-top:4px}

/* cards */
.card{
  background:var(--card); border-radius:var(--radius); padding:14px;
  box-shadow:var(--shadow); border:1px solid rgba(227,222,208,.7); margin-bottom:10px
}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.stat{
  background:#fff; border-radius:var(--radius); padding:12px 12px 10px; box-shadow:var(--shadow);
  border:1px solid rgba(227,222,208,.7); display:flex; flex-direction:column; gap:2px; min-height:82px
}
.stat .label{font-size:.72rem; color:var(--muted); display:flex; align-items:center; gap:4px}
.stat .value{font-size:1.22rem; font-weight:800; letter-spacing:-.3px}
.stat .hint{font-size:.68rem; color:var(--muted)}
.stat.green .value{color:var(--green)}
.stat.gold .value{color:#9a7a10}
.stat.red .value{color:var(--red)}

/* list rows */
.student-card{background:#fff;border-radius:var(--radius);padding:12px 13px;box-shadow:var(--shadow);border:1px solid rgba(227,222,208,.7);margin-bottom:10px}
.student-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.student-name{font-weight:700; font-size:1rem}
.student-meta{font-size:.74rem;color:var(--muted); display:flex; gap:8px; flex-wrap:wrap; margin-top:2px}
.pill{display:inline-flex;align-items:center;gap:4px;font-size:.7rem;padding:2px 8px;border-radius:999px;background:var(--green-light);color:var(--green);font-weight:700}
.pill.gold{background:var(--gold-light);color:#8a6d0b}
.pill.grey{background:#eef0ef;color:#5b6a64}
.pill.red{background:var(--red-light);color:var(--red)}
.pill.blue{background:#e8f0fb;color:#1f4f8f}
.progress{height:8px;background:#eef0ef;border-radius:999px;overflow:hidden;margin-top:10px}
.progress i{display:block;height:100%;background:linear-gradient(90deg,var(--green),#22a06b);border-radius:999px;transition:width .4s}
.progress.done i{background:linear-gradient(90deg,#9a7a10,var(--gold))}
.rowline{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:8px;font-size:.8rem;color:var(--muted)}
.amount{font-weight:800;color:var(--ink);font-size:.95rem}

/* buttons */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  background:var(--green);color:#fff;padding:10px 16px;border-radius:12px;font-weight:700;font-size:.9rem;
  box-shadow:0 2px 8px rgba(11,107,79,.25); transition:transform .08s
}
.btn:active{transform:scale(.98)}
.btn.ghost{background:#fff;color:var(--green);border:1px solid var(--green);box-shadow:none}
.btn.gold{background:var(--gold);color:#3d3200;box-shadow:0 2px 8px rgba(201,162,39,.3)}
.btn.red{background:var(--red);box-shadow:none}
.btn.grey{background:#eef0ef;color:#41514a;box-shadow:none}
.btn.block{width:100%}
.btn.sm{padding:7px 11px;font-size:.78rem;border-radius:10px}
.btn.lg{padding:16px;font-size:1.02rem;border-radius:14px}
.btn:disabled{opacity:.55}

/* big teacher action */
.log-btn{
  width:100%;margin-top:12px;padding:15px;border-radius:14px;font-size:1.02rem;font-weight:800;
  background:linear-gradient(135deg,var(--green),#12805f);color:#fff;box-shadow:0 4px 14px rgba(11,107,79,.28)
}
.log-btn:active{transform:scale(.99)}

/* forms */
.field{margin-bottom:12px}
.field label{display:block;font-size:.8rem;color:var(--muted);margin-bottom:5px;font-weight:700}
.field input,.field select,.field textarea{
  width:100%;padding:12px 13px;border-radius:12px;border:1px solid var(--line);
  background:#fff;color:var(--ink);outline:none
}
.field input:focus,.field select:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(11,107,79,.1)}
.field .hint{font-size:.7rem;color:var(--muted);margin-top:4px}
.inline{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.egp-preview{
  background:var(--gold-light);border:1px dashed var(--gold);border-radius:12px;padding:10px 12px;
  font-size:.84rem;color:#6d5708;font-weight:700;text-align:center
}

/* modal */
.modal-bg{position:fixed;inset:0;background:rgba(10,25,20,.45);z-index:50;display:flex;align-items:flex-end;justify-content:center;backdrop-filter:blur(2px)}
.modal{
  background:var(--beige);width:100%;max-width:560px;max-height:92vh;overflow-y:auto;
  border-radius:20px 20px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom));
  animation:up .22s ease-out
}
@keyframes up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
.modal h3{font-size:1.05rem;margin-bottom:12px;display:flex;justify-content:space-between;align-items:center}
.modal .close{font-size:1.3rem;color:var(--muted);line-height:1}

/* toast */
.toast{
  position:fixed;bottom:96px;right:50%;transform:translateX(50%);
  background:var(--green-dark);color:#fff;padding:11px 18px;border-radius:999px;font-size:.86rem;
  z-index:80;box-shadow:0 6px 20px rgba(0,0,0,.25); max-width:90vw;text-align:center
}
.toast.err{background:var(--red)}
.toast.gold{background:#8a6d0b}

/* lock screen */
.lock-wrap{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(160deg,var(--green-dark),#0b6b4f 60%,#0e7a5a)}
.lock-card{background:#fff;border-radius:22px;padding:26px 20px;width:100%;max-width:380px;text-align:center;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.lock-card .mark{width:64px;height:64px;border-radius:20px;background:var(--green-light);display:grid;place-items:center;font-size:30px;margin:0 auto 12px}
.lock-card h2{font-size:1.15rem}
.lock-card p{color:var(--muted);font-size:.82rem;margin:6px 0 18px}
.pin-input{
  width:100%;text-align:center;letter-spacing:.5em;font-size:1.5rem;font-weight:800;
  padding:14px;border-radius:14px;border:2px solid var(--line);background:var(--beige);outline:none
}
.pin-input:focus{border-color:var(--green)}
.teacher-pick{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-bottom:14px}
.teacher-pick button{
  padding:9px 14px;border-radius:999px;border:1px solid var(--line);background:#fff;font-weight:700;font-size:.86rem;color:var(--ink)
}
.teacher-pick button.sel{background:var(--green);color:#fff;border-color:var(--green)}

.empty{text-align:center;color:var(--muted);font-size:.85rem;padding:26px 10px}
.note{font-size:.75rem;color:var(--muted);line-height:1.6}
.divider{height:1px;background:var(--line);margin:14px 0}
.tag-row{display:flex;gap:6px;flex-wrap:wrap}
.session-row{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 0;border-bottom:1px dashed var(--line)}
.session-row:last-child{border-bottom:none}
.session-row .who{font-weight:700;font-size:.9rem}
.session-row .when{font-size:.72rem;color:var(--muted)}
.arch-card{background:#fff;border-radius:14px;padding:12px;margin-bottom:8px;border:1px solid var(--line)}
.banner{background:var(--gold-light);border:1px solid var(--gold);color:#6d5708;border-radius:12px;padding:10px 12px;font-size:.8rem;margin-bottom:10px}
.banner.red{background:var(--red-light);border-color:var(--red);color:var(--red)}

/* ---------- المواعيد ---------- */
.slots{margin-top:10px;border-top:1px dashed var(--line);padding-top:10px}
.slots-head{display:flex;align-items:center;justify-content:space-between;font-size:.78rem;color:var(--muted);font-weight:700;margin-bottom:6px}
.slot-row{display:flex;align-items:center;justify-content:space-between;background:#f7f6f1;border-radius:10px;padding:7px 10px;margin-bottom:6px;font-size:.86rem}
.slot-when b{color:var(--green)}
.slot-acts{display:flex;gap:6px}
.mini{border:none;background:#fff;border-radius:9px;width:30px;height:30px;font-size:.9rem;box-shadow:var(--shadow);line-height:1;cursor:pointer}
.slot-empty{font-size:.78rem;color:var(--muted);background:#f7f6f1;border-radius:10px;padding:8px 10px;text-align:center}
.slot-line{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0 2px;font-size:.76rem;color:var(--muted)}
.slot-chip{background:var(--green-light);color:var(--green);border-radius:8px;padding:3px 7px;font-weight:700}
.slot-main{font-weight:700;font-size:.95rem}
.wd-pick{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.wd-pick button{padding:9px 2px;border-radius:10px;border:1px solid var(--line);background:#fff;font-size:.75rem;font-family:inherit;color:var(--ink);cursor:pointer}
.wd-pick button.sel{background:var(--green);color:#fff;border-color:var(--green);font-weight:700}
@media (max-width:400px){.tabbar button{font-size:.58rem}.tabbar button .ico{font-size:1.05rem}}
.name-input{
  width:100%;text-align:center;font-size:1.15rem;font-weight:700;
  padding:14px;border-radius:14px;border:2px solid var(--line);background:var(--beige);outline:none
}
.name-input:focus{border-color:var(--green)}

/* ---------- الهوية والشعار ---------- */
#splash{
  position:fixed; inset:0; z-index:100; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:20px; padding:28px;
  background:linear-gradient(170deg,#fdfcf7 0%,#f3eddc 100%);
  animation:splashOut .6s ease 2.6s forwards
}
#splash .logo-full{width:min(74vw,310px);height:auto;display:block}
#splash p{color:#064e3b;font-weight:700;font-size:1rem;line-height:1.9;text-align:center;margin:0;max-width:300px}
@keyframes splashOut{to{opacity:0;visibility:hidden}}
.logo{display:block;object-fit:contain;border-radius:50%;background:transparent}
.logo-head{width:40px;height:40px;flex:0 0 auto}
.logo-lock{width:104px;height:104px;margin:0 auto 10px}
.cycle-line{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0 2px;font-size:.76rem}
