/* آفتابیک — PWA معلم. RTL، فونت محلی، دکمه‌های بزرگ لمسی (حداقل ۴۸px) */
@font-face {
  font-family: "VazirLocal";
  src: url("../fonts/Vazir-FD.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --text: #1c2b33;
  --muted: #62727c;
  --primary: #1f6f8b;
  --primary-text: #ffffff;
  --ok: #2e8b57;
  --warn: #d98e04;
  --danger: #c0392b;
  --line: #d9e2e8;
  --radius: 14px;
  --tap: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11181d;
    --surface: #1a252c;
    --text: #e8eff3;
    --muted: #9fb0ba;
    --primary: #4aa3c2;
    --primary-text: #08141a;
    --line: #2b3a44;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "VazirLocal", Tahoma, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0));
  background: var(--primary);
  color: var(--primary-text);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar h1 { flex: 0 1 auto; margin: 0; font-size: 18px; font-weight: normal; white-space: nowrap; }
.school-name { flex: 1 1 0; min-width: 0; font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline-start: 8px; border-inline-start: 1px solid rgba(255,255,255,.4); }
.school-name[hidden] { display: none; }
.topbar h1 { margin-inline-end: auto; }
.school-name:not([hidden]) ~ .net-dot { margin-inline-start: 0; }
.icon-btn {
  min-width: 48px; min-height: 48px;
  border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  color: inherit; font: inherit; font-size: 22px; cursor: pointer;
}
.net-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid rgba(255,255,255,.7); }
.net-dot.off { background: var(--warn); }
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px; outline: none; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0 16px; direction: ltr; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 6px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: var(--tap);
  padding: 10px 16px; margin: 8px 0;
  border: 0; border-radius: var(--radius);
  background: var(--primary); color: var(--primary-text);
  font: inherit; font-size: 17px; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn.warn { background: var(--warn); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn small { display: block; font-size: 12px; opacity: .85; }
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--warn); color: #fff;
}
.banner span { flex: 1; }
.banner button {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px;
  background: #fff; color: #7a4f00; font: inherit; cursor: pointer;
}
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.tag { font-size: 12px; padding: 2px 10px; border-radius: 99px; }
.tag.ok { background: rgba(46,139,87,.15); color: var(--ok); }
.tag.bad { background: rgba(192,57,43,.15); color: var(--danger); }
.tag.na { background: rgba(217,142,4,.15); color: var(--warn); }
.note { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); }
.note.ok { background: rgba(46,139,87,.12); border-color: var(--ok); }
.note.warn { background: rgba(217,142,4,.12); border-color: var(--warn); }
.note.bad { background: rgba(192,57,43,.12); border-color: var(--danger); }
.note.info { background: rgba(31,111,139,.10); border-color: var(--primary); }
.paste-area { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: 13px monospace; }
details.card summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; }

