/*
==============================================================================
 الكود     : UI-CSS  (Stylesheet Code)
 الملف     : app/static/css/app.css
 الوظيفة   : تنسيق الواجهة كاملة (من اليمين لليسار) + تنسيق الطباعة/PDF.
 الأقسام   : 1) المتغيرات والألوان  2) الإطار العام  3) القائمة الجانبية
             4) المكونات (أزرار، بطاقات، جداول، شارات)  5) النماذج
             6) ملف المشروع واللوحات  7) التقارير  8) الجوال  9) الطباعة
 ملاحظة    : ألوان الحالات موحدة بأسماء ثابتة: green yellow red blue black gray orange
==============================================================================
*/

/* ---------- الخط الموحد للموقع: Tajawal (ملفات محلية في static/fonts) ---------- */
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Regular.ttf") format("truetype"); font-weight: 400; font-display: block; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Medium.ttf") format("truetype"); font-weight: 500 600; font-display: block; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Bold.ttf") format("truetype"); font-weight: 700 900; font-display: block; }

/* ---------- 1) المتغيرات ---------- */
:root {
  --navy: #14294a; --navy-2: #1f3a5f; --navy-3: #2b4c7a;
  --bg: #f3f5f9; --card: #ffffff; --line: #e2e7ef; --text: #1d2433; --muted: #6b7587;
  --primary: #1f6feb; --primary-d: #1557c0;
  --green: #1a7f4b;  --green-bg: #e3f5ea;
  --yellow: #8a6100; --yellow-bg: #fff4d1;
  --red: #b42318;    --red-bg: #fde8e7;
  --blue: #175cd3;   --blue-bg: #e4edff;
  --orange: #b54708; --orange-bg: #fdeee0;
  --black: #f4f4f5;  --black-bg: #2b2f36;
  --gray: #4b5565;   --gray-bg: #eef1f5;
  --radius: 10px; --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --surface-2: #f7f9fc; --input-border: #cfd6e2; --input-bg: #fff; --topbar: var(--navy);
  --font-modern: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
  --font: var(--font-modern);   /* الخط الافتراضي للموقع كاملًا: Tajawal */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .2rem; }
h2 { font-size: 1.05rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.text-red { color: var(--red); }
.inline { display: inline; }

/* ---------- 2) الإطار العام ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  background: var(--topbar); color: #fff; padding: .55rem 1.2rem; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--primary); font-size: 1.2rem; }
.brand strong { display: block; font-size: .98rem; }
.brand small { display: block; opacity: .7; font-size: .76rem; }
.userbox { display: flex; align-items: center; gap: .8rem; font-size: .88rem; }
.user-role { background: rgba(255,255,255,.12); padding: .1rem .6rem; border-radius: 99px; font-size: .78rem; }
.userbox .link-muted { color: #c9d6ea; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.shell { display: flex; min-height: calc(100vh - 54px); }
.content { flex: 1; min-width: 0; padding: 1.4rem 1.6rem 3rem; }

/* ---------- 3) القائمة الجانبية ---------- */
.sidebar { width: 245px; flex-shrink: 0; background: var(--card); border-inline-end: 1px solid var(--line); padding: 1rem .7rem; }
.nav-link { display: flex; align-items: center; gap: .55rem; padding: .5rem .7rem; border-radius: 8px; color: var(--text); margin-bottom: 2px; }
.nav-link:hover { background: var(--gray-bg); text-decoration: none; }
.nav-link.active { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.nav-icon { width: 1.4rem; display: inline-grid; place-items: center; color: var(--primary); opacity: .85; }
.nav-link.active .nav-icon { opacity: 1; }
.side-title { margin: 1rem .7rem .3rem; font-size: .75rem; color: var(--muted); font-weight: 700; }
.side-project { background: var(--navy); color: #fff; border-radius: var(--radius); padding: .8rem; margin-bottom: .8rem; }
.side-project-name { font-weight: 700; line-height: 1.4; }
.side-project-meta { font-size: .8rem; opacity: .75; }
.back-link { display: block; font-size: .85rem; margin: 0 .3rem .6rem; }

/* ---------- 4) المكونات ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.code-tag { font-family: Consolas, monospace; font-size: .72rem; background: var(--gray-bg); color: var(--gray); padding: .05rem .45rem; border-radius: 5px; margin-inline-start: .3rem; }
.btn { display: inline-flex; align-items: center; gap: .3rem; padding: .48rem 1rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--gray-bg); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-warn { background: var(--yellow-bg); border-color: #f2d58a; color: var(--yellow); }
.btn-danger { background: var(--red-bg); border-color: #f6c0bc; color: var(--red); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: .25rem .7rem; font-size: .85rem; }
.btn-approve { background: var(--green); border-color: var(--green); color: #fff; }
.btn-approve:hover { filter: brightness(1.08); }
.row-actions { white-space: nowrap; }
.row-actions form + form { margin-inline-start: .3rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--primary); }
.btn-link.danger { color: var(--red); font-size: .8rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; margin-bottom: 1.1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; gap: .5rem; }
.count { display: inline-block; min-width: 1.6rem; text-align: center; background: var(--gray-bg); color: var(--gray); border-radius: 99px; font-size: .75rem; padding: 0 .45rem; margin-inline-start: .3rem; font-weight: 600; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash-success { background: var(--green-bg); color: var(--green); border-color: #b5e1c6; }
.flash-error { background: var(--red-bg); color: var(--red); border-color: #f6c0bc; }
.flash-warning { background: var(--yellow-bg, #fff6db); color: var(--yellow, #8a6100); border-color: #f1d98a; font-weight: 600; }
.flash-info, .flash-message { background: var(--blue-bg); color: var(--blue); border-color: #bcd0fb; }
.empty { padding: 1.4rem; text-align: center; color: var(--muted); }
.empty.ok { color: var(--green); }

.badge { display: inline-block; padding: .08rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-yellow { background: var(--yellow-bg); color: var(--yellow); }
.tone-red { background: var(--red-bg); color: var(--red); }
.tone-blue { background: var(--blue-bg); color: var(--blue); }
.tone-orange { background: var(--orange-bg); color: var(--orange); }
.tone-black { background: var(--black-bg); color: var(--black); }
.tone-gray { background: var(--gray-bg); color: var(--gray); }
.tone-text-red { color: var(--red); } .tone-text-green { color: var(--green); } .tone-text-yellow { color: var(--yellow); } .tone-text-blue { color: var(--blue); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { background: var(--surface-2); text-align: start; font-weight: 600; color: var(--gray); padding: .6rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: .58rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr.clickable { cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr.row-red td:first-child { box-shadow: inset -3px 0 0 var(--red); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.tab { padding: .35rem .8rem; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: .87rem; }
.tab:hover { text-decoration: none; background: var(--gray-bg); }
.tab.active { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.tab.active .count { background: rgba(255,255,255,.2); color: #fff; }
.search input { padding: .42rem .8rem; border: 1px solid var(--line); border-radius: 8px; min-width: 220px; font: inherit; }

.progress { position: relative; height: 20px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; min-width: 90px; }
.progress-bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, #3b82f6, #1f6feb); border-radius: 99px; }
.progress span { position: relative; display: block; text-align: center; font-size: .75rem; font-weight: 700; line-height: 20px; color: var(--navy); }

/* ---------- 5) النماذج ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .88rem; }
.req { color: var(--red); }
.field input[type=text], .field input[type=number], .field input[type=datetime-local], .field input[type=email], .field input[type=date], .field input[type=tel], .field input[type=password],
.field select, .field textarea, .login-card input, .report-period input {
  padding: .5rem .7rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--card); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #bcd0fb; border-color: var(--primary); }
.field input.num { direction: ltr; text-align: right; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.error { color: var(--red); font-size: .8rem; }
.help { color: var(--muted); font-size: .78rem; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.check { font-weight: 400 !important; display: inline-flex; align-items: center; gap: .35rem; }
.form-actions { display: flex; gap: .5rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.form.narrow { max-width: 460px; }

/* ---------- تفاصيل السجل ---------- */
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .2rem 1.4rem; margin: 0; }
.detail-item { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.detail-item.wide { grid-column: 1 / -1; }
.detail-item dt { color: var(--muted); font-size: .8rem; }
.detail-item dd { margin: 0; font-weight: 600; white-space: pre-wrap; }
.detail-item.computed dt small { color: var(--primary); }
.files { display: flex; flex-wrap: wrap; gap: .8rem; }
.file { width: 150px; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; text-align: center; font-size: .8rem; }
.file img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; }
.file-icon { font-size: 2.6rem; height: 100px; display: grid; place-items: center; }
.file-name { display: block; word-break: break-all; margin: .3rem 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.danger-zone { margin-top: 1rem; text-align: start; }

/* عناوين المجموعات داخل النماذج والتفاصيل (Field.section) */
.form-section, .detail-section { grid-column: 1 / -1; margin: .8rem 0 .1rem; padding-bottom: .35rem; border-bottom: 2px solid var(--line);
  font-weight: 800; font-size: .95rem; color: var(--primary); }
.form-section:first-child, .detail-section:first-child { margin-top: 0; }

/* ---------- 6) ملف المشروع واللوحات ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: #fff; border-radius: 14px; padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; }
.hero h1 { font-size: 1.6rem; }
.hero-kicker { opacity: .7; font-size: .85rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: .6rem; font-size: .9rem; align-items: center; }
.hero-stats { display: grid; gap: .7rem; }
.hero-stat { background: rgba(255,255,255,.09); border-radius: 10px; padding: .6rem .9rem; }
.hero-label { font-size: .8rem; opacity: .75; }
.hero-value { font-size: 1.35rem; font-weight: 700; }
.hero-value small { font-size: .8rem; font-weight: 400; opacity: .8; }
.hero .progress { background: rgba(255,255,255,.2); margin-top: .3rem; }
.hero .progress span { color: #fff; }
.hero .muted { color: #c9d6ea; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.section-title { margin: 1.4rem 0 .7rem; font-size: 1.05rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.kpis-lg { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kpi { display: flex; align-items: center; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1rem; color: var(--text); box-shadow: var(--shadow); border-inline-start: 4px solid var(--line); }
a.kpi:hover { text-decoration: none; border-color: #bcd0fb; }
.kpi-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--primary); }
.kpi-value { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.kpi-label { font-size: .82rem; color: var(--muted); }
.tone-border-red { border-inline-start-color: var(--red); }
.tone-border-green { border-inline-start-color: var(--green); }
.tone-border-yellow { border-inline-start-color: #e0a800; }
.tone-border-blue { border-inline-start-color: var(--blue); }
.tone-border-gray { border-inline-start-color: #9aa4b2; }
.alerts { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; }
.alerts li { padding: .5rem .7rem; border-radius: 8px; margin-bottom: .35rem; font-size: .88rem; }
.alerts li a { color: inherit; display: block; }
.alert-late { background: var(--red-bg); color: var(--red); }
.alert-today { background: var(--yellow-bg); color: var(--yellow); }
.alert-soon { background: var(--blue-bg); color: var(--blue); }
.alert-mod { margin-inline-end: .2rem; display: inline-grid; vertical-align: -3px; color: var(--muted); }
.questions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.question { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; color: var(--text); box-shadow: var(--shadow); }
.question:hover { text-decoration: none; border-color: #bcd0fb; }
.q-title { font-weight: 700; margin-bottom: .4rem; }
.q-num { font-weight: 800; font-size: 1.05rem; }
.q-lbl { color: var(--muted); font-size: .84rem; }

/* ---------- 7) التقارير ---------- */
.report-types { display: flex; flex-wrap: wrap; gap: .4rem; }
.report-type { border: 1px solid var(--line); border-radius: 99px; padding: .35rem .9rem; cursor: pointer; font-size: .88rem; }
.report-type input { display: none; }
.report-type.active { background: var(--navy-2); color: #fff; border-color: var(--navy-2); }
.report-period { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .9rem; }
.report-period label { display: flex; align-items: center; gap: .4rem; }
.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; }
.report-head { border-bottom: 3px solid var(--navy); padding-bottom: .8rem; margin-bottom: 1rem; }
.report-org { color: var(--muted); font-size: .85rem; }
.report-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .9rem; }
.report-foot { margin-top: 1.4rem; padding-top: .7rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }

/* ---------- الدخول والأخطاء ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-3)); }
.login-card { width: min(390px, 92vw); background: var(--card); border-radius: 16px; padding: 2rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; }
.login-card label { display: block; text-align: start; font-weight: 600; margin-bottom: .9rem; font-size: .9rem; }
.login-card input { margin-top: .3rem; }
.login-mark { width: 56px; height: 56px; margin: 0 auto .8rem; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 1.8rem; border-radius: 14px; }
.login-card h1 { font-size: 1.2rem; }
.error-page { text-align: center; padding: 3rem; }
.error-code { font-size: 3.5rem; font-weight: 800; color: var(--navy-3); }

/* ---------- 8) الجوال ---------- */
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .sidebar { position: fixed; top: 54px; bottom: 0; right: 0; z-index: 15; transform: translateX(100%); transition: transform .2s; overflow-y: auto; box-shadow: -4px 0 20px rgba(0,0,0,.25); }
  body.nav-open .sidebar { transform: none; }
  .content { padding: 1rem; }
  .hero, .grid-2 { grid-template-columns: 1fr; }
  .user-name, .userbox .link-muted, .brand small { display: none; }
}

/* ---------- 9) الطباعة / PDF ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: var(--card); font-size: 11.5px; }
  .topbar, .sidebar, .no-print, .flash, .danger-zone, .toolbar, .page-head .actions { display: none !important; }
  .content { padding: 0; }
  .card, .report, .kpi, .question { box-shadow: none; break-inside: avoid; }
  .hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge, .alerts li, table.data th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
  .table-wrap { overflow: visible; }
  .report-section { break-inside: auto; }
}

/* ---------- 10) التحضير والتايم شيت (UI-ATT) ---------- */
.att-daybar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.att-daybar label { display: flex; align-items: center; gap: .4rem; }
.att-daybar input[type=date] { padding: .42rem .6rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; }
.att-dayname { font-weight: 700; font-size: 1.05rem; margin-inline: .5rem; }
.inline-form { display: inline; }
.att-counters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.att-counter { padding: .35rem .9rem; border-radius: 99px; font-size: .9rem; }
.att-sym { font-weight: 800; }
.att-bulk { display: flex; flex-wrap: wrap; gap: .35rem; }
.att-choices { display: flex; flex-wrap: wrap; gap: .3rem; }
.att-choice { position: relative; cursor: pointer; }
.att-choice input { position: absolute; opacity: 0; pointer-events: none; }
.att-choice span { display: inline-block; padding: .25rem .7rem; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card) !important; color: var(--muted) !important; font-size: .85rem; font-weight: 600; transition: all .1s; }
.att-choice:hover span { border-color: #9aa4b2; }
.att-choice.tone-green input:checked + span { background: var(--green) !important; border-color: var(--green); color: #fff !important; }
.att-choice.tone-red input:checked + span { background: var(--red) !important; border-color: var(--red); color: #fff !important; }
.att-choice.tone-blue input:checked + span { background: var(--blue) !important; border-color: var(--blue); color: #fff !important; }
.att-choice.tone-orange input:checked + span { background: var(--orange) !important; border-color: var(--orange); color: #fff !important; }
.att-choice.tone-yellow input:checked + span { background: #e0a800 !important; border-color: #e0a800; color: #fff !important; }
.att-choice { background: none !important; }
.att-note { width: 100%; min-width: 140px; padding: .35rem .5rem; border: 1px solid var(--input-border); border-radius: 6px; font: inherit; }

.timesheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.ts-head { text-align: center; border-bottom: 3px solid var(--navy); padding-bottom: .6rem; margin-bottom: .8rem; }
.ts-head h2 { font-size: 1.15rem; margin: .2rem 0; }
.ts-org { color: var(--muted); font-size: .85rem; }
.ts-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: .3rem 1.6rem; font-size: .9rem; }
table.ts { border-collapse: collapse; width: 100%; font-size: .78rem; }
table.ts th, table.ts td { border: 1px solid #b9c2cf; padding: 2px 3px; text-align: center; white-space: nowrap; }
table.ts thead th { background: var(--navy-2); color: #fff; font-weight: 600; }
table.ts th.ts-day { width: 22px; height: 64px; padding: 0; }
table.ts th.ts-day span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .7rem; }
table.ts .ts-wk { background: #fff200 !important; color: #000 !important; }
table.ts td.ts-name { text-align: start; font-weight: 600; min-width: 150px; }
table.ts td.ts-role { color: var(--muted); }
table.ts td.ts-cell { font-weight: 800; }
.ts-ok { color: var(--green); }
.ts-red { background: #ff2d2d !important; color: #fff !important; }
.ts-orange { background: #ffc58a !important; }
.ts-blue { background: #cfe0ff !important; }
.ts-yellow { background: #ffe58a !important; }
table.ts .ts-sum { background: var(--surface-2); font-weight: 600; }
table.ts thead .ts-sum { background: var(--navy); }
table.ts tbody tr:nth-child(even) td:not(.ts-wk):not(.ts-red):not(.ts-orange):not(.ts-blue):not(.ts-yellow) { background-color: var(--surface-2); }
table.ts tfoot td { background: var(--blue-bg); font-weight: 700; }
.ts-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .6rem; font-size: .82rem; }
.ts-legend b { display: inline-block; min-width: 20px; text-align: center; border: 1px solid #b9c2cf; }
.ts-sign { display: flex; justify-content: space-around; margin-top: 2rem; font-size: .9rem; }
@media print {
  .timesheet { border: 0; padding: 0; }
  table.ts { font-size: 7.5px; }
  table.ts th.ts-day { height: 52px; }
  table.ts td.ts-name { min-width: 0; }
  .ts-wk, .ts-red, .ts-orange, .ts-blue, .ts-yellow, table.ts thead th, table.ts tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 11) الوضع الليلي (UI-DARK) ---------- */
html[data-theme="dark"] {
  --bg: #0f1520; --card: #172131; --line: #26344a; --text: #e6ebf3; --muted: #95a3b8;
  --surface-2: #1c283b; --input-border: #33445e; --input-bg: #111a28; --topbar: #0b111b;
  --navy: #0b111b; --navy-2: #22406a; --navy-3: #1d3557;
  --primary: #4c8dff; --primary-d: #3a78e8;
  --green: #4cc38a; --green-bg: rgba(76,195,138,.14);
  --yellow: #f0c552; --yellow-bg: rgba(240,197,82,.14);
  --red: #ff7a70; --red-bg: rgba(255,122,112,.14);
  --blue: #7aa7ff; --blue-bg: rgba(122,167,255,.14);
  --orange: #ffa45c; --orange-bg: rgba(255,164,92,.14);
  --gray: #a9b4c4; --gray-bg: rgba(169,180,196,.12);
  --black: #e6ebf3; --black-bg: #3a4558;
  color-scheme: dark;
}
html[data-theme="dark"] .field input, html[data-theme="dark"] .field select, html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .search input, html[data-theme="dark"] .att-note, html[data-theme="dark"] .report-period input,
html[data-theme="dark"] .att-daybar input[type=date], html[data-theme="dark"] .login-card input {
  background: var(--input-bg); color: var(--text); }
html[data-theme="dark"] .progress span { color: var(--text); }
html[data-theme="dark"] .side-project { background: var(--navy-3); }
html[data-theme="dark"] table.ts td.ts-cell.ts-wk, html[data-theme="dark"] table.ts .ts-wk { color: #000 !important; }
html[data-theme="dark"] .login-card { background: var(--card); color: var(--text); }
html[data-theme="dark"] .flash-success { border-color: rgba(76,195,138,.4); }
html[data-theme="dark"] .flash-error { border-color: rgba(255,122,112,.4); }
html[data-theme="dark"] .hero { background: linear-gradient(135deg, #14233a, #1e3a5f); }
html[data-theme="dark"] img.logo-img { filter: drop-shadow(0 0 6px rgba(255,255,255,.15)); }
@media print { html[data-theme="dark"] { --bg:#fff; --card:#fff; --text:#1d2433; --line:#e2e7ef; --surface-2:#f7f9fc; } }

/* ---------- 12) الشعار وأدوات العرض ---------- */
.brand-logo { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 2px; }
.view-tools { display: flex; gap: .3rem; }
.tool-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 8px;
  height: 32px; min-width: 34px; padding: 0 .5rem; cursor: pointer; font: inherit; font-size: .85rem; }
.tool-btn:hover { background: rgba(255,255,255,.2); }
.login-logo { width: 110px; height: auto; margin: 0 auto .6rem; display: block; }
.report-logo { width: 64px; height: auto; float: left; }

/* ---------- 13) شاشة الترحيب الرسمية بعد الدخول (UI-WELCOME) ----------
   طابع حكومي رسمي: خلفية عاجية، إطار مزدوج بخط ذهبي هادئ، شريطان أخضران أعلى وأسفل،
   الشعار كبير وواضح دون مؤثرات، الاسم بالأخضر الداكن، حركة ظهور هادئة فقط. */
.welcome-page { --wg: #0b5d3b; --wg-2: #0e7a4d; --wgold: #b08d4c; --wink: #1f2a24;
  margin: 0; min-height: 100vh; display: grid; place-items: center; overflow: hidden; color: var(--wink); font-family: var(--font);
  background: radial-gradient(900px 620px at 50% 42%, #ffffff 0%, #faf8f2 55%, #f1ede2 100%); }
/* نقش خافت جدًا */
.wl-pattern { position: fixed; inset: 0; opacity: .045; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%230b5d3b' stroke-width='1'%3E%3Cpath d='M36 6 L43 29 L66 36 L43 43 L36 66 L29 43 L6 36 L29 29 Z'/%3E%3Crect x='26' y='26' width='20' height='20' transform='rotate(45 36 36)'/%3E%3C/g%3E%3C/svg%3E"); }
/* الشريطان الأخضران والإطار المزدوج */
.wl-band { position: fixed; left: 0; right: 0; height: 10px; z-index: 3;
  background: linear-gradient(90deg, var(--wg), var(--wg-2), var(--wg)); }
.wl-band.top { top: 0; box-shadow: 0 3px 0 var(--wgold); }
.wl-band.bottom { bottom: 0; box-shadow: 0 -3px 0 var(--wgold); }
.wl-frame { position: fixed; inset: 30px; border: 1px solid rgba(176,141,76,.55); pointer-events: none; z-index: 1;
  opacity: 0; animation: wl-fade 1s ease .1s forwards; }
.wl-frame::before { content: ""; position: absolute; inset: 7px; border: 2px solid rgba(176,141,76,.35); }
.welcome { text-align: center; position: relative; z-index: 2; padding: 1rem; animation: wl-exit .6s ease forwards; animation-delay: var(--exit, 3.5s); }
.wl-country { font-size: .95rem; font-weight: 700; color: var(--wg); letter-spacing: .5px; opacity: 0; animation: wl-fade .8s ease .1s forwards; }
/* الشعار: كبير وواضح على الخلفية الفاتحة */
.wl-logo { display: block; width: 280px; height: auto; margin: 1rem auto 0; opacity: 0; transform: scale(.94);
  image-rendering: -webkit-optimize-contrast; filter: drop-shadow(0 10px 18px rgba(20,40,30,.14));
  animation: wl-in 1.1s cubic-bezier(.2,.7,.2,1) .25s forwards; }
.wl-divider { position: relative; width: 0; height: 1px; margin: 1.6rem auto 1.3rem; background: linear-gradient(90deg, transparent, var(--wgold), transparent);
  animation: wl-grow 1s ease 1s forwards; }
.wl-divider::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -5px 0 0 -5px;
  background: var(--wgold); transform: rotate(45deg); box-shadow: 0 0 0 4px #faf8f2; }
.wl-kicker { font-size: 1.05rem; color: #5b665f; opacity: 0; animation: wl-up .8s ease 1.15s forwards; }
.wl-name { margin: .25rem 0 0; font-size: 2.7rem; font-weight: 800; line-height: 1.3; color: var(--wg); opacity: 0; animation: wl-up .8s ease 1.4s forwards; }
.wl-role { margin-top: .3rem; font-size: 1.05rem; font-weight: 600; color: var(--wgold); opacity: 0; animation: wl-up .8s ease 1.7s forwards; }
.wl-app { margin-top: 1rem; font-size: .98rem; color: #3d4a43; opacity: 0; animation: wl-up .8s ease 1.95s forwards; }
.wl-app b { color: var(--wg); font-weight: 700; }
.wl-bar { width: 220px; height: 3px; border-radius: 99px; background: rgba(11,93,59,.12); margin: 1.6rem auto 0; overflow: hidden; }
.wl-bar span { display: block; height: 100%; width: 0; background: var(--wg); animation: wl-load var(--dur, 3.6s) ease-in-out forwards; }
.wl-foot { margin-top: 1rem; display: flex; gap: .6rem; justify-content: center; align-items: center; font-size: .82rem; color: #7a847d; opacity: 0; animation: wl-fade .6s ease 2.2s forwards; }
.wl-skip { color: var(--wg); text-decoration: none; font-weight: 600; }
.wl-skip:hover { text-decoration: underline; }
@keyframes wl-in { to { opacity: 1; transform: none; } }
@keyframes wl-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes wl-fade { to { opacity: 1; } }
@keyframes wl-grow { to { width: 340px; } }
@keyframes wl-load { to { width: 100%; } }
@keyframes wl-exit { to { opacity: 0; } }
@media (max-width: 600px) { .wl-frame { inset: 16px; } .wl-logo { width: 200px; } .wl-name { font-size: 2rem; } @keyframes wl-grow { to { width: 220px; } } }
@media (prefers-reduced-motion: reduce) { .welcome-page * { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* ---------- 14) الواجهة الرئيسية قبل الدخول (UI-PORTAL) ----------
   ألوان ثابتة رسمية (لا تتأثر بالوضع الليلي): أخضر داكن + ذهبي هادئ + عاجي. */
.portal { --pg: #0b5d3b; --pg-d: #073d27; --pg-2: #0e7a4d; --pgold: #b08d4c; --pgold-2: #d9bf86; --pink: #1f2a24; --pmuted: #6d7770;
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--pink); background: #f4f1e8; }
.pt-shell { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100vh; }
/* القسم الأخضر */
.pt-hero { position: sticky; top: 0; height: 100vh; align-self: start; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #fff;
  background: radial-gradient(700px 520px at 50% 30%, #0f6b45 0%, var(--pg) 40%, var(--pg-d) 100%); }
.pt-hero::before { content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M36 6 L43 29 L66 36 L43 43 L36 66 L29 43 L6 36 L29 29 Z'/%3E%3Crect x='26' y='26' width='20' height='20' transform='rotate(45 36 36)'/%3E%3C/g%3E%3C/svg%3E"); }
.pt-hero::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: linear-gradient(180deg, transparent, var(--pgold), transparent); }
.pt-hero-in { position: relative; z-index: 1; padding: 3.2rem 3rem 1.5rem; text-align: center; max-width: 560px; margin: 0 auto; width: 100%; }
.pt-country { font-size: .9rem; font-weight: 700; letter-spacing: .5px; color: var(--pgold-2); }
.pt-emblem { width: 210px; height: 210px; margin: 1.3rem auto 1.4rem; border-radius: 50%; display: grid; place-items: center; background: #fff;
  box-shadow: 0 0 0 3px var(--pgold), 0 0 0 10px rgba(217,191,134,.14), 0 18px 40px rgba(0,0,0,.35); }
.pt-emblem img { width: 188px; height: auto; }
.pt-welcome { font-size: 1.05rem; color: var(--pgold-2); }
.pt-title { margin: .3rem 0 0; font-size: 2.05rem; font-weight: 800; line-height: 1.45; color: #fff; }
.pt-rule { position: relative; width: 240px; height: 1px; margin: 1.3rem auto; background: linear-gradient(90deg, transparent, var(--pgold-2), transparent); }
.pt-rule span { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--pgold-2); transform: rotate(45deg); }
.pt-lead { margin: 0 auto 1.6rem; max-width: 440px; font-size: .98rem; line-height: 1.9; color: rgba(255,255,255,.82); }
.pt-features { list-style: none; margin: 0 auto; padding: 0; max-width: 420px; text-align: start; display: grid; gap: .65rem; }
.pt-features li { display: flex; gap: .8rem; align-items: center; padding: .7rem .9rem; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.pt-features svg { flex: none; color: var(--pgold-2); }
.pt-features b { display: block; font-size: .95rem; }
.pt-features small { display: block; font-size: .8rem; color: rgba(255,255,255,.65); }
.pt-hero-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 3rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; color: rgba(255,255,255,.6); }
/* القسم الفاتح */
.pt-panel { display: flex; flex-direction: column; justify-content: flex-start; padding: clamp(2rem, 6vh, 4rem) clamp(1.2rem, 5vw, 4.5rem) 3rem;
  background: radial-gradient(800px 600px at 50% 20%, #ffffff 0%, #faf8f2 55%, #f1ede2 100%); }
.pt-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; max-width: 640px; width: 100%; margin: 0 auto 1.2rem; }
.pt-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: 1rem .8rem .9rem; text-align: center;
  background: #fff; border: 1px solid #e3ddcc; border-radius: 14px; color: var(--pink); transition: .2s; box-shadow: 0 1px 2px rgba(31,42,36,.04); }
.pt-opt:hover { text-decoration: none; border-color: var(--pgold-2); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(31,42,36,.08); }
.pt-opt-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; margin-bottom: .4rem; color: var(--pg); background: #eef4f0; transition: .2s; }
.pt-opt b { font-size: .98rem; }
.pt-opt small { font-size: .78rem; color: var(--pmuted); }
.pt-opt.active { border-color: var(--pg); box-shadow: 0 0 0 1px var(--pg), 0 10px 24px rgba(11,93,59,.12); }
.pt-opt.active::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; border-radius: 0 0 4px 4px; background: var(--pgold); }
.pt-opt.active .pt-opt-ic { background: var(--pg); color: #fff; }
.pt-card { max-width: 640px; width: 100%; margin: 0 auto; background: #fff; border: 1px solid #e3ddcc; border-radius: 18px;
  padding: 2rem 2.2rem; box-shadow: 0 20px 50px rgba(31,42,36,.08); }
.pt-card h2 { font-size: 1.35rem; font-weight: 800; color: var(--pg); }
.pt-sub { margin: .3rem 0 1.4rem; color: var(--pmuted); font-size: .9rem; }
.pt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.pt-wide { grid-column: 1 / -1; }
.pt-field { display: block; margin-bottom: 1rem; }
.pt-field > span:first-child { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .35rem; color: #3b463f; }
.pt-field i { color: #b42318; font-style: normal; }
.pt-field input, .pt-field select, .pt-field textarea { width: 100%; padding: .7rem .85rem; font: inherit; font-size: .95rem; color: var(--pink);
  background: #fbfaf6; border: 1px solid #d9d3c2; border-radius: 10px; transition: .15s; }
.pt-field textarea { resize: vertical; }
.pt-field input:focus, .pt-field select:focus, .pt-field textarea:focus { outline: none; background: #fff; border-color: var(--pg); box-shadow: 0 0 0 3px rgba(11,93,59,.12); }
.pt-pass { position: relative; display: block; }
.pt-pass input { padding-left: 4.2rem; }
.pt-pass button { position: absolute; left: .45rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--pg); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; padding: .3rem .5rem; }
.pt-btn { width: 100%; margin-top: .3rem; padding: .85rem 1rem; border: 0; border-radius: 10px; cursor: pointer; font: inherit; font-size: 1rem; font-weight: 700;
  color: #fff; background: linear-gradient(180deg, var(--pg-2), var(--pg)); box-shadow: 0 6px 16px rgba(11,93,59,.25), inset 0 -2px 0 rgba(0,0,0,.12); transition: .15s; }
.pt-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.pt-hint { margin: -.3rem 0 1rem; font-size: .8rem; color: var(--pmuted); }
.pt-alt { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed #e3ddcc; text-align: center; font-size: .88rem; color: var(--pmuted); }
.pt-alt a, .pt-contact a { color: var(--pg); font-weight: 700; }
.pt-flash { padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; border: 1px solid; }
.pt-flash-error { background: #fdf0ef; border-color: #f3c5c1; color: #9b1c13; }
.pt-flash-success { background: #ebf6ef; border-color: #b7dcc5; color: #0b5d3b; }
.pt-contact { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.pt-contact > div { flex: 1 1 140px; padding: .6rem .8rem; border-radius: 10px; background: #f6f3ea; border: 1px solid #e8e1cf; }
.pt-contact small { display: block; font-size: .75rem; color: var(--pmuted); }
@media (max-width: 900px) {
  .pt-shell { grid-template-columns: 1fr; }
  .pt-hero { position: relative; height: auto; }
  .pt-hero-in { padding: 2rem 1.2rem 1rem; }
  .pt-emblem { width: 150px; height: 150px; margin: 1rem auto; } .pt-emblem img { width: 134px; }
  .pt-title { font-size: 1.5rem; } .pt-lead, .pt-features { display: none; }
  .pt-hero-foot { padding: .8rem 1.2rem; justify-content: center; }
  .pt-hero::after { display: none; }
  .pt-panel { padding: 1.5rem 1rem 2.5rem; }
  .pt-card { padding: 1.4rem 1.1rem; } .pt-grid { grid-template-columns: 1fr; }
  .pt-opt small { display: none; }
  .pt-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .pt-opt { padding: .8rem .3rem .7rem; } .pt-opt b { font-size: .85rem; }
  .pt-opt-ic { width: 40px; height: 40px; }
}

/* ---------- 15) قائمة المستخدم في الشريط العلوي (UI-USERMENU) ---------- */
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; color: #fff; font-size: 1rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); transition: .15s; position: relative; }
.icon-btn:hover { background: rgba(255,255,255,.16); text-decoration: none; color: #fff; }
.icon-btn .dot { position: absolute; top: -5px; left: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: #d92d20;
  color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--topbar); }
.usermenu { position: relative; }
.usermenu > summary { list-style: none; display: flex; align-items: center; gap: .65rem; cursor: pointer; padding: .3rem .45rem .3rem .75rem;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); transition: .15s; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover, .usermenu[open] > summary { background: rgba(255,255,255,.14); }
.avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; font-size: 1rem;
  color: #3d2f10; background: linear-gradient(160deg, #f1dca6, #c9a35a); box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.avatar.lg { width: 48px; height: 48px; font-size: 1.3rem; box-shadow: none; }
.um-text { display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.um-text b { font-size: .9rem; color: #fff; }
.um-text small { font-size: .74rem; color: rgba(255,255,255,.65); }
.um-chev { opacity: .7; transition: transform .2s; }
.usermenu[open] .um-chev { transform: rotate(180deg); }
.um-pop { position: absolute; left: 0; top: calc(100% + 8px); width: 280px; z-index: 50; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(16,24,40,.18); overflow: hidden; animation: um-in .15s ease; }
@keyframes um-in { from { opacity: 0; transform: translateY(-4px); } }
.um-head { display: flex; gap: .75rem; align-items: center; padding: 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.um-head b { display: block; font-size: .98rem; }
.um-head small { display: block; font-size: .8rem; color: var(--muted); }
.um-role { display: inline-block; margin-top: .3rem; padding: .05rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 700; color: var(--green); background: var(--green-bg); }
.um-list { padding: .4rem; }
.um-list a, .um-list button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border-radius: 9px; border: 0;
  background: none; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; text-align: start; }
.um-list a:hover, .um-list button:hover { background: var(--surface-2); text-decoration: none; }
.um-list .um-count { margin-inline-start: auto; min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--red-bg); color: var(--red); font-size: .75rem; font-weight: 700; text-align: center; }
.um-list hr { border: 0; border-top: 1px solid var(--line); margin: .35rem 0; }
.um-list .um-out { color: var(--red); }
@media (max-width: 760px) { .um-text, .um-chev { display: none; } .usermenu > summary { padding: .25rem; } }

/* ---------- 16) التقارير التنفيذية (UI-EXR) ---------- */
.exr-month select { margin-inline-start: .4rem; padding: .4rem .7rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
.exr-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .9rem; margin-bottom: .8rem; }
.exr-file { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.exr-ic { flex: none; width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.6rem; border-radius: 14px; background: var(--surface-2); color: var(--primary); }
.exr-body { flex: 1; min-width: 0; }
.exr-body b { display: block; font-size: 1rem; }
.exr-body small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.exr-stat { display: inline-block; margin-top: .3rem; font-size: .75rem; font-weight: 700; color: var(--green); background: var(--green-bg); padding: .05rem .55rem; border-radius: 99px; }
.exr-all { text-align: center; margin: .2rem 0 1.2rem; }
.exr-dep { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .7rem; }
.exr-dep > div { padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); }
.exr-dep small { display: block; color: var(--muted); font-size: .76rem; }
.exr-dep b { display: block; font-size: 1.05rem; }
.exr-sec { margin: 1rem 0 .4rem; font-weight: 800; color: var(--primary); }
.exr-un { margin: .2rem 0 0; padding-inline-start: 1.2rem; font-size: .9rem; }
.exr-stat { white-space: nowrap; }

/* ---------- 17) تفاصيل مؤشرات اللوحة الرئيسية (UI-DSH-KPI) ---------- */
.kpi { transition: transform .15s, box-shadow .15s; }
a.kpi { color: inherit; text-decoration: none; cursor: pointer; position: relative; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,.10); text-decoration: none; }
a.kpi::after { content: "‹"; position: absolute; left: .7rem; bottom: .45rem; font-size: 1rem; color: var(--muted); opacity: 0; transition: .15s; }
a.kpi:hover::after { opacity: 1; }
.crumbs { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.crumbs b { color: var(--text); }
.kd-head { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.1rem 1.3rem; margin-bottom: 1rem; box-shadow: var(--shadow); border-inline-start-width: 5px; }
.kd-icon { color: var(--primary); font-size: 2rem; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); }
.kd-main { flex: 1; min-width: 220px; }
.kd-mod { font-size: .8rem; color: var(--muted); font-weight: 700; }
.kd-main h1 { margin: .1rem 0 .3rem; font-size: 1.4rem; }
.kd-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .85rem; color: var(--muted); }
.kd-meta b { color: var(--text); }
.kd-value { font-size: 2.1rem; font-weight: 800; padding: 0 .6rem; }
.kd-actions { display: flex; gap: .4rem; }
.kd-col { text-align: center; white-space: nowrap; }
@media print { .kd-head { box-shadow: none; } a.kpi::after { display: none; } }

/* ---------- 18) نظام التقارير (UI-RPT) ---------- */
/* بطاقات القوالب */
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.rt-card { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.1rem; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); border-top: 4px solid #1F3A5F; transition: .15s; }
a.rt-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,40,.10); border-top-color: #B08D4C; }
.rt-card.rt-custom { border-top-color: #B08D4C; }
.rt-ic { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); color: var(--primary); }
.rt-card b { font-size: 1rem; }
.rt-card small { color: var(--muted); line-height: 1.6; font-size: .8rem; flex: 1; }
.rt-go { font-size: .8rem; font-weight: 700; color: var(--primary); margin-top: .3rem; }
.rt-static .rt-card { box-shadow: none; }
.rh-pick { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.rh-pick label { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 260px; }
.rh-pick select { padding: .55rem .7rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
.rb-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .4rem 1rem; }
.rb-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.rb-chips span { padding: .2rem .7rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .82rem; }
/* شريط الأدوات */
.rd-toolbar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; justify-content: space-between; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; margin-bottom: .8rem; box-shadow: var(--shadow); }
.rd-tb-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rd-status select { padding: .4rem .6rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
.rd-versions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .85rem; margin-bottom: .8rem; color: var(--muted); }
.rd-versions a { padding: .15rem .6rem; border-radius: 99px; border: 1px solid var(--line); background: var(--card); }
.rd-versions a.active { background: #1F3A5F; color: #fff; border-color: #1F3A5F; }
/* ورقة التقرير (ألوان ثابتة رسمية لا تتأثر بالوضع الليلي) */
.rd-stage { background: #E9ECF2; border-radius: 12px; padding: 1.2rem; overflow-x: auto; }
.rd-paper { --rn: #1F3A5F; --rg: #B08D4C; --rl: #D9DEE7; --rt: #1D2433; --rm: #5B6576;
  width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; background: #fff; color: var(--rt); padding: 14mm 13mm 12mm;
  box-shadow: 0 10px 30px rgba(16,24,40,.15); font-size: 12.5px; line-height: 1.65; }
.rd-head { display: grid; grid-template-columns: 1.15fr 1.4fr 1fr; gap: 10px; align-items: center; }
.rd-org { display: flex; gap: 10px; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--rn); line-height: 1.7; }
.rd-org img { width: 64px; height: auto; }
.rd-title { text-align: center; }
.rd-kind { display: inline-block; font-size: 11px; font-weight: 700; color: var(--rg); border: 1px solid var(--rg); border-radius: 99px; padding: 0 10px; }
.rd-title h1 { margin: 4px 0 2px; font-size: 20px; color: var(--rn); line-height: 1.4; }
.rd-project { font-size: 12.5px; font-weight: 700; color: var(--rm); }
.rd-meta { border-collapse: collapse; width: 100%; font-size: 11px; }
.rd-meta th, .rd-meta td { border: 1px solid var(--rl); padding: 3px 7px; text-align: start; }
.rd-meta th { background: #F2F4F8; color: var(--rn); width: 42%; font-weight: 700; }
.rd-rule { height: 4px; margin: 10px 0 12px; background: linear-gradient(90deg, var(--rg), var(--rn) 30%, var(--rn) 70%, var(--rg)); border-radius: 2px; }
.rd-info { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rl); border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.rd-info > div { padding: 5px 9px; border-bottom: 1px solid var(--rl); border-inline-start: 1px solid var(--rl); }
.rd-info span { display: block; font-size: 10.5px; color: var(--rm); }
.rd-info b { font-size: 12px; }
.rd-block { margin-top: 14px; }
.rd-block h2, .rd-text h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 10px; font-size: 14.5px; color: #fff;
  background: var(--rn); border-radius: 6px; border-inline-start: 5px solid var(--rg); }
.rd-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 50%; background: var(--rg); color: #fff; font-size: 12px; }
.rd-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-bottom: 8px; }
.rd-kpi { border: 1px solid var(--rl); border-radius: 6px; padding: 6px 8px; text-align: center; border-top: 3px solid var(--rn); background: #FBFCFE; }
.rd-kpi b { display: block; font-size: 15px; color: var(--rn); }
.rd-kpi span { display: block; font-size: 10.5px; color: var(--rm); line-height: 1.4; }
.rd-kpi em { display: block; font-style: normal; font-size: 10px; color: var(--rm); }
.rd-tone-green { border-top-color: #2E7D32; } .rd-tone-green b { color: #2E7D32; }
.rd-tone-red { border-top-color: #C62828; } .rd-tone-red b { color: #C62828; }
.rd-tone-yellow { border-top-color: #E9A23B; } .rd-tone-yellow b { color: #A86B00; }
.rd-tone-blue { border-top-color: #1F6FEB; } .rd-tone-blue b { color: #1F6FEB; }
.rd-tone-gray { border-top-color: #9AA4B2; }
.rd-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; margin-bottom: 8px; }
.rd-chart { margin: 0; border: 1px solid var(--rl); border-radius: 6px; padding: 6px 8px; break-inside: avoid; }
.rd-chart figcaption { font-weight: 700; font-size: 11.5px; color: var(--rn); margin-bottom: 4px; }
.rc-svg { width: 100%; height: auto; display: block; direction: ltr; unicode-bidi: isolate; }
.rc-svg .rc-lbl { font: 600 12px var(--font); fill: #1D2433; }
.rc-svg .rc-val { font: 700 11.5px var(--font); fill: #1D2433; }
.rc-svg .rc-track { fill: #EEF1F6; }
.rc-svg .rc-total { font: 800 20px var(--font); fill: #1F3A5F; }
.rc-svg .rc-cap { font: 500 10px var(--font); fill: #5B6576; }
.rc-donut { display: flex; align-items: center; gap: 12px; }
.rc-ring { width: 150px; flex: none; }
.rc-legend { list-style: none; margin: 0; padding: 0; flex: 1; font-size: 11.5px; }
.rc-legend li { display: flex; align-items: center; gap: 6px; padding: 2px 0; border-bottom: 1px dashed #EEF1F6; }
.rc-legend i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.rc-legend span { flex: 1; } .rc-legend em { font-style: normal; color: #5B6576; min-width: 36px; text-align: left; }
.rd-table-wrap { margin-bottom: 8px; }
.rd-table-title { font-weight: 700; font-size: 12px; color: var(--rn); margin: 6px 0 4px; }
.rd-table-title small { color: var(--rm); font-weight: 500; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.rd-table th { background: #E8ECF3; color: var(--rn); font-weight: 700; padding: 5px 6px; border: 1px solid var(--rl); text-align: start; }
.rd-table td { padding: 4px 6px; border: 1px solid var(--rl); vertical-align: top; }
.rd-table tbody tr:nth-child(even) td { background: #FAFBFD; }
.rd-table tr.rd-row-red td { background: #FDEEEE !important; }
.rd-table tr.rd-row-yellow td { background: #FFF6E0 !important; }
.rd-table tr.rd-row-green td { background: #EEF8F0 !important; }
.rd-table tfoot td { font-weight: 800; background: #F2F4F8; }
.rd-empty { color: var(--rm); padding: 6px 10px; border: 1px dashed var(--rl); border-radius: 6px; margin: 0; }
.rd-text { margin-top: 14px; }
.rd-text p { white-space: pre-wrap; margin: 0; padding: 8px 10px; border: 1px solid var(--rl); border-radius: 6px; background: #FBFCFE; }
.rd-summary p { border-inline-start: 4px solid var(--rg); }
.rd-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; break-inside: avoid; }
.rd-sign > div { border: 1px solid var(--rl); border-radius: 6px; padding: 8px 10px; text-align: center; min-height: 92px; }
.rd-sign span { display: block; font-weight: 800; color: var(--rn); }
.rd-sign b, .rd-sign small, .rd-sign i { display: block; }
.rd-sign small { color: var(--rm); }
.rd-sign i { font-style: normal; color: var(--rm); margin-top: 8px; font-size: 11px; }
.rd-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 6px;
  border-top: 2px solid var(--rn); font-size: 10px; color: var(--rm); }
@media (max-width: 760px) {
  .rd-paper { padding: 14px; min-height: 0; }
  .rd-head { grid-template-columns: 1fr; text-align: center; } .rd-org { justify-content: center; }
  .rd-info { grid-template-columns: 1fr 1fr; } .rd-sign { grid-template-columns: 1fr; }
}
@media print {
  @page { size: A4; margin: 10mm 9mm 14mm;
    @bottom-center { content: "صفحة " counter(page) " من " counter(pages); font-size: 9px; color: #5B6576; } }
  .rd-stage { background: none; padding: 0; }
  .rd-paper { box-shadow: none; width: auto; min-height: 0; padding: 0; }
  .rd-paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rd-block h2, .rd-kpis, .rd-chart, .rd-table thead { break-inside: avoid; break-after: avoid; }
  .rd-table tr { break-inside: avoid; }
  .crumbs { display: none; }
}

/* ===== 19) أيقونات خطية بدل الإيموجي (CORE-ICON) ===== */
svg.ico { display: inline-block; vertical-align: middle; flex: none; }
.menu-toggle svg, .icon-btn svg { display: block; }
.icon-btn .th-sun { display: none; }
[data-theme="dark"] .icon-btn .th-sun { display: block; }
[data-theme="dark"] .icon-btn .th-moon { display: none; }
.um-list svg.ico { color: var(--muted); }
.um-list .um-out svg.ico { color: var(--red); }

/* ===== 20) جدول المستخلصات (INVS) ===== */
.invs-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.invs-check { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; font-weight: 600; }
.invs-check input { width: 18px; height: 18px; accent-color: var(--green); }
.invs-form input[type=date] { padding: .25rem .4rem; font-size: .85rem; }
.invs-future td { opacity: .55; }

/* ===== 21) ألوان الأيقونات حسب المعنى (CORE-ICON) ===== */
:root { --ic-blue: #2563eb; --ic-violet: #7c3aed; --ic-green: #16a34a; --ic-red: #dc2626; --ic-amber: #d97706;
        --ic-orange: #ea580c; --ic-teal: #0d9488; --ic-cyan: #0891b2; --ic-slate: #475569; }
[data-theme="dark"] { --ic-blue: #60a5fa; --ic-violet: #a78bfa; --ic-green: #4ade80; --ic-red: #f87171; --ic-amber: #fbbf24;
        --ic-orange: #fb923c; --ic-teal: #2dd4bf; --ic-cyan: #22d3ee; --ic-slate: #94a3b8; }
svg.c-blue { color: var(--ic-blue); }   svg.c-violet { color: var(--ic-violet); } svg.c-green { color: var(--ic-green); }
svg.c-red { color: var(--ic-red); }     svg.c-amber { color: var(--ic-amber); }   svg.c-orange { color: var(--ic-orange); }
svg.c-teal { color: var(--ic-teal); }   svg.c-cyan { color: var(--ic-cyan); }     svg.c-slate { color: var(--ic-slate); }
.nav-icon, [data-theme="dark"] .nav-icon { opacity: 1; }
/* مربعات الأيقونات بخلفية من نفس اللون */
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-blue)   { background: color-mix(in srgb, var(--ic-blue) 13%, transparent); }
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-violet) { background: color-mix(in srgb, var(--ic-violet) 13%, transparent); }
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-green)  { background: color-mix(in srgb, var(--ic-green) 13%, transparent); }
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-red)    { background: color-mix(in srgb, var(--ic-red) 13%, transparent); }
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-amber)  { background: color-mix(in srgb, var(--ic-amber) 15%, transparent); }
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-orange) { background: color-mix(in srgb, var(--ic-orange) 13%, transparent); }
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-teal)   { background: color-mix(in srgb, var(--ic-teal) 13%, transparent); }
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-cyan)   { background: color-mix(in srgb, var(--ic-cyan) 13%, transparent); }
:is(.kpi-icon, .rt-ic, .exr-ic, .kd-icon):has(svg.c-slate)  { background: color-mix(in srgb, var(--ic-slate) 12%, transparent); }
.nav-link.active .nav-icon svg { filter: saturate(1.2); }
.invs-bulk { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .8rem 1rem; font-size: .92rem; }
.invs-bulk input[type=date] { padding: .3rem .5rem; }
.nowrap { white-space: nowrap; }

/* بوابة الدخول على الشاشات القصيرة: اللوحة الخضراء ثابتة وتتصغر لتظهر كاملة */
@media (min-width: 901px) and (max-height: 860px) {
  .pt-hero-in { padding-top: 2rem; }
  .pt-emblem { width: 150px; height: 150px; margin: .9rem auto 1rem; } .pt-emblem img { width: 134px; }
  .pt-title { font-size: 1.7rem; } .pt-rule { margin: .9rem auto; } .pt-lead { margin-bottom: 1rem; font-size: .92rem; }
  .pt-features { gap: .45rem; } .pt-features li { padding: .5rem .8rem; }
}
@media (min-width: 901px) and (max-height: 720px) { .pt-features { display: none; } }

/* ===== 22) بنود العقد حسب التصنيف (LDG) ===== */
.ldg-kpis { margin-bottom: 1rem; }
.ldg-title { min-width: 320px; line-height: 1.7; }
.ldg-desc { font-size: 1.02rem; line-height: 1.8; max-width: 900px; margin: .3rem 0; }
.progress-bar.ldg-green { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar.ldg-orange { background: linear-gradient(90deg, #fb923c, #ea580c); }
.progress-bar.ldg-red { background: linear-gradient(90deg, #f87171, #dc2626); }
.progress-bar.ldg-gray { background: transparent; }

/* ===== 23) النسخ الاحتياطي والإشعارات (BKP / NTF) ===== */
.bkp-list { margin: .2rem 0 .8rem; padding-inline-start: 1.2rem; line-height: 2; }
.ntf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.1rem; }
.ntf-grid .card { margin-bottom: 0; }
.ntf-state { display: inline-block; font-size: .78rem; padding: .1rem .55rem; border-radius: 999px; margin-inline-start: .4rem; }
.ntf-state.on { background: var(--green-bg, #e6f6ec); color: var(--green); }
.ntf-state.off { background: var(--surface-2); color: var(--muted); }
.ntf-test { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; margin-top: .8rem; }
.ntf-test input { max-width: 260px; }

/* ===== 24) لوحة المهندس (ENG) ===== */
.eb { max-width: 1180px; }
.eb-viewas { background: var(--blue-bg); color: var(--blue); padding: .55rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; }
.eb-viewas a { margin-inline-start: .6rem; font-weight: 600; }
.eb-hello { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.eb-hello h1 { font-size: 1.6rem; }
.eb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.3rem; }
.eb-stat, .eb-mini > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem;
  display: flex; flex-direction: column; gap: .1rem; box-shadow: var(--shadow); border-top: 4px solid var(--line); }
.eb-num { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.eb-stat.is-green, .eb-mini .is-green { border-top-color: var(--green); } .is-green .eb-num { color: var(--green); }
.eb-stat.is-amber, .eb-mini .is-amber { border-top-color: #d97706; }       .is-amber .eb-num { color: #b45309; }
.eb-stat.is-red, .eb-mini .is-red { border-top-color: var(--red); }       .is-red .eb-num { color: var(--red); }
.eb-stat.is-blue { border-top-color: var(--blue); }                       .is-blue .eb-num { color: var(--blue); }
.eb-section { margin-bottom: 1.5rem; }
.eb-section h2 { font-size: 1.15rem; margin-bottom: .6rem; }
.eb-allgood { display: flex; align-items: center; gap: .9rem; background: var(--green-bg); color: var(--green);
  border-radius: 14px; padding: 1rem 1.2rem; }
.eb-allgood .muted { color: inherit; opacity: .8; }
.eb-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.eb-task { display: flex; align-items: center; gap: .8rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: .7rem .9rem; border-inline-start: 5px solid var(--line); box-shadow: var(--shadow); }
.eb-task.eb-t-red { border-inline-start-color: var(--red); } .eb-task.eb-t-amber { border-inline-start-color: #d97706; }
.eb-task.eb-t-blue { border-inline-start-color: var(--blue); } .eb-task.eb-t-gray { border-inline-start-color: var(--gray); }
.eb-task-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.eb-task-body .muted { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-task-ic { display: inline-flex; }
.eb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.eb-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .6rem; color: var(--text); }
a.eb-card:hover { text-decoration: none; border-color: var(--primary); }
.eb-card-title { font-weight: 700; font-size: 1rem; color: var(--text); line-height: 1.5; }
.eb-time-row { display: flex; justify-content: space-between; gap: .5rem; }
.eb-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: .3rem 0; border: 1px solid var(--line); }
.eb-bar span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #2563eb); border-radius: 99px; }
.eb-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.eb-facts li { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.t-green { color: var(--green); } .t-amber { color: #b45309; } .t-red { color: var(--red); }
.eb-card-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .4rem; border-top: 1px dashed var(--line); }
.eb-eng-head { display: flex; align-items: center; gap: .7rem; }
.eb-avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-bg); color: var(--blue); font-weight: 700; font-size: 1.15rem; }
.eb-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.eb-mini > div { padding: .45rem .5rem; border-radius: 10px; box-shadow: none; font-size: .78rem; }
.eb-mini .eb-num { font-size: 1.3rem; }
.eb-mini-tasks { margin: 0; padding-inline-start: 1rem; font-size: .85rem; display: flex; flex-direction: column; gap: .15rem; }
.eb-mini-tasks .eb-t-red { color: var(--red); } .eb-mini-tasks .eb-t-amber { color: #b45309; }
.eb-mini-tasks li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-ok { color: var(--green); display: flex; align-items: center; gap: .35rem; font-weight: 600; }
@media (max-width: 760px) {
  .eb-stats { grid-template-columns: repeat(2, 1fr); }
  .eb-cards { grid-template-columns: 1fr; }
  .eb-task { flex-wrap: wrap; }
}

/* ===== 25) الصورة الشخصية (CORE-AVT) ===== */
img.avatar, img.eb-avatar { object-fit: cover; padding: 0; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.2rem; box-shadow: none; }
.avt-preview { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.avt-pick { margin-bottom: 1rem; }

/* ===== 26) الدخول بحساب مستخدم (CORE-SWITCH) ===== */
.sw-banner { position: sticky; top: 56px; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: #b42318; color: #fff; padding: .6rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; box-shadow: 0 4px 12px rgba(180,35,24,.3); }
.sw-banner span { display: inline-flex; align-items: center; gap: .45rem; }
.sw-banner .btn { background: #fff; color: #b42318; border-color: #fff; font-weight: 700; }
.sw-search { margin-bottom: .8rem; }
.sw-search input { width: 100%; max-width: 380px; padding: .5rem .7rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
.eb-viewas form { display: inline; margin-inline-start: .6rem; }

/* ===== 27) اللغة الإنجليزية (I18N) ===== */
.lang-btn { font-weight: 800; font-size: .82rem; text-decoration: none !important; min-width: 38px; }
.pt-panel { position: relative; }
.pt-lang { position: absolute; top: 14px; inset-inline-end: 18px; font-weight: 700; font-size: .85rem; padding: .3rem .8rem;
  border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--text); }
html[dir="ltr"] body { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
html[dir="ltr"] .um-chev { transform: none; }

/* ===== 28) إدارة الموقع (CORE-SITE) ===== */
.site-banner { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-weight: 600; }
.sb-info { background: var(--blue-bg); color: var(--blue); } .sb-success { background: var(--green-bg); color: var(--green); }
.sb-warn { background: #fff4e0; color: #9a5b00; } .sb-danger { background: #b42318; color: #fff; }
:root[data-theme="dark"] .sb-warn { background: #3a2a0c; color: #ffcf7a; }
.site-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.site-nav a { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--text); font-size: .9rem; }
.site-sec { scroll-margin-top: 80px; }
.site-img { display: flex; align-items: center; gap: .7rem; } .site-img img { width: 52px; height: 52px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 3px; }
.site-color { display: flex; align-items: center; gap: .6rem; } .site-color input[type=color] { width: 56px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.site-search { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.site-search input[type=search] { flex: 1; min-width: 240px; padding: .55rem .7rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
.site-txt { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr auto; gap: .8rem; align-items: center; padding: .7rem 1rem; margin-bottom: .5rem; }
.site-txt.is-changed { border-inline-start: 4px solid var(--primary); }
.st-orig { display: flex; flex-direction: column; } .st-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.st-fields input { padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); min-width: 0; }
.st-actions { display: flex; gap: .3rem; }
@media (max-width: 760px) { .site-txt { grid-template-columns: 1fr; } .st-fields { grid-template-columns: 1fr; } }

/* ===== 29) شعارات الشركات وخيارات الطباعة (CORE-COMP / RPT) ===== */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; }
.cl-card { display: flex; gap: 1rem; align-items: flex-start; margin: 0; }
.cl-logo { width: 110px; height: 90px; flex: none; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.cl-logo img { max-width: 100px; max-height: 80px; object-fit: contain; }
.cl-body { flex: 1; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.cl-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.cl-form input[type=file] { max-width: 220px; font-size: .8rem; }
.rd-head.has-company { grid-template-columns: 1.1fr 1.3fr 1fr auto; }
.rd-company { display: flex; flex-direction: column; align-items: center; gap: 3px; max-width: 120px; }
.rd-company img { max-width: 110px; max-height: 70px; object-fit: contain; }
.rd-company small { font-size: 9.5px; color: var(--rm); text-align: center; line-height: 1.3; }
.rd-paper { position: relative; }
.rd-watermark { display: none; }
.rp-has-mark .rd-watermark { display: block; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: none; color: rgba(31, 58, 95, .08); font-size: 110px; font-weight: 800; text-align: center;
  padding-top: 38%; transform: rotate(-28deg); white-space: nowrap; }
.rp-no-org .rd-org img, .rp-no-company .rd-company, .rp-no-info .rd-info, .rp-no-kpis .rd-kpis, .rp-no-charts .rd-charts,
.rp-no-tables .rd-table-wrap, .rp-no-texts .rd-text, .rp-no-sign .rd-sign, .rp-hide-empty .rd-is-empty { display: none !important; }
.rp-no-company .rd-head.has-company { grid-template-columns: 1.15fr 1.4fr 1fr; }
.rp-bw { filter: grayscale(1); }
.rp-panel { margin-bottom: 1rem; }
.rp-panel summary { cursor: pointer; font-weight: 700; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: .8rem; }
.rp-grid fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; display: flex; flex-direction: column; gap: .45rem; margin: 0; }
.rp-grid legend { font-weight: 700; padding: 0 .3rem; }
.rp-grid label { display: flex; align-items: center; gap: .4rem; justify-content: space-between; }
.rp-grid label.check { justify-content: flex-start; }
.rp-grid select, .rp-grid input[type=number] { padding: .3rem .5rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
.rp-actions { display: flex; gap: .4rem; margin-top: .3rem; }
@media print { .rp-has-mark .rd-watermark { position: fixed; padding-top: 45vh; } }
