/* ==========================================================================
   aswar.css — هويّة «تطبيق المخازن المتعدّدة» (MWPortal) في تطبيق أسوار (ADR-013 · DESIGN_SYSTEM.md)

   الترتيب في _Head: lib/mwportal-ui/tokens.css ← base.css ← هذا الملفّ — كترتيب MWPortal نفسه
   (tokens → base → shell → app). الرموز والخطوط والأساس من نسخة MWPortal.UI المثبّتة (lib/README.md)،
   وهذا الملفّ:
     ١) أشكال MWPortal **بأسمائها كما هي**، منقولةً قاعدةً قاعدة من مصادرها (مذكورة فوق كلّ قسم):
        MWPortal.Web/wwwroot/shell.css · app.css · وملفّات .razor.css بعد نزع النطاق (::deep).
     ٢) ما يخصّ أسوار وحده، ببادئة aw- (بطاقة المشروع، شريط الأرض، حاويات الرسوم…)، من رموز MWPortal.

   القاعدة الحاكمة: لا لون صريحاً (#RRGGBB) خارج كتلة :root — الألوان كلّها رموز MWPortal (يفرضه اختبار).
   ========================================================================== */

:root {
    /* سمةٌ فاتحة وحدها (ADR-013): لا data-theme على <html>، فكتلة MWPortal الداكنة لا تعمل */
    color-scheme: light;

    /* ألوان أجزاء الأرض الخمسة في الأشرطة والرسوم — من رموز الحالة في MWPortal */
    --aw-land-plots: var(--status-blue);
    --aw-land-streets: var(--text-placeholder);
    --aw-land-landowner: var(--status-amber);
    --aw-land-green: var(--status-green);
    --aw-land-commercial: var(--status-purple);

    /* هامش المحتوى وسقف عرضه — طلب المالك (2026-10-27): «هامش محتوى السكرين قليل جدا، زده ليكون المحتوى محصور
       للوسط اكثر». في MWPortal الهامش --content-pad (32) والسقف --content-max (1600)؛ هنا هامشٌ جانبيٌّ يكبر مع
       الشاشة حتّى 96، وسقفٌ 1280 يتوسّط ما زاد عنه. والهامش العلويّ يبقى --content-pad: به تحاذي القائمةُ الجانبيّة
       عنوانَ الشاشة. والشاشات الصغيرة (≤900px) على هامشها كما هو */
    --aw-content-gutter: clamp(var(--content-pad), 5vw, 96px);
    --aw-content-max: 1280px;
}

