/* =====================================================================
   مركز القيادة (لوحة مدير المدرسة) — شبكة 12 عموداً مرنة لكل الشاشات
   ===================================================================== */
.cc { max-width: 1920px; margin: 0 auto; padding: 0 8px 40px; display: grid; gap: 22px;
      grid-template-columns: repeat(12, minmax(0, 1fr)); }
.cc > * { min-width: 0; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; }

.cc-panel { background: var(--glass-bg); box-shadow: var(--card-shadow); border: 1px solid var(--glass-border); border-radius: 24px; padding: 22px 24px; position: relative; }
.cc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.cc-panel-head h2 { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
.cc-panel-head h2 i { color: var(--accent-color); font-size: .95rem; }
.cc-link { color: var(--text-muted); text-decoration: none; font-size: .82rem; font-weight: 700; }
.cc-link:hover { color: var(--accent-color); }

/* ---------- الشريط العلوي ---------- */
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
          background: var(--header-bg); box-shadow: var(--card-shadow);
          border: 1px solid var(--glass-border); border-radius: 26px; padding: 24px 28px; }
.cc-top h1 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 800; color: var(--text-main); }
.cc-top .cc-sub { color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .88rem; }
.cc-top .cc-sub span { display: inline-flex; align-items: center; gap: 6px; }
.cc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cc-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: .88rem;
          text-decoration: none; color: var(--text-main); background: rgba(255,255,255,.05); border: 1px solid var(--glass-border); transition: .2s; white-space: nowrap; }
.cc-btn:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); }
.cc-btn.primary { background: linear-gradient(135deg, var(--accent-color), var(--btn-primary, #4834d4)); border-color: transparent; color: #fff; box-shadow: 0 10px 22px rgba(var(--accent-rgb), .28); }

/* ---------- شريط المؤشرات ---------- */
.cc-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.cc-kpi { background: var(--glass-bg); box-shadow: var(--card-shadow); border: 1px solid var(--glass-border); border-radius: 22px; padding: 18px 20px; text-decoration: none;
          display: flex; flex-direction: column; gap: 8px; min-height: 128px; transition: .2s; position: relative; overflow: hidden; }
a.cc-kpi:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), .4); }
.cc-kpi .k-label { color: var(--text-muted); font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cc-kpi .k-label i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: .8rem;
                     color: var(--c, var(--accent-color)); background: color-mix(in srgb, var(--c, var(--accent-color)) 15%, transparent); }
.cc-kpi .k-value { font-family: 'Outfit', sans-serif; font-size: 2.1rem; font-weight: 800; color: var(--text-main); line-height: 1; }
.cc-kpi .k-value small { font-size: .95rem; color: var(--text-muted); font-weight: 600; }
.cc-kpi .k-foot { color: var(--text-muted); font-size: .76rem; margin-top: auto; }
.cc-kpi .k-foot b { color: var(--text-main); }
.cc-kpi.hero { flex-direction: row; align-items: center; gap: 16px; }
.cc-kpi .k-alert { color: #ef4444; font-weight: 800; }

/* ---------- الوكالات ---------- */
.cc-depts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cc-dept { --c: var(--accent-color); border: 1px solid var(--glass-border); border-radius: 20px; padding: 18px; background: var(--card-inner);
           border-top: 3px solid var(--c); display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; transition: .2s; }
a.cc-dept:hover { background: var(--card-inner-hover); }
.cc-dept-head { display: flex; align-items: center; gap: 14px; }
.cc-dept-head .d-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); flex-shrink: 0; }
.cc-dept-head h3 { margin: 0; font-size: .98rem; color: var(--text-main); }
.cc-dept-head .d-sub { font-size: .76rem; color: var(--text-muted); }
.cc-dept-head .score-ring { margin-inline-start: auto; }
.cc-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cc-meter .m-top { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-muted); margin-bottom: 5px; }
.cc-meter .m-top b { color: var(--text-main); font-family: 'Outfit', sans-serif; }
.cc-children { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-child { font-size: .72rem; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); color: var(--text-muted); white-space: nowrap; }
.cc-child b { color: var(--lc, var(--text-main)); margin-inline-start: 4px; font-family: 'Outfit', sans-serif; }

/* ---------- يحتاج انتباهك ---------- */
.cc-feed { display: flex; flex-direction: column; gap: 10px; }
.cc-feed a { --c: #94a3b8; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none;
             background: color-mix(in srgb, var(--c) 8%, transparent); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); color: var(--text-main); font-size: .88rem; transition: .2s; }
.cc-feed a:hover { transform: translateX(-3px); }
.cc-feed a i { color: var(--c); width: 18px; text-align: center; }
.cc-feed .sev-danger { --c: #ef4444; } .cc-feed .sev-warn { --c: #f59e0b; } .cc-feed .sev-info { --c: #3b82f6; } .cc-feed .sev-muted { --c: #94a3b8; }
.cc-allgood { text-align: center; padding: 26px 10px; color: var(--text-muted); }
.cc-allgood i { font-size: 2rem; color: #10b981; display: block; margin-bottom: 8px; }

/* ---------- المخطط وخط سير المهام ---------- */
.cc-chart { position: relative; height: 230px; }
.cc-pipe { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: transparent; margin: 6px 0 12px; }
.cc-pipe span { display: block; height: 100%; min-width: 4px; }
.cc-pipe span:first-child { border-radius: 99px 0 0 99px; } .cc-pipe span:last-child { border-radius: 0 99px 99px 0; }
.cc-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .78rem; color: var(--text-muted); }
.cc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cc-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.cc-legend b { color: var(--text-main); font-family: 'Outfit', sans-serif; }
.cc-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.cc-evstats { display: grid; gap: 10px; }
.cc-evstat { --c: var(--accent-color); display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px;
             background: rgba(255,255,255,.03); border-inline-start: 3px solid var(--c); font-size: .85rem; color: var(--text-muted); }
.cc-evstat b { font-family: 'Outfit', sans-serif; font-size: 1.35rem; color: var(--text-main); }

/* ---------- القوائم الصغيرة ---------- */
.cc-list { display: flex; flex-direction: column; gap: 8px; }
.cc-list a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; text-decoration: none; color: inherit;
             background: var(--card-inner); border: 1px solid transparent; transition: .2s; }
