/* v4.7 — المتابعة الحية والسجلات الإشرافية */
.nav a.nav-live{position:relative;background:rgba(255,255,255,.1)}
.nav a .live-dot{width:8px;height:8px;border-radius:50%;background:#4ade80;margin-inline-start:auto;box-shadow:0 0 0 0 rgba(74,222,128,.7);animation:livePulse 1.8s infinite}
@keyframes livePulse{0%{box-shadow:0 0 0 0 rgba(74,222,128,.6)}70%{box-shadow:0 0 0 8px rgba(74,222,128,0)}100%{box-shadow:0 0 0 0 rgba(74,222,128,0)}}
.live-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:700;color:#0f7a45;background:#e8f7f0;border-radius:999px;padding:4px 10px;vertical-align:middle}
.live-badge i{width:8px;height:8px;border-radius:50%;background:#16a34a;animation:livePulse 1.8s infinite}
.live-date{border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff}
.period-strip{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 10px;scrollbar-width:thin}
.period-chip{flex:0 0 auto;border:1px solid var(--line);background:#fff;border-radius:14px;padding:8px 14px;display:grid;gap:2px;text-align:center;min-width:104px;transition:.15s}
.period-chip b{font-size:13px;color:var(--ink)}.period-chip small{font-size:11px;color:var(--muted);direction:ltr}
.period-chip.on{background:var(--brand);border-color:var(--brand)}.period-chip.on b,.period-chip.on small{color:#fff}
.live-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:4px 0 14px}
.live-kpis.mini{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));margin:10px 0}
.live-kpi{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px 14px;display:grid;gap:2px;border-top:4px solid #d8dde2}
.live-kpi b{font-size:26px;color:var(--ink);line-height:1.2}.live-kpi span{font-size:11px;color:var(--muted)}
.live-kpi.ok{border-top-color:#16a34a}.live-kpi.ok b{color:#0f7a45}
.live-kpi.warn{border-top-color:#e0a106}.live-kpi.warn b{color:#925900}
.live-kpi.danger{border-top-color:var(--rb-500,#3143a5)}.live-kpi.danger b{color:var(--rb-600,#283686)}
.live-kpi.info{border-top-color:#2f7bbf}.live-kpi.info b{color:#276399}
.live-tools{margin-bottom:14px;padding:12px}
.seg{display:inline-flex;background:#f3f4f6;border-radius:12px;padding:3px;gap:2px;flex-wrap:wrap}
.seg button{border:0;background:transparent;padding:7px 12px;border-radius:9px;font-size:12px;font-weight:650;color:#4b5563}
.seg button.on{background:#fff;color:var(--brand);box-shadow:0 1px 4px rgba(0,0,0,.08)}
.live-search{border:1px solid var(--line);border-radius:10px;padding:9px 12px;min-width:240px;flex:1;max-width:380px;background:#fff}
.live-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px;margin-bottom:16px}
.live-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:13px;display:flex;flex-direction:column;gap:8px;border-inline-start:5px solid #d8dde2;box-shadow:0 2px 10px rgba(0,0,0,.03)}
.live-card.st-recorded{border-inline-start-color:#16a34a}
.live-card.st-pending{border-inline-start-color:#e0a106;background:#fafafc}
.live-card.st-uncovered,.live-card.st-reported{border-inline-start-color:var(--rb-500,#3143a5);background:#fff7f6}
.live-card.st-substitute{border-inline-start-color:#2f7bbf}
.live-card.st-free{opacity:.7}
.live-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.live-card-head strong{font-size:22px;color:var(--brand);letter-spacing:.3px}
.live-lesson{display:flex;flex-direction:column;gap:4px;font-size:12px}
.live-lesson>b{font-size:13px}
.t-state{display:flex;justify-content:space-between;gap:6px;font-size:12px;padding:4px 8px;border-radius:8px;background:#f6f7f8}
.t-state small{font-size:10px;font-weight:700;white-space:nowrap}
.t-state.ok small{color:#0f7a45}.t-state.warn small{color:#925900}.t-state.danger small{color:var(--rb-600,#283686)}
.live-subs{font-size:12px;color:#276399;background:#edf5fd;border-radius:8px;padding:5px 8px}
.live-rep{font-size:12px;color:var(--rb-600,#283686);font-weight:700}.live-rep.done{color:#0f7a45}
.live-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:auto}
.live-empty{grid-column:1/-1;background:#f2fbf7;border:1px dashed #bee7d4;border-radius:16px;color:#0f7a45;font-weight:700}
.live-bottom .timeline-item.open{border-right-color:var(--rb-500,#3143a5);background:#fff7f6}
.check-list{display:grid;gap:6px}.card-line{border:1px solid var(--line);border-radius:10px;padding:9px 10px;background:#fff}
.alert-results{display:grid;gap:12px;margin-top:12px}
.alert-res{display:grid;grid-template-columns:minmax(160px,.8fr) 2fr auto;gap:10px;align-items:start;border:1px solid var(--line);border-radius:14px;padding:12px}
.alert-msg{width:100%;min-height:92px;border:1px solid #d7dce1;border-radius:10px;padding:8px;font:inherit;font-size:12px}
.sub-list{display:grid;gap:6px;max-height:52vh;overflow:auto;margin-top:10px}
.sub-item{display:grid;text-align:right;gap:2px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 11px}
.sub-item:hover{border-color:var(--brand);background:#fffaf7}.sub-item small{color:var(--muted);font-size:11px}
.sub-item.busy{opacity:.45;cursor:not-allowed}
.live-dash{margin:0 0 14px;border-inline-start:5px solid var(--brand)}
.live-dash-row{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.live-dash-row small{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.live-dash-stats{display:flex;gap:8px;flex-wrap:wrap}
.live-dash-stats span{font-size:12px;font-weight:700;border-radius:999px;padding:5px 11px;background:#f3f4f6}
.live-dash-stats .ok{background:#e8f7f0;color:#0f7a45}.live-dash-stats .warn{background:#fff4df;color:#925900}.live-dash-stats .danger{background:#fff0ef;color:var(--rb-600,#283686)}
/* السجلات الإشرافية */
.sup-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px}
.sup-tabs button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 15px;font-size:12px;font-weight:700;color:#4b5563}
.sup-tabs button.on{background:var(--brand);border-color:var(--brand);color:#fff}
.sup-grid{align-items:start}
.insight-list{display:grid;gap:8px;max-height:70vh;overflow:auto;padding-inline-end:2px}
.insight{display:flex;justify-content:space-between;gap:10px;border:1px solid var(--line);border-radius:13px;padding:10px 12px;background:#fff}
.insight-main{display:grid;gap:4px;min-width:0}.insight-main small{color:var(--muted);font-size:11px}
.insight-act{display:flex;flex-direction:column;gap:6px}
.hint{font-size:11px;color:#6b4e16;background:#fff9ec;border-radius:8px;padding:5px 8px}
.meter{height:6px;background:#edf0f2;border-radius:999px;overflow:hidden;max-width:260px}
.meter i{display:block;height:100%;background:linear-gradient(90deg,var(--rb-500,#3143a5),#e0a106 50%,#16a34a)}
.count-pill{display:inline-grid;place-items:center;min-width:32px;height:26px;padding:0 8px;border-radius:999px;background:#f0f2f4;font-weight:800}
.count-pill.mid{background:#fff4df;color:#925900}.count-pill.hi{background:#fff0ef;color:var(--rb-600,#283686)}
.link{cursor:pointer;color:var(--brand)}.link:hover{text-decoration:underline}
.msg-cell{max-width:420px;white-space:pre-wrap;font-size:11px;line-height:1.7}
.sup-filters{grid-template-columns:2fr repeat(4,minmax(0,1fr))}
.person-head h3{margin:0 0 4px}
@media (max-width:1100px){.live-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.sup-grid{grid-template-columns:1fr}}
@media (max-width:700px){
  .live-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .live-grid{grid-template-columns:1fr}
  .live-search{min-width:0;max-width:none;width:100%}
  .live-tools .toolbar{flex-direction:column;align-items:stretch}
  .seg{overflow-x:auto;flex-wrap:nowrap}.seg button{white-space:nowrap}
  .alert-res{grid-template-columns:1fr}
  .sup-filters{grid-template-columns:1fr 1fr}
  .insight{flex-direction:column}.insight-act{flex-direction:row}
}
@media print{.live-tools,.period-strip,.live-actions,.sup-tabs{display:none!important}}
/* إصلاحات تخطيط عامة (v4.7) */
.sub-workspace>*,.grid>*{min-width:0}
@media (max-width:1100px){.sub-workspace{grid-template-columns:minmax(0,1fr)!important}}
