@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
  /* الهوية «ADH Teal» — الأسماء القديمة أُبقيت كواجهة وقيمها الآن تركوازية */
  --accent: #108686;        /* التركوازي الأساسي — روابط/تركيز/حالات نشطة */
  --accent-dark: #0C6E6E;   /* الأغمق — hover/نصوص */
  --accent-soft: #EAF5F5;   /* غسول تركوازي فاتح */
  --brand-bright: #08B6B4;  /* التركوازي الوهّاج — CTA */
  --on-bright: #04262B;     /* نص داكن فوق الوهّاج */
  --brand-dark: #0E3A42;    /* التركوازي العميق */
  --bg: #F2F7F7;
  --card-bg: #ffffff;
  --border: #E4EDED;
  --text: #12333A;
  --muted: #5B7379;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(14, 58, 66, .06);
  --shadow-lg: 0 12px 40px rgba(14, 58, 66, .16);
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0; direction: rtl;
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
header.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); line-height: 0; }
/* لوكاب الشعار: المارك (C) + الوردمارك بالخط الرسمي (تركوازي على هيدر فاتح) */
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-lockup .mk { height: 34px; width: 34px; object-fit: contain; flex: none; }
.brand-lockup .wm { height: 30px; width: auto; object-fit: contain; flex: none; }
.brand-text { font-weight: 800; font-size: 15px; line-height: 1.25; display: flex; flex-direction: column; }
.brand-text small { font-weight: 600; font-size: 11px; color: var(--muted); }
@media (max-width: 480px) {
  .brand-lockup .mk { height: 30px; width: 30px; }
  .brand-lockup .wm { height: 26px; }
}
.topnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  padding: 7px 14px; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.topnav a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.topnav a.active { background: var(--accent); color: #fff; }
.user-chip {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3;
  padding: 4px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.user-name { font-weight: 700; font-size: 12.5px; }
.user-role { font-size: 11px; color: var(--accent-dark); font-weight: 600; }

main { max-width: 1160px; margin: 0 auto; padding: 24px 16px 48px; }

/* ── Cards & layout ──────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s;
  box-shadow: var(--shadow);
}
.card:hover { box-shadow: 0 6px 20px rgba(14, 58, 66, .12); transform: translateY(-1px); border-color: #C9DEDE; }
.card h3 { margin: 0 0 8px; font-size: 15.5px; font-weight: 700; }
.card .meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.badge {
  display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 999px;
  color: #fff; margin-inline-end: 6px; font-weight: 600;
}
.progress-bar { background: var(--border); border-radius: 999px; height: 7px; overflow: hidden; margin-top: 10px; }
.progress-bar > div { background: linear-gradient(90deg, var(--accent), var(--accent-dark)); height: 100%; border-radius: 999px; }
.stats-row { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.section-title {
  font-size: 16px; font-weight: 800; margin: 28px 0 14px; color: var(--text);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.section-title::before { content: ''; width: 4px; height: 18px; border-radius: 4px; background: var(--accent); }

/* ── Tables ──────────────────────────────────────────────────────────── */
table {
  width: 100%; border-collapse: collapse; background: var(--card-bg);
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow);
}
th, td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--border); font-size: 13px; }
tbody tr:last-child td { border-bottom: none; }
th { background: #EEF5F5; font-weight: 700; font-size: 12.5px; color: var(--muted); }
tbody tr:hover { background: #F7FBFB; }

/* ── Buttons & forms ─────────────────────────────────────────────────── */
button, .btn {
  background: var(--brand-bright); color: var(--on-bright); border: none; border-radius: 9px;
  padding: 8px 18px; font-size: 13px; cursor: pointer; font-family: inherit; font-weight: 700;
  transition: background .15s, box-shadow .15s;
}
button:hover, .btn:hover { background: #0A9C9A; color: var(--on-bright); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { background: #fff; color: var(--accent-dark); border: 1px solid var(--accent); }
button.secondary:hover { background: var(--accent-soft); }
button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }
input, select, textarea {
  border: 1.5px solid var(--border); border-radius: 9px; padding: 8px 12px; font-size: 13.5px;
  font-family: inherit; width: 100%; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 5px; font-weight: 700; }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(14, 58, 66, .45); display: flex;
  align-items: center; justify-content: center; z-index: 50; padding: 16px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal h3 { margin: 0 0 16px; font-size: 17px; font-weight: 800; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal-error {
  display: none; background: #FEF2F2; color: #b91c1c; border: 1px solid #fecaca;
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; font-weight: 600;
}
.modal-error.show { display: block; }

/* ── Segmented control (invite scope etc.) ───────────────────────────── */
.segmented { display: flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.segmented button {
  flex: 1; background: #fff; color: var(--muted); border: none; border-radius: 0;
  padding: 8px 10px; font-weight: 700; font-size: 12.5px;
}
.segmented button + button { border-inline-start: 1.5px solid var(--border); }
.segmented button.on { background: var(--accent); color: #fff; }
.segmented button:disabled { opacity: .45; }

/* ── Member picker (search + checkboxes + chips) ─────────────────────── */
.picker { border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.picker-search { border: none; border-bottom: 1.5px solid var(--border); border-radius: 0; padding: 9px 12px; }
.picker-search:focus { box-shadow: none; border-color: var(--border); border-bottom-color: var(--accent); }
.picker-list { max-height: 210px; overflow-y: auto; }
.picker-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid #EEF3F3; transition: background .1s;
}
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: var(--accent-soft); }
.picker-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; margin: 0; }
.picker-row .p-name { font-weight: 600; font-size: 13px; flex: 1; }
.picker-row .p-code { font-size: 11px; color: var(--muted); direction: ltr; }
.picker-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; object-fit: cover;
  background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.picker-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 12px; background: #F7FBFB; border-top: 1.5px solid var(--border); font-size: 12px;
}
.picker-count { color: var(--accent-dark); font-weight: 700; }
.picker-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ── توسيع الدعوة خارج الهيكل + ضيوف خارجيون بالبريد ───────────────────── */
.picker-scope-toggle {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px; cursor: pointer;
  font-size: 12.5px; color: var(--text-muted); font-weight: 400;
}
.picker-scope-toggle input { width: auto; margin: 0; }
.guest-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.guest-row .guest-email { flex: 1 1 55%; }
.guest-row .guest-name { flex: 1 1 30%; }
.guest-row .guest-remove {
  flex: 0 0 auto; color: #dc2626; text-decoration: none; font-size: 15px; line-height: 1;
}

/* ── Grouped member picker (by membership type) ───────────────────────── */
.picker-group + .picker-group { border-top: 1px solid var(--border); }
.picker-group-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer;
  background: var(--accent-soft); position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--border);
}
.picker-group-head input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; margin: 0; }
.picker-group-head .pg-label { font-weight: 800; font-size: 12.5px; color: var(--accent-dark); flex: 1; }
.picker-group-head .pg-count {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 0 8px; font-size: 10.5px; font-weight: 700; color: var(--muted); line-height: 1.7;
}
.picker-group-body .picker-row { padding-inline-start: 20px; }

