/* אזור התלמידים והניהול. אותה שפה עיצובית כמו דף הנחיתה */
:root {
  --ink: #1d3a3d;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1f2a2b;
  --muted: #4f5b5c;
  --lime: #d8f24a;
  --lime-dark: #b9d82a;
  --lilac: #9c9ef2;
  --lilac-soft: #e9e9fd;
  --turq: #b3e3df;
  --line: #e4e1d8;
  --danger: #b3261e;
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Heebo", "Segoe UI", Arial, sans-serif; font-size: 17px; line-height: 1.65;
}
h1, h2 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); font-weight: 900; }
h2 { font-size: 1.35rem; font-weight: 800; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--lime); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 8px; }

.app-wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.app-main { padding-top: 28px; padding-bottom: 64px; }

.app-header { background: var(--ink); position: sticky; top: 0; z-index: 10; }
.app-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 900; text-decoration: none; }
.brand::after { content: "."; color: var(--lime); }
.app-nav { list-style: none; display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; align-items: center; }
.app-nav a, .app-nav .link-btn { color: #d6e2e2; text-decoration: none; padding: 8px 10px; border-radius: 999px; font-weight: 500; font-size: .95rem; display: inline-block; }
.app-nav a:hover, .app-nav a[aria-current="page"] { background: var(--lime); color: var(--ink); }
.app-nav form { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 24px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--lime); color: var(--ink); }
.btn-primary:hover { background: var(--lime-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { min-height: 42px; padding: 6px 18px; background: var(--ink); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.link-btn.danger { color: var(--danger); }

input, select, textarea {
  font: inherit; width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--text); min-height: 46px;
}
input:focus, select:focus, textarea:focus { border-color: var(--lilac); outline: none; }
label { display: block; font-weight: 700; color: var(--ink); }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; min-height: 0; margin: 0; }

.stack { display: grid; gap: 14px; }
.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row-form .grow { flex: 1 1 200px; }
.row-form .narrow { flex: 0 0 100px; }
.row-form .full { flex: 1 1 100%; }

.flash { padding: 12px 16px; border-radius: 12px; font-weight: 500; }
.flash-ok { background: #e7f7d2; color: #2c4a07; }
.flash-error { background: #fde4e1; color: var(--danger); }
.flash-info { background: var(--lilac-soft); color: #33345c; }

.tag { font-style: normal; font-size: .8rem; background: var(--lilac-soft); color: #33345c; padding: 1px 8px; border-radius: 999px; }
.chip { display: inline-block; background: var(--ink); color: var(--lime); border-radius: 999px; padding: 3px 14px; font-size: .85rem; font-weight: 700; margin: 0 0 12px; }

/* כניסה */
.auth-card { max-width: 440px; margin: 24px auto; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }

/* הקורס */
.course-hero { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.progress { width: 100%; height: 12px; border-radius: 999px; overflow: hidden; appearance: none; border: 0; background: var(--line); }
.progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--lilac); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--lilac); border-radius: 999px; }
.progress-text { font-weight: 700; margin: 8px 0 16px; }

.chapter-block { margin-bottom: 28px; }
.chapter-num { display: inline-block; background: var(--turq); color: var(--ink); font-weight: 800; font-size: .85rem; padding: 2px 12px; border-radius: 999px; margin: 0 0 8px; }
.lesson-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.lesson-list a {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 52px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text);
}
.lesson-list a:hover { border-color: var(--lilac); }
.lesson-check { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 900; color: #fff; }
.is-done .lesson-check { background: var(--lilac); border-color: var(--lilac); }
.lesson-title { flex: 1; font-weight: 500; }
.lesson-dur { color: var(--muted); font-size: .9rem; direction: ltr; }

.crumbs { color: var(--muted); font-size: .95rem; margin-bottom: 8px; }
.lesson-h1 { margin-bottom: 16px; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty { display: grid; place-items: center; background: var(--ink); color: #cfdcdc; padding: 16px; text-align: center; }
.lesson-body { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; margin-top: 20px; }
.done-form { margin: 20px 0; }
.done-yes { color: #2c4a07; font-weight: 700; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; }

/* ניהול */
.admin-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.admin-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .95rem; }
.admin-table th, .admin-table td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: 700; }
.admin-table form { margin: 0; }
.upload-status { margin: 0; font-weight: 500; }

.app-footer { text-align: center; padding: 20px 16px 32px; font-size: .9rem; }

@media (max-width: 600px) {
  .admin-card { padding: 16px; overflow-x: auto; }
  .admin-table { font-size: .85rem; }
}

/* ---------- אנשי קשר ---------- */
.stat-grid { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-card strong { font-family: Heebo, sans-serif; font-weight: 800; font-size: 2rem; line-height: 1.1; color: var(--ink); }
.stat-card span { color: var(--muted); font-size: .9rem; font-weight: 500; }
.table-scroll { overflow-x: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.filters .grow { flex: 1 1 220px; }
.filters label:not(.grow) { flex: 0 1 150px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.pager a { font-weight: 700; }
.tag-on { background: #e3f4d6; color: #2d5a12; }
.tag-off { background: #ecebe8; color: #555; }
.actions { white-space: nowrap; }
.actions form { display: inline; }
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