/* ---- حضور و غیاب (C3) ---- */
.field { width: 100%; min-height: var(--tap); margin: 4px 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 17px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.att-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 8px 0; font-size: 16px; }
.att-summary .sep { color: var(--muted); }
.bad-text { color: var(--danger); font-weight: bold; }
.stu-list { margin-bottom: 14px; }
.list.stu-list li.stu-row { padding: 4px 0; align-items: stretch; }
.stu { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 56px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 17px; text-align: start; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.stu.absent { background: rgba(192,57,43,.14); border-color: var(--danger); }
.stu.justified { background: rgba(217,142,4,.16); border-color: var(--warn); }
.stu-state { font-size: 14px; color: var(--muted); }
.stu.absent .stu-state { color: var(--danger); }
.more { min-width: 48px; min-height: 56px; margin-inline-start: 6px; border: 2px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 17px; }
.check input { width: 24px; height: 24px; }
.sheet { border-color: var(--primary); }

/* ---- نمره (C4) ---- */
.score-row { align-items: center; gap: 10px; }
.score-row .stu-name { flex: 1; font-size: 17px; }
.score-box { display: flex; flex-direction: column; align-items: flex-end; min-width: 96px; }
.score-in { width: 88px; min-height: 52px; padding: 6px 10px; text-align: center; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 20px; direction: ltr; }
.score-in:focus { border-color: var(--primary); outline: none; }
.score-in.invalid { border-color: var(--danger); background: rgba(192,57,43,.12); }

/* ---- ارسال (C5) ---- */
.offscreen { position: fixed; top: 0; inset-inline-start: -9999px; opacity: 0; }
.send-file { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; direction: ltr; font-size: 13px; color: var(--muted); }
.hist li { flex-direction: column; gap: 4px; }

/* ================= R8 — طراحی ساده و دوست‌داشتنی ================= */
:root { --accent: #e8890c; --accent-text: #ffffff; --soft: rgba(31,111,139,.08); --shadow: 0 2px 10px rgba(20,50,65,.08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #f0a23a; --accent-text: #1b1100; --soft: rgba(74,163,194,.12); --shadow: none; } }
/* M11j-3: انتخاب دستی حالت تیره/روشن و اندازهٔ نوشته (ui_prefs.js؛ ویژگی‌ها روی <html>) */
:root[data-theme="dark"] { color-scheme: dark; --bg: #11181d; --surface: #1a252c; --text: #e8eff3; --muted: #9fb0ba; --primary: #4aa3c2; --primary-text: #08141a; --line: #2b3a44; --accent: #f0a23a; --accent-text: #1b1100; --soft: rgba(74,163,194,.12); --shadow: none; }
:root[data-theme="light"] { color-scheme: light; }
html[data-fs="large"] body { zoom: 1.15; }
html[data-fs="xlarge"] body { zoom: 1.3; }
.prefs-card .tabs { margin-bottom: 4px; }
[hidden] { display: none !important; }
body { padding-bottom: calc(env(safe-area-inset-bottom, 0) + 4px); }
body.sheet-open { overflow: hidden; }
main { padding: 12px 14px 20px; }
.small { font-size: 13px; }
.card.tight { padding: 10px 12px; }
.link-btn { background: none; border: 0; color: var(--primary); font: inherit; font-size: 15px; min-height: 44px; padding: 0 10px; cursor: pointer; text-decoration: underline; }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 10px; }
.static-field { min-height: 44px; display: flex; align-items: center; padding: 4px 10px; font-size: 17px; font-weight: bold; }

/* صفحهٔ اصلی */
.hello { padding: 4px 4px 10px; }
.hello h2 { margin: 0; font-size: 22px; }
.hello p { margin: 2px 0 0; font-size: 14px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 12px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 124px; padding: 14px 8px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; }
.tile:active { transform: scale(.97); background: var(--soft); }
.tile-ico { font-size: 38px; line-height: 1.1; }
.tile-lbl { font-size: 18px; font-weight: bold; }
.send-btn { flex-direction: column; gap: 0; min-height: 64px; font-size: 18px; box-shadow: var(--shadow); }
.btn.attn { background: var(--accent); color: var(--accent-text); }
.btn.secondary.send-btn small { color: var(--muted); }
.badge { font-size: 14px; background: rgba(255,255,255,.28); border-radius: 99px; padding: 0 12px; margin-top: 2px; }
.more-box { margin: 14px 0; }
.more-box > summary { min-height: 48px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; list-style: none; }
.more-box > summary::-webkit-details-marker { display: none; }
.more-h { font-size: 15px; margin: 12px 0 0; color: var(--muted); font-weight: normal; }

/* کارت نصب */
.install-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 14px; margin-bottom: 12px; border-radius: 16px; border: 2px dashed var(--primary); background: var(--soft); }
.install-ico { font-size: 34px; grid-row: span 1; }
.install-txt { display: flex; flex-direction: column; font-size: 15px; line-height: 1.7; }
.install-card .btn, .install-steps, .install-card .link-btn, .install-manual { grid-column: 1 / -1; min-width: 0; }
.install-card > * { min-width: 0; }
.install-manual p { overflow-wrap: anywhere; }
.install-done { margin: 4px 0 10px; }
.install-steps { margin: 6px 0 0; padding-inline-start: 22px; font-size: 15px; }
.install-card .link-btn { justify-self: center; }

/* نوار تاریخ */
.date-bar { display: flex; align-items: stretch; gap: 8px; margin-top: 8px; }
.step-btn { flex: 0 0 56px; min-height: 56px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--primary); font-size: 30px; line-height: 1; cursor: pointer; touch-action: manipulation; }
.step-btn:active { background: var(--soft); }
.date-label { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border: 0; border-radius: 14px; background: var(--soft); color: var(--text); font: inherit; cursor: pointer; }
.date-main { font-size: 18px; font-weight: bold; }
.date-label::after { content: "تغییر تاریخ ▾"; font-size: 11px; color: var(--muted); }
.date-label .tag { margin-top: 0; }
.date-extra { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 0; }
.date-extra:empty { display: none; }
.exact { margin-top: 8px; }

