/* 1.9.5 — التعديل الجماعي للحضور، إجازة / عن بُعد، التقويم الدراسي */
.bulk{width:100%;border-collapse:collapse}
.bulk th,.bulk td{padding:8px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
.bulk thead th{position:sticky;top:0;background:var(--surface);font-size:13px;color:var(--muted);text-align:start}
.bulk th.n,.bulk td.n{text-align:center;width:84px}
.bk-all{display:inline-flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer}
.bk-cb,.bk-all input{width:22px;height:22px;accent-color:var(--brand);cursor:pointer}
.bulk tbody tr:has(.bk-cb:checked){background:var(--gold-soft)}
.bk-quick{margin-top:8px}
#bulkPanel #bkForm{margin-top:14px}

.dayoff-kinds{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:6px 0 14px}
.kind{display:flex;flex-direction:column;align-items:center;gap:2px;padding:18px 12px;border:2px solid var(--line);border-radius:var(--r);background:var(--surface);color:var(--ink);font:inherit;cursor:pointer;min-height:76px}
.kind b{font-family:var(--f-display);font-size:20px}
.kind small{color:var(--muted)}
.kind[aria-pressed="true"]{border-color:var(--brand);background:var(--gold-soft);box-shadow:0 0 0 2px var(--gold) inset}

.cal-nav{display:flex;gap:8px;justify-content:space-between;margin-bottom:10px}
.cal-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:13px;color:var(--muted);margin-bottom:10px}
.cal-legend i{display:inline-block;width:12px;height:12px;border-radius:3px;margin-inline-end:6px;vertical-align:-1px;border:1px solid var(--line)}
.cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.cal-h{font-style:normal;text-align:center;font-size:12px;color:var(--muted);padding:4px 0}
.cal-pad{min-height:56px}
.cal-day{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:56px;padding:4px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}
.cal-day b{font-size:16px;line-height:1.2}
.cal-day small{font-size:11px;color:var(--muted)}
.d-school{background:var(--surface)}
.d-weekend{background:var(--bg);color:var(--muted)}
.d-holiday{background:var(--bad-bg)}
.d-remote{background:var(--info-bg)}
.cal-legend .d-school{background:var(--surface)}
.cal-day.is-today{outline:2px solid var(--gold);outline-offset:1px}
.cal-day.is-sel{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand) inset}
.cal-act{margin-top:14px;padding:12px;border:1px solid var(--line);border-radius:var(--r);background:var(--bg)}
.cal-act .actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
@media (max-width:520px){.cal-grid{gap:4px}.cal-day{min-height:50px}.bulk th.n,.bulk td.n{width:62px}}

