/* أنماط خاصة بصفحات ops — الجدول، الحضور، الحجوزات، السجلات، النقل، الرسائل، الموافقات */

/* روابط الأسماء داخل القوائم والجداول */
.linkname { font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: none; }
.linkname:hover { color: var(--primary-ink); text-decoration: underline; }

/* ── الجدول الأساسي: حسب المدربة ── */
.trainer-name { font-size: 16px; }
.schedrow {
  display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap;
  padding: 8px; border-block-end: 1px solid var(--line-soft); min-width: 0;
}
.schedrow:last-child { border-block-end: 0; }
.schedrow:hover { background: var(--surface-2); }

/* ── الجدول الأسبوعي: أعمدة أيام على الشاشات العريضة، مكدسة على الجوال ── */
.weekgrid {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1100px) { .weekgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .weekgrid { grid-template-columns: 1fr; } }
.weekcol {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; display: flex; flex-direction: column; overflow: hidden;
}
.weekcol-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: 8px 12px; color: var(--ink); font-weight: 600;
  border-block-end: 1px solid var(--line);
}
.weekcol.today { border-color: var(--primary-line); }
.weekcol.today .weekcol-head { background: var(--primary-tint); border-block-end-color: var(--primary-line); }
.weekcol-now { font-weight: 500; color: var(--primary-ink); }
.sched-trainer { flex: 0 1 200px; min-width: 150px; }
.today-row { display: flex; align-items: center; gap: var(--s2) var(--s3); padding: 8px var(--s4); min-height: 52px; border-block-end: 1px solid var(--line-soft); flex-wrap: wrap; }
.today-row:last-child { border-block-end: 0; }
.today-row .grow { flex: 1 1 140px; }
.today-time { min-width: 3em; }
.today-row .badge { flex: none; }
.weekcol-empty { padding: 14px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.weekslot {
  display: flex; flex-direction: column; gap: 3px; padding: 9px 12px;
  border-block-end: 1px solid var(--line-soft); min-width: 0;
}
.weekslot:last-child { border-block-end: 0; }
.weekslot.off { background: var(--danger-soft); }
.weekslot .badge { align-self: flex-start; }
.weekslot-act { display: flex; gap: 2px; justify-content: flex-end; }

/* ── حضور الأطفال ── */
.att-stats { margin-block-end: var(--s4); }
.attrow { cursor: default; align-items: flex-start; }
.attrow:hover { border-color: var(--line); }
.attrow-who { display: flex; align-items: center; gap: var(--s3); flex: 1 1 220px; min-width: 0; }
.attrow-who .t { display: block; }
.attrow-slots { display: flex; flex-direction: column; gap: var(--s2); flex: 2 1 420px; min-width: 0; }
.attslot {
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: space-between;
  padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-soft);
}
.attslot-info { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-width: 0; }
.attslot-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) {
  .attslot-btns { width: 100%; }
  .attslot-btns .btn { flex: 1; }
}

/* ── حضور الموظفين ── */
.att-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .att-actions { width: 100%; }
  .att-actions .btn { flex: 1 1 auto; }
}

/* ── الحجوزات ── */
.listrow.static { cursor: default; }
.listrow.static:hover { border-color: var(--line); }
.booktime { min-width: 52px; }
.bookrow { flex-wrap: nowrap; }
.bookrow .grow { min-width: 0; }
.mb-field { margin-block-end: var(--s3); }

/* ── السجلات ── */
.tile-add { border-style: dashed; background: transparent; }
.cell-details { max-width: 32ch; white-space: pre-wrap; }
.sigthumb { height: 34px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xs); display: block; } /* التوقيع حبر داكن على خلفية بيضاء دائماً */
.fieldrow { display: flex; gap: var(--s2); align-items: center; margin-block-end: var(--s2); }
.fieldrow .in:first-child { flex: 1; min-width: 0; }
.fieldrow select.in { flex: 0 0 auto; width: auto; min-width: 110px; }

/* ── خطوط النقل ── */
.line-head { display: flex; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; }
.line-ic { display: inline-flex; color: var(--primary-ink); flex-shrink: 0; padding-top: 3px; }
.line-ic .ic { width: 20px; height: 20px; }
.line-title b { font-size: 16px; }
.line-actions { margin-inline-start: auto; }
.line-members { margin-block-start: var(--s3); border-block-start: 1px solid var(--line); }
.line-empty { margin-block-start: var(--s3); padding: 10px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
@media (max-width: 640px) { .line-actions { width: 100%; justify-content: flex-end; } }

/* ── رسائل الأهل ── */
.msg-picker { margin-block-end: var(--s4); max-width: 560px; }
.msg-picker .field { margin: 0; }
.msgrow { flex-wrap: nowrap; }
.msg-main { min-width: 0; }
.msg-ic { display: inline-flex; color: var(--muted); flex-shrink: 0; }
.msg-ic .ic { width: 18px; height: 18px; }
@media (max-width: 480px) { .msgrow { flex-wrap: wrap; } }

/* ── الموافقات ── */
.apprcard { display: flex; flex-direction: column; gap: var(--s2); }
.appr-head { flex-wrap: wrap; }
.appr-title { min-width: 0; overflow-wrap: anywhere; }
.appr-meta { display: flex; gap: var(--s2) var(--s4); flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.appr-details {
  white-space: pre-wrap; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 8px 12px; overflow-wrap: anywhere;
}
.apprcard .alert { margin: 0; }
.appr-actions { display: flex; gap: var(--s2); flex-wrap: wrap; padding-block-start: var(--s2); border-block-start: 1px solid var(--line-soft); }
.weekslot { position: relative; }
.weekslot-act { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; opacity: .55; transition: opacity .15s; }
.weekslot:hover .weekslot-act, .weekslot:focus-within .weekslot-act { opacity: 1; }
.weekslot-act .iconbtn { width: 28px; height: 28px; }
.weekslot > .row { padding-inline-end: 64px; }

/* إحصاءات الحضور: ثلاث بطاقات متجاورة حتى على الجوال */
.att-stats { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .att-stats .stat { padding: 10px; }
}
/* رقم التسلسل في الجداول المكدسة على الجوال */
@media (max-width: 760px) {
  .tbl.stack-mobile td.rowidx { color: var(--muted); font-size: 12px; font-weight: 600; padding-block-end: 2px; }
}
.att-stats > :last-child:nth-child(odd) { grid-column: auto; }
@media (max-width: 560px) {
  .tbl.stack-mobile td.rowidx, .tbl.stack-mobile td[data-label="ت"] { display: none; }
}

/* ── قائمة الانتظار ── */
.tab-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.tabs + .toolbar, .tabs + div { margin-block-start: var(--s3); }
.waitrow { flex-wrap: wrap; }
.waitrow .grow { flex: 1 1 220px; min-width: 0; }
.wait-acts { display: inline-flex; align-items: center; gap: var(--s1); margin-inline-start: auto; }
.wait-child { font-size: var(--fs-small); font-weight: 400; color: var(--primary-ink); margin-inline-start: var(--s1); }
.wait-freed { margin-block-end: var(--s3); }
.wait-match { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); padding-block: var(--s2); border-block-end: 1px solid var(--line-soft); }
.wait-match:last-child { border-block-end: 0; }
.wait-match .grow { flex: 1 1 200px; min-width: 0; }
.wait-match .s { color: var(--muted); font-size: var(--fs-small); }