/* ---------- الإطار — MWPortal.Web/wwwroot/shell.css ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 20;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex;
    height: var(--topbar-h);
    background: var(--bg-page);
    align-items: center;
    gap: 16px;
    /* هامش أسوار وسقفها (:root) — فيبدأ البحث حيث يبدأ عنوان الشاشة */
    padding: 0 max(var(--aw-content-gutter), calc((100% - var(--aw-content-max)) / 2));
    position: sticky;
    top: 0;
    z-index: 30;
}
.gsearch { position: relative; flex: 1 1 auto; max-width: 480px; min-width: 0; margin: 0; }
/* لوحة نتائج البحث العامّ — MWPortal.Web/Components/Shared/GlobalSearch.razor.css */
.gsearch-backdrop { position: fixed; inset: 0; z-index: 40; }
.gsearch-panel {
    position: absolute; top: calc(100% + 8px); inset-inline-start: 0;
    z-index: 41; width: 100%; min-width: 300px; max-width: calc(100vw - 24px);
    max-height: 70vh; overflow-y: auto;
    background: var(--bg-card); border: 1px solid var(--border-default);
    border-radius: var(--r-card-sm); box-shadow: var(--shadow-lift); padding: 6px;
}
.gsearch-group { font-size: 11px; font-weight: 700; color: var(--text-tertiary); padding: 8px 8px 4px; }
.gsearch-row {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px; border: none; background: transparent; cursor: pointer;
    border-radius: var(--r-btn); text-align: start; color: var(--text-primary);
}
.gsearch-row.hi, .gsearch-row:hover { background: var(--bg-hover); text-decoration: none; }
.gsearch-row-ico {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--r-tile);
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-hover); color: var(--text-secondary);
}
.gsearch-row.hi .gsearch-row-ico { background: var(--bg-card); }
.gsearch-row-ico svg { width: 16px; height: 16px; }
.gsearch-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gsearch-row-body b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch-row-body span { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch-empty { padding: 18px 12px; text-align: center; color: var(--text-secondary); font-size: 12.5px; }
@media (max-width: 480px) {
    .gsearch-panel { position: fixed; inset-inline: 12px; top: calc(var(--topbar-h) + 4px); width: auto; min-width: 0; max-width: none; }
}
/* المبدِّل — MWPortal: app.css */
.notion-seg {
    display: inline-flex; align-items: center; gap: 2px;
    height: 36px; padding: 3px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    flex-shrink: 0; margin: 0;
}
.notion-seg-btn {
    position: relative; height: 28px; padding: 0 14px;
    border: 0; background: transparent;
    color: var(--text-tertiary);
    border-radius: 7px;
    cursor: pointer; font-family: inherit;
    font-size: 12px; font-weight: 600; line-height: 1;
    display: inline-flex; align-items: center; gap: 6px;
    transition: color .15s, background .15s, box-shadow .15s, transform .08s;
}
.notion-seg-btn:hover:not(:disabled) { color: var(--text-secondary); text-decoration: none; }
.notion-seg-btn.is-active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(var(--shadow-rgb), .06), 0 0 0 .5px rgba(var(--shadow-rgb), .04);
    cursor: default;
}
.notion-seg-btn:not(.is-active):active:not(:disabled) { transform: scale(.96); }
.notion-seg-btn:focus-visible { outline: 2px solid var(--status-blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .notion-seg-btn, .notion-seg-btn:active { transform: none; }
}
.logout-form { margin: 0; }
.hamburger {
    display: none;
    width: 38px; height: 38px;
    border: 1px solid var(--border-default);
    border-radius: var(--r-btn);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.hamburger svg { width: 20px; height: 20px; }
.mobile-nav-backdrop { position: fixed; inset: 0; background: rgba(var(--shadow-rgb), .45); z-index: 90; }
.mobile-nav {
    position: fixed;
    top: 0; bottom: 0;
    inset-inline-start: 0;
    width: 268px;
    max-width: 84vw;
    background: var(--bg-card);
    z-index: 91;
    overflow-y: auto;
    padding-bottom: 24px;
    box-shadow: 12px 0 34px rgba(var(--shadow-rgb), .18);
    animation: mobile-nav-in .18s ease-out;
}
@keyframes mobile-nav-in {
    from { transform: translateX(100%); opacity: .4; }
    to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .mobile-nav { animation: none; } }
.mobile-nav-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 8px;
}
.mobile-nav-close {
    margin-inline-start: auto; border: none; background: transparent;
    color: var(--text-tertiary); font-size: 1rem; cursor: pointer; padding: 4px 8px;
}
.mobile-nav-sec { padding: 12px 16px 4px; font-size: 11px; font-weight: 700; color: var(--text-tertiary); letter-spacing: .02em; }
/* رأس الدرج: الشعار والاسم (سطران على الأكثر) — app.css (3477–3492) */
.mobile-nav-brand {
    flex: 1; min-width: 0; align-self: stretch; min-height: 32px;
    display: flex; align-items: center; gap: 9px;
    font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.mobile-nav-brand .sidebar-brand-name {
    white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.mobile-nav-logout { padding: 16px 16px 0; }
.content { padding: var(--content-pad) var(--aw-content-gutter); }
.content-container { max-width: var(--aw-content-max); margin-inline: auto; }

/* ---------- القائمة الجانبيّة: ثلاث بطاقات عائمة — app.css (3377–3708) ---------- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: calc(var(--content-pad) + var(--shell-inset)) 0 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-default) transparent;
}
.sidebar-brand {
    margin: var(--shell-inset) var(--shell-inset) 0;
    padding: var(--shell-card-pad);
    height: calc(var(--topbar-h) - 2 * var(--shell-inset));
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-card-sm);
    box-shadow: var(--shadow-card);
}
.sidebar-brand-logo { flex: none; height: 26px; width: auto; max-width: 84px; object-fit: contain;
    border-radius: 4px; background: var(--logo-plate); box-shadow: 0 0 0 3px var(--logo-plate); }
.sidebar-brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-list {
    list-style: none;
    margin: 0 var(--shell-inset);
    padding: var(--shell-card-pad);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-card-sm);
    box-shadow: var(--shadow-card);
}
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    border-radius: var(--r-tile);
    line-height: 1.2;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: start;
}
.nav-item:hover {
    background: color-mix(in srgb, var(--bg-hover) 50%, var(--bg-card));
    color: var(--text-primary);
    text-decoration: none;
}
.nav-item.active { background: var(--bg-input); color: var(--text-primary); font-weight: 500; }
.nav-item.active::before {
    content: "";
    position: absolute;
    inset-inline-start: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--lime);
}
.nav-ic { width: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); flex-shrink: 0; }
.nav-ic svg { width: 16px; height: 16px; }
.nav-item.active .nav-ic { color: var(--text-primary); }
.sidebar-account {
    margin: 0 var(--shell-inset) var(--shell-inset);
    padding: var(--shell-card-pad);
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-card-sm);
    box-shadow: var(--shadow-card);
}
.account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-page);
    border-radius: var(--r-tile);
    width: 100%;
    color: var(--text-primary);
}
.account-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--lime-soft);
    display: grid; place-items: center;
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    flex-shrink: 0;
}
.account-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.account-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.account-name { font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { font-size: 11px; color: var(--text-tertiary); line-height: 1.2; }
.account-logout {
    width: 30px; height: 30px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; border-radius: var(--r-tile);
    color: var(--text-secondary); cursor: pointer;
    transition: background .1s, color .1s;
}
.account-logout:hover { background: var(--overlay-light); color: var(--status-red); }
.account-logout svg { width: 15px; height: 15px; }

/* ---------- حركة الأيقونة عند المرور: لكلّ أيقونةٍ حركتها، تُعرف ببادئة رسمها — app.css (131–188) كما هي؛
   والمفردات (@keyframes mw-*) في lib/mwportal-ui/base.css. ولا شيء منها لمن طلب تقليل الحركة ---------- */
@media (prefers-reduced-motion: no-preference) {
    /* الجرسُ (‏التنبيهات · قارب النفاد) يرنّ */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:is(:has(path[d^="M6 9a6 6 0 0 1 12 0"]), :has(path[d^="M6 8a6 6 0 0 1 12 0"])) { animation: mw-ring .8s ease-in-out; transform-origin: 50% 8%; }
    /* القمرُ (‏الوضعُ الليليّ) يميل */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M21 12.8A9 9 0 1 1 11.2 3"]) { animation: mw-tilt .6s ease-in-out; }
    /* الشمسُ تدور أشعّتُها */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M12 2v2M12 20v2"]) { animation: mw-turn .6s ease-in-out; }
    /* البيتُ (‏لوحة المعلومات) يقفز */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M3 10.5 12 3l9 7.5"]) { animation: mw-hop .5s ease-out; }
    /* المكعّبُ (‏دليل المواد · بطاقاتُ المواد) يهتزّ */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M21 8.2 12 3 3 8.2"]) { animation: mw-wiggle .6s ease-in-out; }
    /* سهما العمليات يفترقان — الأعلى نحو رأسه */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M7 7h13"]) path:first-of-type { animation: mw-apart-end .55s ease-in-out; }
    /* — والأسفلُ نحو رأسه */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M7 7h13"]) path:last-of-type { animation: mw-apart-start .55s ease-in-out; }
    /* أعمدةُ المخزون تنمو من قاعدتها */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M4 20V10M10 20V4"]) path:first-of-type { animation: mw-grow .6s ease-in-out; transform-box: fill-box; transform-origin: 50% 100%; }
    /* — والمكبّرةُ ترتفع */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M4 20V10M10 20V4"]) :is(circle, path:last-of-type) { animation: mw-lift .6s ease-in-out; }
    /* الترسُ (‏الإعدادات) يدور */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M19.4 15a1.65"]) { animation: mw-turn .6s ease-in-out; }
    /* علامةُ الاستفهام (‏المساعدة) تتمايل */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M9.1 9a3 3 0 0 1 5.8 1"]) { animation: mw-wiggle .6s ease-in-out; }
    /* الشاحنةُ (‏بطاقات النقل · ناقل · في الطريق) تتقدّم */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:is(:has(path[d^="M1 3h13v13H1z"]), :has(path[d^="M14 7h4l3 3v5h-2"])) { animation: mw-drive .6s ease-in-out; }
    /* التحديثُ يلفّ */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M21 12a9 9 0 1 1-3-6.7"]) { animation: mw-spin .6s ease-in-out; }
    /* سهمُ التصدير يصعد من صينيّته */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M17 8l-5-5-5 5"]) path:not([d^="M21 15v4"]) { animation: mw-lift .5s ease-in-out; }
    /* سهمُ التنزيل يهبط إليها */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M7 10l5 5 5-5"]) path:not([d^="M21 15v4"]) { animation: mw-dip .5s ease-in-out; }
    /* الطابعةُ تُخرج ورقتَها */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M6 9V2h12v7"]) rect { animation: mw-dip .5s ease-in-out; }
    /* التقريرُ يُرفع */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M14 3v5h5"]) { animation: mw-lift .5s ease-in-out; }
    /* علامةُ الإضافة تدور */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M12 5v14"]):has(path[d^="M5 12h14"]) { animation: mw-turn .5s ease-in-out; }
    /* السهمُ النازل (‏قيود اليوم) يهبط */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M12 5v14"]):has(path[d^="m19 12-7 7-7-7"]) { animation: mw-dip .5s ease-in-out; }
    /* العلامةُ (‏العروض) تنزل */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="m19 21-7-4-7 4V5"]) { animation: mw-dip .5s ease-in-out; }
    /* العربةُ (‏ورقةُ طلبٍ للمعروض) تتقدّم */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(circle[cx="9"][cy="20"]) { animation: mw-drive .6s ease-in-out; }
    /* عقربُ الساعة (‏العمل المفتوح) يدور */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M12 7v5l3 2"]) path { animation: mw-spin .8s ease-in-out; transform-box: view-box; transform-origin: 12px 12px; }
    /* دائرةُ المنع (‏متوقفة) تتمايل */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="m5.6 5.6 12.8 12.8"]) { animation: mw-wiggle .6s ease-in-out; }
    /* علامةُ النفاد تدور في دائرتها */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="m15 9-6 6"]) path { animation: mw-turn .5s ease-in-out; transform-box: view-box; transform-origin: 12px 12px; }
    /* مثلّثُ التحذير (‏تحتاج إعادة طلب · منخفضة) يرتجف */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M10.3 3."]) { animation: mw-shake .5s ease-in-out; }
    /* الشخصُ والجماعةُ (‏الجهات · زبون) يقفزان */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:is(:has(path[d^="M17 21v-2a4 4 0 0 0-4-4H5"]), :has(path[d^="M20 21v-2a4 4 0 0 0-4-4H8"])) { animation: mw-hop .5s ease-out; }
    /* الوسمُ (‏أخرى) يتأرجح من ثقبه */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M20.6 13.4 12 22"]) { animation: mw-wiggle .6s ease-in-out; transform-origin: 30% 30%; }
    /* المبنى (‏مورد) يرتفع */
    :is(button.icon-btn, .nav-item, .lt-actions .btn:not(:disabled), .kpi-card--link):hover svg:has(path[d^="M3 21V8l6-4 6 4v13"]) { animation: mw-lift .5s ease-in-out; }
}

