/* אזור המורה — מותאם לטלפון, עובד גם במחשב (מרכז בעמודה ברוחב טלפון רחב) */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  min-height: 100vh; -webkit-tap-highlight-color: transparent;
}
button, input { font-family: inherit; }
a { color: var(--plum); }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* כותרת */
.topbar {
  background: var(--card); padding: 18px 18px 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 24px; font-weight: 700; }
.topbar .sub { font-size: 14px; color: var(--ink-mute); }
.icon-btn {
  min-width: 44px; height: 44px; border-radius: 14px; border: none; background: var(--violet-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--plum);
  font-size: 14px; font-weight: 600; padding: 0 12px; cursor: pointer;
}

main { flex: 1; padding: 16px 16px 120px; }

/* כרטיסים וטפסים */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
input.text {
  min-height: 52px; border-radius: 16px; border: 2px solid #E4DCF5; background: #FFFFFF; padding: 0 16px;
  font-size: 18px; color: var(--ink); outline: none;
}
input.text:focus { border-color: var(--violet); }
input.code { letter-spacing: 10px; text-align: center; font-size: 28px; font-weight: 700; direction: ltr; }
input.email { direction: ltr; text-align: right; }

.btn {
  min-height: 56px; border: none; border-radius: 18px; font-size: 19px; font-weight: 700; cursor: pointer;
  background: var(--violet); color: #FFFFFF; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.secondary { background: var(--violet-soft); color: var(--plum); }
.btn.small { min-height: 44px; font-size: 16px; border-radius: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.linkbtn { background: none; border: none; color: var(--plum); font-size: 15px; font-weight: 600; cursor: pointer; padding: 10px; min-height: 44px; }

.msg { border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 1.4; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.info { background: var(--teal-soft); color: var(--teal-ink); }
.msg[hidden] { display: none; }

/* מסך כניסה */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 18px; gap: 22px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.brand .mark { width: 72px; height: 72px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.brand .name { font-size: 32px; font-weight: 700; }
.brand .slogan { font-family: var(--font-serif); font-size: 18px; color: var(--gold-ink); }

/* רשימת תלמידות */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 4px 10px; }
.section-title h2 { margin: 0; font-size: 19px; }
.section-title .count { font-size: 14px; color: var(--ink-mute); }
.students { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.student {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow-card); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; min-height: 64px;
}
.student.inactive { opacity: .7; background: #FAF8FE; }
.avatar { width: 40px; height: 40px; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; }
.student .nm { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.student .nm button { all: unset; cursor: text; display: block; min-height: 32px; line-height: 32px; }
.student input.text { min-height: 40px; font-size: 16px; padding: 0 10px; width: 100%; }
.student .tools { display: flex; gap: 4px; flex: none; }
.tool {
  width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--violet-soft); color: var(--plum);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tool[disabled] { opacity: .35; cursor: default; }
.tool.toggle { width: auto; padding: 0 10px; font-size: 13px; font-weight: 600; }

.addrow { display: flex; gap: 8px; }
.addrow input { flex: 1; min-width: 0; }

/* פס סטטוס תחתון */
.status {
  position: fixed; bottom: 16px; right: 50%; transform: translateX(50%); z-index: 20;
  background: var(--ink); color: #FFFFFF; border-radius: 16px; padding: 12px 18px; font-size: 15px;
  box-shadow: 0 10px 26px rgba(59, 46, 90, .3); display: flex; gap: 8px; align-items: center;
  width: max-content; max-width: min(520px, calc(100% - 32px));
}
.status.error { background: var(--danger); }
.status[hidden] { display: none; }

.mockflag { background: #FFE9B0; color: #6E460A; text-align: center; font-size: 13px; padding: 6px; font-weight: 600; }

@media (min-width: 700px) {
  main { padding-top: 24px; }
  .login { min-height: 80vh; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
