/* مِحْوَر — الهوية: كحلي #0F2A44 · برتقالي #F28C28 · رمادي #4A5868 · أرضية #F7F8FA */
:root {
  --mh-navy: #0F2A44;
  --mh-navy-2: #16395C;
  --mh-orange: #F28C28;
  --mh-orange-dark: #C8641A;
  --mh-slate: #4A5868;
  --mh-ground: #F4F6F9;
  --mh-border: #E1E6ED;
  --bs-primary: #0F2A44;
  --bs-primary-rgb: 15, 42, 68;
  --bs-body-font-family: 'Tajawal', system-ui, sans-serif;
  --bs-body-bg: var(--mh-ground);
  --bs-link-color: #16395C;
  --bs-link-color-rgb: 22, 57, 92;
  --sidebar-w: 248px;
}

body { font-size: 15px; color: #1d2733; }
.font-brand { font-family: 'Reem Kufi', 'Tajawal', sans-serif; }

/* أزرار */
.btn-primary { --bs-btn-bg: var(--mh-navy); --bs-btn-border-color: var(--mh-navy);
  --bs-btn-hover-bg: var(--mh-navy-2); --bs-btn-hover-border-color: var(--mh-navy-2);
  --bs-btn-active-bg: var(--mh-navy-2); --bs-btn-disabled-bg: var(--mh-navy); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--mh-orange-dark); --bs-btn-border-color: var(--mh-orange-dark);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #b0570f; --bs-btn-hover-border-color: #b0570f; }
.btn-outline-primary { --bs-btn-color: var(--mh-navy); --bs-btn-border-color: var(--mh-navy);
  --bs-btn-hover-bg: var(--mh-navy); --bs-btn-hover-border-color: var(--mh-navy); }
.form-control:focus, .form-select:focus { border-color: #6c8fb3; box-shadow: 0 0 0 .2rem rgba(15, 42, 68, .15); }
.form-label { font-weight: 500; font-size: 14px; color: var(--mh-slate); }
.req::after { content: ' *'; color: #c0392b; }

/* الهيكل */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--mh-navy); color: #c9d4e0; position: fixed; inset-block: 0;
  inset-inline-start: 0; display: flex; flex-direction: column; z-index: 1030; transition: transform .2s; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: #fff; text-decoration: none; }
.sidebar .brand img { width: 38px; height: 38px; }
.sidebar .brand .name { font-family: 'Reem Kufi', sans-serif; font-size: 26px; font-weight: 700; line-height: 1; }
.sidebar .brand.brand-custom img { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.sidebar .brand.brand-custom .name { font-family: Tajawal, sans-serif; font-size: 16px; line-height: 1.35; }
.sidebar .brand.brand-custom .sub { display: block; font-size: 9px; letter-spacing: .4px; margin-top: 4px; }
.sidebar .brand .sub { font-size: 10px; letter-spacing: 3px; color: var(--mh-orange); font-family: Montserrat, sans-serif; font-weight: 700; }
.sidebar nav { overflow-y: auto; padding: 8px 12px 24px; flex: 1; }
.sidebar .nav-section { font-size: 12px; color: #8ea2b8; padding: 16px 10px 6px; }
.sidebar .nav-link { color: #d8e1ea; border-radius: 8px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.sidebar .nav-link i { font-size: 17px; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link.active { background: rgba(242, 140, 40, .16); color: #fff; box-shadow: inset -3px 0 0 var(--mh-orange); }
.sidebar .nav-link.soon { color: #7f93a9; cursor: default; }
.sidebar .nav-link.soon:hover { background: none; }
.sidebar .badge-soon { margin-inline-start: auto; font-size: 10px; background: rgba(255,255,255,.08); color: #9fb1c4; font-weight: 500; }
.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--mh-border); padding: 10px 24px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 1020; }
.topbar .page-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--mh-navy); }
.content { padding: 24px; flex: 1; }
.sidebar-toggle { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .main { margin-inline-start: 0; }
  .sidebar-toggle { display: inline-flex; }
  .content { padding: 16px; }
}

/* بطاقات */
.card { border: 1px solid var(--mh-border); border-radius: 12px; box-shadow: none; }
.card-header { background: #fff; border-bottom: 1px solid var(--mh-border); font-weight: 700; color: var(--mh-navy); padding: 14px 18px; }
.stat-card { padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-card .icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: rgba(15, 42, 68, .08); color: var(--mh-navy); }
.stat-card .icon.accent { background: rgba(242, 140, 40, .15); color: var(--mh-orange-dark); }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--mh-navy); line-height: 1.1; }
.stat-card .label { color: var(--mh-slate); font-size: 14px; }

/* جداول */
.table { --bs-table-hover-bg: #f6f8fb; margin: 0; }
.table thead th { font-size: 13px; color: var(--mh-slate); font-weight: 600; background: #f8fafc; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; }

/* لوحة السيارة السعودية */
.plate { display: inline-flex; border: 2px solid #1d2733; border-radius: 6px; overflow: hidden; font-weight: 700; background: #fff;
  line-height: 1; direction: rtl; font-family: 'Tajawal', sans-serif; }
.plate .p-letters, .plate .p-numbers { padding: 4px 8px; font-size: 15px; letter-spacing: 1px; }
.plate .p-letters { border-inline-end: 2px solid #1d2733; }
.plate .p-numbers { direction: ltr; font-family: Montserrat, sans-serif; }
.plate.lg .p-letters, .plate.lg .p-numbers { font-size: 22px; padding: 8px 14px; }

/* شارات أنواع العملاء */
.badge-type-individual { background: #e8f0f8; color: #16395C; }
.badge-type-company { background: #fff1e3; color: #9a4b0d; }
.badge-type-insurance { background: #e6f4ef; color: #1c6b4f; }

/* صفحات الدخول */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--mh-navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.auth-side .auth-logo { width: 96px; height: 96px; object-fit: contain; }
.auth-side.brand-custom .auth-logo { width: 150px; height: 150px; }
.auth-side.brand-custom h1 { font-family: Tajawal, sans-serif; font-weight: 700; font-size: 40px; line-height: 1.3; }
.brand-title-custom { font-family: Tajawal, sans-serif; font-weight: 700; font-size: 1.45rem; }
.auth-logo-sm { width: 64px; height: 64px; object-fit: contain; }
.auth-side h1 { font-family: 'Reem Kufi', sans-serif; font-size: 64px; margin: 0; }
.auth-side .tag { color: #c3cedb; font-size: 20px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #d8e1ea; }
.auth-side li i { color: var(--mh-orange); margin-inline-end: 8px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: #fff; }
.auth-form .box { width: 100%; max-width: 440px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

.empty-state { text-align: center; padding: 48px 16px; color: var(--mh-slate); }
.empty-state i { font-size: 44px; color: #b8c4d2; display: block; margin-bottom: 8px; }
.customer-picker { position: relative; }
.customer-picker .results { position: absolute; inset-inline: 0; top: 100%; z-index: 20; max-height: 280px; overflow-y: auto; }
.perm-group { border: 1px solid var(--mh-border); border-radius: 10px; padding: 14px; height: 100%; }
.acc-level-2 { padding-inline-start: 24px !important; }
.acc-level-3 { padding-inline-start: 48px !important; }
.acc-level-4 { padding-inline-start: 72px !important; }
.text-navy { color: var(--mh-navy) !important; }
.text-orange { color: var(--mh-orange-dark) !important; }
.checklist .done { color: #8a96a3; text-decoration: line-through; }

/* أزرار الإجراءات السريعة في لوحة المؤشرات: شبكة من عمودين على الجوال */
@media (max-width: 575.98px) {
  .dash-actions { display: grid !important; grid-template-columns: 1fr 1fr; width: 100%; }
  .dash-actions .btn { white-space: nowrap; }
}

/* شعار الشركة المرفوع: لوحة بيضاء ليظهر بوضوح فوق الخلفيات الداكنة */
.logo-plate { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px;
  padding: 5px; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.logo-plate img { max-width: 100%; max-height: 100%; width: auto !important; height: auto !important; object-fit: contain; }
.logo-plate-lg { width: 150px; height: 150px; padding: 14px; border-radius: 20px; }
.logo-plate-sm { width: 34px; height: 34px; padding: 3px; border-radius: 8px; }

/* توثيق الاستلام: مخطط الأضرار ولوحة التوقيع */
.damage-map { background: #f6f8fb; border: 1px solid #e3e7ee; border-radius: 10px; padding: 6px; max-width: 260px; margin-inline: auto; }
.damage-map[data-editable] svg { cursor: crosshair; }
.damage-map svg { width: 100%; height: auto; display: block; }
.damage-map .car-body { fill: #fff; stroke: #8a97a8; stroke-width: 2; }
.damage-map .car-glass { fill: #dbe5f0; stroke: #8a97a8; stroke-width: 1.2; }
.damage-map .car-roof { fill: #f1f4f8; stroke: #b3bdca; stroke-width: 1; }
.damage-map .car-wheel { fill: #39424e; }
.damage-map .car-line { fill: none; stroke: #c2cad5; stroke-width: 1.2; }
.damage-map .car-label { font-size: 10px; fill: #6b7787; font-family: Tajawal, sans-serif; }
.damage-map .dmg-num { font-size: 9px; font-weight: 700; fill: #fff; font-family: Montserrat, sans-serif; pointer-events: none; }
.dmg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.sign-pad { width: 100%; height: 150px; border: 1.5px dashed #9aa6b5; border-radius: 8px; background: #fff; touch-action: none; display: block; }

/* المواعيد: شريط الأسبوع وجدول اليوم */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid #e3e7ee; border-radius: 10px; background: #fff; color: inherit; text-decoration: none; }
.week-day.active { border-color: var(--mh-navy); box-shadow: inset 0 0 0 1px var(--mh-navy); }
.week-day.off { opacity: .5; }
.appt-grid-wrap { overflow-x: auto; }
.appt-grid { display: grid; position: relative; min-width: 100%; }
.appt-head { position: sticky; top: 0; background: #f6f8fb; border-bottom: 1px solid #e3e7ee; font-size: 12.5px; font-weight: 700; padding: 8px 6px; text-align: center; z-index: 2; }
.appt-head.off, .appt-cell.off { background: repeating-linear-gradient(45deg, #f4f5f7, #f4f5f7 6px, #eceef1 6px, #eceef1 12px); }
.appt-time { font-size: 11px; color: #6b7787; text-align: center; border-top: 1px solid #eef1f5; padding-top: 2px; font-family: Montserrat, sans-serif; }
.appt-cell { border-top: 1px solid #eef1f5; border-inline-start: 1px solid #eef1f5; }
.appt-cell[data-slot] { cursor: pointer; }
.appt-cell[data-slot]:hover { background: #eef4fb; }
.appt-block { z-index: 1; margin: 1px 3px; border-radius: 7px; padding: 3px 6px; font-size: 11.5px; line-height: 1.35; overflow: hidden; border-inline-start: 3px solid; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.appt-block.st-booked { background: #eef2f7; border-color: #8a97a8; }
.appt-block.st-confirmed { background: #e6f0fb; border-color: #2a78d6; }
.appt-block.st-arrived { background: #e7f6ee; border-color: #1baf7a; }
.appt-block.st-no_show { background: #fdecea; border-color: #c0392b; opacity: .75; }

/* قاعدة معرفة المركبات */
.car-art { width: 100%; height: auto; display: block; }
.kb-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 16px;
  color: #fff; background: radial-gradient(120% 140% at 100% 0%, #24507e 0%, var(--mh-navy) 55%, #0b1d31 100%); }
.kb-search { position: relative; flex: 1; max-width: 420px; min-width: 240px; }
.kb-search i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: #6b7787; }
.kb-search input { width: 100%; border: 0; border-radius: 12px; padding: 12px 42px 12px 14px; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.kb-makes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kb-make { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; background: #fff; border: 1px solid #e3e7ee; border-radius: 14px;
  color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; text-align: center; }
.kb-make:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,42,68,.10); }
.kb-make-mono { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: Montserrat, sans-serif; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--mh-navy), #2a78d6); margin-bottom: 4px; }
.kb-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kb-model { background: #fff; border: 1px solid #e3e7ee; border-radius: 14px; padding: 12px; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.kb-model:hover { box-shadow: 0 8px 22px rgba(15,42,68,.10); transform: translateY(-2px); }
.kb-model-img { width: 100%; height: 96px; object-fit: contain; margin-bottom: 6px; background: linear-gradient(180deg, #f6f8fb, #fff); border-radius: 10px; }
.kb-thumb { width: 84px; flex-shrink: 0; }
.kb-gen-hero { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 18px; background: #fff; border: 1px solid #e3e7ee; border-radius: 16px; padding: 16px; }
@media (max-width: 767.98px) { .kb-gen-hero { grid-template-columns: 1fr; } }
.kb-gen-visual { position: relative; background: linear-gradient(180deg, #eef3f9, #fff); border-radius: 12px; padding: 14px; min-height: 180px; display: grid; place-items: center; }
.kb-gen-visual img { width: 100%; max-height: 240px; object-fit: contain; border-radius: 8px; }
.kb-img-form { position: absolute; inset-inline-end: 10px; bottom: 10px; }
.kb-img-del { position: absolute; inset-inline-start: 6px; bottom: 6px; }
.kb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kb-chips span { background: #f1f4f8; border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.kb-chips i { color: var(--mh-orange); margin-inline-end: 3px; }
.kb-spec-group { background: #f6f8fb; font-size: 12px; font-weight: 700; color: #4a5768; padding: 6px 14px; border-top: 1px solid #eef1f5; }
.kb-spec { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-top: 1px solid #f1f3f6; font-size: 13.5px; }
.kb-spec-label { flex: 1 1 45%; color: #4a5768; }
.kb-spec-value { flex: 1 1 40%; font-weight: 700; }
.kb-spec-input { flex: 1 1 40%; max-width: 220px; }
.kb-verify { font-size: 12px; color: #4a5768; white-space: nowrap; display: flex; align-items: center; gap: 3px; }
.kb-badge-ref { background: #fff4e5; color: #9a5b00; border: 1px solid #f3d29a; font-weight: 600; }
.kb-badge-ok { background: #e7f6ee; color: #136a3f; border: 1px solid #b5e2c8; font-weight: 600; }

/* بطاقة المركبة الفنية */
.vcard { border: 1px solid #e3e7ee; border-radius: 16px; overflow: hidden; background: #fff; }
.vcard-top { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: linear-gradient(135deg, #f3f7fc, #fff); }
.vcard-art { width: 132px; flex-shrink: 0; }
.vcard-art img { width: 100%; height: 72px; object-fit: contain; }
.vcard-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vcard-spec { padding: 8px 14px; border-top: 1px solid #f1f3f6; font-size: 12.5px; }
.vcard-spec:nth-child(odd) { border-inline-end: 1px solid #f1f3f6; }
.vcard-spec .k { color: #6b7787; display: block; }
.vcard-spec .v { font-weight: 700; }
.vcard-spec .v.ref::after { content: ' •'; color: #e09a1a; }

/* شرائح فئات قاعدة المعرفة */
.kb-classes, .kb-origins { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.kb-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--bs-border-color);
  color: inherit; text-decoration: none; font-size: .9rem; white-space: nowrap; transition: background .15s, border-color .15s; }
.kb-chip:hover { border-color: #f08c2e; }
.kb-chip.active { background: #0f2a4a; border-color: #0f2a4a; color: #fff; }
.kb-chip-sm { padding: .2rem .65rem; font-size: .8rem; }
.kb-chip-n { font-size: .75rem; background: rgba(0,0,0,.07); border-radius: 999px; padding: 0 .45rem; }
.kb-chip.active .kb-chip-n { background: rgba(255,255,255,.18); }
@media (max-width: 576px) { .kb-classes { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; } }

/* إسناد صور ويكيميديا */
.kb-gen-visual { position: relative; }
.kb-credit { position: absolute; inset-inline-start: .5rem; bottom: .35rem; max-width: 70%; font-size: .68rem; color: #fff; background: rgba(15,42,74,.72);
  padding: .1rem .45rem; border-radius: 4px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; }
.kb-credit:hover { color: #fff; background: rgba(15,42,74,.9); }
.vcard-credit { font-size: .66rem; color: var(--bs-secondary-color); padding: 0 .75rem .35rem; direction: ltr; text-align: end; }

/* مراجعة صور المركبات (لوحة المنصة) */
.kb-photo-card { cursor: pointer; overflow: hidden; }
.kb-photo-card:has(.kb-pick:checked) { outline: 3px solid #198754; outline-offset: -1px; }
.kb-photo-img { aspect-ratio: 16 / 10; background: #eef2f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.kb-photo-img img { width: 100%; height: 100%; object-fit: cover; }
.kb-photo-img svg { width: 80%; }
.kb-bulkbar { position: sticky; top: 0; z-index: 5; background: var(--bs-body-bg, #f4f6f9); padding: .5rem 0; }
.min-w-0 { min-width: 0; }

/* اختيارات الاستلام المصوّرة (الشكوى والأغراض) */
.ic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.ic-chip { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .7rem .35rem .55rem; min-height: 92px;
  background: #fff; border: 1.5px solid var(--bs-border-color); border-radius: 12px; color: #334155; font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.ic-chip:hover { border-color: var(--ic); box-shadow: 0 2px 8px rgba(15,42,74,.08); }
.ic-chip:active { transform: scale(.97); }
.ic-chip:focus-visible { outline: 3px solid rgba(240,140,46,.45); outline-offset: 1px; }
.ic-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--ic);
  background: color-mix(in srgb, var(--ic) 10%, #fff); transition: background .15s, color .15s; }
.ic-label { font-size: .8rem; line-height: 1.25; text-align: center; font-weight: 500; }
.ic-check { position: absolute; top: 6px; inset-inline-end: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--ic);
  display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.ic-chip.on { border-color: var(--ic); background: color-mix(in srgb, var(--ic) 6%, #fff); }
.ic-chip.on .ic-icon { background: var(--ic); color: #fff; }
.ic-chip.on .ic-label { color: #0f172a; font-weight: 700; }
.ic-chip.on .ic-check { opacity: 1; transform: scale(1); }
@media (max-width: 576px) { .ic-grid { grid-template-columns: repeat(3, 1fr); } .ic-chip { min-height: 86px; } }

/* الموظفون */
.emp-avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; font-weight: 700; }
.emp-row { cursor: pointer; }
.emp-stat { color: inherit; transition: border-color .15s, box-shadow .15s; }
.emp-stat:hover, .emp-stat.active { border-color: #f08c2e; box-shadow: 0 2px 10px rgba(15,42,74,.08); }
.emp-stat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #eef3f9; color: #0f2a4a; font-size: 1.3rem; }
.emp-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; border-radius: 16px;
  color: #fff; background: linear-gradient(135deg, #0f2a4a, #1d4673); }
.emp-hero .emp-ini { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.emp-kv { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--bs-border-color); font-size: .9rem; }
.emp-kv:last-child { border-bottom: 0; }
.emp-kv span { color: var(--bs-secondary-color); }
.emp-kv strong { font-weight: 600; text-align: end; }
.emp-cats { display: flex; flex-wrap: wrap; gap: .35rem; }
.emp-chain { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.emp-chain-node { display: flex; flex-direction: column; padding: .4rem .75rem; border: 1px solid var(--bs-border-color); border-radius: 10px; text-decoration: none; color: inherit; background: #fff; }
.emp-chain-node small { color: var(--bs-secondary-color); font-size: .75rem; }
.emp-chain-node.current { border-color: #f08c2e; background: #fff7ed; }
.emp-reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.emp-report { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--bs-border-color); border-radius: 10px; text-decoration: none; color: inherit; }
.emp-report span { display: flex; flex-direction: column; min-width: 0; }
.emp-report small { color: var(--bs-secondary-color); font-size: .75rem; }

/* الهيكل التنظيمي (شجرة رأسية) */
.oc-wrap { overflow-x: auto; }
.oc-tree ul { list-style: none; margin: 0; padding-inline-start: 1.6rem; position: relative; }
.oc-tree > ul { padding-inline-start: 0; }
.oc-tree li { position: relative; padding: .35rem 0; }
.oc-tree ul ul li::before { content: ""; position: absolute; inset-inline-start: -1.1rem; top: 0; bottom: 0; border-inline-start: 2px solid #d7dee8; }
.oc-tree ul ul li:last-child::before { bottom: auto; height: 1.9rem; }
.oc-tree ul ul li::after { content: ""; position: absolute; inset-inline-start: -1.1rem; top: 1.9rem; width: .9rem; border-top: 2px solid #d7dee8; }
.oc-node { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem .8rem; min-width: 240px; background: #fff; border: 1px solid var(--bs-border-color);
  border-radius: 12px; text-decoration: none; color: inherit; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.oc-node:hover, .oc-node:target { border-color: #f08c2e; }
.oc-node:target { box-shadow: 0 0 0 3px rgba(240,140,46,.3); }
.oc-node span { display: flex; flex-direction: column; line-height: 1.3; }
.oc-node small { color: var(--bs-secondary-color); font-size: .75rem; }
.oc-node .oc-dept { color: #1d4673; }
.oc-count { font-style: normal; margin-inline-start: auto; background: #0f2a4a; color: #fff; font-size: .7rem; border-radius: 999px; padding: 0 .45rem; }
.oc-leave { opacity: .7; border-style: dashed; }
@media print { .sidebar, .topbar, .btn { display: none !important; } .oc-node { box-shadow: none; } }

/* محدد الشكوى بمستويين */
.sym-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .5rem; }
.sym-cat { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .75rem .4rem .6rem; background: #fff;
  border: 1.5px solid var(--bs-border-color); border-radius: 14px; font: inherit; color: #334155; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; }
.sym-cat:hover { border-color: var(--ic); }
.sym-cat:active { transform: scale(.97); }
.sym-cat.active { border-color: var(--ic); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ic) 20%, transparent); }
.sym-cat-ico { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 11%, #fff); }
.sym-cat.has .sym-cat-ico, .sym-cat.active .sym-cat-ico { background: var(--ic); color: #fff; }
.sym-cat-name { font-size: .82rem; font-weight: 600; text-align: center; line-height: 1.25; }
.sym-cat-n { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ic); color: #fff;
  font-size: .72rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.sym-panel { margin-top: .6rem; border: 1.5px solid var(--ic); border-radius: 14px; padding: .7rem; background: color-mix(in srgb, var(--ic) 4%, #fff); }
.sym-panel-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; color: var(--ic); }
.sym-items { display: flex; flex-wrap: wrap; gap: .4rem; }
.sym-item { padding: .45rem .85rem; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--ic) 35%, #fff); background: #fff; font: inherit;
  font-size: .88rem; cursor: pointer; color: #1f2937; }
.sym-item:hover { border-color: var(--ic); }
.sym-item.on { background: var(--ic); border-color: var(--ic); color: #fff; font-weight: 600; }
.sym-item.on::before { content: "✓ "; }
.sym-selected { margin-top: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.sym-row { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem .6rem; border: 1px solid var(--bs-border-color); border-inline-start: 4px solid var(--ic);
  border-radius: 10px; background: #fff; }
.sym-row-ico { color: var(--ic); flex-shrink: 0; margin-top: 2px; }
.sym-row-main { flex: 1; min-width: 0; }
.sym-row-title { font-size: .9rem; }
.sym-opts { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; align-items: center; }
.sym-opt { padding: .12rem .55rem; border-radius: 999px; border: 1px solid var(--bs-border-color); background: #f8fafc; font: inherit; font-size: .74rem; color: #475569; cursor: pointer; }
.sym-opt.on { background: #0f2a4a; border-color: #0f2a4a; color: #fff; }
.sym-freq.on { background: var(--ic); border-color: var(--ic); }
.sym-sep { width: 1px; height: 16px; background: var(--bs-border-color); margin: 0 .2rem; }
.sym-del { flex-shrink: 0; }
@media (max-width: 576px) { .sym-cats { grid-template-columns: repeat(3, 1fr); } .sym-cat-ico { width: 44px; height: 44px; } }
.sym-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--ic) 10%, #fff);
  color: #1f2937; border: 1px solid color-mix(in srgb, var(--ic) 30%, #fff); font-size: .8rem; }
.sym-chip svg { color: var(--ic); }
.fit-panel .list-group-item { padding: .4rem .6rem; }
.fit-part { display: flex; align-items: center; gap: .4rem; width: 100%; text-align: start; }
.fit-part .small { line-height: 1.2; }
.fit-sug { border-inline-start: 3px solid #f08c2e; }

.sym-toggle { border: 0; background: none; padding: 0 .2rem; font: inherit; font-size: .76rem; color: #1d4673; text-decoration: underline dotted; cursor: pointer; }
.sym-toggle span { color: #0f2a4a; font-weight: 600; text-decoration: none; }

/* التشخيص وأكواد الأعطال */
.dtc-row { border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: .55rem .8rem; background: #fff; }
.dtc-row > summary { cursor: pointer; list-style: none; }
.dtc-row > summary::-webkit-details-marker { display: none; }
.dtc-row[open] { box-shadow: 0 2px 10px rgba(16,24,40,.06); }
.dtc-cleared { opacity: .65; }
.dtc-cleared .dtc-code { text-decoration: line-through; }
.dtc-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; background: #0f172a; color: #fbbf24; border-radius: .4rem; padding: .1rem .5rem; letter-spacing: .5px; }
.dtc-sev-low { background: #e2e8f0; color: #334155; }
.dtc-sev-medium { background: #fef3c7; color: #92400e; }
.dtc-sev-high { background: #ffedd5; color: #c2410c; }
.dtc-sev-critical { background: #fee2e2; color: #b91c1c; }
.dtc-sys { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--bs-border-color); background: #fff; color: inherit; text-decoration: none; font-size: .9rem; }
.dtc-sys.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.dtc-sys b { font-family: ui-monospace, monospace; }
.dtc-table td { vertical-align: middle; }
.ins-bar { height: 8px; border-radius: 4px; background: #f1f4f8; overflow: hidden; }
.ins-bar > span { display: block; height: 100%; background: var(--mh-orange, #f08c2e); border-radius: 4px; }
.ins-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 12%, #fff); flex: none; }

/* مفاتيح الشاشات (لوحة المنصة) */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.mod-sec { border: 1px solid var(--bs-border-color); border-radius: .6rem; overflow: hidden; background: #fff; }
.mod-sec-h { background: #f6f8fb; padding: .45rem .8rem; font-weight: 700; font-size: .85rem; color: #475569; }
.mod-item { display: flex; align-items: center; gap: .55rem; padding: .5rem .8rem; border-top: 1px solid #eef1f5; cursor: pointer; margin: 0; }
.mod-item > i { color: var(--mh-orange, #f08c2e); }
.mod-item.off { background: #fafafa; color: #94a3b8; }
.mod-item.off > i { color: #cbd5e1; }
.mod-item.off span.flex-grow-1 { text-decoration: line-through; }

/* توقيع العميل */
.sig-img { height: 70px; max-width: 220px; object-fit: contain; background: #fff; }
.sig-methods .nav-link { padding: .3rem .7rem; font-size: .85rem; border: 1px solid var(--bs-border-color); background: #fff; color: inherit; }
.sig-methods .nav-link.active { background: var(--mh-navy, #0F2A44); color: #fff; border-color: transparent; }
.sign-pad.is-invalid { border-color: #dc3545; }

/* الواجهة الإنجليزية (من اليسار لليمين): عكس الأيقونات الاتجاهية */
[dir="ltr"] .bi-arrow-right::before, [dir="ltr"] .bi-arrow-left::before, [dir="ltr"] .bi-arrow-left-short::before, [dir="ltr"] .bi-arrow-right-short::before,
[dir="ltr"] .bi-chevron-left::before, [dir="ltr"] .bi-chevron-right::before, [dir="ltr"] .bi-box-arrow-left::before, [dir="ltr"] .bi-box-arrow-right::before,
[dir="ltr"] .bi-arrow-return-left::before, [dir="ltr"] .bi-caret-left-fill::before, [dir="ltr"] .bi-caret-right-fill::before { display: inline-block; transform: scaleX(-1); }
[dir="ltr"] body { font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif; }

/* حالة السداد والاعتماد المالي */
.pay-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; line-height: 1.3; white-space: nowrap; }
.pay-chip i { font-size: .8rem; }
.pay-success { background: #dcfce7; color: #166534; }
.pay-danger { background: #fee2e2; color: #b91c1c; }
.pay-warning { background: #fef3c7; color: #92400e; }
.pay-info { background: #dbeafe; color: #1e40af; }
.pay-teal { background: #ccfbf1; color: #0f766e; }
.pay-purple { background: #ede9fe; color: #6d28d9; }
.pay-light { background: #f1f5f9; color: #64748b; }
.text-purple { color: #6d28d9 !important; }
.border-purple-subtle { border-color: #ddd6fe !important; }
.btn-purple { background: #6d28d9; color: #fff; border-color: #6d28d9; }
.btn-purple:hover { background: #5b21b6; color: #fff; }
.btn-outline-purple { color: #6d28d9; border-color: #a78bfa; background: #fff; }
.btn-outline-purple:hover { background: #ede9fe; color: #5b21b6; }
.pay-wrap .pay-chip { white-space: normal; }
.plate { flex-shrink: 0; }
.plate .p-letters, .plate .p-numbers { white-space: nowrap; }

/* إعدادات قنوات التواصل */
.mail-mode { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: .7rem .8rem; cursor: pointer; background: #fff; height: 100%; margin: 0; }
.mail-mode input { margin-top: .25rem; flex: none; }
.mail-mode.active { border-color: var(--mh-orange, #f08c2e); box-shadow: 0 0 0 3px rgba(240,140,46,.12); }
.mail-mode.disabled { opacity: .55; cursor: not-allowed; }
.smtp-log { background: #0f172a; color: #cbd5e1; font-size: 11px; border-radius: .5rem; padding: .7rem; max-height: 240px; overflow: auto; text-align: left; }
