/* ui-pro.css — تحسينات القراءة وتجربة الاستخدام فوق الثيم القائم.
   يُحمَّل بعد كل الأنماط، ولا يغيّر الألوان ولا الهوية: يرتّب الكثافة والمحاذاة فقط.
   حذفُ هذا الملف (وسطر <link> إليه) يُرجع الواجهة كما كانت. */

/* ===== ١) السجل التفصيلي: صفٌّ حقيقي لكل إجراء =====
   خانات التقرير (التحديد · الرقم · رقم التقرير · الاستمارة) تمتدّ على صفوف
   إجراءاته، وكل إجراء صفّه: فتلتفّ الملاحظة كاملةً ويتّسع الصفّ معها بلا
   اختلال في المحاذاة. والخانات القصيرة لا تلتفّ. */
.scroll:has(> table > #log){max-height:calc(100vh - 260px);min-height:420px}
#log td{padding-block:9px;vertical-align:top}
#log td.who, #log td.when, #log td.rid, #log td.num{white-space:nowrap}
#log td.num{width:36px}
#log td.form-cell{min-width:120px;max-width:170px;line-height:1.6}
/* حدود التقرير واضحة، وحدود إجراءاته داخله منقّطة هادئة */
#log tr.g-first > td{border-top:1px solid var(--line-strong, var(--line))}
#log tr.g-cont > td{border-top:1px dashed var(--line)}
#log tr.g-cont > td.who, #log tr.g-cont > td.acts-cell, #log tr.g-cont > td.when, #log tr.g-cont > td.note{padding-top:8px}
#log .act-line{display:flex;align-items:center;gap:6px;min-height:22px}
/* التفاصيل: السبب والمقاول والملاحظة كاملةً — تلتفّ ولا تُقصّ */
#log td.note{min-width:220px;max-width:420px;white-space:normal;line-height:1.75}
#log .dt-l + .dt-l{margin-top:4px}
#log .dt-note{color:var(--ink, inherit);word-break:break-word}
#log .dt-none{color:var(--muted)}
#log .dt-k{display:inline-block;font-size:10.5px;padding:0 6px;margin-inline-end:6px;border-radius:5px;
  line-height:18px;color:var(--muted);background:var(--surface-3, rgba(255,255,255,.06))}
/* تمييز التقرير المحدَّد بكل صفوفه */
#log tr.picked > td{background:color-mix(in srgb, var(--gold, #C9A86A) 9%, transparent)}
#log [data-more]{min-width:240px}

/* رؤوس الجداول ثابتة عند التمرير داخل الحاوية: نضمن أنها فوق الصفوف */
.scroll thead th{z-index:2}

/* ===== ٢) الأرقام: أرقام جدولية متساوية العرض فتصطفّ الأعمدة ===== */
table td{font-variant-numeric:tabular-nums}

/* ===== ٣) التركيز بلوحة المفاتيح: حلقة واضحة على كل عنصر تفاعلي ===== */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
[tabindex]:focus-visible{
  outline:2px solid var(--gold, #C9A86A);outline-offset:2px;border-radius:8px
}

/* ===== ٤) الجوال: الجداول تتمرّر أفقيًا داخل بطاقتها والصفحة لا تتحرّك ===== */
@media (max-width: 760px){
  .scroll:has(> table > #log){max-height:none;min-height:0}
  #log td.note{min-width:200px}
}

/* ===== ٥) احترام تقليل الحركة ===== */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{animation-duration:.01ms !important;transition-duration:.01ms !important}
}

/* ===== ٦) السجل: المراقب تحت الاستمارة، واسم الإجراء الطويل يُقصّ ويُقرأ كاملًا عند الوقوف ===== */
#log td.form-cell .insp{margin-top:4px;font-size:11.5px;color:var(--muted);white-space:nowrap;direction:ltr;text-align:right}
#log .acts-cell{min-width:0}
#log .alab{min-width:0;display:flex;align-items:center;gap:6px;flex:1}
#log .alab-t{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ═══════════════ ٧) لمسات احترافية — بألوان الثيم نفسها ═══════════════
   لا لون جديد هنا: كل قيمة من متغيّرات الثيم (--gold, --line, --ink-3 …)
   فتعمل في الوضعين الليلي والنهاري كما هما. */

/* رأس الصفحة ثابت أعلى الشاشة: الفلاتر والتصدير في متناول اليد مهما طال التمرير */
.head{position:sticky;top:0;z-index:30;background:var(--head-bg);
  -webkit-backdrop-filter:saturate(1.2) blur(10px);backdrop-filter:saturate(1.2) blur(10px)}
.head h2{letter-spacing:-.01em}

/* البطاقات: حدّ يضيء قليلًا تحت المؤشّر، وانتقال هادئ */
.card{transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease}
.card:hover{border-color:var(--gold-line)}

/* بطاقات المؤشّرات: الرقم هو البطل — أثقل وأوضح، والعنوان فوقه هادئ */
.tile{position:relative;overflow:hidden}
.tile .k{color:var(--ink-3);font-size:12.5px;letter-spacing:.01em}
.tile .v{font-weight:600;letter-spacing:-.02em;line-height:1.1;margin:10px 0 6px}
.tile .d{color:var(--ink-3)}
.tile:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}
/* خيطٌ ذهبي رفيع أعلى البطاقة يظهر عند المرور — نفس لغة .card h3::after */
.tile::after{content:"";position:absolute;inset-inline:22px;top:0;height:2px;border-radius:0 0 2px 2px;
  background:linear-gradient(90deg,transparent,var(--gold),transparent);opacity:0;transition:opacity .2s ease}