/* ≤900px: القائمة تختفي ويظهر زرّ الدرج — app.css */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .hamburger { display: flex; }
    .content { padding: 14px 12px; }
    header.topbar { padding: 0 16px; }
    h1 { font-size: 17px; }
}

/* ---------- بحث الشريط العلويّ — MWPortal.UI/Components/SearchBox.razor.css ---------- */
.searchbox {
    position: relative; z-index: 42;
    display: flex; align-items: center; gap: 8px;
    height: calc(var(--topbar-h) - 2 * var(--shell-inset)); padding: 0 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-card-sm);
    box-shadow: var(--shadow-card);
    transition: border-color .15s, box-shadow .15s;
}
.searchbox:focus-within { border-color: var(--border-hover); box-shadow: var(--shadow-lift); }
.searchbox-ico { display: flex; color: var(--text-placeholder); flex-shrink: 0; }
.searchbox-ico svg { width: 16px; height: 16px; }
.searchbox-input {
    flex: 1; min-width: 0; border: none; background: transparent; outline: none;
    font-size: 13px; color: var(--text-primary); font-family: inherit;
}
.searchbox-input::placeholder { color: var(--text-placeholder); }
.searchbox-kbd {
    direction: ltr;
    flex-shrink: 0; font-size: 11px; color: var(--text-placeholder);
    background: var(--bg-card); border: 1px solid var(--border-default);
    border-radius: 4px; padding: 1px 6px; font-family: inherit;
    line-height: 1.3; opacity: 0.6; transition: opacity 0.15s;
}
/* القاعدتان معاً وبترتيبهما: متساويتان، فالقصاصة تختفي أثناء الكتابة لأنّ الثانية ثانية */
.searchbox:hover .searchbox-kbd { opacity: 1; }
.searchbox:focus-within .searchbox-kbd { opacity: 0; }

