/* نسخة الويب من تطبيق شركة الريادة في العمارة - نفس تصميم التطبيق:
   خلفية كحلي، لوجو الشركة فوق، المباني تحت، وكروت كحلي شفاف بإطار أبيض رفيع */

:root {
  --bg-top: #0b1f3f;
  --bg-bottom: #10305f;
  --card: rgba(20, 30, 54, 0.6);
  --card-strong: rgba(20, 30, 54, 0.8);
  --card-border: rgba(255, 255, 255, 0.25);
  --input: rgba(20, 30, 54, 0.55);
  --input-border: rgba(255, 255, 255, 0.7);
  --text: #ffffff;
  --muted: #cbd5e1;
  --accent: #3fa9f5;
  --yellow: #ffd54f;
  --green: #a5d6a7;
  --danger: #ffb4b4;
  --icon-box: #e0f2fe;
  --icon-box-border: #bae6fd;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 60%, #0b2347 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}

body::after {
  /* المباني (سكاي لاين المدينة) ثابتة تحت الشاشة وخافتة */
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 32vh;
  background: url("../img/skyline.png") center bottom / contain no-repeat;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.brand { text-align: center; margin-bottom: 20px; }
.brand img { width: 190px; max-width: 50vw; height: auto; }
.brand.small img { width: 130px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}
.topbar a, .link-btn {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
}
.link-btn.danger { color: var(--danger); }
#userBar { display: flex; align-items: center; gap: 14px; }

h1.title { text-align: center; font-size: 22px; margin: 6px 0 4px; }
p.subtitle { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.glass {
  background: var(--card);
  border: 1.2px solid var(--card-border);
  border-radius: 18px;
  backdrop-filter: blur(4px);
}

/* ===== كروت القوائم (زي كروت التطبيق بالظبط) ===== */
.menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.menu-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease;
}
.menu-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.55); }
.menu-card .icon-box {
  width: 80px; height: 60px; flex: none;
  background: var(--icon-box);
  border: 1px solid var(--icon-box-border);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.menu-card .icon-box img { max-width: 72px; max-height: 50px; }
.menu-card .icon-box img.svg { width: 44px; height: 44px; }
.menu-card .text { flex: 1; min-width: 0; }
.menu-card .text b { display: block; font-size: 16px; }
.menu-card .text > span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.menu-card .arrow { color: #fff; font-size: 14px; opacity: .8; }
.menu-card.disabled { opacity: .45; cursor: default; }
.menu-card.disabled:hover { transform: none; border-color: var(--card-border); }
.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,213,79,.15); color: var(--yellow); margin-inline-start: 6px;
}

.section-title { font-size: 14px; color: var(--muted); margin: 22px 4px 10px; }

/* ===== نموذج تسجيل الدخول ===== */
.login-box { max-width: 420px; margin: 0 auto; padding: 22px; }
.field { display: block; margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input);
  color: #fff;
  font: inherit;
  font-size: 15px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