/* ── Meetings page ───────────────────────────────────────────────────── */
.meeting-card { cursor: pointer; }
.meeting-when {
  display: flex; align-items: center; gap: 10px; margin: 8px 0;
  font-size: 12.5px; color: var(--text); font-weight: 600;
}
.meeting-when .m-date {
  background: var(--accent-soft); color: var(--accent-dark); border-radius: 8px;
  padding: 3px 10px; font-weight: 700;
}
.meeting-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.join-btn {
  display: inline-block; text-decoration: none; background: var(--success); color: #fff;
  border-radius: 8px; padding: 5px 14px; font-size: 12px; font-weight: 700;
}
.join-btn:hover { background: #15803d; color: #fff; }
.chip {
  display: inline-block; background: var(--bg); border: 1px solid var(--border);
  color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 600;
}
.invitee-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #EEF3F3; font-size: 13px; flex-wrap: wrap;
}
.invitee-row:last-child { border-bottom: none; }
.invitee-row .inv-name { font-weight: 600; flex: 1; min-width: 120px; }
.invitee-row select { width: auto; padding: 4px 8px; font-size: 12px; }
.rsvp-pill { font-size: 11px; border-radius: 999px; padding: 2px 9px; font-weight: 700; }
.rsvp-accepted { background: #DCFCE7; color: #15803d; }
.rsvp-declined { background: #FEE2E2; color: #b91c1c; }
.rsvp-pending { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

/* ── Misc ────────────────────────────────────────────────────────────── */
.tree-node { padding: 6px 0 6px 20px; border-right: 2px solid var(--border); margin-right: 8px; }
.empty-state { text-align: center; color: var(--muted); padding: 48px 0; font-size: 13.5px; }
a { color: var(--accent-dark); }
.link-btn {
  background: none; border: none; color: var(--accent-dark); cursor: pointer; padding: 0;
  font-size: 13px; text-decoration: underline; font-weight: 600;
}
.link-btn:hover { background: none; color: var(--accent); }

#toastHolder { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2937; color: #fff; border-radius: 10px; padding: 11px 18px; font-size: 13px;
  font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s; max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { background: #b91c1c; }
.toast-success { background: #15803d; }

/* ── Dashboard indicators bar (المرحلة 2) ────────────────────────────── */
.indicator-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; flex: 1; }
.indicator {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; box-shadow: var(--shadow);
}
.indicator .num { font-size: 20px; font-weight: 800; line-height: 1.2; }
.indicator .lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.indicator.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.indicator.clickable:hover { box-shadow: 0 6px 20px rgba(14, 58, 66, .12); transform: translateY(-1px); }
.indicator.alert { border-color: var(--accent); background: var(--accent-soft); }
.indicator.alert .num { color: var(--accent-dark); }
.dash-head { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; }
.dash-actions { display: flex; flex-direction: column; gap: 8px; justify-content: center; }

/* ── Project tabs row (المرحلة 2) ─────────────────────────────────────── */
.proj-tabs {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 18px 0 14px; padding-bottom: 4px; scrollbar-width: thin;
}
.proj-tab {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; white-space: nowrap;
  background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 11px;
  border-top: 3px solid var(--tab-color, var(--border));
  font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; font-family: inherit;
  transition: box-shadow .15s, color .15s, border-color .15s;
}
.proj-tab:hover { box-shadow: var(--shadow); color: var(--text); background: var(--card-bg); }
.proj-tab.active {
  color: var(--text); border-color: var(--tab-color, var(--accent));
  border-top-width: 3px; box-shadow: var(--shadow); background: #fff;
}
.proj-tab .tab-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tab-color, var(--accent)); flex: 0 0 auto; }
.tab-pill {
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 0 7px; color: var(--muted); font-weight: 700; font-size: 10.5px; line-height: 1.7;
}
.tab-pill.overdue { background: #FEE2E2; color: #b91c1c; border-color: #fecaca; }

/* ── Active project header inside the tab ─────────────────────────────── */
.proj-head {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  border-inline-start: 5px solid var(--tab-color, var(--border));
  padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 16px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between;
}
.proj-head .ph-info { flex: 1; min-width: 220px; }
.proj-head h2 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.proj-head .meta { margin: 0; }
.proj-head .ph-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ── Monday-style status board (task cards grouped by status) ─────────── */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.board-col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--col-color, var(--muted)); color: #fff; border-radius: 10px;
  padding: 7px 12px; font-weight: 800; font-size: 12.5px;
}
.board-col-head .cnt { background: rgba(255,255,255,.25); border-radius: 999px; padding: 0 8px; font-size: 11px; }
.board-col-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.board-col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 14px 0; }

