/* «مؤشر استثمار الوقت» في تبويب «مهماتي» (scripts/patch-my-tasks-pressure.mjs) */

/* الزر في شريط الأدوات: نقطة ملونة بحالة الأسبوع */
#root .bmp-launch { font-weight: 700; }
#root .bmp-launch .bmp-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; box-shadow: 0 0 0 2px #fff; }
#root .bmp-launch.is-normal { color: #15803d; }
#root .bmp-launch.is-normal .bmp-dot { background: #16a34a; }
#root .bmp-launch.is-idle { color: #b45309; border-color: #fcd34d !important; background: #fffbeb !important; }
#root .bmp-launch.is-idle .bmp-dot { background: #d97706; }
#root .bmp-launch.is-over { color: #b91c1c; border-color: #fca5a5 !important; background: #fef2f2 !important; }
#root .bmp-launch.is-over .bmp-dot { background: #dc2626; }

/* اللوحة: ورقة سفلية في الجوال، ونافذة في الوسط على الشاشات الأكبر */
.bmp-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 42, .45);
  font-family: inherit;
}
.bmp-panel {
  width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  background: #fff; color: #1e293b;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(15, 23, 42, .25);
  overflow: hidden;
}
@media (min-width: 760px) {
  .bmp-overlay { align-items: center; padding: 24px; }
  .bmp-panel { max-width: 720px; border-radius: 18px; box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
}
.bmp-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #f1f5f9; }
.bmp-head-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: #dcfce7; color: #15803d; }
.bmp-head-icon.is-idle { background: #fef3c7; color: #b45309; }
.bmp-head-icon.is-over { background: #fee2e2; color: #b91c1c; }
.bmp-head-text { flex: 1; min-width: 0; }
.bmp-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.bmp-head p { margin: 1px 0 0; font-size: 12px; color: #94a3b8; }
.bmp-x { width: 34px; height: 34px; border-radius: 10px; font-size: 22px; line-height: 1; color: #64748b; background: #f8fafc; border: 1px solid #e2e8f0; cursor: pointer; }
.bmp-x:hover { background: #f1f5f9; color: #0f172a; }

.bmp-body { overflow-y: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.bmp-body section { display: flex; flex-direction: column; gap: 10px; }
.bmp-body h3 { margin: 0; font-size: 14px; font-weight: 800; color: #0f172a; }
.bmp-body h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: #64748b; }
.bmp-muted { font-size: 12px; color: #94a3b8; margin: 0; }
.bmp-muted.is-late { color: #dc2626; font-weight: 600; }

.bmp-summary { margin: 0; padding: 11px 13px; border-radius: 12px; font-size: 14px; font-weight: 600; line-height: 1.75; background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.bmp-summary.is-idle { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.bmp-summary.is-over { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }

/* ثلاث خانات: هذا الأسبوع والقادم والماضي */
.bmp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bmp-fact { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 12px; border: 1px solid #e2e8f0; border-top: 3px solid #16a34a; min-width: 0; }
.bmp-fact.is-idle { border-top-color: #d97706; }
.bmp-fact.is-over { border-top-color: #dc2626; }
.bmp-fact-title { font-size: 11px; color: #94a3b8; font-weight: 700; }
.bmp-fact strong { font-size: 13.5px; font-weight: 800; }
.bmp-fact.is-normal strong { color: #15803d; }
.bmp-fact.is-idle strong { color: #b45309; }
.bmp-fact.is-over strong { color: #b91c1c; }
.bmp-fact-note { font-size: 11px; color: #64748b; }

/* يومًا بيوم */
.bmp-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bmp-switch { display: inline-flex; padding: 2px; background: #f1f5f9; border-radius: 10px; gap: 2px; }
.bmp-switch button { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 12px; font-weight: 700; color: #475569; cursor: pointer; }
.bmp-switch button.is-active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.bmp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: #64748b; }
.bmp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bmp-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 3px; }
.bmp-legend i.is-ontime { background: #60a5fa; }
.bmp-legend i.is-late { background: #ef4444; }
.bmp-legend i.is-shift { width: 14px; height: 10px; background: #f1f5f9; border: 1px solid #cbd5e1; }

.bmp-rows { list-style: none; margin: 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.bmp-row + .bmp-row { border-top: 1px solid #f1f5f9; }
.bmp-row.is-today { background: #f5f7ff; }
.bmp-row-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: transparent; text-align: start; cursor: pointer; font: inherit; color: inherit; }
.bmp-row-btn:hover { background: #f8fafc; }
.bmp-row-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: -2px; }
.bmp-row-day { width: 74px; flex-shrink: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bmp-row-day b { font-size: 13px; }
.bmp-row.is-today .bmp-row-day b { color: #4338ca; }
.bmp-row-day small { font-size: 11px; color: #94a3b8; }
.bmp-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
/* المسار = ساعات الدوام، والتعبئة = ساعات المهام؛ ما زاد على الدوام يظهر بعد العلامة */
.bmp-track { position: relative; display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: linear-gradient(to left, #f1f5f9 var(--shift), transparent var(--shift)); box-shadow: inset 0 0 0 1px #e2e8f0; }
.bmp-fill { display: block; height: 100%; flex-shrink: 0; }
.bmp-fill.is-ontime { background: #60a5fa; }
.bmp-fill.is-late { background: #ef4444; }
.bmp-shift-mark { position: absolute; top: -2px; bottom: -2px; inset-inline-start: var(--shift); width: 2px; background: #0f172a; }
.bmp-row-text { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #475569; }
.bmp-tag { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: #dcfce7; color: #166534; }
.bmp-tag.is-idle { background: #fef3c7; color: #92400e; }
.bmp-tag.is-over { background: #fee2e2; color: #991b1b; }
.bmp-row-detail { padding: 2px 12px 12px; padding-inline-start: 96px; }
.bmp-row-detail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bmp-row-detail li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; }
@media (max-width: 480px) {
  .bmp-row-day { width: 62px; }
  .bmp-row-detail { padding-inline-start: 12px; }
}
.bmp-link { background: none; border: 0; padding: 0; font: inherit; color: #3730a3; font-weight: 600; text-align: start; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.bmp-link:hover { text-decoration: underline; }
.bmp-row-detail .bmp-muted, .bmp-focus .bmp-muted { flex-shrink: 0; white-space: nowrap; }

/* أسباب التراكم: شريط نسب ثم شرح كل سبب */
.bmp-two { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .bmp-two { grid-template-columns: 1fr 1fr; } }
.bmp-two > div { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; }
.bmp-causes { display: flex; flex-direction: column; gap: 8px; }
.bmp-cause-strip { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #f1f5f9; gap: 2px; }
.bmp-cause-strip span { display: block; height: 100%; }
.bmp-cause { display: flex; gap: 8px; align-items: flex-start; }
.bmp-cause > i { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; flex-shrink: 0; }
.bmp-cause strong, .bmp-cause b { font-size: 13px; }
.bmp-cause p { margin: 2px 0 0; font-size: 11.5px; color: #64748b; line-height: 1.6; }

/* ابدأ اليوم بـ */
.bmp-focus { list-style: none; counter-reset: bmp; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bmp-focus li { counter-increment: bmp; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 13px; }
.bmp-focus li::before { content: counter(bmp); flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #eef2ff; color: #4338ca; font-size: 12px; font-weight: 800; }
.bmp-focus li .bmp-link { flex: 1; }

/* الاقتراحات */
.bmp-tips { display: flex; flex-direction: column; gap: 8px; }
.bmp-tip { border-radius: 12px; padding: 10px 12px; border: 1px solid #e2e8f0; border-inline-start-width: 4px; background: #fff; }
.bmp-tip strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.bmp-tip p { margin: 0; font-size: 12.5px; line-height: 1.75; color: #334155; }
.bmp-tip.is-red { border-inline-start-color: #dc2626; background: #fffafa; }
.bmp-tip.is-amber { border-inline-start-color: #d97706; background: #fffcf5; }
.bmp-tip.is-violet { border-inline-start-color: #7c3aed; background: #fcfaff; }
.bmp-tip.is-teal { border-inline-start-color: #0f766e; background: #f8fdfc; }
.bmp-tip.is-orange { border-inline-start-color: #ea580c; background: #fffbf7; }
.bmp-tip.is-slate { border-inline-start-color: #64748b; }
.bmp-tip.is-green { border-inline-start-color: #16a34a; background: #f9fefa; }
.bmp-tip-btn { margin-top: 8px; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid #c7d2fe; background: #eef2ff; color: #3730a3; font-size: 12px; font-weight: 700; cursor: pointer; }
.bmp-tip-btn:hover { background: #e0e7ff; }

.bmp-foot { border-top: 1px solid #f1f5f9; padding-top: 12px; }
.bmp-foot .bmp-muted { line-height: 1.8; }