/* ---------- البطاقة ورأس الصفحة — app.css (13–32 · 2357–2367) ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-card-sm);
    box-shadow: var(--shadow-card);
}
.card-pad { padding: 18px; }
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.page-head h1 { margin: 0; }
.list-head-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list-head h1 { display: inline-flex; align-items: center; gap: 8px; }
.h1-ico { display: inline-flex; color: var(--text-secondary); }
.h1-ico svg { width: 22px; height: 22px; }
.list-sub { font-size: 12.5px; color: var(--text-tertiary); margin-top: 3px; }
.ws-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.ws-head .page-head { margin-bottom: 0; }
.ws-head .kpi-strip { margin-bottom: 0; }
.ws-hero { align-items: flex-start; }
.ws-hero .head-actions { padding-top: 4px; }
.dash-today { font-size: 12.5px; color: var(--text-tertiary); }
.head-actions { display: flex; gap: 8px; align-items: center; }
.head-actions .btn { height: var(--control-h); }
.head-actions .btn svg { width: 15px; height: 15px; }
.dash-section { margin-bottom: 22px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.dash-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.dash-sec-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.dash-sec-hint { font-size: 11px; color: var(--text-tertiary); }
@media (min-width: 1200px) {
    .dash-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; }
    .dash-cols > .dash-section { display: flex; flex-direction: column; min-width: 0; }
    .dash-cols > .dash-section > .card { flex: 1; }
}
.hm-chartbody { padding: 14px 16px; }
.chart-empty { padding: 40px 16px; text-align: center; font-size: 12.5px; color: var(--text-tertiary); }
.list-count { font-size: 12.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.list-count b { color: var(--text-primary); font-weight: 600; }

/* ---------- الأزرار — app.css (95–118) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--r-btn);
    border: 1px solid var(--border-default);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: background .15s, border-color .15s;
    text-decoration: none;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--status-blue); outline-offset: 2px; }
.btn svg { flex-shrink: 0; }
:where(.btn) { flex-shrink: 0; }
:where(.btn) :where(svg) { width: 15px; height: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); font-weight: 600; }
.btn-primary:hover { background: var(--lime-hover); border-color: var(--lime-hover); }
.btn-primary:disabled { background: var(--lime-soft); border-color: var(--lime-soft); color: var(--text-tertiary); opacity: 1; }
.btn-outline { border-color: var(--border-default); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; padding: 5px 11px; }
.btn-ghost:hover { background: var(--bg-hover); border-color: transparent; color: var(--text-primary); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-link-clear { background: none; border: 0; color: var(--status-blue); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
@media (max-width: 600px) { .btn { padding: 9px 16px; } }

/* ---------- الحقول — app.css (242–292) ---------- */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-input);
    border-radius: var(--r-btn);
    font: inherit;
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color .1s, box-shadow .1s;
    unicode-bidi: plaintext;
}
.form-control::placeholder { color: var(--text-placeholder); }
.form-control:hover { border-color: var(--border-hover); }
.form-control:focus { outline: none; border-color: var(--text-primary); box-shadow: 0 0 0 3px rgba(var(--shadow-rgb), .06); }
.form-control.is-invalid { border-color: var(--status-red); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .form-group { flex: 1 1 150px; }
.form-hint { margin-top: 5px; font-size: 11.5px; line-height: 1.55; color: var(--text-tertiary); }
.form-hint.is-warn { color: var(--status-amber); font-weight: 600; }
.validation-message { color: var(--status-red); font-size: 11.5px; margin-top: 3px; }
.inv-grid { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.inv-grid .form-group { margin: 0; }
@media (max-width: 900px) { .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .inv-grid { grid-template-columns: 1fr; } }

/* ---------- الجدول — app.css (299–403) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
.table th, .table td {
    padding: 9px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    font-size: 13px;
}
.table th {
    background: var(--bg-hover);
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 11px;
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 1;
}
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: left; }
.empty-row { text-align: center; color: var(--text-tertiary); padding: 36px 16px !important; font-size: 13px; }
.table td.empty-row { text-align: center; }

/* ---------- الشارات والتنبيهات — app.css (881–895 · 938–973) ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; line-height: 1.6; }
.badge-on { background: var(--green-50); color: var(--status-green); }
.badge-info { background: var(--blue-50); color: var(--status-blue); }
.badge-warn { background: var(--amber-50); color: var(--status-amber); }
.badge-muted { background: var(--bg-input); color: var(--text-tertiary); }
.alert { padding: 10px 14px; border-radius: var(--r-control); margin-bottom: 12px; font-size: 13px; }
.alert-error { background: var(--red-50); color: var(--status-red); border: 1px solid var(--edge-red); }
.alert-success { background: var(--green-50); color: var(--status-green); border: 1px solid var(--edge-green); }
.alert-warn { background: var(--amber-50); color: var(--status-amber); border: 1px solid var(--edge-amber); }
.alert-info { background: var(--blue-50); color: var(--status-blue); border: 1px solid var(--edge-blue); }
.alert-sub { margin: 4px 0 0; font-size: 12px; opacity: .75; }
.alert-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; }
.alert-note .alert-ico { display: flex; flex: none; margin-top: 1px; }
.alert-note .alert-ico svg { width: 17px; height: 17px; }
.alert-note .alert-body { min-width: 0; }
.alert-note .alert-title { margin: 0; font-weight: 600; line-height: 1.55; }
.alert-note .alert-sub { margin-top: 5px; line-height: 1.6; }

/* ---------- شرائح الأرقام — MWPortal.UI/Components/KpiCard.razor.css + app.css (2421–2634) ---------- */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 901px) and (max-width: 1019px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-strip { grid-template-columns: 1fr; } }
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-card-sm);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.kpi-label { font-size: 12.5px; color: var(--text-primary); font-weight: 600; }
.kpi-num {
    font-family: "Inter", "Cairo", sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.kpi-num--muted { color: var(--text-placeholder); }
.kpi-unit { font-size: 11.5px; color: var(--text-tertiary); }
.kpi-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; font-size: 11.5px; color: var(--text-tertiary); }
.kpi-ico { width: 52px; height: 52px; flex-shrink: 0; align-self: center; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.kpi-ico svg { width: 24px; height: 24px; }
.kpi-ico[data-tone="slate"] { background: var(--bg-page); color: var(--text-tertiary); }
.kpi-ico[data-tone="blue"] { background: var(--blue-50); color: var(--status-blue); }
.kpi-ico[data-tone="green"] { background: var(--green-50); color: var(--status-green); }
.kpi-ico[data-tone="amber"] { background: var(--amber-50); color: var(--status-amber); }
.kpi-ico[data-tone="purple"] { background: var(--purple-50); color: var(--status-purple); }
/* الخفوت لونٌ لا مساحة: قيمةٌ صفريّة تُخفت التسمية والرقم والقرص — KpiCard.razor.css (130–137) */
.kpi-label.kpi-label--muted { color: var(--text-secondary); }
.kpi-ico.kpi-ico--muted[data-tone] { background: var(--bg-page); color: var(--text-tertiary); }
/* بطاقة رقمٍ تُنقر إلى شاشتها — KpiCard.razor.css (140–143) */
.kpi-card--link { cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease; }
.kpi-card--link:hover { border-color: var(--border-hover); box-shadow: var(--shadow-lift); }
.kpi-card--link:active { transform: translateY(1px); }
.kpi-card--link:focus-visible { outline: 2px solid var(--status-blue); outline-offset: 2px; }
/* في أسوار البطاقة رابطٌ حقيقيّ (<a>) لا زرٌّ بـ JS: بلا لون الروابط وخطّها */
a.kpi-card--link, a.kpi-card--link:hover { color: inherit; text-decoration: none; }
/* أرقام سطر التفصيل — app.css (2609–2610) */
.kpi-sub b { font-weight: 650; color: var(--text-secondary); }
.kpi-sub .sep { opacity: .5; }

/* ---------- البحث وشريط الأدوات والصفحات — SearchField · ListToolbar · ListPager (.razor.css) ---------- */
.field-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--control-h);
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-btn);
    color: var(--text-tertiary);
}
.field-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.field-search input {
    flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
    font-family: inherit; font-size: 13px; color: var(--text-primary);
}
.field-search:focus-within { border-color: var(--status-blue); box-shadow: 0 0 0 3px var(--blue-50); }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.list-toolbar .btn { height: var(--control-h); flex-shrink: 0; white-space: nowrap; }
.lt-find { display: flex; align-items: center; gap: 8px; }
.lt-find .field-search { flex: 1 1 260px; max-width: 380px; }
.lt-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .lt-find, .lt-actions { flex: 1 1 100%; } }
.items-panel { padding: 0; }
.items-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); }
.items-toolbar .btn { height: var(--control-h); }
.fp-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-secondary); }
.fp-field .form-control { height: var(--control-h); padding-block: 0; min-width: 160px; }
/* حقول التصفية في شريط الجدول تلتفّ في الشاشات الضيّقة (MWPortal يضعها في درجٍ منبثق — هنا ظاهرةٌ) */
.items-toolbar .lt-find { flex-wrap: wrap; align-items: flex-end; }
@media (max-width: 640px) {
    .items-toolbar .fp-field { flex: 1 1 140px; }
    .items-toolbar .fp-field .form-control { min-width: 0; width: 100%; }
}
.items-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    scroll-margin-top: var(--topbar-h);
}
.pg-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-tertiary); }
.pg-info { font-variant-numeric: tabular-nums; }
.pg-nav { display: flex; align-items: center; gap: 4px; }
.pg-btn, .pg-num {
    min-width: var(--pager-h);
    height: var(--pager-h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    padding: 0 6px;
    text-decoration: none;
}
.pg-btn svg { width: 15px; height: 15px; }
.pg-btn:hover, .pg-num:hover { background: var(--bg-hover); border-color: var(--border-hover); text-decoration: none; }
.pg-btn.is-disabled { opacity: .4; pointer-events: none; }
.pg-num.active { background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--text-primary); font-weight: 600; }
.pg-ellipsis { min-width: 20px; text-align: center; color: var(--text-placeholder); }
@media (max-width: 860px) {
    .items-panel { border: 0; box-shadow: none; background: transparent; }
    .items-toolbar { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--r-card-sm); margin-bottom: 10px; }
    .items-pager { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--r-card-sm); margin-bottom: 10px; }
}