.cc-list a:hover { border-color: var(--glass-border); background: var(--card-inner-hover); }
.cc-list .l-date { width: 46px; flex-shrink: 0; text-align: center; border-radius: 12px; padding: 6px 0; background: rgba(var(--accent-rgb), .12); }
.cc-list .l-date b { display: block; font-family: 'Outfit', sans-serif; font-size: 1.1rem; color: var(--text-main); line-height: 1.1; }
.cc-list .l-date span { font-size: .65rem; color: var(--text-muted); }
.cc-list .l-main { flex: 1; min-width: 0; }
.cc-list .l-title { color: var(--text-main); font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-list .l-sub { color: var(--text-muted); font-size: .75rem; margin-top: 2px; }
.cc-empty { color: var(--text-muted); font-size: .85rem; padding: 12px 4px; }

/* ---------- الخدمات حسب الهيكل ---------- */
.cc-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cc-svc-group { --c: var(--accent-color); border-radius: 20px; padding: 16px; background: var(--card-inner); border: 1px solid var(--glass-border); }
.cc-svc-group h3 { margin: 0 0 12px; font-size: .9rem; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.cc-svc-group h3 i { color: var(--c); }
.cc-svc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; text-decoration: none; color: var(--text-main);
          font-size: .86rem; font-weight: 600; transition: .2s; }
.cc-svc:hover { background: color-mix(in srgb, var(--c) 12%, transparent); }
.cc-svc > i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); flex-shrink: 0; }
.cc-svc .s-badge { margin-inline-start: auto; font-size: .7rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; font-family: 'Outfit', sans-serif; }
.s-badge.tone-danger { background: rgba(239,68,68,.16); color: #f87171; } .s-badge.tone-warn { background: rgba(245,158,11,.16); color: #fbbf24; }
.s-badge.tone-info { background: rgba(59,130,246,.16); color: #60a5fa; }

/* ---------- أحدث الشواهد ---------- */
.cc-evgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cc-ev { border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; background: var(--card-inner); border: 1px solid var(--glass-border); transition: .2s; display: flex; flex-direction: column; }
.cc-ev:hover { transform: translateY(-3px); }
.cc-ev .e-img { aspect-ratio: 16/10; background: rgba(var(--accent-rgb), .08) center/cover no-repeat; display: grid; place-items: center; color: var(--accent-color); font-size: 1.6rem; }
.cc-ev .e-body { padding: 10px 12px; }
.cc-ev .e-title { font-size: .82rem; font-weight: 700; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-ev .e-sub { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }

.cc-committees { display: grid; gap: 8px; }
.cc-committee { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 13px; background: var(--card-inner); text-decoration: none; color: var(--text-main); font-size: .84rem; }
.cc-committee i { color: var(--c); width: 20px; text-align: center; }
.cc-committee span { margin-inline-start: auto; color: var(--text-muted); font-size: .74rem; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- الاستجابة ---------- */
@media (max-width: 1500px) {
    .cc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cc-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
    .span-8, .span-4, .span-6, .span-7, .span-5 { grid-column: span 12; }
    .cc-evgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .cc-depts { grid-template-columns: 1fr; }
    .cc-split { grid-template-columns: 1fr; }
    .cc-evgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .cc { gap: 16px; padding: 0 0 30px; }
    .cc-top { padding: 18px; }
    .cc-top h1 { font-size: 1.25rem; }
    .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .cc-kpi { min-height: 110px; padding: 14px; }
    .cc-kpi .k-value { font-size: 1.6rem; }
    .cc-kpi.hero { grid-column: span 2; }
    .cc-services { grid-template-columns: 1fr; }
    .cc-meters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cc-panel { padding: 16px; border-radius: 20px; }
    .cc-actions { width: 100%; }
    .cc-actions .cc-btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- شاشة العرض الحي (معاينة مصغّرة تعمل كفيديو) ---------- */
.cc-live { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: center; overflow: hidden; }
.cc-live-screen { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #060913;
                  border: 1px solid var(--glass-border); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(var(--accent-rgb), .12); transition: transform .3s; }
.cc-live-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.cc-live-screen:hover { transform: translateY(-3px) scale(1.01); }
.cc-live-play { position: absolute; left: 14px; bottom: 14px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff;
                background: rgba(var(--accent-rgb), .85); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .6); animation: ccPulse 2.2s infinite; opacity: .9; }
@keyframes ccPulse { 70% { box-shadow: 0 0 0 16px rgba(var(--accent-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); } }
.cc-live-text h2 { margin: 10px 0 8px; font-size: 1.5rem; color: var(--text-main); font-weight: 900; }
.cc-live-text p { color: var(--text-muted); line-height: 1.9; margin: 0 0 16px; font-size: .92rem; }
.cc-live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 800; color: #fca5a5; background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .3); }
.cc-live-badge i { font-size: .5rem; animation: ccBlink 1.2s infinite; }
@keyframes ccBlink { 50% { opacity: .2; } }
@media (max-width: 900px) { .cc-live { grid-template-columns: 1fr; } }
