/* رَكيزة — Rakeza Hifz · mint design system */
:root {
  --bg: #EFFAF3;
  --bg2: #E3F5EA;
  --surface: #FFFFFF;
  --primary: #1F7A4D;
  --primary-dark: #175F3C;
  --primary-soft: #D7F0E0;
  --text: #14322A;
  --muted: #5B7268;
  --line: #DDEBE3;
  --blue: #2F80ED;
  --blue-soft: #E3EDFC;
  --green: #22A45D;
  --green-soft: #DCF5E6;
  --amber: #E8A13A;
  --amber-soft: #FCEED8;
  --red: #DC2626;
  --red-soft: #FCE4E4;
  --grey: #98A2B3;
  --grey-soft: #EEF1F4;
  --violet: #7C5CFC;
  --violet-soft: #ECE7FE;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(31, 122, 77, 0.08);
  --shadow-lg: 0 18px 50px rgba(20, 50, 42, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding-inline: 20px; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.hint { color: var(--muted); font-size: 0.85em; }
.right { text-align: right; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(239, 250, 243, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
}
.brand-text b { display: block; font-size: 17px; font-weight: 800; line-height: 1.2; }
.brand-text span { font-size: 10px; color: var(--muted); letter-spacing: 0.4px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-nav { display: flex; gap: 18px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.header-nav a:hover { color: var(--primary); }

.lang-btn {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 12.5px;
  color: var(--primary); transition: 0.15s;
}
.lang-btn:hover { background: var(--primary-soft); }

/* profile menu */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--primary-soft);
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 800; cursor: pointer;
}
.avatar.sm { width: 38px; height: 38px; font-size: 15px; cursor: default; }
.avatar.no-photo { color: var(--primary); }
.profile-wrap { position: relative; }
.profile-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 8px; display: none; z-index: 70;
}
.profile-menu.open { display: block; }
.profile-menu .pm-name { padding: 8px 10px; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profile-menu button {
  width: 100%; text-align: start; background: none; border: 0;
  padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.profile-menu button:hover { background: var(--bg2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 11px 22px; font-size: 14.5px; font-weight: 700;
  transition: 0.15s; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--primary); border-color: var(--line); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-soft:hover { background: #C8E9D6; }
.btn-sm { padding: 7px 15px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-title {
  font-size: 16.5px; font-weight: 800; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.section-gap { margin-top: 22px; }
.count-badge {
  min-width: 26px; padding: 2px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 800; text-align: center;
}

/* ---------- forms ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 13px; font-size: 14.5px; font-family: inherit;
  background: var(--surface); color: var(--text); transition: border-color 0.15s;
}
.input:focus { outline: none; border-color: var(--primary); }
select.input { appearance: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 11px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge-lg { font-size: 13.5px; padding: 6px 15px; }
.type-hifz { background: var(--primary-soft); color: var(--primary-dark); }
.type-review { background: var(--violet-soft); color: var(--violet); }
.st-planned { background: var(--blue-soft); color: var(--blue); }
.st-memorized { background: var(--amber-soft); color: #B4761F; }
.st-recited, .st-done { background: var(--green-soft); color: var(--green); }
.st-late { background: var(--grey-soft); color: #667085; }
.st-redo { background: var(--red-soft); color: var(--red); }
.g-excellent { background: var(--green-soft); color: var(--green); }
.g-very_good { background: #EAF3D8; color: #5E8C1F; }
.g-good { background: var(--amber-soft); color: #B4761F; }
.g-needs_redo { background: var(--red-soft); color: var(--red); }
.g-incomplete { background: #E9EEF2; color: #4E6273; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.late { background: var(--grey); }
.dot.planned { background: var(--blue); }
.dot.memorized { background: var(--amber); }
.dot.recited { background: var(--green); }
.dot.redo { background: var(--red); }

/* ---------- stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.3; }
.stat-value.g-excellent { color: var(--green); background: var(--green-soft); border-radius: 999px; display: inline-block; padding: 2px 16px; font-size: 19px; }
.stat-value.g-very_good { color: #5E8C1F; background: #EAF3D8; border-radius: 999px; display: inline-block; padding: 2px 16px; font-size: 19px; }
.stat-value.g-good { color: #B4761F; background: var(--amber-soft); border-radius: 999px; display: inline-block; padding: 2px 16px; font-size: 19px; }
.stat-value.g-needs_redo { color: var(--red); background: var(--red-soft); border-radius: 999px; display: inline-block; padding: 2px 16px; font-size: 19px; }
.stat-value.g-incomplete { color: #4E6273; background: #E9EEF2; border-radius: 999px; display: inline-block; padding: 2px 16px; font-size: 19px; }

/* ---------- profile card ---------- */
.profile-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-photo-wrap { position: relative; }
.profile-photo {
  width: 86px; height: 86px; border-radius: 50%; object-fit: cover;
  background: var(--primary-soft); border: 3px solid var(--primary-soft);
  display: grid; place-items: center; font-size: 30px; font-weight: 800;
  color: var(--primary); cursor: pointer; overflow: hidden;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-hint {
  position: absolute; bottom: -4px; inset-inline-end: -4px;
  background: var(--primary); color: #fff; width: 26px; height: 26px;
  border-radius: 50%; display: grid; place-items: center; font-size: 13px;
  border: 2px solid var(--surface);
}
.profile-info { flex: 1; min-width: 200px; }
.profile-info h2 { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.profile-info .email { color: var(--muted); font-size: 13.5px; }
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  width: 30px; height: 30px; display: inline-grid; place-items: center;
  color: var(--muted); font-size: 14px;
}
.icon-btn:hover { background: var(--bg2); color: var(--primary); }
.name-edit { display: flex; gap: 8px; margin-top: 8px; }
.name-edit .input { max-width: 260px; }
.teacher-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 700;
  margin-top: 6px;
}

/* ---------- entries / today ---------- */
.ent-row {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.ent-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ent-label { font-size: 14.5px; }
.ent-row .btn { margin-top: 9px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-size: 17px; font-weight: 800; }
.cal-nav {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 20px; color: var(--primary); line-height: 1;
}
.cal-nav:hover { background: var(--primary-soft); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-week { margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.cal-cell {
  border: 1px solid transparent; border-radius: 10px;
  background: var(--surface); min-height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 4px; transition: 0.12s;
}
.cal-cell:not(.empty):hover { border-color: var(--primary); }
.cal-cell.empty { background: transparent; border: 0; min-height: 40px; }
.cal-num { font-size: 14px; font-weight: 700; }
.cal-dots { display: flex; gap: 3px; }
.cal-cell.is-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-cell.st-late { background: var(--grey-soft); }
.cal-cell.st-planned { background: var(--blue-soft); }
.cal-cell.st-memorized { background: var(--amber-soft); }
.cal-cell.st-recited { background: var(--green-soft); }
.cal-cell.st-redo { background: var(--red-soft); }
.cal-cell.st-late .cal-num { color: #667085; }
.cal-cell.st-recited .cal-num { color: var(--green); font-weight: 800; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- dialog / overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 50, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.dialog {
  background: var(--surface); border-radius: var(--radius);
  width: min(560px, 100%); max-height: 86vh; overflow: auto;
  box-shadow: var(--shadow-lg);
}
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface);
}
.dialog-head h3 { font-size: 16px; font-weight: 800; }
.dialog-head .x {
  background: var(--bg2); border: 0; width: 30px; height: 30px;
  border-radius: 50%; font-size: 14px; color: var(--muted);
}
.dialog-body { padding: 16px 20px 22px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 18px; }
.grade-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.grade-row .sel-grade { max-width: 150px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.chk input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------- rows (students/requests/lists) ---------- */
.teacher-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; border-bottom: 1px solid var(--line);
}
.teacher-row:last-child { border-bottom: 0; }
.pending-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: 100%; text-align: start;
  background: var(--amber-soft); border: 1px solid #F3DFC0;
  border-radius: 12px; padding: 11px 14px; margin-bottom: 9px;
}
.pending-chip span { font-size: 12.5px; color: var(--muted); }
.pending-chip:hover { border-color: var(--amber); }

/* ---------- plan preview ---------- */
.preview-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg); }
.preview-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 4px; border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
.preview-row:last-child { border-bottom: 0; }
.pv-date { color: var(--muted); font-size: 12.5px; }
.preview-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 80px);
  background: var(--text); color: #fff; border-radius: 999px;
  padding: 11px 26px; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-lg); z-index: 200; opacity: 0;
  transition: 0.25s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- landing ---------- */
.hero { padding: 70px 0 50px; position: relative; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; line-height: 1.35; }
.hero h1 span { color: var(--primary); }
.hero p { color: var(--muted); font-size: 16.5px; margin: 16px 0 26px; max-width: 540px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art {
  background: linear-gradient(145deg, var(--primary-soft), var(--bg2));
  border: 1px solid var(--line); border-radius: 24px;
  padding: 26px; box-shadow: var(--shadow);
}
.art-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.art-cal i {
  height: 34px; border-radius: 8px; background: var(--surface);
  display: grid; place-items: center; font-style: normal; font-size: 11px;
  color: var(--muted); font-weight: 700; border: 1px solid var(--line);
}
.art-cal i.b { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.art-cal i.a { background: var(--amber-soft); border-color: transparent; color: #B4761F; }
.art-cal i.g { background: var(--green-soft); border-color: transparent; color: var(--green); }
.art-caption { text-align: center; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--primary-dark); }

.section { padding: 44px 0; }
.section-title { font-size: 27px; font-weight: 800; text-align: center; margin-bottom: 26px; }
.section-title span { color: var(--primary); }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: 0.15s;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 21px; margin-bottom: 12px;
}
.feature-card h3 { font-size: 16.5px; font-weight: 800; margin-bottom: 6px; }
.feature-card p { font-size: 13.5px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; position: relative;
}
.step-num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 800;
  display: grid; place-items: center; margin-bottom: 10px; font-size: 15px;
}
.step h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 4px; }
.step p { font-size: 13.5px; color: var(--muted); }

.footer {
  background: var(--text); color: #B7C7C0; margin-top: 40px;
  padding: 26px 0; text-align: center; font-size: 13.5px;
}
.footer b { color: #fff; }
.footer-love { margin-top: 6px; }

/* ---------- auth ---------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 50, 42, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.auth-card {
  background: var(--surface); border-radius: 20px;
  width: min(430px, 100%); max-height: 92vh; overflow: auto;
  box-shadow: var(--shadow-lg); padding: 28px;
}
.auth-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.auth-error {
  background: var(--red-soft); color: var(--red);
  border-radius: 10px; padding: 9px 13px; font-size: 13.5px; font-weight: 700;
  margin-bottom: 12px;
}
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.auth-alt a { color: var(--primary); font-weight: 800; cursor: pointer; }
.divider {
  display: flex; align-items: center; gap: 12px; color: var(--muted);
  font-size: 12.5px; margin: 16px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-opt {
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px; text-align: center; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: 0.15s; background: var(--surface);
}
.role-opt input { display: none; }
.role-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.role-opt .ri { display: block; font-size: 20px; margin-bottom: 3px; }
.google-btn {
  width: 100%; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 11px; font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.google-btn:hover { background: var(--bg); }
.google-g { font-weight: 800; color: #4285F4; font-size: 16px; }

/* ---------- pending / empty states ---------- */
.state-card { text-align: center; padding: 50px 24px; }
.state-card .si { font-size: 44px; margin-bottom: 12px; }
.state-card h2 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.state-card p { color: var(--muted); max-width: 430px; margin: 0 auto; }

/* ---------- tabs (landing auth switch ok) ---------- */
.page-main { padding: 26px 0 50px; }
.two-col { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 18px; align-items: start; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-inner, .two-col { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .cal-cell { min-height: 48px; }
  .cal-num { font-size: 12.5px; }
  .stat-value { font-size: 22px; }
}
@media (max-width: 480px) {
  .card { padding: 16px; }
  .btn { padding: 10px 18px; font-size: 14px; }
  .profile-card { gap: 12px; }
}
