/* =========================================================
   لوحة مهام تمكين — تصميم هادي ومرتب على طريقة جوجل كالندر
   ========================================================= */
:root {
  --blue: #1A44B5;
  --blue-dark: #133590;
  --blue-soft: #E8EEFB;
  --orange: #F39200;
  --orange-dark: #D27E00;
  --text: #1F2430;
  --muted: #5F6675;
  --faint: #9096A3;
  --line: #E3E6EB;
  --line-soft: #EFF1F4;
  --surface: #F7F8FA;
  --hover: #F1F3F6;
  --danger: #D92D20;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }

body {
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); color: var(--muted); }

/* ---------- الأزرار ---------- */
.btn-primary, .btn-outline, .btn-ghost, .btn-danger, .btn-google {
  border-radius: 999px;
  padding: 6px 16px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-outline { background: var(--card); border-color: var(--line); color: var(--text); }
.btn-outline:hover { background: var(--hover); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-ghost.dark { background: transparent; color: var(--muted); padding: 5px 10px; }
.btn-ghost.dark:hover { color: var(--blue); background: var(--hover); }
.btn-ghost.dark:disabled { opacity: .4; cursor: default; background: transparent; color: var(--muted); }
.btn-danger { background: var(--card); color: var(--danger); border-color: #F3C9C5; margin-inline-start: auto; }
.btn-danger:hover { background: #FEF3F2; }
.btn-primary.sm, .btn-outline.sm, .btn-danger.sm { padding: 3px 12px; font-size: 12.5px; margin: 0; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* ---------- الهيدر ---------- */
.topbar {
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 24px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; direction: ltr; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: .5px; }
.brand-sub { font-size: 7px; letter-spacing: 3.3px; opacity: .9; }
.brand-divider { width: 1px; height: 20px; background: rgba(255,255,255,.3); }
.brand-title { font-weight: 600; font-size: 14px; }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-box .btn-ghost { padding: 4px 12px; font-size: 13px; }
.user-name { opacity: .9; font-size: 13px; }
.pill { background: var(--orange); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 11px; font-weight: 700; margin-inline-start: 4px; }

/* ---------- شريط الأدوات ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px 24px 10px;
}
.month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.month-title { min-width: 180px; padding: 2px 10px; line-height: 1.3; border: none; background: none; text-align: right; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; }
.month-title:hover { background: var(--hover); }
.month-title h1 { display: flex; align-items: center; gap: 4px; }
.month-title h1 svg { color: var(--muted); }
.month-title h1 { margin: 0; font-size: 20px; font-weight: 600; color: var(--text); }
.month-title > span { color: var(--muted); font-size: 12px; }
#newTaskBtn { padding: 8px 18px; box-shadow: 0 1px 3px rgba(243,146,0,.35); }
#newTaskBtn:hover { box-shadow: 0 3px 10px rgba(243,146,0,.4); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters input[type=search], .filters select {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--hover);
  padding: 0 14px;
}
.filters input[type=search] { width: 210px; }
.filters input:focus, .filters select:focus { outline: none; background: var(--card); border-color: var(--blue); }

.color-filter { display: flex; gap: 6px; align-items: center; }
.color-filter:empty { display: none; }
.color-filter button { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.color-filter button.active { box-shadow: 0 0 0 2px var(--text); }

.seg { display: inline-flex; background: var(--hover); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; border-radius: 999px; padding: 4px 14px; font-weight: 600; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--card); color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg.small button { padding: 2px 12px; font-size: 13px; }

/* قائمة العرض زي جوجل */
.view-menu { position: relative; }
.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 600;
}
.view-btn:hover, .view-btn[aria-expanded="true"] { background: var(--hover); }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 270px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(16,30,70,.16);
  padding: 6px 0;
}
.menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: none;
  background: none;
  padding: 8px 18px;
  font-size: 14px;
  text-align: right;
}
.menu button:hover { background: var(--hover); }
.menu button.active { color: var(--blue); font-weight: 700; background: var(--blue-soft); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu .tick { width: 18px; height: 18px; flex: none; text-align: center; }
.menu .check.on .tick::before { content: "✓"; color: var(--blue); font-style: normal; font-weight: 800; font-size: 15px; }

/* الصف التاني: إحصائيات + الدليل + تراجع */
.stats-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px; padding: 0 24px 10px; }
.stats { color: var(--muted); font-size: 12.5px; display: flex; gap: 16px; }
.stats b { color: var(--text); }
.view-opts { display: flex; align-items: center; gap: 4px; }
.view-opts .btn-ghost.dark { font-size: 12.5px; }

/* دليل الألوان (سطر صغير) */
.legend-inline { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.legend-title { font-size: 12.5px; color: var(--muted); }
.legend-list { display: flex; flex-wrap: wrap; gap: 4px; }
.legend-empty { color: var(--faint); font-size: 12.5px; }
.legend-item { display: inline-flex; align-items: center; gap: 0; border-radius: 999px; padding: 0 2px 0 8px; }
.legend-item:hover { background: var(--hover); }
.legend-item.active { background: var(--blue-soft); }
.legend-item .chip { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; padding: 2px 0; font-size: 12.5px; }
.legend-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend-item .edit { width: 22px; height: 22px; border-radius: 50%; border: none; background: transparent; color: var(--faint); display: grid; place-items: center; padding: 0; opacity: 0; }
.legend-item:hover .edit { opacity: 1; }
.legend-item .edit:hover { color: var(--blue); }
.legend-item .edit svg { width: 12px; height: 12px; }
.legend-add { width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--faint); background: var(--card); color: var(--muted); font-weight: 700; line-height: 1; padding: 0; }
.legend-add:hover { border: 1px solid var(--blue); color: var(--blue); }

/* ---------- الجدول ---------- */
.board-wrap { padding: 0 24px 24px; overflow-x: auto; }
.board {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.board thead th {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 6px;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.board thead th.corner { background: var(--blue-dark); color: #fff; font-weight: 600; }

.board tbody th.week {
  background: var(--blue-soft);
  text-align: right;
  vertical-align: top;
  padding: 10px 12px;
  border-top: 1px solid var(--line-soft);
  font-weight: 400;
  position: relative;
  overflow: hidden;
}
.board tbody tr:first-child th.week, .board tbody tr:first-child td.day { border-top: none; }
.week-label { display: block; font-weight: 700; font-size: 12.5px; color: var(--blue); margin-bottom: 4px; }
.week-date { display: block; font-size: 11.5px; line-height: 1.5; color: var(--text); }
.week-date.hijri { color: var(--blue); opacity: .8; }

/* مقابض تغيير المقاس (زي الإكسيل) */
.col-resizer { position: absolute; top: 0; bottom: 0; left: -1px; width: 8px; cursor: col-resize; z-index: 3; }
.col-resizer::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 3px; width: 1px; background: rgba(255,255,255,.35); }
.col-resizer:hover::after, .col-resizer.active::after { background: var(--orange); width: 2px; top: 0; bottom: 0; }
.row-resizer { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: row-resize; z-index: 3; }
.row-resizer:hover, .row-resizer.active { background: linear-gradient(transparent 6px, var(--orange) 6px); }
body.resizing-col, body.resizing-col * { cursor: col-resize !important; user-select: none; }
body.resizing-row, body.resizing-row * { cursor: row-resize !important; user-select: none; }

.cell-inner { min-height: 100px; }
.board.view-week .cell-inner, .board.view-x4 .cell-inner { min-height: 280px; }
.board.view-day .cell-inner { min-height: 320px; }
.board tr.sized .cell-inner { height: var(--row-h); min-height: 0; overflow-y: auto; overflow-x: hidden; }
.board tr.sized .week-inner { height: calc(var(--row-h) - 8px); overflow: hidden; }

.board td.day {
  vertical-align: top;
  border-top: 1px solid var(--line-soft);
  border-inline-start: 1px solid var(--line-soft);
  padding: 4px 6px 6px;
  background: var(--card);
  position: relative;
  overflow: hidden;
  transition: background .15s, opacity .15s;
}
.board td.day.colored::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--day-bar, var(--day-color)); }
.board td.day.out .day-num .g { color: var(--faint); font-weight: 500; }
.board td.day.dimmed { opacity: .3; }
.board td.day.drop-target { box-shadow: inset 0 0 0 2px var(--blue); }
.board td.day.sel { box-shadow: inset 0 0 0 2px var(--blue); }
.board td.day.sel::after { content: ""; position: absolute; inset: 0; background: rgba(26,68,181,.06); pointer-events: none; }

.day-head { display: flex; justify-content: center; margin-bottom: 4px; }
.day-num { display: flex; flex-direction: column; align-items: center; line-height: 1.3; cursor: pointer; min-width: 0; max-width: 100%; }
.day-num .g {
  font-weight: 600;
  font-size: 12.5px;
  min-width: 24px;
  height: 24px;
  line-height: 24px;
  border-radius: 999px;
  text-align: center;
  padding: 0 4px;
}
.day-num:hover .g { background: var(--hover); }
.today .day-num .g, .today .day-num:hover .g { background: var(--blue); color: #fff; }
.day-num .h { font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* أدوات اليوم: بتظهر بس لما تقف على اليوم */
.day-tools { position: absolute; top: 5px; inset-inline-end: 5px; display: flex; gap: 3px; opacity: 0; transition: opacity .12s; z-index: 2; }
td.day:hover .day-tools, td.day.sel .day-tools, th.hday:hover .day-tools, .day-tools:focus-within { opacity: 1; }
.day-tools button {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--hover);
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}
.day-tools button:hover { background: var(--line); color: var(--text); }
.day-tools button.add { background: var(--orange); color: #fff; font-weight: 700; }
.day-tools button.add:hover { background: var(--orange-dark); }
.day-tools svg { width: 13px; height: 13px; }

/* ليبل بداية/نهاية الشهر الهجري */
.hlabel {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.55;
  padding: 0 6px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ---------- المهام (سطور خفيفة زي جوجل) ---------- */
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; min-height: 22px; }
.task {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--task-accent, var(--blue));
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12.5px;
  line-height: 20px;
  cursor: grab;
  min-width: 0;
}
.task:hover { border-color: #C3CCE0; border-inline-start-color: var(--task-accent, var(--blue)); }
.task.dragging { opacity: .4; }
.task.hidden { display: none; }
.task.selected { background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }

/* دايرة "خلصت" */
.task input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 12px;
  height: 12px;
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--task-accent, var(--blue));
  background: var(--card);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.task input[type=checkbox]:checked { background: var(--task-accent, var(--blue)); }
.task input[type=checkbox]:checked::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--card); }
.time-badge { flex: none; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; unicode-bidi: isolate; }
.task .title { flex: 1; min-width: 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.done .title { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--text); color: var(--muted); }
.task.done .time-badge { opacity: .55; }

.placeholder { height: 3px; border-radius: 2px; background: var(--orange); list-style: none; }
.adder input { width: 100%; border: 1px solid var(--blue); border-radius: 6px; padding: 3px 7px; font-size: 12.5px; background: var(--card); }
.adder input:focus { outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }

/* ---------- العرض بالساعات (زي جوجل كالندر) ---------- */
.board-wrap.hours-wrap { max-height: calc(100vh - 170px); min-height: 380px; overflow: auto; margin: 0 24px 24px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.board.mode-hours { overflow: visible; border: none; border-radius: 0; }
.board.mode-hours.view-week { min-width: 980px; }
.board.mode-hours thead th { position: sticky; top: 0; z-index: 20; padding: 8px 6px; white-space: normal; vertical-align: top; }
.board.mode-hours thead th.corner { z-index: 21; font-size: 11px; vertical-align: bottom; }
.hday { text-align: center; }
.hday-head { display: flex; justify-content: center; }
.hday-name { display: flex; flex-direction: column; align-items: center; line-height: 1.3; cursor: pointer; min-width: 0; }
.hday-name .n { font-size: 12px; font-weight: 700; color: #fff; opacity: .9; }
.hday-name .g { font-size: 21px; font-weight: 600; color: #fff; min-width: 38px; height: 38px; line-height: 38px; border-radius: 50%; }
.hday-name:hover .g { background: rgba(255,255,255,.15); }
.hday.today .hday-name .g, .hday.today .hday-name:hover .g { background: var(--card); color: var(--blue); }
.hday-name .h { font-size: 10.5px; font-weight: 400; color: #fff; opacity: .8; white-space: nowrap; }
.hday .day-tools button { background: rgba(255,255,255,.18); color: #fff; }
.hday .day-tools button:hover { background: rgba(255,255,255,.3); color: #fff; }
.hday .day-tools button.add { background: var(--orange); }
.hday.colored { box-shadow: inset 0 -4px 0 var(--day-color); }
.hday.sel { box-shadow: inset 0 0 0 2px var(--blue); }
.hday .day-tools { top: 6px; }

.board th.hour {
  width: 64px;
  background: var(--card);
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  vertical-align: top;
  text-align: center;
  padding: 0;
  white-space: nowrap;
}
.board th.hour.allday-label { background: var(--blue-soft); color: var(--blue); font-weight: 700; vertical-align: middle; padding: 6px 2px; border-bottom: 1px solid var(--line); }

.board td.slot {
  border-inline-start: 1px solid var(--line-soft);
  padding: 4px 4px;
  vertical-align: top;
  position: relative;
  cursor: cell;
}
.board td.slot.allday { border-bottom: 1px solid var(--line); min-height: 36px; }
.board td.slot.allday .tasks { min-height: 22px; }
.board td.slot.drop-target { box-shadow: inset 0 0 0 2px var(--blue); }
.board td.slot.dimmed, .board td.daycol.dimmed { opacity: .3; }

/* محور الساعات + أعمدة الأيام */
.hours-axis { position: relative; }
.hours-axis .hl { position: absolute; left: 0; right: 0; padding-inline-end: 8px; text-align: left; transform: translateY(-7px); }
.hours-axis .hl:first-child { transform: none; }
.board td.daycol { padding: 0; border-inline-start: 1px solid var(--line-soft); vertical-align: top; }
.daycol-inner { position: relative; cursor: cell; }
.hline { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line-soft); pointer-events: none; }
.hline.gap { border-top: 2px dashed var(--line); }
.daycol.today-col .daycol-inner { background: #FFFCF5; }

/* بلوك الموعد */
.task.ev {
  position: absolute;
  align-items: flex-start;
  flex-direction: column;
  gap: 0;
  padding: 2px 6px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--ev-bg, var(--blue-soft));
  border: none;
  border-inline-start: 3px solid var(--task-accent, var(--blue));
  line-height: 1.35;
  font-size: 12px;
  z-index: 1;
  box-shadow: 0 0 0 1px #fff;
}
.task.ev:hover { filter: brightness(.97); z-index: 2; }
.task.ev .ev-top { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; }
.task.ev .title { font-weight: 600; }
.task.ev .time-badge { font-size: 11px; }
.task.ev.short { flex-direction: row; align-items: center; }
.task.ev.done { opacity: .6; }
.drop-ghost {
  position: absolute;
  left: 2px;
  right: 2px;
  height: 0;
  border-top: 2px solid var(--orange);
  pointer-events: none;
  z-index: 4;
}
.drop-ghost span { position: absolute; top: -10px; inset-inline-start: 4px; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 0 5px; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #EA4335; z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; right: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #EA4335; }
.hours-empty { padding: 10px 14px; color: var(--faint); font-size: 12.5px; text-align: center; }

/* ---------- عرض السنة ---------- */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 32px; padding: 6px 4px; }
.ym-head { display: flex; flex-direction: column; margin-bottom: 8px; }
.ym-head h3 { margin: 0; font-size: 15px; font-weight: 600; cursor: pointer; }
.ym-head h3:hover { color: var(--blue); }
.ym-head span { font-size: 11px; color: var(--faint); }
.ym-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.ym-wd { font-size: 10.5px; color: var(--faint); font-weight: 600; padding-bottom: 4px; }
.ym-day { position: relative; font-size: 11.5px; line-height: 26px; border-radius: 50%; cursor: pointer; aspect-ratio: 1; max-width: 30px; margin: 0 auto; width: 100%; }
.ym-day:hover { background: var(--hover); }
.ym-day.today { background: var(--blue) !important; color: #fff; font-weight: 700; }
.ym-day.sel { box-shadow: inset 0 0 0 2px var(--blue) !important; }
.ym-day.dimmed { opacity: .3; }
.ym-day .ym-dot { position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }

/* ---------- جدول المواعيد ---------- */
.agenda { border-top: 1px solid var(--line); }
.ag-day { display: flex; gap: 20px; padding: 12px 8px; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.ag-day.sel { box-shadow: inset 0 0 0 2px var(--blue); background: #F8FAFE; }
.ag-date { width: 170px; flex: none; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; border-inline-start: 3px solid var(--ag-color, transparent); padding-inline-start: 8px; }
.ag-date .g { font-size: 22px; font-weight: 500; min-width: 36px; height: 36px; line-height: 36px; text-align: center; border-radius: 50%; }
.ag-date .info { display: flex; flex-direction: column; line-height: 1.35; padding-top: 2px; }
.ag-date .n { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ag-date .h { font-size: 11px; color: var(--faint); }
.ag-day.today .ag-date .g { background: var(--blue); color: #fff; }
.ag-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ag-label { font-size: 12px; font-weight: 700; }
.ag-body .tasks { min-height: 0; gap: 2px; }
.ag-body .task { font-size: 13.5px; padding: 3px 6px; }
.ag-add { align-self: flex-start; border: none; background: none; color: var(--faint); font-size: 12.5px; padding: 0 6px; }
.ag-add:hover { color: var(--blue); }
.empty-view { padding: 48px; text-align: center; color: var(--faint); }

/* ---------- شريط التحديد ---------- */
body.selecting, body.selecting * { user-select: none; }
.sel-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: calc(100vw - 32px);
  background: #2B2F36;
  color: #fff;
  border-radius: 12px;
  padding: 8px 10px 8px 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.28);
}
.sel-count { font-weight: 700; font-size: 13.5px; padding-inline-end: 4px; }
.sel-group { display: flex; flex-wrap: wrap; gap: 4px; padding-inline-start: 10px; border-inline-start: 1px solid rgba(255,255,255,.2); }
.sel-bar button { border: none; background: rgba(255,255,255,.1); color: #fff; border-radius: 7px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.sel-bar button:hover { background: rgba(255,255,255,.22); }
.sel-bar button.danger { color: #FDA29B; }
.sel-bar .sel-close { background: transparent; font-size: 15px; padding: 4px 8px; }

/* ---------- النوافذ ---------- */
.modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(16,30,70,.28);
}
.modal::backdrop { background: rgba(16,30,70,.35); }
.modal form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13.5px; }
.modal label.check { flex-direction: row; align-items: center; gap: 8px; }
.modal textarea, .modal input[type=date], .modal input[type=text], .modal input[type=time], .modal select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 400;
  background: var(--card);
}
.modal textarea { resize: vertical; }
.modal textarea:focus, .modal input:focus, .modal select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.modal input[type=date] { width: 100%; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.modal-hint { margin: -4px 0 0; font-size: 12.5px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: 13.5px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-hint { font-size: 12px; color: var(--faint); }
.field-hint b { color: var(--muted); font-weight: 600; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.time-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.time-range span { font-size: 13px; color: var(--muted); }
.time-range input { flex: 1; min-width: 110px; }
.check-group { display: flex; gap: 18px; }
.hijri-pick { display: grid; grid-template-columns: 70px 1fr 100px; gap: 6px; }
.date-equiv { font-size: 12.5px; color: var(--blue); font-weight: 600; min-height: 1.4em; }
.date-equiv.bad { color: var(--danger); }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input { width: 44px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 1px; background: var(--card); flex: none; }
.color-row .hlabel { font-size: 11px; padding: 1px 8px; margin: 0; }

.legend-colors { display: flex; align-items: center; gap: 10px; }
.legend-colors .swatches { flex: 1; }
.legend-colors input[type=color] { width: 44px; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 1px; background: var(--card); flex: none; }

/* ---------- اختيار اللون ---------- */
.color-pop {
  position: absolute;
  z-index: 95;
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  width: 230px;
  box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(16,30,70,.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.color-pop-title { font-weight: 600; font-size: 13px; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.swatches button { aspect-ratio: 1; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatches button.active { box-shadow: 0 0 0 2px var(--text); }
.custom-color { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.custom-color input { width: 44px; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 1px; background: var(--card); }
.pop-legend { display: flex; flex-direction: column; gap: 2px; }
.pop-legend:empty { display: none; }
.pop-legend button { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: none; border-radius: 6px; padding: 4px 6px; font-size: 13px; text-align: right; }
.pop-legend button:hover { background: var(--hover); }
.pop-legend button.active { border-color: var(--text); }
.pop-legend .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }

/* ---------- تنبيه ---------- */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #2B2F36;
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast button { border: none; background: none; color: #FFB547; font-weight: 800; padding: 2px 4px; }
.toast button:hover { text-decoration: underline; }

/* ---------- صفحة الدخول ---------- */
.auth-page { min-height: 100vh; background: var(--blue); display: grid; place-items: center; padding: 16px; }
.auth-card { background: var(--card); border-radius: 16px; padding: 32px 28px; width: min(400px, 100%); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--blue); color: #fff; border-radius: 12px; padding: 16px; margin-bottom: 22px; }
.auth-brand .brand-name { font-size: 20px; }
.auth-brand .brand-sub { font-size: 9px; letter-spacing: 4px; }
.auth-card h1 { margin: 0 0 4px; font-size: 20px; color: var(--blue); text-align: center; }
.auth-hint { margin: 0 0 12px; text-align: center; color: var(--muted); font-size: 14px; }
.auth-error { background: #FEF3F2; color: var(--danger); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
.auth-notice { background: var(--blue-soft); color: var(--blue); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.auth-form input { height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.auth-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.auth-form .btn-primary { height: 44px; font-size: 16px; border-radius: 8px; }
.btn-google { width: 100%; height: 44px; margin-top: 14px; background: var(--card); border-color: var(--line); color: var(--text); border-radius: 8px; }
.btn-google:hover { background: var(--hover); }
.auth-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- صفحة المستخدمين ---------- */
.users-page { max-width: 1100px; margin: 0 auto; padding: 24px; }
.users-hint { color: var(--muted); margin: 0 0 14px; }
.users-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.users-table th { background: var(--surface); color: var(--muted); text-align: right; padding: 10px 14px; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
.users-table td { padding: 10px 14px; border-top: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: middle; }
.users-table tr:first-child td { border-top: none; }
.users-table td.email { text-align: right; color: var(--muted); }
.users-table tr.st-pending td { background: #FFFAF0; }
.users-table tr.st-rejected td { opacity: .6; }
.users-table .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--hover); color: var(--muted); margin-inline-start: 4px; }
.badge.admin { background: var(--blue-soft); color: var(--blue); }
.st-pending .badge.st { background: #FDE7C2; color: #8A5300; }
.st-active .badge.st { background: #DCF5E3; color: #157038; }
.st-rejected .badge.st { background: #FDE2E0; color: var(--danger); }
form.inline { display: inline; margin: 0; }

/* ---------- موبايل ---------- */
@media (max-width: 720px) {
  .topbar { padding: 6px 14px; }
  .brand-divider, .brand-title, .user-name { display: none; }
  .toolbar { padding: 12px 14px 8px; }
  .filters, .filters input[type=search] { width: 100%; }
  .stats-row { padding: 0 14px 8px; }
  .board-wrap { padding: 0 14px 20px; }
  .board-wrap.hours-wrap { margin: 0 14px 20px; }
  .ag-day { flex-direction: column; gap: 8px; }
  .ag-date { width: auto; }
  .row-2 { grid-template-columns: 1fr; }
}

/* صف "طوال اليوم" ثابت تحت أسماء الأيام في العرض بالساعات */
.board.mode-hours .sticky-allday { position: sticky; z-index: 4; background-color: var(--card); }
.board.mode-hours th.sticky-allday { background: var(--blue-soft); z-index: 15; }

/* ---------- المهمة الممدودة على كذا يوم (شريط زي جوجل) ---------- */
.board td.day, .board td.slot.allday { overflow: visible; }
.span-space { flex: none; }
.task.span-bar {
  position: absolute;
  inset-inline-start: 3px;
  height: 21px;
  z-index: 3;
  background: var(--ev-bg, #DCE5FA);
  border: none;
  border-inline-start: 4px solid var(--task-accent, var(--blue));
  border-radius: 6px;
  font-weight: 600;
  padding: 0 8px;
  box-shadow: 0 1px 2px rgba(16, 30, 70, .12);
}
.task.span-bar:hover { filter: brightness(.97); }
.task.span-bar.cont-start { border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start: none; padding-inline-start: 10px; }
.task.span-bar.cont-end { border-start-end-radius: 0; border-end-end-radius: 0; }
.task.span-bar .title { flex: 0 1 auto; }
.span-range { flex: 1; min-width: 0; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.span-bar.selected { box-shadow: 0 0 0 2px var(--blue); }
.span-day { flex: none; font-size: 11px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 0 8px; }

/* شريط التحديد: زرار المهمة على الأيام */
.sel-bar button.accent { background: var(--orange); }
.sel-bar button.accent:hover { background: var(--orange-dark); }

/* نافذة الإضافة: "من" و"لحد" */
.date-pair { display: flex; align-items: center; gap: 8px; }
.date-pair .pair-label { width: 28px; flex: none; font-size: 13px; color: var(--muted); }
.date-pair input[type=date], .date-pair .hijri-pick { flex: 1; }
.hijri-pick.empty select { color: var(--faint); }

/* المهمة اللي خلصت: خط عليها وبتفضل مكانها */
.task.done { opacity: .85; }
.task.ev.done .title, .task.span-bar.done .title { text-decoration: line-through; text-decoration-thickness: 2px; }

/* شريط ألوان اليوم في العرض بالساعات لما يكون أكتر من لون */
.hday { position: sticky; }
.hday-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }

/* ---------- اختيار شهر / يوم / كذا شهر ---------- */
.date-pick {
  position: absolute;
  z-index: 96;
  width: 330px;
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 16px 40px rgba(16,30,70,.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dp-year { display: flex; align-items: center; gap: 2px; }
.dp-year b { min-width: 74px; text-align: center; font-size: 15px; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-months button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-months button:hover { border-color: var(--blue); color: var(--blue); }
.dp-months button.now { color: var(--orange-dark); }
.dp-months button.sel { background: var(--blue); border-color: var(--blue); color: #fff; }
.dp-months button.anchor:not(.sel) { box-shadow: inset 0 0 0 2px var(--blue); }
.dp-hint { margin: 0; font-size: 11.5px; color: var(--faint); text-align: center; }
.dp-days-title { font-size: 13px; font-weight: 700; color: var(--blue); border-top: 1px solid var(--line-soft); padding-top: 10px; }
.dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dp-wd { font-size: 11px; color: var(--faint); font-weight: 700; }
.dp-day { border: none; background: none; border-radius: 8px; padding: 3px 0; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.dp-day b { font-size: 13px; }
.dp-day small { font-size: 9.5px; color: var(--faint); }
.dp-day:hover { box-shadow: inset 0 0 0 1px var(--blue); }
.dp-day.today b { color: #fff; background: var(--blue); border-radius: 50%; width: 22px; line-height: 22px; }

/* ---------- قاعدة التلوين التلقائي في الدليل ---------- */
.rule-box { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border-radius: 10px; padding: 12px; }
.rule-label { font-size: 13px; font-weight: 600; margin-top: 4px; }
.rule-label small { font-weight: 400; color: var(--faint); }
.weekday-pick { display: flex; flex-wrap: wrap; gap: 5px; }
.weekday-pick button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.weekday-pick button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.rule-row { display: flex; gap: 8px; align-items: center; }
.rule-row input { flex: 1; }
.rule-box input[type=text] { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--card); }
#lRuleHint { color: var(--blue); font-weight: 600; }
#lRuleHint.bad { color: var(--danger); }
.auto-mark { font-size: 10px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 0 6px; }

/* تقويم صغير في نافذة اللون */
#legendDialog { width: min(520px, calc(100vw - 32px)); }
#legendDialog form { max-height: calc(100vh - 40px); overflow-y: auto; }
.mini-cal { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mc-head b { font-size: 12.5px; text-align: center; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.mc-wd { font-size: 11px; color: var(--faint); font-weight: 700; }
.mc-day { border: none; background: none; border-radius: 8px; padding: 3px 0; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.mc-day b { font-size: 13px; }
.mc-day small { font-size: 9.5px; opacity: .7; }
.mc-day:hover { box-shadow: inset 0 0 0 1px var(--blue); }
.mc-day.on { font-weight: 800; }
.mc-day.today:not(.on) b { color: var(--blue); text-decoration: underline; }
.legend-colors .swatches { grid-template-columns: repeat(auto-fill, 28px); gap: 8px; }

/* التقويم الصغير: اختيار الشهر من العنوان */
.mc-title { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; border: none; background: none; border-radius: 8px; padding: 6px; font-weight: 700; font-size: 13px; color: var(--blue); margin-bottom: 4px; }
.mc-title:hover { background: var(--hover); }
.mc-months { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.mc-months .btn-primary.sm { align-self: center; padding: 4px 22px; }
.mc-month + .mc-month { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.mc-month-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.mc-month-title b { font-size: 12.5px; color: var(--blue); }
.mc-month-title span { font-size: 11px; color: var(--faint); }

/* ---------- رأس اليوم: سطر واحد (الميلادي في طرف والهجري في الطرف التاني) ---------- */
.board td.day .day-head { display: block; margin-bottom: 4px; }
.board td.day .day-num {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  max-width: none;
}
.board td.day .day-num .g {
  font-size: 13.5px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  line-height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
}
.board td.day .day-num .h {
  font-size: 11px;
  color: var(--faint);
  line-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  min-width: 0;
}
.board td.day .day-num .mark { font-weight: 700; }
.board td.day .day-num .h.mark { font-size: 10.5px; }
.board td.day.today .day-num .g:not(.mark) { background: var(--blue); color: #fff; }
.board td.day.today .day-num .g.mark { box-shadow: 0 0 0 2px var(--blue); }
.board td.day.out .day-num .g:not(.mark) { color: var(--faint); font-weight: 500; }
.board td.day .day-num:hover .g:not(.mark) { background: var(--hover); }
.board td.day.today .day-num:hover .g:not(.mark) { background: var(--blue); }

/* أزرار اليوم (+ والألوان): تحت في الركن وقت ما تقف على اليوم، من غير ما تغطي الأرقام */
.board td.day .day-tools { top: auto; bottom: 5px; inset-inline-end: 5px; }
/* لو الليبلين طوال في نفس اليوم: كل واحد ياخد مساحته من غير ما يخرج برا الخانة */
.board td.day .day-num .g { flex: 0 1 auto; min-width: 24px; overflow: hidden; text-overflow: ellipsis; }
/* لو الخانة ضيقة: الليبل ينزل سطر بدل ما يتقص */
.board td.day .day-num { flex-wrap: wrap; row-gap: 3px; }
.board td.day .day-num .g, .board td.day .day-num .h { flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* حرف م (ميلادي) و هـ (هجري) جنب الرقم */
.cal-tag { font-size: .72em; font-weight: 600; opacity: .7; margin-inline-start: 2px; }
.mark .cal-tag { opacity: .9; }
.hday-name .g .cal-tag { font-size: 11px; }
/* الليبل الطويل في خانة ضيقة: يكمل على سطرين جوه نفس الشارة بدل ما يتقص */
.board td.day .day-num .mark { white-space: normal; text-overflow: clip; height: auto; line-height: 1.45; padding: 2px 8px; border-radius: 10px; }
/* الشارة دايمًا سطر واحد — الاختصار بيحصل من الكود (fitDayBadges) */
.board td.day .day-num { flex-wrap: nowrap; }
.board td.day .day-num .mark { white-space: nowrap; overflow: hidden; height: 22px; line-height: 22px; padding: 0 8px; border-radius: 999px; }
.board td.day .day-num .g, .board td.day .day-num .h { flex: 0 1 auto; min-width: 0; }
.board td.day .day-num.wrap { flex-wrap: wrap; row-gap: 3px; }
/* الرقم العادي عمره ما يتضغط — الشارة الملونة بس هي اللي بتختصر */
.board td.day .day-num > span:not(.mark) { flex: none; overflow: visible; }

/* ---------- المهمة اللي خلصت: بتفضل مكانها، عليها خط + علامة "خلصت" ---------- */
.task.done { opacity: 1; background: #F6F8F7; }
.task.done .title { color: var(--muted); }
.task.done::after {
  content: "✓ منجزة";
  flex: none;
  font-size: 10px;
  font-weight: 700;
  color: #157038;
  background: #DCF5E3;
  border-radius: 999px;
  padding: 0 6px;
  line-height: 16px;
}
.task.ev.done::after { position: absolute; top: 3px; inset-inline-end: 4px; }
.task.ev.done { opacity: .75; }

/* ---------- ليبل بداية/نهاية الشهر: أصغر ---------- */
.board td.day .day-num .mark { height: 18px; line-height: 18px; font-size: 10px; padding: 0 6px; font-weight: 700; }
.board td.day .day-num .mark .cal-tag { font-size: 9px; }
/* "خلصت" = الدايرة بتبقى خضرا وجواها ✓ (بدل شارة تاخد مكان من اسم المهمة) */
.task.done::after { content: none; }
.task.done input[type=checkbox] { width: 14px; height: 14px; border-color: #1E9E50; background: #1E9E50; }
.task.done input[type=checkbox]::after { content: "✓"; width: auto; height: auto; border-radius: 0; background: none; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; }
.task.done .title { text-decoration-color: #1E9E50; }

/* =========================================================
   الموبايل
   ========================================================= */
.only-mobile { display: none !important; }

/* الشهر على الموبايل: جدول صغير */
.board.mobile-month { table-layout: fixed; width: 100%; border-radius: 12px; }
.board.mobile-month thead th { font-size: 11px; padding: 8px 0; }
.board.mobile-month td.mday {
  position: relative;
  height: 56px;
  padding: 4px 0 6px;
  text-align: center;
  vertical-align: top;
  border-top: 1px solid var(--line-soft);
  border-inline-start: 1px solid var(--line-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.board.mobile-month td.mday::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--day-bar, transparent); }
.mday .g { display: block; margin: 0 auto; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; font-weight: 700; font-size: 13.5px; }
.mday .h { display: block; font-size: 9.5px; color: var(--faint); line-height: 1.2; }
.mday .dots { display: flex; justify-content: center; gap: 2px; margin-top: 2px; }
.mday .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.mday.out .g { color: var(--faint); font-weight: 500; }
.mday.today .g { background: var(--blue); color: #fff; }
.mday.picked { box-shadow: inset 0 0 0 2px var(--blue); }
.mday.sel { box-shadow: inset 0 0 0 2px var(--orange); }
.mday.dimmed { opacity: .35; }

/* مهام اليوم تحت الجدول / كروت الأسبوع */
.m-panel { margin-top: 12px; }
.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-day {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 10px;
  overflow: hidden;
}
.m-day::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--day-bar, transparent); }
.m-day.today { border-color: var(--blue); }
.m-day.sel { box-shadow: 0 0 0 2px var(--blue); }
.m-day.dimmed { opacity: .4; }
.m-day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.m-date { display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; }
.m-date b { font-size: 15px; color: var(--blue); }
.m-date > span { font-size: 12px; color: var(--muted); }
.m-date .hlabel { align-self: flex-start; font-size: 10px; }
.m-colors { font-size: 12px !important; font-weight: 700; }
.m-day .day-tools { position: static; opacity: 1; }
.m-day .day-tools button { width: 34px; height: 34px; font-size: 18px; }
.m-day .day-tools svg { width: 16px; height: 16px; }
.m-day .tasks { gap: 6px; }
.m-day .task { font-size: 14px; line-height: 24px; padding: 6px 10px; }
.m-day .task input[type=checkbox] { width: 18px; height: 18px; }
.m-empty { margin: 4px 0 0; color: var(--faint); font-size: 13px; }

/* زرار الإضافة العايم */
.fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 80;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: none;
  background: var(--orange);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(243,146,0,.45);
}
.fab:active { transform: scale(.96); }

@media (hover: none) {
  .day-tools { opacity: 1; }
  .legend-item .edit { opacity: 1; }
}

@media (max-width: 760px) {
  .only-mobile { display: inline-flex !important; }
  body { font-size: 14px; }

  /* الهيدر */
  .topbar { padding: 6px 12px; }
  .brand-divider, .brand-title, .user-name { display: none; }
  .user-box { gap: 6px; }
  .user-box .btn-ghost { padding: 4px 10px; font-size: 12px; }

  /* شريط الأدوات */
  .toolbar { padding: 10px 12px 6px; gap: 8px; }
  .month-nav { width: 100%; gap: 6px; }
  .month-title { order: -1; flex: 1 1 100%; min-width: 0; padding: 2px 4px; }
  .month-title h1 { font-size: 18px; }
  .view-btn { height: 34px; padding: 0 10px; }
  #newTaskBtn { display: none; }
  #todayBtn { padding: 6px 12px; }
  #modeSeg { flex: 1 1 100%; justify-content: center; }
  #modeSeg button { flex: 1; }

  /* الفلاتر: صف واحد (روابط + بحث + فلتر) */
  .filters { display: flex; flex-wrap: nowrap; width: 100%; }
  .filters input[type=search] { flex: 1 1 auto; width: auto; min-width: 0; }
  .filters select { flex: 1; }

  /* الإحصائيات + الدليل */
  .stats-row { padding: 0 12px 8px; gap: 6px; }
  .stats { gap: 12px; font-size: 12px; }
  .legend-inline { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .legend-list { flex-wrap: nowrap; }
  .legend-item { flex: none; }
  .view-opts { width: 100%; justify-content: space-between; }
  #resetSizes { display: none; }

  /* الجدول */
  .board-wrap { padding: 0 8px 96px; }
  .board-wrap.hours-wrap { margin: 0 8px 96px; max-height: calc(100vh - 150px); }
  .board.mode-hours.view-week, .board.mode-hours.view-x4 { min-width: 720px; }
  .year-grid { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .ym-day { line-height: 22px; font-size: 11px; }

  /* النوافذ */
  .modal form { padding: 18px 16px; }
  .modal-actions .btn-primary, .modal-actions .btn-outline { flex: 1; }
  .date-pick { width: calc(100vw - 16px); left: 8px !important; }
  .dp-months button { font-size: 12px; padding: 8px 2px; }
  .sel-bar { bottom: 86px; padding: 6px 8px; gap: 6px; }
  .sel-bar button { padding: 5px 8px; font-size: 12px; }
  .sel-group { padding-inline-start: 6px; }
  .toast { top: auto; bottom: 90px; max-width: calc(100vw - 24px); }
  .menu { right: 0; min-width: 240px; }
}
@media (max-width: 760px) {
  .view-opts { width: auto; margin-inline-start: auto; }
  .stats-row { flex-wrap: wrap; }
  .legend-inline { order: 3; }
  .users-page { padding: 14px 10px; overflow-x: auto; }
  .users-table { min-width: 640px; }
}

/* أزرار "كذا شهر" و"تحديد" للموبايل */
.multi-toggle { display: none; border: 1px dashed var(--blue); background: var(--card); color: var(--blue); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; }
.multi-toggle.on { background: var(--blue); color: #fff; border-style: solid; }
#selModeBtn.on { background: var(--blue); color: #fff; border-color: var(--blue); }
@media (max-width: 760px), (hover: none) {
  .multi-toggle { display: block; align-self: center; }
  .dp-hint { display: none; }
}
@media (max-width: 760px) {
  .sel-bar { left: 8px; right: 8px; transform: none; max-width: none; justify-content: space-between; }
  .sel-group { flex: 1 1 100%; border-inline-start: none; padding-inline-start: 0; }
  .sel-group button { flex: 1 1 auto; }
}
@media (max-width: 760px) {
  .sel-count { order: 0; flex: 1; }
  .sel-bar .sel-close { order: 1; }
  .sel-group { order: 2; }
}

/* =========================================================
   النهارده: باين أكتر
   ========================================================= */
.board td.day.today { box-shadow: inset 0 0 0 2px var(--blue); }
.board td.day.today:not(.colored) { background: var(--tint); }
.board td.day.today .day-num .g:not(.mark) { font-size: 15.5px; height: 30px; line-height: 30px; min-width: 30px; padding: 0 9px; box-shadow: 0 2px 6px rgba(26,68,181,.35); }
.board td.day.today .day-num .g:not(.mark)::after { content: "اليوم"; font-size: 10px; font-weight: 700; margin-inline-start: 6px; opacity: .9; }
.mday.today .g { width: 30px; height: 30px; line-height: 30px; font-size: 15px; box-shadow: 0 2px 6px rgba(26,68,181,.35); }
.mday.today { background: var(--tint); }

/* =========================================================
   روابط سريعة جنب البحث + زرار الفلتر
   ========================================================= */
.quick-links { display: flex; gap: 6px; }
.quick-link {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ql, var(--blue));
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: transform .15s, box-shadow .15s;
}
.quick-link:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.quick-link svg { width: 17px; height: 17px; }

.filter-menu { position: relative; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid transparent;
  background: var(--hover); color: var(--text); font-weight: 600;
}
.filter-btn:hover { border-color: var(--line); }
.filter-btn.active { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.filter-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 70;
  width: 240px; background: var(--card); border-radius: 12px; padding: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(16,30,70,.18);
  display: flex; flex-direction: column; gap: 10px;
}
.filter-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.filter-pop select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--card); color: var(--text); font-weight: 400; }

/* =========================================================
   المهمة: المسؤول + الروابط + من اجتماع
   ========================================================= */
.task .who {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: #5B3B00; background: #FFF1D6;
  border-radius: 999px; padding: 0 7px; line-height: 18px; max-width: 45%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task .who i { font-style: normal; font-size: 10px; }
.task.done .who { opacity: .6; }
.link-badge {
  flex: none; border: none; background: var(--blue-soft); color: var(--blue);
  border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 700; line-height: 18px; cursor: pointer;
}
.link-badge:hover { background: var(--blue); color: #fff; }
.meet-badge { flex: none; text-decoration: none; font-size: 12px; }
.task.ev .who { max-width: 100%; margin-top: 2px; }
.task.span-bar .who { line-height: 16px; }

.link-pop {
  position: absolute; z-index: 97; min-width: 220px; max-width: 320px;
  background: var(--card); border-radius: 10px; padding: 6px;
  box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(16,30,70,.2);
  display: flex; flex-direction: column;
}
.link-pop a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.link-pop a:hover { background: var(--hover); color: var(--blue); }
.link-pop a i { font-style: normal; }

/* الاجتماع في الجدول */
.meeting-item {
  display: flex; align-items: center; gap: 6px; list-style: none;
  background: #F3EEFF; border: 1px solid #DCCFFB; border-inline-start: 3px solid #7C3AED;
  border-radius: 6px; padding: 1px 6px; font-size: 12.5px; line-height: 20px;
  cursor: pointer; min-width: 0; color: #3B1D7A; font-weight: 600;
}
.meeting-item:hover { background: #EAE1FF; }
.meeting-item i { font-style: normal; flex: none; }
.meeting-item .title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* نافذة المهمة: لون + روابط */
.task-colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-colors button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.task-colors button.tc-swatch:not(.named) { padding: 3px; }
.task-colors button i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.task-colors button.active { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.task-colors input[type=color] { width: 30px; height: 26px; border: 1px solid var(--line); border-radius: 6px; padding: 1px; background: var(--card); }
.links-edit { display: flex; flex-direction: column; gap: 6px; }
.links-edit:empty::before { content: "لا توجد روابط — اضغط + رابط"; font-size: 12px; color: var(--faint); }
.link-row { display: grid; grid-template-columns: 120px 1fr 28px; gap: 6px; }
.link-row input { min-width: 0; }
.l-del { border: none; background: var(--hover); border-radius: 6px; color: var(--danger); font-size: 16px; }
.meeting-from a, .meeting-link { color: #7C3AED; font-weight: 600; }
.meeting-link { text-decoration: none; }
.meeting-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .quick-links { order: -1; }
  .filters { gap: 8px; }
  #fSearch { flex: 1; width: auto !important; }
  .filter-pop { left: 0; right: auto; max-width: calc(100vw - 32px); }
  .link-row { grid-template-columns: 1fr 28px; }
  .link-row .l-label { grid-column: 1 / -1; }
  .m-day .task .who { font-size: 11.5px; }
}

/* =========================================================
   صفحة محاضر الاجتماعات
   ========================================================= */
.meetings-page { background: var(--surface); }
.mt-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; padding: 20px 24px 40px; align-items: start; max-width: 1500px; margin: 0 auto; }
.mt-list-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 16px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; gap: 12px; }
.mt-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-list-head h1 { margin: 0; font-size: 18px; color: var(--blue); }
.mt-list-head h1 span { color: var(--faint); font-size: 14px; font-weight: 500; }
.mt-tools { display: flex; flex-direction: column; gap: 8px; }
.mt-tools input, .mt-tools select { height: 36px; border: 1px solid transparent; border-radius: 999px; background: var(--hover); padding: 0 14px; }
.mt-tools input:focus, .mt-tools select:focus { outline: none; background: var(--card); border-color: var(--blue); }
.mt-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-inline-end: 2px; }
.mt-month { font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 4px 2px; }
.mt-none { color: var(--faint); text-align: center; padding: 24px 8px; }
.mt-card { display: flex; gap: 12px; text-align: right; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px; cursor: pointer; }
.mt-card:hover { border-color: #C3CCE0; background: #FAFBFE; }
.mt-card.active { border-color: #7C3AED; box-shadow: 0 0 0 1px #7C3AED; background: #FAF7FF; }
.mt-card-date { flex: none; width: 52px; border-radius: 8px; background: #F3EEFF; color: #5B21B6; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 0; }
.mt-card.today .mt-card-date { background: var(--blue); color: #fff; }
.mt-card-date b { font-size: 20px; line-height: 1.1; }
.mt-card-date span { font-size: 10.5px; font-weight: 600; }
.mt-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mt-card-title { font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.mt-people { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mt-card-snippet { font-size: 12px; color: var(--faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.mt-editor { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; min-height: 420px; }
.mt-empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.mt-empty-icon { font-size: 46px; margin-bottom: 8px; }
#mForm { display: flex; flex-direction: column; gap: 16px; }
#mForm[hidden] { display: none; }
.mt-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt-form-head h2 { margin: 0; font-size: 18px; color: #5B21B6; }
.mt-head-actions { display: flex; gap: 8px; }
.mt-head-actions .btn-danger { margin: 0; }
#mForm label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13.5px; }
#mForm input[type=text], #mForm input[type=date], #mForm input[type=time], #mForm input[type=url], #mForm textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-weight: 400; background: var(--card);
}
#mForm textarea { resize: vertical; line-height: 1.8; }
#mForm input:focus, #mForm textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.mt-title-field input { font-size: 17px; font-weight: 700 !important; }
.mt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-label small { font-weight: 400; color: var(--faint); }

.chips-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--card); cursor: text; }
.chips-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.chips { display: contents; }
.chip-item { display: inline-flex; align-items: center; gap: 4px; background: #F3EEFF; color: #5B21B6; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; font-weight: 600; }
.chip-item button { border: none; background: rgba(91,33,182,.12); color: #5B21B6; border-radius: 50%; width: 18px; height: 18px; line-height: 16px; padding: 0; font-size: 13px; }
.chips-input input { flex: 1; min-width: 160px; border: none !important; box-shadow: none !important; padding: 4px !important; }

.mt-tasks { display: flex; flex-direction: column; gap: 6px; }
.mt-tasks:empty::before { content: "لا توجد مهام — اضغط + مهمة. كل مهمة تُضاف للتقويم في يومها."; font-size: 12px; color: var(--faint); }
.mt-task { display: grid; grid-template-columns: 1fr 160px 150px 28px; gap: 6px; }
.mt-task input { min-width: 0; }
.mt-task.done .tk-title { text-decoration: line-through; color: var(--muted); }
.mt-save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border-top: 1px solid var(--line); padding: 12px 0 2px; }
.mt-save-bar .btn-primary { padding: 9px 26px; }

.print-only { display: none; }

@media (max-width: 900px) {
  .mt-layout { grid-template-columns: 1fr; padding: 12px; }
  .mt-list-pane { position: static; max-height: none; }
  body.mt-open .mt-list-pane { display: none; }
  body:not(.mt-open) .mt-editor { display: none; }
  .mt-editor { padding: 16px 14px; }
  .mt-row { grid-template-columns: 1fr; }
  .mt-task { grid-template-columns: 1fr 28px; }
  .mt-task .tk-title { grid-column: 1; }
  .mt-task .tk-who, .mt-task .tk-date { grid-column: 1; }
  .mt-task .l-del { grid-row: 1; grid-column: 2; }
  .mt-head-actions { width: 100%; }
}

/* طباعة المحضر */
@page { size: A4; margin: 0; }
@page plan { size: A4 landscape; margin: 0; }
@media print {
  html, body { height: auto !important; overflow: visible !important; background: var(--card) !important; }
  body.meetings-page > *:not(#mPrintView) { display: none !important; }
  body.meetings-page { display: block !important; }
  #mPrintView.print-only { display: block !important; position: static !important; font-family: 'Cairo', sans-serif; color: var(--text); font-size: 12.5pt; line-height: 1.7; }
  #mPrintView * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pv-wrap { width: 100%; border-collapse: collapse; }
  .pv-wrap > thead { display: table-header-group; }
  .pv-wrap > tfoot { display: table-footer-group; }
  .pv-wrap > thead td, .pv-wrap > tbody > tr > td, .pv-wrap > tfoot td { padding: 0; border: none; }
  .pv-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 14px; border-bottom: 2.5px solid #1A44B5; }
  .pv-head img { width: 38px; height: 38px; }
  .pv-brand { display: flex; flex-direction: column; line-height: 1.1; direction: ltr; text-align: left; }
  .pv-brand b { font-size: 15pt; color: #1A44B5; letter-spacing: 1px; }
  .pv-brand span { font-size: 7pt; color: #F39200; letter-spacing: 3px; font-weight: 700; }
  .pv-doc { margin-inline-start: auto; font-weight: 700; color: #1A44B5; font-size: 12pt; }
  .pv-foot-space { height: 6mm; }
  #mPrintView h1 { font-size: 19pt; margin: 0 0 2px; color: var(--text); }
  .pv-meta { color: #444; margin: 0 0 10px; font-size: 11pt; }
  .pv-sec { margin-top: 12px; }
  #mPrintView h3 { font-size: 13.5pt; margin: 0 0 6px; color: #1A44B5; border-inline-start: 4px solid #F39200; padding-inline-start: 8px; break-after: avoid; page-break-after: avoid; }
  #mPrintView ul { margin: 0; padding-inline-start: 20px; }
  #mPrintView li { break-inside: avoid; page-break-inside: avoid; margin-bottom: 2px; }
  #mPrintView p { margin: 0; orphans: 3; widows: 3; }
  .pv-tasks { width: 100%; border-collapse: collapse; font-size: 11.5pt; }
  .pv-tasks th, .pv-tasks td { border: 1px solid #bbb; padding: 5px 8px; text-align: right; }
  .pv-tasks th { background: var(--tint); }
  .pv-tasks tr { break-inside: avoid; page-break-inside: avoid; }
}
}

/* ===== المسؤول: مستخبي على اللوحة إلا لو اتفعّل من القائمة ===== */
.task .who { display: none; }
body.show-who .task .who { display: inline-flex; }

/* ===== المهمة الملونة: الخلفية كلها بلونها عشان تبان ===== */
.task.colored,
.task.colored.ev,
.task.colored.span-bar {
  background: var(--task-accent);
  border-color: var(--task-accent);
  color: var(--on-accent, #fff);
  font-weight: 600;
}
.task.colored:hover { filter: brightness(1.06); border-color: var(--task-accent); }
.task.colored .title,
.task.colored .time-badge,
.task.colored .span-range { color: var(--on-accent, #fff); }
.task.colored .span-range,
.task.colored .time-badge { opacity: .9; }
.task.colored input[type=checkbox] { border-color: var(--on-accent, #fff); background: transparent; }
.task.colored .who,
.task.colored .link-badge { background: rgba(255,255,255,.25); color: var(--on-accent, #fff); border-color: transparent; }
.task.colored.done { background: var(--task-accent); opacity: .7; }
.task.colored.done .title { color: var(--on-accent, #fff); text-decoration-color: var(--on-accent, #fff); }
.task.colored.done input[type=checkbox] { border-color: #fff; background: #1E9E50; }
.task.colored.selected { box-shadow: 0 0 0 2px var(--blue), 0 0 0 4px #fff inset; }
.mday .dots i.c { width: 7px; height: 7px; box-shadow: 0 0 0 1px #fff; }

/* ===== الروابط السريعة: أزرار بالأسامي ===== */
.quick-link {
  width: auto; height: 32px; padding: 0 14px;
  border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none;
}
@media (max-width: 760px) {
  .filters { flex-wrap: wrap; }
  .quick-links { order: -1; flex: 1 1 100%; }
  .quick-link { flex: 1; justify-content: center; padding: 0 6px; font-size: 12.5px; }
}

/* ===== قوايم الأسامي ===== */
select.people-select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--card); font: inherit; color: var(--text); }
.team-add { display: flex; gap: 8px; }
.team-add input { flex: 1; min-width: 0; }
.team-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.team-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.team-list li span { flex: 1; }
.team-list li button { border: none; background: var(--hover); color: var(--danger); border-radius: 6px; width: 26px; height: 26px; font-size: 16px; cursor: pointer; }
.team-list .empty { color: var(--muted); border-style: dashed; justify-content: center; }

/* ===== الحضور: قايمة منسدلة باختيار أكتر من اسم ===== */
.att-select { position: relative; }
.att-btn {
  width: 100%; height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
}
.att-btn i { font-style: normal; color: var(--muted); font-size: 12px; }
.att-btn[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,68,181,.12); }
.att-pop {
  position: absolute; inset-inline: 0; bottom: calc(100% + 6px); z-index: 40;
  background: var(--card); border-radius: 10px; padding: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(16,30,70,.18);
}
.att-options { max-height: 240px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px; }
.att-opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.att-opt:hover { background: var(--hover); }
.att-opt input { width: 16px; height: 16px; accent-color: #7C3AED; margin: 0; }
.att-empty { margin: 6px; color: var(--muted); font-size: 13px; }
.att-new { display: flex; gap: 6px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.att-new input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; }
#mAttendees { margin-top: 8px; }
#mAttendees:empty { display: none; }
select.tk-who { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--card); font: inherit; min-width: 0; }
#mAttendees { display: flex; flex-wrap: wrap; gap: 6px; } #mAttendees .chip-item { width: auto; flex: none; }
#mForm .att-opt { flex-direction: row; align-items: center; justify-content: flex-start; font-weight: 500; color: var(--text); }

/* ===== صفحة الإعدادات ===== */
.st-wrap { max-width: 1100px; margin: 20px auto; padding: 0 16px 40px; display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.st-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; background: var(--card); border-radius: 12px; padding: 8px; box-shadow: 0 1px 3px rgba(16,30,70,.08); }
.st-nav a { padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.st-nav a:hover { background: var(--hover); color: var(--blue); }
#stForm { display: flex; flex-direction: column; gap: 16px; }
.st-card { background: var(--card); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(16,30,70,.08); scroll-margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.st-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.st-head h2 { margin: 0 0 4px; font-size: 17px; color: var(--blue); }
.st-head .field-hint { margin: 0; }
.st-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13.5px; }
.st-card label.check { flex-direction: row; align-items: center; font-weight: 500; }
.st-card input[type=text], .st-card input[type=number] { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; min-width: 0; }
.st-card input[type=color] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--card); flex: none; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-inline { display: flex; gap: 8px; }
.st-inline input[type=text] { flex: 1; }
.st-radio { display: flex; flex-direction: column; gap: 8px; }
.st-num { width: 70px; display: inline-block; margin: 0 4px; }
.st-links { display: flex; flex-direction: column; gap: 8px; }
.st-link { display: grid; grid-template-columns: 150px 1fr 1.6fr 44px 30px 30px; gap: 8px; align-items: center; }
.st-link-prev { background: var(--ql); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.st-move { display: flex; flex-direction: column; gap: 2px; }
.st-move button { border: none; background: var(--hover); border-radius: 4px; font-size: 9px; line-height: 1; height: 17px; cursor: pointer; color: var(--muted); }
.st-link .l-del { height: 30px; }
.st-preview { display: flex; gap: 8px; }
.st-save { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 14px; padding: 12px 20px; box-shadow: 0 -2px 12px rgba(16,30,70,.08); }
@media (max-width: 760px) {
  .st-wrap { grid-template-columns: 1fr; }
  .st-nav { position: static; flex-direction: row; overflow-x: auto; }
  .st-nav a { white-space: nowrap; }
  .st-grid { grid-template-columns: 1fr; }
  .st-link { grid-template-columns: 1fr 44px 30px 30px; }
  .st-link-prev { grid-column: 1 / -1; justify-self: start; }
  .st-link .k-label { grid-column: 1 / -1; }
  .st-link .k-url { grid-column: 1 / 2; }
}

/* ===== شارة نسبة الإنجاز ===== */
.day-pct { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 800; color: #fff; line-height: 1; white-space: nowrap; flex: none; }
.day-pct.good { background: #16A34A; }
.day-pct.mid { background: #F59E0B; }
.day-pct.low { background: #DC2626; }
.day-pct.none { background: #CBD5E1; color: var(--text-2); }

/* نسبة الإنجاز جنب رقم اليوم */
.board td.day .day-num .day-pct { margin-inline-end: auto; }
.board td.day .day-num .day-pct + .h { margin-inline-start: 0; }
.stats-pct .day-pct { height: 19px; font-size: 11.5px; vertical-align: middle; }

/* ===== الأزرار السريعة في نص الشريط ===== */
.toolbar > .quick-links { flex: 1 1 200px; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden; padding: 4px 2px; }
.toolbar > .quick-links .quick-link { flex: none; }
.ql-more { position: relative; flex: none; }
.ql-more-pop {
  position: fixed; z-index: 80; margin-top: 6px; display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border-radius: 12px; padding: 8px; box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(16,30,70,.18);
}
.ql-more-pop .quick-link { justify-content: center; }
@media (max-width: 760px) {
  .toolbar > .quick-links { order: 5; flex: 1 1 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .toolbar > .quick-links::-webkit-scrollbar { display: none; }
  .toolbar > .quick-links .quick-link { flex: none; padding: 0 12px; }
}

/* ===== الأولوية ===== */
.prio-flag {
  flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0;
  border: none; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s;
}
.task:hover .prio-flag, .prio-flag:focus-visible { opacity: 1; }
.prio-flag:hover { background: var(--hover); color: var(--text); }
.prio-flag.p1, .prio-flag.p2 { opacity: 1; color: var(--prio); }
body.is-mobile .prio-flag.p0 { opacity: .35; }
.task.prio-2 { box-shadow: inset 0 0 0 1.5px var(--prio); }
.task.prio-2:not(.colored) { background: color-mix(in srgb, var(--prio) 8%, #fff); }
.task.prio-2 .title { font-weight: 700; }
.task.prio-1 .title { font-weight: 600; }
.task.colored .prio-flag.p1, .task.colored .prio-flag.p2 { color: var(--on-accent, #fff); background: rgba(255,255,255,.22); }
.task.done .prio-flag.p1, .task.done .prio-flag.p2 { opacity: .5; }

.prio-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.prio-opt {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer;
}
.prio-opt svg { color: var(--prio); }
.prio-opt.active { border-color: var(--prio); background: color-mix(in srgb, var(--prio) 12%, #fff); color: var(--text); }
.prio-opt.p0.active { border-color: var(--blue); background: var(--blue-soft); }

.prio-pop {
  position: absolute; z-index: 90; min-width: 160px; display: flex; flex-direction: column; padding: 6px;
  background: var(--card); border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(16,30,70,.18);
}
.prio-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: none; background: none; border-radius: 6px; font: inherit; font-size: 14px; text-align: right; cursor: pointer; color: var(--text); }
.prio-item:hover { background: var(--hover); }
.prio-item.active { background: var(--blue-soft); font-weight: 700; }
.prio-item i { color: var(--prio); display: inline-grid; place-items: center; font-style: normal; }

/* ===== تقرير الإنجاز ===== */
.report-modal { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.report-head h2 { margin: 0; }
.report-actions { display: flex; gap: 6px; align-items: center; }
.rp-sub { color: var(--muted); margin: 0 0 12px; font-size: 13px; }
.rp-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.rp-card { background: var(--surface, #F4F6FB); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); }
.rp-card b { font-size: 24px; color: var(--text); }
.rp-card.good b { color: #16A34A; }
.rp-card.mid b { color: #D97706; }
.rp-card.low b { color: #DC2626; }
#rpBody h3 { font-size: 15px; color: var(--blue); margin: 16px 0 8px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rp-table th { background: var(--blue); color: #fff; font-weight: 600; padding: 7px 8px; text-align: right; }
.rp-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rp-table tr:nth-child(even) td { background: var(--surface); }
.rp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rp-list ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.rp-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.rp-list.good li::marker { color: #16A34A; }
.rp-list.low li::marker { color: #DC2626; }
.rp-list.good .rp-t { text-decoration: line-through; text-decoration-color: #16A34A88; }
.rp-meta { color: var(--muted); font-size: 12px; }
.rp-prio { font-size: 11px; font-weight: 700; color: #fff; background: var(--prio); border-radius: 999px; padding: 0 7px; }
.rp-empty { color: var(--muted); }
@media (max-width: 760px) {
  .rp-cards { grid-template-columns: repeat(2, 1fr); }
  .rp-two { grid-template-columns: 1fr; }
}

/* ===== إعداد الخطة في الإعدادات ===== */
.st-sub { margin: 0 0 8px; font-size: 16px; color: var(--blue); }
.st-entities { display: flex; flex-direction: column; gap: 12px; }
.st-entity { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.st-entity-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.st-card .st-entity-name { font-weight: 700; font-size: 15px; flex: 1 1 200px; }
.st-entity-head select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--card); font: inherit; font-size: 13px; }
.st-projects { display: flex; flex-direction: column; gap: 6px; padding-inline-start: 14px; border-inline-start: 3px solid var(--blue-soft); }
.st-project { display: grid; grid-template-columns: 1fr 260px 32px; gap: 8px; align-items: center; }
.st-project-new { grid-template-columns: 1fr 260px auto; margin-top: 4px; }
.st-card .st-dir { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.st-dir span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.st-dir select { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--card); font: inherit; }
.st-edit-list li input { flex: 1; min-width: 0; height: 32px; border: 1px solid transparent; border-radius: 6px; padding: 0 6px; font: inherit; background: transparent; }
.st-edit-list li input:hover, .st-edit-list li input:focus { border-color: var(--line); background: var(--card); }
.st-teams { display: flex; flex-direction: column; gap: 8px; }
.st-card .st-team-row { display: grid; grid-template-columns: 220px 1fr; gap: 10px; align-items: center; font-weight: 500; }
.st-team-row small { color: var(--muted); }
.btn-outline.sm { padding: 4px 12px; font-size: 13px; }
@media (max-width: 760px) {
  .st-project, .st-project-new { grid-template-columns: 1fr 32px; }
  .st-project .st-dir { grid-column: 1 / -1; grid-row: 2; }
  .st-project-new { grid-template-columns: 1fr; }
  .st-card .st-team-row { grid-template-columns: 1fr; }
}

/* ===== صفحة الخطة الشهرية ===== */
.plans-page { background: var(--surface, #F4F6FB); }
.pl-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 24px 8px; }
.pl-month { display: flex; align-items: center; gap: 8px; }
.pl-month-title { min-width: 170px; text-align: center; }
.pl-month-title h1 { margin: 0; font-size: 21px; }
.pl-month-title span { font-size: 12px; color: var(--muted); }
.pl-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pl-director { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; }
.pl-director select { height: 36px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; background: var(--card); font: inherit; min-width: 170px; }
#plTabs button.active { background: var(--blue); color: #fff; }
.pl-target-mode { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.pl-team { margin: 0 24px 6px; font-size: 14px; color: var(--text); }
.pl-team .muted { color: var(--muted); }
.pl-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 6px 24px 10px; }
.pl-card { background: var(--card); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 1px 3px rgba(16,30,70,.06); }
.pl-card b { font-size: 22px; line-height: 1.2; }
.pl-card span { font-size: 12.5px; color: var(--muted); }
.pl-card.good b { color: #16A34A; }
.pl-card.mid b { color: #D97706; }
.pl-card.low b { color: #DC2626; }
.pl-main { padding: 0 24px 40px; }
.pl-empty { background: var(--card); border-radius: 14px; padding: 40px 20px; text-align: center; color: var(--muted); font-size: 15px; }
.pl-sec { background: var(--card); border-radius: 14px; padding: 14px 14px 12px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(16,30,70,.06); }
.pl-sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.pl-sec-head h2 { margin: 0; font-size: 17px; color: var(--blue); }
.pl-sec-meta { font-size: 12.5px; color: var(--muted); }
.pl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.pl-grid { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.pl-grid th, .pl-grid td { border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); text-align: center; padding: 0; height: 34px; white-space: nowrap; }
.pl-grid thead th { background: var(--blue); color: #fff; font-weight: 600; padding: 3px 4px; }
.pl-grid thead th.pl-day { font-size: 11px; font-weight: 500; min-width: 40px; }
.pl-grid thead th.pl-date { font-size: 13px; font-weight: 800; background: #2A55C8; }
.pl-grid thead th.today { background: var(--orange, #F39200); }
.pl-fix { position: sticky; z-index: 2; background: var(--card); text-align: right !important; padding: 0 10px !important; }
.pl-grid thead .pl-fix { z-index: 3; background: var(--blue); }
.pl-c1 { right: 0; min-width: 120px; }
.pl-c2 { right: 120px; min-width: 120px; }
.pl-c3 { right: 240px; min-width: 100px; box-shadow: -3px 0 6px -3px rgba(16,30,70,.15); }
.pl-c2 small.pl-dir { display: block; font-size: 10.5px; color: var(--muted); line-height: 1; margin-top: -4px; }
.pl-cell { position: relative; min-width: 40px; }
.pl-cell input { width: 100%; min-width: 38px; height: 33px; border: none; background: transparent; text-align: center; font: inherit; font-weight: 700; font-size: 14px; color: var(--text); -moz-appearance: textfield; }
.pl-cell input::-webkit-outer-spin-button, .pl-cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pl-cell input::placeholder { color: #CBD5E1; font-weight: 500; }
.pl-cell input:focus { outline: 2px solid var(--blue); outline-offset: -2px; background: var(--card); }
.pl-cell > span { font-weight: 700; }
.pl-cell.today { background: #FFF7ED; }
.pl-cell.has { background: #ECFDF3; }
.pl-cell.empty { background: #FEF2F2; }
.pl-cell.met { background: #DCFCE7; }
.pl-cell.short { background: #FEE2E2; }
.pl-cell.saving { opacity: .6; }
.pl-tgt { position: absolute; bottom: 1px; inset-inline-start: 3px; font-size: 9.5px; font-style: normal; color: var(--muted); pointer-events: none; line-height: 1; }
.pl-tgt:empty { display: none; }
body.target-mode .pl-cell input { color: #C2410C; }
.pl-sum { font-weight: 800; min-width: 64px; padding: 0 6px !important; background: var(--surface); }
.pl-stop { min-width: 64px; font-weight: 700; color: var(--muted); }
.pl-stop.bad { color: #DC2626; background: #FEF2F2; }
.pl-act { min-width: 54px; }
.pl-row-btn { border: none; background: var(--hover); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; color: var(--muted); }
.pl-row-btn.del { color: #DC2626; }
.pl-grid tfoot td { font-weight: 700; background: var(--surface); }
.pl-grid tfoot .pl-fix { background: var(--tint); }
.pl-foot-label { color: var(--blue); }
.pl-grid .pl-gap td.bad, .rp-table td.bad { color: #DC2626; background: #FEF2F2; font-weight: 800; }
.pl-grid .pl-gap td.ok { color: #16A34A; }
.pl-grid .pl-target-row td { color: #C2410C; }
.pl-norows { color: var(--muted); padding: 14px !important; text-align: center !important; }
.pl-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.pl-add select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--card); font: inherit; min-width: 150px; }
.btn-primary.sm { padding: 6px 16px; font-size: 13.5px; }
.pl-hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
#plReport h3 { font-size: 16px; color: var(--blue); margin: 18px 0 8px; }
#plReport .pl-scroll { background: var(--card); }
#plReport .rp-table td.ok { color: #16A34A; font-weight: 700; }
#plReport a { color: var(--blue); font-weight: 700; }
@media (max-width: 760px) {
  .pl-toolbar, .pl-main { padding-inline: 12px; }
  .pl-cards { padding-inline: 12px; grid-template-columns: repeat(2, 1fr); }
  .pl-team { margin-inline: 12px; }
  .pl-c1 { min-width: 90px; }
  .pl-c2 { right: 90px; min-width: 90px; }
  .pl-c3 { right: 180px; min-width: 76px; }
}
@media print {
  .plans-page .topbar, .plans-page .pl-controls, .plans-page .pl-add, .plans-page .pl-act, .plans-page .toast, .plans-page #plPrev, .plans-page #plNext, .plans-page #plThisMonth { display: none !important; }
  .plans-page { background: var(--card); }
  .plans-page * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pl-scroll { overflow: visible; border: none; }
  .pl-grid { font-size: 9pt; }
  .pl-fix { position: static; }
  .pl-sec { box-shadow: none; break-inside: avoid; }
}

/* أقسام الخطة في الإعدادات: نفس عمود الفورم */
.st-wrap > .st-card { grid-column: 2; }
.st-wrap > .st-nav { grid-row: 1 / span 60; align-self: start; }
@media (max-width: 760px) { .st-wrap > .st-card, .st-wrap > .st-group, .st-wrap > #stForm { grid-column: auto; } .st-wrap > .st-nav { grid-row: auto; } }

.pl-sum, .pl-tgt { direction: ltr; unicode-bidi: isolate; }

/* ===== الخطة: الخطة بدون لون، الأخضر = منجز، الأحمر = فجوة ===== */
.pl-cell.done { background: #16A34A; }
.pl-cell.done input, .pl-cell.done .pl-val { color: #fff; }
.pl-cell.gap { background: #DC2626; }
.pl-cell.gap input, .pl-cell.gap .pl-val { color: #fff; }
.pl-cell.planned { background: var(--card); }
.pl-cell.stopday { background: var(--tint); }
.pl-cell.today:not(.done):not(.gap) { background: #FFF7ED; }
.pl-cell .pl-val { font-weight: 800; font-size: 14px; }
.pl-cell.clickable { cursor: pointer; user-select: none; }
.pl-cell.clickable:hover { box-shadow: inset 0 0 0 2px var(--blue); }
.pl-cell.clickable:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.pl-cell.clickable.planned:hover, .pl-cell.clickable.gap:hover { filter: brightness(.95); }
.pl-cell.done input:focus, .pl-cell.gap input:focus { background: transparent; }
body.check-mode .pl-cell.done .pl-val::after { content: " ✓"; font-size: 10px; }
.pl-grid thead th.pl-sum.done { background: #15803D; }
.pl-grid thead th.pl-sum.gap { background: #B91C1C; }
.pl-sum.done { color: #16A34A; }
.pl-sum.gap.bad { color: #DC2626; background: #FEF2F2; }
.pl-grid tfoot td.ok { color: #16A34A; }
.pl-grid tfoot td.bad { color: #DC2626; background: #FEF2F2; }
.pl-grid .pl-done-row .pl-foot-label { color: #15803D; }
.pl-grid .pl-gap .pl-foot-label { color: #B91C1C; }
.pl-legend { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pl-legend .lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }
.pl-legend .lg.done { background: #16A34A; border-color: #16A34A; }
.pl-legend .lg.gap { background: #DC2626; border-color: #DC2626; }
.pl-legend .lg.planned { background: var(--card); }
.pl-mode-hint { margin: 0 0 8px; padding: 8px 12px; background: #ECFDF3; border: 1px solid #BBF7D0; border-radius: 8px; color: #166534; font-size: 13.5px; }
#plMode button.active { background: var(--blue); color: #fff; }
#plMode button[data-mode="check"].active { background: #16A34A; }
@media print {
  .plans-page .pl-mode, .plans-page .pl-mode-hint { display: none !important; }
}

.pl-grid thead th.pl-sum { color: #fff; }

/* ===== الإعدادات: يظهر لمين / المديرون / الأهداف / المستخدمون ===== */
.st-link { grid-template-columns: 150px 1fr 1.6fr 44px auto 30px 30px; }
.st-link .k-vis { white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.st-vis { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.st-vis-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; flex: 1 1 100%; }
.st-vis-custom b { font-size: 12.5px; color: var(--muted); }
.st-dirs { position: relative; }
.st-dirs-btn { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-dirs-pop { position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline-start: 0; min-width: 220px; max-height: 300px; overflow: auto; background: var(--card); border-radius: 10px; padding: 10px; box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(16,30,70,.18); display: flex; flex-direction: column; gap: 6px; }
.st-dirs-actions { display: flex; gap: 6px; margin-top: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.st-project-simple { grid-template-columns: 1fr 32px; }
.st-project-simple.st-project-new { grid-template-columns: 1fr auto; }
.st-users td, .st-goals td { vertical-align: middle; }
.st-users select { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--card); font: inherit; }
.st-users .st-perm { text-align: center; }
.st-users .st-perm input { width: 18px; height: 18px; accent-color: var(--blue); }
.st-email { display: block; color: var(--muted); font-size: 11.5px; }
.st-month { flex-direction: row !important; align-items: center; gap: 8px; }
.st-month input { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; }
.st-goals th { white-space: nowrap; }
.st-goal-in { width: 70px; height: 32px; border: 1px solid var(--line); border-radius: 6px; text-align: center; font: inherit; font-weight: 700; }
.st-goal-sum { font-weight: 800; color: var(--blue); }
.st-goal-tools { display: flex; align-items: center; gap: 12px; }
.st-transfer { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.st-transfer label { flex-direction: row !important; align-items: center; gap: 6px; }
.st-transfer select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--card); font: inherit; min-width: 180px; }
@media (max-width: 760px) {
  .st-link { grid-template-columns: 1fr 44px 30px 30px; }
  .st-link .k-vis { grid-column: 1 / -1; max-width: none; }
}

/* ===== الخطة: لوحة المديرين + أهداف الشهر ===== */
.pl-overview, .pl-goals { margin: 0 24px 14px; background: var(--card); border-radius: 14px; padding: 14px; box-shadow: 0 1px 3px rgba(16,30,70,.06); }
.pl-overview[hidden], .pl-goals[hidden] { display: none; }
.pl-ov-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pl-ov-head h2, .pl-goals h2 { margin: 0; font-size: 17px; color: var(--blue); }
.day-pct.big { height: 30px; font-size: 16px; padding: 0 14px; }
.pl-ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pl-ov-card { text-align: right; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.pl-ov-card:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(26,68,181,.12); }
.pl-ov-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.pl-ov-bar { height: 7px; background: #E5E9F2; border-radius: 999px; overflow: hidden; }
.pl-ov-bar i { display: block; height: 100%; background: #16A34A; border-radius: 999px; }
.pl-ov-nums, .pl-goal-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.pl-ov-nums b, .pl-goal-nums b { color: var(--text); }
.pl-ov-nums .bad b { color: #DC2626; }
.pl-ov-card small { color: var(--muted); font-size: 12px; }
.pl-goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 10px; }
.pl-goal-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pl-goal-ent { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pl-goal-ent b { font-size: 15px; }
.pl-goal-ent small { color: var(--muted); }
.pl-goal-row { display: flex; flex-direction: column; gap: 5px; }
.pl-goal-name { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; }
.pl-goal-nums .ok b { color: #16A34A; }
.pl-goal-nums .warn b { color: #D97706; }
@media (max-width: 760px) {
  .pl-overview, .pl-goals { margin-inline: 12px; }
}

/* ===== جدول المطلوب (مشروع × نوع) ===== */
.pl-goals-table th, .pl-goals-table td { text-align: center; white-space: nowrap; }
.pl-goals-table td:first-child, .pl-goals-table td:nth-child(2), .pl-goals-table th:first-child, .pl-goals-table th:nth-child(2) { text-align: right; }
.rp-table th.pl-gt-type { background: #12348F; border-inline-start: 2px solid #fff; font-size: 14px; }
.rp-table th.pl-gt-sub { background: #2A55C8; font-size: 11.5px; font-weight: 500; padding: 4px 6px; }
.pl-gt-target { font-weight: 800; }
.pl-gt-none { color: #CBD5E1; }
.pl-goals-table td.ok { color: #16A34A; font-weight: 700; }
.pl-goals-table td.bad { color: #DC2626; font-weight: 700; }
.pl-goals-table tfoot td { background: var(--tint); font-weight: 800; }
.st-goals tr.st-ent-start td { border-top: 2px solid #C7D2EE; }
.st-goals td small.st-email { margin-top: 2px; }
.pl-add-wrap { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pl-add-wrap .pl-add { margin-top: 0; }
.pl-add-label { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 84px; }
.pl-add input[type=text] { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; min-width: 200px; }

.st-goals td:first-child, .st-goals th:first-child { min-width: 120px; white-space: nowrap; }
.st-goals td:nth-child(2), .st-goals th:nth-child(2) { min-width: 110px; white-space: nowrap; }

.st-team-body { display: flex; flex-direction: column; gap: 6px; }
.st-dir-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.st-dir-opts label { font-weight: 500 !important; }
.pl-goals-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pl-goal-in { width: 64px; height: 30px; border: 1px solid var(--line); border-radius: 6px; text-align: center; font: inherit; font-weight: 800; }
.pl-goal-in:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

/* ===== التنبيهات + سجل التعديلات ===== */
.st-cron { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.st-cron code { background: #0F172A; color: #E2E8F0; border-radius: 8px; padding: 8px 10px; font-size: 12px; overflow-x: auto; white-space: nowrap; text-align: left; }
.st-cron-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-sep { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.st-email-in { width: 200px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 12.5px; }
.st-audit-filters { display: flex; gap: 8px; }
.st-audit-filters select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--card); font: inherit; }
.st-audit td { font-size: 13px; }
.st-audit-time { white-space: nowrap; color: var(--muted); font-size: 12px !important; text-align: left !important; }
.st-area { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--hover); white-space: nowrap; }
.st-area.tasks { background: #DBEAFE; color: #1E40AF; }
.st-area.meetings { background: #EDE9FE; color: #5B21B6; }
.st-area.plans { background: #DCFCE7; color: #166534; }
.st-area.settings { background: #FEF3C7; color: #92400E; }
#auMore { align-self: center; }

/* ===== أرقام الخطة في لوحة المهام ===== */
.plan-item { display: flex; align-items: center; gap: 6px; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; line-height: 20px; background: #F0FDF4; border: 1px dashed #86EFAC; margin-bottom: 2px; }
.plan-item input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 13px; height: 13px; margin: 0; border-radius: 50%; border: 2px solid #16A34A; background: var(--card); cursor: pointer; display: grid; place-items: center; }
.plan-item input[type=checkbox]:checked { background: #16A34A; }
.plan-item input[type=checkbox]:checked::after { content: "✓"; color: #fff; font-size: 9px; font-weight: 800; line-height: 1; }
.plan-item .plan-val { font-weight: 800; color: #166534; }
.plan-item .title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); text-decoration: none; }
.plan-item small { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.plan-item.done { background: #DCFCE7; border-style: solid; border-color: #16A34A; }
.plan-item.done .title { text-decoration: line-through; color: var(--muted); }
.plan-item.gap { background: #FEF2F2; border-color: #FCA5A5; }
.plan-item.gap .plan-val { color: #DC2626; }

/* ===== دعوة مستخدم ===== */
.st-iv-perms, .st-iv-ents { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 6px; }
.st-iv-perms label, .st-iv-ents label { font-weight: 500 !important; }
.st-iv-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.st-iv-result { background: #ECFDF3; border: 1px solid #BBF7D0; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; color: #166534; }
.st-iv-link { display: flex; gap: 8px; }
.st-iv-link input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12.5px; background: var(--card); }
.st-iv-row-actions { white-space: nowrap; }
.st-danger { color: #DC2626 !important; }

/* ===== الجرس 🔔 ===== */
.notif { position: relative; }
.notif-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.notif-btn:hover { background: rgba(255,255,255,.24); }
.notif-btn.has svg { animation: notif-ring 1.6s ease-in-out 1; }
@keyframes notif-ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } }
.notif-count { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #F39200; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--blue); }
.notif-pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 120; width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: var(--card); color: var(--text); border-radius: 14px; box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 16px 40px rgba(16,30,70,.22); }
.notif-head { position: sticky; top: 0; background: var(--card); display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.notif-all { border: none; background: none; color: var(--blue); font: inherit; font-size: 12.5px; cursor: pointer; }
.notif-list { list-style: none; margin: 0; padding: 4px; }
.notif-list li { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.notif-list li:hover { background: var(--hover); }
.notif-list li.unread { background: var(--tint); font-weight: 600; }
.notif-list li.unread::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #F39200; float: inline-start; }
.notif-list li small { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.notif-list .notif-empty { color: var(--muted); text-align: center; cursor: default; }
.st-backup { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* الموبايل: قائمة الإشعارات على عرض الشاشة، والشريط اللي فوق أخف */
@media (max-width: 760px) {
  .notif-pop { position: fixed; top: 64px; left: 10px; right: 10px; width: auto; inset-inline-end: auto; }
  .topbar .user-box { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .topbar .user-box::-webkit-scrollbar { display: none; }
  .topbar .user-box .btn-ghost { white-space: nowrap; padding: 6px 12px; font-size: 13px; }
  .notif-btn { flex: none; }
}

/* ===== الطلبات في لوحة المهام ===== */
.request-item { display: flex; align-items: center; gap: 6px; padding: 2px 8px; margin-bottom: 2px; border-radius: 6px; background: #0891B2; color: #fff; font-size: 12.5px; font-weight: 700; line-height: 20px; cursor: pointer; }
.request-item .title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-item i { font-style: normal; }
.request-item .rq-st { font-size: 10.5px; font-weight: 600; background: rgba(255,255,255,.22); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.request-item.urgent { box-shadow: inset 0 0 0 2px #FCA5A5; }
.request-item.s-delivered { background: #7C3AED; }
.request-item.s-approved { background: #16A34A; opacity: .8; }
.request-item.s-approved .title { text-decoration: line-through; }
.request-item.s-changes { background: #D97706; }
.request-item:hover { filter: brightness(1.08); }

/* ===== صفحة الطلبات ===== */
.requests-page { background: var(--surface, #F4F6FB); }
.rq-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; padding: 20px 24px 40px; align-items: start; max-width: 1500px; margin: 0 auto; }
.rq-list-pane, .rq-detail { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: 0 1px 3px rgba(16,30,70,.08); }
.rq-list-pane { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 110px); }
.rq-list-head { display: flex; justify-content: space-between; align-items: center; }
.rq-list-head h1 { margin: 0; font-size: 19px; color: var(--blue); }
.rq-list-head h1 span { font-size: 13px; color: var(--muted); }
.rq-tabs button.active { background: var(--blue); color: #fff; }
.rq-tools { display: flex; gap: 8px; }
.rq-tools input, .rq-tools select { height: 36px; border: none; background: var(--hover); border-radius: 999px; padding: 0 12px; font: inherit; min-width: 0; }
.rq-tools input { flex: 1; }
.rq-list { overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.rq-none { color: var(--muted); text-align: center; padding: 20px 0; }
.rq-card { text-align: right; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.rq-card:hover { border-color: var(--blue); }
.rq-card.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,68,181,.15); background: var(--surface); }
.rq-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.rq-card-top b { font-size: 14px; }
.rq-card-meta, .rq-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.rq-card-meta .late { color: #DC2626; font-weight: 700; }
.rq-prio { color: #fff; background: var(--p); border-radius: 999px; padding: 0 8px; font-weight: 700; font-size: 11px; }
.rq-status { flex: none; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.rq-status.big { font-size: 13px; padding: 4px 14px; }
.rq-status.s-new { background: #DBEAFE; color: #1E40AF; }
.rq-status.s-progress { background: #FEF3C7; color: #92400E; }
.rq-status.s-delivered { background: #EDE9FE; color: #5B21B6; }
.rq-status.s-changes { background: #FFEDD5; color: #C2410C; }
.rq-status.s-approved { background: #DCFCE7; color: #166534; }
.rq-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.rq-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.rq-head h2 { margin: 0 0 6px; font-size: 20px; }
.rq-details { white-space: pre-wrap; background: var(--surface); border-radius: 10px; padding: 12px; margin-top: 12px; line-height: 1.8; }
.rq-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rq-ok { background: #16A34A !important; }
.rq-thread { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.rq-event { align-self: center; font-size: 12px; color: var(--muted); background: var(--hover); border-radius: 999px; padding: 3px 12px; }
.rq-msg { max-width: 85%; align-self: flex-start; background: var(--tint); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.rq-msg.mine { align-self: flex-end; background: var(--tint); }
.rq-msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.rq-msg-head small { color: var(--muted); }
.rq-msg-body { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; }
.rq-files { display: flex; flex-direction: column; gap: 8px; }
.rq-file { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.rq-file img, .rq-file video { max-width: 100%; max-height: 360px; border-radius: 8px; display: block; }
.rq-file audio { width: 100%; }
.rq-file-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.rq-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-reply-wrap { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.rq-reply-wrap h3 { margin: 0; font-size: 15px; color: var(--blue); }
.rq-reply { border: 2px dashed var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.rq-reply.drag { border-color: var(--blue); background: var(--surface); }
.rq-reply textarea { border: none; resize: vertical; font: inherit; min-height: 70px; outline: none; }
.rq-pending { display: flex; flex-wrap: wrap; gap: 6px; }
.rq-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--hover); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.rq-chip.bad { background: #FEE2E2; color: #DC2626; }
.rq-chip button { border: none; background: none; color: #DC2626; font-size: 15px; cursor: pointer; padding: 0; }
.rq-progress { height: 8px; background: #E5E9F2; border-radius: 999px; overflow: hidden; }
.rq-progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.rq-reply-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rq-reply-actions .btn-primary { margin-inline-start: auto; }
.rq-back { margin-bottom: 8px; }
@media (max-width: 760px) {
  .rq-layout { grid-template-columns: 1fr; padding: 12px; }
  .rq-list-pane { position: static; max-height: none; }
  body.rq-open .rq-list-pane { display: none; }
  body:not(.rq-open) .rq-detail { display: none; }
  .rq-msg { max-width: 100%; }
}

/* ===== طباعة المحاضر: هوامش جوه الصفحة + اللوجو المضمّن ===== */
@media print {
  .pv-wrap > thead td { padding: 10mm 14mm 0 !important; }
  .pv-wrap > tbody > tr > td { padding: 0 14mm !important; }
  .pv-foot-space { height: 12mm !important; }
  .pv-logo { display: inline-flex; }
  .pv-logo svg { width: 38px; height: 38px; }
}

/* ===== طباعة الخطة الشهرية (PDF احترافي بالعرض) ===== */
#plPrintView { display: none; }
@media print {
  body.plans-page > *:not(#plPrintView) { display: none !important; }
  body.plans-page { background: var(--card) !important; }
  #plPrintView { display: block !important; page: plan; font-family: 'Cairo', sans-serif; color: var(--text); font-size: 9pt; }
  #plPrintView * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .pp-wrap { width: 100%; border-collapse: collapse; }
  .pp-wrap > thead { display: table-header-group; }
  .pp-wrap > tfoot { display: table-footer-group; }
  .pp-wrap > thead > tr > td { padding: 8mm 10mm 0; }
  .pp-wrap > tbody > tr > td { padding: 0 10mm; }
  .pp-wrap > tfoot > tr > td { padding: 0 10mm 6mm; }
  .pp-head { display: flex; align-items: center; gap: 10px; background: #1A44B5; color: #fff; border-radius: 10px; padding: 8px 14px; margin-bottom: 10px; }
  .pp-logo { width: 40px; height: 40px; background: var(--card); border-radius: 8px; display: grid; place-items: center; flex: none; }
  .pp-logo svg { width: 30px; height: 30px; }
  .pp-brand { display: flex; flex-direction: column; line-height: 1.05; direction: ltr; text-align: left; }
  .pp-brand b { font-size: 14pt; letter-spacing: 1px; }
  .pp-brand span { font-size: 6.5pt; letter-spacing: 3px; color: #F39200; font-weight: 700; }
  .pp-title { display: flex; flex-direction: column; margin-inline-start: 18px; border-inline-start: 2px solid rgba(255,255,255,.35); padding-inline-start: 14px; }
  .pp-title b { font-size: 13pt; }
  .pp-title span { font-size: 8.5pt; opacity: .9; }
  .pp-date { margin-inline-start: auto; font-size: 8pt; opacity: .9; }
  .pp-foot { display: flex; justify-content: space-between; border-top: 2px solid #F39200; padding-top: 4px; margin-top: 8px; font-size: 7.5pt; color: #555; }
  .pp-cards { display: flex; gap: 8px; margin-bottom: 10px; }
  .pp-card { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; background: var(--surface); break-inside: avoid; }
  .pp-card b { font-size: 15pt; line-height: 1.2; }
  .pp-card span { font-size: 8pt; color: #555; }
  .pp-card.ok b, .pp-card.good b { color: #16A34A; }
  .pp-card.bad b, .pp-card.low b { color: #DC2626; }
  .pp-card.mid b { color: #D97706; }
  .pp-sec { margin-bottom: 10px; }
  .pp-sec h2 { font-size: 11pt; color: #1A44B5; margin: 0 0 5px; border-inline-start: 4px solid #F39200; padding-inline-start: 7px; break-after: avoid; }
  .pp-table { width: 100%; border-collapse: collapse; font-size: 8pt; }
  .pp-table th { background: #1A44B5; color: #fff; font-weight: 600; padding: 3px 4px; border: 1px solid #1A44B5; }
  .pp-table th.pp-type { background: #12348F; }
  .pp-table th.pp-sub { background: #2A55C8; font-size: 7pt; }
  .pp-table td { border: 1px solid var(--line); padding: 2px 4px; text-align: center; }
  .pp-table tr { break-inside: avoid; }
  .pp-table thead { display: table-header-group; }
  .pp-strong { font-weight: 700; }
  .pp-ok, .pp-table tr.pp-ok td { color: #15803D; font-weight: 700; }
  .pp-bad, .pp-table tr.pp-bad td { color: #DC2626; font-weight: 700; }
  .pp-none { color: #CBD5E1; }
  .pp-pct { display: inline-block; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 7pt; font-weight: 800; }
  .pp-pct.good { background: #16A34A; } .pp-pct.mid { background: #F59E0B; } .pp-pct.low { background: #DC2626; }
  .pp-grid { table-layout: fixed; font-size: 7.5pt; }
  .pp-grid th, .pp-grid td { padding: 2px 1px; }
  .pp-grid th:nth-child(1), .pp-grid th:nth-child(2) { width: 18mm; }
  .pp-grid th:nth-child(3) { width: 14mm; }
  .pp-grid th.pp-sum { width: 11mm; }
  .pp-grid th.pp-day { font-size: 6pt; font-weight: 500; white-space: nowrap; overflow: hidden; }
  .pp-grid th.today, .pp-grid th.pp-date.today { background: #F39200; }
  .pp-grid td:nth-child(-n+3) { text-align: right; padding-inline-start: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .pp-cell { font-weight: 800; }
  .pp-cell.done { background: #16A34A; color: #fff; }
  .pp-cell.gap { background: #DC2626; color: #fff; }
  .pp-cell.stopday { background: var(--tint); }
  .pp-grid tfoot td { background: var(--tint); font-weight: 700; }
}

/* رأس طباعة المحاضر بنفس هوية تقرير الخطة */
@media print {
  #mPrintView .pv-head { background: #1A44B5 !important; color: #fff; border: none !important; border-radius: 10px; padding: 8px 14px !important; }
  #mPrintView .pv-logo { width: 40px; height: 40px; background: var(--card); border-radius: 8px; display: grid; place-items: center; }
  #mPrintView .pv-logo svg { width: 30px; height: 30px; }
  #mPrintView .pv-brand b { color: #fff !important; }
  #mPrintView .pv-doc { color: #fff !important; }
}

/* ===== مهامي (المدير الفني) + المحضر للقراءة فقط ===== */
.btn-mytasks { display: inline-flex; align-items: center; gap: 4px; background: var(--card); color: var(--blue); font-weight: 800; font-size: 13.5px; padding: 6px 16px; border-radius: 999px; text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.btn-mytasks:hover { background: #FFF4E5; color: #C2410C; }
.mt-readonly input:disabled, .mt-readonly textarea:disabled, .mt-readonly select:disabled { background: #F8FAFC; color: var(--text, #1F2937); opacity: 1; cursor: default; }
.mt-readonly .att-btn:disabled { cursor: default; opacity: .8; }
.mt-ro-note { background: var(--tint); color: var(--blue); border: 1px solid #BFDBFE; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* طلب مُرسل (عند المدير العام) — إطار بدل التعبئة */
.request-item.sent { background: var(--card); color: #0E7490; border: 1.5px dashed #0891B2; padding: 1px 7px; }
.request-item.sent .rq-st { background: #E0F2FE; color: #0E7490; }
.request-item.sent.s-delivered { background: #F5F3FF; color: #6D28D9; border-color: #7C3AED; border-style: solid; }
.request-item.sent.s-delivered .rq-st { background: #7C3AED; color: #fff; }
.request-item.sent.s-changes { color: #B45309; border-color: #D97706; }
.request-item.sent.s-changes .rq-st { background: #FEF3C7; color: #B45309; }

/* ===== الهيدر الرسمي للطباعة (مشترك: التقرير، الخطة، المحاضر) ===== */
.tk-pw { width: 100%; border-collapse: collapse; background: var(--card); }
.tk-pw > thead { display: table-header-group; }
.tk-pw > tfoot { display: table-footer-group; }
.tk-pw > thead > tr > td { padding: 9mm 12mm 0; border: none; }
.tk-pw > tbody > tr > td { padding: 0 12mm; border: none; vertical-align: top; }
.tk-pw > tfoot > tr > td { padding: 0 12mm 7mm; border: none; }
.tkh { position: relative; display: flex; align-items: center; gap: 12px; padding: 0 0 9px; margin-bottom: 14px; border-bottom: 3px solid #1A44B5; background: var(--card); color: var(--text); font-family: 'Cairo', sans-serif; }
.tkh::after { content: ''; position: absolute; bottom: -7px; inset-inline-start: 0; width: 110px; height: 3px; background: #F39200; }
.tkh-logo { flex: none; display: flex; }
.tkh-logo svg { width: 44px; height: 44px; display: block; }
.tkh-brand { display: flex; flex-direction: column; line-height: 1.05; direction: ltr; text-align: left; flex: none; }
.tkh-brand b { color: #1A44B5; font-size: 15pt; font-weight: 800; letter-spacing: 1.5px; }
.tkh-brand span { color: #F39200; font-size: 6.5pt; font-weight: 700; letter-spacing: 3.6px; }
.tkh-title { display: flex; flex-direction: column; margin-inline-start: 6px; padding-inline-start: 14px; border-inline-start: 2px solid #D6DDEE; min-width: 0; }
.tkh-title b { font-size: 14pt; font-weight: 800; color: #0F2A72; line-height: 1.3; }
.tkh-title span { font-size: 8.5pt; color: #555; }
.tkh-date { margin-inline-start: auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 7pt; color: #777; line-height: 1.35; flex: none; }
.tkh-date b { font-size: 8.5pt; color: #222; font-weight: 700; }
.tkf { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 4px; border-top: 1.5px solid var(--line); font-size: 7.5pt; color: #666; font-family: 'Cairo', sans-serif; }
.tk-pw, .tk-pw * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ===== نافذة اختيار الأقسام ===== */
.sec-pick { border: none; border-radius: 16px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(15,23,42,.3); font-family: 'Cairo', sans-serif; }
.sec-pick::backdrop { background: rgba(15,23,42,.45); }
.sec-pick form { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.sec-pick h2 { margin: 0; font-size: 18px; color: var(--blue, #1A44B5); }
.sec-pick-hint { margin: 0 0 4px; font-size: 12.5px; color: var(--muted, #64748B); }
.sec-all { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--tint); border-radius: 10px; cursor: pointer; }
.sec-list { display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow: auto; }
.sec-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.sec-item:has(input:checked) { border-color: #93C5FD; background: var(--tint); }
.sec-item input, .sec-all input { width: 17px; height: 17px; margin-top: 3px; accent-color: #1A44B5; flex: none; }
.sec-item span { display: flex; flex-direction: column; }
.sec-item b { font-size: 14px; }
.sec-item small { font-size: 11.5px; color: var(--muted, #64748B); }
.sec-pick-err { margin: 0; color: #DC2626; font-size: 12.5px; font-weight: 600; }
.sec-pick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.sec-pick-actions .btn-ghost.dark { margin-inline-start: auto; }

/* ===== مكان ظهور الأزرار (الإعدادات) + الشريط العلوي ===== */
.st-link { grid-template-columns: 140px 1fr 1.4fr 150px 44px auto 30px 30px; }
.st-link .k-place { height: 34px; border: 1px solid var(--line, var(--line)); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: var(--card); }
.st-link .k-sys { font-size: 12.5px; color: var(--muted, #64748B); background: var(--tint); border-radius: 8px; padding: 7px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-link.sys .k-label { font-weight: 700; }
.st-link .l-lock { display: grid; place-items: center; font-size: 14px; opacity: .6; cursor: help; }
.st-link.hidden-link .st-link-prev { opacity: .35; }
.topbar .user-box .btn-ghost.top-link.active { background: var(--card); color: var(--blue, #1A44B5); font-weight: 700; }
@media (max-width: 760px) {
  .st-link { grid-template-columns: 1fr 44px 30px 30px; }
  .st-link .k-place { grid-column: 1 / -1; }
}

/* حالة مهام المحضر + متابعة المهام المسندة */
.mt-task { grid-template-columns: 1fr 160px 150px 74px 28px; align-items: center; }
.mt-task .tk-st { font-size: 12px; font-weight: 700; white-space: nowrap; text-align: center; border-radius: 999px; padding: 3px 6px; }
.mt-task .tk-st.ok { background: #DCFCE7; color: #15803D; }
.mt-task .tk-st.wait { background: #FEF3C7; color: #B45309; }
.request-item.follow-item { border-color: #7C3AED; color: #6D28D9; }
.request-item.follow-item .rq-st { background: #EDE9FE; color: #6D28D9; }
.request-item.follow-item.s-approved { border-style: solid; border-color: #16A34A; color: #15803D; background: #F0FDF4; opacity: 1; }
.request-item.follow-item.s-approved .title { text-decoration: line-through; }
.request-item.follow-item.s-approved .rq-st { background: #16A34A; color: #fff; }
@media (max-width: 760px) {
  .mt-task { grid-template-columns: 1fr 28px; }
  .mt-task .tk-st { grid-column: 1; justify-self: start; }
}

/* ===== خطة الشهر / خطة الموسم ===== */
.gl-mode { display: inline-flex; gap: 4px; background: var(--tint); border-radius: 999px; padding: 4px; margin: 4px 0 10px; }
.gl-tab { border: none; background: transparent; border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted, #64748B); cursor: pointer; }
.gl-tab.active { background: var(--card); color: var(--blue, #1A44B5); box-shadow: 0 1px 4px rgba(16,30,70,.12); }
.gl-tab[data-mode="season"].active { color: #7C3AED; }
.gl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.gl-bar select { min-width: 260px; max-width: 100%; }
.gl-del { color: #DC2626 !important; }
.gl-season-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; background: #F5F3FF; border: 1px solid #DDD6FE; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.gl-season-form label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; gap: 3px; }
.gl-season-form input { height: 34px; }
.gl-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.gl-label small { color: var(--muted, #64748B); }
.gl-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 800; color: #fff; }
.gl-badge.month { background: #1A44B5; }
.gl-badge.season { background: #7C3AED; }
.pl-seasons .pl-goals-head h2 { color: #6D28D9; }
.pl-season-box + .pl-season-box { margin-top: 14px; }
.pl-season-box .pl-gt-type, .pl-season-box thead tr:first-child th { background: #6D28D9 !important; }
.pl-season-box .pl-gt-sub { background: #7C3AED !important; }
.pl-season-left { font-size: 12.5px; font-weight: 700; color: #6D28D9; background: #EDE9FE; border-radius: 999px; padding: 2px 10px; }
@media print { .pl-seasons { display: none !important; } }

/* ===== v22: صلاحيات أدق + إضافة مستخدم + نقل انتقائي + حذف الطلب ===== */
.st-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.st-note { margin-top: 6px !important; background: var(--tint); border-radius: 8px; padding: 6px 10px; }
.st-perm-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.st-perm-chip { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 12.5px; font-weight: 600 !important; white-space: nowrap; cursor: pointer; }
.st-perm-chip input { width: 15px; height: 15px; accent-color: var(--blue); margin: 0; }
.st-perm-chip:has(input:checked) { background: var(--tint); border-color: #C7D6FB; color: var(--blue); }
.st-perm-chip.sub { border-style: dashed; }
.st-perm-chip.off { opacity: .45; cursor: not-allowed; }
.st-users .st-perm-cell { min-width: 380px; }
.st-udlg { width: min(640px, calc(100vw - 32px)); }
.st-udlg .st-perm-grid { padding-top: 6px; }
.st-tr-ents { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FAFBFF; }
.st-tr-list { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.st-tr-list label, .st-tr-all { font-weight: 500 !important; flex-direction: row !important; align-items: center; gap: 6px; }
.st-tr-list small { color: var(--muted, #64748B); }
.rq-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.rq-del { font-size: 13px; }
.rq-deleted-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.rq-deleted-note button { margin-inline-start: auto; }
.st-danger-bg { background: #DC2626 !important; border-color: #DC2626 !important; color: #fff !important; }
.rq-confirm { width: min(460px, calc(100vw - 32px)); }
.rq-confirm p { line-height: 1.8; color: var(--text-2); }
/* بدون صلاحية الطباعة والتصدير: الطباعة (حتى Ctrl+P) بتطلع رسالة بس */
@media print {
  body.no-export > * { display: none !important; }
  body.no-export::before { content: 'الطباعة والتصدير غير متاحة لحسابك — تواصل مع المدير العام.'; display: block; font: 700 18px Cairo, Tahoma, sans-serif; text-align: center; padding: 40px; }
}

/* ===== حجم الجداول (تكبير/تصغير + أعمدة مضغوطة) ===== */
.tk-sz-bar { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; background: #F1F5FB; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px; font-size: 12px; white-space: nowrap; }
.tk-sz-bar .tk-sz-lbl { color: var(--muted); padding: 0 6px; font-weight: 600; }
.tk-sz-bar button { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--blue); min-width: 26px; height: 26px; border-radius: 999px; cursor: pointer; padding: 0 6px; }
.tk-sz-bar button:hover:not(:disabled) { background: var(--card); }
.tk-sz-bar button:disabled { opacity: .35; cursor: default; }
.tk-sz-bar .tk-sz-val { min-width: 46px; color: var(--text); }
.tk-sz-bar .tk-sz-fit { border-inline-start: 1px solid var(--line); border-radius: 0 999px 999px 0; color: var(--text-2); }
.gl-label-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-sz .rp-table { font-size: calc(13px * var(--tk-scale, 1)); }
.tk-sz .rp-table th, .tk-sz .rp-table td { padding: calc(6px * var(--tk-scale, 1)) calc(9px * var(--tk-scale, 1)); }
.tk-sz .rp-table thead th { font-size: calc(12px * var(--tk-scale, 1)); }
.tk-sz .pl-goal-in, .tk-sz .st-goal-in { width: calc(56px * var(--tk-scale, 1)); height: calc(28px * var(--tk-scale, 1)); font-size: calc(13px * var(--tk-scale, 1)); }
.tk-sz .day-pct { font-size: calc(11px * var(--tk-scale, 1)); }
/* مضغوط = كل عمود على قد محتواه بدل ما يتوزع على عرض الصفحة */
.tk-sz.tk-compact .rp-table { width: auto; min-width: 0; }
.tk-sz.tk-compact { width: fit-content; max-width: 100%; }
.tk-sz.tk-compact .st-goals td:first-child, .tk-sz.tk-compact .st-goals th:first-child,
.tk-sz.tk-compact .st-goals td:nth-child(2), .tk-sz.tk-compact .st-goals th:nth-child(2) { min-width: 0; }
@media print { .tk-sz-bar { display: none !important; } }


/* ===== V3: أكتر من مسؤول + مهام مشتركة + دليل مشارَك ===== */
.who-more { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 8px; }
.who-more:empty { display: none; }
.who-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--tint); color: var(--blue); border: 1px solid #C7D6FB; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12.5px; font-weight: 700; }
.who-chip button { border: 0; background: var(--card); color: #DC2626; border-radius: 999px; width: 20px; height: 20px; cursor: pointer; font-weight: 800; line-height: 1; }
.who-add { min-width: 140px; height: 30px; border: 1px dashed #94A3B8; border-radius: 999px; padding: 0 10px; background: var(--card); font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.request-item.shared-item { border-color: #0891B2; color: #0E7490; background: #ECFEFF; border-style: solid; cursor: default; }
.request-item.shared-item input { width: 14px; height: 14px; margin: 0; accent-color: #0891B2; flex: none; }
.request-item.shared-item .rq-st { background: #CFFAFE; color: #0E7490; }
.request-item.shared-item.s-approved { border-color: #16A34A; color: #15803D; background: #F0FDF4; opacity: 1; }
.request-item.shared-item.s-approved .title { text-decoration: line-through; }
.request-item.shared-item.s-approved .rq-st { background: #16A34A; color: #fff; }
.auto-mark.shared-mark { background: #E0F2FE; color: #0369A1; }
.lg-share { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: var(--surface); }
.lg-share-list { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 6px; }
.lg-share-list label { font-weight: 500 !important; flex-direction: row !important; align-items: center; gap: 6px; }

/* ===== V4: حالة البريد SMTP ===== */
.st-smtp { border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; font-size: 13px; line-height: 1.8; }
.st-smtp.ok { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.st-smtp.bad { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.st-smtp small { color: inherit; opacity: .85; }

/* ===== V6: تنظيم الإعدادات + جدول المستخدمين + الحذف الآمن + إعادة التسمية ===== */
.st-wrap > .st-group, .st-wrap > #stForm { grid-column: 2; }
.st-group { margin: 22px 0 -4px; font-size: 15px; font-weight: 800; color: var(--text-2); border-bottom: 2px solid var(--line); padding-bottom: 6px; scroll-margin-top: 80px; }
.st-group:first-of-type { margin-top: 0; }
.st-nav .st-nav-g { display: block; font-size: 11.5px; color: var(--muted); margin: 10px 0 2px; padding-inline: 12px; font-weight: 800; }
.st-nav .st-nav-g:first-child { margin-top: 0; }
.st-users tr.st-user-off td { opacity: .6; }
.st-users tr.st-user-off td:last-child { opacity: 1; }
.st-u-email { font-size: 13px; color: var(--text-2); }
.st-act-menu { height: 32px; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; background: var(--card); font: inherit; font-size: 13px; font-weight: 700; color: var(--blue); cursor: pointer; }
.st-warn { background: #FEF3C7; color: #92400E; border-radius: 8px; padding: 6px 10px; }
#delBody ul { margin: 4px 0 10px; padding-inline-start: 20px; line-height: 1.9; font-size: 13.5px; }
#delBody b { font-size: 14px; }
.st-del-note { background: var(--tint); border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.8; }
.st-del-block { background: #FEF2F2; color: #991B1B; border-radius: 8px; padding: 10px; font-weight: 700; }
.st-del-ok { margin-top: 8px; font-weight: 700 !important; color: #991B1B; }
.pl-rn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 3px; line-height: 1; vertical-align: middle; }
.pl-rn:hover { color: var(--blue); }
@media print { .pl-rn { display: none !important; } }
.rq-edit-dlg { width: min(560px, calc(100vw - 32px)); }
.rq-event.edit { background: #FEF3C7; color: #92400E; }
/* V9 (مراجعة المالك 64): مهمة من الخطة — الضغط يروح لخانتها، والقلم للتعديل */
.task.from-plan .title { cursor: pointer; }
.task.from-plan .title:hover { text-decoration: underline; }
.task .plan-edit { flex: 0 0 auto; display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted, #64748B); font-size: 12px; line-height: 1; cursor: pointer; }
.task .plan-edit:hover, .task .plan-edit:focus-visible { border-color: var(--line, #E2E8F0); background: var(--card, #fff); color: var(--blue, #1A44B5); }
/* V9 (مراجعة المالك 70): المهمة اللي جيت لها من إشعار التنبيه */
.task.task-flash { outline: 3px solid #F39200; outline-offset: 2px; box-shadow: 0 0 0 7px rgba(243, 146, 0, .25); border-radius: 8px; animation: taskFlash 1s ease-in-out 3; }
@keyframes taskFlash { 50% { box-shadow: 0 0 0 11px rgba(243, 146, 0, .12); } }
@media (prefers-reduced-motion: reduce) { .task.task-flash { animation: none; } }