/* فهرست فشردهٔ دانش‌آموزان */
.list.stu-list.compact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.list.stu-list.compact li.stu-row { padding: 0; border-bottom: 1px solid var(--line); align-items: stretch; gap: 0; }
.list.stu-list.compact li.stu-row:last-child { border-bottom: 0; }
.compact .stu { min-height: 52px; padding: 6px 14px; border: 0; border-radius: 0; background: transparent; }
.compact .stu.absent { background: rgba(192,57,43,.12); }
.compact .stu.justified { background: rgba(217,142,4,.14); }
.compact .stu:active { background: var(--soft); }
.stu-name { display: flex; flex-direction: column; text-align: start; }
.stu-note { color: var(--muted); font-size: 12px; line-height: 1.4; }
.pill { min-width: 52px; padding: 2px 12px; border-radius: 99px; text-align: center; font-size: 15px; }
.pill.present { color: var(--ok); background: rgba(46,139,87,.12); font-size: 18px; }
.pill.absent { color: #fff; background: var(--danger); font-weight: bold; }
.pill.justified { color: #fff; background: var(--warn); font-weight: bold; }
.pill.score { min-width: 56px; padding: 4px 14px; font-size: 20px; color: var(--muted); border: 2px dashed var(--line); }
.pill.score.filled { color: var(--primary-text); background: var(--primary); border: 2px solid var(--primary); font-weight: bold; }
.edit-btn { flex: 0 0 52px; border: 0; border-inline-start: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }

/* نوار پایین چسبان */
.bottom-bar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 12px; margin: 0 -14px -20px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(20,50,65,.08); }
.bar-info { flex: 1; display: flex; flex-direction: column; line-height: 1.5; }
.bar-main { font-size: 16px; }
.bottom-bar .btn { width: auto; flex: 0 0 auto; margin: 0; padding: 0 20px; min-height: 52px; }
.bottom-bar small { font-size: 12px; }

/* پنجرهٔ پایین‌صفحه */
.sheet-overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(10,25,32,.5); animation: fade .18s ease-out; }
.sheet-panel { width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--surface); color: var(--text); border-radius: 22px 22px 0 0; padding: 6px 16px calc(16px + env(safe-area-inset-bottom, 0)); animation: rise .22s ease-out; outline: none; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 8px; }
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-title { flex: 1; font-size: 19px; }
.sheet-x { background: var(--soft); color: var(--muted); }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 8px 0; padding: 8px 14px; border: 2px solid var(--line); border-radius: 14px; background: transparent; color: var(--text); font: inherit; font-size: 17px; cursor: pointer; }
.choice-box { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 8px; color: transparent; }
.choice.on { border-color: var(--warn); background: rgba(217,142,4,.14); }
.choice.on .choice-box { background: var(--warn); border-color: var(--warn); color: #fff; }

/* صفحه‌کلید عددی نمره */
.pad-progress { margin: 4px 0 8px; font-size: 14px; }
.numpad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.num { min-height: 60px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; font-size: 24px; cursor: pointer; touch-action: manipulation; }
.num:active { background: var(--primary); color: var(--primary-text); }
.num.on { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: bold; }
.pad-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.pad-actions .btn { margin: 0; font-size: 15px; min-height: 50px; }
@keyframes rise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-overlay, .sheet-panel { animation: none; } .tile:active { transform: none; } }