.tile:hover::after{opacity:.7}

/* التنبيهات: أيقونة في دائرة، ونصّ بمسافة سطر مريحة */
.alert{align-items:flex-start}
.alert .ic{flex:0 0 34px;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;
  background:var(--gold-tint);border:1px solid var(--gold-line);font-size:15px}
.alert p{line-height:1.85;margin-top:4px}

/* الجداول: رأس مميَّز، وفواصل أهدأ، وصفّ يُضاء تحت المؤشّر */
thead th{background:var(--thead-bg);font-weight:600;letter-spacing:.01em}
tbody tr{transition:background-color .15s ease}
tbody tr:hover > td{background:var(--row-hover)}
.scroll{scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
.scroll::-webkit-scrollbar{height:8px;width:8px}
.scroll::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:8px}

/* الأزرار والحقول: ارتفاع موحّد وتفاعل واضح */
.btn{min-height:38px;transition:filter .15s ease, background-color .15s ease, border-color .15s ease, transform .1s ease}
.btn:active{transform:translateY(1px)}
.btn.sm{min-height:32px}
input[type=text], input[type=search], input[type=password], select{transition:border-color .15s ease, box-shadow .15s ease}
input[type=text]:focus, input[type=search]:focus, input[type=password]:focus, select:focus{
  border-color:var(--gold);box-shadow:0 0 0 3px var(--gold-ring);outline:none}

/* القائمة الجانبية: انتقالٌ ناعم بين العناصر */
aside a{transition:background-color .15s ease, color .15s ease}

/* شريط النطاق الزمني: المقطع النشط يبرز بظلّ خفيف */
.seg button{transition:background-color .15s ease, color .15s ease}

/* ظهور الصفحة عند التنقّل بين الأقسام — حركة قصيرة لا تُبطئ القراءة */
[data-view]:not([hidden]){animation:proFade .22s ease-out}
@keyframes proFade{from{opacity:0;transform:translateY(4px)}}
/* على الجوال الرأس طويل (العنوان والنطاق والتصدير): تثبيته يأكل نصف الشاشة */
@media (max-width: 760px){ .head{position:relative;backdrop-filter:none;-webkit-backdrop-filter:none} }

/* ═══════════════ ٨) بطاقة الإضافة: تثبيت · تحديث · تحقّق · حلول ═══════════════ */
.ext-dl .xd-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;flex-wrap:wrap}
.ext-dl .xd-head h3{margin-bottom:6px}
.ext-dl .xd-dl{display:flex;flex-direction:column;align-items:center;gap:6px}
.ext-dl .xd-dl a.btn{display:inline-flex;align-items:center;gap:6px;text-decoration:none;padding-inline:22px;min-height:44px}
.xd-tabs{display:flex;gap:6px;margin:18px 0 6px;padding:4px;border:1px solid var(--line);border-radius:12px;
  background:var(--seg-bg, transparent);width:fit-content;max-width:100%;flex-wrap:wrap}
.xd-tabs button{border:0;background:transparent;color:var(--ink-3);font:inherit;font-size:13px;padding:7px 14px;border-radius:9px;cursor:pointer}
.xd-tabs button.on{background:var(--gold-tint);color:var(--gold);box-shadow:inset 0 0 0 1px var(--gold-line)}
.xd-steps{list-style:none;counter-reset:xd;margin:12px 0 0;padding:0;display:grid;gap:10px}
.xd-steps li{counter-increment:xd;position:relative;padding:10px 14px 10px 14px;padding-inline-start:50px;
  border:1px solid var(--line);border-radius:12px;color:var(--ink-2);line-height:1.9;font-size:13.5px}
.xd-steps li::before{content:counter(xd);position:absolute;inset-inline-start:12px;top:10px;width:26px;height:26px;
  display:grid;place-items:center;border-radius:50%;font-size:12.5px;font-weight:700;color:var(--gold);
  background:var(--gold-tint);border:1px solid var(--gold-line)}
.xd-steps li.xd-verify{border-color:var(--ok-line, var(--gold-line));background:var(--ok-tint, transparent)}
.xd-steps li.xd-verify::before{content:"✓";color:var(--ok, var(--gold))}
.xd-steps code,.xd-help code{font-family:Consolas,"Courier New",monospace;font-size:12px;background:var(--soft);
  border:1px solid var(--line);padding:1px 6px;border-radius:6px}
.xd-copy{display:inline-flex;align-items:center;gap:6px;margin-inline-start:4px;vertical-align:middle}
.xd-copy .btn.sm{min-height:26px;padding:2px 10px;font-size:11.5px}
.xd-help{margin-top:12px;display:grid;gap:8px}
.xd-help details{border:1px solid var(--line);border-radius:12px;padding:10px 14px}
.xd-help details[open]{border-color:var(--gold-line)}
.xd-help summary{cursor:pointer;font-weight:600;color:var(--ink);font-size:13.5px}
.xd-help p{margin:8px 0 2px;color:var(--ink-2);line-height:1.9;font-size:13px}
@media (max-width:760px){ .ext-dl .xd-dl{align-items:stretch;width:100%} .xd-steps li{padding-inline-start:46px} }
