/* تنسيقات مشتركة لعناصر النماذج (Tailwind للتخطيط، وهذا الملف لعناصر الإدخال) */
body { font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; font-size: 15px; line-height: 1.7; color: #1e293b; }
h1, h2, h3 { line-height: 1.4; }

/* بطاقة السؤال */
.q-code { flex-shrink: 0; direction: ltr; font-size: .9rem; font-weight: 800; color: #1e40af; background: #eff6ff;
  border: 1px solid #dbeafe; border-radius: .375rem; padding: .1rem .5rem; margin-top: .2rem; }
.q-text { font-size: 1.12rem; line-height: 1.95; color: #0f172a; font-weight: 700; }
.q-card:hover { border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }

.field { margin-bottom: 1rem; }
.field > label { display: block; font-weight: 600; margin-bottom: .35rem; color: #334155; font-size: .9rem; }
.field input[type=text], .field input[type=password], .field input[type=number], .field input[type=email],
.field input[type=file], .field select, .field textarea, .ctl {
  width: 100%; border: 1px solid #cbd5e1; border-radius: .5rem; padding: .5rem .75rem;
  background: #fff; font-size: .95rem; color: #0f172a;
}
.field select[multiple] { min-height: 8rem; }
.field input:focus, .field select:focus, .field textarea:focus, .ctl:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.field .errorlist, .errorlist { color: #b91c1c; font-size: .85rem; margin-top: .25rem; list-style: none; padding: 0; }
.field .help { color: #64748b; font-size: .8rem; margin-top: .25rem; }
.field ul:not(.errorlist) { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.field ul:not(.errorlist) label { font-weight: 400; display: inline-flex; align-items: center; gap: .35rem; }
.field input[type=checkbox] { width: 1rem; height: 1rem; }

.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem 1rem; border-radius: .5rem;
  font-size: .9rem; font-weight: 600; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-primary { background: #1d4ed8; color: #fff; }
.btn-primary:hover { background: #1e40af; }
.btn-light { background: #fff; color: #1e293b; border-color: #cbd5e1; }
.btn-light:hover { background: #f1f5f9; }
.btn-danger { background: #fff; color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: .25rem .6rem; font-size: .8rem; }
.btn-danger-solid { background: #b91c1c; color: #fff; }
.btn-danger-solid:hover { background: #991b1b; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { background: #f1f5f9; color: #334155; font-weight: 600; text-align: right; padding: .6rem .75rem;
  border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
table.data td { padding: .55rem .75rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
table.data tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }

.ltr { direction: ltr; unicode-bidi: embed; }

/* شاشة العمل على الملف */
.answer-opt { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .9rem; border: 1px solid #cbd5e1;
  border-radius: 999px; cursor: pointer; font-size: .85rem; background: #fff; user-select: none; transition: all .12s; }
.answer-opt:hover { border-color: #94a3b8; }
.answer-opt input { accent-color: #1d4ed8; }
.answer-opt:has(input:checked) { border-color: #1d4ed8; background: #eff6ff; color: #1e3a8a; font-weight: 600; }
.answer-opt.no:has(input:checked) { border-color: #b91c1c; background: #fef2f2; color: #991b1b; }
.answer-opt.na:has(input:checked) { border-color: #64748b; background: #f1f5f9; color: #334155; }
fieldset[disabled] .answer-opt { cursor: default; opacity: .85; }
/* ---------- بطاقات عامة ---------- */
body { background: #f4f6fa; }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.section-title { font-weight: 700; color: #0f172a; font-size: .95rem; }

/* ---------- رأس ملف التدقيق ---------- */
.eng-header { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06); border-top: 4px solid #1d4ed8; }
.file-no { font-size: .8rem; font-weight: 700; color: #1e3a8a; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 999px; padding: .15rem .75rem; }
.stage-pill { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .15rem .7rem; border: 1px solid; }
.stage-preparation { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.stage-reviewer_review { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.stage-partner_review { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.stage-closed { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.eng-facts { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 0; margin: 1rem 1.5rem 0;
  border: 1px solid #f1f5f9; border-radius: .75rem; background: #f8fafc; }
@media (min-width: 768px) { .eng-facts { grid-template-columns: 14rem repeat(3, minmax(0, 1fr)); } }
.eng-facts > div { padding: .75rem 1rem; }
@media (min-width: 768px) { .eng-facts > div + div { border-right: 1px solid #e2e8f0; } }
.eng-facts dt { font-size: .75rem; color: #64748b; margin-bottom: .35rem; }
.eng-facts dd { font-size: .875rem; color: #0f172a; }
.person { display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 999px; padding: .1rem .65rem .1rem .2rem; font-size: .8rem; font-weight: 600; }
.avatar { width: 1.5rem; height: 1.5rem; border-radius: 999px; display: inline-flex; align-items: center;
  justify-content: center; font-size: .75rem; font-weight: 700; background: #fef3c7; color: #92400e; }
.avatar-blue { background: #dbeafe; color: #1e40af; }
.avatar-violet { background: #ede9fe; color: #5b21b6; }
.eng-tabs { display: flex; flex-wrap: wrap; gap: .25rem; padding: .75rem 1.25rem 0; margin-top: .75rem; }
.eng-tabs a { padding: .55rem 1rem; font-size: .875rem; font-weight: 600; color: #64748b;
  border-bottom: 3px solid transparent; }
.eng-tabs a:hover { color: #1e3a8a; }
.eng-tabs a.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }

.completion-strip { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: .5rem; margin: .75rem 1.5rem 0; }
@media (min-width: 768px) { .completion-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.completion { display: flex; align-items: center; gap: .6rem; border: 1px dashed #cbd5e1; border-radius: .75rem; padding: .5rem .75rem; }
.completion .mark { width: 1.6rem; height: 1.6rem; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; background: #f1f5f9; color: #94a3b8; flex-shrink: 0; }
.completion.done { border-style: solid; border-color: #bbf7d0; background: #f0fdf4; }
.completion.done .mark { background: #16a34a; color: #fff; }

/* ---------- قائمة النماذج الجانبية ---------- */
.tab-btn { flex: 1; padding: .7rem .5rem; font-weight: 700; color: #64748b; border-bottom: 2px solid #e2e8f0; }
.tab-btn.active { color: #1d4ed8; border-bottom-color: #1d4ed8; background: #f8fafc; }
.tab-count { font-size: .7rem; background: #f1f5f9; color: #475569; border-radius: 999px; padding: 0 .4rem; margin-right: .25rem; }
.forms-nav { padding: .4rem; max-height: 58vh; overflow-y: auto; font-size: .875rem; }
.form-link { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: .5rem;
  border-right: 3px solid transparent; color: #334155; }
.form-link:hover { background: #f8fafc; }
.form-link .code { direction: ltr; width: 3.4rem; flex-shrink: 0; font-size: .75rem; font-weight: 700; color: #64748b; text-align: right; }
.form-link .name { flex: 1; min-width: 0; line-height: 1.5; }
.form-link .check { flex-shrink: 0; }
.form-link.active { background: #eff6ff; color: #1e3a8a; font-weight: 700; border-right-color: #1d4ed8; }
.form-link.active .code { color: #1d4ed8; }

/* ---------- مراحل سير العمل ---------- */
.stepper { display: flex; justify-content: space-between; position: relative; }
.stepper::before { content: ""; position: absolute; top: .8rem; right: 12%; left: 12%; height: 2px; background: #e2e8f0; }
.stepper li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.stepper .dot { width: 1.6rem; height: 1.6rem; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; background: #fff; border: 2px solid #cbd5e1; color: #94a3b8; z-index: 1; }
.stepper .label { font-size: .7rem; color: #94a3b8; line-height: 1.3; }
.stepper li.done .dot { background: #16a34a; border-color: #16a34a; color: #fff; }
.stepper li.done .label { color: #166534; }
.stepper li.current .dot { background: #1d4ed8; border-color: #1d4ed8; color: #fff; box-shadow: 0 0 0 4px #dbeafe; }
.stepper li.current .label { color: #1e3a8a; font-weight: 700; }
.timeline { border-right: 2px solid #e2e8f0; padding-right: .75rem; display: flex; flex-direction: column; gap: .6rem;
  max-height: 14rem; overflow-y: auto; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; right: -1.08rem; top: .35rem; width: .55rem; height: .55rem;
  border-radius: 999px; background: #1d4ed8; }
.timeline li.return::before { background: #dc2626; }
.timeline li.reopen::before { background: #d97706; }
.timeline li.change::before { background: #7c3aed; }

/* ---------- لوحة التحكم ---------- */
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; color: #fff;
  border-radius: 1rem; padding: 1.25rem 1.5rem;
  background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 55%, #0ea5e9 100%); box-shadow: 0 6px 20px rgba(29, 78, 216, .25); }
.kpi { display: flex; align-items: center; gap: .9rem; border-radius: 1rem; padding: 1rem 1.1rem; color: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12); transition: transform .12s; }
.kpi:hover { transform: translateY(-2px); }
.kpi-icon { width: 2.75rem; height: 2.75rem; border-radius: .8rem; background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.kpi-label { font-size: .8rem; opacity: .9; }
.kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.kpi-indigo { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.kpi-amber  { background: linear-gradient(135deg, #d97706, #f59e0b); }
.kpi-blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.kpi-violet { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.kpi-green  { background: linear-gradient(135deg, #059669, #10b981); }
.kpi-red    { background: linear-gradient(135deg, #b91c1c, #ef4444); }

.board-col { border-radius: 1rem; border: 1px solid; overflow: hidden; }
.board-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; color: #fff; }
.board-count { background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 0 .6rem; font-weight: 700; font-size: .85rem; }
.board-col > div { padding: .75rem; display: flex; flex-direction: column; gap: .75rem; overflow-y: auto; }
.board-card { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; padding: .8rem;
  border-right-width: 4px; transition: box-shadow .12s, transform .12s; }
.board-card:hover { box-shadow: 0 4px 12px rgba(15, 23, 42, .1); transform: translateY(-1px); }
.board-amber  { background: #fffbeb; border-color: #fde68a; } .board-amber .board-head { background: #f59e0b; } .board-amber .board-card { border-right-color: #f59e0b; }
.board-blue   { background: #eff6ff; border-color: #bfdbfe; } .board-blue .board-head { background: #2563eb; } .board-blue .board-card { border-right-color: #2563eb; }
.board-violet { background: #f5f3ff; border-color: #ddd6fe; } .board-violet .board-head { background: #7c3aed; } .board-violet .board-card { border-right-color: #7c3aed; }
.board-green  { background: #f0fdf4; border-color: #bbf7d0; } .board-green .board-head { background: #059669; } .board-green .board-card { border-right-color: #059669; }

/* ---------- ميزان المراجعة: تعديل مباشر ---------- */
.tb-in { border: 1px solid transparent; background: transparent; border-radius: .375rem; padding: .25rem .4rem;
  font-size: .85rem; width: 100%; color: #0f172a; }
.tb-in:hover { border-color: #cbd5e1; background: #fff; }
.tb-in:focus { outline: none; border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
form .tb-in { border-color: #cbd5e1; background: #fff; }
.tb-num { direction: ltr; text-align: left; width: 7.5rem; font-variant-numeric: tabular-nums; }
.tb-table td { padding: .3rem .45rem; vertical-align: middle; }
.tb-table thead th { background: #1e3a8a; color: #fff; border-bottom: 0; }
.tb-table tfoot td { background: #e2e8f0; padding: .6rem .75rem; }
.tb-hl td { background: #fef3c7; }
.tb-hl:hover td { background: #fde68a !important; }

/* ---------- العناوين والأسئلة: خط أكبر وأعرض ---------- */
.page-title { font-size: 1.2rem; font-weight: 800; color: #0f172a; }
h1 { font-weight: 800 !important; }
h2 { font-weight: 800 !important; }
.section-title { font-size: 1.05rem !important; font-weight: 800 !important; }

/* ---------- أوراق العمل ---------- */
.wp-head { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 0; margin-top: 1rem;
  border: 1px solid #e2e8f0; border-radius: .75rem; overflow: hidden; }
@media (min-width: 768px) { .wp-head { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wp-head > div { padding: .55rem .9rem; border-bottom: 1px solid #f1f5f9; background: #f8fafc; }
.wp-head dt { font-size: .7rem; color: #64748b; }
.wp-head dd { font-weight: 700; color: #0f172a; font-size: .9rem; }
.wp-table td { white-space: nowrap; }
.wp-card { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border: 1px solid #e2e8f0; border-radius: .75rem;
  background: #fff; transition: box-shadow .12s, border-color .12s; }
.wp-card:hover { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }

/* ---------- C4 ---------- */
.c4-flag td { background: #fef2f2; }
.c4-flag td:first-child { box-shadow: inset -3px 0 0 #dc2626; }

/* ---------- المرفقات ---------- */
.dropzone.drag-over { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.save-ok { color: #15803d; }
.save-err { color: #b91c1c; }
.htmx-request .saving-indicator { display: inline; }
.saving-indicator { display: none; color: #64748b; }
dialog::backdrop { background: rgba(15, 23, 42, .45); }

/* ======================================================================
   تنسيق الملف (الإصدار 2): ألوان أوضح وتمييز للحالة والأهمية النسبية
   ====================================================================== */
body { background: #eef2f7; }

/* رأس الملف: شريط ملوّن */
.eng-header { border-top: 0; border-radius: 1.25rem; box-shadow: 0 8px 24px rgba(15, 23, 42, .08); }
.eng-band { padding: 1.5rem 1.75rem 1.4rem; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #2563eb 0%, #1e3a8a 55%, #172554 100%); }
.band-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); color: #fff;
  border-radius: 999px; padding: .2rem .8rem; }
.eng-band .stage-pill { border-color: transparent; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.band-progress #eng-progress .bg-slate-100 { background: rgba(255, 255, 255, .2); }
.band-progress #eng-progress span { color: #fff; }
.band-progress #eng-progress .bg-gradient-to-l { background: linear-gradient(90deg, #34d399, #a7f3d0); }

/* صندوق الأهمية النسبية في الرأس */
.mat-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; min-width: min(30rem, 100%);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); border-radius: 1rem; padding: .6rem;
  backdrop-filter: blur(4px); transition: background .15s; }
.mat-box:hover { background: rgba(255, 255, 255, .16); }
.mat-item { background: rgba(255, 255, 255, .1); border-radius: .75rem; padding: .55rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.mat-item span { font-size: .72rem; color: #bfdbfe; }
.mat-item b { font-size: 1.15rem; font-weight: 800; color: #fff; }
.mat-item.main { background: #fbbf24; }
.mat-item.main span { color: #78350f; font-weight: 700; }
.mat-item.main b { color: #451a03; font-size: 1.45rem; }
.mat-item.warn { grid-column: 1 / -1; background: #fef3c7; }
.mat-item.warn span { color: #92400e; }
.mat-item.warn b { color: #92400e; font-size: 1rem; }
.eng-facts { margin-top: 1.1rem; }
.eng-tabs a { border-radius: .6rem .6rem 0 0; }
.eng-tabs a.active { background: #eff6ff; }

/* شريط نماذج الميزان */
.tb-bar { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: .75rem; align-items: stretch; }
@media (min-width: 900px) { .tb-bar { grid-template-columns: 1.2fr 1fr 1fr auto; } }
.tb-bar-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; padding: .8rem 1rem;
  display: flex; flex-direction: column; gap: .15rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.tb-bar-item span { font-size: .78rem; color: #64748b; font-weight: 600; }
.tb-bar-item b { font-size: 1.35rem; font-weight: 800; color: #0f172a; }
.tb-bar-item small { font-size: .72rem; color: #64748b; }
.tb-bar-item.mat { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; }
.tb-bar-item.mat b { color: #92400e; }
.tb-bar-item.hot { background: linear-gradient(135deg, #fff1f2, #ffe4e6); border-color: #fda4af; }
.tb-bar-item.hot b { color: #be123c; }
.tb-bar-btn { border-radius: 1rem; padding: .8rem 1.2rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb); box-shadow: 0 4px 12px rgba(37, 99, 235, .25); }
.tb-bar-btn:hover { background: linear-gradient(135deg, #1e40af, #1d4ed8); }

/* القائمة الجانبية: حالة كل نموذج بلون */
.form-link .dot { width: .55rem; height: .55rem; border-radius: 999px; flex-shrink: 0; background: #cbd5e1; }
.form-link.st-partial .dot { background: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; }
.form-link.st-done .dot { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.form-link.st-done .name { color: #166534; }
.form-link.active { background: linear-gradient(90deg, #eff6ff, #dbeafe); }
.nav-group { font-size: .7rem; font-weight: 800; color: #1e3a8a; background: #f1f5f9; border-radius: .4rem;
  padding: .3rem .6rem; margin: .5rem .2rem .2rem; letter-spacing: .02em; }
.nav-group:first-child { margin-top: .1rem; }

/* بطاقة السؤال: لون الحافة حسب الإجابة */
.q-card { border-right-width: 5px; border-right-color: #e2e8f0; transition: border-color .15s, box-shadow .15s; }
.q-card[data-answer="yes"] { border-right-color: #16a34a; }
.q-card[data-answer="no"] { border-right-color: #dc2626; background: #fffafa; }
.q-card[data-answer="na"] { border-right-color: #94a3b8; }
.q-code { background: linear-gradient(135deg, #1d4ed8, #3b82f6); color: #fff; border: 0; }

/* أزرار الإجابة */
.answer-opt.yes:has(input:checked) { border-color: #16a34a; background: #dcfce7; color: #14532d; }
.answer-opt.no:has(input:checked) { border-color: #dc2626; background: #fee2e2; color: #7f1d1d; }
.answer-opt.na:has(input:checked) { border-color: #64748b; background: #e2e8f0; color: #1e293b; }
.answer-opt input { width: 1rem; height: 1rem; }

/* عناوين الأقسام والبطاقات */
.section-title { display: flex; align-items: center; gap: .5rem; color: #1e3a8a !important; }
.section-title::before { content: ""; width: .35rem; height: 1.1rem; border-radius: 999px; background: linear-gradient(#2563eb, #60a5fa); }
.card { border-radius: 1rem; }
.tb-table thead th { background: linear-gradient(180deg, #1e40af, #1e3a8a); }

/* الهوية والتخطيط في theme.css (الملف الوحيد للتصميم) */
.print-header { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff !important; font-size: 12px; }
  .no-print, .sidebar, .topbar, aside, .eng-tabs, .btn, .tb-bar-btn, form button, .dropzone,
  dialog, #workflow { display: none !important; }
  .print-header { display: flex !important; align-items: center; justify-content: space-between;
    border-bottom: 2px solid #12315C; padding-bottom: 6px; margin-bottom: 10px; }
  .print-header img { height: 46px; width: auto; }
  .print-meta { font-size: 10px; color: #64748b; }
  main { max-width: none !important; padding: 0 !important; }
  .card, .eng-header, .q-card { box-shadow: none !important; break-inside: avoid; }
  .eng-band { background: #fff !important; color: #0f172a !important; border-bottom: 1px solid #e2e8f0; }
  .eng-band h1, .eng-band .text-blue-100, .eng-band b { color: #0f172a !important; }
  .mat-item, .mat-item.main { background: #f8fafc !important; border: 1px solid #e2e8f0; }
  .mat-item span, .mat-item b { color: #0f172a !important; }
  .lg\:grid-cols-\[19rem_minmax\(0\2c 1fr\)\] { grid-template-columns: 1fr !important; }
  input, select, textarea { border: 0 !important; background: transparent !important; }
}

.eng-tabs a.print-tab { color: #fff; background: #b0444a; border-radius: .6rem; margin-bottom: .35rem; }
.eng-tabs a.print-tab:hover { background: #8f3439; color: #fff; }

/* عدد المتطلبات قيد الانتظار على تبويب الملف */
.tab-count { display: inline-flex; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; align-items: center; justify-content: center;
  border-radius: 999px; background: #f59e0b; color: #fff; font-size: .7rem; font-weight: 800; }

/* إنجاز المرحلة وعلامة المراجعة */
.progress-label { color: #64748b; }
.band-progress .progress-label, .band-progress .progress-sub { color: #dbeafe; }
.review-mark { font-size: .65rem; font-weight: 800; color: #6d28d9; background: #ede9fe; border-radius: 999px; padding: 0 .4rem; white-space: nowrap; }
.review-box { border-right: 4px solid #7c3aed; }

/* الرقم المرجعي للعميل */
.ref-no { display: inline-block; font-size: .7rem; font-weight: 600; color: #0f766e; background: #ccfbf1; border-radius: 999px;
  padding: 0 .45rem; white-space: nowrap; vertical-align: middle; }

/* P6 النسب المالية */
.ratios tr.na-row td { color: #94a3b8; background: #f8fafc; }

/* لوحة التحكم: رسم المراحل (سلسلة واحدة، لون واحد، القيمة مكتوبة) وتمييز المتأخر */
.stage-chart { display: flex; flex-direction: column; gap: .55rem; }
.sc-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 2.5rem; align-items: center; gap: .75rem;
  padding: .3rem .4rem; border-radius: .5rem; color: inherit; }
.sc-row:hover { background: #f1f5f9; }
.sc-label { font-size: .85rem; font-weight: 600; color: #334155; }
.sc-track { display: block; height: .7rem; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.sc-bar { display: block; height: 100%; min-width: 2px; background: #2563eb; border-radius: 4px 0 0 4px; }
.sc-value { font-weight: 800; color: #0f172a; text-align: left; font-variant-numeric: tabular-nums; }
.board-card.overdue { border-color: #fca5a5; box-shadow: inset -4px 0 0 #dc2626; }

/* ================= لوحة التحكم (تصميم مبسّط) ================= */
.dh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem;
  padding: 1.1rem 1.4rem; border-radius: 1.1rem; color: #fff;
  background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 60%, #0ea5e9 100%); box-shadow: 0 6px 18px rgba(29, 78, 216, .22); }
.dh-hello { font-size: 1.35rem; font-weight: 800; }
.dh-date { font-size: .8rem; opacity: .85; margin-top: .1rem; }
.dh-filters { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; flex: 1; justify-content: flex-end; min-width: min(100%, 22rem); }
.dh-ctl { border: 0; border-radius: .7rem; padding: .55rem .8rem; font: inherit; font-size: .9rem; color: #0f172a; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.dh-ctl:focus { outline: 3px solid rgba(255, 255, 255, .45); }
.dh-search { flex: 1; min-width: 12rem; max-width: 26rem; }
.dh-clear { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 999px;
  background: rgba(255, 255, 255, .2); color: #fff; font-weight: 800; }
.dash-alert { display: flex; justify-content: space-between; border-radius: .9rem; background: #fef2f2; border: 1px solid #fecaca;
  color: #991b1b; padding: .75rem 1.1rem; margin-bottom: 1.25rem; font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { display: flex; align-items: center; gap: .85rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem;
  padding: .9rem 1rem; transition: border-color .15s, box-shadow .15s; }
.stat:hover { border-color: #bfdbfe; box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
.stat b { display: block; font-size: 1.65rem; line-height: 1.1; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.stat small { font-size: .8rem; color: #64748b; font-weight: 600; }
.stat-ico { width: 2.6rem; height: 2.6rem; border-radius: .8rem; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0; }
.ico-indigo { background: #eef2ff; } .ico-blue { background: #eff6ff; } .ico-green { background: #ecfdf5; } .ico-red { background: #fef2f2; }
.stat-alert { border-color: #fecaca; background: #fffafa; }
.stat-alert b { color: #b91c1c; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.dash-side { display: flex; flex-direction: column; gap: 1.25rem; }
.dcard { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; padding: 1rem 1.1rem; }
.dcard-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .8rem; }
.dcard-head h2 { font-size: 1.05rem; font-weight: 800; color: #0f172a; }
.muted-sm { font-size: .78rem; color: #64748b; font-weight: 500; }
.link-sm { font-size: .82rem; color: #1d4ed8; white-space: nowrap; }
.link-sm:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.chip { border: 1px solid #e2e8f0; background: #f8fafc; color: #334155; border-radius: 999px; padding: .3rem .8rem; font: inherit;
  font-size: .82rem; font-weight: 700; cursor: pointer; }
.chip span { display: inline-block; min-width: 1.3rem; margin-right: .25rem; padding: 0 .35rem; border-radius: 999px; background: #e2e8f0;
  font-size: .72rem; text-align: center; }
.chip.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.chip.active span { background: rgba(255, 255, 255, .25); }

.work-list { list-style: none; margin: 0; padding: 0; max-height: 34rem; overflow-y: auto; }
.work-row a { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem 8rem 7.5rem; align-items: center; gap: .9rem;
  padding: .7rem .6rem; border-bottom: 1px solid #f1f5f9; border-radius: .6rem; color: inherit; }
.work-row a:hover { background: #f8fafc; }
.work-row.is-late a { box-shadow: inset -3px 0 0 #dc2626; }
.wr-main { min-width: 0; }
.wr-name { display: block; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-meta { display: block; font-size: .75rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-stage { justify-self: start; white-space: nowrap; }
.wr-progress { display: flex; align-items: center; gap: .45rem; }
.wr-progress b { font-size: .78rem; width: 2.6rem; text-align: left; font-variant-numeric: tabular-nums; }
.wr-track { flex: 1; height: .4rem; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.wr-fill { display: block; height: 100%; background: #2563eb; border-radius: 4px 0 0 4px; }
.wr-due { font-size: .78rem; color: #475569; display: flex; gap: .35rem; align-items: center; justify-content: flex-end; white-space: nowrap; }
.late-badge { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 999px; padding: 0 .45rem; font-weight: 700; }
.note-badge { color: #9a3412; background: #fff7ed; border-radius: 999px; padding: 0 .4rem; font-weight: 700; }
@media (max-width: 700px) {
  .work-row a { grid-template-columns: minmax(0, 1fr) auto; }
  .wr-progress { grid-column: 1 / -1; }
  .wr-due { justify-content: flex-start; }
}
.work-empty, .empty-note { padding: 1.5rem; text-align: center; color: #94a3b8; font-size: .9rem; list-style: none; }

.late-list { list-style: none; margin: 0; padding: 0; }
.late-list a { display: block; padding: .5rem .6rem; border-radius: .6rem; border-right: 3px solid #dc2626; margin-bottom: .4rem; background: #fffafa; }
.late-list a:hover { background: #fef2f2; }
.late-name { display: block; font-weight: 700; font-size: .88rem; color: #0f172a; }
.late-meta { display: block; font-size: .74rem; color: #b91c1c; }
.ok-note { font-size: .85rem; color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: .7rem; padding: .7rem .9rem; }

.tabs2 { display: flex; gap: .25rem; background: #f1f5f9; padding: .25rem; border-radius: .8rem; flex-wrap: wrap; }
.tab2 { border: 0; background: transparent; border-radius: .6rem; padding: .4rem .9rem; font: inherit; font-size: .85rem; font-weight: 700;
  color: #475569; cursor: pointer; }
.tab2.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }

.done-list { list-style: none; margin: 0; padding: 0; }
.done-list li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .55rem .2rem; border-bottom: 1px solid #f1f5f9; }
.done-name { font-weight: 600; }

/* أوراق العمل العامة AML10 / D1 / F100 */
.paper-head { width: 100%; border-collapse: collapse; }
.paper-head th, .paper-head td { border: 1px solid #e2e8f0; padding: .35rem .6rem; text-align: right; }
.paper-head th { background: #f8fafc; font-weight: 600; color: #475569; white-space: nowrap; width: 1%; }
.paper-sec { border-top: 1px solid #eef2f7; padding: 1rem 0 .25rem; }
.paper-sec:first-of-type { border-top: 0; padding-top: .25rem; }
.paper-sec-title { font-weight: 700; color: #0f172a; margin-bottom: .6rem; }
.paper-sec-title .ltr { font-weight: 400; font-size: .75rem; color: #64748b; margin-right: .35rem; }
.paper-field { margin-bottom: .75rem; }
.paper-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .3rem; }
.paper-label .ltr { font-weight: 400; font-size: .72rem; color: #64748b; }
.paper-table td { vertical-align: top; }
.paper-table .ctl { padding: .3rem .45rem; }
.paper-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 1.25rem; }
.paper-fields > .full { grid-column: 1 / -1; }