/* درباره و راهنما */
.about-link { display: block; margin: 4px auto 0; }
details.qa { padding: 4px 16px; }
details.qa > summary { min-height: 56px; font-size: 17px; font-weight: bold; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
details.qa > summary::-webkit-details-marker { display: none; }
details.qa > summary::after { content: "▾"; color: var(--muted); }
details.qa[open] > summary::after { content: "▴"; }
details.qa[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.plain-list { margin: 6px 0 10px; padding-inline-start: 22px; line-height: 2; }


/* ---- R9: راهنمای ثبت نمره و بازطراحی ارسال ---- */
.card.guide { border: 2px solid var(--primary); background: rgba(31,111,139,.07); }
.guide-title { font-weight: 800; font-size: 17px; margin: 0 0 6px; }
.guide-steps { margin: 4px 0 12px; padding-inline-start: 22px; line-height: 1.9; }
.btn.start-btn { background: var(--ok); color: #fff; font-size: 18px; }
.btn.start-btn.secondary { background: transparent; color: var(--ok); border: 2px solid var(--ok); }
.btn.start-btn[hidden] { display: none; }
li.stu-row.next .stu { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(46,139,87,.25); }
li.stu-row.next .pill.score { border-color: var(--ok); color: var(--ok); }
.send-hero { text-align: center; padding: 20px 16px; }
.send-count { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 10px; }
.send-count b { font-size: 48px; line-height: 1.1; color: var(--primary); }
.send-count span { color: var(--muted); font-size: 16px; }
.send-count .send-ok { font-size: 44px; color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 14px; }
.chip { padding: 6px 12px; border-radius: 99px; background: rgba(31,111,139,.12); font-size: 14px; }
.btn.big { min-height: 64px; font-size: 20px; font-weight: 800; }
.ready-card { border: 2px solid var(--ok); }
.ready-desc { font-size: 16px; }
details.more > summary, details.more-card > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; color: var(--primary); font-weight: bold; }
details.more .btn { margin-top: 8px; }
.small { font-size: 13px; }


/* ---- R10: ارسال امن‌تر (ضدّ لمس تکراری) و تاریخچهٔ جمع‌شونده ---- */
.spin { width: 18px; height: 18px; border: 3px solid currentColor; border-top-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }
.is-busy .btn, .is-busy summary { pointer-events: none; }
.is-busy .btn:not([aria-busy="true"]) { opacity: .45; }
.btn[aria-busy="true"] { opacity: .85; cursor: progress; }
.btn.sm { min-height: 44px; font-size: 15px; padding: 6px 14px; margin: 6px 0; }
.hist-card h2 { margin-bottom: 2px; }
.list.hist li.hist-li { display: block; padding: 6px 0; }
.hist-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.hist-item.wait { border-color: var(--warn); }
.hist-item > summary { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; cursor: pointer; list-style: none; }
.hist-item > summary::-webkit-details-marker { display: none; }
.hist-item > summary::after { content: "▾"; color: var(--muted); }
.hist-item[open] > summary::after { content: "▴"; }
.hist-ico { font-size: 18px; color: var(--ok); }
.hist-item.wait .hist-ico { color: var(--warn); }
.hist-main { flex: 1; display: flex; flex-direction: column; line-height: 1.5; min-width: 0; }
.hist-body { padding: 4px 12px 10px; border-top: 1px solid var(--line); }
.hist-resend { width: auto; min-width: 140px; margin-inline-start: 0; }
.resend-box .btn { margin: 4px 0; }

/* ---- صفحه‌های مدیریت (M5b-2) ---- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 10px; padding-bottom: 2px; }
.tab { flex: 0 0 auto; min-height: 44px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.tab.on { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.row-btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 0; border: 0; background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.list li:has(> .row-btn) { padding: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats b { display: block; font-size: 24px; }
.tel-link { display: inline-block; padding: 6px 16px; border-radius: 99px; border: 1px solid var(--primary); color: var(--primary); text-decoration: none; }
.phone-end { display: flex; align-items: center; gap: 10px; }
.num-ltr { direction: ltr; unicode-bidi: plaintext; }
.sched-cell { text-align: end; }
.list li.bar-row { align-items: center; }
.bar { flex: 1; min-width: 40px; height: 10px; accent-color: var(--primary); }

/* M5c-2: صفحه‌های تغییر مدیریت (حضور، نمره، انضباط) */
.note.bad { border-color: var(--danger); }
.date-row { display: flex; flex-direction: column; gap: 4px; }
.day-step { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.day-step .btn { width: 56px; min-height: var(--tap); font-size: 22px; }
.row-end { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pend-tag { font-size: 11px; }
.pend-row { align-items: center; gap: 8px; }
.score-row { flex-wrap: wrap; align-items: center; gap: 6px; }
.score-name { flex: 1 1 100%; }
.score-cells { display: flex; gap: 8px; width: 100%; }
.cell-btn { flex: 1; min-height: var(--tap); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 18px; cursor: pointer; }
.cell-btn.pend { background: rgba(217,142,4,.18); border-color: var(--warn); }
.cell-btn:disabled { opacity: .7; cursor: default; }
.keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.key { min-height: var(--tap); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 18px; cursor: pointer; }
.key.on { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* M5d-1: هشدار زودهنگام و تحلیل نمرات */
.warn-row { flex-direction: column; align-items: stretch; }
.warn-detail { padding: 4px 0 10px; }
.plain { margin: 0 0 8px; padding: 0 18px 0 0; }
.subj-row { flex-direction: column; align-items: stretch; }

/* M5d-2: صفحهٔ پیامک */
.chip-btn { padding: 8px 14px; min-height: 44px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.chip-btn.on { background: rgba(31,111,139,.16); border-color: rgba(31,111,139,.6); font-weight: 700; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.row-actions .btn { flex: 1 1 140px; }
textarea.field { min-height: 120px; resize: vertical; line-height: 1.7; }
.pat-text { padding: 8px 10px; border-radius: 10px; background: rgba(31,111,139,.08); white-space: pre-wrap; }
.row-btn[aria-pressed="true"] { font-weight: 700; }
.warn-txt { color: var(--warn); }

/* M6c — صفحه‌های دانش‌آموز/والد */
.score-chips { flex: 1; text-align: center; font-size: 15px; color: var(--muted); white-space: nowrap; overflow-x: auto; }
.list li.bar-row .score-chips { min-width: 40px; }

/* M5h — وضعیت همگام‌سازی و نتیجهٔ درخواست‌ها */
.sync-status h2, .results-card h2 { margin-top: 0; }
.sync-problems li { align-items: flex-start; }
.result-row { flex-direction: column; align-items: stretch; gap: 2px; }
.result-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* M9b — اطلاعیه‌های مدرسه (S04): بدون style درون‌خطی چون CSP فقط 'self' را می‌پذیرد */
.notice-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.card.notice.important { border-inline-start: 4px solid #c0392b; }

/* ================= UX1 — سادگی برای همه (اصل‌ها: میلر، هیک، فیتس، پرهیز از بار شناختی) ================= */
/* دکمه‌های بزرگ صفحهٔ اصلی معلم */
.main-actions { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 14px; }
.big-action { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 84px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); font: inherit; text-align: start; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; }
.big-action:active { transform: scale(.98); background: var(--soft); }
.big-action .ba-ico { flex: 0 0 56px; height: 56px; display: grid; place-items: center; font-size: 32px; border-radius: 16px; background: var(--soft); }
.ba-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.5; min-width: 0; }
.ba-title { font-size: 20px; font-weight: bold; }
.ba-hint { font-size: 14px; color: var(--muted); }
.ba-go { color: var(--muted); font-size: 28px; padding: 0 4px; }
.ba-badge { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: 99px; background: var(--accent-text); color: var(--accent); font-weight: bold; font-size: 18px; }
.big-action.attn { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.big-action.attn .ba-hint, .big-action.attn .ba-go { color: inherit; opacity: .9; }
.big-action.attn .ba-ico { background: rgba(255,255,255,.25); }
.big-action.quiet { box-shadow: none; }
.more-btn { min-height: 60px; font-size: 18px; }

/* صفحهٔ «بیشتر» */
.menu-h { margin: 18px 4px 6px; font-size: 15px; color: var(--muted); font-weight: bold; }
.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.menu-row:last-child { border-bottom: 0; }
.menu-row:active { background: var(--soft); }
.mr-ico { flex: 0 0 40px; font-size: 26px; text-align: center; }
.mr-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.5; }
.mr-title { font-size: 17px; font-weight: bold; }
.mr-hint { font-size: 13px; color: var(--muted); }
.more-box-card { margin-top: 14px; }

/* کاشی‌های مدیریت */
.tile.dim { opacity: .6; border-style: dashed; }
.tile-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.tile-lbl { text-align: center; line-height: 1.5; }
.sync-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sync-txt { display: flex; flex-direction: column; line-height: 1.5; font-size: 14px; min-width: 0; }
.sync-go { width: auto; margin: 0; flex: 0 0 auto; }

/* جدول هفتگی (ردیف = زنگ، ستون = روز) */
.card.tight { padding: 10px 8px; }
.card.tight > h2 { padding: 0 6px; }
.wk-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; outline-offset: 2px; }
.wk { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 100%; font-size: 13px; }
.wk th, .wk td { border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); padding: 6px 4px; vertical-align: middle; text-align: center; }
.wk tr > :first-child { border-inline-start: 0; }
.wk tbody tr:last-child > * { border-bottom: 0; }
.wk thead th { position: sticky; top: 0; background: var(--soft); font-size: 13px; white-space: nowrap; min-width: 82px; }
.wk .wk-corner, .wk .wk-slot { position: sticky; inset-inline-start: 0; z-index: 1; min-width: 64px; width: 64px; background: var(--soft); color: var(--muted); }
.wk .wk-corner { z-index: 2; }
.wk .wk-slot { font-weight: bold; font-size: 13px; color: var(--text); white-space: nowrap; }
.wk .wk-slot small { display: block; font-size: 10px; font-weight: normal; }
.wk .wk-slot.today { background: var(--primary); color: var(--primary-text); }
.wk thead th small { display: block; font-size: 10px; font-weight: normal; opacity: .9; }
.wk td.today { background: rgba(31,111,139,.09); }
.wk td.none { color: var(--line); }
.wk-item { display: flex; flex-direction: column; line-height: 1.45; padding: 2px 0; }
.wk-item + .wk-item { border-top: 1px dashed var(--line); margin-top: 2px; }
.wk-l1 { font-weight: bold; font-size: 13px; }
.wk-l2 { font-size: 11.5px; color: var(--muted); }
.wk-empty { color: var(--line); }
.today-card { border-color: var(--primary); background: var(--soft); }
.slot-badge { flex: 0 0 auto; min-width: 64px; padding: 0 10px; border-radius: 99px; background: var(--primary); color: var(--primary-text); text-align: center; font-size: 13px; line-height: 1.9; }
.today-card .list li { align-items: center; }

/* خلاصهٔ غیبت (E11) */
.sum-nums { display: flex; gap: 10px; margin: 6px 0 8px; }
.sum-num { flex: 1; text-align: center; padding: 12px 6px; border-radius: 14px; background: var(--soft); }
.sum-num b { display: block; font-size: 30px; line-height: 1.2; }
.sum-num span { font-size: 15px; color: var(--muted); }
.sum-num.warn b { color: var(--danger); }
.row-sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.row-num { text-align: end; white-space: nowrap; }
.row-num b { display: block; }
.row-num small { display: block; font-size: 13px; }
.row-num small.warn { color: var(--danger); font-weight: 700; }
.chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 10px; }

/* مدیریت: فهرست و تماس (E03/E06) */
.chev { color: var(--muted); font-size: 22px; flex: 0 0 auto; }
.call-list { display: grid; gap: 10px; }
.btn.call-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; font-size: 18px; text-decoration: none; }
.btn.call-btn small { font-size: 15px; color: var(--muted); }
.call-none { margin: 4px 0; }


/* ---- M11g: تأیید پیش از ارسال و صفحه‌های ثبت ---- */
.sum-list { margin: 6px 0 14px; padding-inline-start: 22px; line-height: 2; font-size: 16px; }
.sheet-body .btn.big { margin-top: 8px; }
.card.guide .guide-steps[hidden], .card.guide p[hidden] { display: none; }
.send-hero .btn.secondary { margin-top: 8px; }

/* R-UX2: نوار یکپارچهٔ همگام‌سازی (آخرین دریافت + دکمهٔ کوچک)، نتیجهٔ درخواست‌ها در پایین */
.sync-panel { margin-bottom: 12px; }
.sync-panel .sync-bar { margin-bottom: 0; }
.sync-panel.warn .sync-bar { border-color: var(--warn); }
.sync-panel.bad .sync-bar { border-color: var(--danger); }
.sync-panel .sync-go { min-height: 40px; padding: 4px 12px; font-size: 14px; white-space: nowrap; }
.sync-panel .sync-go:disabled { opacity: .7; }
.sync-panel .sync-problems { margin: 6px 4px 0; padding: 0 18px 0 0; font-size: 14px; line-height: 1.8; color: var(--muted); }
.results-box > .card { margin-top: 8px; }

/* ---- بازطراحی «آخرین دریافت» (نوار فشردهٔ یک‌خطی) ---- */
.sync-bar { gap: 10px; padding: 8px 10px 8px 8px; }
.sync-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: rgba(46,139,87,.14); }
.sync-panel.warn .sync-ico { background: rgba(217,142,4,.16); }
.sync-panel.bad .sync-ico { background: rgba(192,57,43,.14); }
.sync-txt { flex: 1 1 auto; line-height: 1.35; }
.sync-lbl { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync-when { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-panel .sync-go { min-height: 36px; padding: 2px 12px; font-size: 13px; border-radius: 99px; background: rgba(31,111,139,.10); color: var(--primary); border: 1px solid transparent; white-space: nowrap; flex: 0 0 auto; width: auto; }
.sync-panel .sync-go:disabled { opacity: .65; background: transparent; border-color: var(--line); color: var(--muted); }

/* ---- پیام کوتاه «اطلاعات تازه دریافت شد»: یک خط، خودکار محو می‌شود ---- */
.flash-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; margin: 0 0 10px; font-size: 13px; line-height: 1.5; border-radius: 99px; background: rgba(46,139,87,.12); color: var(--ok); border: 1px solid rgba(46,139,87,.35); overflow: hidden; max-height: 60px; animation: chipOut .45s ease 6s forwards; }
@keyframes chipOut { to { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; border-width: 0; } }
@media (prefers-reduced-motion: reduce) { .flash-chip { animation-duration: .01s; } }

/* ---- «در انتظار اعمال» جمع‌وجور ---- */
.pend-note { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 8px 12px; margin-bottom: 12px; border-radius: 12px; background: rgba(217,142,4,.10); border: 1px solid var(--warn); font-size: 14px; }
.pend-sub { color: var(--muted); font-size: 13px; }
.stale-box { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* M11p2b */
.sync-line { display: flex; align-items: baseline; white-space: nowrap; overflow: hidden; min-width: 0; }
.sync-auto { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; margin-inline-start: 2px; }
.pend-row { flex-wrap: wrap; }
.pend-what { flex: 1 1 60%; min-width: 0; }
.link-btn { flex: 0 0 100%; text-align: start; background: none; border: 0; padding: 4px 0; min-height: 32px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-btn.arm { color: var(--danger); font-weight: bold; }

/* PS1 — صفحهٔ پیامک: فهرست «بعد از این چه می‌شود؟» */
.steps { margin: 6px 0 10px; padding-inline-start: 22px; line-height: 1.9; }

/* PS1d — حالت «در حال ارسال» پیامک */
.send-head { display: flex; align-items: center; gap: 10px; }
.send-head h2 { margin: 0; }
.send-steps { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.send-step { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.send-step.ok, .send-step.now { color: var(--text); }
.send-step.bad { color: var(--danger); font-weight: 700; }
.send-mark { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); flex: 0 0 auto; }
.send-step.ok .send-mark { background: rgba(46,139,87,.16); border-color: var(--ok); color: var(--ok); }
.send-step.bad .send-mark { border-color: var(--danger); }
.send-card.ok { border-color: var(--ok); }
.send-card.warn { border-color: var(--warn); }
.send-card.bad { border-color: var(--danger); }

/* ATT-P · P8: حضور و غیابِ زنگ‌محور */
.stu.late { background: rgba(123,94,167,.14); border-color: #7b5ea7; }
.compact .stu.late { background: rgba(123,94,167,.14); }
.pill.late { color: #fff; background: #7b5ea7; font-weight: bold; }
.chip-btn .cnt { opacity: .75; }
.sheet-body .chips { margin: 4px 0 10px; }

/* P3-02: ورود نمرهٔ اعشاری (فقط وقتی دسکتاپ اجازه داده باشد دیده می‌شود) */
.dec-box { margin-bottom: 10px; }
.dec-row { display: block; }
.dec-row .field { margin: 0; font-size: 22px; text-align: center; min-height: 52px; width: 100%; }
.dec-row .field::placeholder { font-size: 14px; }
.dec-msg { color: var(--danger, #b00020); margin: 6px 0 0; }

/* SA-18: صفحهٔ «ورود و خروج همکاران» (فقط کلاس‌های تازه؛ رنگ‌ها از متغیرهای موجود ⇒ حالت تیره هم درست است) */
.staff-bar { width: 100%; height: 14px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); accent-color: var(--ok); }
.staff-bar::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.staff-bar::-webkit-progress-value { background: var(--ok); border-radius: 99px; }
.staff-bar::-moz-progress-bar { background: var(--ok); border-radius: 99px; }
.staff-prog { margin: 6px 0 0; font-weight: 700; font-size: 15px; }
.staff-list li.staff-row { display: block; padding: 12px 0; }
.staff-list.dim { opacity: .75; }
.staff-who { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; font-size: 16px; }
.staff-who .staff-more { margin-inline-start: auto; min-width: 48px; font-size: 22px; }
.staff-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.staff-role, .staff-pend, .staff-queued { background: rgba(98,114,124,.16); color: var(--muted); font-size: 13px; }
.staff-acts { display: flex; gap: 8px; }
.staff-acts .staff-btn { flex: 1 1 0; width: auto; min-height: 56px; margin: 0; padding: 0 8px; font-size: 15px; }
.staff-sheet-alt { display: flex; gap: 8px; margin-top: 10px; }
.staff-sheet-alt .btn { flex: 1 1 0; width: auto; }
/* SA-19: نوار «برگرداندن» */
.staff-undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-inline-start: 4px solid var(--ok); }
.staff-undo .btn { width: auto; flex: 0 0 auto; margin: 0; padding: 0 16px; min-height: 52px; }
