/* التعديل المباشر داخل الجداول (مثل الخلايا في الجداول الإلكترونية، لكن بقوائم مضبوطة) */
.cell-edit {
  position: relative; display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 3px 6px; margin: -3px -6px; border-radius: 8px; cursor: pointer;
  transition: background .12s, box-shadow .12s, opacity .12s;
}
.cell-edit:hover { background: var(--hover); }
.cell-edit:focus-within { background: var(--surface); box-shadow: var(--ring); }
.cell-edit .caret { display: inline-flex; color: var(--ink-3); opacity: 0; transition: opacity .12s; }
.cell-edit:hover .caret, .cell-edit:focus-within .caret { opacity: 1; }
.cell-edit > select, .cell-edit > input[type=date] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  border: 0; margin: 0; padding: 0; font-size: 14px; appearance: none;
}
.cell-edit.saving { opacity: .5; pointer-events: none; }

.cell-text {
  display: block; min-height: 24px; padding: 3px 6px; margin: -3px -6px; border-radius: 8px; cursor: text;
  line-height: 1.5; transition: background .12s;
}
.cell-text:hover { background: var(--hover); }
.cell-text:focus-visible { box-shadow: var(--ring); }
.cell-text.empty-val { color: var(--ink-3); }
.cell-input {
  width: 100%; min-width: 160px; height: 32px; padding: 0 9px; font: inherit; color: var(--ink);
  background: var(--field-bg); border: 1px solid var(--accent); border-radius: 8px; box-shadow: var(--ring); outline: 0;
}

.tbl tbody tr.flash td { animation: cell-flash 1.4s ease-out; }
@keyframes cell-flash { 0%, 30% { background: var(--flash); } 100% { background: transparent; } }

/* شاشة الدخول */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 28px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-2); text-align: center; }
.login-card h1 { font-size: 20px; margin: 6px 0 0; }
.login-card p { margin: 0 0 8px; color: var(--ink-3); font-size: 14px; }
.login-card .input, .login-card .btn { width: 100%; height: 44px; }
.login-err { min-height: 20px; color: var(--orange-ink); font-size: 13px; }
.sidebar-foot .logout { margin-top: 6px; color: var(--ink-3); }

/* ─────────── التقارير ─────────── */
.rep-period { min-width: 190px; text-align: center; font-weight: 600; }
.rep-today { margin-bottom: 16px; }
.rep-today-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rep-who { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 8px; border-radius: 99px; border: 1px dashed var(--line-2); background: transparent; color: var(--ink-3); cursor: pointer; font: inherit; font-size: 13.5px; }
.rep-who:hover { border-color: var(--line-3); color: var(--ink-2); }
.rep-who.on { border-style: solid; border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok-ink); }
.rep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.rep { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 20px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rep:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.rep-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.rep-h .muted { font-size: 12.5px; }
.rep-edit { margin-inline-start: auto; color: var(--ink-4); opacity: 0; transition: opacity .15s; }
.rep:hover .rep-edit { opacity: 1; }
.rep-sum { margin: 10px 0 0; white-space: pre-line; color: var(--ink); line-height: 1.75; }
.rep-items { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rep-items li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13.5px; padding: 6px 10px; background: var(--surface-2); border-radius: var(--r-sm); }
.rep-items li > span { color: var(--ink-2); flex-basis: 100%; }
.rep-task { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent-ink); cursor: pointer; text-align: start; }
.rep-task:hover { text-decoration: underline; }
.rep-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.rep-block { color: var(--warn-ink); }
.wk-sec { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); }
.wk-sec-h { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-weight: 600; margin-bottom: 8px; }
.wk-sec-h .muted { font-weight: 400; font-size: 12.5px; }
.wk-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 92px minmax(0, 1.7fr); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.wk-row:first-child { border-top: 0; }
.wk-t { display: flex; flex-direction: column; min-width: 0; }
.wk-t b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-t .muted { font-size: 12px; }
@media (max-width: 720px) { .wk-row { grid-template-columns: 1fr 92px; } .wk-row .wk-n { grid-column: 1 / -1; } .rep-list { grid-template-columns: 1fr; } }

/* التقرير الشهري */
.month-report { padding: 24px; }
.mr-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.mr-head h2 { font-size: 20px; margin: 0 0 2px; }
.mr-head .muted { font-size: 13px; }
.mr-h { font-size: 16px; margin: 22px 0 10px; }
.mr-member { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; break-inside: avoid; }
.mr-mh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mr-chips { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.mr-chips span { background: var(--surface-2); border-radius: 99px; padding: 2px 10px; }
.mr-chips b { color: var(--ink); font-weight: 600; }
.mr-chips .alert b { color: var(--danger-ink); }
.mr-sub { margin-top: 8px; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.mr-weeks { margin: 8px 0 0; padding-inline-start: 18px; font-size: 13.5px; line-height: 1.75; }
.mr-tbl { margin-top: 4px; }
@media (max-width: 900px) { .month-report { padding: 16px; } }
@media print {
  .no-print, .scrim, .drawer, .toasts { display: none !important; }
  .month-report { border: 0; box-shadow: none; padding: 0; }
  .content { padding: 0 !important; max-width: none; }
}

/* شارة الجهة الطالبة */
.org-badge { display: inline-grid; place-items: center; flex: none; border-radius: 6px; object-fit: contain; vertical-align: middle; }
.org-mono { background: var(--surface-3); color: var(--ink-2); font-weight: 600; border-radius: 50%; line-height: 1; }