.task-card { border-inline-start: 4px solid var(--task-color, var(--border)); }
.task-card h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; line-height: 1.5; }
.task-card .due-late { color: var(--danger); font-weight: 700; }
.task-card .progress-label { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 6px; }
.quick-edit { display: flex; gap: 6px; margin-top: 10px; align-items: center; cursor: default; }
.quick-edit select { flex: 1; padding: 5px 8px; font-size: 12px; min-width: 0; }
.quick-edit input { width: 62px; padding: 5px 6px; font-size: 12px; text-align: center; flex: 0 0 auto; }

.cancelled-fold { margin-top: 18px; }
.cancelled-fold summary {
  cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted);
  padding: 8px 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
}
.cancelled-fold[open] summary { border-radius: 10px 10px 0 0; }
.cancelled-fold .board-col-list {
  border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px;
  padding: 12px; background: #F7FBFB;
}

/* ── Notifications bell (م3) ──────────────────────────────────────────── */
.bell-wrap { position: relative; }
.bell-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; color: var(--muted); transition: color .15s, box-shadow .15s;
}
.bell-btn:hover { color: var(--text); box-shadow: var(--shadow); background: var(--card-bg); }
.bell-badge {
  position: absolute; top: -6px; inset-inline-start: -6px; background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 800; padding: 1px 5px; min-width: 18px;
  text-align: center; line-height: 1.5; box-shadow: 0 0 0 2px var(--bg);
}
.bell-panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: min(340px, 88vw);
  max-height: 60vh; overflow-y: auto; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(14, 58, 66, .16); z-index: 60;
}
.bell-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 13px;
  position: sticky; top: 0; background: var(--card-bg);
}
.bell-item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: var(--accent-soft); }
.bell-item.unread { background: var(--accent-soft); border-inline-start: 3px solid var(--accent); }
.bell-body { font-size: 12.5px; font-weight: 600; line-height: 1.7; }
.bell-time { font-size: 10.5px; color: var(--muted); margin-top: 3px; direction: ltr; text-align: end; }
.bell-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ── Color swatches (fixed palette picker) ────────────────────────────── */
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; padding: 0;
  cursor: pointer; flex: 0 0 auto; transition: transform .1s, border-color .1s;
}
.swatch:hover { transform: scale(1.12); background: inherit; }
.swatch.on { border-color: var(--text); box-shadow: inset 0 0 0 2px #fff; }
.swatch-none { background: linear-gradient(135deg, #fff 44%, var(--danger) 44%, var(--danger) 56%, #fff 56%); border: 2px solid var(--border); }
.swatch-none:hover { background: linear-gradient(135deg, #fff 44%, var(--danger) 44%, var(--danger) 56%, #fff 56%); }
.swatch-none.on { border-color: var(--text); }

@media (max-width: 1000px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .topbar-inner { gap: 10px; }
  .brand-text small { display: none; }
  .user-chip { display: none; }
  .field-row { flex-direction: column; gap: 0; }
  main { padding: 16px 12px 40px; }
  .board { grid-template-columns: 1fr; }
  .dash-actions { flex-direction: row; width: 100%; }
  .dash-actions button { flex: 1; min-height: 44px; }
  .indicator-bar { grid-template-columns: repeat(2, 1fr); }

  /* م4: أي جدول (التقارير، الحضور، سجل التدقيق…) → تمرير أفقي داخلي بدل الفيض/القصّ */
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

  /* م4: المودالات = ورقة سفلية بعرض كامل وأهداف لمس ≥44px */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .modal button, .modal select, .modal textarea,
  .modal input:not([type=hidden]):not([type=checkbox]) { min-height: 44px; }
  .modal .link-btn { min-height: 0; } /* الأزرار النصية داخل المنتقي تبقى مدمجة */

  /* م4: لمس أريَح للعناصر المدمجة */
  .swatch { width: 32px; height: 32px; }
  .quick-edit select, .quick-edit input { min-height: 38px; }

  /* م4: قائمة الجرس تتموضع ثابتة بعرض الشاشة بدل التعلق بحافة الزر */
  .bell-panel { position: fixed; top: 64px; inset-inline: 10px; width: auto; max-height: 70vh; }
}

/* ── منصة التقييم (evaluation.html) ─────────────────────────────────── */
.eval-tabs { max-width: 520px; margin-bottom: 18px; }
.rel-chip {
  display: inline-block; border-radius: 999px; padding: 1px 10px;
  font-size: 11px; font-weight: 700; border: 1px solid var(--border);
  background: var(--bg); color: var(--muted);
}
.rel-chip.rel-manager { background: #EDE9FE; color: #6d28d9; border-color: #ddd6fe; }
.rel-chip.rel-subordinate { background: #DBEAFE; color: #1d4ed8; border-color: #bfdbfe; }
.rel-chip.rel-peer { background: #DCFCE7; color: #15803d; border-color: #bbf7d0; }
.rel-chip.rel-self { background: var(--accent-soft); color: var(--accent-dark); border-color: #BEDCDC; }
.eval-done { opacity: .55; }
.eval-note {
  background: var(--accent-soft); border: 1px solid #BEDCDC; border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; color: var(--accent-dark); margin: 12px 0;
}
.axis-block { margin: 18px 0 6px; }
.axis-title { font-weight: 800; font-size: 14px; margin-bottom: 8px; color: var(--accent-dark); }
.likert-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; background: var(--card-bg); flex-wrap: wrap;
}
.likert-stmt { flex: 1 1 260px; font-size: 13px; }
.likert-opts { display: flex; gap: 4px; flex: 0 0 auto; }
.rate-opt {
  min-width: 44px; min-height: 34px; border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer;
  padding: 2px 6px;
}
.rate-opt.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.score-hidden { color: var(--muted); font-size: 11px; white-space: nowrap; }
.comment-quote {
  background: var(--card-bg); border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; font-size: 13px;
}
.chart-wrap { max-width: 520px; margin: 0 auto; }
.eval-progress { display: flex; align-items: center; gap: 12px; margin: 10px 0 16px; }
.eval-progress .progress-bar { flex: 1; }

@media (max-width: 640px) {
  .likert-row { flex-direction: column; align-items: stretch; }
  /* في الاتجاه العمودي flex-basis يصبح ارتفاعاً — صفّره وإلا تمددت العبارة 260px */
  .likert-stmt { flex: 0 0 auto; }
  .likert-opts { justify-content: space-between; }
  .rate-opt { flex: 1; min-height: 44px; }
  .eval-tabs { max-width: none; }
}

/* ── مؤشّرات الأداء الاحترافية (طراز Power BI) في التقارير ────────────────── */
.gauge-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.gauge-leg { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.gauge-leg .dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.gauge-leg-note { font-size: 11px; opacity: .85; }

.gauge-agg { display: flex; justify-content: center; margin-bottom: 6px; }
.gauge-agg .gauge-pro { flex: 0 0 auto; min-width: 280px; }
.gauge-proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.gauge-pro {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px 12px; text-align: center;
}
.gauge-pro.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.gauge-pro.clickable:hover { box-shadow: 0 6px 18px rgba(0,0,0,.09); transform: translateY(-2px); border-color: var(--accent); }
.gauge-pro svg { display: block; margin: 0 auto; }
.gauge-status { font-size: 12px; font-weight: 800; margin-top: -2px; }
.gauge-label { font-size: 14px; font-weight: 800; color: var(--text); margin-top: 3px; line-height: 1.3; }
.gauge-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.gauge-pro-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 150px; }
.gauge-empty { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--bg); border: 1px dashed var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 8px; }
.section-subtitle { font-size: 13px; font-weight: 700; color: var(--muted); margin: 8px 0 4px; }

/* ── تقويم توزيع المهام ─────────────────────────────────────────────────── */
.cal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 6px 0 14px;
}
.cal-nav { display: flex; gap: 8px; }
.cal-title { font-size: 18px; font-weight: 800; margin: 0; color: var(--text); }
.cal-scope { font-size: 12px; color: var(--muted); }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.cal-leg { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal-cell {
  min-height: 104px; border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; background: var(--card-bg); display: flex; flex-direction: column; gap: 4px;
}
.cal-cell.muted { opacity: .5; background: transparent; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.has-tasks { cursor: pointer; }
.cal-cell.has-tasks:hover { border-color: var(--accent); }
.cal-daynum { font-size: 12px; font-weight: 800; color: var(--text); display: flex; justify-content: space-between; align-items: center; }
.cal-late { font-size: 10px; font-weight: 700; color: var(--danger); }
.cal-chips { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-chip {
  display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  color: var(--text); background: color-mix(in srgb, var(--chip) 14%, transparent);
  border-inline-start: 3px solid var(--chip); border-radius: 5px; padding: 2px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-chip.late { text-decoration: line-through dotted; }
.cal-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--chip); flex: 0 0 auto; }
.cal-more { font-size: 10px; font-weight: 700; color: var(--muted); padding: 0 2px; }

@media (max-width: 640px) {
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 72px; padding: 3px; }
  .cal-weekday { font-size: 10px; }
  .cal-chip { font-size: 9px; padding: 1px 3px; }
  .cal-chip-dot { display: none; }
  .gauge { max-width: none; }
}

/* ── تصدير التقرير PDF عبر حوار الطباعة — يُطبع محتوى .print-me وحده ── */
@media print {
  body.printing * { visibility: hidden; }
  body.printing .print-me, body.printing .print-me * { visibility: visible; }
  body.printing .print-me { position: absolute; top: 0; right: 0; left: 0; width: 100%; }
  body.printing .print-me .no-print, body.printing .print-me button, body.printing .print-me select { display: none !important; }
}

/* ── منتقي عضو قابل للبحث (إسناد/تحويل مدير المشروع) ── */
.member-picker-list {
  max-height: 210px; overflow-y: auto; margin-top: 6px;
  border: 1.5px solid var(--border); border-radius: 9px; background: #fff;
}
.member-picker-item {
  padding: 9px 12px; cursor: pointer; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.member-picker-item:last-child { border-bottom: none; }
.member-picker-item:hover { background: var(--accent-soft); }
.member-picker-item.sel { background: var(--accent); color: #fff; }
.member-picker-item small { opacity: .7; }
.member-picker-empty { padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }
