/* © 2026 م. موسى محمد التميمي (M.T) — جميع الحقوق محفوظة. */
/* القيم منقولة من البرنامج المكتبي (sidebar.py / main_window.py / login_dialog.py / style.qss) */

@font-face { font-family: "Cairo"; src: url("/static/fonts/Cairo.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("/static/fonts/Cairo-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --primary: #1E3A5F;
  --primary-tint: rgba(30, 58, 95, 0.10);
  --app-bg: #F0F2F5;
  --ui-font: "Segoe UI", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--ui-font); font-size: 14px; background: var(--app-bg); color: #1E293B; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ═════════════════════════ شاشة الدخول ═════════════════════════ */
.login-page { background: var(--app-bg); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 10px; }
.login-card {
  width: 440px; max-width: 100%; border-radius: 24px; border: 1px solid rgba(100,160,255,0.2);
  box-shadow: 0 8px 40px rgba(0,0,0,0.45); overflow: hidden; font-family: "Cairo", var(--ui-font);
}
.login-card.shake { animation: shake 0.28s linear; }
@keyframes shake { 0%{transform:translateX(0)} 15%{transform:translateX(6px)} 30%{transform:translateX(-6px)}
  45%{transform:translateX(4px)} 60%{transform:translateX(-4px)} 75%{transform:translateX(2px)} 90%{transform:translateX(-2px)} 100%{transform:translateX(0)} }
.login-head { position: relative; background: #fff; padding: 20px 24px 16px; text-align: center; overflow: hidden; }
.login-head::before { content: ""; position: absolute; inset: 0; background: url("/static/img/bg_medical.png") center/cover no-repeat; opacity: 0.06; }
.login-logo { position: relative; width: 260px; max-width: 100%; max-height: 200px; object-fit: contain; display: block; margin: 0 auto; }
.login-body {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 10px 36px 28px;
  background: linear-gradient(180deg, rgb(10,31,78), rgb(13,43,107));
}
.login-body::before { content: ""; position: absolute; inset: 0; background: url("/static/img/bg_medical.png") center/cover no-repeat; opacity: 0.15; pointer-events: none; }
.login-body > * { position: relative; }
.lg-welcome { color: #fff; font-size: 22px; font-weight: 700; text-align: center; line-height: 1.3; }
.lg-sub { color: rgba(180,210,255,0.85); font-size: 12px; text-align: center; margin-top: -16px; margin-bottom: 8px; }
.lg-lbl { color: rgba(180,210,255,0.9); font-size: 12px; font-weight: 500; }
.lg-inp {
  height: 48px; display: flex; align-items: center; gap: 4px; padding: 0 14px;
  background: rgba(255,255,255,0.08); border: 1.5px solid rgba(100,160,255,0.25); border-radius: 12px;
}
.lg-inp:focus-within { border-color: rgba(100,200,255,0.6); background: rgba(255,255,255,0.12); }
.lg-inp-pw { padding: 0 14px 0 8px; }
.lg-inp input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: #fff; font-size: 13px; font-family: "Cairo", var(--ui-font); height: 100%; }
.lg-inp input:-webkit-autofill { -webkit-text-fill-color: #fff; transition: background-color 9999s; }
.lg-eye { width: 32px; height: 32px; border: none; background: transparent; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 0; }
.lg-eye:hover { background: rgba(255,255,255,0.1); }
.lg-caps { color: #FBBF24; font-size: 10px; font-weight: 700; background: rgba(251,191,36,0.14); border: 1px solid rgba(251,191,36,0.40); border-radius: 6px; padding: 0 6px; height: 20px; line-height: 18px; white-space: nowrap; direction: ltr; }
.lg-remember { display: flex; justify-content: flex-end; padding: 0 4px; }
.lg-remember label { display: flex; align-items: center; gap: 6px; color: rgba(180,210,255,0.85); font-size: 11px; cursor: pointer; user-select: none; }
.lg-remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.lg-box { width: 12px; height: 12px; border: 1.5px solid rgba(180,210,255,0.5); border-radius: 3px; display: inline-block; position: relative; }
.lg-remember input:checked + .lg-box { background: #00B4D8; border-color: #00B4D8; }
.lg-remember input:checked + .lg-box::after { content: ""; position: absolute; left: 2.5px; top: 0; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.lg-remember input:focus-visible + .lg-box { outline: 2px solid rgba(100,200,255,0.6); }
.lg-err { color: #FF6B6B; font-size: 11px; background: rgba(255,50,50,0.1); border: 1px solid rgba(255,100,100,0.3); border-radius: 8px; padding: 6px 10px; text-align: center; }
.lg-btn {
  margin-top: 8px; height: 48px; border: none; border-radius: 14px; color: #fff; font-size: 14px; font-weight: 700;
  font-family: "Cairo", var(--ui-font); letter-spacing: 1px; background: linear-gradient(90deg, #00B4D8, #0096C7);
}
.lg-btn:hover { background: linear-gradient(90deg, #48CAE4, #00B4D8); }
.lg-btn:active { background: #0096C7; }
.lg-btn:disabled { background: rgba(100,100,100,0.4); cursor: default; }
.lg-forgot { align-self: center; background: transparent; border: none; color: rgba(100,180,255,0.8); font-size: 11px; text-decoration: underline; font-family: "Cairo", var(--ui-font); }
.lg-forgot:hover { color: #fff; }
.lg-conn { font-size: 11px; text-align: center; min-height: 16px; }
.lg-conn .dot-ok { color: #22C55E; } .lg-conn .txt-ok { color: rgba(180,210,255,0.75); }
.lg-conn .dot-bad { color: #EF4444; } .lg-conn .txt-bad { color: #FCA5A5; }
.lg-sep { height: 1px; background: rgba(100,150,255,0.2); margin-top: 4px; margin-bottom: 8px; }
.lg-dev { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.lg-dev-note { font-size: 9px; color: rgba(150,190,255,0.5); }
.lg-dev-name { font-size: 12px; font-weight: 700; color: rgba(200,220,255,0.85); }
.lg-dev-mail { font-size: 9px; color: rgba(150,190,255,0.5); }

/* ═════════════════════════ الإطار العام ═════════════════════════ */
.app { overflow: hidden; }
.menubar { height: 26px; display: flex; align-items: center; gap: 2px; padding: 0 4px; background: var(--app-bg); font-size: 13px; position: relative; z-index: 30; }
.mb-item { position: relative; padding: 2px 8px; border-radius: 4px; cursor: default; user-select: none; color: #1E293B; }
.mb-item:hover, .mb-item.open { background: rgba(30,58,95,0.12); }
.mb-menu { display: none; position: absolute; top: 100%; right: 0; min-width: 180px; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; padding: 4px; box-shadow: 0 6px 18px rgba(0,0,0,0.10); font-family: Arial, sans-serif; }
.mb-item.open .mb-menu { display: block; }
.mb-act { padding: 8px 20px; border-radius: 6px; color: #1E293B; cursor: pointer; white-space: nowrap; }
.mb-act:hover { background: var(--primary); color: #fff; }
.mb-act.disabled { color: #94A3B8; cursor: default; }
.mb-act.disabled:hover { background: transparent; color: #94A3B8; }
.mb-icon { width: 26px; height: 22px; border: none; background: transparent; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 0; }
.mb-icon:hover { background: rgba(30,58,95,0.12); }

.frame { display: flex; height: calc(100vh - 26px); }

/* ── القائمة الجانبية (sidebar.py) ── */
.sidebar { width: 250px; flex: 0 0 auto; display: flex; flex-direction: column; background: #F8FAFC; border-left: 1px solid #E2E8F0; transition: width 0.18s ease; z-index: 20; }
.sb-head { height: 64px; flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; padding: 0 14px; background: #F1F5F9; border-bottom: 1px solid #E2E8F0; }
.sb-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sb-app { color: #1E293B; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sb-ver { color: #94A3B8; font-size: 10px; white-space: nowrap; }
.sb-tenant { color: #64748B; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.sb-sec { color: #94A3B8; font-size: 10px; font-weight: 700; padding: 8px 8px 4px; white-space: nowrap; }
.navbtn { height: 44px; flex: 0 0 44px; display: flex; align-items: center; padding: 0 0 0 8px; border-radius: 10px; text-decoration: none; color: #475569; background: transparent; }
.navbtn:hover { background: rgba(0,0,0,0.04); }
.nb-bar { width: 4px; height: 100%; border-radius: 2px; background: transparent; flex: 0 0 4px; }
.nb-icon { width: 22px; height: 22px; flex: 0 0 22px; color: #64748B; margin: 0 10px 0 10px; display: flex; }
.nb-text { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.nb-badge { width: 22px; height: 22px; border-radius: 11px; background: #EF4444; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-left: 6px; }
.navbtn.checked { background: var(--primary-tint); color: var(--primary); }
.navbtn.checked .nb-bar { background: var(--primary); }
.navbtn.checked .nb-icon { color: var(--primary); }
.navbtn.checked .nb-text { font-weight: 700; }
.sb-sep { height: 1px; background: #E2E8F0; margin: 0 10px; flex: 0 0 1px; }
.sb-user { height: 64px; flex: 0 0 auto; display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; padding: 0 14px; background: #F1F5F9; }
.sb-avatar { width: 26px; height: 26px; border-radius: 13px; background: var(--primary); display: flex; align-items: center; justify-content: center; flex: 0 0 26px; }
.sb-name { color: #1E293B; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; min-width: 0; }
.sb-fill { flex: 1; }
.sb-pw, .sb-power { width: 26px; height: 26px; border: none; border-radius: 8px; padding: 0; display: flex; flex: 0 0 26px; }
.sb-pw { background: #E2E8F0; } .sb-pw:hover { background: #CBD5E1; }
.sb-power { background: #DC2626; } .sb-power:hover { background: #EF4444; }
.sb-logout-f { margin: 0; display: flex; }

/* الوضع المصغّر: أيقونات فقط (64px) */
.sb-compact .sidebar { width: 64px; }
.sb-compact .sb-title, .sb-compact .sb-sec, .sb-compact .nb-text, .sb-compact .nb-badge,
.sb-compact .sb-name, .sb-compact .sb-pw, .sb-compact .sb-avatar, .sb-compact .sb-fill { display: none; }
.sb-compact .sb-nav { padding: 14px 8px 10px; }
.sb-compact .navbtn { padding: 0; justify-content: center; position: relative; }
.sb-compact .nb-bar { position: absolute; right: 0; top: 0; }
.sb-compact .nb-icon { margin: 0; }
.sb-compact .sb-user { padding: 0; gap: 0; justify-content: center; }

/* ── المنطقة الرئيسية ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header { height: 56px; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 24px; background: #fff; border-bottom: 1px solid #E5E7EB; }
.hamb { width: 34px; height: 34px; border: none; border-radius: 8px; background: transparent; padding: 0; display: flex; flex: 0 0 34px; }
.hamb:hover { background: #F1F5F9; }
.hd-title { margin: 0; font-size: 17px; font-weight: 700; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-fill { flex: 1; }
.hd-date { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--primary); white-space: nowrap; }
.content { flex: 1; overflow: auto; background: var(--app-bg); }

/* صفحة مؤقتة (placeholder_page.py) */
.ph { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.ph-icon { font-size: 64px; margin-bottom: 16px; line-height: 1; }
.ph-name { font-size: 22px; font-weight: 700; color: #1F2937; }
.ph-soon { font-size: 14px; color: #6B7280; margin-top: 8px; }

/* ── النوافذ ── */
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,0.35); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 12px; }
.dlg { background: #fff; border-radius: 14px; border: 0.5px solid #E2E8F0; overflow: hidden; max-width: 100%; box-shadow: 0 6px 36px rgba(0,0,0,0.14); }
.dlg-head { height: 50px; background: var(--primary); display: flex; align-items: center; justify-content: flex-start; padding: 0 16px; color: #fff; font-size: 15px; font-weight: 700; font-family: Arial, sans-serif; }
.dlg-body { padding: 20px; background: #F8FAFC; display: flex; flex-direction: column; gap: 6px; }
.dlg-msg { margin: 0 0 14px; font-size: 13px; color: #334155; text-align: center; line-height: 1.8; }
.btn-primary { height: 32px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
.btn-primary:hover { background: #16304f; }
.btn-primary:disabled { background: #CBD5E1; }
.btn-cancel { height: 32px; border: 1.5px solid #E2E8F0; border-radius: 10px; background: #F1F5F9; color: #475569; font-size: 11px; font-weight: 700; }
.btn-cancel:hover { background: #E2E8F0; }

/* عن النظام */
.about { text-align: center; font-family: Arial, sans-serif; }
.ab-name { font-size: 15px; font-weight: 700; color: var(--primary); }
.ab-ver { font-size: 13px; color: #64748B; }
.ab-desc { font-size: 13px; color: #475569; margin: 6px 0 10px; }
.ab-sep { height: 1px; background: #E2E8F0; margin-bottom: 10px; }
.ab-small { font-size: 11px; color: #94A3B8; }
.ab-dev { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.ab-tiny { font-size: 10px; color: #94A3B8; }

/* تغيير كلمة المرور (ChangePasswordDialog) */
.dlg-pw { width: 460px; border-radius: 18px; border: 1px solid #E2E8F0; }
.dlg-head-lg { height: 72px; justify-content: center; font-size: 14px; font-family: var(--ui-font); }
.dlg-pw .dlg-body { background: #fff; padding: 20px 28px 24px; }
.cp-lbl { font-size: 12px; color: #475569; font-weight: 700; margin-top: 3px; }
.cp-inp { height: 40px; background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 9px; padding: 0 12px; font-size: 13px; color: #1E293B; outline: none; font-family: var(--ui-font); }
.cp-inp:focus { border-color: #3B82F6; background: #F0F7FF; }
.cp-strength { display: flex; flex-direction: column; gap: 4px; padding: 2px 0; }
.cp-srow { display: flex; align-items: center; gap: 6px; }
.cp-sval { width: 40px; font-size: 10px; font-weight: 700; }
.cp-sbar { flex: 1; height: 6px; background: #E2E8F0; border-radius: 3px; overflow: hidden; }
.cp-sbar i { display: block; height: 100%; width: 0; border-radius: 3px; background: #94A3B8; transition: width .15s; }
.cp-slbl { font-size: 10px; color: #94A3B8; }
.cp-reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #F0FDF4; border-radius: 10px; padding: 8px 12px; }
.cp-reqs span { font-size: 10px; color: #94A3B8; }
.cp-reqs span.ok { color: #16A34A; font-weight: 700; }
.cp-err { color: #DC2626; font-size: 12px; background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px; padding: 8px 12px; }
.dlg-pw .btn-primary { border-radius: 10px; }
.dlg-pw .btn-cancel { margin-top: 6px; }

/* التنبيه السريع (show_toast) */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; padding: 10px 24px; border-radius: 10px; z-index: 200; }
/* التلميحة (QToolTip) */
.tip { position: fixed; background: #1E1E1E; color: #fff; font-size: 12px; padding: 1px 8px; border-radius: 4px; z-index: 150; pointer-events: none; white-space: nowrap; }

/* صفحات التنبيه (رابط خطأ / انتهى الاشتراك) */
.notice-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.notice { background: #fff; border: 1px solid #E2E8F0; border-radius: 18px; padding: 28px 32px; text-align: center; max-width: 420px; margin: 12px; }
.notice-logo { width: 200px; max-width: 100%; }
.notice-title { font-size: 18px; font-weight: 700; color: var(--primary); margin-top: 10px; }
.notice-msg { font-size: 14px; color: #475569; margin-top: 8px; line-height: 1.8; }

.sb-scrim { display: none; }

/* ═════════════ الجوال: القائمة تطلع من زر ☰ فوق المحتوى ═════════════ */
@media (max-width: 760px) {
  .sidebar { position: fixed; top: 26px; bottom: 0; right: 0; transform: translateX(100%); transition: transform 0.2s ease; box-shadow: none; }
  .sb-compact .sidebar { width: 250px; }
  .sb-compact .sb-title, .sb-compact .sb-sec, .sb-compact .nb-text, .sb-compact .sb-name,
  .sb-compact .sb-pw, .sb-compact .sb-avatar, .sb-compact .sb-fill { display: revert; }
  .sb-compact .sb-sec, .sb-compact .sb-title { display: block; }
  .sb-compact .sb-title { display: flex; }
  .sb-compact .nb-icon { margin: 0 10px; } .sb-compact .navbtn { padding: 0 0 0 8px; justify-content: flex-start; }
  .sb-compact .nb-bar { position: static; }
  .sb-compact .sb-user { padding: 0 14px; gap: 10px; justify-content: flex-start; }
  .sb-compact .sb-avatar, .sb-compact .sb-pw { display: flex; }
  .sb-compact .sb-fill { display: block; }
  body.sb-open .sidebar { transform: translateX(0); box-shadow: -8px 0 24px rgba(0,0,0,0.18); }
  body.sb-open .sb-scrim { display: block; position: fixed; inset: 26px 0 0 0; background: rgba(15,23,42,0.35); z-index: 15; }
  .header { padding: 0 8px 0 12px; }
  .hd-date span { display: none; }
}

/* ═════════════════════════ صفحة الأصول (assets_page.py) ═════════════════════════ */
.content:has(.as-page) { overflow: hidden; }
.as-page { position: relative; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.as-toolbar { height: 58px; flex: 0 0 58px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: #fff; border-bottom: 2px solid #E2E8F0; }
.as-search input { width: 450px; max-width: 100%; height: 36px; background: #F8FAFC; border: 2px solid #E2E8F0; border-radius: 8px; padding: 0 14px; font-size: 13px; color: #0F172A; outline: none; font-family: var(--ui-font); }
.as-search input:focus { border-color: #3B82F6; background: #EFF6FF; }
.as-fill { flex: 1; }
.as-clear { width: 25px; height: 25px; flex: 0 0 25px; padding: 0; background: #FEE2E2; border: 1.5px solid #FECACA; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.as-clear:hover { background: #FECACA; border-color: #FCA5A5; }
.as-count { color: #64748B; font-size: 10px; font-weight: 700; white-space: nowrap; }
.as-count.filtered { color: #1D4ED8; }
.as-selected { color: #1D4ED8; font-size: 10px; font-weight: 700; white-space: nowrap; }
.as-sum { color: #059669; font-size: 10px; font-weight: 700; white-space: nowrap; }

.as-grid { --z: 1; position: relative; flex: 1; min-height: 0; overflow: auto; background: #fff; outline: none; }
/* W036: أشرطة التمرير في كل الصفحات مثل البرنامج (style.qss) */
::-webkit-scrollbar { width: 6px; height: 16px; }
::-webkit-scrollbar-track:vertical { background: #EFF6FF; }
::-webkit-scrollbar-track:horizontal { background: #F1F5F9; border-top: 1px solid #E2E8F0; }
::-webkit-scrollbar-thumb { background: #1E3A5F; border-radius: 3px; }
::-webkit-scrollbar-thumb:horizontal { border: 3px solid #F1F5F9; border-left: 0; border-right: 0; }
::-webkit-scrollbar-corner { background: #F1F5F9; }
::-webkit-scrollbar-thumb:horizontal { min-width: 30px; }
::-webkit-scrollbar-thumb:horizontal:hover { background: #1E3A5F; }
::-webkit-scrollbar-button:horizontal:single-button { display: block; width: 16px; height: 16px; background-color: #E2E8F0; background-repeat: no-repeat; background-position: center; background-size: 6px 10px; border-top: 1px solid #E2E8F0; box-sizing: border-box; }
::-webkit-scrollbar-button:horizontal:single-button:hover { background-color: #CBD5E1; }
::-webkit-scrollbar-button:horizontal:single-button:start { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10'><path d='M5 1L1 5l4 4' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); border-right: 1px solid #CBD5E1; }
::-webkit-scrollbar-button:horizontal:single-button:end { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10'><path d='M1 1l4 4-4 4' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); border-left: 1px solid #CBD5E1; }
::-webkit-scrollbar-button:vertical { display: none; height: 0; }
::-webkit-scrollbar-thumb:vertical:hover { background: #16304f; }
.as-grid::-webkit-scrollbar { width: 6px; height: 16px; }
.as-grid::-webkit-scrollbar-track:vertical { background: #EFF6FF; }
.as-grid::-webkit-scrollbar-track:horizontal { background: #F1F5F9; border-top: 1px solid #E2E8F0; }
.as-grid::-webkit-scrollbar-thumb { background: #1E3A5F; border-radius: 3px; }
.as-grid::-webkit-scrollbar-thumb:horizontal { border: 3px solid #F1F5F9; border-left: 0; border-right: 0; }
.as-grid::-webkit-scrollbar-corner { background: #F1F5F9; }
/* W036: التمرير الأفقي مثل البرنامج — أزرار أسهم بالطرفين */
.as-grid::-webkit-scrollbar-thumb:horizontal { min-width: 30px; }
.as-grid::-webkit-scrollbar-thumb:horizontal:hover { background: #1E3A5F; }
.as-grid::-webkit-scrollbar-button:horizontal:single-button { display: block; width: 16px; height: 16px; background-color: #E2E8F0; background-repeat: no-repeat; background-position: center; background-size: 6px 10px; border-top: 1px solid #E2E8F0; box-sizing: border-box; }
.as-grid::-webkit-scrollbar-button:horizontal:single-button:hover { background-color: #CBD5E1; }
.as-grid::-webkit-scrollbar-button:horizontal:single-button:start { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10'><path d='M5 1L1 5l4 4' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); border-right: 1px solid #CBD5E1; }
.as-grid::-webkit-scrollbar-button:horizontal:single-button:end { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10'><path d='M1 1l4 4-4 4' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); border-left: 1px solid #CBD5E1; }
.as-grid::-webkit-scrollbar-button:vertical { display: none; height: 0; }
.g { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; font-family: "Segoe UI", Tahoma, Arial, sans-serif; user-select: none; }
.g th, .g td { padding: 0; overflow: hidden; }
/* الهيدر: سطرين — الاسم (38px) + خانة الفلتر */
.g thead th { position: sticky; top: 0; z-index: 3; height: 60px; background: #1E3A5F; color: #fff; font-weight: 700; font-size: 12px; vertical-align: top; border-left: 1px solid #2D5382; }
.g thead th:hover { background: #2D5382; }
.g thead th.frz, .g thead th.rn { z-index: 5; }
.g thead th.sel-col { background: #2D5382; }
.th-in { position: relative; height: 60px; }
.th-title { height: 38px; line-height: 38px; text-align: center; padding: 0 2px; white-space: nowrap; overflow: hidden; }
.th-t { display: inline-block; white-space: nowrap; }
.th-t .th-arrow { display: inline-block; vertical-align: middle; margin-inline-start: 0; }
.th-arrow { width: 10px; height: 6px; flex: 0 0 10px; cursor: pointer; overflow: visible; padding: 9px 5px; margin: -9px -5px; box-sizing: content-box; }
.th-sub { position: absolute; top: 22px; left: 1px; right: 1px; height: 14px; text-align: center; font-size: 9px; font-weight: 400; color: rgba(255,255,255,0.7); pointer-events: none; }
.th-flt { position: absolute; top: 37px; right: 1px; left: 4px; height: 20px; background: #F0F4F8; border: 1px solid #CBD5E1; border-radius: 3px; font-size: 10px; color: #94A3B8; display: flex; align-items: center; justify-content: center; cursor: text; overflow: hidden; white-space: nowrap; font-weight: 400; }
.th-flt.on { background: #FEF3C7; border: 1.5px solid #F59E0B; color: #92400E; font-weight: 700; }
.th-rs { position: absolute; top: 0; bottom: 0; left: -3px; width: 7px; cursor: col-resize; z-index: 2; }
.g thead th.rn { width: 44px; border-left: 1px solid #2D5382; }
.rn-in { height: 58px; display: flex; flex-direction: row-reverse; align-items: flex-start; justify-content: center; gap: 5px; padding-top: 0; border-bottom: 2px solid #94A3B8; }
.rn-in b { height: 38px; line-height: 38px; font-size: 14px; cursor: pointer; }
.rn-in .th-arrow { margin-top: 7px; }

.g tbody td { height: calc(28px * var(--z)); font-size: calc(12px * var(--z)); font-weight: 700; color: #0F172A; text-align: center; white-space: nowrap; text-overflow: ellipsis; padding: 0 4px; border-left: 1px solid #E2E8F0; border-bottom: 1px solid #E2E8F0; cursor: cell; }
.g tbody td { unicode-bidi: plaintext; }
.g tbody td.ltr { direction: ltr; unicode-bidi: normal; }
.g tbody td.rn { position: sticky; right: 0; z-index: 2; background: #1E3A5F; color: #fff; font-size: 12px; border-left: 1px solid #2D5382; border-bottom: 1px solid #2D5382; cursor: pointer; }
.g tbody td.frz { position: sticky; z-index: 1; }
.g tbody td.sel { box-shadow: inset 0 0 0 999px rgba(37,99,235,0.35); }
.g tbody td.rn.sel-row { background: #2D5382; }
.g tbody tr.sp td { height: 0; padding: 0; border: 0; }
.g-zoom { position: absolute; top: calc(58px + 70px); left: 50%; transform: translateX(-50%); background: rgba(15,23,42,0.82); color: #fff; border-radius: 10px; font-size: 13px; font-weight: 700; padding: 6px 16px; z-index: 10; pointer-events: none; }

/* قائمة الفلترة (FilterPopup) */
.flt-pop { position: fixed; z-index: 120; width: 330px; background: #fff; border: 1.5px solid #CBD5E1; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); font-family: var(--ui-font); }
.flt-search { height: 30px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 5px 8px; font-size: 12px; outline: none; font-family: inherit; }
.flt-search:focus { border-color: var(--primary); background: #fff; }
.flt-allrow { display: flex; align-items: center; gap: 6px; }
.flt-all { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 12px; font-weight: 700; color: #1F2937; cursor: pointer; user-select: none; }
.flt-fill { flex: 1; }
.flt-cb { width: 16px; height: 16px; flex: 0 0 16px; border: 1.5px solid #94A3B8; border-radius: 4px; background: #fff; position: relative; display: inline-block; }
.flt-cb.on, .flt-cb.part { background: var(--primary); border-color: var(--primary); }
.flt-cb.on::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.flt-cb.part::after { content: ""; position: absolute; left: 3px; right: 3px; top: 6px; height: 2px; background: #fff; }
.flt-list { height: 230px; overflow-y: auto; border: 1px solid #E2E8F0; border-radius: 6px; padding: 2px; font-size: 12px; }
.flt-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; color: #1F2937; cursor: pointer; user-select: none; }
.flt-item:hover { background: #F1F5F9; }
.flt-item .flt-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flt-item .flt-n { color: #94A3B8; flex: 0 0 auto; }
.flt-btns { display: flex; gap: 8px; }
.flt-btns button { flex: 1; height: 32px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.flt-ok { background: var(--primary); color: #fff; border: none; }
.flt-cancel { background: #fff; color: #475569; border: 1px solid #CBD5E1; }
.flt-cancel:hover { background: #F1F5F9; }

/* قائمة كليك يمين (MENU_STYLE) */
.ctx-menu { position: fixed; z-index: 130; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 4px; font-size: 13px; min-width: 200px; box-shadow: 0 6px 18px rgba(0,0,0,0.10); max-height: 70vh; overflow-y: auto; }
.ctx-item { padding: 8px 20px; border-radius: 4px; color: #1E293B; cursor: pointer; white-space: nowrap; }
.ctx-item:hover { background: #1E3A5F; color: #fff; }
.ctx-sep { height: 1px; background: #E2E8F0; margin: 4px 8px; }

@media (max-width: 760px) {
  .as-toolbar { padding: 0 8px; gap: 6px; }
  .as-search { flex: 1; min-width: 0; }
  .as-search input { width: 100%; }
  .as-fill { display: none; }
}

/* ═════════════ نافذة الاستيراد من إكسل (import_dialog.py) ═════════════ */
.win { background: var(--app-bg); border-radius: 8px; border: 1px solid #CBD5E1; overflow: hidden; max-width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.win-bar { height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 0; background: #fff; border-bottom: 1px solid #E5E7EB; font-size: 12px; color: #1F2937; }
.win-x { width: 46px; height: 32px; border: none; background: transparent; font-size: 13px; color: #374151; }
.win-x:hover { background: #E81123; color: #fff; }
.imp-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.imp-title { font-size: 16px; font-weight: 700; color: #1F2937; }
.imp-warn { display: flex; align-items: center; gap: 10px; background: #FEF3C7; border: 1px solid #F59E0B; border-radius: 8px; padding: 10px; color: #92400E; font-size: 13px; line-height: 1.6; }
.imp-warn-i { font-size: 20px; }
.imp-file { display: flex; gap: 6px; }
.imp-file input[type=text] { flex: 1; min-width: 0; height: 38px; border: 1px solid #D1D5DB; border-radius: 6px; padding: 0 10px; font-size: 13px; background: #fff; color: #1F2937; font-family: inherit; direction: ltr; text-align: right; }
.imp-file button { width: 90px; height: 38px; border: 1px solid #D1D5DB; border-radius: 6px; background: #fff; font-size: 13px; color: #1F2937; }
.imp-file button:hover { background: #F3F4F6; }
.imp-prog { position: relative; height: 20px; border: 1px solid #D1D5DB; border-radius: 8px; background: #F3F4F6; overflow: hidden; }
.imp-prog i { position: absolute; top: 0; bottom: 0; right: 0; width: 0; background: #2563EB; border-radius: 8px; transition: width .2s; }
.imp-prog span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 18px; color: #111827; }
.imp-log { height: 140px; overflow-y: auto; background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 6px; font-size: 12px; color: #374151; padding: 6px 8px; line-height: 1.7; white-space: pre-wrap; }
.imp-btns { display: flex; gap: 6px; }
.imp-start { flex: 1; height: 40px; border: none; border-radius: 6px; background: #2563EB; color: #fff; font-size: 14px; padding: 0 20px; white-space: pre; }
.imp-start:hover { background: #1D4ED8; }
.imp-start:disabled { background: #9CA3AF; cursor: default; }
.imp-close { width: 90px; height: 40px; border: 1px solid #D1D5DB; border-radius: 6px; background: #fff; font-size: 13px; }
.imp-close:hover { background: #F3F4F6; }
.dup-info { font-size: 13px; color: #1E293B; line-height: 1.7; margin-bottom: 6px; }
.dup-wrap { max-height: 396px; overflow-y: auto; border: 1px solid #E2E8F0; border-radius: 6px; }
.dup-tbl { width: 100%; border-collapse: collapse; font-size: 12px; color: #1E293B; }
.dup-tbl th { position: sticky; top: 0; background: #1E3A5F; color: #fff; font-weight: 700; padding: 6px; }
.dup-tbl td { padding: 6px; border-top: 1px solid #E2E8F0; text-align: center; height: 30px; }
.dup-tbl td:nth-child(2) { text-align: right; }

/* ═════════════ صفحة الأصول: الأزرار + نافذة الجهاز (EquipmentDialog) ═════════════ */
.as-add { width: 37px; height: 37px; flex: 0 0 37px; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.as-add:hover { background: #F1F5F9; border-color: #CBD5E1; }
.as-actions { height: 58px; flex: 0 0 58px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: #fff; border-top: 2px solid #E2E8F0; }
.ab-btn { width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; padding: 0; }
.ab-view { background: transparent; border: 1.5px solid #CBD5E1; }
.ab-view:hover { background: #F1F5F9; }
.ab-del { background: #FEF2F2; border: none; }
.ab-del:hover { background: #FEE2E2; }
.ab-hint { color: #94A3B8; font-size: 12px; }

.eq-win { width: 960px; height: 700px; max-height: 94vh; display: flex; flex-direction: column; background: #F8FAFC; }
.eq-head { height: 64px; flex: 0 0 64px; background: var(--primary); display: flex; align-items: center; justify-content: space-between; padding: 0 24px 0 32px; }
.eq-title { color: #fff; font-size: 17px; font-weight: 700; }
.eq-name { color: rgba(255,255,255,0.7); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.eq-tabs { display: flex; flex: 0 0 auto; background: #F8FAFC; }
.eq-tab { background: #E2E8F0; color: #475569; font-size: 13px; font-weight: 700; padding: 10px 22px; border: none; border-radius: 0; min-width: 140px; }
.eq-tab:hover:not(.on) { background: #CBD5E1; color: #1E293B; }
.eq-tab.on { background: var(--primary); color: #fff; }
.eq-pane { flex: 1; min-height: 0; overflow-y: auto; background: #F8FAFC; }
.eq-form { padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; }
.eq-sec { font-size: 13px; font-weight: 700; color: #1E3A5F; background: #EFF6FF; border-left: 4px solid #2563EB; border-radius: 0 6px 6px 0; padding: 6px 14px; margin: 4px 0; white-space: pre; }
.eq-sec:not(:first-child) { margin-top: 12px; }
.eq-grid { display: grid; grid-template-columns: max-content 1fr; gap: 10px; align-items: center; }
.eq-grid label { font-size: 13px; font-weight: 600; color: #334155; }
.eq-form input, .eq-form select { width: 100%; min-height: 38px; height: 38px; background: #F8FAFC; border: 2px solid #E2E8F0; border-radius: 8px; padding: 0 12px; font-size: 14px; color: #0F172A; font-family: inherit; outline: none; }
.eq-form input:focus, .eq-form select:focus { border-color: #3B82F6; background: #EFF6FF; }
.eq-form.ro input, .eq-form.ro select { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }
.eq-form.ro select { appearance: none; pointer-events: none; opacity: 0.85; }
.eq-form.ed .eq-grid input { background: #fff; border: 1.5px solid #CBD5E1; padding: 0 14px; font-size: 13px; }
.eq-form.ed .eq-grid input:focus { border-color: #3B82F6; }
.eq-form input.bad { border-color: #EF4444 !important; }
.eq-dup { color: #B91C1C; font-size: 11px; margin-top: -4px; }
.eq-prices { border: 1px solid #E2E8F0; border-radius: 10px; background: #fff; overflow: hidden; }
.eq-pr-head, .eq-pr-row { display: grid; grid-template-columns: 90px repeat(5, 1fr); align-items: center; }
.eq-pr-head { background: var(--primary); }
.eq-pr-head span { color: #fff; font-size: 12px; font-weight: 700; text-align: center; padding: 10px 0; }
.eq-pr-head span + span:not(:last-child) { border-left: 1px solid rgba(255,255,255,0.15); }
.eq-pr-row { background: #F8FAFC; border-top: 1px solid #E2E8F0; padding: 6px 0; }
.eq-pr-row span { font-size: 12px; color: #475569; font-weight: 500; text-align: center; }
.eq-form .eq-pr-row input { width: auto; margin: 0 6px; height: 30px; min-height: 30px; background: #fff; border: 1px solid #E2E8F0; border-radius: 6px; padding: 4px 6px; font-size: 13px; }
.eq-form.ro .eq-pr-row input { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.eq-form textarea { width: 100%; height: 90px; resize: none; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 8px 14px; font-size: 13px; color: #0F172A; font-family: inherit; outline: none; }
.eq-form textarea:focus { border-color: #3B82F6; }
.eq-att-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #fff; }
.eq-att-t { font-size: 13px; color: #64748B; }
.eq-att-s { font-size: 11px; color: #94A3B8; }
.eq-bar { height: 62px; flex: 0 0 62px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: #fff; border-top: 1.5px solid #E2E8F0; }
.eq-save { width: 100px; height: 38px; border: none; border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 0; display: flex; align-items: center; justify-content: center; gap: 2px; white-space: pre; }
.eq-save:hover { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.3); }
.eq-save:disabled { opacity: .6; }
.eq-edit { width: 42px; height: 42px; border-radius: 21px; border: 1.5px solid #CBD5E1; background: transparent; display: flex; align-items: center; justify-content: center; padding: 0; }
.eq-edit:hover { background: #F1F5F9; }
.eq-rowinfo { color: #94A3B8; font-size: 12px; }

/* make_dialog / show_warning */
.msg-body { background: #F8FAFC; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.msg-row { display: flex; align-items: center; gap: 14px; }
.msg-text { font-size: 13px; color: #374151; white-space: pre-line; line-height: 1.6; flex: 1; }
.msg-btns { display: flex; gap: 8px; }
.msg-btns button { flex: 1; height: 32px; border: none; border-radius: 8px; font-size: 11px; font-weight: 700; }
.m-ok { background: #1E3A5F; color: #fff; } .m-ok:hover { background: #152C4A; }
.m-cancel { background: #F1F5F9; color: #374151; } .m-cancel:hover { background: #E2E8F0; }
#msgModal { z-index: 140; }

/* ═════════════ التعديل من الجدول + الملاحظات + السجلات ═════════════ */
.cell-ed { position: fixed; z-index: 60; background: #fff; border: 2px solid #3B82F6; border-radius: 4px; font-size: 13px; padding: 2px 6px; color: #0F172A; outline: none; font-family: inherit; }
.cell-ed.ppm { font-size: 12px; font-weight: 700; }
.g tbody td.has-note { background-image: linear-gradient(135deg, #F97316 0 6px, transparent 6px) !important; background-repeat: no-repeat; }
.note-pop { position: fixed; z-index: 160; max-width: 328px; background: #FFFBF5; border: 1.5px solid #F97316; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #1E293B; white-space: pre-wrap; pointer-events: none; }
.note-ed { width: 100%; min-height: 100px; background: #fff; border: 1.5px solid #CBD5E1; border-radius: 8px; font-size: 13px; padding: 6px; outline: none; font-family: inherit; resize: vertical; }
.note-ed:focus { border-color: #1E3A5F; }
.bulk-lbl { font-size: 13px; color: #1F2937; }
#bulkEd input, #bulkEd select, #s2BulkEd input, #s2BulkEd select { width: 100%; height: 36px; background: #fff; border: 1.5px solid #CBD5E1; border-radius: 8px; font-size: 13px; padding: 0 10px; outline: none; font-family: inherit; }
#bulkEd input:focus { border-color: #1E3A5F; }
#bulkEd select.ppm { height: 38px; }
.bulk-btns { gap: 4px; }
.b-clear { background: #FEE2E2; color: #B91C1C; border: 1.5px solid #FECACA !important; }
.b-clear:hover { background: #DC2626; color: #fff; }
.b-cancel { background: #fff; color: #475569; border: 1.5px solid #CBD5E1 !important; }
.b-cancel:hover { background: #F1F5F9; }
.log-dlg { width: 620px; height: 600px; max-height: 92vh; display: flex; flex-direction: column; }
.log-body { flex: 1; min-height: 0; background: #fff; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.log-top { display: flex; align-items: flex-start; gap: 10px; }
.log-top > div { flex: 1; min-width: 0; }
.log-name { font-size: 16px; font-weight: 700; color: #0F2340; user-select: text; }
.log-sub { font-size: 12px; color: #475569; user-select: text; margin-top: 2px; }
.log-search { width: 200px; height: 32px; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 8px; font-size: 12px; color: #0F172A; outline: none; font-family: inherit; }
.log-search:focus { border-color: #1E3A5F; }
.log-line { height: 1px; background: #E2E8F0; flex: 0 0 1px; }
.log-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.log-chips:empty { display: none; }
.log-chip { border-radius: 11px; padding: 3px 12px; font-size: 12px; font-weight: 700; border: 1px solid; }
.log-tbl-wrap { flex: 1; min-height: 0; overflow-y: auto; border: 1px solid #E2E8F0; border-radius: 6px; }
.log-tbl { width: 100%; border-collapse: collapse; font-size: 13px; color: #0F172A; table-layout: fixed; }
.log-tbl th { position: sticky; top: 0; background: #F1F5F9; color: #334155; font-weight: 700; border-bottom: 1px solid #E2E8F0; padding: 7px; }
.log-tbl td { height: 32px; text-align: center; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.log-tbl td.v { font-weight: 700; }
.log-tbl tr.ev td { background: #E6F1FB; }
.log-tbl tr.ev td.f { color: #0C447C; font-weight: 700; }
.v-tag { display: inline-block; border-radius: 9px; padding: 1px 8px; font-size: 11px; font-weight: 700; margin-inline-start: 6px; }
.v-tag.prev { background: #FEF3C7; color: #92400E; }
.v-tag.extra { background: #DBEAFE; color: #1E40AF; }
.log-empty { font-size: 14px; color: #64748B; text-align: center; padding: 40px; }
.log-ft { display: flex; align-items: center; gap: 8px; }
.log-note { font-size: 11px; color: #64748B; }
.log-btn { flex: 0 0 auto !important; min-width: 100px; height: 32px; border-radius: 8px; font-size: 11px; font-weight: 700; border: none; }

/* ═════════════ نافذة «إضافة جهاز جديد» (add_equipment_page.py) ═════════════ */
.add-win { width: 1100px; height: 700px; max-height: 94vh; display: flex; flex-direction: column; background: #F8FAFC; }
.ad-head { height: 56px; flex: 0 0 56px; background: var(--primary); display: flex; align-items: center; gap: 8px; padding: 0 20px; }
.ad-title { color: #fff; font-size: 16px; font-weight: 700; white-space: pre; }
.ad-pg-lbl { color: #CBD5E1; font-size: 12px; }
.ad-pg { width: 160px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.18); overflow: hidden; }
.ad-pg i { display: block; height: 100%; width: 0; border-radius: 4px; background: #EF4444; transition: width .15s; }
.ad-pct { min-width: 38px; color: #fff; font-size: 13px; font-weight: 700; }
.ad-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.ad-body > * { flex-shrink: 0; }
.ad-sec { font-size: 12px; font-weight: 700; color: #475569; background: #F1F5F9; border-radius: 6px; padding: 5px 10px; white-space: pre; }
.ad-lbl { font-size: 13px; font-weight: 600; color: #334155; white-space: nowrap; }
.ad-lbl .req { color: #EF4444; }
.ad-name-row { display: grid; grid-template-columns: 110px 1fr; gap: 6px; align-items: center; }
.ad-grid3 { display: grid; grid-template-columns: max-content 1fr max-content 1fr max-content 1fr; gap: 10px; align-items: center; }
.ad-body input, .ad-body select, .sc { height: 36px; min-height: 36px; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 12px; font-size: 13px; color: #0F172A; outline: none; font-family: inherit; width: 100%; }
.ad-body input:focus, .ad-body select:focus, .sc:focus { border-color: #3B82F6; }
.ad-body input.bad { border-color: #EF4444; }
.ad-war { cursor: pointer; }
.ad-asset { display: flex; flex-direction: column; gap: 3px; align-self: start; }
.ad-dup { color: #B91C1C; font-size: 11px; }
.ad-dup a { color: #B91C1C; text-decoration: underline; }
.sc { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; gap: 6px; }
.sc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.sc::after { content: "▾"; color: #64748B; font-size: 11px; }
.sc-pop { position: fixed; z-index: 150; width: 300px; background: #fff; border: 1.5px solid #CBD5E1; border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.sc-search { height: 30px; background: #F1F5F9; border: 1px solid #E2E8F0; border-radius: 6px; padding: 5px 8px; font-size: 12px; outline: none; font-family: inherit; }
.sc-list { max-height: 264px; overflow-y: auto; }
.sc-item { padding: 7px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 32px; unicode-bidi: plaintext; text-align: right; }
.sc-item:hover, .sc-item.cur { background: #1E3A5F; color: #fff; }
.sc-item.add { color: #3B82F6; }
.sc-item.add:hover { color: #fff; }
.ad-ppm { display: flex; align-items: center; gap: 10px; }
.ad-ppm input { width: 189px !important; }
.ad-prices .eq-pr-row input { width: calc(100% - 12px); min-width: 0; margin: 0 6px; height: 30px; min-height: 30px; border: 1px solid #E2E8F0; border-radius: 6px; padding: 4px 6px; }
.ad-att-head { display: flex; align-items: center; gap: 8px; }
.ad-badge { background: #1E3A5F; color: #fff; font-size: 11px; padding: 2px 10px; border-radius: 10px; }
.ad-drop { height: 70px; flex: 0 0 70px; background: #F8FAFC; border: 2px dashed #CBD5E1; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.ad-drop:hover, .ad-drop.over { border-color: #94A3B8; background: #F1F5F9; }
.ad-drop button { width: 110px; height: 32px; background: #1E3A5F; color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 700; }
.ad-drop button:hover { background: #2d5080; }
.ad-att-none { color: #94A3B8; font-size: 11px; padding: 2px 8px; }
.ad-att { width: 100%; border: 1px solid #E2E8F0; border-radius: 6px; border-collapse: separate; border-spacing: 0; font-size: 12px; background: #fff; overflow: hidden; }
.ad-att th { background: #F1F5F9; color: #64748B; font-size: 11px; font-weight: 700; border-bottom: 1px solid #E2E8F0; padding: 6px; }
.ad-att td { padding: 4px 8px; height: 34px; }
.ad-att tr:nth-child(even) td { background: #F8FAFC; }
.ad-att td:first-child { text-align: right; max-width: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1E293B; }
.ad-att td:not(:first-child) { text-align: center; }
.att-type { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 2px 6px; }
.att-del { height: 24px; background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; border-radius: 5px; font-size: 11px; font-weight: 700; padding: 0 8px; }
.att-del:hover { background: #FEE2E2; }
.ad-notes { display: flex; gap: 10px; align-items: flex-start; }
.ad-notes textarea { flex: 1; height: 70px; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 6px 12px; font-size: 13px; resize: none; outline: none; font-family: inherit; }
.ad-notes textarea:focus { border-color: #3B82F6; }
.ad-bar { height: 60px; flex: 0 0 60px; display: flex; align-items: center; gap: 10px; padding: 0 20px; background: #fff; border-top: 1.5px solid #E2E8F0; }
.ad-btn { height: 36px; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 14px; }
.ad-btn.pri { width: 100px; padding: 0; background: var(--primary); color: #fff; border: none; } .ad-btn.pri:hover { background: #1E40AF; }
.ad-btn.sec { width: 100px; padding: 0; background: #475569; color: #fff; border: none; } .ad-btn.sec:hover { background: #334155; }
.ad-btn.out { width: 80px; padding: 0; background: #fff; color: #475569; border: 2px solid #CBD5E1; } .ad-btn.out:hover { background: #F1F5F9; }
.ad-btn:disabled { opacity: .6; }
.ad-err { color: #EF4444; font-size: 12px; }
.ad-err.ok { color: #22C55E; } .ad-err.muted { color: #94A3B8; }
/* نافذة الإدخال (_input_dialog) */
.inp-head { justify-content: flex-start; height: 50px; padding: 0 18px; font-size: 14px; }
.inp-body { background: #F8FAFC; padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 10px; }
.inp-lbl { font-size: 13px; font-weight: 600; color: #334155; }
.inp-body input { height: 36px; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 12px; font-size: 13px; color: #0F172A; outline: none; font-family: inherit; }
.inp-body input:focus { border-color: #3B82F6; }
.inp-ft { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: #fff; border-top: 1px solid #E2E8F0; }
.inp-ft button { height: 32px; border-radius: 8px; font-size: 13px; font-weight: 700; padding: 0 20px; }
.inp-cancel { background: #fff; color: #475569; border: 1.5px solid #CBD5E1; } .inp-cancel:hover { background: #F1F5F9; }
.inp-ok { background: var(--primary); color: #fff; border: none; }
#inpModal, #draftsModal { z-index: 145; }
/* المسودات */
.dr-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.dr-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 0.5px solid #E2E8F0; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.dr-row.on { border: 1.5px solid #1E3A5F; }
.dr-row div { flex: 1; min-width: 0; }
.dr-name { font-size: 13px; font-weight: 700; color: #1E293B; }
.dr-date { font-size: 11px; color: #94A3B8; }
.dr-sel { width: 22px; height: 22px; border-radius: 11px; border: 1.5px solid #CBD5E1; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex: 0 0 22px; }
.dr-row.on .dr-sel { background: #1E3A5F; border-color: #1E3A5F; }
.dr-foot { display: flex; gap: 8px; }
.dr-resume { height: 34px; background: #1E3A5F; color: #fff; border: none; border-radius: 8px; font-size: 12px; font-weight: 500; padding: 0 16px; } .dr-resume:hover { background: #152C4A; }
.dr-del { height: 34px; background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; border-radius: 8px; font-size: 12px; font-weight: 500; padding: 0 14px; } .dr-del:hover { background: #FEE2E2; }

/* ═════════════ التقويم الموحّد (calendar_popup.py) ═════════════ */
.cal-pop { position: fixed; z-index: 155; width: 280px; background: #fff; border: 1px solid #CBD5E1; border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-family: var(--ui-font); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; background: #1E3A5F; border-radius: 8px; padding: 4px; }
.cal-nav button { background: transparent; color: #fff; border: none; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.cal-nav button:hover { background: #2D5382; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 6px 2px; }
.cal-grid span { text-align: center; font-size: 12px; color: #1F2937; height: 30px; line-height: 30px; border-radius: 4px; }
.cal-grid .wd { font-weight: 700; font-size: 11px; color: #475569; }
.cal-grid .we { color: #DC2626; }
.cal-grid .d { cursor: pointer; }
.cal-grid .d:hover { background: #E2E8F0; }
.cal-grid .o { color: #CBD5E1; }
.cal-grid .sel { background: #1E3A5F; color: #fff; }
.cal-clear { width: calc(100% - 8px); margin: 2px 4px 4px; background: #FEE2E2; color: #991B1B; border: none; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 5px 12px; }
.cal-clear:hover { background: #FECACA; }
.cal-years { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); width: 120px; max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid #CBD5E1; border-radius: 6px; z-index: 2; }
.cal-years div { padding: 6px; text-align: center; font-size: 12px; cursor: pointer; }
.cal-years div:hover, .cal-years div.cur { background: #1E3A5F; color: #fff; }
#addModal { z-index: 95; }
.dr-date { direction: ltr; text-align: right; }
@media (max-width: 760px) {
  .ad-head { padding: 0 12px; } .ad-pg-lbl { display: none; } .ad-pg { width: 80px; }
  .ad-body { padding: 14px 12px; }
  .ad-grid3 { grid-template-columns: max-content 1fr; }
  .ad-ppm { flex-wrap: wrap; } .ad-ppm > span { display: none; } .ad-ppm input { width: calc(100% - 130px) !important; flex: 1; }
  .ad-prices { overflow-x: auto; } .ad-prices .eq-pr-head, .ad-prices .eq-pr-row { min-width: 560px; }
  .ad-notes { flex-direction: column; } .ad-notes textarea { width: 100%; }
  .ad-bar { padding: 0 10px; gap: 6px; } .ad-err { display: none; } .ad-err:not(:empty) { display: block; position: absolute; bottom: 62px; right: 12px; background: #fff; padding: 2px 6px; border-radius: 4px; }
}

/* ═════════════ تبويب المرفقات (EquipmentDialog) ═════════════ */
.eq-att-pane:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.att-head { height: 52px; flex: 0 0 52px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #F8FAFC; border-bottom: 1px solid #E2E8F0; }
.att-title { font-size: 14px; font-weight: 700; color: #1E3A5F; }
.att-count { background: #EFF6FF; color: #1D4ED8; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 10px; }
.att-add { width: 37px; height: 37px; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0; }
.att-add:hover { background: #F1F5F9; border-color: #CBD5E1; }
.att-scroll { flex: 1; min-height: 0; overflow: auto; }
.att-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.att-tbl th { position: sticky; top: 0; height: 36px; background: #F1F5F9; border-bottom: 1px solid #E2E8F0; font-size: 11px; font-weight: 700; color: #64748B; text-align: center; padding: 0 6px; }
.att-tbl th.an { text-align: right; padding-right: 16px; }
.att-tbl td { height: 48px; border-bottom: 1px solid #F1F5F9; text-align: center; color: #475569; padding: 0 6px; }
.att-tbl tr:hover td { background: #F8FAFC; }
.att-tbl td.an { text-align: right; padding-right: 16px; font-weight: 700; color: #1E3A5F; max-width: 1px; width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-tbl td.ad { font-size: 11px; color: #64748B; white-space: nowrap; direction: ltr; }
.att-act { display: inline-flex; gap: 4px; }
.att-act button { height: 28px; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 0 8px; }
.att-open { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; } .att-open:hover { background: #DBEAFE; }
.att-dl { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; } .att-dl:hover { background: #DCFCE7; }
.att-tbl .att-del { height: 28px; font-size: 11px; }
/* ═════════════ تبويب الأجهزة المستبدَلة ═════════════ */
.repl-pane:not([hidden]) { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.repl-title { font-size: 14px; font-weight: 700; color: var(--primary); }
.repl-wrap { flex: 1; min-height: 120px; overflow: auto; border: 1px solid #E2E8F0; border-radius: 8px; background: #fff; }
.repl-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.repl-tbl th { position: sticky; top: 0; background: var(--primary); color: #fff; font-weight: 700; padding: 6px; white-space: nowrap; }
.repl-tbl td { padding: 6px; text-align: center; white-space: nowrap; color: #1E293B; cursor: default; }
.repl-tbl tr:nth-child(even) td { background: #F8FAFC; }
.repl-tbl tr.on td { background: #EFF6FF; }
.repl-del { width: 36px; height: 36px; align-self: flex-end; background: #FEF2F2; border: none; border-radius: 18px; display: flex; align-items: center; justify-content: center; padding: 0; }
.repl-del:hover { background: #FEE2E2; }
/* نافذة بيانات الجهاز المستبدل */
.repl-dlg { width: 600px; height: 520px; max-height: 94vh; display: flex; flex-direction: column; background: #F8FAFC; }
.repl-dlg .dlg-head { height: 56px; flex: 0 0 56px; padding: 0 20px; font-size: 14px; }
.repl-info { font-size: 12px; color: #475569; background: #EFF6FF; padding: 10px 16px; border-bottom: 1px solid #BFDBFE; }
.repl-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.repl-row { display: flex; align-items: center; gap: 8px; }
.repl-row label { width: 110px; flex: 0 0 110px; font-size: 12px; color: #475569; }
.repl-row input, .repl-body textarea { flex: 1; min-width: 0; background: #fff; border: 1px solid #E2E8F0; border-radius: 6px; padding: 6px 10px; font-size: 13px; color: #0F172A; min-height: 30px; outline: none; font-family: inherit; }
.repl-row input:focus, .repl-body textarea:focus { border-color: #3B82F6; }
.repl-body textarea { height: 60px; flex: 0 0 60px; resize: none; padding: 4px; }
.repl-ft { height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 6px; padding: 0 16px; background: #fff; border-top: 1px solid #E2E8F0; }
.repl-ft button { height: 32px; border-radius: 8px; font-size: 11px; font-weight: 700; padding: 0 14px; }
.repl-save { background: var(--primary); color: #fff; border: none; }
.repl-cancel { background: #fff; color: #475569; border: 1.5px solid #CBD5E1; } .repl-cancel:hover { background: #F1F5F9; }
#replModal { z-index: 120; }
/* مؤشر الرفع */
.up-busy { position: fixed; inset: 0; z-index: 160; background: rgba(15,23,42,.25); display: flex; align-items: center; justify-content: center; }
.up-box { background: #fff; border-radius: 10px; padding: 16px 22px; display: flex; align-items: center; gap: 12px; font-size: 13px; color: #1E293B; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.up-spin { width: 20px; height: 20px; border: 3px solid #E2E8F0; border-top-color: var(--primary); border-radius: 50%; animation: upspin .8s linear infinite; }
@keyframes upspin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .att-tbl th:nth-child(4), .att-tbl td:nth-child(4), .att-tbl th:nth-child(5), .att-tbl td:nth-child(5) { display: none; }
  .repl-row label { width: 90px; flex-basis: 90px; }
}

/* ═════════════ صفحة الإعدادات (settings_page.py) ═════════════ */
.content:has(.st-page) { overflow: hidden; }
.st-page { height: 100%; display: flex; }
.st-side { width: 220px; flex: 0 0 220px; background: #0F172A; display: flex; flex-direction: column; border-left: 1px solid #1E293B; }
.st-head { height: 72px; flex: 0 0 72px; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid #1E293B; }
.st-gear { width: 34px; height: 34px; background: #1E3A5F; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.st-t1 { color: #F1F5F9; font-size: 13px; font-weight: 700; }
.st-t2 { color: #94A3B8; font-size: 11px; }
.st-nav { flex: 1; overflow-y: auto; padding: 14px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.st-sec { color: #94A3B8; font-size: 11px; font-weight: 700; padding: 10px 8px 4px; letter-spacing: .5px; }
.st-item { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 6px; border-radius: 10px; text-decoration: none; color: #94A3B8; position: relative; }
.st-item:hover { background: rgba(255,255,255,0.05); }
.st-ic { width: 20px; height: 20px; color: #64748B; display: flex; }
.st-txt { flex: 1; font-size: 13px; font-weight: 500; }
.st-bar { width: 4px; height: 24px; border-radius: 2px; background: transparent; position: absolute; right: 0; }
.st-item.on { background: rgba(255,255,255,0.08); color: #fff; }
.st-item.on .st-txt { font-weight: 700; }
.st-item.on .st-ic { color: #60A5FA; }
.st-item.on .st-bar { background: #60A5FA; }
.st-foot { height: 40px; flex: 0 0 40px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-top: 1px solid #1E293B; color: #64748B; font-size: 11px; }
.st-dot { width: 8px; height: 8px; border-radius: 4px; background: #22C55E; }
.st-main { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; }
.st-pane:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* المستخدمون */
.us-pane { background: #F1F5F9; padding: 24px; gap: 14px; overflow-y: auto; }
.us-top { display: flex; align-items: center; gap: 8px; }
.us-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--primary); }
.us-add { background: var(--primary); color: #fff; border: none; border-radius: 9px; font-size: 14px; padding: 6px 16px; white-space: pre; }
.us-add:hover { opacity: .9; }
.us-sub { font-size: 11px; color: #64748B; margin-top: -10px; }
.us-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.us-stat { background: #fff; border: 1px solid #E3E8EF; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.us-stat i { width: 10px; height: 10px; border-radius: 5px; }
.us-stat b { display: block; font-size: 20px; color: #14263D; }
.us-stat span { font-size: 11px; color: #64748B; }
.us-card { background: #fff; border: 1px solid #E3E8EF; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.us-card-ic { width: 36px; height: 36px; flex: 0 0 36px; background: #EEF2F7; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.us-card-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.us-card-t b { font-size: 13px; color: #14263D; } .us-card-t span { font-size: 11px; color: #64748B; }
.us-gdot { width: 7px; height: 7px; border-radius: 4px; background: #16A34A; }
.us-on-txt { font-size: 11px; color: #475569; margin-left: 6px; }
.us-out-all { height: 32px; background: #fff; border: 1px solid #CBD5E1; border-radius: 8px; padding: 0 14px; font-size: 11px; font-weight: 700; color: #1E3A5F; }
.us-out-all:hover { background: #F6F8FB; border-color: #94A3B8; }
.us-panel { background: #fff; border: 1px solid #E3E8EF; border-radius: 14px; display: flex; flex-direction: column; min-height: 300px; flex: 1; overflow: hidden; }
.us-tools { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #E3E8EF; flex-wrap: wrap; }
.us-search { width: 280px; max-width: 100%; height: 32px; border: 1px solid #E3E8EF; border-radius: 9px; padding: 0 10px; font-size: 11px; outline: none; font-family: inherit; }
.us-search:focus { border-color: #3B82F6; }
.us-seg { background: #F6F8FB; border: 1px solid #E3E8EF; border-radius: 9px; padding: 3px; display: flex; gap: 2px; flex-wrap: wrap; }
.us-seg button { height: 26px; background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 0 10px; font-size: 11px; font-weight: 700; color: #64748B; white-space: pre; }
.us-seg button.on { background: #fff; color: #14263D; border-color: #E3E8EF; }
.us-tbl-wrap { flex: 1; overflow: auto; }
.us-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.us-tbl th { position: sticky; top: 0; z-index: 1; background: #F6F8FB; color: #64748B; font-weight: 700; font-size: 11px; padding: 8px; border-bottom: 1px solid #E3E8EF; }
.us-tbl td { height: 58px; border-bottom: 1px solid #E3E8EF; text-align: center; padding: 4px 6px; color: #64748B; }
.us-tbl th.c-user { width: 300px; }
.us-tbl tr.off td { color: #94A3B8; }
.us-tbl tr.drop-b td { box-shadow: inset 0 -3px 0 #2563EB; }
.us-tbl tr.drop-t td { box-shadow: inset 0 3px 0 #2563EB; }
.us-u { display: flex; align-items: center; gap: 10px; text-align: right; }
.us-drag { color: #94A3B8; cursor: grab; font-size: 14px; letter-spacing: -2px; padding: 0 2px; user-select: none; }
.us-av { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 17px; color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.us-av.on { box-shadow: 0 0 0 2px #12805C; }
.us-nm { font-size: 12px; font-weight: 700; color: #14263D; }
.us-un { font-size: 10px; color: #94A3B8; margin-right: 8px; font-weight: 400; }
.us-em { font-size: 10px; color: #64748B; direction: ltr; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
tr.off .us-nm, tr.off .us-em { color: #94A3B8; }
.pill { display: inline-block; height: 22px; line-height: 22px; border-radius: 11px; padding: 0 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.us-comp { font-size: 10px; color: #64748B; margin-top: 2px; }
.us-act { display: inline-flex; gap: 6px; }
.us-act button { width: 30px; height: 30px; background: #fff; border: 1px solid #E3E8EF; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0; color: #475569; }
.us-act button:hover { background: #F6F8FB; border-color: #CBD5E1; }
.us-menu { min-width: 220px; border-radius: 10px; padding: 6px; border: 1px solid #E3E8EF; }
.us-menu .ctx-item { padding: 7px 18px; font-size: 12px; border-radius: 6px; }
.us-menu .ctx-item.dis { color: #CBD5E1; pointer-events: none; }
/* نوافذ صغيرة */
.st-dlg { width: 380px; }
.st-dlg-head { height: 44px; padding: 0 16px; font-size: 14px; }
.st-dlg-body { background: #F8FAFC; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.st-dlg-msg { font-size: 13px; color: #1E293B; white-space: pre-line; line-height: 1.6; }
.st-dlg-btns { display: flex; gap: 10px; margin-top: 4px; }
.st-dlg-btns button { flex: 1; height: 36px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.sd-ok { background: var(--primary); color: #fff; border: none; } .sd-ok:hover { background: #162d4a; }
.sd-cancel { background: #F8FAFC; color: #475569; border: 1.5px solid #E2E8F0; } .sd-cancel:hover { background: #F1F5F9; }
.st-inp { width: 100%; height: 38px; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 9px; padding: 0 14px; font-size: 13px; color: #0F172A; outline: none; font-family: inherit; }
.st-inp:focus { border-color: #3B82F6; background: #F0F7FF; }
.st-inp:read-only { background: #F8FAFC; color: #94A3B8; }
.st-inp.bad { border-color: #DC2626; }
.rp-hint { font-size: 10px; color: #64748B; }
#cfModal, #rpModal, #oaModal, #pfModal { z-index: 140; }
.oa-dlg { width: 400px; background: #fff; padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.oa-row { display: flex; gap: 12px; }
.oa-ic { width: 40px; height: 40px; flex: 0 0 40px; background: #FEF2F2; color: #B91C1C; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.oa-t { font-size: 14px; font-weight: 700; color: #0F172A; margin-bottom: 6px; }
.oa-m { font-size: 12px; color: #475569; margin-bottom: 6px; }
.oa-n { font-size: 11px; color: #64748B; text-align: left; }
.oa-btns { display: flex; gap: 8px; }
.oa-btns button { height: 32px; border-radius: 8px; padding: 0 18px; font-size: 12px; }
.oa-ok { background: #B91C1C; color: #fff; border: none; font-weight: 700; } .oa-ok:hover { background: #991B1B; } .oa-ok:disabled { opacity: .5; }
.oa-cancel { background: #fff; color: #334155; border: 1px solid #CBD5E1; } .oa-cancel:hover { background: #F6F8FB; }
/* نافذة المستخدم */
.ud-win { width: 1000px; height: 90vh; display: flex; flex-direction: column; background: #F8FAFC; }
.ud-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 24px 16px; display: flex; flex-direction: column; gap: 12px; }
.ud-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.ud-grid label { display: block; font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 2px; }
.ud-err { color: #DC2626; font-size: 11px; padding: 2px 4px; }
.ud-strength { max-width: 480px; }
.ud-anote { color: #1D4ED8; background: #EFF6FF; border-radius: 8px; padding: 8px 12px; font-size: 12px; }
.ud-bar { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 24px; border-top: 1px solid #E2E8F0; background: #F8FAFC; }
.ud-bar button { flex: 1; height: 32px; border-radius: 9px; font-size: 11px; font-weight: 700; }
.ud-save { background: var(--primary); color: #fff; border: none; } .ud-save:disabled { background: #CBD5E1; }
.ud-cancel { background: #F8FAFC; color: #475569; border: 1.5px solid #E2E8F0; } .ud-cancel:hover { background: #F1F5F9; }
.pm-box { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; min-height: 500px; display: flex; flex-direction: column; overflow: hidden; }
.pm-top { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid #E2E8F0; }
.pm-top b { font-size: 13px; color: #14263D; }
.pm-copy { background: #fff; border: 1px dashed #CBD5E1; border-radius: 8px; font-size: 11px; font-weight: 700; color: var(--primary); padding: 3px 10px; min-width: 150px; font-family: inherit; outline: none; }
.pm-body { flex: 1; display: flex; min-height: 440px; }
.pm-list { width: 290px; flex: 0 0 290px; border-left: 1px solid #E2E8F0; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.pm-search { height: 30px; border: 1px solid #E2E8F0; border-radius: 8px; padding: 0 10px; font-size: 11px; outline: none; font-family: inherit; }
.pm-rows { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; max-height: 520px; }
.pm-row { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 8px; cursor: pointer; border-right: 3px solid transparent; }
.pm-row:hover { background: #F8FAFC; }
.pm-row.sel { background: #EEF3F9; border-right-color: var(--primary); }
.pm-row .nm { flex: 1; font-size: 12px; color: #14263D; }
.pm-row.sel .nm { font-weight: 700; }
.pm-cnt { font-size: 10px; font-weight: 700; border-radius: 8px; padding: 1px 8px; color: #64748B; background: #F6F8FB; }
.pm-cnt.full { color: #12805C; background: #E7F5EF; }
.tri { width: 15px; height: 15px; flex: 0 0 15px; border: 2px solid #CBD5E1; border-radius: 4px; background: #fff; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; }
.tri.s1 { background: var(--primary); border-color: var(--primary); } .tri.s1::after { content: "–"; }
.tri.s2 { background: var(--primary); border-color: var(--primary); } .tri.s2::after { content: "✓"; }
.pm-detail { flex: 1; min-width: 0; background: #F8FAFC; padding: 14px 18px; overflow-y: auto; max-height: 560px; display: flex; flex-direction: column; gap: 6px; }
.pd-head { display: flex; align-items: center; }
.pd-head b { flex: 1; font-size: 15px; color: #14263D; }
.pd-all { background: transparent; border: none; color: var(--primary); font-size: 11px; font-weight: 700; }
.pd-all:hover { text-decoration: underline; }
.pd-sub { font-size: 11px; color: #64748B; }
.pd-grp { font-size: 11px; font-weight: 700; color: #64748B; padding: 8px 0 2px; }
.pd-item { background: #fff; border: 1px solid #E3E8EF; border-radius: 10px; padding: 7px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.pd-item.dis { cursor: default; }
.pd-item .tx { flex: 1; display: flex; flex-direction: column; }
.pd-item .tx b { font-size: 12px; color: #14263D; }
.pd-item .tx span { font-size: 10px; color: #64748B; white-space: pre-line; }
.pm-cb { width: 15px; height: 15px; flex: 0 0 15px; accent-color: var(--primary); margin: 0; cursor: pointer; }
.pm-cb:disabled { cursor: default; }
.pd-tag { font-size: 10px; font-weight: 700; border-radius: 8px; padding: 1px 8px; }
.pd-tag.base { color: #1E3A5F; background: #EEF3F9; } .pd-tag.sens { color: #C2352B; background: #FBEAE8; }
.pd-tabsubs { display: flex; gap: 14px; padding: 0 28px 4px 4px; flex-wrap: wrap; }
.pd-tabsubs label, .pd-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #334155; cursor: pointer; }
.pd-seg { display: inline-flex; border: 1px solid #CBD5E1; border-radius: 8px; overflow: hidden; }
.pd-seg button { background: #fff; color: #334155; border: none; font-size: 12px; padding: 6px 12px; }
.pd-seg button.on { background: #1E3A5F; color: #fff; }
.pd-seg button:disabled { background: #F8FAFC; color: #94A3B8; }
.pd-flow { background: #fff; border: 1px solid #5DCAA5; border-radius: 10px; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.pd-flow > span { font-size: 10px; color: #64748B; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-chips label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #334155; border: 1px solid #CBD5E1; border-radius: 8px; padding: 4px 8px; background: #fff; cursor: pointer; }
.pd-chips label.on { background: #E1F5EE; border-color: #5DCAA5; color: #085041; }
.pd-chips.ltr { direction: ltr; }
.pd-note { font-size: 10px; color: #64748B; }
.pd-gbox { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 10px 12px; display: flex; align-items: flex-start; gap: 14px; }
.pd-gbox .all { font-weight: 700; color: #14263D; font-size: 12px; white-space: nowrap; }
.pd-gbox .sep { width: 1px; height: 18px; background: #E2E8F0; flex: 0 0 1px; }
.pd-gbox .gs { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pd-gbox .gs label { font-size: 12px; color: #334155; }
.pm-total { font-size: 11px; color: #64748B; padding: 7px 14px; border-top: 1px solid #E2E8F0; }
/* إعدادات PPM */
.ppm-pane { background: #F8FAFC; }
.pc-hdr { height: 52px; flex: 0 0 52px; background: #1E3A5F; color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center; padding: 0 22px; }
.pc-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.pc-ft { height: 44px; flex: 0 0 44px; background: #fff; border-top: 1px solid #E2E8F0; color: #64748B; font-size: 11px; display: flex; align-items: center; padding: 0 22px; }
.pc-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.pc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-top b { font-size: 15px; color: #1E293B; } .pc-top span { font-size: 11px; color: #64748B; }
.pc-add { height: 32px; background: #fff; border: 1.5px dashed #94A3B8; border-radius: 8px; color: #1E293B; font-size: 11px; font-weight: 700; padding: 0 16px; white-space: pre; }
.pc-add:hover { background: #F1F5F9; }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.pc-row { height: 40px; border: 1px solid #E2E8F0; border-radius: 8px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 8px; }
.pc-badge { min-width: 44px; height: 24px; line-height: 24px; text-align: center; border-radius: 6px; font-size: 12px; font-weight: 700; padding: 0 8px; }
.pc-lbl { flex: 1; font-size: 12px; color: #334155; }
.pc-link { background: transparent; border: none; font-size: 12px; font-weight: 700; padding: 0 6px; color: #1E293B; }
.pc-link:hover { text-decoration: underline; }
.pc-link.red { color: #B91C1C; }
.pc-lock { font-size: 11px; color: #94A3B8; padding: 0 6px; }
.pf-lbl { font-size: 12px; font-weight: 700; color: #1E293B; margin-bottom: -6px; }
.pf-err { color: #B91C1C; font-size: 11px; }
@media (max-width: 760px) {
  .st-page { flex-direction: column; }
  .st-side { width: auto; flex: 0 0 auto; border-left: none; }
  .st-head, .st-foot { display: none; }
  .st-nav { flex-direction: row; padding: 6px; overflow-x: auto; }
  .st-sec { display: none; }
  .st-item { flex: 0 0 auto; }
  .us-pane { padding: 12px; }
  .us-stats { grid-template-columns: 1fr 1fr; }
  .us-card { flex-wrap: wrap; }
  .us-tbl th:nth-child(3), .us-tbl td:nth-child(3), .us-tbl th:nth-child(5), .us-tbl td:nth-child(5) { display: none; }
  .us-tbl th.c-user { width: auto; }
  .ud-grid { grid-template-columns: 1fr; }
  .pm-body { flex-direction: column; }
  .pm-list { width: auto; flex: 0 0 auto; border-left: none; border-bottom: 1px solid #E2E8F0; }
  .pm-rows { max-height: 180px; }
  .pc-grid { grid-template-columns: 1fr; }
}
.ud-scroll > * { flex-shrink: 0; }
.ud-grid select.st-inp { color: #0F172A; }

/* ═════════════ الصفحة الرئيسية (dashboard_page.py) ═════════════ */
.db-page { padding: 16px 0 20px; display: flex; flex-direction: column; gap: 20px; max-width: 100%; }
.content:has(.db-page) { padding: 12px 20px 0; }
.db-hero { border-radius: 18px; padding: 18px 22px; color: #fff; display: flex; flex-direction: column; gap: 6px;
  background: radial-gradient(260px 260px at 8% -25%, rgba(56,189,248,.22), transparent 70%),
              radial-gradient(210px 210px at 62% 115%, rgba(45,212,191,.16), transparent 70%),
              linear-gradient(to bottom left, #12233A 0%, var(--primary) 55%, #274A7A 100%); }
.db-top { display: flex; gap: 18px; }
.db-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.db-org { color: #A9C1DE; font-size: 11px; }
.db-num { color: #fff; font-size: 14px; font-weight: 700; margin-top: 4px; align-self: flex-start; cursor: default; }
.db-chips { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.db-pill { display: inline-block; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); color: #DCE8F7; border-radius: 14px; padding: 3px 12px; font-size: 12px; white-space: pre; direction: rtl; }
.db-ringcol { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.db-status { display: inline-flex; align-items: center; gap: 5px; border-radius: 10px; padding: 1px 8px; font-size: 10px; border: 1px solid; }
.db-status i { width: 5px; height: 5px; border-radius: 3px; box-shadow: 0 0 0 1.5px var(--halo, transparent); }
.db-ring-n { fill: #fff; font-size: 18px; font-weight: 700; }
.db-ring-c { fill: #A9C1DE; font-size: 9px; }
.db-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.db-stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13); border-radius: 14px; padding: 9px 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.db-stat-c { color: #A9C1DE; font-size: 11px; }
.db-stat-v { display: flex; align-items: baseline; justify-content: center; gap: 5px; }
.db-stat-v b { font-size: 17px; }
.db-stat-v small { color: #A9C1DE; font-size: 10px; }
.db-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 4px; display: flex; justify-content: flex-start; }
.db-bar i { display: block; height: 100%; border-radius: 3px; width: 0; transition: width .3s; }
.db-tax { color: #A9C1DE; font-size: 10px; text-align: center; margin-top: 2px; }
.db-docs { background: #fff; border-radius: 16px; padding: 10px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.db-doc { min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 12px; padding: 6px 4px; font-size: 11px;
  background: #fff; border: 1.5px dashed #CBD8E8; color: #94A3B8; }
.db-doc:hover { border-color: #94A3B8; color: #64748B; }
.db-doc .db-doc-ic { display: flex; color: #94A3B8; }
.db-doc .db-doc-ic.add, .db-doc.empty-lbl .db-doc-ic:not(.add) { display: none; }
.db-doc.empty-lbl .db-doc-ic.add { display: flex; }
.db-doc.has { background: #F4F7FB; border: 1px solid #E3EAF3; color: var(--primary); font-weight: 700; }
.db-doc.has:hover { background: #EAF1FB; border-color: #B9CDE8; }
.db-doc.has .db-doc-ic { color: var(--primary); }
.db-doc.has .db-doc-ic.add { display: none !important; }
.db-doc.has .db-doc-ic:not(.add) { display: flex !important; }
.db-bands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.db-band { background: #fff; border: 1px solid #E3EAF3; border-radius: 16px; padding: 16px 14px 14px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; cursor: pointer; user-select: none; }
.db-band::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--acc); }
.db-band:hover { border-color: #B9CDE8; }
.db-band-top { display: flex; align-items: center; gap: 12px; }
.db-bring .pct { fill: #0F2340; font-size: 14px; font-weight: 700; }
.db-band.over .db-bring .pct { fill: #DC2626; }
.db-band-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.db-band-t { display: flex; align-items: center; gap: 6px; }
.db-band-t span { display: flex; }
.db-band-t b { font-size: 13px; color: #0F2340; }
.db-band-cap { font-size: 11px; color: #64748B; text-align: center; }
.db-band-total { font-size: 16px; font-weight: 700; color: var(--primary); text-align: center; }
.db-band-mini { display: flex; gap: 8px; }
.db-band-mini > div { flex: 1; border-radius: 10px; padding: 6px 10px 7px; display: flex; flex-direction: column; }
.db-band-mini span { font-size: 11px; }
.db-band-mini b { font-size: 13px; text-align: center; }
.db-band-mini .sp { background: #FEF2F2; color: #B91C1C; }
.db-band-mini .rm { background: #ECFDF5; color: #047857; }
.db-band-mini .rm b.neg { color: #DC2626; }
.db-band-tax { font-size: 10px; color: #94A3B8; text-align: center; }
.db-tip { position: fixed; z-index: 160; background: #1E1E1E; color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 4px; white-space: pre; pointer-events: none; }
.cn-lbl { font-size: 13px; font-weight: 700; color: #1E293B; margin-bottom: -6px; }
.cn-lbl small { font-weight: 400; color: #94A3B8; font-size: 11px; }
#cnModal, #dtModal, #dbCf { z-index: 140; }
.dt-dlg { width: 400px; background: #fff; border-radius: 12px; }
.dt-head { background: #1E3A5F; color: #fff; font-size: 14px; font-weight: 700; padding: 14px 20px; display: flex; gap: 8px; align-items: center; }
.dt-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dt-cal { position: static !important; width: 100% !important; box-shadow: none; }
.dt-sel { background: #EFF6FF; border-radius: 10px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; }
.dt-sel span { font-size: 12px; color: #64748B; } .dt-sel b { font-size: 15px; color: #1E3A5F; direction: ltr; }
.dt-btns { display: flex; gap: 10px; }
.dt-btns button { height: 32px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.dt-cancel { background: #fff; color: #334155; border: 1px solid #CBD5E1; padding: 0 20px; } .dt-cancel:hover { background: #F8FAFC; }
.dt-ok { background: #1E3A5F; color: #fff; border: none; padding: 0 28px; } .dt-ok:hover { background: #2D5382; }
.db-menu-item { }
@media (max-width: 900px) {
  .content:has(.db-page) { padding: 8px 10px 0; }
  .db-stats, .db-bands { grid-template-columns: 1fr; }
  .db-docs { grid-template-columns: repeat(3, 1fr); }
}
.sd-del { background: #fff; color: #DC2626; border: 1px solid #FCA5A5; } .sd-del:hover { background: #FEF2F2; }
/* تعاميد قطع الغيار */
.po-card { background: #fff; border: 1px solid #E3EAF3; border-radius: 16px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; user-select: none; }
.po-title { display: flex; align-items: center; gap: 6px; } .po-title span { display: flex; color: var(--primary); } .po-title b { font-size: 13px; color: #0F2340; }
.po-body { display: flex; gap: 14px; }
.po-right, .po-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.po-right { gap: 8px; } .po-left { gap: 4px; }
.po-bars { height: 118px; display: flex; align-items: stretch; border-bottom: 1px solid #EEF2F7; position: relative; }
.po-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; cursor: pointer; position: relative; padding-bottom: 20px; }
.po-col .v { font-size: 10px; color: #64748B; height: 16px; }
.po-col i { display: block; width: min(26px, 60%); border-radius: 4px 4px 0 0; background: #C7D7EA; min-height: 0; }
.po-col:hover i { background: #93B4DA; }
.po-col.sel i { background: var(--primary); }
.po-col.sel .v, .po-col.sel .l { color: var(--primary); font-weight: 700; }
.po-col .l { position: absolute; bottom: 2px; font-size: 10px; color: #64748B; white-space: nowrap; }
.po-boxes { display: flex; gap: 6px; }
.po-box { flex: 1; background: #F4F7FB; border-radius: 10px; padding: 6px 10px 7px; display: flex; flex-direction: column; }
.po-box span { font-size: 10px; color: #64748B; } .po-box b { font-size: 16px; color: var(--primary); }
.po-share { font-size: 10px; color: #64748B; min-height: 16px; }
.po-sbar { height: 10px; border-radius: 5px; background: #EEF2F7; overflow: hidden; display: flex; margin-bottom: 2px; }
.po-sbar i { display: block; height: 100%; }
.po-srow { display: flex; align-items: center; gap: 6px; padding: 1px 4px; font-size: 11px; }
.po-srow i { width: 9px; height: 9px; border-radius: 3px; } .po-srow span { flex: 1; color: #334155; } .po-srow b { color: #0F2340; }
.po-srow.zero span, .po-srow.zero b { color: #B8C2CF; }
.po-over-cap { font-size: 10px; color: #64748B; margin-top: 4px; }
.po-orow { display: flex; align-items: center; gap: 6px; background: #FEF2F2; border-radius: 9px; padding: 4px 8px; cursor: pointer; text-decoration: none; margin-bottom: 4px; }
.po-orow:hover { background: #FEE2E2; }
.po-orow b { font-size: 11px; color: #0F2340; } .po-orow span { flex: 1; font-size: 10px; color: #475569; } .po-orow em { font-style: normal; font-size: 11px; font-weight: 700; color: #DC2626; }
.po-ok { background: #F0FDF4; color: #15803D; border-radius: 9px; font-size: 11px; padding: 5px 8px; }
.po-all { color: var(--primary); font-size: 11px; font-weight: 700; align-self: flex-end; text-decoration: none; padding: 2px 4px; }
.po-all:hover { text-decoration: underline; }
/* الإجازات والاستئذان */
.lv-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.lv-top { display: flex; align-items: center; gap: 8px; }
.lv-top b { font-size: 16px; color: var(--primary); flex: 1; }
.lv-chip { font-size: 11px; font-weight: 700; border-radius: 10px; padding: 3px 12px; }
.lv-body { display: flex; gap: 24px; }
.lv-rc { flex: 10; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lv-lc { flex: 11; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lv-cap { font-size: 11px; color: #64748B; }
.lv-week { height: 130px; display: flex; border-bottom: 1px solid #E2E8F0; }
.lv-day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; cursor: pointer; position: relative; padding-bottom: 20px; }
.lv-day .c { font-size: 11px; font-weight: 700; color: #334155; height: 16px; }
.lv-day i { width: min(34px, 55%); border-radius: 3px; background: #E2E8F0; }
.lv-day.has i { background: #94A3B8; }
.lv-day.sel i { background: var(--primary); }
.lv-day.sel .c, .lv-day.sel .l { color: #1D4ED8; }
.lv-day .l { position: absolute; bottom: 2px; font-size: 11px; color: #64748B; white-space: nowrap; }
.lv-day.today .l { color: #334155; font-weight: 700; } .lv-day.sel .l { font-weight: 700; }
.lv-tiles { display: flex; gap: 8px; }
.lv-tile { flex: 1; height: 64px; background: #F1F5F9; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; text-decoration: none; }
.lv-tile span { font-size: 11px; color: #64748B; } .lv-tile b { font-size: 22px; }
a.lv-tile:hover { background: #E0ECFA; }
.lv-stack { height: 10px; border-radius: 5px; overflow: hidden; display: flex; background: #E2E8F0; }
.lv-stack i { display: block; height: 100%; }
.lv-lg { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 8px; cursor: pointer; }
.lv-lg:hover { background: #F1F5F9; } .lv-lg.on { background: #E0ECFA; } .lv-lg.dis { cursor: default; } .lv-lg.dis:hover { background: transparent; }
.lv-lg i { width: 9px; height: 9px; border-radius: 2px; } .lv-lg span { flex: 1; font-size: 12px; color: #334155; } .lv-lg b { font-size: 12px; color: #1E293B; }
.lv-row { display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 5px 10px; background: #F8FAFC; text-decoration: none; }
a.lv-row:hover { background: #EFF6FF; }
.lv-row b { font-size: 12px; color: #1E293B; } .lv-row em { font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: #5B21B6; border-radius: 7px; padding: 1px 7px; }
.lv-row span { flex: 1; text-align: left; font-size: 11px; }
.lv-bot { display: flex; align-items: center; } .lv-bot span { flex: 1; font-size: 11px; color: #64748B; }
.lv-bot a { color: var(--primary); font-size: 13px; font-weight: 700; text-decoration: none; } .lv-bot a:hover { text-decoration: underline; }
@media (max-width: 900px) { .po-body, .lv-body { flex-direction: column; } }

/* ═════════════ نافذة متابعة تعاميد قطع الغيار (SparePOMonitorWindow) ═════════════ */
.pmon-page { --bg:#EFF3F8; --pn:#FFFFFF; --bd:#E2E8F0; --tx:#0F2340; --tx2:#334155; --mu:#64748B; --dim:#B8C2CF; --sf:#F4F7FB; --trk:#EEF2F7;
  --row:#FFFFFF; --rowh:#F8FAFC; --warn:#B45309; --flash:#FDE68A; --acc: var(--primary); --dgbg:#FEF2F2; --dgbd:#FECACA; --dgcap:#B91C1C; --dgval:#DC2626;
  --wbg:#FFFBEB; --wbd:#FDE68A; --wtx:#B45309; --wic:#FEF3C7; --icbg:#EEF3F9;
  background: var(--bg); font-family: "Cairo", var(--ui-font); height: 100vh; overflow: hidden; }
.pmon-page.dark { --bg:#0B1220; --pn:#111A2E; --bd:#1F2A44; --tx:#E2E8F0; --tx2:#CBD5E1; --mu:#94A3B8; --dim:#475569; --sf:#16213A; --trk:#1A2642;
  --row:#121C31; --rowh:#17233D; --warn:#FCD34D; --flash:#854D0E; --acc:#60A5FA; --dgbg:#2A1218; --dgbd:#5B1A22; --dgcap:#FCA5A5; --dgval:#F87171;
  --wbg:#2A2410; --wbd:#4A3B12; --wtx:#FCD34D; --wic:#3A300B; --icbg:#16244A; }
.pmon { height: 100vh; display: flex; flex-direction: column; }
.pm-topbar { background: var(--primary); display: flex; align-items: center; gap: 12px; padding: 9px 16px; color: #fff; }
.pm-logo { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; color: #fff; }
.pm-ttl { display: flex; flex-direction: column; } .pm-ttl b { font-size: 18px; } .pm-ttl span { font-size: 11px; color: rgba(255,255,255,.72); }
.pm-conn { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.pm-conn i { width: 8px; height: 8px; border-radius: 4px; background: #34D399; }
.pm-conn.off i { background: #F87171; animation: pmblink 1s infinite; }
@keyframes pmblink { 50% { opacity: .2; } }
.pm-sep { width: 1px; height: 34px; background: rgba(255,255,255,.2); }
.pm-clock { display: flex; flex-direction: column; align-items: center; padding: 0 6px; }
.pm-clock b { font-size: 22px; font-family: Consolas, "Courier New", monospace; direction: ltr; } .pm-clock span { font-size: 11px; color: rgba(255,255,255,.78); }
.pm-cd text { fill: #fff; font-size: 10px; font-weight: 700; }
.pm-btn { height: 30px; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; font-size: 11px; font-weight: 700; padding: 0 12px; }
.pm-btn:hover { background: rgba(255,255,255,.18); } .pm-btn.on { background: #fff; color: var(--primary); border-color: #fff; }
.pm-banner { background: #DC2626; color: #fff; font-size: 13px; padding: 7px 18px; }
.pm-main { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 14px; }
.pm-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pm-kpi { flex: 1; display: flex; gap: 11px; background: var(--pn); border: 1px solid var(--bd); border-radius: 14px; padding: 10px 14px 10px 1px; min-height: 0; }
.pm-kpi .acc { width: 3px; border-radius: 1px; background: var(--acc); }
.pm-kpi .in { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.pm-kpi .hd { display: flex; align-items: center; gap: 8px; }
.pm-kpi .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--icbg); color: var(--acc); display: flex; align-items: center; justify-content: center; }
.pm-kpi .cap { font-size: 12px; color: var(--mu); }
.pm-kpi b { font-size: 28px; color: var(--tx); text-align: center; }
.pm-kpi .sub { font-size: 11px; color: var(--mu); text-align: left; min-height: 15px; }
.pm-kpi.k-exp { background: var(--wbg); border-color: var(--wbd); cursor: pointer; }
.pm-kpi.k-exp .acc { background: #F59E0B; } .pm-kpi.k-exp .ic { background: var(--wic); color: var(--wtx); }
.pm-kpi.k-exp .cap, .pm-kpi.k-exp b, .pm-kpi.k-exp .sub { color: var(--wtx); }
.pm-kpi.k-exp.on { border: 2px solid #F59E0B; }
.pm-kpi.k-over { background: var(--dgbg); border-color: var(--dgbd); cursor: pointer; }
.pm-kpi.k-over .acc { background: #DC2626; } .pm-kpi.k-over .ic { background: var(--dgbd); color: var(--dgval); }
.pm-kpi.k-over .cap, .pm-kpi.k-over .sub { color: var(--dgcap); } .pm-kpi.k-over b { color: var(--dgval); }
.pm-kpi.k-over.on { border: 2px solid #DC2626; }
.pm-panel { background: var(--pn); border: 1px solid var(--bd); border-radius: 14px; padding: 12px 14px; }
.pm-st-hd { display: flex; align-items: center; } .pm-st-hd b { flex: 1; font-size: 12px; color: var(--tx2); } .pm-st-hd span { font-size: 11px; color: var(--mu); }
.pm-cols { height: 190px; display: flex; gap: 6px; padding-top: 6px; }
.pm-colw { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; cursor: pointer; border-radius: 8px; padding: 4px 0; }
.pm-colw:hover { background: var(--sf); } .pm-colw.sel { background: var(--sf); box-shadow: inset 0 0 0 1.5px var(--bd); }
.pm-colw .n { font-size: 14px; font-weight: 700; color: var(--tx); } .pm-colw.zero .n, .pm-colw.zero .l { color: var(--dim); }
.pm-colw i { width: 60%; max-width: 34px; border-radius: 5px 5px 0 0; min-height: 2px; }
.pm-colw .l { font-size: 10px; color: var(--mu); margin-top: 4px; text-align: center; line-height: 1.2; height: 26px; }
.pm-tbl { flex: 3; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pm-tbl-hd { display: flex; align-items: center; gap: 8px; } .pm-tbl-hd .ic { color: var(--acc); display: flex; } .pm-tbl-hd b { font-size: 14px; color: var(--tx); }
.pm-cnt { min-width: 26px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; font-size: 11px; font-weight: 700; background: var(--acc); color: #fff; padding: 0 8px; }
.pm-fbtn { height: 26px; border: none; border-radius: 13px; color: #fff; font-size: 11px; font-weight: 700; padding: 0 12px; margin-right: 8px; }
.pm-hdr { display: flex; gap: 10px; padding: 8px 11px; background: var(--sf); border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--mu); text-align: center; }
.pm-hdr span { min-width: 0; }
.pm-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.pm-sec { display: flex; align-items: center; gap: 8px; padding: 8px 2px 2px; }
.pm-sec i { width: 4px; height: 16px; border-radius: 2px; } .pm-sec b { font-size: 13px; color: var(--tx); }
.pm-sec em { font-style: normal; min-width: 26px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; font-size: 11px; font-weight: 700; color: #fff; padding: 0 8px; }
.pm-sec hr { flex: 1; border: none; height: 1px; background: var(--bd); margin: 0; }
.pm-row { display: flex; gap: 10px; align-items: center; background: var(--row); border: 1px solid var(--bd); border-radius: 10px; padding: 6px 10px; margin-top: 6px; transition: background .2s; }
.pm-row:hover { background: var(--rowh); } .pm-row.flash { background: var(--flash); }
.pm-row > div { min-width: 0; text-align: center; font-size: 14px; color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-ref b { font-size: 14px; color: var(--tx); } .pm-ref small { display: block; font-size: 11px; color: var(--mu); } .pm-ref .wo { font-size: 10px; font-weight: 400; color: var(--mu); }
.pm-row > div:first-child { overflow: visible; }
.pm-badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; border-radius: 11px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.pm-badge::before { content: "●"; font-size: 8px; }
.pm-due span { display: block; } .pm-due .bar { width: 110px; height: 5px; margin: 4px auto 0; border-radius: 3px; background: var(--trk); overflow: hidden; }
.pm-due .bar i { display: block; height: 100%; border-radius: 3px; }
.pm-reason.none { font-weight: 700; color: var(--warn); } .pm-reason.dash { color: var(--mu); }
.pm-empty { background: var(--sf); color: var(--mu); border-radius: 9px; font-size: 14px; padding: 10px 12px; margin-top: 6px; }
.pm-feed { height: 40px; flex: 0 0 40px; background: var(--pn); border-top: 1px solid var(--bd); display: flex; align-items: center; gap: 10px; padding: 0 16px; overflow: hidden; }
.pm-feed .ic { color: var(--acc); display: flex; } .pm-feed > b { font-size: 12px; color: var(--tx); white-space: nowrap; }
.pm-fsep { width: 1px; height: 16px; background: var(--bd); }
.pm-fbox { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; overflow: hidden; white-space: nowrap; }
.pm-ev { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pm-ev + .pm-ev::before { content: ""; width: 1px; height: 16px; background: var(--bd); margin-left: 2px; }
.pm-ev .eic { width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.pm-ev time { font-size: 11px; color: var(--mu); } .pm-ev span { font-size: 12px; color: var(--tx); }
.pm-none { font-size: 12px; font-style: italic; color: var(--dim); }
@media (max-width: 900px) { .pm-main { flex-direction: column; overflow-y: auto; } .pm-side { flex: none; } .pm-kpi { min-height: 90px; } .pm-tbl { min-height: 500px; } .pm-clock, .pm-sep, .pm-cd { display: none; } }

/* ═════════════ صيانة PPM (ppm_page.py) ═════════════ */
.content:has(.pp-page) { overflow: hidden; }
.pp-page { height: 100%; display: flex; flex-direction: column; background: #fff; }
.pp-toolbar { height: 58px; flex: 0 0 58px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: #fff; border-bottom: 1px solid #E2E8F0; }
.pp-title { font-size: 15px; color: #1E3A5F; }
.pp-lbl { font-size: 12px; color: #475569; white-space: nowrap; }
.pp-month { height: 34px; min-width: 130px; background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 8px; font-size: 12px; color: #0F172A; font-family: inherit; outline: none; }
.pp-left { font-size: 12px; color: #475569; } .pp-left b { color: #B91C1C; }
.pp-search { height: 34px; width: 260px; max-width: 40vw; background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 10px; font-size: 12px; outline: none; font-family: inherit; }
.pp-search:focus { border-color: #3B82F6; background: #fff; }
.pp-groups { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; background: #F8FAFC; }
.pp-chips { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.pp-chips button { height: 28px; flex: 0 0 auto; background: #fff; color: #334155; border: 1px solid #CBD5E1; border-radius: 14px; font-size: 11px; font-weight: 700; padding: 0 12px; white-space: pre; }
.pp-chips button:hover { border-color: #94A3B8; }
.pp-chips button.zero { color: #94A3B8; border-color: #E2E8F0; }
.pp-chips button.on { background: #1E3A5F; color: #fff; border-color: #1E3A5F; }
.pp-cards { display: flex; gap: 10px; padding: 10px 16px 8px; background: #F8FAFC; }
.pp-card { flex: 1; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; }
.pp-card.gray { background: #F8FAFC; }
.pp-card span { font-size: 11px; color: #64748B; } .pp-card b { font-size: 20px; }
.pp-tabs { display: flex; gap: 4px; padding: 0 16px; background: #F8FAFC; border-bottom: 1px solid #E2E8F0; }
.pp-tabs button { height: 38px; background: transparent; border: none; border-bottom: 3px solid transparent; color: #64748B; font-size: 12px; font-weight: 700; padding: 0 16px; white-space: pre; }
.pp-tabs button:hover:not(.on) { color: #334155; }
.pp-tabs button.on { color: #1E3A5F; border-bottom-color: #1E3A5F; }
.pp-banner-w { padding: 8px 16px 0; }
.pp-banner { background: #EFF6FF; border: 1px solid #93C5FD; border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.pp-banner span { flex: 1; font-size: 12px; color: #1E3A5F; }
.pp-banner button { height: 30px; }
.pp-plain { height: 30px; background: #fff; color: #334155; border: 1px solid #CBD5E1; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 0 8px; white-space: nowrap; }
.pp-plain:hover { background: #F1F5F9; }
.pp-code { height: 28px; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 0 8px; border: 1px solid; white-space: nowrap; }
.pp-code.big { padding: 0 10px; }
.pp-code:disabled { background: #F1F5F9 !important; color: #94A3B8 !important; border-color: #E2E8F0 !important; cursor: default; }
.pp-tbl-w { flex: 1; min-height: 0; padding: 8px 16px 0; display: flex; flex-direction: column; }
.pp-scroll { flex: 1; min-height: 0; overflow: auto; }
.pp-tbl { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.pp-tbl th { position: sticky; top: 0; z-index: 1; background: #1E3A5F; color: #fff; font-weight: 700; padding: 6px 8px; border-bottom: 2px solid #2D5382; white-space: nowrap; cursor: pointer; user-select: none; }
.pp-tbl th.ns { cursor: default; }
.pp-tbl th .ar { font-size: 9px; margin-right: 4px; }
.pp-tbl td { height: 44px; padding: 3px 6px; text-align: center; border-bottom: 1px solid #F1F5F9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #0F172A; }
.pp-tbl tbody tr:nth-child(even) td { background: #F8FAFC; }
.pp-tbl tbody tr.jd td { background: #ECFDF5; }
.pp-tbl tbody tr.sel td { background: rgba(37,99,235,.12); }
.pp-tbl td.nm { font-weight: 700; unicode-bidi: plaintext; }
.pp-tbl td.num { background: #1E3A5F !important; color: #fff; font-weight: 700; padding: 0 4px; }
.pp-tbl td.num label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.pp-tbl th.num input, .pp-tbl td.num input { accent-color: #60A5FA; margin: 0; cursor: pointer; }
.pp-tbl td.act { overflow: visible; }
.pp-acts { display: flex; align-items: center; gap: 5px; justify-content: flex-start; }
.pp-ok { color: #15803D; font-size: 11px; font-weight: 700; flex: 1; text-align: right; }
.pp-empty { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #94A3B8; padding: 30px; }
.pp-bulk { height: 48px; flex: 0 0 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #EFF6FF; border-top: 1px solid #BFDBFE; }
.pp-bulk b { font-size: 12px; color: #1E3A5F; }
.pp-menu { position: fixed; z-index: 150; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; padding: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 70vh; overflow-y: auto; min-width: 200px; }
.pp-menu .sec { font-size: 10px; font-weight: 700; color: #94A3B8; padding: 4px 12px 2px; }
.pp-menu .sep { height: 1px; background: #E2E8F0; margin: 4px 6px; }
.pp-menu .it { height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 10px; border-radius: 6px; cursor: pointer; }
.pp-menu .it:hover { background: #F1F5F9; }
.pp-menu .it i { font-style: normal; width: 64px; height: 22px; line-height: 20px; text-align: center; border: 1px solid; border-radius: 5px; font-size: 11px; font-weight: 700; }
.pp-menu .it span { font-size: 12px; color: #0F172A; }
@media (max-width: 900px) {
  .pp-toolbar { flex-wrap: wrap; height: auto; padding: 8px; } .pp-search { width: 100%; max-width: none; }
  .pp-cards { flex-wrap: wrap; } .pp-card { flex: 1 1 30%; }
  .pp-tbl { table-layout: auto; }
}

/* ═════════════ البيانات التشغيلية (operational_data_page.py) ═════════════ */
.content:has(.op-page) { overflow: hidden; }
.op-page { height: 100%; background: #F1F5F9; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.op-bar { display: flex; align-items: center; gap: 8px; }
.op-tabs { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 6px; display: flex; gap: 4px; }
.op-tabs button { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: #64748B; border: 1px solid #E2E8F0; border-radius: 8px; padding: 8px 20px; font-size: 13px; font-weight: 700; white-space: pre; }
.op-tabs button span { display: flex; color: #334155; }
.op-tabs button:hover:not(.on) { background: #F1F5F9; color: #1E293B; border-color: #CBD5E1; }
.op-tabs button.on { background: #1E3A5F; color: #fff; border-color: #1E3A5F; }
.op-tabs button.on span { color: #fff; }
.op-ibtn { width: 37px; height: 37px; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0; }
.op-ibtn:hover { background: #F1F5F9; border-color: #CBD5E1; }
.op-stack { flex: 1; min-height: 0; background: #fff; border: 0.5px solid #E2E8F0; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.op-card-row { display: flex; justify-content: center; }
.op-card-row .db-band { width: 500px; max-width: 100%; cursor: default; }
.op-card-row .db-band.spare { width: 550px; }
.op-sp-cols { display: flex; gap: 8px; }
.op-sp-cols > div { flex: 1; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.op-sp-cols h5 { margin: 0; font-size: 11px; } .op-sp-cols b { font-size: 13px; } .op-sp-cols b.big { font-size: 15px; } .op-sp-cols small { font-size: 9px; color: #64748B; margin-top: -4px; }
.op-sp-cols hr { width: 100%; border: none; height: 1px; background: rgba(15,35,64,.10); margin: 0; }
.op-tbl-w { flex: 1; min-height: 0; overflow: auto; border: 1px solid #E2E8F0; }
.op-tbl { border-collapse: collapse; font-size: 12px; font-weight: 700; min-width: 100%; }
.op-tbl th { position: sticky; top: 0; z-index: 2; height: 40px; background: #1E3A5F; color: #fff; font-size: 12px; padding: 8px 6px; border-left: 1px solid #2D5382; white-space: nowrap; cursor: pointer; user-select: none; }
.op-tbl th:hover { background: #2D5382; }
.op-tbl th.rn { width: 30px; min-width: 30px; position: sticky; right: 0; z-index: 3; }
.op-tbl td { height: 30px; border: 1px solid #E2E8F0; padding: 4px 8px; text-align: center; color: #1E293B; white-space: nowrap; background: #fff; cursor: cell; }
.op-tbl tr:nth-child(even) td { background: #F8FAFC; }
.op-tbl td.rn { position: sticky; right: 0; z-index: 1; background: #1E3A5F !important; color: #fff; font-size: 8pt; width: 30px; min-width: 30px; padding: 0; cursor: pointer; border-color: #2D5382; }
.op-tbl td.rn:hover { background: #2D5382 !important; }
.op-tbl td.calc { background: #F8FAFC !important; color: #374151; cursor: default; }
.op-tbl td.sel { background: rgba(37,99,235,.35) !important; }
.op-tbl td.rn.sel { background: #2563EB !important; }
.op-tbl td.txt { text-align: right; unicode-bidi: plaintext; }
.op-tbl td input, .op-tbl td select { width: 100%; height: 22px; border: 1px solid #CBD5E1; border-radius: 3px; padding: 2px 6px; font: inherit; color: #1E293B; text-align: center; outline: none; background: #fff; }
.op-tbl td select { border: 2px solid #3B82F6; border-radius: 4px; padding: 0 4px; }
.op-tbl td.tx select { border: none; background: transparent; cursor: pointer; text-align: center; text-align-last: center; }
.op-total { height: 36px; flex: 0 0 36px; background: #1E3A5F; color: #fff; font-size: 15px; font-weight: 700; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 900px) { .op-page { padding: 6px; } .op-tabs button { padding: 6px 10px; font-size: 12px; } .op-sp-cols { flex-direction: column; } }

/* ═════════════ مستخلص مقاولي الباطن ═════════════ */
.content:has(.sc-page) { overflow: hidden; }
.sc-page { height: 100%; display: flex; flex-direction: column; background: #fff; }
.sc-tabbar { padding: 8px 18px; background: #F1F5F9; display: flex; }
.sc-pane:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sc-tb { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #fff; border-bottom: 1.5px solid #E2E8F0; flex-wrap: wrap; }
.sc-search { width: 450px; max-width: 100%; height: 34px; background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 14px; font-size: 13px; outline: none; font-family: inherit; }
.sc-search:focus, .sc-months:focus { border-color: #3B82F6; background: #EFF6FF; }
.sc-months { width: 100px; height: 34px; background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 12px; font-size: 13px; outline: none; font-family: inherit; direction: ltr; text-align: right; }
.sc-year { width: 150px; height: 34px; background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 10px; font-size: 13px; font-family: inherit; outline: none; }
.sc-count { font-size: 12px; font-weight: 700; color: #475569; }
.sc-clrf { width: 25px; height: 25px; background: #FEE2E2; border: 1.5px solid #FECACA; border-radius: 8px; padding: 0; display: flex; align-items: center; justify-content: center; }
.sc-pill { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; background: rgba(30,58,95,.12); color: var(--primary); border: none; border-radius: 16px; font-size: 11px; font-weight: 700; padding: 0 18px; cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,.08); white-space: pre; }
.sc-pill:hover { background: rgba(30,58,95,.22); }
.sc-pill input { accent-color: var(--primary); margin: 0; }
.sc-cards { display: flex; justify-content: center; gap: 38px; padding: 8px 0; flex-wrap: wrap; }
.sc-card { width: 265px; height: 88px; border-radius: 14px; padding: 12px 18px; display: flex; align-items: center; gap: 14px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 6px 16px rgba(0,0,0,.10); }
.sc-card i { font-style: normal; font-size: 26px; width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.sc-card span { display: block; font-size: 12px; opacity: .9; } .sc-card b { font-size: 22px; }
.sc-tw { flex: 1; min-height: 0; overflow: auto; }
.sc-tbl { border-collapse: collapse; font-size: 12px; font-weight: 700; min-width: 100%; }
.sc-tbl th { position: sticky; top: 0; z-index: 2; background: #1E3A5F; color: #fff; padding: 6px 8px; border-right: 1px solid #2D5382; white-space: nowrap; }
.sc-tbl th.rn { width: 34px; }
.sc-tbl tr.flt th { top: 30px; background: #F1F5F9; padding: 2px 4px; }
.sc-tbl tr.flt input { width: 100%; min-width: 50px; height: 22px; border: 1px solid #CBD5E1; border-radius: 4px; padding: 0 4px; font: inherit; font-size: 11px; font-weight: 400; outline: none; }
.sc-tbl td { height: 28px; padding: 3px 8px; text-align: center; border: 1px solid #F1F5F9; white-space: nowrap; color: #0F172A; background: #fff; }
.sc-tbl tbody tr:nth-child(even) td { background: #F8FAFC; }
.sc-tbl td.rn { background: #1E3A5F !important; color: #fff; font-size: 8pt; cursor: pointer; padding: 0 4px; }
.sc-tbl td.sel { box-shadow: inset 0 0 0 999px rgba(37,99,235,.35); }
.sc-tbl td.ppm, .sc-tbl td.nt { cursor: pointer; }
.sc-tbl td.ppm.done { color: #000; }
.sc-tbl td input.ed { width: 100%; height: 22px; border: 1px solid #3B82F6; border-radius: 3px; padding: 0 4px; font: inherit; outline: none; }
.sc-dr-win { width: 820px; height: 500px; max-height: 90vh; display: flex; flex-direction: column; background: #fff; }
.sc-dr-head { height: 64px; flex: 0 0 64px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; padding: 0 20px; }
.sc-dr-body { flex: 1; overflow: auto; }
.sc-dr-tbl { width: 100%; border-collapse: collapse; font-size: 12px; font-weight: 700; }
.sc-dr-tbl th { position: sticky; top: 0; background: #F1F5F9; color: #475569; padding: 8px; border-bottom: 1px solid #E2E8F0; }
.sc-dr-tbl td { height: 47px; text-align: center; border-bottom: 1px solid #F1F5F9; color: #1E293B; }
.sc-dr-acts { display: inline-flex; gap: 6px; }
.sc-dr-acts button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #E2E8F0; background: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.sc-dr-acts button:hover { background: #F1F5F9; }
.sc-sv-win { width: 1200px; height: 88vh; display: flex; flex-direction: column; background: #fff; }
#scCf, #scMenu { z-index: 150; }
@media print { body.sc-print * { visibility: hidden; } body.sc-print #scSv, body.sc-print #scSv * { visibility: visible; } body.sc-print #scSv { position: absolute; inset: 0; background: #fff; } body.sc-print .sc-tb, body.sc-print .win-bar button { display: none; } body.sc-print .sc-sv-win { width: 100%; height: auto; } body.sc-print .sc-tw { overflow: visible; } }
@media (max-width: 900px) { .sc-search { width: 100%; } .sc-cards { gap: 10px; } .sc-card { width: 45%; } }

/* ═════════════ البحث المتقدم (advanced_search2.py) ═════════════ */
.content:has(.s2-page) { overflow: hidden; }
.s2-page { height: 100%; display: flex; flex-direction: column; background: #fff; }
.s2-bar { height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1.5px solid #E2E8F0; }
.s2-search { width: 450px; max-width: 60vw; height: 36px; background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none; font-family: inherit; }
.s2-search:focus { border-color: #3B82F6; background: #EFF6FF; }
.s2-count { font-size: 12px; font-weight: 700; color: #475569; }
.s2-body { flex: 1; min-height: 0; display: flex; }
.s2-filters { width: 248px; flex: 0 0 248px; overflow-y: auto; background: #F8FAFC; border-left: 1px solid #E2E8F0; padding: 12px 8px; }
.s2-filters.off { display: none; }
.s2-fclr { display: flex; justify-content: flex-end; min-height: 4px; }
.s2-fclr button { width: 28px; height: 28px; background: #FEE2E2; border: 1.5px solid #FECACA; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0; }
.s2-sec { background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; margin-top: 16px; padding: 0 0 6px; overflow: hidden; }
.s2-sec > button { width: 100%; background: #1E3A5F; color: #fff; border: none; font-size: 12px; font-weight: 700; text-align: right; padding: 6px 10px; }
.s2-sec > button:hover { background: #2D5382; }
.s2-sec .its { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 0; }
.s2-sec .its button { background: transparent; color: #334155; border: none; border-radius: 6px; font-size: 12px; text-align: right; padding: 4px 8px; white-space: pre; }
.s2-sec .its button:hover { background: #F1F5F9; }
.s2-sec .its button.on { background: #EFF6FF; color: #1D4ED8; font-weight: 700; }
.s2-tog { width: 16px; flex: 0 0 16px; background: #1E3A5F; color: #fff; border: none; font-size: 12px; font-weight: 700; padding: 0; }
.s2-tog:hover { background: #2D5382; }
.s2-tw { flex: 1; min-width: 0; overflow: auto; }
.s2-tbl { border-collapse: collapse; font-size: 12px; font-weight: 700; min-width: 100%; }
.s2-tbl th { position: sticky; top: 0; z-index: 2; background: #1E3A5F; color: #fff; padding: 6px 8px; border-right: 1px solid #2D5382; white-space: nowrap; }
.s2-tbl td { height: 28px; padding: 3px 8px; text-align: center; border: 1px solid #F1F5F9; white-space: nowrap; }
.s2-tbl td.rn { background: #1E3A5F !important; color: #fff; font-size: 8pt; cursor: pointer; position: sticky; right: 0; z-index: 1; }
.s2-tbl th.rn { position: sticky; right: 0; z-index: 3; width: 34px; }
.s2-tbl td.sel { box-shadow: inset 0 0 0 999px rgba(37,99,235,.25); }
.s2-tbl td input, .s2-tbl td select { width: 100%; min-width: 80px; height: 22px; border: 1px solid #3B82F6; border-radius: 3px; padding: 0 4px; font: inherit; outline: none; }
.s2-bottom { height: 54px; flex: 0 0 54px; display: flex; align-items: center; padding: 4px 10px; border-top: 1px solid #E2E8F0; }
.s2-bottom .eq-edit:disabled { opacity: .4; cursor: default; }
@media (max-width: 900px) { .s2-filters { position: absolute; z-index: 20; height: calc(100% - 110px); box-shadow: 0 6px 18px rgba(0,0,0,.15); } .s2-body { position: relative; } }
.cal-grid .dis { color: #CBD5E1 !important; cursor: default; background: transparent !important; }

/* ═════════════ تعاميد قطع الغيار (spare_parts_po_page.py) ═════════════ */
.content:has(.spo-page) { overflow: hidden; }
.spo-page { height: 100%; display: flex; flex-direction: column; gap: 3px; padding: 3px 0 0; overflow: auto; }
.spo-page [hidden] { display: none !important; }
.spo-flt { background: #fff; border: 0.5px solid #E2E8F0; border-radius: 10px; padding: 7px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; flex-shrink: 0; }
.spo-g { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.spo-l { font-size: 11px; color: #64748B; }
.spo-vs { width: 1px; height: 20px; background: #E2E8F0; }
.spo-seg { background: #F1F5F9; border-radius: 8px; padding: 3px; display: flex; gap: 2px; }
.spo-seg button { background: transparent; color: #64748B; border: none; border-radius: 6px; font-size: 11px; padding: 3px 12px; }
.spo-seg button:hover { color: #1E3A5F; }
.spo-seg button.on { background: #1E3A5F; color: #fff; font-weight: 700; }
.spo-dup { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 3px 12px; }
.spo-dup.on { background: #B91C1C; color: #fff; border-color: #B91C1C; }
.spo-cmb { height: 26px; min-width: 78px; background: #F8FAFC; border: 0.5px solid #E2E8F0; border-radius: 7px; padding: 0 8px; font-size: 11px; color: #1E3A5F; font-weight: 700; font-family: inherit; }
.spo-cmb:hover { border-color: #CBD5E1; }
#spoMonths { display: flex; flex-wrap: wrap; gap: 5px; }
#spoMonths button { height: 26px; background: #F8FAFC; border: 0.5px solid #E2E8F0; border-radius: 7px; padding: 0 8px; font-size: 11px; color: #475569; white-space: nowrap; }
#spoMonths button.all { border-radius: 6px; padding: 0 12px; }
#spoMonths button i { font-style: normal; font-size: 10px; color: #94A3B8; }
#spoMonths button.empty { background: #fff; color: #CBD5E1; border-color: #F1F5F9; }
#spoMonths button.empty i { color: #E2E8F0; }
#spoMonths button.on { background: #1E3A5F; color: #fff; border-color: #1E3A5F; font-weight: 700; }
#spoMonths button.on i { color: #BFDBFE; }
#spoMonths button:hover { border-color: #1E3A5F; }
.spo-clr, .spo-clrf { width: 26px; height: 26px; background: #FEE2E2; border: 1.5px solid #FECACA; border-radius: 10px; padding: 0; display: flex; align-items: center; justify-content: center; }
.spo-clr:hover, .spo-clrf:hover { background: #FECACA; border-color: #FCA5A5; }
.spo-clrf { width: 30px; height: 30px; }
.spo-sum { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; flex-shrink: 0; }
.spo-sumbar { background: #fff; border: 0.5px solid #E2E8F0; border-radius: 10px; padding: 4px 8px 4px 14px; display: flex; align-items: center; gap: 10px; min-height: 34px; }
.spo-sumbar b { font-size: 12px; color: #1E293B; }
.spo-compact { font-size: 11px; color: #64748B; white-space: nowrap; overflow: hidden; }
.spo-tog { width: 28px; height: 24px; background: #F8FAFC; border: 0.5px solid #E2E8F0; border-radius: 6px; padding: 0; display: flex; align-items: center; justify-content: center; }
.spo-tog:hover { background: #EEF2F7; border-color: #CBD5E1; }
.spo-sumbody { display: flex; flex-direction: column; gap: 10px; }
.spo-r1 { display: flex; gap: 10px; }
.spo-total { flex: 2; min-width: 0; background: #1E3A5F; border: 2px solid #1E3A5F; border-radius: 14px; padding: 10px 14px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.spo-total.on { border-color: #93C5FD; }
.spo-total .h { display: flex; align-items: center; gap: 8px; }
.spo-total .ic { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; }
.spo-total .h b { font-size: 12px; color: #E2E8F0; }
.spo-total .cnt { font-size: 10px; color: #94A3B8; }
.spo-total .tr { font-size: 10px; font-weight: 700; }
.spo-total .vr { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.spo-total .vr b { font-size: 20px; color: #fff; }
.spo-total .vr > span { font-size: 11px; color: #CBD5E1; }
.spo-total .vr .det { font-size: 10px; color: #94A3B8; }
.spo-total .sp, .spo-card .sp { line-height: 0; }
.spk { width: 100%; display: block; }
.spo-dist { flex: 5; min-width: 0; background: #F9FAFB; border: 1px solid #E2E8F0; border-radius: 14px; padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.spo-dh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spo-dh b { font-size: 12px; color: #1E293B; flex: 1; }
.spo-dh span { font-size: 10px; color: #94A3B8; }
.spo-bar { height: 8px; display: flex; gap: 3px; }
.spo-bar span { border-radius: 4px; min-width: 2px; }
.spo-lg { display: flex; }
.spo-lg > div { flex: 1; display: flex; flex-direction: column; align-items: center; border-left: 1px solid #E2E8F0; }
.spo-lg > div:last-child { border-left: none; }
.spo-lg span { font-size: 11px; color: #475569; white-space: nowrap; }
.spo-lg i { font-style: normal; }
.spo-lg b { font-size: 14px; color: #1E293B; }
.spo-r2 { display: flex; gap: 10px; }
.spo-card { flex: 1; min-width: 0; background: #F9FAFB; border: 1px solid #E2E8F0; border-radius: 14px; padding: 12px 14px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.spo-card.cx { background: #F1F5F9; }
.spo-card.on { border: 2px solid var(--c); padding: 11px 13px 7px; }
.spo-card .h { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.spo-card .ic { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.spo-card .h b { font-size: 12px; color: #1E293B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spo-card.cx .h b { color: #475569; }
.spo-card .cr { display: flex; align-items: baseline; gap: 4px; }
.spo-card .cr .v { font-size: 14px; }
.spo-card.cx .cr .v { color: #64748B; }
.spo-card .cr span { font-size: 10px; color: #94A3B8; }
.spo-card .cr .tr { font-weight: 700; }
.spo-card .sub { font-size: 10px; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spo-card.cx .sub { color: #94A3B8; }
.spo-tb { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 2px 0; }
.spo-modebox { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 3px; display: flex; gap: 2px; }
.spo-modebox button { height: 26px; background: transparent; border: none; border-radius: 8px; padding: 0 14px; font-size: 12px; font-weight: 700; color: #64748B; white-space: nowrap; }
.spo-modebox button:hover:not(.on) { background: #F1F5F9; }
.spo-modebox button.on { background: #1E3A5F; color: #fff; }
.spo-dsearch { flex: 1; height: 30px; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 0 10px; font-size: 12px; outline: none; font-family: inherit; }
.spo-dsearch:focus { border-color: #93C5FD; }
.spo-ib { width: 30px; height: 30px; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.spo-ib:hover { background: #F1F5F9; border-color: #CBD5E1; }
.spo-ib.spo-del:hover { background: #FEE2E2; border-color: #FCA5A5; }
.spo-ib.spo-clrf { background: #FEE2E2; border: 1.5px solid #FECACA; }
.spo-search { width: 300px; max-width: 40vw; height: 34px; background: #fff; border: 1px solid #CBD5E1; border-radius: 8px; font-size: 12px; padding: 0 12px; outline: none; font-family: inherit; }
.spo-search:focus { border: 1.5px solid #1E3A5F; }
.spo-tb .dm-hide { display: none !important; }
.spo-ovd { display: flex; align-items: center; gap: 10px; background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px; padding: 6px 12px; font-size: 12px; color: #B91C1C; font-weight: 700; flex-shrink: 0; }
.spo-ovd button { background: #fff; color: #B91C1C; border: 1px solid #FCA5A5; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 2px 10px; }
.spo-tw { flex: 1; min-height: 260px; overflow: auto; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; direction: ltr; }
.spo-tbl { border-collapse: collapse; font-size: 9pt; font-weight: 700; min-width: 100%; font-family: "Segoe UI", Arial, sans-serif; }
.spo-tbl th { position: sticky; top: 0; z-index: 2; background: #1E3A5F; color: #fff; font-size: 11px; padding: 7px 8px; border-right: 1px solid #2D5382; white-space: nowrap; cursor: pointer; user-select: none; }
.spo-tbl th.rn { cursor: default; left: 0; z-index: 3; }
.spo-tbl td { height: 30px; padding: 3px 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid #F1F5F9; border-right: 1px solid rgba(226,232,240,.6); }
.spo-tbl td.rn { background: #1E3A5F !important; color: #fff; font-size: 8pt; position: sticky; left: 0; z-index: 1; cursor: pointer; min-width: 36px; }
.spo-tbl tbody tr.sel td:not(.rn) { box-shadow: inset 0 0 0 999px rgba(37,99,235,.18); }
.spo-tbl tbody.full tr.sel td.rn { background: #2563EB !important; }
.spo-tbl tbody tr.flash td:not(.rn) { background: #FEF08A !important; color: #0F172A !important; }
.spo-tbl td.miss { animation: spoPulse 1.4s ease-in-out infinite; }
@keyframes spoPulse { 0%,100% { box-shadow: inset 0 0 0 2px rgba(220,38,38,.15); } 50% { box-shadow: inset 0 0 0 2px rgba(220,38,38,.85); } }
.spo-tbl .pill { display: inline-block; margin-left: 4px; background: #F59E0B; color: #fff; font-size: 9px; border-radius: 8px; padding: 1px 6px; vertical-align: middle; }
.spo-delp { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.spo-delnote { font-size: 12px; color: #92400E; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px; padding: 7px 12px; }
.spo-delp td { height: 40px; }
.spo-delp td.acts { text-align: left; }
.spo-delp td.acts button { height: 26px; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 0 10px; margin-right: 6px; }
.spo-delp .dv { background: #fff; color: #334155; border: 1px solid #CBD5E1; } .spo-delp .dv:hover { background: #F1F5F9; }
.spo-delp .dr { background: #1E3A5F; color: #fff; border: none; } .spo-delp .dr:hover { background: #2D5382; }
.spo-delp .dp { background: #fff; color: #B91C1C; border: 1px solid #FCA5A5; } .spo-delp .dp:hover { background: #FEF2F2; }
.ctx-sep { height: 1px; background: #E2E8F0; margin: 4px 8px; }
/* نافذة التعميد */
.po-dlg { width: 1000px; height: min(760px, 94vh); display: flex; flex-direction: column; background: #F8FAFC; }
.po-head { height: 56px; flex: 0 0 56px; background: #1E3A5F; color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: flex-start; padding: 0 20px; }
.po-tabs { display: flex; gap: 2px; padding: 6px 12px 0; border-bottom: 1px solid #E2E8F0; background: #F8FAFC; }
.po-tabs button { background: transparent; color: #64748B; font-size: 12px; padding: 8px 18px; border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0; }
.po-tabs button.on { background: #fff; color: #1E3A5F; font-weight: 700; border-color: #E2E8F0; }
.po-note { background: #FFFBEB; color: #92400E; border-bottom: 1px solid #FDE68A; font-size: 12px; padding: 7px 20px; text-align: right; direction: rtl; }
.po-body { flex: 1; overflow: auto; padding: 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.po-body > * { flex-shrink: 0; }
.po-sec { font-size: 12px; font-weight: 700; color: #475569; background: #F1F5F9; border-radius: 6px; padding: 5px 10px; }
.po-grid { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; }
.po-grid label { font-size: 13px; font-weight: 600; color: #334155; white-space: nowrap; }
.po-grid input, .po-grid select, .po-date { height: 38px; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 12px; font-size: 13px; color: #0F172A; outline: none; font-family: inherit; width: 100%; min-width: 0; }
.po-grid input:focus, .po-grid select:focus, .po-date:focus { border-color: #3B82F6; }
.po-grid input.ro { background: #F1F5F9; color: #64748B; }
.po-grid input.span5 { grid-column: span 5; }
.po-grid input:disabled, .po-grid select:disabled { background: #F8FAFC; color: #475569; opacity: 1; }
.po-grid .lock { background: #F1F5F9 !important; }
.po-vend { min-width: 0; } .po-vend input { width: 100%; }
.po-date { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 0 10px; }
.po-date .t { flex: 1; text-align: left; }
.po-date .x { width: 18px; height: 18px; border: none; background: transparent; color: #94A3B8; font-size: 15px; padding: 0; line-height: 1; }
.po-date .x:hover { color: #DC2626; }
.po-date.empty .x { visibility: hidden; }
.po-date.dis { background: #F8FAFC; cursor: default; color: #64748B; }
.po-date.dis .x { visibility: hidden; }
.po-lw { background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; overflow: auto; min-height: 190px; max-height: 300px; }
.po-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.po-lines th { position: sticky; top: 0; background: #1E3A5F; color: #fff; font-size: 11px; font-weight: 700; padding: 6px 4px; z-index: 1; }
.po-lines td { border: 1px solid #E2E8F0; padding: 0; height: 34px; text-align: center; }
.po-lines td.ln, .po-lines th.ln { width: 30px; background: #F1F5F9; color: #64748B; font-size: 11px; }
.po-lines th.ln { background: #1E3A5F; }
.po-lines input { width: 100%; height: 32px; border: none; background: transparent; text-align: center; font: inherit; outline: none; color: #0F172A; }
.po-lines input:focus { background: #EFF6FF; }
.po-lines input.bad { background: #FEE2E2; color: #991B1B; }
.po-lines input:disabled { color: #334155; }
.po-lines td.net { background: #F1F5F9; color: #1E3A5F; font-weight: 600; }
.ln-del { background: transparent; border: none; padding: 4px; border-radius: 6px; display: inline-flex; }
.ln-del:hover { background: #FEE2E2; }
.po-body.ro .ln-del { display: none; }
.po-addln { height: 30px; background: #EFF6FF; color: #1D4ED8; border: 1.5px dashed #93C5FD; border-radius: 8px; font-size: 11px; font-weight: 700; padding: 0 16px; }
.po-addln:hover { background: #DBEAFE; }
.po-foot { height: 56px; flex: 0 0 56px; background: #fff; border-top: 1px solid #E2E8F0; display: flex; align-items: center; gap: 10px; padding: 0 24px; }
.po-info { font-size: 11px; color: #64748B; }
.po-foot button { width: 110px; height: 32px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.po-cancel { background: #F1F5F9; color: #374151; border: 1.5px solid #E2E8F0; } .po-cancel:hover { background: #E2E8F0; }
.po-ok { background: #1E3A5F; color: #fff; border: none; } .po-ok:hover { background: #2D5382; }
.po-ok:disabled { opacity: .6; }
.po-extra { width: auto !important; padding: 0 14px; background: #fff; color: #B45309; border: 1.5px solid #FCD34D; }
.po-req { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.po-req .h { display: flex; align-items: center; gap: 8px; }
.po-req .h b { font-size: 13px; color: #1E293B; }
.po-req .st { font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 10px; }
.po-req .d, .po-req .b { font-size: 12px; color: #64748B; }
.req-body { background: #F8FAFC; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.req-sum { background: #F1F5F9; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #475569; }
.req-cap { font-size: 12px; color: #374151; }
#reqText { height: 70px; background: #fff; border: 1.5px solid #CBD5E1; border-radius: 8px; padding: 6px; font-size: 13px; color: #1E293B; resize: none; outline: none; font-family: inherit; }
#reqText:focus { border-color: #1E3A5F; }
.req-err { font-size: 12px; color: #DC2626; height: 16px; visibility: hidden; }
.req-note { font-size: 11px; color: #64748B; }
.adv-body { background: #F8FAFC; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.adv-body label { color: #374151; font-size: 11px; font-weight: 700; margin-top: 4px; }
.adv-body input, .adv-body select { height: 34px; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; font-size: 12px; padding: 0 10px; outline: none; font-family: inherit; width: 100%; }
.adv-body input:focus, .adv-body select:focus { border-color: #1E3A5F; }
.adv-2 { display: flex; align-items: center; gap: 6px; } .adv-2 span { color: #94A3B8; }
.adv-body .msg-btns { margin-top: 10px; }
@media (max-width: 1100px) { .spo-r2 { flex-wrap: wrap; } .spo-card { flex: 1 1 30%; } .spo-r1 { flex-direction: column; } }
@media (max-width: 900px) { .po-grid { grid-template-columns: auto 1fr; } .po-grid input.span5 { grid-column: span 1; } }

/* ═════════════ بيانات الموظفين (employee_data_page.py) ═════════════ */
.content:has(.emp-page) { overflow: hidden; }
.emp-page { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 0; }
.emp-page > * { flex-shrink: 0; }
.emp-bar { height: 50px; background: #F8FAFC; border-radius: 8px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.emp-q { width: 180px; height: 30px; border: 1px solid #E2E8F0; border-radius: 10px; padding: 4px 10px; font-size: 11px; background: #fff; outline: none; font-family: inherit; }
.emp-q:focus { border: 1.5px solid #1E3A5F; }
.emp-stats { height: 65px; display: flex; gap: 8px; }
.emp-card { flex: 1; min-width: 0; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 10px; padding: 6px 10px; color: #1E40AF; cursor: pointer; display: flex; flex-direction: column; }
.emp-card.on { border: 2px solid #2563EB; padding: 5px 9px; }
.emp-card b { font-size: 10px; }
.emp-card .v { font-size: 18px; font-weight: 700; text-align: center; line-height: 1.1; }
.emp-card .nf { display: flex; justify-content: space-between; font-size: 8px; }
.emp-card .nf span { display: flex; align-items: center; gap: 3px; }
.emp-card.tot { background: #1E3A5F; border: none; color: #fff; }
.emp-card.tot .sub { font-size: 8px; color: rgba(255,255,255,.8); text-align: center; }
.emp-tabs { display: flex; gap: 2px; }
.emp-tabs button { background: #F1F5F9; color: #374151; border: 1px solid #E2E8F0; border-radius: 6px 6px 0 0; padding: 6px 20px; font-size: 11px; font-weight: 700; }
.emp-tabs button:hover:not(.on) { background: #E2E8F0; }
.emp-tabs button.on { background: #1E3A5F; color: #fff; border-color: #1E3A5F; }
.emp-tw { flex: 1 1 auto !important; min-height: 0; overflow: auto; border: 1px solid #E2E8F0; border-radius: 0 0 8px 8px; margin-top: -10px; background: #fff; }
.emp-tbl { border-collapse: collapse; font-size: 8pt; font-weight: 700; min-width: 100%; font-family: Arial, sans-serif; }
.emp-tbl th { position: sticky; top: 0; z-index: 2; background: #1E3A5F; color: #fff; font-size: 11px; padding: 9px 8px; border-bottom: 2px solid #2D5382; white-space: nowrap; cursor: pointer; user-select: none; }
.emp-tbl th.rn { right: 0; z-index: 3; cursor: default; }
.emp-tbl td { height: 28px; padding: 4px 8px; text-align: center; white-space: nowrap; border: 1px solid #E2E8F0; }
.emp-tbl td.rn { background: #1E3A5F; color: #fff; position: sticky; right: 0; z-index: 1; cursor: pointer; min-width: 30px; }
.emp-tbl td.sel, .emp-tbl tr.sel td:not(.rn) { box-shadow: inset 0 0 0 999px rgba(37,99,235,.35); }
.emp-tbl tr.sel td.rn { background: #2563EB; }
.emp-pop { position: fixed; z-index: 120; background: #fff; border: 1.5px solid #1E3A5F; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.emp-pop select { border: none; outline: none; font: inherit; font-size: 12px; min-width: 100%; padding: 2px; }
.emp-pop option { padding: 4px 8px; }
.emp-add { width: 440px; max-height: 92vh; display: flex; flex-direction: column; }
.emp-form { flex: 1; overflow: auto; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 16px 20px; background: #fff; }
.emp-form label { color: #374151; font-size: 11px; font-weight: 700; white-space: nowrap; }
.emp-form input, .emp-form select { background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; font-size: 12px; padding: 4px 10px; height: 34px; outline: none; font-family: inherit; width: 100%; }
.emp-form input:focus, .emp-form select:focus { border-color: #1E3A5F; }
.emp-ft { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid #E2E8F0; background: #F8FAFC; }
.emp-ft button { flex: 1; height: 34px; }
.sup-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; background: #F8FAFC; }
.sup-l { font-size: 13px; color: #374151; font-weight: 700; }
.sup-rb { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #1E293B; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.sup-rb:has(input:checked) { background: #EFF6FF; border-color: #1E3A5F; }
.sup-rb.dis { color: #94A3B8; background: #F8FAFC; cursor: default; }
.sup-rb input { accent-color: #1E3A5F; }
.sup-w { font-size: 12px; color: #92400E; background: #FEF3C7; border-radius: 6px; padding: 6px 8px; }
.msg-hl { font-size: 12px; color: #92400E; background: #FEF3C7; border-radius: 6px; padding: 6px 8px; margin: 0 16px 6px; }

/* ═════════════ الإجازات والاستئذان (leave_page.py) ═════════════ */
.content:has(.lv-page) { overflow: hidden; }
.lv-page { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 0; }
.lv-page > * { flex-shrink: 0; }
.lv-page [hidden], .modal-back [hidden] { display: none !important; }
.lv-bar { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-sw { position: relative; }
.lv-sw .lv-sic { position: absolute; right: 9px; top: 7px; line-height: 0; }
.lv-sw input { width: 220px; height: 32px; border: 1.5px solid #CBD5E1; border-radius: 8px; padding: 0 32px 0 10px; font-size: 12px; outline: none; font-family: inherit; }
.lv-sw input:focus { border-color: #1E3A5F; }
.lv-cb { height: 32px; border: 1.5px solid #CBD5E1; border-radius: 8px; padding: 0 10px; font-size: 12px; background: #fff; font-family: inherit; }
.lv-b { position: relative; width: 34px; height: 34px; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0; }
.lv-b span { line-height: 0; }
.lv-b:hover { background: #F1F5F9; }
.lv-b.pri { background: #1E3A5F; border-color: #1E3A5F; }
.lv-b.pri:hover { background: #2D5382; }
.lv-badge { position: absolute; top: -6px; left: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: #DC2626; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.lv-cards { display: flex; gap: 10px; }
.lvp-card { flex: 1; min-height: 74px; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.lvp-card.on { border: 2px solid var(--c); padding: 9px 13px; }
.lvp-card .ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lvp-card b { font-size: 12px; color: #64748B; }
.lvp-card .v { font-size: 22px; font-weight: 700; line-height: 1.1; }
.lv-main { flex: 1 1 auto !important; min-height: 0; display: flex; gap: 10px; }
.lv-tw { flex: 1; min-width: 0; overflow: auto; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; }
.lv-tbl { border-collapse: collapse; width: 100%; font-size: 12px; }
.lv-tbl th { position: sticky; top: 0; z-index: 2; background: #1E3A5F; color: #fff; font-size: 11px; font-weight: 700; padding: 8px 6px; border-bottom: 2px solid #2D5382; white-space: nowrap; cursor: pointer; user-select: none; }
.lv-tbl td { height: 40px; padding: 4px 8px; text-align: center; border-bottom: 1px solid #E2E8F0; white-space: nowrap; }
.lv-tbl tbody tr:nth-child(even) td { background-color: #F8FAFC; }
.lv-tbl tbody tr { cursor: pointer; }
.lv-tbl tbody tr.sel td { background-color: #E0ECFA !important; }
.lv-tbl td.rn { width: 44px; color: #1E3A5F; font-weight: 700; }
.lv-tbl td.nm { font-weight: 700; text-align: right; }
.lv-tbl td.nm .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #EA580C; margin-left: 6px; }
.lv-tbl td.bal { width: 160px; }
.lv-tbl td.bal b { display: block; font-size: 12px; }
.lv-tbl .bar { display: block; height: 4px; background: #E2E8F0; border-radius: 2px; margin: 3px 8px; overflow: hidden; direction: rtl; }
.lv-tbl .bar i { display: block; height: 100%; border-radius: 2px; }
.lv-tbl td.bal small, .lv-tbl td.prm span { font-size: 10px; color: #64748B; }
.lv-tbl .pill, .lv-page .pill, .modal-back .pill { display: inline-block; border-radius: 10px; padding: 2px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.lv-tbl.sm td { height: 32px; font-size: 12px; cursor: default; }
.lv-tbl.sm tbody tr { cursor: default; }
.lv-tbl td.tl { text-align: right; white-space: normal; max-width: 260px; }
.lv-empty { color: #64748B; font-size: 13px; text-align: center; padding: 40px; }
.lv-det { width: 330px; flex-shrink: 0; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.lv-hd { background: #1E3A5F; padding: 10px 14px 14px; color: #fff; }
.lv-tools { display: flex; gap: 6px; }
.lv-tools button { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.12); border: none; display: flex; align-items: center; justify-content: center; padding: 0; }
.lv-tools button:hover { background: rgba(255,255,255,.25); }
.lv-dn { font-size: 16px; font-weight: 700; margin-top: 6px; }
.lv-ds { font-size: 11px; color: #CBD5E1; }
.lv-db { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.lv-db > * { flex-shrink: 0; }
.lv-link { font-size: 11px; color: #166534; background: #DCFCE7; border-radius: 8px; padding: 6px 10px; }
.lv-link.no { color: #9A3412; background: #FFF7ED; }
.lv-bx { display: flex; gap: 8px; }
.lv-bx > * { flex: 1; }
.lv-bal { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lv-bal.warn { border-color: #FDBA74; }
.lv-bal .t { font-size: 11px; color: #64748B; }
.lv-bal b { font-size: 20px; }
.lv-bal b small { font-size: 12px; font-weight: 400; color: #64748B; }
.lv-bal .s { font-size: 10px; color: #64748B; text-align: center; }
.lv-bal .chip { font-size: 10px; border-radius: 7px; padding: 2px 8px; background: #F1F5F9; color: #475569; }
.lv-bal .chip.w { background: #FFF7ED; color: #C2410C; }
.lv-bal .bar { align-self: stretch; height: 4px; background: #E2E8F0; border-radius: 2px; overflow: hidden; margin-top: 2px; }
.lv-bal .bar i { display: block; height: 100%; }
.lv-sect { font-size: 12px; font-weight: 700; color: #1E3A5F; margin-top: 6px; }
.lv-kv { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; }
.lv-kv > div { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #F1F5F9; font-size: 12px; }
.lv-kv > div:last-child { border-bottom: none; }
.lv-kv .ic { line-height: 0; }
.lv-kv .k { color: #64748B; }
.lv-kv b { color: #1E293B; }
.lv-tl { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 4px 10px; }
.lv-tl .it { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }
.lv-tl .it i { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.lv-tl .it b { display: block; font-size: 12px; color: #1E293B; }
.lv-tl .it span { font-size: 11px; color: #64748B; }
.lv-mute { color: #94A3B8; font-size: 12px; text-align: center; padding: 10px; }
.lv-mute.big { padding: 50px; font-size: 13px; }
.lv-ft { padding: 10px; border-top: 1px solid #E2E8F0; background: #fff; }
.lv-ft button { width: 100%; height: 34px; background: #1E3A5F; color: #fff; border: none; border-radius: 8px; font-size: 12px; font-weight: 700; }
.lv-full { width: min(1100px, 96vw); height: min(680px, 92vh); display: flex; flex-direction: column; }
.lv-tabs { display: flex; gap: 4px; padding: 10px 14px 0; }
.lv-tabs button { background: #F1F5F9; color: #475569; border: none; border-radius: 7px; padding: 6px 16px; font-size: 12px; font-weight: 700; }
.lv-tabs button.on { background: #1E3A5F; color: #fff; }
.lv-fb { flex: 1; overflow: auto; padding: 10px 14px; }
.lv-hint { background: #EFF6FF; color: #1E3A5F; border-radius: 8px; padding: 7px 12px; font-size: 12px; margin-bottom: 8px; }
.lv-ff { display: flex; padding: 10px 14px; border-top: 1px solid #E2E8F0; }
.lv-ff button { width: 110px; height: 32px; }
.lv-x { background: transparent; border: none; padding: 4px; border-radius: 6px; line-height: 0; }
.lv-x:hover { background: #FEE2E2; }
.lv-dlg { width: 520px; max-height: 94vh; display: flex; flex-direction: column; overflow: auto; }
.lv-form { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 14px 16px 6px; }
.lv-form label { font-size: 12px; font-weight: 700; color: #374151; white-space: nowrap; }
.lv-form input:not([type=checkbox]), .lv-form select, .lv-inp { height: 36px; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none; font-family: inherit; width: 100%; background: #fff; }
.lv-form input:focus, .lv-form select:focus, .lv-inp:focus { border-color: #1E3A5F; }
.lv-form input.dt, .lv-ctbl input.dt { cursor: pointer; }
.lv-sub { display: flex; gap: 6px; } .lv-sub > * { flex: 1; min-width: 0; }
.lv-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lv-files button { height: 32px; background: #EFF6FF; color: #1D4ED8; border: 1.5px dashed #93C5FD; border-radius: 8px; font-size: 11px; font-weight: 700; padding: 0 14px; }
.fch { display: inline-flex; gap: 4px; align-items: center; background: #F1F5F9; border-radius: 6px; padding: 3px 8px; font-size: 11px; color: #1E3A5F; text-decoration: none; margin: 2px; }
.fch a { color: #DC2626; text-decoration: none; }
.lv-info { margin: 4px 16px; font-size: 12px; color: #475569; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px; padding: 8px 10px; line-height: 1.8; }
.lv-info:empty { display: none; }
.lv-err { margin: 4px 16px; font-size: 12px; color: #B91C1C; background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px; padding: 8px 10px; white-space: pre-line; }
.lv-dft { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #E2E8F0; margin-top: 8px; }
.lv-dft button { flex: 1; height: 36px; }
.lv-ctbl { width: calc(100% - 32px); margin: 6px 16px; border-collapse: collapse; }
.lv-ctbl th { background: #1E3A5F; color: #fff; font-size: 11px; padding: 6px; }
.lv-ctbl td { padding: 3px; border-bottom: 1px solid #E2E8F0; }
.lv-ctbl input { width: 100%; height: 32px; border: 1px solid #E2E8F0; border-radius: 6px; padding: 0 6px; font: inherit; font-size: 12px; }
.lv-rq { width: min(880px, 96vw); height: min(620px, 92vh); display: flex; flex-direction: column; }
.lv-rqt { display: flex; align-items: center; gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.lv-seg { display: flex; gap: 4px; }
.lv-seg button { height: 30px; background: #fff; color: #64748B; border: 1px solid #E2E8F0; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 0 14px; }
.lv-seg button.on { background: #1E3A5F; color: #fff; border-color: #1E3A5F; }
.lv-seg.sm button { height: 26px; padding: 0 10px; border-radius: 8px; }
.lv-rqb { flex: 1; overflow: auto; padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.lv-rqb > * { flex-shrink: 0; }
.rq-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.rq-card .h { display: flex; align-items: center; gap: 8px; }
.rq-card .h b { font-size: 13px; color: #1E293B; }
.rq-card .h .k { font-size: 12px; color: #1E3A5F; background: #EFF6FF; border-radius: 6px; padding: 1px 8px; }
.rq-card .l { font-size: 12px; color: #334155; font-weight: 700; }
.rq-card .n { font-size: 12px; color: #64748B; }
.rq-card .tl { background: #F8FAFC; border-radius: 8px; padding: 4px 10px; }
.rq-card .tl > div { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #334155; padding: 2px 0; }
.rq-card .tl i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rq-card .tl small { color: #94A3B8; font-size: 10px; }
.rq-card .f { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.rq-card .f small { color: #94A3B8; font-size: 11px; }
.rq-card .f button { height: 28px; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 0 14px; border: 1px solid transparent; }
.rq-card .f .ok { background: #16A34A; color: #fff; } .rq-card .f .no { background: #fff; color: #DC2626; border-color: #FCA5A5; }
.rq-card .f .wd { background: #fff; color: #B45309; border-color: #FCD34D; } .rq-card .f .dl { background: #fff; color: #64748B; border-color: #CBD5E1; }
.lv-sec { font-size: 12px; font-weight: 700; color: #1E3A5F; margin-bottom: 6px; }
.lv-aetw { max-height: 230px; overflow: auto; margin: 8px 16px; border: 1px solid #E2E8F0; border-radius: 8px; }
.lv-aetw tbody tr { cursor: pointer !important; }
.lv-note { margin: 0 16px 8px; height: 70px; border: 1.5px solid #CBD5E1; border-radius: 8px; padding: 6px; font: inherit; font-size: 13px; resize: none; width: calc(100% - 32px); }
@media (max-width: 1000px) { .lv-det { position: absolute; left: 10px; top: 10px; bottom: 10px; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,.2); } .lv-main { position: relative; } .lv-cards { flex-wrap: wrap; } .lvp-card { flex: 1 1 40%; } }
.lv-ff button, .lv-dft button, .emp-ft button { border-radius: 8px; font-weight: 700; font-size: 12px; background: #F1F5F9; border: 1.5px solid #E2E8F0; color: #374151; }
.lv-ff button.m-ok, .lv-dft button.m-ok, .emp-ft button.m-ok { background: #1E3A5F; color: #fff; border: none; }
.lv-ff button.m-ok:hover, .lv-dft button.m-ok:hover, .emp-ft button.m-ok:hover { background: #2D5382; }
.lv-ff button:not(.m-ok):hover, .lv-dft button:not(.m-ok):hover, .emp-ft button:not(.m-ok):hover { background: #E2E8F0; }
.lv-dft button:disabled { opacity: .6; }

/* ═════════════ جدول الدوام الشهري (duty_schedule_page.py) ═════════════ */
.content:has(.du-page) { overflow: hidden; }
.du-page { height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 0; }
.du-page > * { flex-shrink: 0; }
.du-page [hidden] { display: none !important; }
.du-bar { min-height: 50px; background: #F8FAFC; border-radius: 8px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; flex-wrap: wrap; }
.du-l { color: #374151; font-size: 12px; }
.du-cb { height: 26px; min-width: 110px; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 8px; font-size: 11px; background: #fff; font-family: inherit; }
#duSite { min-width: 78px; }
.du-q { width: 190px; border: 1px solid #CBD5E1; border-radius: 8px; padding: 5px 10px; font-size: 12px; background: #fff; outline: none; font-family: inherit; }
.du-q:focus { border: 1.5px solid #1E3A5F; }
.du-chips { display: flex; gap: 6px; }
.du-chips span { height: 26px; border-radius: 13px; font-size: 11px; font-weight: 700; padding: 0 12px; display: flex; align-items: center; white-space: nowrap; }
.du-lvb { height: 30px; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; font-size: 11px; font-weight: 700; color: #0F766E; padding: 0 10px; }
.du-lvb:hover { background: #F0FDFA; border-color: #99F6E4; }
.du-tw { flex: 1 1 auto !important; min-height: 0; overflow: auto; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; }
.du-tbl { border-collapse: separate; border-spacing: 0; font-size: 9px; font-family: Arial, sans-serif; font-weight: 700; }
.du-tbl th { position: sticky; top: 0; z-index: 3; background: #1E3A5F; color: #fff; height: 36px; padding: 0 2px; font-size: 10px; line-height: 1.2; border-left: 1px solid #2D5382; min-width: 42px; cursor: pointer; user-select: none; }
.du-tbl th.we { background: #94A3B8; }
.du-tbl td { height: 28px; text-align: center; border-left: 1px solid #E2E8F0; border-bottom: 1px solid #E2E8F0; min-width: 42px; padding: 0 2px; cursor: default; user-select: none; }
.du-tbl .c0, .du-tbl .c1, .du-tbl .c2, .du-tbl .c3, .du-tbl .c4 { position: sticky; z-index: 2; }
.du-tbl th.c0, .du-tbl th.c1, .du-tbl th.c2, .du-tbl th.c3, .du-tbl th.c4 { z-index: 4; }
.du-tbl .c0 { right: 0; min-width: 36px; width: 36px; }
.du-tbl .c1 { right: 36px; min-width: 60px; width: 60px; }
.du-tbl .c2 { right: 96px; min-width: 180px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.du-tbl .c3 { right: 276px; min-width: 70px; width: 70px; }
.du-tbl .c4 { right: 346px; min-width: 70px; width: 70px; border-left: 2px solid #94A3B8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.du-tbl td.c0 { background: #1E3A5F; color: #fff; }
.du-tbl td.c2, .du-tbl td.c3, .du-tbl td.c4 { background: #EFF6FF; color: #1E3A5F; }
.du-tbl td.c2 { text-align: right; padding: 0 6px; }
.du-tbl td.c3.miss { background: #FEF3C7; }
.du-tbl td.d.sel { box-shadow: inset 0 0 0 999px rgba(37,99,235,.35); }
.du-tbl td.cur { outline: 2px solid #2563EB; outline-offset: -2px; }
.du-tbl td.m-conflict { box-shadow: inset 0 0 0 2px #DC2626; }
.du-tbl td.m-unreg { box-shadow: inset 0 0 0 2px #F59E0B; }
.du-tbl td.m-ok { background-image: linear-gradient(225deg, #16A34A 5px, transparent 5px); }
.du-tbl td.nt { background-image: linear-gradient(135deg, #2563EB 5px, transparent 5px); }
.du-empty { padding: 50px; text-align: center; color: #64748B; font-size: 13px; }
.du-legend { height: 32px; background: #1E293B; border-radius: 8px; display: flex; align-items: center; gap: 5px; padding: 3px 10px; }
.du-legend span { border-radius: 4px; font-size: 9px; font-weight: 700; padding: 1px 8px; cursor: pointer; user-select: none; white-space: nowrap; }
.du-pop { position: fixed; z-index: 130; width: 300px; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow: hidden; }
.du-pop .dh { height: 44px; background: #1E3A5F; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; padding: 0 16px; }
.du-pop .db { padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.du-pop .dl { font-size: 11px; color: #64748B; font-weight: 700; }
#duOpts { display: flex; flex-direction: column; gap: 5px; }
#duOpts button { height: 30px; border: 1px solid #E2E8F0; border-radius: 6px; font-size: 11px; font-weight: 700; text-align: left; direction: ltr; padding: 0 10px; }
#duOpts button.on { border: 2px solid var(--fg); }
.du-pop input { height: 32px; border: 1.5px solid #E2E8F0; border-radius: 6px; padding: 0 8px; font: inherit; font-size: 12px; outline: none; }
.du-pop input:focus { border-color: #1E3A5F; }
.du-pop .df { display: flex; gap: 8px; padding: 8px 12px; background: #F8FAFC; border-top: 1px solid #E2E8F0; }
.du-pop .df button { flex: 1; height: 32px; border: none; border-radius: 8px; font-size: 12px; font-weight: 700; }

/* ═════════════ التقارير (reports_page.py) ═════════════ */
.content:has(.rp-page) { background: #F8FAFC; }
.rp-page { min-height: 100%; background: #F8FAFC; color: #E2E8F0; display: flex; flex-direction: column; gap: 0; padding: 12px 12px 0; }
.rp-page [hidden] { display: none !important; }
.rp-tabs { display: flex; gap: 0; flex-wrap: wrap; align-items: flex-end; }
.rp-tabs button { display: inline-flex; align-items: center; gap: 8px; background: #EEF2F7; color: #475569; border: none; border-radius: 8px 8px 0 0; font: inherit; font-size: 13px; font-weight: 700; padding: 10px 18px; margin-left: 4px; cursor: pointer; }
.rp-tabs button.on { background: #1E3A5F; color: #fff; }
.rp-tabs button:hover:not(.on) { background: #E2E8F0; }
.rp-tabs .rp-print { background: #1D4ED8; color: #fff; border: none; }
.rp-body { display: flex; flex-direction: column; gap: 10px; background: #080C14; padding: 14px; flex: 1; }
.rp-row { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-row > * { flex: 1 1 240px; min-width: 0; }
.rp-kpi { min-height: 110px; border: 1px solid; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.rp-kpi span, .rp-kpi small { font-size: 10px; color: #94A3B8; }
.rp-kpi b { font-size: 32px; font-weight: 700; line-height: 1.1; }
.rp-kpi i { display: block; height: 4px; border-radius: 2px; }
.rp-wk { cursor: pointer; border-radius: 16px; border: 2px solid transparent; }
.rp-wk.on { border-color: #E2E8F0; }
.rp-card { background: #0D1526; border: 1px solid #1E2D45; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.rp-card.wide { flex-basis: 100%; }
.rp-card:hover { border-color: #2563EB; }
.rp-ch { display: flex; align-items: center; }
.rp-ch b { font-size: 12px; color: #E2E8F0; display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.rp-gold { color: #FCD34D; font-size: 11px; font-weight: 700; }
.rp-gold.s { min-height: 14px; }
.rp-sub { font-size: 11px; color: #94A3B8; font-weight: 700; margin-top: 4px; }
.rp-db { display: flex; align-items: center; gap: 12px; }
.rp-db .rp-leg { flex: 1; }
.rp-donut { flex-shrink: 0; }
.rp-donut .t1, .rp-line .t1, .rp-card svg .t1 { fill: #E2E8F0; font-size: 20px; font-weight: 700; }
.rp-donut .t2, .rp-card svg .t2 { fill: #64748B; font-size: 11px; }
.rp-leg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-leg > div { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #CBD5E1; }
.rp-leg i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.rp-leg span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-leg small { color: #64748B; min-width: 40px; text-align: left; }
.rp-bars { display: flex; flex-direction: column; gap: 5px; }
.rp-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.rp-bar .l { width: 110px; color: #CBD5E1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-bar .tr { flex: 1; height: 10px; background: #1E2D45; border-radius: 5px; overflow: hidden; }
.rp-bar .tr i { display: block; height: 100%; border-radius: 5px; }
.rp-bar b { min-width: 40px; text-align: left; color: #E2E8F0; }
.rp-bar small { min-width: 40px; color: #64748B; text-align: left; }
.rp-mute { color: #64748B; font-size: 12px; text-align: center; padding: 14px; }
.rp-empty { color: #94A3B8; font-size: 13px; text-align: center; padding: 60px; }
.rp-seg { display: inline-flex; gap: 3px; margin-right: auto; }
.rp-seg button { height: 22px; background: #0B1220; color: #94A3B8; border: 1px solid #1E2D45; border-radius: 6px; font-size: 10px; font-weight: 700; padding: 0 8px; }
.rp-seg button.on { background: #1D4ED8; color: #fff; border-color: #2563EB; }
.rp-filt { display: flex; align-items: center; gap: 8px; background: #0D1526; border: 1px solid #1E2D45; border-radius: 10px; padding: 8px 12px; font-size: 12px; }
.rp-filt select, .rp-filt input { height: 30px; background: #0B1220; color: #E2E8F0; border: 1px solid #1E2D45; border-radius: 7px; padding: 0 8px; font: inherit; font-size: 12px; }
.rp-filt input { width: 300px; }
.rp-tw { max-height: 60vh; overflow: auto; }
.rp-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.rp-tbl th { position: sticky; top: 0; background: #1E2D45; color: #E2E8F0; padding: 7px 6px; white-space: nowrap; }
.rp-tbl td { padding: 6px; border-bottom: 1px solid #1E2D45; text-align: center; color: #CBD5E1; white-space: nowrap; }
.rp-tbl td.tl { text-align: right; }
.rp-pill { border: 1px solid; border-radius: 10px; padding: 1px 8px; font-size: 10px; font-weight: 700; }
.rp-band { display: flex; flex-direction: column; gap: 6px; }
.rp-band > div:not(.pr):not(.big) { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.rp-band span { color: #94A3B8; flex: 1; }
.rp-band small { color: #64748B; }
.rp-band .pr { height: 8px; background: #1E2D45; border-radius: 4px; overflow: hidden; }
.rp-band .pr i { display: block; height: 100%; }
.rp-band .big { font-size: 26px; font-weight: 700; text-align: center; }
.rp-line { width: 100%; height: 240px; }
.rp-line .ax line { stroke: #1E2D45; }
.rp-line .ax text { fill: #64748B; font-size: 10px; }
.rp-ll { display: flex; gap: 16px; justify-content: center; font-size: 11px; color: #CBD5E1; }
.rp-ll i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 5px; }
.rp-cols { height: 180px; display: flex; gap: 6px; align-items: flex-end; padding-top: 10px; }
.rp-cols > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.rp-cols i { width: 70%; background: linear-gradient(180deg, #60A5FA, #1D4ED8); border-radius: 4px 4px 0 0; min-height: 2px; }
.rp-cols span { font-size: 9px; color: #64748B; }
@media print { body.rp-printing .sidebar, body.rp-printing .topbar, body.rp-printing .rp-tabs, body.rp-printing .app-menubar { display: none !important; } body.rp-printing .rp-page { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ═════════════ النسخ الاحتياطي (backup_page.py) ═════════════ */
.bk-page { display: flex; flex-direction: column; gap: 14px; padding: 8px 4px; }
.bk-page [hidden] { display: none !important; }
.bk-band { min-height: 190px; background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; display: flex; flex-wrap: wrap; }
.bk-verdict { width: 360px; max-width: 100%; border-left: 1px solid #E2E8F0; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; }
.bk-chip { align-self: flex-start; height: 24px; border-radius: 12px; padding: 0 12px; font-size: 11px; font-weight: 700; display: flex; align-items: center; }
.bk-chip.ok { background: #DCFCE7; color: #166534; } .bk-chip.warn { background: #FEF3C7; color: #92400E; }
.bk-head { font-size: 17px; font-weight: 700; color: #0F172A; }
.bk-reason { font-size: 12px; color: #64748B; }
.bk-acts { display: flex; gap: 8px; }
.bk-b { height: 34px; border-radius: 9px; font-size: 12px; font-weight: 700; padding: 0 16px; background: #fff; color: #0F172A; border: 1px solid #E2E8F0; }
.bk-b:hover { background: #F8FAFC; }
.bk-b.pri { background: #1E3A5F; color: #fff; border-color: #1E3A5F; } .bk-b.pri:hover { background: #2B4C75; }
.bk-days { flex: 1; min-width: 300px; padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.bk-dh { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #0F172A; }
.bk-dh .lg { font-size: 11px; color: #64748B; display: flex; align-items: center; gap: 4px; }
.bk-dh .lg i { width: 10px; height: 10px; border-radius: 3px; }
.bk-track { display: flex; gap: 6px; }
.bk-track > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bk-track i { width: 100%; height: 30px; border-radius: 6px; background: #E2E8F0; }
.bk-track .ok i { background: #16A34A; } .bk-track .fail i { background: #DC2626; }
.bk-track span { font-size: 10px; color: #64748B; } .bk-track small { font-size: 10px; color: #94A3B8; }
.bk-note { font-size: 11px; color: #64748B; background: #F8FAFC; border-radius: 8px; padding: 8px 10px; }
.bk-list { background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; overflow: hidden; }
.bk-lh { display: flex; align-items: center; padding: 12px 16px; font-size: 13px; color: #0F172A; border-bottom: 1px solid #E2E8F0; }
.bk-lh span:last-child { font-size: 11px; color: #64748B; }
.bk-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.bk-tbl th { background: #1E3A5F; color: #fff; padding: 8px; font-size: 11px; }
.bk-tbl td { padding: 8px; text-align: center; border-bottom: 1px solid #F1F5F9; }
.bk-tbl td.acts { display: flex; gap: 6px; justify-content: center; }
.bk-ty { background: #EFF6FF; color: #1D4ED8; border-radius: 10px; padding: 2px 10px; font-size: 11px; font-weight: 700; }
.bk-ty.a { background: #F1F5F9; color: #475569; }
.bk-s { height: 28px; display: inline-flex; align-items: center; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 0 12px; background: #fff; color: #1E3A5F; border: 1px solid #CBD5E1; text-decoration: none; }
.bk-s.r { color: #B45309; border-color: #FCD34D; } .bk-s.d { color: #B91C1C; border-color: #FCA5A5; }
.bk-empty { color: #94A3B8; padding: 30px !important; }
.bk-rb { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; background: #F8FAFC; }
.bk-warn { font-size: 12px; color: #991B1B; background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px; padding: 10px; line-height: 1.7; }
.bk-when { font-size: 12px; color: #334155; font-weight: 700; }
.bk-sum { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; }
.bk-sum th, .bk-sum td { border: 1px solid #E2E8F0; padding: 6px; text-align: center; }
.bk-sum th { background: #F1F5F9; }
.bk-cf { font-size: 12px; color: #334155; display: flex; gap: 8px; align-items: center; }
.bk-spin { width: 34px; height: 34px; border: 4px solid #E2E8F0; border-top-color: #1E3A5F; border-radius: 50%; margin: auto; animation: bkS 1s linear infinite; }
@keyframes bkS { to { transform: rotate(360deg); } }
/* إعدادات الإجازات وتسلسل الموافقات والترحيل (W022) */
.lv-chainbox { margin: 12px 16px 0; display: flex; gap: 8px; align-items: center; font-size: 12px; color: #1E3A5F; background: #EFF6FF; border-radius: 8px; padding: 6px 10px; white-space: pre-line; }
.lv-chainbox span { flex: 1; }
.lv-chainbox button { height: 28px; background: #fff; color: #1E3A5F; border: 1px solid #BFDBFE; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 0 12px; white-space: nowrap; }
.st-g label { display: flex; gap: 6px; align-items: center; }
.st-n { display: flex; gap: 6px; align-items: center; } .st-n input { width: 100px !important; } .st-n span { font-size: 12px; color: #64748B; }
.lv-sec2 { margin: 10px 16px 0; font-size: 12px; font-weight: 700; color: #475569; background: #F1F5F9; border-radius: 6px; padding: 5px 10px; }
.lv-sub2 { margin: 6px 16px 0; font-size: 12px; color: #475569; }
.st-rules { margin: 6px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.st-r { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #334155; }
.st-r b { min-width: 110px; } .st-r input[type=number] { width: 70px; height: 30px; border: 1.5px solid #E2E8F0; border-radius: 6px; padding: 0 6px; font: inherit; }
.st-r input:disabled, .st-n input:disabled { background: #F1F5F9; color: #94A3B8; }
.ch-dlg { width: min(1080px, 96vw); height: min(760px, 94vh); }
.ch-top { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px 0; }
.ch-top .lv-seg { flex: 1; } .ch-top .lv-seg button { flex: 1; }
.ch-body { flex: 1; overflow: auto; padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.ch-body > * { flex-shrink: 0; }
.ch-hnote { display: flex; gap: 8px; align-items: center; background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; font-size: 12px; border-radius: 8px; padding: 8px 10px; }
.ch-hnote span { flex: 1; } .ch-hnote button { height: 28px; background: #fff; color: #92400E; border: 1px solid #FCD34D; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 0 12px; }
.ch-first { font-size: 12px; color: #64748B; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px; padding: 7px 10px; }
.ch-hdr, .ch-row { display: grid; grid-template-columns: 26px 1fr 180px 180px 150px 200px 96px; gap: 8px; align-items: start; }
.ch-hdr span { font-size: 11px; color: #64748B; font-weight: 700; text-align: center; }
.ch-row { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 8px; margin-bottom: 6px; }
.ch-row.away { background: #FFF7ED; border-color: #FDBA74; }
.ch-row .n { width: 24px; height: 24px; border-radius: 12px; background: #1E3A5F; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.ch-row input:not([type=checkbox]), .ch-row select { height: 32px; border: 1.5px solid #E2E8F0; border-radius: 7px; padding: 0 8px; font: inherit; font-size: 12px; width: 100%; background: #fff; }
.ch-row .uc { display: flex; flex-direction: column; gap: 4px; }
.ch-row .aw { font-size: 11px; color: #92400E; display: flex; gap: 4px; align-items: center; }
.ch-row .cd { display: flex; gap: 4px; align-items: center; } .ch-row .cd input { width: 70px !important; } .ch-row .cd small { font-size: 11px; color: #64748B; }
.ch-row .ib { display: flex; gap: 3px; } .ch-row .ib button { width: 28px; height: 30px; background: #fff; border: 1px solid #E2E8F0; border-radius: 6px; font-size: 11px; color: #475569; }
.ch-row .ib button:disabled { opacity: .35; } .ch-row .ib button[data-m=del] { color: #DC2626; }
.ch-grp { position: relative; } .ch-grp summary { height: 32px; border: 1.5px solid #E2E8F0; border-radius: 7px; padding: 0 8px; font-size: 11px; display: flex; align-items: center; cursor: pointer; list-style: none; overflow: hidden; white-space: nowrap; }
.ch-grp > div { position: absolute; z-index: 5; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; padding: 6px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 4px; min-width: 140px; font-size: 12px; }
.ch-grp.dis { height: 32px; border: 1.5px solid #E2E8F0; border-radius: 7px; background: #F8FAFC; color: #94A3B8; font-size: 11px; display: flex; align-items: center; padding: 0 8px; }
.ch-mx td input { width: 16px; height: 16px; accent-color: #1E3A5F; }
.co-opts { display: flex; flex-direction: column; gap: 8px; margin: 8px 16px 0; }
.co-o { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.co-o:has(input:checked) { background: #F1F5F9; border-color: #1E3A5F; }
.co-o input[type=radio] { accent-color: #1E3A5F; margin-top: 3px; }
.co-o b { display: block; font-size: 13px; color: #1E293B; } .co-o span { font-size: 12px; color: #64748B; }
.co-cap { margin-top: 6px; font-size: 12px; } .co-cap input { width: 70px; height: 28px; border: 1.5px solid #E2E8F0; border-radius: 6px; padding: 0 6px; font: inherit; }
.co-cards { display: flex; gap: 8px; margin: 10px 16px 0; }
.co-cards > div { flex: 1; background: #EFF6FF; color: #1E3A5F; border-radius: 10px; padding: 8px; text-align: center; }
.co-cards > div.g { background: #DCFCE7; color: #166534; } .co-cards > div.r { background: #FEE2E2; color: #991B1B; }
.co-cards span { display: block; font-size: 11px; } .co-cards b { font-size: 18px; }
.imp-cnt { display: flex; justify-content: space-between; font-size: 13px; color: #334155; padding: 4px 2px; }
.imp-cnt b { color: #1E3A5F; }
.op-ibtn input[type=file] { display: none; }
/* نافذة الأجهزة المفلترة — التقارير */
.rp-bar.ck, .rp-leg > div.ck { cursor: pointer; border-radius: 6px; transition: background .12s; }
.rp-bar.ck:hover, .rp-leg > div.ck:hover { background: rgba(148,163,184,.12); }
.fa-dlg { width: min(1240px, 96vw); height: min(680px, 90vh); display: flex; flex-direction: column; background: #F8FAFC; padding: 14px 16px; gap: 10px; }
.fa-head { display: flex; align-items: center; gap: 8px; }
.fa-head b { font-size: 14px; color: #1E3A5F; }
.fa-io { width: 36px; height: 36px; border: none; border-radius: 12px; background: rgba(30,58,95,.12); color: var(--primary, #1E3A5F); cursor: pointer; display: grid; place-items: center; }
.fa-io:hover { background: rgba(30,58,95,.2); }
.fa-tw { flex: 1; overflow: auto; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; }
.fa-tbl { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12px; color: #1E293B; }
.fa-tbl th { position: sticky; top: 0; background: #1E3A5F; color: #fff; font-size: 11px; font-weight: 700; padding: 7px 8px; border-bottom: 2px solid #2D5382; white-space: nowrap; z-index: 1; }
.fa-tbl td { padding: 5px 8px; text-align: center; border-bottom: 1px solid #E2E8F0; white-space: nowrap; }
.fa-tbl tbody tr:nth-child(even) td { background: #F8FAFC; }
.fa-tbl tbody tr:hover td { background: #DBEAFE; }
.fa-tbl td.hl { background: #16A34A !important; color: #000; }
.fa-tbl td.n { color: #64748B; }
.fa-none { color: #94A3B8; padding: 30px !important; }
.fa-foot { display: flex; justify-content: flex-end; }
.fa-close { height: 32px; padding: 0 28px; border: none; border-radius: 8px; background: #1E3A5F; color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.fa-close:hover { background: #2D5382; }
#faMenu { position: fixed; z-index: 3000; }
/* تقويم الإجازات */
.lv-seg { display: inline-flex; margin-inline-start: 6px; }
.lv-seg button { height: 34px; padding: 0 14px; border: 1px solid #E2E8F0; background: #fff; color: #334155; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.lv-seg button:first-child { border-radius: 0 8px 8px 0; }
.lv-seg button:last-child { border-radius: 8px 0 0 8px; border-inline-start: none; }
.lv-seg button.on { background: var(--primary, #1E3A5F); border-color: var(--primary, #1E3A5F); color: #fff; }
.lv-cal { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 10px 12px; min-height: 0; }
.lc-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lc-nav > button { height: 30px; padding: 0 12px; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: #1E293B; cursor: pointer; }
.lc-nav > button:hover { background: #F1F5F9; }
.lc-nav b { font-size: 15px; color: var(--primary, #1E3A5F); padding: 0 8px; min-width: 110px; text-align: center; }
.lc-leg { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #475569; margin-inline-end: 10px; }
.lc-leg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-inline-start: 8px; }
.lc-tw { flex: 1; overflow: auto; min-height: 0; }
.lc-tbl { width: 100%; border-collapse: separate; border-spacing: 1px; table-layout: fixed; font-size: 11px; }
.lc-tbl th { background: var(--primary, #1E3A5F); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 0; height: 34px; position: sticky; top: 0; z-index: 1; line-height: 1.2; }
.lc-tbl th small { font-size: 9px; font-weight: 600; opacity: .85; }
.lc-tbl th.td { color: #FCA5A5; }
.lc-tbl th.nm, .lc-tbl td.nm { width: 170px; }
.lc-tbl td { height: 26px; }
.lc-tbl td.nm { background: #EFF6FF; color: var(--primary, #1E3A5F); font-weight: 700; text-align: center; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-tbl tr.cnt td { text-align: center; font-weight: 700; color: #94A3B8; background: #fff; }
.lc-tbl tr.cnt td.lbl { color: #64748B; background: #fff; }
.lc-tbl tr.cnt td.c2 { background: #FFEDD5; color: #9A3412; }
.lc-tbl tr.cnt td.c3 { background: #FEE2E2; color: #991B1B; }
/* سجل التدقيق — الإعدادات */
.au-pane { background: #F1F5F9; padding: 24px; gap: 8px; }
.au-r1 { display: flex; align-items: center; }
.au-title { font-size: 18px; font-weight: 800; color: var(--primary, #1E3A5F); }
.au-live { color: #22C55E; font-size: 12px; font-weight: 700; }
.au-r2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.au-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.au-chips button { height: 28px; padding: 0 12px; background: #fff; border: 1px solid #CBD5E1; border-radius: 12px; font: inherit; font-size: 11px; font-weight: 700; color: #475569; cursor: pointer; }
.au-chips button.on { background: #1E3A5F; color: #fff; border-color: #1E3A5F; }
.au-q { width: 350px; max-width: 100%; height: 28px; background: #fff; border: 1.5px solid #E2E8F0; border-radius: 9px; padding: 0 14px; font: inherit; font-size: 13px; color: #0F172A; }
.au-q:focus { outline: none; border-color: #3B82F6; background: #F0F7FF; }
.au-tw { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; }
.au-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.au-tbl th { position: sticky; top: 0; background: var(--primary, #1E3A5F); color: #fff; font-weight: 700; padding: 8px; white-space: nowrap; z-index: 1; }
.au-tbl td { padding: 6px; text-align: center; border-bottom: 1px solid #F1F5F9; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1E293B; }
.au-tbl tbody tr:hover td { background: #EFF6FF; }
.au-pg { display: flex; align-items: center; gap: 8px; background: #fff; padding: 6px 12px; border-radius: 10px; }
.au-pg button { height: 28px; padding: 0 12px; border: none; border-radius: 6px; background: var(--primary, #1E3A5F); color: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.au-pg button:disabled { background: #CBD5E1; cursor: default; }
.au-pg span#auInfo { font-size: 12px; color: #475569; }
@media (max-width: 760px) { .au-pane { padding: 12px; } }
/* إعدادات النسخ التلقائي */
.bk-row { display: flex; gap: 14px; align-items: flex-start; }
.bk-row .bk-list { flex: 1; min-width: 0; }
.bk-set { width: 310px; flex: 0 0 310px; background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; overflow: hidden; }
.bs-body { padding: 4px 18px 18px; display: flex; flex-direction: column; }
.bs-g { padding: 14px 0; border-bottom: 1px solid #E2E8F0; display: flex; flex-direction: column; gap: 10px; }
.bs-r { display: flex; align-items: center; font-size: 12px; color: #0F172A; }
.bs-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bs-tc { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.bs-tc small { font-size: 10px; color: #64748B; }
.bs-tc select { height: 28px; background: #fff; border: 1px solid #E2E8F0; border-radius: 7px; padding: 0 6px; font: inherit; font-size: 12px; font-weight: 700; color: #0F172A; }
.bs-hint { font-size: 11px; color: #64748B; line-height: 1.6; }
.bs-sw { position: relative; width: 40px; height: 22px; cursor: pointer; }
.bs-sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.bs-sw i { position: absolute; inset: 0; background: #CBD5E1; border-radius: 11px; transition: background .15s; }
.bs-sw i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: right .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.bs-sw input:checked + i { background: #16A34A; }
.bs-sw input:checked + i::after { right: 21px; }
.bs-stp { display: inline-flex; border: 1px solid #E2E8F0; border-radius: 9px; overflow: hidden; background: #fff; }
.bs-stp button { width: 28px; height: 30px; border: none; background: #F8FAFC; color: #64748B; font-size: 14px; font-weight: 700; cursor: pointer; }
.bs-stp button:hover { background: #E2E8F0; }
.bs-stp input { width: 56px; height: 30px; border: none; text-align: center; font: inherit; font-size: 12px; font-weight: 700; color: #0F172A; }
.bs-save { margin-top: 16px; height: 36px; }
@media (max-width: 900px) { .bk-row { flex-direction: column; } .bk-set { width: 100%; flex-basis: auto; } }
/* الشريط العلوي: طباعة/تصدير + تراجع/إعادة */
.mb-item.mb-ic { padding: 0 4px; height: 22px; display: flex; align-items: center; cursor: pointer; }
.mb-sep { height: 1px; background: #E2E8F0; margin: 4px 8px; }
.mb-icon:hover { background: rgba(30,58,95,0.12); }
.tb-dlg { width: 420px; background: #F8FAFC; }
.tb-dh { height: 56px; background: #1E3A5F; color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center; padding: 0 18px; }
.tb-db { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.tb-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.tb-card:hover, .tb-card.on { border: 2px solid #1E3A5F; padding: 11px 13px; }
.tb-card > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tb-card b { font-size: 14px; color: #1E293B; } .tb-card small { font-size: 11px; color: #64748B; }
.tb-card i { width: 22px; height: 22px; border-radius: 11px; border: 1.5px solid #CBD5E1; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; color: #fff; }
.tb-card.on i { background: #1E3A5F; border-color: #1E3A5F; }
.tb-card.dis { cursor: default; } .tb-card.dis b { color: #94A3B8; } .tb-card.dis small { color: #CBD5E1; } .tb-card.dis:hover { border: 1px solid #E2E8F0; padding: 12px 14px; }
.tb-df, .tb-pf { display: flex; gap: 10px; justify-content: flex-start; padding: 12px 18px 16px; border-top: 1px solid #E2E8F0; }
.tb-ok { height: 32px; padding: 0 24px; border: none; border-radius: 8px; background: #1E3A5F; color: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.tb-ok:hover { background: #16304f; }
.tb-no { height: 32px; padding: 0 24px; border: 1px solid #CBD5E1; border-radius: 8px; background: #fff; color: #64748B; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.tb-pv { width: min(1000px, 96vw); height: min(650px, 90vh); display: flex; flex-direction: column; background: #F8FAFC; padding: 16px 16px 0; gap: 10px; }
.tb-pi { font-size: 13px; color: #475569; font-weight: 700; }
.tb-pw { flex: 1; overflow: auto; background: #fff; border: 1px solid #E2E8F0; }
.tb-pt { border-collapse: collapse; font-size: 12px; width: max-content; min-width: 100%; }
.tb-pt thead th { position: sticky; top: 0; background: #1E3A5F; color: #fff; padding: 6px 10px; white-space: nowrap; z-index: 1; }
.tb-pt tbody th { background: #1E3A5F; color: #fff; padding: 4px 8px; min-width: 36px; }
.tb-pt td { border: 1px solid #E2E8F0; padding: 4px 10px; text-align: center; white-space: nowrap; }
.tb-pt tr.tot td { font-weight: 700; background: #F1F5F9; }
.tb-more { color: #64748B; padding: 10px !important; }
.tb-pf { border-top: none; padding: 4px 0 14px; }

/* ══ التقارير — مطابقة للبرنامج (W029) ══ */
.rp-body.rx-monthly { background: #0F1B2D; }
.rp-body.rx-spare { background: #E3E8EF; color: #0F172A; }
.rx-pr { display: flex; justify-content: flex-end; padding-bottom: 4px; }
.rx-print { background: #1D4ED8; color: #fff; border: none; border-radius: 7px; font: inherit; font-size: 11px; font-weight: 600; padding: 6px 16px; cursor: pointer; }
.rx-print:hover { background: #2563EB; }
.rx-row { display: flex; gap: 10px; }
.rx-row > * { flex: 1 1 0; min-width: 0; }
.rx-kpi { min-height: 110px; border: 1px solid; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.rx-kpi .t, .rx-kpi .s { font-size: 10px; color: #64748B; }
.rx-kpi .v { font-size: 32px; font-weight: 700; line-height: 1.25; direction: ltr; text-align: left; }
.rx-kpi.k28 { min-height: 100px; } .rx-kpi.k28 .v { font-size: 28px; }
.rx-kpi > i { display: block; height: 3px; border-radius: 2px; }
.rx-wk .t { font-size: 11px; } .rx-wk .v { font-size: 30px; text-align: right; direction: rtl; }
.rx-card { background: #0D1526; border: 1px solid #1E2D45; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.rx-card:hover { border-color: #2563EB; }
.rx-hd { display: flex; align-items: center; gap: 8px; }
.rx-hd b { font-size: 11px; font-weight: 700; color: #E2E8F0; }
.rx-hd .sp, .rx-leg .sp, .rx-wf .sp { flex: 1; }
.rx-hd .gold { font-size: 11px; font-weight: 700; color: #FCD34D; }
.rx-card .gold.s { font-size: 10px; color: #FCD34D; min-height: 14px; }
.rx-dd { background: #0D2051; color: #60A5FA; border: 1px solid #1D4ED8; border-radius: 6px; font: inherit; font-size: 9px; font-weight: 600; padding: 2px 8px; cursor: pointer; }
.rx-dd:hover { background: #1D4ED8; color: #fff; }
.rx-db { display: flex; align-items: center; gap: 10px; }
.rx-db .rx-leg { flex: 1; align-self: stretch; }
.rx-donut { flex-shrink: 0; overflow: visible; }
.rx-donut .sg { transition: filter .12s, transform .12s; transform-origin: 50% 50%; }
.rx-donut .sg:hover { filter: brightness(1.3); transform: scale(1.04); }
.rx-donut .t1 { fill: #E2E8F0; font-size: 17px; font-weight: 700; }
.rx-donut .t2 { fill: #64748B; font-size: 10px; }
.rx-leg { display: flex; flex-direction: column; gap: 3px; }
.rx-leg .lg { display: flex; align-items: center; gap: 4px; padding-bottom: 2px; }
.rx-leg .lg b { font-size: 12px; font-weight: 700; color: #E2E8F0; }
.rx-leg .lg small { font-size: 10px; color: #64748B; }
.rx-leg .lg .nm { font-size: 10px; color: #94A3B8; }
.rx-leg .lg i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rx-leg .lg:hover b { font-size: 14px; color: #fff; } .rx-leg .lg:hover small { font-size: 11px; color: #94A3B8; }
.rx-leg .lg:hover .nm { font-size: 11px; font-weight: 600; color: var(--c); } .rx-leg .lg:hover i { width: 10px; height: 10px; }
.rx-bars { display: flex; flex-direction: column; gap: 5px; }
.rx-bar { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.rx-bar b { width: 45px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: #E2E8F0; text-align: right; }
.rx-bar .tr { flex: 1; height: 8px; background: #0F1929; border-radius: 4px; direction: ltr; display: flex; transition: height .12s; }
.rx-bar .tr i { display: block; height: 100%; border-radius: 4px; }
.rx-bar .nm { width: 90px; flex-shrink: 0; font-size: 10px; color: #94A3B8; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.rx-bar:hover .tr { height: 12px; background: #1E2D45; border-radius: 6px; } .rx-bar:hover .tr i { border-radius: 6px; }
.rx-bar:hover b { font-size: 13px; color: #fff; } .rx-bar:hover .nm { font-size: 11px; color: #E2E8F0; }
.rx-tg { display: flex; gap: 4px; }
.rx-tg button { background: #080C14; color: #64748B; border: 1px solid #1E2D45; border-radius: 6px; font: inherit; font-size: 10px; padding: 4px 10px; cursor: pointer; }
.rx-tg button:hover { border-color: #475569; color: #E2E8F0; }
.rx-tg button.on { background: #1D4ED8; color: #fff; border-color: #1D4ED8; font-weight: 600; }
.rx-sc { max-height: 280px; overflow-y: auto; }
.rx-of { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rx-of span { font-size: 10px; color: #64748B; }
.rx-of select { min-height: 28px; background: #0D1526; color: #E2E8F0; border: 1px solid #1E2D45; border-radius: 6px; padding: 0 8px; font: inherit; font-size: 11px; min-width: 110px; }
.rx-of button { background: #1E293B; color: #94A3B8; border: 1px solid #334155; border-radius: 6px; font: inherit; font-size: 10px; padding: 3px 10px; cursor: pointer; }
.rx-of button:hover { background: #334155; color: #fff; }
.rx-of button.on { background: #1D4ED8; color: #fff; border-color: #1D4ED8; font-weight: 600; }
/* الضمان */
.rx-wf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rx-wf input { width: 260px; height: 28px; background: #0D1526; color: #E2E8F0; border: 1px solid #1E2D45; border-radius: 7px; padding: 0 8px; font: inherit; font-size: 11px; }
.rx-wf input:focus { outline: none; border-color: #3B82F6; }
.rx-wf b { font-size: 11px; color: #E2E8F0; }
.rx-wf select { height: 28px; min-width: 110px; background: #0D1526; color: #E2E8F0; border: 1px solid #1E2D45; border-radius: 7px; padding: 0 6px; font: inherit; font-size: 11px; }
.rx-inv { height: 28px; background: #3A1A0A; color: #FDBA74; border: 1px solid #7C2D12; border-radius: 7px; font: inherit; font-size: 11px; font-weight: 700; padding: 0 12px; cursor: pointer; }
.rx-inv:hover { border-color: #FF6600; } .rx-inv.on { background: #7C2D12; color: #fff; border-color: #FF6600; }
.rx-wt { background: #0D1526; border: 1px solid #1E2D45; border-radius: 10px; overflow: auto; max-height: 62vh; }
.rx-wt table { width: 100%; border-collapse: collapse; font-size: 12px; color: #E2E8F0; }
.rx-wt th { position: sticky; top: 0; background: #1E3A5F; color: #fff; font-size: 13px; font-weight: 700; padding: 10px; white-space: nowrap; }
.rx-wt td { padding: 8px 10px; text-align: center; border: 1px solid #1E2D45; white-space: nowrap; }
.rx-wt td.n { color: #94A3B8; }
.rx-wt tbody tr:hover td { background: #1D4ED822; }
.rx-wn { font-size: 12px; color: #64748B; text-align: left; }
/* المالي */
.rx-mt { min-height: 110px; border: 1px solid; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.rx-mt .t { font-size: 10px; color: #fff; }
.rx-mt .v { display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.rx-mt .v b { font-size: 28px; font-weight: 700; direction: ltr; } .rx-mt .v span { font-size: 14px; font-weight: 700; }
.rx-mt .x { font-size: 10px; color: #CBD5E1; text-align: center; }
.rx-mt .br { display: flex; align-items: center; gap: 6px; }
.rx-mt .br > span:first-child { width: 36px; font-size: 10px; font-weight: 700; }
.rx-mt .tr { flex: 1; height: 5px; background: rgba(255,255,255,.1); border-radius: 3px; direction: ltr; display: flex; }
.rx-mt .tr i { display: block; border-radius: 3px; }
.rx-mid .g1 { flex: 1 1 0; } .rx-mid .g2 { flex: 2 1 0; }
.rx-mc { background: #0D1B2A; border: 1px solid #1E3A5F; border-radius: 12px; padding: 10px 16px 14px; cursor: pointer; display: flex; flex-direction: column; }
.rx-mc:hover { border: 1.5px solid #3B82F6; }
.rx-mc .mt { font-size: 11px; font-weight: 700; color: #CBD5E1; }
.rx-gauge { width: 100%; max-width: 380px; height: 190px; align-self: center; }
.rx-gauge .ga:hover { stroke-width: 26; }
.rx-gauge .g1 { fill: #fff; font-size: 30px; font-weight: 700; } .rx-gauge .g2 { fill: #94A3B8; font-size: 11px; }
.rx-gl { display: flex; align-items: stretch; }
.rx-gl > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rx-gl .d { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #94A3B8; } .rx-gl .d i { font-style: normal; font-size: 11px; }
.rx-gl b { font-size: 12px; font-weight: 700; color: #fff; } .rx-gl small { font-size: 10px; }
.rx-gl .sep { width: 1px; background: #2A3D5F; }
.rx-di { display: flex; align-items: center; gap: 16px; flex: 1; margin-top: 16px; }
.rx-di .tv { flex: 1; display: flex; flex-direction: column; gap: 4px; align-self: stretch; justify-content: space-between; }
.rx-di .hr, .rx-di .dr { display: flex; align-items: center; padding: 3px 4px; }
.rx-di .c0 { width: 70px; flex-shrink: 0; text-align: center; } .rx-di .c1 { flex: 2; text-align: center; } .rx-di .c2 { flex: 3; } .rx-di .c3 { flex: 3; text-align: left; }
.rx-di .hr span { font-size: 11px; font-weight: 700; color: #fff; }
.rx-di .ln { display: block; height: 1px; background: #2A3D5F; }
.rx-di .dr { border-radius: 6px; }
.rx-di .dr:hover { background: rgba(59,130,246,.08); }
.rx-di .dr em { display: inline-flex; align-items: center; justify-content: center; width: 70px; height: 26px; border-radius: 13px; font-style: normal; font-size: 12px; font-weight: 700; }
.rx-di .dr .c1 { font-size: 12px; color: #CBD5E1; } .rx-di .dr:hover .c1 { font-size: 13px; font-weight: 700; color: #fff; }
.rx-di .dr .c3 { font-size: 12px; } .rx-di .dr:hover .c3 { font-size: 13px; font-weight: 700; }
.rx-di .hb { display: flex; height: 7px; background: #2A3D5F; border-radius: 4px; direction: ltr; transition: height .12s; } .rx-di .hb i { display: block; border-radius: 4px; }
.rx-di .dr:hover .hb { height: 12px; border-radius: 6px; }
.rx-di .tt { display: flex; justify-content: space-between; font-size: 11px; color: #fff; } .rx-di .tt b { font-weight: 700; }
.rx-md .ms { transition: transform .12s; transform-origin: 50% 50%; } .rx-md .ms:hover { transform: scale(1.06); }
.rx-md .m1 { fill: #fff; font-size: 17px; font-weight: 700; } .rx-md .m2 { fill: #94A3B8; font-size: 10px; }
.rx-band { min-height: 210px; padding: 14px; gap: 6px; }
.rx-band .bh { display: flex; align-items: center; justify-content: center; gap: 6px; color: #fff; }
.rx-band .bh b { font-size: 11px; font-weight: 700; color: #CBD5E1; } .rx-band .bh span { color: #64748B; font-size: 18px; width: 30px; text-align: center; }
.rx-band .cap { font-size: 10px; color: #fff; }
.rx-band .tv { font-size: 16px; font-weight: 700; color: #60A5FA; text-align: center; }
.rx-band .tx { font-size: 10px; color: #94A3B8; text-align: center; }
.rx-band .bx { display: flex; gap: 6px; }
.rx-band .bx > div { flex: 1; border-radius: 7px; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rx-band .rm { background: #0D2218; color: #10B981; } .rx-band .sn { background: #2A1018; color: #EF4444; }
.rx-band .bx span { font-size: 10px; } .rx-band .bx b { font-size: 12px; font-weight: 700; }
.rx-band .pb { display: flex; align-items: center; gap: 6px; }
.rx-band .pb > span:first-child { width: 36px; font-size: 10px; font-weight: 700; color: #60A5FA; }
.rx-band .hb { flex: 1; display: flex; height: 7px; background: #253558; border-radius: 4px; direction: ltr; transition: height .12s; } .rx-band .hb i { display: block; background: #60A5FA; border-radius: 4px; }
.rx-band .pb:hover .hb { height: 12px; border-radius: 6px; }
.rx-ch { background: #0D1B2A; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 400px; }
.rx-ch .chh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rx-ch .chh b { font-size: 11px; font-weight: 700; color: #CBD5E1; }
.rx-ch .chh .sp { flex: 1; }
.rx-ch select { width: 70px; background: #1E3A5F; color: #CBD5E1; border: 1px solid #334155; border-radius: 6px; padding: 3px 8px; font: inherit; font-size: 11px; }
.rx-ch .chh button { border-radius: 6px; font: inherit; font-size: 10px; font-weight: 700; padding: 3px 10px; border: 1px solid var(--c); background: transparent; color: var(--c); cursor: pointer; }
.rx-ch .chh button.on { background: var(--cb); border-color: var(--cbr); }
.rx-ch .sum { display: flex; gap: 8px; }
.rx-ch .sum > div { flex: 1; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rx-ch .sum span { font-size: 10px; color: #94A3B8; } .rx-ch .sum b { font-size: 13px; font-weight: 700; }
.rx-ch .cw { min-height: 260px; }
.rx-ch .ax { fill: #475569; font-size: 9px; } .rx-ch .mx { fill: #64748B; font-size: 9px; } .rx-ch .bv { font-size: 9px; font-weight: 700; }
.rx-ch .cb:hover { filter: brightness(1.3); }
@media (max-width: 900px) { .rx-row { flex-wrap: wrap; } .rx-row > * { flex-basis: 100%; } .rx-db { flex-direction: column; } .rx-di { flex-direction: column; } }
/* ══ تعاميد قطع الغيار — الثيم الفاتح (spare_parts_report_tab) ══ */
.rx-spare { --acc: #1E3A5F; --bd: #E5E9F0; --tp: #0F172A; --ts: #64748B; --tm: #475569; --tr: #EEF1F6; --hb: #E8EEF7; --zb: #F7F9FC; }
.sp-pr { display: flex; justify-content: flex-end; }
.sp-print { background: var(--acc); color: #fff; border: none; border-radius: 7px; font: inherit; font-size: 11px; font-weight: 600; padding: 6px 16px; cursor: pointer; }
.sp-print:hover { background: #2D5382; }
.sp-band { background: #fff; border: 1px solid var(--bd); border-top: 3px solid var(--acc); border-radius: 10px; padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 10px rgba(15,23,42,.11); }
.sp-band .top { display: flex; align-items: center; gap: 12px; }
.sp-band .bn { font-size: 13px; font-weight: 700; color: var(--acc); margin-left: 12px; }
.sp-band .bc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sp-band .bc:last-child { flex: 0 0 auto; padding: 0 10px 0 6px; }
.sp-band .bt { font-size: 12px; color: var(--tm); }
.sp-band .bc b { font-size: 16px; font-weight: 700; color: var(--tp); }
.sp-band .bc b small { font-size: 11px; font-weight: 600; } .sp-band .bc b small.na { font-size: 12px; font-weight: 400; color: var(--ts); }
.sp-band .bs { font-size: 11px; color: var(--ts); min-height: 14px; }
.sp-band .vs { width: 1px; align-self: stretch; background: var(--bd); }
.sp-band .kb { height: 8px; background: var(--tr); border-radius: 4px; display: flex; justify-content: flex-start; overflow: hidden; }
.sp-band .kb i { display: block; border-radius: 4px; }
.sp-kp { display: flex; flex-direction: column; box-shadow: 0 1px 10px rgba(15,23,42,.11); border-radius: 12px; }
.sp-per { position: sticky; top: 0; z-index: 5; background: var(--acc); border-radius: 12px 12px 0 0; display: flex; align-items: center; gap: 6px; padding: 8px 12px; flex-wrap: wrap; }
.sp-per b { font-size: 11px; font-weight: 700; color: #fff; }
.sp-per button { height: 28px; background: transparent; color: #CBD5E1; border: 1px solid #3E5F86; border-radius: 7px; font: inherit; font-size: 11px; font-weight: 700; padding: 0 12px; cursor: pointer; }
.sp-per button:hover { color: #fff; border-color: #7C95B5; }
.sp-per button.on { background: #fff; color: var(--acc); border-color: #fff; }
.sp-per .gap { width: 10px; }
.sp-per input { height: 28px; width: 110px; background: #2C4B73; border: 1px solid #3E5F86; border-radius: 7px; color: #fff; font: inherit; font-size: 11px; padding: 2px 8px; direction: ltr; cursor: pointer; }
.sp-per input:focus { outline: none; border-color: #7C95B5; }
.sp-rings { background: #fff; border: 1px solid var(--bd); border-top: none; border-radius: 0 0 12px 12px; display: flex; padding: 10px; }
.sp-rings .sep { width: 1px; background: var(--tr); flex-shrink: 0; }
.sp-tile { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 12px; cursor: pointer; }
.sp-tile:hover { background: #F8FAFC; }
.sp-tile.hot { background: #FFF5F5; } .sp-tile.hot .tt { color: #B91C1C; }
.sp-tile .tt { font-size: 12px; font-weight: 700; color: var(--tm); text-align: center; }
.sp-tile .ts { font-size: 11px; color: var(--ts); text-align: center; min-height: 14px; }
.sp-tile .tx { display: flex; justify-content: center; width: 100%; }
.sp-tile .ol { font-size: 11px; color: var(--tm); text-align: center; }
.sp-pill { height: 22px; line-height: 22px; border-radius: 11px; font-size: 11px; font-weight: 700; padding: 0 12px; white-space: nowrap; }
.sp-pill.em { visibility: hidden; }
.sp-row { display: flex; gap: 10px; align-items: stretch; }
.sp-row > * { flex: 1 1 0; min-width: 0; }
.sp-card { background: #fff; border: 1px solid var(--bd); border-radius: 12px; display: flex; flex-direction: column; box-shadow: 0 1px 10px rgba(15,23,42,.11); }
.sp-ch { height: 40px; background: var(--acc); border-radius: 11px 11px 0 0; display: flex; align-items: center; gap: 8px; padding: 0 16px; flex-shrink: 0; }
.sp-ch b { font-size: 13px; font-weight: 700; color: #fff; }
.sp-ch .sp { flex: 1; }
.sp-note { font-size: 10px; color: #B8C7DB; }
.sp-ht { display: inline-flex; }
.sp-ht button { height: 26px; background: transparent; color: #CBD5E1; border: 1px solid #3E5F86; font: inherit; font-size: 11px; font-weight: 700; padding: 0 12px; cursor: pointer; }
.sp-ht button:first-child { border-radius: 0 7px 7px 0; } .sp-ht button:last-child { border-radius: 7px 0 0 7px; }
.sp-ht button:hover { color: #fff; border-color: #7C95B5; }
.sp-ht button.on { background: #fff; color: var(--acc); border-color: #fff; }
.sp-cb { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.sp-head { display: grid; grid-template-columns: var(--g); background: var(--hb); border-radius: 6px; padding: 6px 8px; }
.sp-head span { font-size: 11px; font-weight: 700; color: var(--acc); text-align: center; cursor: pointer; }
.sp-head span.r { text-align: right; } .sp-head em { font-style: normal; font-size: 9px; }
.sp-ln { display: block; height: 1px; background: var(--bd); } .sp-ln.m { margin: 4px 0; }
.sp-none { font-size: 11px; color: var(--ts); }
.sp-st { display: flex; align-items: center; gap: 24px; }
.sp-st .tb { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sp-sd { flex-shrink: 0; cursor: pointer; } .sp-sd .ds:hover { stroke-width: 24; } .sp-sd .dc { cursor: pointer; }
.sp-srow { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; align-items: center; padding: 2px 0; cursor: pointer; }
.sp-srow span { text-align: center; font-size: 12px; }
.sp-srow .nm { display: flex; align-items: center; gap: 8px; text-align: right; color: var(--tp); }
.sp-srow .nm i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.sp-srow .n { font-weight: 700; color: var(--tp); } .sp-srow .p { font-weight: 700; color: var(--tc); } .sp-srow .v { color: var(--tm); }
.sp-srow:hover .nm { font-size: 13px; font-weight: 700; color: var(--tc); } .sp-srow:hover .nm i { width: 10px; height: 10px; }
.sp-srow:hover .n { font-size: 16px; } .sp-srow:hover .p, .sp-srow:hover .v { font-size: 13px; font-weight: 700; } .sp-srow:hover .v { color: var(--tp); }
.ptc .sp-cb { overflow: hidden; }
.sp-psc { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; max-height: 210px; }
.sp-prow { display: grid; grid-template-columns: 5fr 2fr 2fr 3fr; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.sp-prow.z { background: var(--zb); } .sp-prow:hover { background: #EEF3FA; }
.sp-prow span { font-size: 12px; text-align: center; color: var(--tm); } .sp-prow span.r { text-align: right; } .sp-prow span.b { font-weight: 700; color: var(--tp); }
.sp-prow:hover span { color: var(--tp); }
.sp-drow { display: grid; grid-template-columns: 3fr 2fr 2fr 2fr 2fr 3fr; padding: 6px 8px; border-bottom: 1px solid #F1F4F8; }
.sp-drow.z { background: var(--zb); } .sp-drow.hi { background: #FEF2F2; }
.sp-drow span { font-size: 12px; text-align: center; color: var(--tp); } .sp-drow span.r { text-align: right; }
.sp-drow.tot { background: var(--acc); border-radius: 6px; border: none; } .sp-drow.tot span { color: #fff; font-weight: 700; }
.sp-gws { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-gws button { height: 26px; background: #F1F5F9; color: var(--tm); border: 1px solid var(--bd); border-radius: 8px; font: inherit; font-size: 11px; font-weight: 700; padding: 0 10px; cursor: pointer; }
.sp-gws button:hover { border-color: #94A3B8; color: var(--tp); }
.sp-gws button.on { background: var(--acc); color: #fff; border-color: var(--acc); }
.sp-gh { display: flex; align-items: center; }
.sp-gh b { font-size: 13px; font-weight: 700; color: var(--tp); cursor: pointer; flex: 1; } .sp-gh b:hover { color: #2563EB; }
.sp-gh span { font-size: 11px; color: var(--ts); }
.sp-stk { display: flex; align-items: center; gap: 10px; padding: 1px 0; }
.sp-stk .l { width: 64px; flex-shrink: 0; font-size: 11px; color: var(--tm); text-align: right; }
.sp-stk .bar { flex: 1; height: 18px; display: flex; align-items: center; justify-content: flex-start; }
.sp-stk .fill { display: flex; height: 12px; border-radius: 4px; overflow: hidden; transition: height .1s; }
.sp-stk .fill i { display: block; height: 100%; cursor: pointer; }
.sp-stk .t { width: 130px; flex-shrink: 0; font-size: 11px; color: var(--ts); text-align: left; }
.sp-stk:hover .l, .sp-stk:hover .t { font-size: 12px; font-weight: 700; color: var(--tp); } .sp-stk:hover .fill { height: 16px; }
.sp-leg { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--tm); } .sp-leg i { font-style: normal; }
.sp-vsc { max-height: 300px; overflow-y: auto; }
.sp-vrow { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr; align-items: center; padding: 3px 8px; }
.sp-vrow.z { background: var(--zb); }
.sp-vrow span { font-size: 12px; text-align: center; color: var(--tm); } .sp-vrow span.r { text-align: right; } .sp-vrow span.b { font-weight: 700; color: var(--tp); }
.sp-vrow em { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 22px; border-radius: 11px; font-style: normal; font-size: 11px; font-weight: 700; }
.sp-vrow em.na { font-size: 12px; font-weight: 400; }
.sp-vrow:hover span { font-size: 14px; color: var(--tp); font-weight: 700; } .sp-vrow:hover em { width: 74px; height: 26px; border-radius: 13px; font-size: 12px; }
.sp-mc { min-height: 260px; }
.sp-mc .ax { fill: #64748B; font-size: 10px; } .sp-mc .bv { fill: #1E3A5F; font-size: 9px; font-weight: 700; }
@media (max-width: 900px) { .sp-row, .sp-band .top, .sp-st { flex-direction: column; } .sp-rings { flex-wrap: wrap; } .sp-rings .sep { display: none; } .sp-tile { flex-basis: 45%; } }

/* W031: رأس القائمة مثل البرنامج (سطرين بعرض كامل وتحت كل سطر خط) + أيقونات الشريط العلوي بحجم البرنامج */
.sb-head { justify-content: stretch; align-items: stretch; padding: 0 14px; }
.sb-head .sb-title { flex: 1; gap: 0; }
.sb-head .sb-app, .sb-head .sb-ver { flex: 1; display: flex; align-items: center; border-bottom: 1px solid #E2E8F0; }
.sb-head .sb-ver { border-bottom: none; }
.menubar .mb-icon svg, .menubar .mb-ic svg { width: 17px; height: 17px; }
.menubar .mb-icon { width: 24px; height: 22px; }

/* W032: هيدر البحث المتقدم بارتفاع البرنامج (36) + قابل للتحديد */
.s2-tbl thead th { height: 36px; padding: 0 8px; cursor: pointer; user-select: none; }
.s2-tbl thead th:hover { background: #2D5382; }

/* W033: وضع التضمين — نافذة الجهاز فوق صفحة ثانية (البحث المتقدم) */
html.embed, html.embed body { background: transparent !important; }
html.embed body * { visibility: hidden; }
html.embed .modal-back, html.embed .modal-back *, html.embed #calPop, html.embed #calPop *, html.embed .ctx-menu, html.embed .ctx-menu *, html.embed #toast, html.embed #toast * { visibility: visible; }
.dev-embed { position: fixed; inset: 0; width: 100%; height: 100%; border: none; z-index: 5000; background: transparent; }
/* البحث المتقدم: زاوية عمود الأرقام فاضية مثل البرنامج */
.s2-tbl thead th.rn { background: #fff; border: none; }
.s2-tbl thead th.rn:hover { background: #fff; }

/* W034: منع تظليل النص في جدول البحث المتقدم (مثل البرنامج) */
.s2-tbl tbody td { user-select: none; -webkit-user-select: none; }

/* W035: مستخلص مقاولي الباطن مثل البرنامج */
.sc-card { height: 68px; padding: 0 18px; gap: 12px; justify-content: space-between; box-shadow: 0 4px 18px rgba(0,0,0,.14); }
.sc-card > div { display: flex; flex-direction: column; gap: 3px; }
.sc-card b { font-size: 26px; font-weight: 700; line-height: 1.1; color: #fff; }
.sc-card span { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.85); opacity: 1; }
.sc-card i { width: 52px; height: 52px; border-radius: 18px; background: rgba(255,255,255,.18); font-size: 26px; flex-shrink: 0; }
.sc-tbl tr.flt input { text-align: center; }
.sc-tbl tr.flt input:not(:placeholder-shown) { text-align: right; }
.sc-tbl thead th.rn { position: sticky; right: 0; z-index: 4; background: #fff; border: none; }
.sc-tbl td.rn { position: sticky; right: 0; z-index: 1; }

/* W038: توسيع أعمدة المستخلص يدوياً + زاوية عمود الأرقام */
.sc-tbl tr:first-child th[data-c] { position: sticky; }
.sc-tbl th[data-c] .rs { position: absolute; top: 0; bottom: 0; left: -3px; width: 6px; cursor: col-resize; z-index: 3; }
.sc-tbl.fx td, .sc-tbl.fx th[data-c] { overflow: hidden; text-overflow: ellipsis; }
.sc-tbl.fx tr.flt input { min-width: 0; }
.sc-tbl thead th.rn { top: 0; vertical-align: top; }

/* W039: المستخلص — بدون تظليل نص + خانة الفلتر تفتح قائمة */
.sc-page .sc-tbl tbody td { user-select: none; }
.sc-page .sc-tbl tbody td input { user-select: text; }
.sc-tbl tr.flt input[readonly] { cursor: pointer; background: #F0F4F8; }
.sc-tbl tr.flt input.on { background: #FEF3C7; border: 1.5px solid #F59E0B; font-weight: 700; }
.sc-tbl tr.flt input.on::placeholder { color: #92400E; }
.sc-tbl.fx td.rn { text-overflow: clip; }

/* W040: نافذة تعديل الكل */
#scBk { z-index: 150; }
.sc-bk-sel { height: 38px; width: 100%; font-size: 13px; }

/* W041: ارتفاع صف العناوين مثل البرنامج */
.sc-tbl thead tr:first-child th { height: 38px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
.sc-tbl tr.flt th { height: 22px; padding: 0 2px 2px; box-sizing: border-box; }
.sc-tbl tr.flt input { height: 20px; font-size: 10px; background: #F0F4F8; border: 1px solid #CBD5E1; border-radius: 3px; color: #374151; padding: 0 2px; box-sizing: border-box; }
.spo-tbl thead th { height: 36px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }

/* W042: هيدر PPM مثل البرنامج — ارتفاع 35 + «#» جنب المربع + مربعات تحديد بحد أبيض */
.pp-tbl thead th { height: 35px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
.pp-tbl th .pp-hn { display: inline-flex; align-items: center; gap: 8px; }
.pp-tbl th.num input, .pp-tbl td.num input { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; flex: 0 0 12px; border: 1px solid #fff; border-radius: 3px; background: transparent; margin: 0; cursor: pointer; position: relative; vertical-align: middle; }
.pp-tbl th.num input:checked, .pp-tbl td.num input:checked { background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 6.2 5 8.6 9.6 3.4' fill='none' stroke='%231E3A5F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/12px no-repeat; }
.pp-tbl th.num input:indeterminate { background: #fff linear-gradient(#1E3A5F, #1E3A5F) center/6px 2px no-repeat; }

/* W043: الأجهزة المجدولة — «#» + مربع تحديد الكل في زاوية عمود الأرقام + مربع لكل صف (مثل PPM) */
.sc-tbl thead th.rn.chk { background: #1E3A5F; border-left: 1px solid #2D5382; vertical-align: middle; cursor: default; }
.sc-tbl th.rn .pp-hn { display: inline-flex; align-items: center; gap: 6px; }
.sc-tbl .rn-l { display: inline-flex; align-items: center; gap: 4px; }
.sc-tbl th.rn input, .sc-tbl td.rn input { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; flex: 0 0 12px; border: 1px solid #fff; border-radius: 3px; background: transparent; margin: 0; cursor: pointer; }
.sc-tbl th.rn input:checked, .sc-tbl td.rn input:checked { background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 6.2 5 8.6 9.6 3.4' fill='none' stroke='%231E3A5F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/12px no-repeat; }
.sc-tbl th.rn input:indeterminate { background: #fff linear-gradient(#1E3A5F, #1E3A5F) center/6px 2px no-repeat; }

/* W044: خط أرقام الصفوف في المستخلص مثل PPM */
.sc-tbl td.rn { font-size: 12px; font-weight: 700; }

/* W046: أزرار المستخلص الشهري أيقونات مع تلميحات */
.sc-ib { position: relative; width: 40px; height: 40px; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; background: rgba(30,58,95,.12); color: var(--primary); border: none; border-radius: 12px; cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,.08); padding: 0; }
.sc-ib:hover { background: rgba(30,58,95,.22); }
.sc-ib.red { background: #FEE2E2; color: #DC2626; }
.sc-ib.red:hover { background: #FECACA; }
.sc-ib[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1E293B; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 50; pointer-events: none; }

/* W047: بطاقات نافذة المستخلص المحفوظ + معاينة الطباعة فوق نافذة المسودات */
.sc-sv-cards { background: #F1F5F9; height: 104px; flex: 0 0 104px; align-items: center; padding: 0; box-sizing: border-box; }
#tbChoose, #tbPrev { z-index: 160; }

/* W048: مربعات المستخلص 36 + زر تكبير نافذة المستخلص المحفوظ */
.sc-ib { width: 36px; height: 36px; flex: 0 0 36px; }
.sc-ib svg { width: 18px; height: 18px; }
.win-btns { display: flex; align-items: center; height: 100%; }
.win-max { width: 46px; height: 32px; border: none; background: transparent; color: #374151; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.win-max:hover { background: #E5E7EB; }
#scSvBar { user-select: none; }
.sc-sv-win.max { position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none; border-radius: 0; border: none; }

/* W049: أعمدة الأسعار — فراغ بين اسم العمود و«غير شامل 15%» */
.th-title.has-sub { position: relative; top: -5px; }
.th-sub { top: 23px; }

/* W050: PPM — توسيع الأعمدة + تلوين الزر المختار بدل «انسجلت» */
.pp-tbl th { position: sticky; }
.pp-tbl th .pp-rs { position: absolute; top: 0; bottom: 0; left: -3px; width: 6px; cursor: col-resize; z-index: 2; }
.pp-acts .dim { opacity: .45; }
.pp-acts .dim:hover { opacity: .8; }
.pp-acts .pp-code.on { font-weight: 700; }

/* W052: خط فاصل بين أعمدة هيدر PPM مثل الأصول */
.pp-tbl thead th:not(:last-child) { border-left: 1px solid #2D5382; }

/* W054: أزرار المجموعة في شريط الشهر نفسه */
.pp-toolbar .pp-vs { width: 1px; height: 24px; background: #E2E8F0; flex: 0 0 1px; }
.pp-toolbar .pp-lbl { white-space: nowrap; }
.pp-toolbar .pp-chips { min-width: 0; padding-bottom: 0; align-items: center; }
.pp-toolbar .pp-left { white-space: nowrap; }

/* W055: عمود الأرقام في PPM ثابت عند التمرير الأفقي */
.pp-tbl th.num { position: sticky; right: 0; z-index: 3; }
.pp-tbl td.num { position: sticky; right: 0; z-index: 1; }

/* W056: وميض الخانات الناقصة مثل البرنامج — مربع برتقالي يظهر ويختفي بهدوء */
.spo-tbl td.miss { position: relative; animation: none; }
.spo-tbl td.miss::after { content: ""; position: absolute; inset: 3px; border-radius: 5px; background: #F59E0B; opacity: .08; pointer-events: none; animation: spoMiss 1.8s ease-in-out infinite; }
@keyframes spoMiss { 0%, 100% { opacity: .08; } 50% { opacity: .45; } }

/* W056: قائمة فرعية في التصدير */
.ctx-item.has-sub { display: flex; align-items: center; gap: 10px; }
.ctx-item.has-sub .ctx-arr { margin-right: auto; font-size: 10px; opacity: .7; }

/* W056: مرفقات طلب الإلغاء + عرضها في سجل الطلبات */
.req-att { display: flex; flex-direction: column; gap: 6px; }
.req-attb { height: 30px; background: transparent; color: #1D4ED8; border: 1.5px dashed #93C5FD; border-radius: 8px; font-size: 11px; font-weight: 700; padding: 0 12px; cursor: pointer; }
.req-attb:hover { background: #EFF6FF; }
.req-files { display: flex; flex-direction: column; gap: 4px; }
.req-file { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; padding: 4px 6px 4px 10px; }
.req-file .n { flex: 1; font-size: 12px; color: #1E293B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-file .s { font-size: 11px; color: #94A3B8; }
.req-file button { width: 22px; height: 22px; border: none; background: transparent; color: #DC2626; font-size: 16px; font-weight: 700; padding: 0; border-radius: 5px; cursor: pointer; }
.req-file button:hover { background: #FEE2E2; }
.req-hint { font-size: 11px; color: #94A3B8; }
.po-rqf { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.po-rqf a { background: #EFF6FF; color: #1D4ED8; border-radius: 6px; font-size: 11px; padding: 3px 10px; text-decoration: underline; }
.po-rqf a:hover { background: #DBEAFE; }

/* W056: شريط الحضور «متواجدون الآن» + مؤشر التعديل على الصف */
.pres-bar { height: 34px; display: inline-flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #E2E8F0; border-radius: 17px; padding: 0 6px 0 16px; flex-shrink: 0; }
.pres-bar .cap { font-size: 11px; color: #64748B; white-space: nowrap; }
.pres-bar .avs { display: inline-flex; direction: rtl; }
.pav { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; color: #fff; font-style: normal; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-left: -8px; cursor: default; text-transform: uppercase; }
.pav:first-child { margin-left: 0; }
.pav b { position: absolute; left: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #22C55E; border: 1.5px solid #fff; }
.pav.more { background: #E2E8F0; color: #475569; font-size: 10px; }
.spo-tbl tr.editing td { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--ec) 15%, transparent); }
.spo-tbl tr.editing td.rn { box-shadow: inset 4px 0 0 #fff; }
.spo-tbl td.rn .ed-av { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #fff; color: #fff; font-style: normal; font-size: 9px; font-weight: 700; align-items: center; justify-content: center; margin-right: 4px; vertical-align: middle; text-transform: uppercase; }
.cc-msg { font-size: 13px; color: #334155; line-height: 1.7; }
.cc-note { font-size: 12px; color: #64748B; }
#ccModal { z-index: 160; }

/* W057: جرس الطلبات في الشريط العلوي + نافذة طلبات التعاميد */
.hd-bell { position: relative; width: 34px; height: 34px; flex: 0 0 34px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; cursor: pointer; padding: 0; margin-left: 14px; }
.hd-bell:hover { background: #F1F5F9; }
.hd-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; border-radius: 8px; background: #DC2626; color: #fff; font-size: 10px; font-weight: 700; font-style: normal; text-align: center; box-sizing: border-box; }
.bl-menu { z-index: 140; min-width: 220px; border-radius: 10px; padding: 6px; }
.bl-menu .ctx-item { font-size: 12px; font-weight: 700; padding: 9px 18px; border-radius: 7px; }
.bl-menu .ctx-item:hover { background: #F1F5F9; color: #1E293B; }
#porM, #rqM { z-index: 135; }
#bxM { z-index: 170; }
.por-dlg { width: min(640px, 96vw); height: min(560px, 92vh); display: flex; flex-direction: column; }
.por-q { width: 170px; height: 30px; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; padding: 0 10px; font-size: 12px; color: #1E293B; outline: none; font-family: inherit; }
.por-q:focus { border-color: #1E3A5F; }
.por-c .pill { border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.por-po { cursor: pointer; font-size: 12px; }
.por-po:hover { color: #2563EB; text-decoration: underline; }
.por-m { font-size: 11px; color: #64748B; }
.por-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; color: #64748B; }
.por-f a { background: #EFF6FF; color: #1D4ED8; border-radius: 6px; padding: 3px 10px; text-decoration: underline; }
.por-f a:hover { background: #DBEAFE; }
.por-w { font-size: 11px; color: #92400E; }
.por-w.r { color: #991B1B; }
.por-b { display: flex; gap: 8px; margin-top: 4px; }
.por-b button { height: 32px; border: none; border-radius: 8px; font-size: 11px; font-weight: 700; padding: 0 18px; cursor: pointer; }
.por-b .ok { background: #16A34A; color: #fff; } .por-b .ok:hover { background: #15803D; }
.por-b .ok:disabled { background: #CBD5E1; cursor: default; }
.por-b .no { background: #F1F5F9; color: #374151; } .por-b .no:hover { background: #E2E8F0; }
@media (max-width: 760px) { .hd-bell { margin-left: 6px; } }

/* W059: البحث المتقدم في التعاميد مثل البرنامج */
.adv-dlg .adv-body { padding: 16px 20px; gap: 4px; }
.adv-dlg .adv-body label { margin-top: 6px; }
.adv-dlg .adv-body input, .adv-dlg .adv-body select { height: 32px; }
.adv-lr { display: flex; align-items: flex-end; }
.adv-lr label { margin-top: 0 !important; }
.adv-x { width: 22px; height: 22px; padding: 0; background: #FEE2E2; border: 1.5px solid #FECACA; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.adv-x:hover { background: #FECACA; border-color: #FCA5A5; }
.adv-g { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 4px; margin-top: 6px; }
.adv-g label { margin-top: 2px !important; }
.adv-d { height: 32px; font-size: 12px; }
.adv-d.empty .t::before { content: "yyyy-MM-dd"; color: #94A3B8; }
.adv-foot { display: flex; gap: 8px; padding: 10px 16px; background: #F1F5F9; border-top: 1px solid #E2E8F0; }
.adv-foot button { height: 32px; border: none; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.adv-ok { background: var(--primary); color: #fff; padding: 0 24px; flex: 1; }
.adv-no { background: #E2E8F0; color: #475569; padding: 0 16px; flex: 1; }
.adv-no:hover { background: #CBD5E1; }

/* W060: توسيع أعمدة التعاميد يدوياً */
.spo-tbl th { position: sticky; }
.spo-tbl th .spo-rs { position: absolute; top: 0; bottom: 0; right: 0; width: 6px; cursor: col-resize; z-index: 3; }
.spo-tbl.fx td, .spo-tbl.fx th { overflow: hidden; text-overflow: ellipsis; }

/* W061: صفحة الإجازات — تحديد جماعي · حاسبة الرصيد · ترحيل يوم تعويض */
.lv-selbar { display: flex; align-items: center; gap: 8px; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 8px; padding: 4px 10px; margin-bottom: 6px; }
.lv-selbar span#lvSelT { color: #1E3A5F; font-size: 12px; font-weight: 700; }
.lv-selbar button { height: 28px; border-radius: 8px; font-size: 12px; font-weight: 700; padding: 0 12px; cursor: pointer; }
.lv-selbar .c { background: #fff; color: #1E3A5F; border: 1px solid #CBD5E1; }
.lv-selbar .d { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.lv-selbar .d:hover { background: #FECACA; }
.lv-ck { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lv-ck input { margin: 0; accent-color: #1E3A5F; cursor: pointer; }
.lv-calc { position: fixed; z-index: 140; background: #fff; border: 1px solid #CBD5E1; border-radius: 10px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); width: 280px; }
.lv-calc .res { background: #EFF6FF; border-radius: 8px; padding: 8px; text-align: center; margin-top: 6px; }
.lv-calc .t1, .lv-calc .t3 { font-size: 11px; color: #64748B; }
.lv-calc .t2 { font-size: 20px; font-weight: 700; color: #1E3A5F; }
.lv-cd tbody tr[data-seq] { cursor: pointer; }
.lv-cd tbody tr.sel td { background: #DBEAFE !important; }
.lv-exb { display: flex; justify-content: flex-start; margin-top: 8px; }
.lv-exb .lv-btn { height: 30px; background: #fff; color: #1E3A5F; border: 1px solid #CBD5E1; border-radius: 8px; font-size: 12px; font-weight: 700; padding: 0 14px; cursor: pointer; }
.lv-exb .lv-btn:hover { background: #F1F5F9; }
.ex-t { font-size: 13px; font-weight: 700; color: #14263D; }
.ex-g { margin-top: 10px; }
.ex-n { display: flex; align-items: center; gap: 6px; } .ex-n input { width: 100px; }
.ex-new { font-size: 12px; color: #1E3A5F; font-weight: 700; margin-top: 8px; }
.bd-msg { font-size: 13px; color: #1E293B; white-space: pre-line; line-height: 1.6; }
.bd-in { margin-top: 8px; width: 100%; }
.bd-ok:not(:disabled) { background: #DC2626 !important; }
.bd-ok:disabled { opacity: .5; cursor: default; }

/* W062: معاينة كشف الرصيد وكشف الفترة */
.lv-pv { width: min(940px, 96vw); height: min(820px, 94vh); display: flex; flex-direction: column; background: #F8FAFC; }
.lv-pv.max { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }
.lv-pv .dlg-head { display: flex; align-items: center; }
.pv-max { margin-right: auto; background: transparent; border: none; color: #fff; font-size: 16px; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; }
.pv-max:hover { background: rgba(255,255,255,.15); }
.pv-info { font-size: 13px; font-weight: 700; color: #475569; padding: 10px 20px 0; }
.pv-ctl { margin: 12px 20px 0; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 12px 16px; }
.pr-g { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; }
.pr-g > label { font-size: 12px; font-weight: 700; color: #334155; }
.pr-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-seg { display: inline-flex; gap: 6px; }
.pr-seg button { height: 32px; padding: 0 16px; border: 1.5px solid #CBD5E1; border-radius: 8px; background: #fff; color: #334155; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.pr-seg button:hover { background: #F1F5F9; }
.pr-seg button.on { background: #1E3A5F; border-color: #1E3A5F; color: #fff; }
.pr-r .lv-cb { height: 38px; min-width: 100px; }
.pr-r .pr-e { min-width: 240px; }
#prM { width: 130px; } #prY { width: 100px; }
.pr-h { font-size: 12px; color: #64748B; }
.pr-h.bad { color: #DC2626; }
.pr-d { height: 38px; width: 160px; border: 1px solid #CBD5E1; border-radius: 8px; background: #fff; font: inherit; font-size: 13px; color: #1E293B; cursor: pointer; direction: ltr; }
.pr-cards { display: flex; gap: 8px; padding: 10px 20px 0; flex-wrap: wrap; }
.pr-cards > div { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 6px 12px; display: flex; flex-direction: column; }
.pr-cards span { font-size: 11px; color: #64748B; } .pr-cards b { font-size: 17px; color: #1E293B; }
.pv-wrap { flex: 1; min-height: 0; margin: 10px 20px; background: #E2E8F0; border-radius: 10px; overflow: auto; padding: 20px; display: flex; justify-content: center; }
.pv-page { width: 210mm; flex: none; border: 1px solid #CBD5E1; background: #fff; height: 297mm; }
.pv-ft { display: flex; gap: 10px; padding: 0 20px 14px; }
.pv-ft button { height: 32px; padding: 0 24px; }
.pv-ft button { border-radius: 8px; font-size: 11px; font-weight: 700; border: 1px solid #CBD5E1; background: #fff; color: #64748B; cursor: pointer; }
.pv-ft button:hover { background: #F1F5F9; }
.pv-ft button.m-ok { background: #1E3A5F; color: #fff; border: none; }
.pv-ft button.m-ok:hover { background: #16304f; }
.pv-ft button:disabled { opacity: .5; cursor: default; }

/* W063: السجل الكامل — مطابق للبرنامج */
.lv-full { width: min(980px, 96vw); height: min(600px, 92vh); }
.lv-exb { justify-content: flex-end; gap: 8px; }
.lv-sel tbody tr[data-rid] { cursor: pointer; }
.lv-sel tbody tr.sel td { background: #DBEAFE !important; }
.pm-strip { display: flex; align-items: center; gap: 6px; background: #EFF6FF; border-radius: 8px; padding: 4px 10px; margin-bottom: 6px; }
.pm-strip > b { font-size: 13px; color: #1E3A5F; }
.pm-a { width: 26px; height: 26px; padding: 0; background: #fff; color: #1E3A5F; border: 1px solid #CBD5E1; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; }
.pm-a:hover { background: #EFF6FF; } .pm-a:disabled { color: #CBD5E1; cursor: default; background: #fff; }
.pm-t { font-size: 12px; font-weight: 700; color: #334155; margin-right: 8px; }
.pm-tot { font-size: 12px; color: #64748B; }
.pm-row { display: flex; gap: 6px; margin-bottom: 6px; }
.pm-chip { flex: 1 1 0; min-width: 58px; height: 58px; box-sizing: border-box; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px; padding: 4px 6px 5px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; }
.pm-chip:hover { background: #EFF6FF; }
.pm-chip.on { border: 2px solid #1E3A5F; padding: 3px 5px 4px; }
.pm-chip.fut { background: #fff; border: 1px dashed #E2E8F0; cursor: default; }
.pm-chip span { font-size: 10px; color: #64748B; } .pm-chip.fut span { color: #CBD5E1; }
.pm-chip b { font-size: 14px; }
.pm-chip i { display: block; width: 100%; height: 4px; background: #E2E8F0; border-radius: 2px; margin-top: auto; overflow: hidden; }
.pm-chip i em { display: block; height: 100%; border-radius: 2px; margin-right: 0; }

/* W064: جدول الأرصدة — نفس مقاسات البرنامج (هيدر 36 · صف 40 · كل شي بالوسط · عمود # كحلي) */
#lvTw .lv-tbl th { height: 36px; box-sizing: border-box; padding: 0 6px; font-size: 11px; vertical-align: middle; }
#lvTw .lv-tbl td { height: 40px; box-sizing: border-box; padding: 0 8px; font-size: 12px; text-align: center; vertical-align: middle; line-height: 1.25; }
#lvTw .lv-tbl td.nm { text-align: center; position: relative; padding: 0 22px; }
#lvTw .lv-tbl td.nm .dot { position: absolute; right: 8px; top: 50%; margin: -4px 0 0; }
#lvTw .lv-tbl td.bal b { display: block; font-size: 13px; font-weight: 700; }
#lvTw .lv-tbl td.bal small { display: block; font-size: 10px; color: #64748B; }
#lvTw .lv-tbl td.prm span { font-size: 12px; }
#lvTw .lv-tbl td.prm.on b { display: block; font-size: 13px; }
#lvTw .lv-tbl td.prm.on small { display: block; font-size: 10px; }
#lvTw .lv-tbl .rn, #lvTw .lv-tbl tbody tr td.rn, #lvTw .lv-tbl tbody tr.sel td.rn, #lvTw .lv-tbl tbody tr:nth-child(even) td.rn { background: #1E3A5F !important; color: #fff; font-weight: 700; font-size: 12px; border-bottom: 1px solid #2D5382; width: 44px; min-width: 44px; max-width: 44px; padding: 0; }
#lvTw .lv-tbl th.rn { border-bottom: 2px solid #2D5382; }
#lvTw .lv-tbl .rn.ck { width: 56px; min-width: 56px; max-width: 56px; }
#lvTw .lv-tbl .rn .lv-ck { display: flex; width: 100%; height: 100%; align-items: center; gap: 0; padding: 0 8px 0 2px; box-sizing: border-box; }
#lvTw .lv-tbl .rn .lv-ck span { flex: 1; text-align: center; }
#lvTw .lv-tbl .rn .lv-ck input { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin: 0; border: 1px solid #fff; border-radius: 3px; background: transparent; position: relative; flex: none; }
#lvTw .lv-tbl .rn .lv-ck input:checked { background: #fff; }
#lvTw .lv-tbl .rn .lv-ck input:checked::after { content: ""; position: absolute; left: 3.5px; top: 0.5px; width: 3px; height: 7px; border: solid #1E3A5F; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