/* ---------- الحالة الفارغة وصفوف التفاصيل وبلاطات الأيقونات — app.css ---------- */
.cover-empty { text-align: center; color: var(--text-tertiary); padding: 40px 16px; font-size: 14px; }
.cover-empty .ce-ico { display: inline-flex; align-items: center; justify-content: center;
    inline-size: 52px; block-size: 52px; margin-bottom: 12px; border-radius: 14px;
    background: var(--bg-hover); color: var(--text-secondary); }
.cover-empty .ce-ico svg { width: 26px; height: 26px; }
.cover-empty .ce-title { display: block; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.cover-empty .ce-say { max-width: 52ch; margin: 6px auto 0; font-size: 13px; line-height: 1.7; }
.cover-empty .ce-act { display: flex; justify-content: center; margin-top: 16px; }
.ic-drow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); font-size: 12.5px; }
.ic-drow:last-child { border-bottom: 0; }
.ic-drow .k { color: var(--text-tertiary); flex-shrink: 0; }
.ic-drow .v { color: var(--text-primary); font-weight: 600; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--r-btn); display: flex; align-items: center; justify-content: center; background: var(--bg-input); color: var(--text-secondary); }
.settings-ico svg { width: 18px; height: 18px; }
.settings-ico[data-tone="blue"] { background: var(--blue-50); color: var(--status-blue); }
.settings-ico[data-tone="green"] { background: var(--green-50); color: var(--status-green); }
.settings-ico[data-tone="purple"] { background: var(--purple-50); color: var(--status-purple); }
.settings-ico[data-tone="amber"] { background: var(--amber-50); color: var(--status-amber); }