/* ---------- الشريط العلوي ---------- */
.daybar{background:linear-gradient(135deg,var(--brand) 0%,var(--brand-2) 100%);color:var(--on-brand,#fff);position:relative;overflow:hidden;border-bottom:3px solid var(--gold)}
.daybar::before{content:"";position:absolute;inset:auto 0 0 0;height:34px;opacity:.16;pointer-events:none;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'><path d='M0 22 C150 2 300 38 450 20 S750 4 900 22 S1100 36 1200 18 L1200 40 L0 40 Z' fill='%23C9A96E'/></svg>") center/100% 100% no-repeat}
.db-in{position:relative;padding-block:12px;display:flex;flex-direction:column;gap:10px}
.db-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.db-card{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid rgba(201,169,110,.38);border-radius:14px;background:rgba(255,255,255,.07);min-width:0}
.db-ic{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--gold);color:#2B2A5E}
.db-card>div{min-width:0}
.db-card b{display:block;font-size:17px;line-height:1.35;font-weight:700;overflow-wrap:anywhere}
.db-card small{display:block;font-size:13px;line-height:1.4;color:#e6e3f5;overflow-wrap:anywhere}
.db-clock b{font-size:22px;letter-spacing:0}
.db-clock b i{font-style:normal;font-size:14px;opacity:.8}
.db-clock b em{font-style:normal;font-size:14px;color:var(--gold)}
.daybar[data-kind="holiday"] .db-clock .db-ic,.daybar[data-kind="weekend"] .db-clock .db-ic{background:#e6e3f5}
@media (max-width:900px){.db-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:380px){.db-card{padding:8px}.db-ic{width:34px;height:34px}.db-card b{font-size:15px}.db-clock b{font-size:19px}}
@media print{.daybar,.navbar{display:none}}

/* ---------- 1.9.6: شريط الأقسام بروح التقويم (كحلي وذهبي) بحجم أصغر + لوحة المؤشرات ---------- */
.navbar{display:grid;gap:8px;margin:0 0 8px;padding:8px 10px;border-radius:16px;color:#fff;border:1px solid rgba(201,169,110,.55);background:linear-gradient(135deg,var(--brand) 0%,var(--brand-2,var(--brand)) 100%);box-shadow:0 2px 0 var(--gold)}
.nv-row{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.nv-row::-webkit-scrollbar{display:none}
.nv{position:relative;flex:none;display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:4px 14px 4px 8px;border:1px solid rgba(201,169,110,.38);border-radius:12px;background:rgba(255,255,255,.07);color:#fff;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer;white-space:nowrap}
.nv-i{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:var(--gold);color:#2B2A5E}
.nv-i svg{width:17px;height:17px;display:block}
.nv:hover{background:rgba(201,169,110,.22)}
.nv:focus-visible,.nv-sub .tab:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.nv.on{background:var(--gold);color:#2B2A5E;border-color:var(--gold)}
.nv.on .nv-i{background:#2B2A5E;color:var(--gold)}
.nv .badge{position:static;margin-inline-start:2px;min-width:20px;height:20px;line-height:20px;font-size:12px;padding:0 6px}
.nv-sub{padding:0;gap:6px}
.nv-sub .tab{min-height:34px;padding:4px 14px;font-size:13px;border-radius:10px;background:rgba(255,255,255,.07);color:#e6e3f5;border:1px solid rgba(201,169,110,.38)}
.nv-sub .tab:hover{background:rgba(201,169,110,.22)}
.nv-sub .tab[aria-current="page"]{background:var(--gold);color:#2B2A5E;border-color:var(--gold);box-shadow:none}
.nv-sub .tab .badge{position:static}
.navbar>.btn.ghost{justify-self:start;color:#fff;border-color:rgba(201,169,110,.5)}
@media (min-width:760px){.nv-row{flex-wrap:wrap;overflow:visible}}

.dash{--c-main:var(--brand);--c-ok:#1f8a5b;--c-late:#c98500;--c-abs:#c8402f;--c-exc:#3b6fd4;--c-pend:#b9b8c8;display:grid;gap:16px}
:root[data-theme="dark"] .dash{--c-main:#8fa8ff;--c-ok:#199e70;--c-late:#c98500;--c-abs:#cf4a4a;--c-exc:#3987e5;--c-pend:#5a5a75}
.dash-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.dash-grid.five{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
.dash .stat.tile{display:grid}
.dash .stat.tile.sm{padding:9px 12px}
.dash .stat.tile.sm b{font-size:20px}
.dash .stat.tile.sm .ti{width:28px;height:28px;border-radius:9px;margin-bottom:2px}
.dash .stat.tile.sm .ti svg{width:17px;height:17px}
.dash .stat.tile:not(button){cursor:default}
.dash .stat.tile:not(button):hover{border-color:var(--line)}
.dash .stat.tile:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.viz-row{display:grid;gap:12px;margin-top:12px}
.viz-row.r3{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr) minmax(0,1.6fr)}
.viz-row.r2{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.viz-row.r1{grid-template-columns:minmax(0,1fr)}
.vcard{background:var(--surface);border:1px solid var(--line);border-radius:var(--r,14px);padding:12px 14px;min-width:0}
.vcard h3{font-size:14px;margin:0 0 8px;color:var(--ink)}
.viz{display:block;width:100%;height:auto;max-width:100%}
.viz-ring{max-width:170px;margin-inline:auto}
.viz-donut{max-width:150px;flex:none}
.viz-big{font-size:28px;font-weight:700;fill:var(--ink);font-family:inherit}
.viz-mid{font-size:20px;font-weight:700;fill:var(--ink);font-family:inherit}
.viz-val{font-size:11px;font-weight:700;fill:var(--ink);font-family:inherit}
.viz-ax{font-size:10px;fill:var(--muted);font-family:inherit}
.viz-hit{transition:opacity .15s}
.viz-hit:hover{opacity:.78}
.dn{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:center}
.viz-leg{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:13px;color:var(--ink)}
.viz-leg li{display:flex;align-items:center;gap:8px}
.viz-leg li b{margin-inline-start:auto;padding-inline-start:12px}
.viz-leg i{flex:none;width:12px;height:12px;border-radius:4px}
.viz-leg.row{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:6px}
.cbars{display:grid;gap:7px}
.cb-row{display:grid;grid-template-columns:minmax(96px,1.3fr) minmax(0,2fr) 40px;align-items:center;gap:8px;font-size:12.5px}
.cb-n{color:var(--ink);line-height:1.35;overflow-wrap:anywhere}
.cb-bar{display:flex;gap:2px;height:14px;background:var(--line);border-radius:5px;overflow:hidden}
.cb-bar i{display:block;min-width:3px;border-radius:3px}
.cb-p{text-align:end;color:var(--ink)}
.mini{display:flex;justify-content:center;gap:16px;margin-top:8px;font-size:13px;color:var(--muted)}
.mini b{color:var(--ink);font-size:15px}
.viz-table{margin-top:10px;font-size:13px}
.viz-table summary{cursor:pointer;color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:900px){.viz-row.r3,.viz-row.r2{grid-template-columns:minmax(0,1fr)}}
@media (max-width:600px){.vcard{overflow-x:auto}.viz-line,.viz-pairs{min-width:600px}}
@media (prefers-reduced-motion:reduce){.viz-hit{transition:none}}

/* مؤشرات الرئيسية: لا تستعمل .loading كي لا تُسقطها مهلة ٨ ثوانٍ العامة؛ البيانات قد تتأخر أكثر في أول طلب */
.dwait { min-height: 84px; border-radius: 12px; display: grid; place-items: center; color: var(--muted, #6b6b85); font-size: .9rem;
  background: linear-gradient(90deg, rgba(120,120,160,.08) 25%, rgba(120,120,160,.16) 50%, rgba(120,120,160,.08) 75%); background-size: 200% 100%; animation: dwaitSh 1.4s linear infinite; }
@keyframes dwaitSh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .dwait { animation: none; } }