select option { background: #13284d; color: #fff; }
input[type=email], input[type=password] { direction: ltr; text-align: left; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #1e5aa8, #3fa9f5);
  color: #fff;
  font: inherit;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.secondary { background: var(--card-strong); border: 1.2px solid var(--card-border); }

.error { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }
.notice {
  max-width: 640px; margin: 0 auto 16px; padding: 14px 16px; font-size: 13.5px; line-height: 1.8;
  border-color: rgba(255,213,79,.6);
}
.notice code { direction: ltr; unicode-bidi: embed; background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 6px; }

/* ===== قوائم البيانات ===== */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 220px; }
.breadcrumb { color: var(--yellow); font-weight: bold; font-size: 14px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-radius: 12px;
  background: var(--input);
  border: 1px solid rgba(255,255,255,.55);
  cursor: pointer;
}
.row:hover { border-color: #fff; }
.row .main { min-width: 0; }
.row .main b { display: block; font-size: 15px; }
.row .main > span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.row .count {
  flex: none; min-width: 44px; text-align: center; padding: 4px 10px; border-radius: 12px;
  background: rgba(63,169,245,.18); color: #9ed3ff; font-weight: bold; font-size: 13px;
}
.empty, .loading { text-align: center; color: var(--muted); padding: 28px; }

/* ===== نافذة التفاصيل ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 680px; max-height: 88vh; overflow: auto;
  background: rgba(20,30,54,.97); border: 1.2px solid var(--card-border); border-radius: 18px;
  padding: 20px 22px;
}
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal h3 { margin: 18px 0 6px; font-size: 14.5px; color: var(--yellow); }
.modal ul { margin: 0; padding-inline-start: 18px; }
.modal li { margin: 4px 0; font-size: 14px; line-height: 1.7; }
.modal .none { color: #8b98ab; font-size: 13px; }
.modal .close { margin-top: 18px; }

@media (max-width: 600px) {
  .menu { grid-template-columns: 1fr; }
  .brand img { width: 150px; }
}

/* ===== شاشات الملخص (أسبوعي / شهري) ===== */
.panel { padding: 16px 18px; margin-bottom: 14px; }
.panel-title { margin: 0 0 10px; font-size: 15px; }
.controls { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.controls label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.controls .grow { flex: 1; min-width: 220px; }
.period { display: flex; align-items: center; gap: 10px; }
.period-label { font-weight: bold; color: var(--yellow); min-width: 170px; text-align: center; }
.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn.small { width: auto; padding: 9px 16px; font-size: 14px; white-space: nowrap; }
.btn.green { background: linear-gradient(90deg, #2e7d32, #43a047); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { padding: 14px 16px; text-align: center; }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 28px; margin-top: 4px; }
.summary h3 { margin: 14px 0 6px; font-size: 14px; color: var(--yellow); }
.summary ul { margin: 0; padding-inline-start: 18px; }
.summary li { margin: 3px 0; font-size: 14px; }
.summary .panel-title { margin-top: 0; }
.summary .none { color: #8b98ab; font-size: 13px; }

.chart svg { width: 100%; height: 240px; display: block; }
.chart .bar { fill: #3fa9f5; }
.chart .grid { stroke: rgba(255,255,255,.12); stroke-width: 1; }
.chart .axis { stroke: rgba(255,255,255,.35); stroke-width: 1; }
.chart .lbl, .chart .val { fill: #cbd5e1; font-size: 12px; text-anchor: middle; font-family: inherit; }
.chart .val { fill: #fff; font-weight: bold; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: rgba(255,255,255,.06); }
.chart-tip {
  position: fixed; display: none; z-index: 20; pointer-events: none;
  background: #0b1f3f; border: 1px solid rgba(255,255,255,.35); border-radius: 8px;
  padding: 6px 10px; font-size: 12.5px; color: #fff; text-align: center;
}

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { color: var(--muted); font-weight: bold; text-align: center; padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.25); }
.table td { text-align: center; padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
.table th:first-child, .table td:first-child { text-align: right; }

.print-only { display: none; }

@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat b { font-size: 22px; }
  .period { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .period-label { min-width: 0; order: -1; width: 100%; }
}

/* ===== الطباعة / حفظ PDF: خلفية بيضاء وكلام غامق عشان يتطبع واضح ===== */
@media print {
  html, body { background: #fff !important; color: #111 !important; }
  body::after, .no-print, .chart-tip, .modal-backdrop { display: none !important; }
  .print-only { display: block; text-align: center; margin-bottom: 12px; font-size: 15px; }
  .page { max-width: none; padding: 0; }
  .brand img { filter: invert(1) hue-rotate(180deg); }
  .glass, .row { background: #fff !important; border: 1px solid #bbb !important; backdrop-filter: none; color: #111; }
  .subtitle, .stat span, .section-title, .row .main > span, .table th { color: #444 !important; }
  .summary h3, .panel-title { color: #0b2d5b !important; }
  .chart .bar { fill: #1e5aa8; }
  .chart .lbl { fill: #333; } .chart .val { fill: #111; }
  .chart .grid { stroke: #ddd; } .chart .axis { stroke: #999; }
  .row { break-inside: avoid; }
}

/* ===== متابعة تقدم المشاريع + الإحصائيات ===== */
.st-red { color: #ff6b6b; } .st-green { color: #7cfc98; } .st-yellow { color: #ffd54f; }
.row .main > span.st-green { color: #7cfc98; } .row .main > span.st-yellow { color: #ffd54f; }
.st-gray { color: #9aa5b5; } .st-orange { color: #ffb74d; } .st-blue { color: #81d4fa; }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0 4px 10px; }
.prow { cursor: pointer; }
.prow .main > span { margin-top: 4px; }
.prow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.prow-head .pct { font-weight: bold; font-size: 16px; }
.pbar { position: relative; height: 10px; border-radius: 6px; background: rgba(255,255,255,.12); margin: 8px 0 4px; overflow: visible; }
.pfill { position: absolute; right: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(270deg, #1e5aa8, #3fa9f5); }
.pmark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-right: -1.5px; background: #ffd54f; border-radius: 2px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stats.four .stat span { min-height: 34px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { margin: 5px 0; font-size: 14px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 200px) 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.hbar .ht { height: 12px; background: rgba(255,255,255,.10); border-radius: 6px; }
.hbar .hf { height: 100%; border-radius: 6px; background: #3fa9f5; }
.hbar b { text-align: left; }
@media (max-width: 600px) {
  .stats.four { grid-template-columns: 1fr 1fr; }
  .hbar { grid-template-columns: 90px 1fr 30px; }
}
@media print {
  .pbar { background: #eee; } .pmark { background: #e0a800; }
  .st-green { color: #1b7f3a !important; } .st-red { color: #c62828 !important; }
  .st-yellow { color: #a07800 !important; } .st-orange { color: #c66900 !important; } .st-blue { color: #0b5d8f !important; }
  .muted, .hint { color: #444 !important; }
  .hbar .ht { background: #eee; } .hbar .hf { background: #1e5aa8; }
}

/* ===== شاشات نظم: نوافذ الإدخال والأزرار ===== */
.dlg-body .field { margin-bottom: 12px; }
.dlg-body .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.dlg-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.dlg-actions .btn { flex: 1; }
.btn.danger { background: linear-gradient(90deg, #b71c1c, #e53935); }
.row-actions { display: flex; gap: 8px; flex: none; }
.row-actions button { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.row-actions button.edit { color: #64b5f6; } .row-actions button.del { color: #ef9a9a; }
.row-actions button:hover { border-color: #fff; }
.checks { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.checks label { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: #3fa9f5; }
input[type=date] { color-scheme: dark; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #0b1f3f; border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 10px 18px; border-radius: 12px;
  z-index: 30; transition: all .2s ease; pointer-events: none; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 600px) { .dlg-body .grid2 { grid-template-columns: 1fr; } .row { flex-wrap: wrap; } }

/* ===== شاشة كتابة التقرير اليومي (إتقان) ===== */
textarea {
  width: 100%; min-height: 90px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--input-border); background: var(--input); color: #fff;
  font: inherit; font-size: 15px; outline: none; resize: vertical;
}
textarea:focus { border-color: var(--accent); }
input:disabled, select:disabled { opacity: .7; cursor: not-allowed; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.info-grid div { background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 10px; }
.info-grid span { display: block; color: var(--muted); font-size: 12px; }
.info-grid b { display: block; font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.rrow { border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: rgba(255,255,255,.03); }
.rrow-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rrow-head b { color: var(--yellow); font-size: 14px; }
.rrow-head button { background: none; border: none; color: var(--danger); font: inherit; font-size: 13px; cursor: pointer; }
.rgrid { display: grid; gap: 0 12px; }
.rgrid.c2 { grid-template-columns: 1fr 1fr; }
.rgrid.c3 { grid-template-columns: 2fr 1fr 1fr; }
.rgrid.c4 { grid-template-columns: 1fr 1fr; }
.rgrid .field { margin-bottom: 10px; }
.add-row { background: none; border: 1.2px dashed rgba(255,255,255,.45); color: #fff; border-radius: 10px; padding: 9px; width: 100%; font: inherit; font-size: 14px; cursor: pointer; }
.add-row:hover { border-color: #fff; background: rgba(255,255,255,.05); }
.total-labor { margin-top: 10px; font-size: 14px; color: var(--muted); }
.total-labor b { color: #fff; font-size: 16px; }
.invalid { border-color: #ff6b6b !important; box-shadow: 0 0 0 2px rgba(255,107,107,.25); }
.field-error { color: #ff8a80; font-size: 12px; margin-top: 4px; }
.edit-banner { border-color: rgba(255,213,79,.6); padding: 10px 14px; margin-bottom: 14px; font-size: 14px; color: var(--yellow); text-align: center; }
.submit-bar { margin: 6px 0 30px; }
.report-row .edit-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: bold; color: #64b5f6; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }
.report-row .edit-locked { display: inline-block; margin-top: 8px; font-size: 13px; color: rgba(255,255,255,.55); }
@media (max-width: 640px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
  .rgrid.c3 { grid-template-columns: 1fr 1fr; }
  .rgrid.c3 > .field:first-child { grid-column: 1 / -1; }
}

/* ===== الشاشة الرئيسية وشاشات الأقسام (عمود واحد في النص زي التطبيق) ===== */
.menu.single { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
.menu.single .menu-card { padding: 16px 18px; }
.page-head { text-align: center; margin: 0 0 18px; }
.page-head img { height: 64px; max-width: 170px; object-fit: contain; display: block; margin: 0 auto 10px; background: var(--icon-box); border: 1px solid var(--icon-box-border); border-radius: 16px; padding: 8px 14px; box-sizing: content-box; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* ===== شاشة إدارة المعوقات ===== */
.obs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.obs { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.obs.done { opacity: .72; }
.obs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.obs-head .main { min-width: 0; }
.obs-head .main b { display: block; font-size: 15px; }
.obs-head .main > span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; overflow-wrap: anywhere; }
.obs-type { font-weight: bold; color: var(--yellow); font-size: 15px; }
.obs-desc { margin: 0; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.obs-meta { color: var(--muted); font-size: 13px; }
.obs-meta b { color: #fff; }
.obs-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.pill { flex: none; display: inline-block; font-size: 12px; font-weight: bold; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.pill.warn { background: rgba(255,183,77,.18); color: #ffb74d; }
.pill.ok { background: rgba(124,252,152,.16); color: #7cfc98; }
.pill.prio { margin-inline-start: 6px; font-weight: normal; }
.pill.prio.high { background: rgba(255,107,107,.18); color: #ff8a80; }
.pill.prio.mid { background: rgba(255,213,79,.16); color: #ffd54f; }
.pill.prio.low { background: rgba(129,212,250,.16); color: #81d4fa; }
@media (max-width: 600px) { .obs-list { grid-template-columns: 1fr; } }

/* ===== لوحة إدارة التخطيط: أقسام وكروت الشاشات كلها برّه ===== */
.plan-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 26px 4px 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.18); }
.plan-head:first-child { margin-top: 6px; }
.plan-head h2 { margin: 0; font-size: 18px; color: var(--yellow); }
.plan-head span { color: var(--muted); font-size: 13px; }

/* ===== لوحة إدارة التخطيط: أقسام قابلة للطي (drop panels) ===== */
.sec { margin-bottom: 16px; overflow: hidden; }
.sec > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; user-select: none; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary:hover { background: rgba(255,255,255,.04); }
.sec > summary > img { width: 44px; height: 44px; flex: none; padding: 6px; background: var(--icon-box); border: 1px solid var(--icon-box-border); border-radius: 12px; box-sizing: border-box; }
.sec .t { flex: 1; min-width: 0; }
.sec .t b { display: block; font-size: 17px; color: var(--yellow); }
.sec .t span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.sec .chev { flex: none; font-size: 18px; color: var(--muted); transition: transform .15s ease; }
.sec:not([open]) .chev { transform: rotate(90deg); }
.sec .menu { padding: 4px 16px 16px; }
.sec .menu-card { background: rgba(255,255,255,.04); }

/* ===== تصميم 3D (بيتفعّل بكلاس d3 على <main>) =====
   نفس هوية الموقع: كحلي غامق + إطار أبيض رفيع، لكن بسطوح متدرجة فيها إضاءة من فوق،
   حواف مشطوفة، وظلال عمق، وارتفاع وميلان خفيف عند الوقوف بالماوس */
.d3 .glass {
  background: linear-gradient(150deg, rgba(48,72,118,.78) 0%, rgba(22,36,68,.88) 55%, rgba(12,22,46,.94) 100%);
  border: 1.2px solid rgba(255,255,255,.26);
  border-top-color: rgba(255,255,255,.6);
  border-bottom-color: rgba(255,255,255,.12);
  border-radius: 20px;
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.28),
    inset 0 -3px 8px rgba(0,0,0,.35),
    0 1px 0 rgba(255,255,255,.06),
    0 14px 28px -8px rgba(0,0,0,.6),
    0 4px 10px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}
.d3 .menu { perspective: 1000px; }
.d3 .menu-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .18s ease-out, box-shadow .18s ease-out, border-color .18s ease-out;
  will-change: transform;
}
.d3 .menu-card::after {                       /* لمعة ضوء بتتحرك مع الماوس */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.16), transparent 60%);
  opacity: 0; transition: opacity .18s ease-out;
}
.d3 .menu-card:hover {
  transform: translateY(-5px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  border-color: rgba(255,255,255,.55);
  border-top-color: rgba(255,255,255,.85);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.4),
    inset 0 -3px 8px rgba(0,0,0,.35),
    0 26px 38px -10px rgba(0,0,0,.7),
    0 8px 14px rgba(0,0,0,.4);
}
.d3 .menu-card:hover::after { opacity: 1; }
.d3 .menu-card:active { transform: translateY(-1px) scale(.995); }
.d3 .menu-card .icon-box,
.d3 .sec > summary > img {
  background: linear-gradient(160deg, #f6fcff 0%, #d4ecfd 55%, #b4dbf6 100%);
  border: 1px solid #9fcdef;
  box-shadow:
    inset 0 2px 0 #fff,
    inset 0 -4px 8px rgba(30,90,168,.28),
    0 8px 14px -2px rgba(0,0,0,.55),
    0 2px 0 rgba(255,255,255,.12);
  transform: translateZ(30px);
}
.d3 .menu-card .icon-box img { filter: drop-shadow(0 3px 3px rgba(11,45,91,.35)); }
.d3 .menu-card .text b { text-shadow: 0 2px 4px rgba(0,0,0,.45); }
.d3 .menu-card .arrow { text-shadow: 0 2px 3px rgba(0,0,0,.5); }

/* أقسام اللوحة */
.d3 .sec { overflow: visible; }
.d3 .sec > summary { border-radius: 20px; }
.d3 .sec > summary:hover { background: rgba(255,255,255,.05); }
.d3 .sec .t b { text-shadow: 0 2px 4px rgba(0,0,0,.5); }
.d3 .sec .menu-card { background: linear-gradient(150deg, rgba(58,86,138,.7), rgba(18,30,60,.9)); }

/* أزرار بارزة تتضغط */
.d3 .btn {
  background: linear-gradient(180deg, #4aa3ee 0%, #1e5aa8 100%);
  border: 1px solid rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 0 #0b2d5b, 0 10px 14px rgba(0,0,0,.4);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  transition: transform .08s ease-out, box-shadow .08s ease-out;
}
.d3 .btn.secondary {
  background: linear-gradient(180deg, rgba(70,96,146,.7) 0%, rgba(22,36,68,.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 0 #08183a, 0 10px 14px rgba(0,0,0,.4);
}
.d3 .btn.green {
  background: linear-gradient(180deg, #5fcf65 0%, #2e7d32 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 #1b5e20, 0 10px 14px rgba(0,0,0,.4);
}
.d3 .btn:hover:not(:disabled) { transform: translateY(-1px); }
.d3 .btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 #0b2d5b, 0 3px 6px rgba(0,0,0,.4); }

/* شاشة المعوقات: كروت وأرقام وفلاتر بارزة */
.d3 .obs { transition: transform .18s ease-out, box-shadow .18s ease-out; }
.d3 .obs:hover { transform: translateY(-4px); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.34), inset 0 -3px 8px rgba(0,0,0,.35), 0 24px 34px -10px rgba(0,0,0,.7), 0 6px 12px rgba(0,0,0,.4); }
.d3 .obs.done { opacity: .78; }
.d3 .stat b { text-shadow: 0 3px 6px rgba(0,0,0,.55); }
.d3 .pill { box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.35); }
.d3 input, .d3 select { box-shadow: inset 0 3px 6px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.12); }

@media (prefers-reduced-motion: reduce) {
  .d3 .menu-card, .d3 .obs, .d3 .btn { transition: none; }
  .d3 .menu-card:hover, .d3 .obs:hover { transform: none; }
}

/* ===== الخلفية الجديدة (كلاس nb على body) =====
   بتتطبق على كل الصفحات ما عدا الدخول والرئيسية.
   المباني خلفية ثابتة مثبتة في الأسفل (مفيش حاجة بتتقص لما حجم النافذة يتغير)،
   ولوجو الشركة وسطرا الحقوق عناصر منفصلة. */
@media (min-width: 900px) {
  body.nb { background: transparent; }
  body.nb::before {                       /* الخلفية: ستارة كحلي خفيفة فوق الصورة عشان الكلام يفضل مقروء */
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-color: #00204a;
    background-image:
      linear-gradient(180deg, rgba(0, 26, 60, .30) 0%, rgba(0, 26, 60, .18) 100%),
      url("../img/bg_wide.jpg");
    background-size: auto, cover;
    background-position: 0 0, center bottom;
    background-repeat: no-repeat;
  }
  body.nb::after { display: none; }       /* السكاي لاين القديم */
  body.nb .page { min-height: 100vh; padding-bottom: 120px; max-width: 1560px; }
  body.nb .page::after, body.nb .page::before {   /* سطرا الحقوق في آخر الصفحة */
    position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; direction: ltr;
  }
  body.nb .page::after {
    content: "© 2026 Al-Reyadah FelEmarah Co."; bottom: 36px; padding-top: 14px;
    font-size: 14px; letter-spacing: .08em; color: rgba(206, 222, 242, .92);
    background: linear-gradient(90deg, transparent, rgba(190, 210, 235, .45), transparent) top center / 380px 1px no-repeat;
  }
  body.nb .page::before {
    content: "Designed & developed by Wael Alashkar"; bottom: 12px;
    font-size: 12px; letter-spacing: .07em; color: rgba(160, 184, 214, .88);
  }
}
@media print { body.nb::before, body.nb::after, body.nb .page::before, body.nb .page::after { display: none !important; } }

/* ===== الترتيب العام: شريط علوي موحد بعرض المحتوى (للصفحات اللي فيها nb) =====
   [لوجو الشركة] | [رجوع]  ............  [الإيميل] [تسجيل الخروج] */
@media (min-width: 900px) {
  body.nb .brand { display: none; }                      /* اللوجو دلوقتي جوه الشريط */
  body.nb .page { padding-top: 116px; }
  body.nb .topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: 92px; margin: 0;
    padding: 0 max(20px, calc((100vw - 1560px) / 2 + 16px));   /* نفس حواف المحتوى بالظبط */
    display: flex; align-items: center; gap: 14px; font-size: 14px;
    background: linear-gradient(180deg, rgba(8, 26, 56, .94), rgba(10, 32, 66, .80));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .38), inset 0 -1px 0 rgba(255, 255, 255, .05);
  }
  body.nb .topbar::before {                               /* لوجو الشركة: أول عنصر في الشريط (أقصى اليمين من المحتوى) */
    content: ""; flex: none; width: 150px; height: 80px; margin-inline-end: 8px; padding-inline-end: 22px;
    background: url("../img/company_logo.png") right center / contain no-repeat;
    background-origin: content-box;
    border-inline-end: 1px solid rgba(255, 255, 255, .2);
  }
  body.nb .topbar > a {                                   /* زرار رجوع */
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .07);
    color: #fff; font-weight: bold; text-decoration: none; transition: background .12s, border-color .12s;
  }
  body.nb .topbar > a:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .6); }
  body.nb #userBar { margin-inline-start: auto; gap: 12px; }
  body.nb #userBar > span { color: var(--muted); padding: 7px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
  body.nb #userBar .link-btn.danger {
    padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255, 150, 150, .45);
    background: rgba(183, 28, 28, .18); color: #ffb4b4; font-weight: bold;
  }
  body.nb #userBar .link-btn.danger:hover { background: rgba(229, 57, 53, .32); border-color: rgba(255, 180, 180, .8); }
}
@media print {
  body.nb .topbar { position: static; height: auto; background: none; box-shadow: none; border: 0; padding: 0; }
  body.nb .topbar::before { display: none; }
  body.nb .page { padding-top: 0; }
}

/* ===== كروت وصناديق شفافة (الخلفية بتظهر من ورا) ===== */
@media (min-width: 900px) {
  body.nb .glass, body.nb .panel, body.nb .stat, body.nb .obs, body.nb .menu-card, body.nb .sec .menu-card, body.nb .login-box {
    background: linear-gradient(150deg, rgba(60, 94, 152, .30), rgba(10, 24, 54, .40));
    backdrop-filter: blur(8px) saturate(1.2);
    border-color: rgba(255, 255, 255, .20);
    border-top-color: rgba(255, 255, 255, .46);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -2px 6px rgba(0, 0, 0, .18), 0 12px 26px -12px rgba(0, 0, 0, .5);
  }
  body.nb .menu-card:hover, body.nb .obs:hover { background: linear-gradient(150deg, rgba(74, 112, 176, .34), rgba(14, 30, 64, .38)); }
  /* أقسام التخطيط: من غير صندوق خارجي، عنوان القسم بخط تحته والكروت هي اللي زجاجية */
  body.nb .sec { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; margin-bottom: 10px; }
  body.nb .sec > summary { border-radius: 14px; padding: 12px 16px; background: linear-gradient(150deg, rgba(60, 94, 152, .26), rgba(10, 24, 54, .38)); backdrop-filter: blur(8px) saturate(1.2); border: 1px solid rgba(255, 255, 255, .20); border-top-color: rgba(255, 255, 255, .42); }
  body.nb .sec > summary:hover { background: linear-gradient(150deg, rgba(74, 112, 176, .34), rgba(14, 30, 64, .42)); }
  body.nb .sec .menu { padding: 16px 0 6px; }
  /* الصفوف والحقول */
  body.nb .row { background: rgba(10, 24, 54, .34); backdrop-filter: blur(6px); border-color: rgba(255, 255, 255, .34); }
  body.nb .row:hover { background: rgba(60, 94, 152, .32); }
  body.nb input, body.nb select, body.nb textarea { background: rgba(10, 24, 54, .50); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3); }
  body.nb .rrow { background: rgba(255, 255, 255, .02); }
  body.nb .info-grid div { background: rgba(255, 255, 255, .06); }
  /* وضوح النص فوق الخلفية */
  body.nb .glass, body.nb .panel, body.nb .menu-card, body.nb .obs, body.nb .row, body.nb .stat, body.nb .sec > summary, body.nb .page-head, body.nb h1.title, body.nb .subtitle {
    text-shadow: 0 1px 3px rgba(0, 0, 0, .65);
  }
  body.nb .menu-card .text > span, body.nb .subtitle, body.nb .muted { color: #dbe5f1; }
}

/* ===== اللوحة الرئيسية: كروت المشاريع + اكتمال البيانات ===== */
.stats.five { grid-template-columns: repeat(5, 1fr); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; perspective: 1200px; }
.pcard {
  position: relative; display: block; padding: 16px 18px 14px; color: inherit; text-decoration: none;
  transform-style: preserve-3d; will-change: transform;
  transition: transform .18s ease-out, box-shadow .18s ease-out, border-color .18s ease-out;
}
.pcard::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.16), transparent 60%);
  opacity: 0; transition: opacity .18s ease-out;
}
.pcard:hover { transform: translateY(-5px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); border-color: rgba(255,255,255,.55); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.4), 0 26px 38px -10px rgba(0,0,0,.7), 0 8px 14px rgba(0,0,0,.4); }
.pcard:hover::after { opacity: 1; }
.pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pc-head b { font-size: 17px; text-shadow: 0 2px 4px rgba(0,0,0,.45); }
.pc-head .pct { font-size: 26px; font-weight: bold; color: #7cc4ff; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.pcard .pbar { height: 12px; margin: 10px 0 8px; }
.pc-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.chip.ok { color: #8fe3a8; border-color: rgba(143,227,168,.45); background: rgba(46,160,90,.15); }
.chip.warn { color: #ffcf8a; border-color: rgba(255,207,138,.45); background: rgba(230,150,30,.16); }
.pc-foot { font-size: 12px; }
.dqgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 22px; padding: 6px 16px 12px; }
.dq-h { display: flex; justify-content: space-between; font-size: 13.5px; }
.dq small { color: var(--muted); font-size: 12px; }
@media (max-width: 899px) { .stats.five { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .pcard, .pcard:hover { transition: none; transform: none; } }

/* قسم اكتمال البيانات: صندوق زجاجي كامل عشان الكلام يتقري فوق الخلفية */
@media (min-width: 900px) {
  body.nb .dqsec { background: linear-gradient(150deg, rgba(60, 94, 152, .34), rgba(10, 24, 54, .62)); backdrop-filter: blur(10px) saturate(1.2); border: 1px solid rgba(255, 255, 255, .20); border-top-color: rgba(255, 255, 255, .42); border-radius: 20px; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .5); margin-top: 18px; }
  body.nb .dqsec > summary { background: transparent; border: 0; backdrop-filter: none; }
}

/* ===== صفحة المشروع: التبويبات + التقويم + عناصر مساعدة ===== */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 0 8px; scrollbar-width: thin; }
.tabs[hidden], section[hidden] { display: none !important; }
.tabs button {
  flex: none; font: inherit; font-weight: bold; color: #dbe7f6; cursor: pointer; padding: 10px 20px; border-radius: 14px;
  border: 1.2px solid rgba(255,255,255,.22); border-top-color: rgba(255,255,255,.45);
  background: linear-gradient(160deg, rgba(60,94,152,.40), rgba(10,24,54,.55));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 5px rgba(0,0,0,.25), 0 6px 12px -6px rgba(0,0,0,.6);
  transition: transform .15s, background .15s, border-color .15s;
}
.tabs button:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.55); }
.tabs button.on {
  color: #fff; border-color: #ffd54f; border-top-color: #ffe58a;
  background: linear-gradient(160deg, rgba(40,110,200,.75), rgba(14,40,90,.85));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 5px rgba(0,0,0,.3), 0 0 0 1px rgba(255,213,79,.35), 0 8px 16px -6px rgba(0,0,0,.7);
}
.pbar.big { height: 18px; }
.pbar.big .pfill, .pbar.big { border-radius: 10px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.legend .c-has, .legend .c-miss, .legend .c-off { height: 12px; width: 12px; border-radius: 4px; }
.legend .c-has { background: #2e9e5a; } .legend .c-miss { background: #c8433a; } .legend .c-off { background: rgba(255,255,255,.25); }
.mini { display: flex; align-items: center; gap: 8px; } .mini .pbar { flex: 1; margin: 0; } .mini b { min-width: 38px; }
.table small { display: block; font-size: 11.5px; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-h { text-align: center; color: var(--muted); font-size: 13px; padding: 4px 0; }
.cal-d {
  font: inherit; color: #fff; min-height: 70px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: default;
}
.cal-d b { font-size: 17px; } .cal-d small { font-size: 12px; opacity: .9; }
.cal-d.empty { visibility: hidden; }
.cal-d.has { cursor: pointer; background: linear-gradient(150deg, rgba(46,160,90,.65), rgba(20,90,50,.65)); border-color: rgba(143,227,168,.65); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 12px -6px rgba(0,0,0,.6); transition: transform .12s; }
.cal-d.has:hover { transform: translateY(-3px); }
.cal-d.miss { background: linear-gradient(150deg, rgba(200,67,58,.55), rgba(110,28,28,.55)); border-color: rgba(255,150,140,.6); }
.cal-d.off, .cal-d.future { opacity: .45; }
.cal-d.pending { border-style: dashed; }
.cal-d.today { outline: 2px solid #ffd54f; outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; color: #fff; background: rgba(255,255,255,.06); border: 0; padding: 7px 18px; cursor: pointer; }
.seg button.on { background: rgba(40,110,200,.7); font-weight: bold; }
.page-head h1 { margin-bottom: 4px; }
@media (max-width: 700px) { .cal-h { font-size: 10px; } .cal-d { min-height: 52px; } .cal-d b { font-size: 14px; } .cal-d small { font-size: 10px; } .cal-grid { gap: 4px; } }
@media print { .tabs { display: none !important; } section[hidden] { display: block !important; } }

/* الأسابيع الجاية */
.la-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 6px 0 4px; color: inherit; text-decoration: none; transition: transform .15s, border-color .15s; }
.la-banner:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.55); }
.la-banner img { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(160deg, #f6fcff, #b4dbf6); padding: 6px; box-shadow: inset 0 2px 0 #fff, 0 6px 12px -2px rgba(0,0,0,.5); }
.la-banner .t { flex: 1; display: flex; flex-direction: column; gap: 3px; } .la-banner .t b { font-size: 16px; } .la-banner .t span { font-size: 13px; color: var(--muted); } .la-banner em { font-style: normal; font-weight: bold; }
.la-banner .chev { font-size: 26px; color: var(--muted); }
.row.la { border-inline-start: 4px solid rgba(255,255,255,.25); }
.row.la.crit { border-inline-start-color: #ff6b61; background: rgba(200, 67, 58, .16); }
.empty.small { padding: 10px; font-size: 13px; }
.row.la .main > span b, .row.la .main > span strong { display: inline; }
body.nb .section-title { color: #dbe7f6; text-shadow: 0 1px 5px rgba(0, 0, 0, .85); }

/* Gantt */
.gantt-wrap { overflow-x: auto; }
.gantt { min-width: 780px; }
.g-head, .g-row { display: flex; align-items: stretch; }
.g-lab { flex: none; width: var(--lab, 230px); padding: 0 6px; font-size: 13.5px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.g-head .g-lab { color: var(--muted); font-size: 13px; }
.g-axis { position: relative; flex: 1; height: 26px; border-bottom: 1px solid rgba(255,255,255,.3); }
.g-axis span { position: absolute; top: 3px; padding-right: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.g-body { position: relative; }
.g-over { position: absolute; top: 0; bottom: 0; left: 0; right: var(--lab, 230px); pointer-events: none; }
.g-gl { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.1); }
.g-today { position: absolute; top: 0; bottom: 0; width: 0; border-right: 2px dashed #ffd54f; z-index: 3; }
.g-today b { position: absolute; top: -2px; right: 4px; font-size: 11px; color: #ffd54f; text-shadow: 0 1px 3px #000; }
.g-row { height: 40px; border-bottom: 1px solid rgba(255,255,255,.07); }
.g-row:hover { background: rgba(255,255,255,.04); }
.g-track { position: relative; flex: 1; }
.g-bar {
  position: absolute; top: 9px; height: 22px; border-radius: 8px; overflow: hidden; z-index: 2;
  background: rgba(143,184,255,.28); border: 1px solid rgba(143,184,255,.75);
  box-shadow: 0 4px 8px -3px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.2);
}
.g-fill { position: absolute; right: 0; top: 0; bottom: 0; background: linear-gradient(270deg, #1e5aa8, #3fa9f5); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.g-bar span { position: relative; z-index: 1; display: block; text-align: center; line-height: 20px; font-size: 11.5px; font-weight: bold; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.g-bar.late { border-color: #ff6b61; background: rgba(255,107,97,.25); }
.g-bar.late .g-fill { background: linear-gradient(270deg, #b83a32, #ff6b61); }
.g-bar.done { border-color: #5cc888; } .g-bar.done .g-fill { background: linear-gradient(270deg, #1f7a45, #2e9e5a); }
.g-bar.approx { border-style: dashed; }
@media print { .gantt-wrap { overflow: visible; } .gantt { min-width: 0; } }

/* كانبان المعوقات */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 14px; }
.kcol { border-radius: 18px; padding: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(8, 22, 50, .35); backdrop-filter: blur(6px); min-height: 160px; transition: border-color .15s, background .15s; }
.kcol header { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 10px; font-size: 15px; }
.kcol.open header b { color: #ffcf8a; } .kcol.progress header b { color: #7cc4ff; } .kcol.resolved header b { color: #8fe3a8; }
.kcount { min-width: 28px; text-align: center; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.12); font-weight: bold; font-size: 13px; }
.kbody { display: flex; flex-direction: column; gap: 12px; }
.kcol.over { border-color: #ffd54f; background: rgba(40, 80, 150, .35); }
.kcol .obs { cursor: grab; }
.kcol .obs.dragging { opacity: .45; }
.kcol .obs.open { border-inline-start: 4px solid #ffb74d; }
.kcol .obs.progress { border-inline-start: 4px solid #3fa9f5; }
.kcol .obs.resolved { border-inline-start: 4px solid #2e9e5a; opacity: .88; }
.kempty { text-align: center; color: var(--muted); font-size: 13px; padding: 22px 0; border: 1px dashed rgba(255,255,255,.2); border-radius: 12px; }
@media (max-width: 1000px) { .kanban { grid-template-columns: 1fr; } }
.pill.prog { background: rgba(63,169,245,.2); color: #8fd0ff; border: 1px solid rgba(63,169,245,.55); }
.stats.four .st-blue, .st-blue { color: #7cc4ff; }

/* كانبان المعوقات */
.kb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.kb-col { border-radius: 18px; border: 1px solid rgba(255,255,255,.18); border-top-color: rgba(255,255,255,.38); background: rgba(8, 22, 50, .38); backdrop-filter: blur(8px); padding: 10px; transition: background .15s, border-color .15s; min-height: 160px; }
.kb-col.over { background: rgba(40, 110, 200, .30); border-color: #7cc4ff; }
.kb-col header { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; border-bottom: 3px solid var(--kc, #ffb74d); margin-bottom: 10px; }
.kb-col header b { font-size: 16px; } .kb-n { min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: bold; background: rgba(255,255,255,.14); }
.kb-col.c-open { --kc: #ffb74d; } .kb-col.c-progress { --kc: #5aa9ff; } .kb-col.c-done { --kc: #4cc27f; }
.kb-body { display: flex; flex-direction: column; gap: 10px; max-height: 68vh; overflow-y: auto; padding: 2px; }
.kb-empty { text-align: center; color: var(--muted); padding: 22px 0; font-size: 13px; }
.kb-card { cursor: grab; padding: 12px 14px; gap: 7px; }
.kb-card.dragging { opacity: .45; transform: scale(.98); }
.kb-card .obs-actions .btn { padding: 5px 10px; font-size: 12.5px; }
.kb-card .obs-desc { font-size: 13.5px; line-height: 1.7; }
@media (max-width: 1000px) { .kb { grid-template-columns: 1fr; } .kb-body { max-height: none; } }

/* مؤشر صحة المشروع */
.hdot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-inline-end: 8px; vertical-align: middle; background: #8896ab; box-shadow: 0 0 0 3px rgba(255,255,255,.12), 0 0 10px currentColor; color: #8896ab; }
.hdot.h-green { background: #3fd37a; color: #3fd37a; } .hdot.h-yellow { background: #ffc94d; color: #ffc94d; } .hdot.h-red { background: #ff5f55; color: #ff5f55; } .hdot.h-gray { background: #8896ab; color: #8896ab; }
.pcard { border-inline-start: 5px solid #8896ab; }
.pcard.h-green { border-inline-start-color: #3fd37a; } .pcard.h-yellow { border-inline-start-color: #ffc94d; } .pcard.h-red { border-inline-start-color: #ff5f55; }
.health-row { margin-top: 12px; }
.page-head p .hdot { margin-inline-end: 6px; }

/* التقويم العام */
.cal-d.cg { min-height: 88px; justify-content: flex-start; padding: 7px 4px; cursor: pointer; transition: transform .12s, border-color .12s; }
.cal-d.cg:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.55); }
.cal-d.cg.sel { outline: 2px solid #7cc4ff; outline-offset: 1px; background: rgba(60, 120, 210, .28); }
.cal-d.cg.off, .cal-d.cg.future { opacity: .55; }
.dcs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 4px; }
.dc { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); white-space: nowrap; }
.dc.ok { background: rgba(46,160,90,.45); border-color: rgba(143,227,168,.7); }
.dc.mid { background: rgba(230,170,40,.40); border-color: rgba(255,207,138,.8); }
.dc.bad { background: rgba(200,67,58,.50); border-color: rgba(255,150,140,.8); }
.dc.due { background: rgba(63,169,245,.28); border-color: rgba(124,196,255,.75); } .dc.due.late { background: rgba(200,67,58,.40); border-color: rgba(255,150,140,.8); }
.legend .c-mid { background: #d9a03a; height: 12px; width: 12px; border-radius: 4px; }
a.row.due-row { color: inherit; text-decoration: none; display: flex; }
@media (max-width: 700px) { .cal-d.cg { min-height: 64px; } .dc { font-size: 9.5px; padding: 0 4px; } }

/* ===== جرس التنبيهات ===== */
.bell-wrap { position: relative; flex: none; }
.bell-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; font-size: 18px; line-height: 1;
  border: 1px solid rgba(255,255,255,.26); background: rgba(255,255,255,.07); color: #fff; }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { background: rgba(255,255,255,.16); }
.bell-btn.has .bell-ic { display: inline-block; animation: bellring 2.4s ease-in-out 1; transform-origin: 50% 10%; }
@keyframes bellring { 0%,100% { transform: rotate(0) } 10%,30% { transform: rotate(14deg) } 20%,40% { transform: rotate(-14deg) } 50% { transform: rotate(0) } }
.bell-badge { position: absolute; top: -6px; inset-inline-start: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #e53935; color: #fff; font-size: 11px; line-height: 20px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.bell-panel { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60; width: min(380px, 92vw); max-height: 70vh; display: flex; flex-direction: column;
  border-radius: 14px; background: rgba(10,30,62,.97); border: 1px solid rgba(255,255,255,.22); box-shadow: 0 18px 44px rgba(0,0,0,.55); color: #fff; overflow: hidden; }
.bell-panel[hidden] { display: none; }
.bell-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.14); }
.bell-rf { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; }
.bell-body { overflow: auto; padding: 6px 0; }
.bell-g { padding: 8px 14px 4px; font-size: 12px; color: var(--muted); font-weight: bold; }
.bell-it { display: flex; gap: 10px; padding: 9px 14px; color: #fff; text-decoration: none; align-items: flex-start; }
.bell-it:hover { background: rgba(255,255,255,.09); }
.bell-it div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.bell-it span { color: #cfd9ea; font-size: 12.5px; }
.bell-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #fb8c00; }
.bell-it.red .bell-dot { background: #e53935; }
.bell-empty { padding: 22px 14px; text-align: center; color: var(--muted); }
.bell-f { padding: 8px 14px; font-size: 11.5px; color: var(--muted); border-top: 1px solid rgba(255,255,255,.1); text-align: center; }
@media (max-width: 899px) { .bell-wrap { margin-inline-start: 8px; } .bell-panel { inset-inline-end: auto; inset-inline-start: -4px; } }
@media print { .bell-wrap { display: none; } }

/* ===== معالج التقرير اليومي: بيانات ثابتة فوق + قايمة أقسام على اليمين + التالي ===== */
.wiz { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 24px; }
.wiz-rail { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 110px; }
.wiz-tab { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 12px; cursor: pointer; font: inherit; font-size: 14px; color: #fff; text-align: start;
  border: 1px solid rgba(255,255,255,.2); background: rgba(10,30,62,.55); backdrop-filter: blur(6px); transition: background .12s, border-color .12s, transform .12s; }
.wiz-tab:hover { background: rgba(255,255,255,.12); }
.wiz-tab i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: bold; background: rgba(255,255,255,.14); }
.wiz-tab span { flex: 1; }
.wiz-tab em { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-style: normal; font-size: 12px; line-height: 22px; text-align: center; background: rgba(76,175,80,.28); color: #a5d6a7; }
.wiz-tab em:empty { display: none; }
.wiz-tab.on { background: linear-gradient(135deg, #1e6fd0, #17a2c8); border-color: rgba(255,255,255,.7); box-shadow: 0 8px 20px rgba(0,0,0,.4); transform: translateX(-4px); }
.wiz-tab.on i { background: rgba(255,255,255,.28); }
.wiz-tab.done i { background: #2e7d32; }
.wiz-tab.seen i { background: rgba(255,213,79,.35); }
.wiz-step[hidden] { display: none; }
.wiz-nav { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.wiz-nav .btn { width: auto; min-width: 130px; margin: 0; }
.wiz-nav .btn:disabled { opacity: .4; cursor: default; }
.wiz-nav .btn[hidden] { display: none; }
.wiz-pos { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }
.wiz-nav #btnSubmit { margin-inline-start: auto; min-width: 200px; }
@media (max-width: 899px) {
  .wiz { grid-template-columns: 1fr; gap: 10px; }
  .wiz-rail { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 4px; gap: 6px; scrollbar-width: thin; }
  .wiz-tab { width: auto; flex: none; padding: 8px 10px; font-size: 13px; }
  .wiz-tab.on { transform: none; }
  .wiz-nav { flex-wrap: wrap; } .wiz-pos { order: -1; flex-basis: 100%; }
  .wiz-nav .btn { flex: 1; }
}
@media (min-width: 1100px) { .wiz-top .info-grid { grid-template-columns: repeat(5, 1fr); } }

/* ===== مقاولو الباطن ===== */
.stats.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .stats.three { grid-template-columns: 1fr 1fr; } }
.sub-card { padding: 14px 16px; margin-bottom: 10px; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; margin-bottom: 8px; }
.sub-head .main { display: flex; flex-direction: column; gap: 3px; }
.sub-head .main span { color: var(--muted); font-size: 13px; }
.sub-n { text-align: center; } .sub-n b { display: block; font-size: 22px; } .sub-n small { color: var(--muted); }
.sub-card.open { border-color: rgba(255,255,255,.55); }
.sub-detail { margin-top: 12px; }
.sub-detail .tbl-wrap { overflow-x: auto; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover { background: rgba(255,255,255,.08); }

/* ===== القايمة الجانبية ===== */
.sn-btn { display: none; }
.sidenav { position: fixed; top: 108px; inset-inline-start: max(20px, calc((100vw - 1560px) / 2 + 16px)); width: 200px; z-index: 15; display: flex; flex-direction: column; gap: 6px;
  padding: 12px; border-radius: 16px; background: rgba(10,30,62,.72); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.sn-t { font-size: 12px; color: var(--muted); padding: 2px 8px 6px; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; color: #fff; text-decoration: none; font-size: 14px; border: 1px solid transparent; }
.sidenav a:hover { background: rgba(255,255,255,.12); }
.sidenav a.on { background: linear-gradient(135deg, #1e6fd0, #17a2c8); border-color: rgba(255,255,255,.55); font-weight: bold; }
.sidenav a i { font-style: normal; width: 22px; text-align: center; }
.sn-scrim { display: none; }
@media (min-width: 1100px) { body.has-nav .page { padding-inline-start: 236px; } }
@media (max-width: 1099px) {
  .sn-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 20px; color: #fff;
    border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); flex: none; }
  .sidenav { top: 0; bottom: 0; inset-inline-start: 0; width: min(260px, 80vw); border-radius: 0; padding-top: 20px; transform: translateX(100%); transition: transform .2s; z-index: 70; background: rgba(8,24,52,.98); }
  body.sn-open .sidenav { transform: none; }
  body.sn-open .sn-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.5); }
}
@media print { .sidenav, .sn-btn { display: none; } body.has-nav .page { padding-inline-start: 0; } }
