/* 📅 إدارة السنتر والحصص — فاتح/داكن عبر متغيرات app.css */

/* the center module takes the whole screen width (no paper editor next to it) */
body[data-tab=teachers]:not(.app-shell) .layout { grid-template-columns: 1fr; }
body[data-tab=teachers]:not(.app-shell) .layout > .work { display: none; }
body[data-tab=teachers]:not(.app-shell) .side { border: 0; padding: 16px 20px; }
body[data-tab=teachers] #origPanel { display: none !important; }

.tch-app { max-width: 1400px; margin: 0 auto; }
.tch-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tch-head h3 { margin: 0 !important; font-size: 18px !important; color: var(--text) !important; }
.tch-nav { display: flex; flex-wrap: wrap; gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; }
.tch-nav button { border: 0; background: transparent; color: var(--muted); padding: 7px 11px; border-radius: 9px; font-weight: 600; font-size: 13px; }
.tch-nav button.on { background: var(--panel); color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.tch-body { min-height: 300px; }

.tch-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.tch-bar label { display: flex !important; align-items: center; gap: 6px; margin: 0 !important; }
.tch-bar input, .tch-bar select { display: inline-block !important; width: auto !important; margin: 0 !important; min-width: 150px; }
.tch-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.tch-card h4 { margin: 0 0 8px; font-size: 14px; }
.tch-warn { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 8%, var(--panel)); }
.tch-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.tch-steps { margin: 0 0 10px; padding-inline-start: 20px; line-height: 2; }

.tch-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tch-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center; }
.tch-stat span { font-size: 26px; grid-row: span 2; }
.tch-stat b { font-size: 18px; }
.tch-stat small { color: var(--muted); }

.tch-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); border-radius: 12px; overflow: hidden; }
.tch-table th, .tch-table td { padding: 8px 9px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: middle; }
.tch-table th { background: var(--bg); color: var(--muted); font-weight: 600; white-space: nowrap; }
.tch-table .nowrap { white-space: nowrap; }
.tch-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.tch-ok { color: #15803d; font-weight: 700; }
.tch-badwords { color: var(--danger); font-weight: 700; }
.tch-line { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.tch-line input { width: auto !important; display: inline-block !important; }
.tch-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 12px; max-height: 240px; overflow: auto; margin-bottom: 10px; }
.tch-checks small { color: var(--muted); }

.tch-days { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tch-days .chip { padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 12px; cursor: pointer; }
.tch-days .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* timetable */
.tch-tt, .tch-weekgrid { display: grid; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.tch-col { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px; min-height: 120px; }
.tch-col h5 { margin: 0 0 6px; font-size: 13px; color: var(--brand); display: flex; justify-content: space-between; }
.tch-col h5 small { color: var(--muted); }
.tch-lesson { display: block; width: 100%; text-align: start; border: 1px solid var(--border); border-inline-start: 4px solid var(--brand); background: var(--bg); color: var(--text);
  border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 13px; }
button.tch-lesson:hover { border-color: var(--brand); }
.tch-lesson.bad { background: color-mix(in srgb, var(--danger) 12%, var(--panel)); border-color: var(--danger); }
.tch-lesson b { display: block; font-size: 12px; }
.tch-lesson span { display: block; font-weight: 600; }
.tch-lesson small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }

/* attendance */
.att-b { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 8px; padding: 4px 9px; margin-inline-end: 3px; font-size: 12px; }
.att-b.on.p { background: #16a34a; border-color: #16a34a; color: #fff; }
.att-b.on.l { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.att-b.on.a { background: var(--danger); border-color: var(--danger); color: #fff; }

@media (max-width: 900px) {
  .tch-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tch-nav button { white-space: nowrap; }
  .tch-tt { grid-template-columns: repeat(7, minmax(150px, 1fr)) !important; }
  .tch-table { font-size: 12px; }
}

/* 🪪 student QR cards + 📷 check-in */
.qr-card-prev { text-align: center; }
.qr-card-prev img { width: 100%; max-width: 420px; border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.18); }
.qr-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.qr-links a { text-decoration: none; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.qr-thumb { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 12px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.qr-thumb img { width: 100%; border-radius: 8px; aspect-ratio: 85.6 / 54; background: #fff; }
.qr-in .qr-big { width: 100%; font-size: 18px; padding: 14px; margin: 6px 0 10px; }
.qr-stage { position: relative; margin: 10px auto; max-width: 460px; border-radius: 14px; overflow: hidden; background: #000; }
.qr-stage video { width: 100%; display: block; }
.qr-stage .qr-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.qr-stage .qr-frame i { width: 58%; aspect-ratio: 1; border: 3px solid #2dd4bf; border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); position: relative; overflow: hidden; }
.qr-stage .qr-frame i::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #2dd4bf, transparent); animation: qrSweep 1.6s ease-in-out infinite alternate; }
@keyframes qrSweep { from { top: 4%; } to { top: 94%; } }
.qr-stage.hit .qr-frame i { border-color: #22c55e; }
.qr-stage > button { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.9); color: #111; }
.qr-res { border: 2px solid var(--border); border-radius: 14px; padding: 12px; margin-top: 10px; display: grid; gap: 6px; }
.qr-res.ok { border-color: #16a34a; background: rgba(22,163,74,.07); }
.qr-res.dup { border-color: #0ea5e9; background: rgba(14,165,233,.07); }
.qr-res.warn { border-color: #f59e0b; background: rgba(245,158,11,.08); }
.qr-res.bad { border-color: var(--danger); background: rgba(220,38,38,.07); }
.qr-res small { display: block; color: var(--muted); }
.qr-res-top { display: flex; align-items: center; gap: 10px; }
.qr-res-top b { font-size: 18px; }
.qr-av { width: 44px; height: 44px; border-radius: 50%; background: #0f766e; color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700; flex: none; }
.qr-mark { margin-inline-start: auto; font-weight: 700; font-size: 15px; }
.qr-res-row { display: flex; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