/* ---------- خطوات الاستيراد — MWPortal.Web/Components/Pages/Masters/ImportPage.razor.css ---------- */
.imp-stages { list-style: none; margin: 10px 0 0; padding: 0; }
.imp-stage { padding: 32px 0; scroll-margin-top: 80px; }
.imp-stage:first-child { padding-top: 4px; }
.imp-stage + .imp-stage { border-top: 1px solid var(--border-subtle); }
.imp-stage-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.imp-stage.is-done .imp-stage-head { align-items: center; margin-bottom: 0; }
.imp-stage-num {
    width: 28px; height: 28px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border-default); border-radius: 50%;
    background: var(--bg-card);
    font-size: 13px; font-weight: 600; line-height: 1; color: var(--text-secondary);
}
.imp-stage-num svg { width: 16px; height: 16px; }
.imp-stage.is-active .imp-stage-num { border-color: var(--text-primary); color: var(--text-primary); }
.imp-stage.is-done .imp-stage-num { color: var(--status-green); }
.imp-stage.is-ghost .imp-stage-head { align-items: center; margin-bottom: 0; }
.imp-stage.is-ghost .imp-stage-num { border-style: dashed; color: var(--text-tertiary); }
.imp-stage-ghost-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--text-tertiary); margin: 0; }
.imp-stage-txt { flex: 1; min-width: 0; }
.imp-stage-title { font-size: 15px; font-weight: 600; margin: 0; color: var(--text-primary); letter-spacing: -.01em; }
.imp-stage-lede { font-size: 12.5px; color: var(--text-secondary); margin: 3px 0 0; max-width: 62ch; line-height: 1.75; }
.imp-stage-sum { font-size: 12.5px; color: var(--text-secondary); margin: 3px 0 0; unicode-bidi: plaintext; }
.imp-stage-body { padding-inline-start: 34px; }
.imp-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.imp-acts .btn, .imp-actions .btn { height: var(--control-h); }
.imp-read { margin: 0 0 14px; font-size: 13.5px; }
.imp-read b { font-weight: 600; }
.imp-panel { padding: 12px 16px; }
.imp-panel-t { display: block; font-size: 13.5px; font-weight: 600; }
.imp-panel-list { margin: 8px 0 0; padding-inline-start: 22px; line-height: 1.9; }
.imp-panel-list b { font-weight: 600; }
.imp-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.imp-drop {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 32px 20px; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--border-input); border-radius: var(--r-control);
    background: var(--bg-card);
    transition: border-color .15s, background .15s;
}
.imp-drop:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.imp-drop.is-over { border-color: var(--lime-edge); background: var(--lime-soft); }
.imp-drop input[type=file] {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.imp-drop:focus-within { outline: 2px solid var(--status-blue); outline-offset: 2px; }
.imp-drop-ico { color: var(--text-tertiary); margin-bottom: 4px; display: flex; }
.imp-drop-ico svg { width: 32px; height: 32px; }
.imp-drop b { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.imp-drop-hint { font-size: 12.5px; color: var(--text-secondary); }
.imp-drop-btn { margin-top: 4px; }
.imp-result-lines { margin: 0; display: grid; grid-template-columns: auto max-content; justify-content: start; gap: 7px 14px; font-size: 13px; align-items: baseline; }
.imp-result-lines dt { opacity: .82; }
.imp-result-lines dd { margin: 0; font-weight: 600; }

/* ---------- صفحات الدخول والخطأ — app.css (1022–1732) ---------- */
.auth-canvas {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-card), var(--shadow-lift);
    padding: 32px;
    width: 100%;
    max-width: 440px;
}
.auth-heading { font-size: 20px; font-weight: 600; color: var(--text-primary); margin: 0 0 6px; line-height: 1.3; }
.auth-intro { font-size: 12.5px; color: var(--text-secondary); margin: 0 0 22px; line-height: 1.6; }
.auth-password-wrap { position: relative; }
.auth-password-wrap .form-control { padding-inline-end: 44px; }
.auth-password-wrap input[type="password"]::-ms-reveal { display: none; }
.auth-eye {
    position: absolute; top: 50%; inset-inline-end: 4px; transform: translateY(-50%);
    width: 32px; height: 32px; border: 0; background: transparent; color: var(--text-tertiary);
    border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center;
    transition: background .1s, color .1s;
}
.auth-eye:hover { background: var(--bg-hover); color: var(--text-primary); }
.auth-eye svg { width: 17px; height: 17px; }
.auth-eye .eye-off { display: none; }
.auth-eye.is-shown .eye-open { display: none; }
.auth-eye.is-shown .eye-off { display: inline; }
.auth-submit {
    width: 100%;
    height: var(--control-h-block);
    border: 0;
    border-radius: 10px;
    background: var(--lime);
    color: var(--on-lime);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform .08s, opacity .15s;
}
.auth-submit:hover { opacity: .92; }
.auth-submit:active { transform: scale(.99); }
.auth-submit:focus-visible { outline: 2px solid var(--status-blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .auth-submit:active { transform: none; } }
.auth-error {
    margin: 0 0 16px; padding: 10px 12px;
    background: var(--red-50); border: 1px solid var(--edge-red); border-radius: 10px;
    color: var(--status-red); font-size: 12.5px; line-height: 1.5;
}
.auth-note { margin: 0 0 18px; }
.auth-exits { display: flex; flex-direction: column; margin-top: 16px; align-items: center; }
.auth-exits a { display: flex; align-items: center; justify-content: center; min-height: 38px; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.auth-exits a:hover { text-decoration: underline; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 11px; color: var(--text-secondary); }
.auth-inline-labels .form-group { position: relative; display: grid; }
.auth-inline-labels .form-group > label {
    position: absolute;
    grid-area: 1 / 1 / 2 / 2;
    inset-inline-start: 13px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    font-size: 13px;
    line-height: 1;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 1;
}
.auth-inline-labels .form-control { height: var(--control-h-block); }
.auth-inline-labels .form-control::placeholder { color: transparent; }
.auth-inline-labels .form-group:has(.form-control:not(:placeholder-shown)) > label { opacity: 0; }
.auth-inline-labels .form-group:has(.auth-password-wrap) > label { inset-inline-end: 44px; }
@media (max-width: 480px) {
    .auth-card { padding: 22px 20px; border-radius: 14px; }
    .auth-card .form-control { font-size: 16px; }
}

/* ==========================================================================
   ما يخصّ أسوار (aw-) — من رموز MWPortal وعلى طريقة أشكاله
   ========================================================================== */

/* علامة الشركة في بطاقة الدخول (MWPortal يُظهرها خلف البطاقة صورةً مموّهة — هنا فوقها) */
.aw-auth-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.aw-auth-brand img { height: 40px; width: auto; border-radius: 8px; }


/* شبكة بطاقات المشاريع — على وصفة .settings-grid/.settings-card بلا حدّ العرض (طلب المالك: بطاقات لا جدول) */
.aw-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.aw-project-card {
    display: flex; flex-direction: column; gap: 14px; padding: 16px;
    color: var(--text-primary); text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
a.aw-project-card:hover { border-color: var(--text-placeholder); transform: translateY(-1px); text-decoration: none; }
a.aw-project-card:focus-visible { outline: 2px solid var(--status-blue); outline-offset: 2px; }
.aw-pc-head { display: flex; align-items: flex-start; gap: 12px; }
.aw-pc-title { min-width: 0; }
.aw-pc-title b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-pc-title > span { display: block; font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { a.aw-project-card:hover { transform: none; } }

/* شريط تقسيم الأرض: خمسة أجزاءٍ بنسبها */
.aw-landbar { display: flex; height: 8px; border-radius: var(--r-pill); overflow: hidden; background: var(--bg-input); gap: 2px; }
.aw-landbar--lg { height: 14px; }
.aw-landbar > span { display: block; min-width: 2px; }
.aw-land-plots { background: var(--aw-land-plots); }
.aw-land-streets { background: var(--aw-land-streets); }
.aw-land-landowner { background: var(--aw-land-landowner); }
.aw-land-green { background: var(--aw-land-green); }
.aw-land-commercial { background: var(--aw-land-commercial); }

/* مفتاح الألوان، وجدول أجزاء الأرض */
.aw-sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw { box-shadow: inset 0 0 0 1px rgba(var(--shadow-rgb), .14); }
/* يُقرأ ولا يُرى: حالة البحث لقارئ الشاشة */
.aw-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- مسار الصفحة وسجلّ الدور (أفكارٌ من Plane بأشكال MWPortal) ---------- */
.aw-crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; color: var(--text-tertiary); min-width: 0; }
.aw-crumbs a { color: var(--text-secondary); }
.aw-crumbs a:hover { color: var(--text-primary); }
.aw-crumbs-sep { display: inline-flex; flex-shrink: 0; }
.aw-crumbs-sep svg { width: 12px; height: 12px; }
.aw-crumbs-here { color: var(--text-primary); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.aw-houses-head { align-items: center; flex-wrap: wrap; }

/* شارات التصفية — على .ops-chip في MWPortal (app.css)، رابطٌ يزيل تصفيته */
.ops-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding-block: 5px; padding-inline: 12px;
    border-radius: var(--r-pill);
    border: none; background: var(--bg-input);
    font: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; line-height: 1.4; white-space: nowrap;
    transition: filter .15s;
}
.ops-chip:has(b) { padding-inline-end: 5px; }
.ops-chip:hover { filter: brightness(0.97); }
.ops-chip b {
    font-family: "Inter", "Cairo", sans-serif;
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: var(--r-pill);
    padding: 3px 9px; line-height: 1;
    font-variant-numeric: tabular-nums; min-width: 20px; text-align: center;
}
.aw-filter-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); }
a.aw-chip { text-decoration: none; max-width: 100%; }
.aw-chip b { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.aw-chip-x { display: inline-flex; color: var(--text-tertiary); margin-inline-end: 3px; }
.aw-chip:hover .aw-chip-x { color: var(--text-primary); }
.aw-chip-x svg { width: 12px; height: 12px; }
.aw-chip:focus-visible { outline: 2px solid var(--status-blue); outline-offset: 2px; }
.aw-filter-chips .btn-link-clear { font-size: 12px; margin-inline-start: 4px; }

/* السجلّ مجمَّعاً: details أصيلة (تُفتح وتُطوى بلا سكربت) */
.aw-hgroups-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); }
.aw-hgroups-all { display: flex; gap: 14px; font-size: 12px; }
.aw-hgroup { border-bottom: 1px solid var(--border-subtle); }
.aw-hgroup:last-child { border-bottom: 0; }
.aw-hgroup > summary {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 11px 16px; cursor: pointer; list-style: none;
    font-size: 13px;
}
.aw-hgroup > summary::-webkit-details-marker { display: none; }
.aw-hgroup > summary:hover { background: var(--bg-hover); }
.aw-hgroup > summary:focus-visible { outline: 2px solid var(--status-blue); outline-offset: -2px; }
.aw-hgroup-chev { display: inline-flex; color: var(--text-tertiary); flex-shrink: 0; }
.aw-hgroup-chev svg { width: 14px; height: 14px; }
.aw-hgroup[open] > summary .aw-hgroup-chev svg { transform: rotate(-90deg); }
@media (prefers-reduced-motion: no-preference) { .aw-hgroup-chev svg { transition: transform .15s; } }
.aw-hgroup-key { font-weight: 600; min-width: 0; }
.aw-hgroup-sums { margin-inline-start: auto; font-size: 12px; color: var(--text-secondary); }
.aw-hgroup-table { table-layout: fixed; min-width: 480px; }

.aw-land-rows { margin-top: 12px; }
.aw-land-rows:first-child { margin-top: 0; }
.aw-land-rows .ic-drow .k { display: inline-flex; align-items: center; gap: 8px; }
.aw-land-rows .ic-drow .v { display: inline-flex; gap: 10px; }
.aw-pct { color: var(--text-tertiary); font-weight: 500; min-width: 48px; text-align: end; }
.aw-land-warn { margin: 12px 0 0; }

/* زرّ نموذجٍ أُرسل (data-aw-once في aswar.js): يبقى في مكانه ويقول إنّه يعمل */
.btn[aria-disabled="true"] { opacity: .65; cursor: progress; pointer-events: none; }

/* الأسماء حتّى 200 حرف (ProjectCreation.MaxNameLength) وأسماء الملفّات الطويلة: تلتفّ في المراجعة ولا تخرج من بطاقتها.
   تعديلٌ على شكلَي MWPortal (.imp-result-lines · .imp-stage-sum) — عنده أسماءٌ أقصر */
.imp-result-lines { grid-template-columns: auto minmax(0, 1fr); }
.imp-result-lines dd, .imp-stage-sum { overflow-wrap: anywhere; }
.imp-panel-t + .aw-landbar, .imp-panel-t + .imp-result-lines { margin-top: 10px; }
.imp-drop ~ .alert { margin: 12px 0 0; }

/* حاويات الرسوم (Chart.js يرسم في canvas بارتفاعٍ ثابت) */
.aw-chart { position: relative; width: 100%; height: 280px; }
.aw-chart--doughnut { height: 240px; }
.aw-chart canvas { display: block; }

/* «مجموع الأجزاء» الحيّ في خطوة بيانات المشروع */
.aw-landsum { margin-top: 14px; line-height: 1.7; padding: 10px 14px; border-radius: var(--r-control); font-size: 13px; background: var(--bg-hover); color: var(--text-secondary); }
.aw-landsum.is-ok { background: var(--green-50); color: var(--status-green); }
.aw-landsum.is-warn { background: var(--amber-50); color: var(--status-amber); }
.aw-landsum b { font-weight: 600; }

/* لا طباعة لإطار التطبيق — app.css (@media print) */
@media print {
    .sidebar, .topbar, .mobile-nav, .mobile-nav-backdrop { display: none !important; }
    .content, .content-container { margin: 0 !important; padding: 0 !important; max-width: none !important; }
}
