/* ---------- الألوان: فاتح / داكن (Bootstrap 5.3 data-bs-theme) ---------- */
/* لون الموقع (data-color على <html>، الافتراضي أحمر). معرَّف على html فقط ليرثه الشريط الأحمر (data-bs-theme="dark") أيضًا */
:root {
    --brand: #b02a37;
    --brand-dark: #8a1f2a;
    --brand-text: #b02a37;
}
html[data-bs-theme="dark"] { --brand-dark: #d0404f; --brand-text: #f07a86; }
html[data-color="green"]  { --brand: #198754; --brand-dark: #146c43; --brand-text: #198754; }
html[data-color="blue"]   { --brand: #1d5fbf; --brand-dark: #174c99; --brand-text: #1d5fbf; }
html[data-color="teal"]   { --brand: #0f766e; --brand-dark: #0b5c56; --brand-text: #0f766e; }
html[data-color="purple"] { --brand: #6f42c1; --brand-dark: #59359a; --brand-text: #6f42c1; }
html[data-color="pink"]   { --brand: #c2255c; --brand-dark: #a61e4d; --brand-text: #c2255c; }
html[data-color="orange"] { --brand: #d9480f; --brand-dark: #b23a0c; --brand-text: #d9480f; }
html[data-color="gold"]   { --brand: #b7791f; --brand-dark: #975a16; --brand-text: #a86d14; }
html[data-color="gray"]   { --brand: #495057; --brand-dark: #343a40; --brand-text: #495057; }
html[data-color="burgundy"] { --brand: #7b1e3a; --brand-dark: #5e162c; --brand-text: #7b1e3a; }
html[data-color="brown"]    { --brand: #7c4a2d; --brand-dark: #5f3822; --brand-text: #7c4a2d; }
html[data-color="sky"]      { --brand: #0b7fab; --brand-dark: #08668a; --brand-text: #0a76a0; }
html[data-color="navy"]     { --brand: #1e3a5f; --brand-dark: #152a45; --brand-text: #1e3a5f; }
html[data-color="turquoise"] { --brand: #0e8f98; --brand-dark: #0a727a; --brand-text: #0b828a; }
html[data-bs-theme="dark"][data-color="green"]  { --brand-dark: #25a56a; --brand-text: #5ccf96; }
html[data-bs-theme="dark"][data-color="blue"]   { --brand-dark: #3b7ddd; --brand-text: #7fb0f5; }
html[data-bs-theme="dark"][data-color="teal"]   { --brand-dark: #149c91; --brand-text: #4fd1c5; }
html[data-bs-theme="dark"][data-color="purple"] { --brand-dark: #8559d6; --brand-text: #b69cf0; }
html[data-bs-theme="dark"][data-color="pink"]   { --brand-dark: #e64980; --brand-text: #f783ac; }
html[data-bs-theme="dark"][data-color="orange"] { --brand-dark: #f06422; --brand-text: #ff9a5c; }
html[data-bs-theme="dark"][data-color="gold"]   { --brand-dark: #d69e2e; --brand-text: #f6c35b; }
html[data-bs-theme="dark"][data-color="gray"]   { --brand-dark: #6c757d; --brand-text: #ced4da; }
html[data-bs-theme="dark"][data-color="burgundy"] { --brand-dark: #a3304f; --brand-text: #e88aa5; }
html[data-bs-theme="dark"][data-color="brown"]    { --brand-dark: #a0653f; --brand-text: #d9a77f; }
html[data-bs-theme="dark"][data-color="sky"]      { --brand-dark: #1597cc; --brand-text: #67c8ee; }
html[data-bs-theme="dark"][data-color="navy"]     { --brand-dark: #2f5a8f; --brand-text: #8fb4e3; }
html[data-bs-theme="dark"][data-color="turquoise"] { --brand-dark: #14b3bd; --brand-text: #5fe0e6; }
html { --brand-soft: color-mix(in srgb, var(--brand-text) 13%, transparent); }

:root,
[data-bs-theme="light"] {
    --app-bg: #f6f6f7;
    --card-bg: #ffffff;
    --card-border: #e3e3e6;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, .06);
    --warn-bg: #fff8ec;
    --warn-border: #f0ad4e;
    --soon-bg: #f0f6fd;
    --soon-border: #8fb8e6;
    --danger-bg: #fdf0f1;
    --danger-border: #e4a1a8;
}

[data-bs-theme="dark"] {
    --app-bg: #121417;
    --card-bg: #1c1f23;
    --card-border: #343a40;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, .4);
    --warn-bg: #33290f;
    --warn-border: #b8862b;
    --soon-bg: #14243a;
    --soon-border: #3d6a9e;
    --danger-bg: #36191d;
    --danger-border: #8a3a44;
}

/* ---------- الخطوط (SIL OFL 1.1، مستضافة عندنا في lib/ — لا Google Fonts) ----------
   كل زائر يختار خطه من قائمة "الخط" (data-font على <html> + localStorage metfati.font، مثل اللون):
   Tahoma / Tajawal / Cairo / Almarai / Noto Sans Arabic (الافتراضي منذ 2026-12-02) / IBM Plex Sans Arabic. المتصفح يحمّل فقط ملفات الخط المستعمل فعلًا،
   وفقط الجزء الذي يحتاجه (عربي / لاتيني) حسب unicode-range. */
/* Tajawal: 400 / 500 / 700 (600 يُعرض بـ 700) */
@font-face {
    font-family: 'Tajawal'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../lib/tajawal/tajawal-400-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Tajawal'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../lib/tajawal/tajawal-400-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap;
    src: url(../lib/tajawal/tajawal-500-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap;
    src: url(../lib/tajawal/tajawal-500-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../lib/tajawal/tajawal-700-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../lib/tajawal/tajawal-700-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Cairo: خط متغيّر 200–1000 */
@font-face {
    font-family: 'Cairo'; font-style: normal; font-weight: 200 1000; font-display: swap;
    src: url(../lib/cairo/cairo-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Cairo'; font-style: normal; font-weight: 200 1000; font-display: swap;
    src: url(../lib/cairo/cairo-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Cairo'; font-style: normal; font-weight: 200 1000; font-display: swap;
    src: url(../lib/cairo/cairo-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Almarai: 400 / 700 فقط (500 يُعرض بـ 400، و600 بـ 700) */
@font-face {
    font-family: 'Almarai'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../lib/almarai/almarai-400-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Almarai'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../lib/almarai/almarai-400-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Almarai'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../lib/almarai/almarai-700-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Almarai'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../lib/almarai/almarai-700-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Noto Sans Arabic: خط متغيّر 100–900 */
@font-face {
    font-family: 'Noto Sans Arabic'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url(../lib/noto-sans-arabic/noto-sans-arabic-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Noto Sans Arabic'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url(../lib/noto-sans-arabic/noto-sans-arabic-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Sans Arabic: 400 / 500 / 600 / 700 */
@font-face {
    font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../lib/ibm-plex-sans-arabic/ibm-plex-sans-arabic-400-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../lib/ibm-plex-sans-arabic/ibm-plex-sans-arabic-400-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 500; font-display: swap;
    src: url(../lib/ibm-plex-sans-arabic/ibm-plex-sans-arabic-500-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 500; font-display: swap;
    src: url(../lib/ibm-plex-sans-arabic/ibm-plex-sans-arabic-500-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap;
    src: url(../lib/ibm-plex-sans-arabic/ibm-plex-sans-arabic-600-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap;
    src: url(../lib/ibm-plex-sans-arabic/ibm-plex-sans-arabic-600-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../lib/ibm-plex-sans-arabic/ibm-plex-sans-arabic-700-arabic.woff2) format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../lib/ibm-plex-sans-arabic/ibm-plex-sans-arabic-700-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root { --app-font: 'Noto Sans Arabic', Tahoma, "Segoe UI", system-ui, sans-serif; }
:root[data-font="tahoma"] { --app-font: Tahoma, "Segoe UI", system-ui, sans-serif; }
:root[data-font="cairo"] { --app-font: 'Cairo', Tahoma, "Segoe UI", system-ui, sans-serif; }
:root[data-font="almarai"] { --app-font: 'Almarai', Tahoma, "Segoe UI", system-ui, sans-serif; }
:root[data-font="tajawal"] { --app-font: 'Tajawal', Tahoma, "Segoe UI", system-ui, sans-serif; }
:root[data-font="noto"] { --app-font: 'Noto Sans Arabic', Tahoma, "Segoe UI", system-ui, sans-serif; }
:root[data-font="plex"] { --app-font: 'IBM Plex Sans Arabic', Tahoma, "Segoe UI", system-ui, sans-serif; }
/* كل خيار في قائمة "الخط" يُكتب بخطه */
.font-sample-tajawal { font-family: 'Tajawal', Tahoma, sans-serif; }
.font-sample-cairo { font-family: 'Cairo', Tahoma, sans-serif; }
.font-sample-almarai { font-family: 'Almarai', Tahoma, sans-serif; }
.font-sample-noto { font-family: 'Noto Sans Arabic', Tahoma, sans-serif; }
.font-sample-plex { font-family: 'IBM Plex Sans Arabic', Tahoma, sans-serif; }
.font-sample-tahoma { font-family: Tahoma, "Segoe UI", system-ui, sans-serif; }
.font-icon { font-weight: 700; font-size: .85em; line-height: 1; }

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    font-family: var(--app-font);
    background: var(--app-bg);
}

/* بلد عنوان IP وعلمه في "الأجهزة المتصلة" (_IpCountry.cshtml) */
.ip-country { white-space: nowrap; display: inline-flex; align-items: center; gap: .65rem; vertical-align: middle; }   /* gap: مسافة بين العلم والاسم في الاتجاهين */
.ip-flag { display: inline-block; flex-shrink: 0; width: 16px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); object-fit: cover; }

/* الروابط بلا خط تحتها في كل الموقع، حتى عند المرور بالفأرة (طلب المالك 2026-11-27: "دائمًا أزل الخط من الروابط") */
:root { --bs-link-decoration: none; }
a, a:hover, a:focus { text-decoration: none; }

.bg-brand { background-color: var(--brand) !important; }

.btn-danger { background-color: var(--brand); border-color: var(--brand); }
.btn-danger:hover, .btn-danger:focus { background-color: var(--brand-dark); border-color: var(--brand-dark); }

.icon { width: 1em; height: 1em; vertical-align: -.125em; }

/* زر المظهر: أيقونة وتسمية حسب المظهر الظاهر حاليًا */
[data-bs-theme="light"] .theme-icon-dark,
[data-bs-theme="light"] .theme-label-dark,
[data-bs-theme="dark"] .theme-icon-light,
[data-bs-theme="dark"] .theme-label-light { display: none; }
/* داخل شريط التنقل (data-bs-theme="dark" دائمًا) نتبع مظهر الصفحة، لا الشريط */
html[data-bs-theme="light"] .navbar .theme-icon-light,
html[data-bs-theme="light"] .navbar .theme-label-light { display: inline; }
html[data-bs-theme="light"] .navbar .theme-icon-dark,
html[data-bs-theme="light"] .navbar .theme-label-dark { display: none; }

/* ---------- حقول الإدخال: مميَّزة عن خلفية البطاقة (طلب المالك) ---------- */
:root, [data-bs-theme="light"] { --input-bg: #f7f8fa; --input-border: #b9bfc7; --input-border-hover: #8f969f; }
[data-bs-theme="dark"] { --input-bg: #15181c; --input-border: #4f565e; --input-border-hover: #6c757d; }
.form-control, .form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
}
.form-control:hover, .form-select:hover { border-color: var(--input-border-hover); }
.form-control:focus, .form-select:focus {
    background-color: var(--bs-body-bg);
    border-color: var(--brand-text);
    box-shadow: 0 0 0 .2rem var(--brand-soft);
}
.form-control:disabled, .form-control[readonly] { background-color: var(--bs-secondary-bg); }

/* ---------- أخطاء الحقول: ظاهرة (طلب المالك 2026-11-24: النص الأحمر الصغير لا يلفت الانتباه) ----------
   الحقل الخاطئ بإطار أحمر وخلفية وردية، والرسالة شريط وردي بأيقونة (!) ونص عريض.
   الصنفان يضعهما ASP.NET (الخادم) وjquery-validation-unobtrusive (المتصفح) فيشملان كل النماذج. */
:root, [data-bs-theme="light"] { --err: #c82333; --err-bg: #fde8ea; --err-field-bg: #fff5f6; }
[data-bs-theme="dark"] { --err: #ff8a94; --err-bg: rgba(220, 53, 69, .18); --err-field-bg: rgba(220, 53, 69, .08); }
.form-control.input-validation-error, .form-select.input-validation-error {
    border-color: var(--err);
    border-width: 2px;
    background-color: var(--err-field-bg);
}
.form-control.input-validation-error:focus, .form-select.input-validation-error:focus {
    border-color: var(--err);
    box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .25);
}
.field-validation-error {
    /* block لا flex: الرسالة قد تحتوي <b> و<span> (الرقم المسجّل)، وفي flex يصير كل جزء عمودًا يلتف وحده */
    display: block;
    margin-top: .35rem;
    padding: .3rem .6rem;
    border-radius: .375rem;
    background: var(--err-bg);
    color: var(--err) !important;
    font-weight: 600;
    font-size: .875rem !important;
}
/* سكربتات بعض الصفحات (فحص الهاتف أثناء الكتابة) تمسح نص الخطأ فقط ويبقى الصنف: رسالة فارغة = لا شريط */
.field-validation-error:empty { display: none; }
.field-validation-error::before {
    content: "";
    display: inline-block;
    vertical-align: -.15em;
    margin-inline-end: .4rem;
    width: 1.05em;
    height: 1.05em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm-.9 3.5.3 5.6h1.2l.3-5.6ZM8 10.3a1.1 1.1 0 1 0 0 2.2 1.1 1.1 0 0 0 0-2.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm-.9 3.5.3 5.6h1.2l.3-5.6ZM8 10.3a1.1 1.1 0 1 0 0 2.2 1.1 1.1 0 0 0 0-2.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- هيكل الصفحة: شريط علوي + قائمة جانبية عمودية + المحتوى ---------- */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 1030; }
.app-topbar .navbar { min-height: 56px; }
.app-content { flex: 1 1 auto; padding: 1rem; }
@media (min-width: 992px) {
    .app-content { padding: 1.5rem 2rem; }
    /* القائمة بطول الصفحة من الأعلى، والشعار في رأسها على نفس ارتفاع الشريط الأحمر */
    .app-sidebar {
        flex: 0 0 230px;
        width: 230px;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        background: var(--card-bg);
        border-inline-end: 1px solid var(--card-border);
    }
    .side-brand {
        width: 100%;
        height: 56px;
        align-items: center;
        gap: .6rem;
        padding: 0 .75rem;
        border: 0;
        /* رأس متناسق مع لون الموقع لكن مختلف عن الرابط النشط: لون أخف + خط سفلي بلون الموقع */
        background: color-mix(in srgb, var(--brand-text) 6%, transparent);
        border-bottom: 2px solid color-mix(in srgb, var(--brand-text) 45%, transparent);
        color: var(--brand-text);
        white-space: nowrap;
        cursor: pointer;
    }
    .side-toggle {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: .5rem;
    }
    .side-brand:hover .side-toggle, .side-brand:focus-visible .side-toggle { background: var(--bs-tertiary-bg); }
    .side-toggle svg { width: 24px; height: 24px; }
    .side-brand-name { display: inline-flex; font-size: 1.3rem; font-weight: 700; }
    .sidebar-collapsed .side-brand { justify-content: center; padding-inline: 0; }
    .sidebar-collapsed .side-brand-name { display: none; }
    .app-sidebar .offcanvas-header { display: none; }
    .app-sidebar .offcanvas-body { padding: 1rem .75rem; }
    .app-sidebar { transition: flex-basis .2s, width .2s; overflow-x: hidden; }
    /* مطويّة: أيقونات فقط (الاسم يظهر كتلميح title) */
    .sidebar-collapsed .app-sidebar { flex-basis: 64px; width: 64px; }
    .sidebar-collapsed .app-sidebar .offcanvas-body { padding-inline: .5rem; }
    .sidebar-collapsed .side-link { justify-content: center; padding-inline: 0; }
    .sidebar-collapsed .side-link span { display: none; }
}
.side-link span { white-space: nowrap; }
/* رمز المطفأة بجانب اسم الموقع (رأس القائمة، والشريط العلوي على الهاتف) */
.side-brand-icon { width: 1.2rem; height: 1.7rem; flex-shrink: 0; }
/* شعار الموقع = رسم favicon (Shared/_BrandLogo): الخرطوم والمقبض داكنان، وفاتحان في المظهر الداكن */
:root { --logo-ink: #2b2b2b; }
[data-bs-theme=dark] { --logo-ink: #d0d0d0; }
/* في LTR يقابل النصَّ جسمُ القارورة العريض (لا الخرطوم كما في RTL) فيبدو ملتصقًا: مسافة إضافية (طلب المالك) */
[dir=ltr] .side-brand-icon, [dir=ltr] .brand-icon { margin-inline-start: .25rem; }
.side-nav { display: flex; flex-direction: column; gap: .25rem; width: 100%; }
.side-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .85rem;
    border-radius: .5rem;
    color: var(--bs-body-color);
    text-decoration: none;
    font-weight: 500;
}
.side-link:hover, .side-link:focus-visible { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.side-link.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }
/* رمز الربط القصير (يُكتب باليد في تطبيق SMS Metfati) */
.pair-code {
    display: inline-block;
    margin-top: .35rem;
    padding: .35rem 1rem;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--brand-text);
    border: 2px dashed var(--input-border);
    border-radius: .5rem;
    background: transparent;
    cursor: copy;
}
.pair-code:hover, .pair-code:focus-visible { border-color: var(--brand); background: var(--brand-soft); }

/* قائمة لون الموقع */
.color-swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; vertical-align: -.1em; flex-shrink: 0; }
.navbar .color-swatch-current { background: var(--brand); border: 2px solid #fff; }
.color-swatch-current { background: var(--brand); }

/* قائمة التفضيلات الموحّدة (اللغة / المظهر / اللون / الخط) */
.prefs-panel { width: 290px; max-width: calc(100vw - 2rem); }
.prefs-title { font-size: .8rem; font-weight: 700; color: var(--bs-secondary-color); margin-bottom: .35rem; }
.prefs-panel .btn { white-space: nowrap; }
.swatch-btn {
    width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.swatch-btn:hover { transform: scale(1.1); }
.swatch-btn.active, .swatch-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 4px var(--bs-body-color);
}
/* الهاتف: في الشريط العلوي أيقونات المظهر واللون فقط (بلا نص) لتتسع الأزرار */
@media (max-width: 575.98px) { .navbar .pref-label { display: none; } }
.side-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

/* بطاقات الأرقام في لوحة التحكم */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: .75rem;
    padding: 1rem;
    text-align: center;
    height: 100%;
}
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--bs-secondary-color); font-size: .9rem; margin-top: .25rem; }
a.stat-link { display: block; color: inherit; text-decoration: none; transition: transform .1s, box-shadow .1s; }
a.stat-link:hover, a.stat-link:focus { box-shadow: var(--card-shadow); transform: translateY(-1px); }
.stat-warn  { border-color: var(--warn-border); background: var(--warn-bg); }
.stat-soon  { border-color: var(--soon-border); background: var(--soon-bg); }   /* خلال 30 يومًا */
.stat-danger { border-color: var(--danger-border); background: var(--danger-bg); }

/* معاينة تاريخ انتهاء القارورة في النموذج */
/* بنفس ارتفاع حقل الإدخال ليصطف في نفس السطر */
.expiry-preview { padding: .375rem .75rem; line-height: 1.5; border: 1px dashed var(--input-border); border-radius: .375rem; color: var(--brand-text); }
details > summary { cursor: pointer; color: var(--bs-secondary-color); }

/* النماذج: عرض مريح على الشاشات الكبيرة، في وسط الصفحة */
.page-narrow { max-width: 680px; margin-inline: auto; }
.form-narrow { max-width: 680px; }
/* ViewData["NarrowXL"] = true مع Narrow: 800px (صفحة "اشتراكك"، طلب المالك 2026-11-27) */
.page-narrow.page-narrow-xl { max-width: 800px; }
.page-narrow-xl .form-narrow { max-width: none; }
/* الشريط العلوي: اسم المؤسسة أوضح من اسم المستخدم (طلب المالك 2026-11-27) */
.topbar-shop { color: rgb(255 255 255 / 80%) !important; }
.topbar-user { color: rgb(255 255 255 / 60%) !important; }
/* ViewData["Wide"] = true: نماذج المدير، حقلان في كل سطر على الحاسوب */
.page-wide { max-width: 960px; }
.page-wide .form-narrow { max-width: none; }
/* ViewData["List"] = true: قوائم الزبائن والقارورات أضيق (طلب المالك) لتبقى الحالة قريبة من الاسم */
.page-list { max-width: 600px; margin-inline: auto; }
.page-list.page-list-wide { max-width: 700px; }
.page-list.page-list-xl { max-width: 800px; }
/* سعر الباقة بارز (قائمة الباقات عند المدير، طلب المالك 2026-11-25) */
.plan-price {
    display: flex; flex-direction: column; align-items: center; line-height: 1.1;
    padding: .35rem .8rem; border-radius: .75rem; white-space: nowrap;
    background: color-mix(in srgb, var(--brand) 12%, var(--bs-body-bg)); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.plan-price-value { font-size: 1.45rem; font-weight: 800; color: var(--brand-text); }
.sub-plan-mine { border: 2px solid var(--brand); }   /* اشتراكك: الباقات المتاحة، باقة المحل بإطار بلون الموقع */
.sub-plan .plan-price-value { font-size: 1.25rem; }
.sub-plan-features li { padding: .1rem 0; }
.sub-plan-periods { border-top: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color); padding: .35rem 0; }
.sub-plan-free { font-size: .72rem; color: var(--bs-success-text-emphasis); margin-top: -.1rem; margin-bottom: .2rem; }
.plan-price-per { font-size: .72rem; color: var(--bs-secondary-color); margin-top: .15rem; }   /* قائمة المحلات عند المدير (طلب المالك 2026-11-25) */
/* الإحصائيات: حقلا التاريخ بعرض مناسب لا بعرض الإطار كله (طلب المالك 2026-11-24)؛ على الهاتف تبقى الأعمدة 5/5/2 */
@media (min-width: 576px) { .stats-date { width: 10.5rem; } .stats-show { min-width: 6rem; } }

/* الاستيراد: سحب ملف إلى أي مكان في الصفحة (طلب المالك 2026-11-24) */
.drop-overlay {
    position: fixed; inset: 0; z-index: 2000; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--bs-body-bg) 80%, transparent);
    border: 4px dashed var(--brand); border-radius: 1rem; margin: .75rem;
}
.drop-overlay.d-none { display: none !important; }
.drop-overlay > div { font-size: 1.5rem; font-weight: bold; color: var(--brand-text); }   /* قائمة القارورات (طلب المالك 2026-11-24) */
/* رمز ∞ (باقة بلا حد) كرسم SVG بارتفاع السطر — لا يغيّر ارتفاع السطر */
svg.infinity { width: 1.25em; height: 1em; vertical-align: -.15em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
fieldset.card legend { float: none; width: auto; margin-bottom: .75rem; }

/* صفحات الدخول */
.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.auth-prefs {
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: .75rem;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    box-shadow: var(--card-shadow);
}
.auth-card-wide, .auth-prefs-wide { max-width: 680px; }   /* نفس عرض نماذج الموقع */
@media (min-width: 768px) { .auth-card-wide { padding: 2rem; } }
.brand-mark { font-size: 1.75rem; font-weight: 700; color: var(--brand-text); }
.brand-icon { width: 1.55rem; height: 2.2rem; flex-shrink: 0; }   /* viewBox مقصوص على الرسم فيلتصق بالاسم */

/* نوع الزبون في تنبيه الرقم المسجّل: أصغر وباهت (طلب المالك) */
.lookup-type { font-size: .85em; font-weight: normal; opacity: .65; }

/* "تفاصيل" في تذكيرات الزبائن: زر صغير رمادي + أيقونة (i) بلون الموقع بجانب الوقت — لا يشبه شارة الحالة (طلب المالك 2026-11-30) */
.rem-info-btn {
    display: inline-flex; align-items: center; gap: .25rem; vertical-align: middle;
    margin-inline-start: .35rem; padding: .05rem .45rem;
    font-size: .75rem; line-height: 1.4; font-weight: 600; white-space: nowrap;
    border: 1px solid var(--bs-border-color); border-radius: .375rem;
    background: var(--bs-tertiary-bg); color: var(--bs-secondary-color) !important;
    transition: background .15s, color .15s, border-color .15s;
}
.rem-info-btn svg { color: var(--brand); }
/* نتيجة رسالة التجربة في نافذة مثل alert (طلب المالك 2026-11-30) */
.test-dialog-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; border-radius: 50%;
    font-size: 1.5rem; font-weight: 700; line-height: 1; color: #fff;
}
.test-dialog-icon.is-ok { background: var(--bs-success); }
.test-dialog-icon.is-error { background: var(--bs-danger); }
.test-dialog-icon.is-busy { background: none; color: var(--brand); }
.test-dialog-icon.is-busy .spinner-border { width: 2.5rem; height: 2.5rem; border-width: .25rem; }
.test-dialog-text { white-space: pre-line; }   /* السبب في سطر ثانٍ */
.test-dialog-title { font-weight: 700; }
.test-dialog-reason { margin-top: .5rem; }
.test-dialog-reason:empty { display: none; }
#test-dialog .modal-content { border-radius: .75rem; }
/* رصيد الشريحة في "هاتف الرسائل" (طلب المالك 2026-11-30): رد الشبكة كما هو بأسطره */
.balance-box { border-top: 1px dashed var(--bs-border-color); padding-top: .5rem; }
.balance-text { white-space: pre-line; font-weight: 600; }
/* حجم ثابت لا يتغير بالمحتوى (طلب المالك 2026-11-30): عرض 500px وارتفاع يسع أطول نتيجة (العنوان + السبب + الرقم) */
#test-dialog .modal-dialog, #balance-dialog .modal-dialog { max-width: 500px; }
#balance-dialog .modal-content { border-radius: .75rem; }
#balance-dialog .modal-body { min-height: 11rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#balance-dialog .modal-body > div { max-width: 100%; }
#balance-dialog .balance-text { font-size: calc(100% - 1px); }
/* "إضافة الكود" / "تغيير" في بطاقة الهاتف: بلا خط، ويُسطَّر عند مرور الفأرة فقط (طلب المالك 2026-12-01) */
.bal-code-toggle { text-decoration: none; }
.bal-code-toggle:hover, .bal-code-toggle:focus-visible { text-decoration: underline; }   /* أصغر من عنوان "رصيد الشريحة" بـ 1px (طلب المالك 2026-12-01) */   /* حد أقصى: على الهاتف تأخذ عرض الشاشة */
#test-dialog .modal-body { min-height: 11rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }   /* المحتوى في الوسط عموديًا: العنوان وحده لا يترك فراغًا كبيرًا تحته (طلب المالك) */
#test-dialog .modal-body > div { max-width: 100%; }   /* يسع النتيجة المعتادة فلا يتغير الحجم؛ نص استثنائي أطول يكبّرها بدل أن يُقطع */
@media (max-width: 575.98px) { #test-dialog .modal-body { min-height: 13rem; } }   /* الهاتف: السبب يلتف أسطرًا أكثر */
.rem-info-btn:hover, .rem-info-btn:focus-visible { background: var(--bs-secondary-bg); border-color: var(--bs-secondary-color); color: var(--bs-body-color) !important; }

/* نوع الزبون: قائمة على شكل شبكة من 3 أعمدة (طلب المالك) */
.type-grid .type-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .25rem; }
.type-grid .type-items .dropdown-item { padding: .3rem .5rem; border-radius: .375rem; white-space: normal; text-align: start; }
.type-grid .type-items .dropdown-item.active { background: var(--brand); color: #fff; }

/* الإحصائيات: رابط التبديل يوم واحد / فترة — نص رمادي بلا خط ولا أزرق، يغمق عند المرور (طلب المالك) */
.stats-mode { color: var(--bs-secondary-color); text-decoration: none; }
.stats-mode:hover, .stats-mode:focus-visible { color: var(--bs-body-color); }

/* الإحصائيات: تاريخ الفترة المعروضة بارز — خلفية لون الموقع الخفيفة وخط بلون الموقع على الجانب */
.stats-period { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; font-weight: 700; padding: .6rem .9rem; border-radius: .5rem; background: var(--brand-soft); border-inline-start: 4px solid var(--brand); color: var(--bs-body-color); }
.stats-period svg { color: var(--brand); flex-shrink: 0; }

.stats-period { flex-wrap: wrap; }
.stats-period-dates { font-size: .85rem; font-weight: 400; color: var(--bs-secondary-color); }
/* عمودا "تعبئة" و"مراقبة" في التفصيل: بعرض ثابت ليتراصّا */
.stats-pair { display: inline-flex; flex-shrink: 0; }
.stats-pair > span { width: 4.5rem; text-align: center; }

/* زر "مراقبة" برتقالي (طلب المالك 2026-11-24؛ Bootstrap بلا برتقالي) — بنفس متغيرات btn-outline-* */
.btn-outline-orange {
    /* برتقالي غامق ليكون بوضوح الأزرق (#e8590c كان باهتًا — طلب المالك) */
    --bs-btn-color: #c94a00; --bs-btn-border-color: #c94a00;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #c94a00; --bs-btn-hover-border-color: #c94a00;
    --bs-btn-focus-shadow-rgb: 201, 74, 0;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #c94a00; --bs-btn-active-border-color: #c94a00;
    --bs-btn-disabled-color: #c94a00; --bs-btn-disabled-border-color: #c94a00;
}
/* ممتلئ: للقارورة المنتهية أو القريبة، مثل "تمت التعبئة اليوم" الأخضر (طلب المالك) */
.btn-orange {
    --bs-btn-color: #fff; --bs-btn-bg: #c94a00; --bs-btn-border-color: #c94a00;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #a83e00; --bs-btn-hover-border-color: #a83e00;
    --bs-btn-focus-shadow-rgb: 201, 74, 0;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #a83e00; --bs-btn-active-border-color: #a83e00;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #c94a00; --bs-btn-disabled-border-color: #c94a00;
}
/* نص الإحصائيات: المراقبة برتقالي والتعبئة أخضر، أغمق من الأزرار (اختيار المالك 2026-11-24) */
.text-orange { color: #a93e00 !important; }
.text-green { color: rgb(0 119 64) !important; }
[data-bs-theme="dark"] .text-green { color: #4cc38a !important; }
[data-bs-theme="dark"] .text-orange { color: #ff8a3d !important; }
[data-bs-theme="dark"] .btn-outline-orange { --bs-btn-color: #ff8a3d; --bs-btn-border-color: #ff8a3d; --bs-btn-active-bg: #e8590c; --bs-btn-active-border-color: #e8590c; --bs-btn-hover-bg: #e8590c; --bs-btn-hover-border-color: #e8590c; }


/* شارة "تجريبي حتى..." (_ShopStatus): سماوي أهدأ من bg-info (طلب المالك 2026-11-23) */
.badge-trial { background-color: rgb(129 234 255); color: #0b3a44; }

/* ===== صفحات الطباعة (_PrintLayout): ملصقات QR — 2026-11-22 (تقرير المفتش صار PDF من الخادم: Pdf/ReportPdf.cs) ===== */
/* على الشاشة: كعارض PDF (شريط داكن، خلفية رمادية، صفحات A4 بيضاء بظل) — طلب المالك 2026-11-23 */
.print-body { background: #525659; color: #000; min-height: 100vh; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding: .55rem 1rem; background: #323639; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.print-title { font-weight: 500; flex: 1 1 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.print-toolbar .form-select { background-color: #fff; color: #000; }
.print-pages { padding: 6mm 0; }
.sheet-page { width: 210mm; height: 297mm; box-sizing: border-box; margin: 0 auto 6mm; background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.45); overflow: hidden; }

/* بطاقات مراقبة بمقاس يختاره المحل (LabelsModel.Sizes: ×4 الافتراضي، ×8، ×10، ×21)، أو ورق عادي ثم القص على الخط المتقطع.
   المتغيرات من الصفحة: --lw/--lh المقاس، --cols، --qr الرمز، --lf الخط.
   تصميم واحد منذ 2026-11-23 (طلب المالك، مثل بطاقات المحلات): رأس في الوسط، جدول بإطار + QR بجانبه، مدة الصلاحية في الأسفل */
.label-sheet { --lw: 99.1mm; --lh: 139mm; --cols: 2; --qr: 40mm; --lf: 12pt;
    display: grid; grid-template-columns: repeat(var(--cols), var(--lw)); gap: 0 2.5mm; justify-content: center; }
.qr-label { width: var(--lw); height: var(--lh); box-sizing: border-box; display: flex;
    border: 1px dashed #bbb; overflow: hidden; break-inside: avoid; background: #fff; color: #000; }
.qr-card { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 0; padding: 1.5mm 2mm;
    font-size: var(--lf); line-height: 1.2; text-align: center; }
.qr-card-shop { font-weight: bold; font-size: calc(var(--lf) * 1.7); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-card-addr, .qr-card-tel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-card-tel { font-weight: bold; }
.qr-card-sep { display: inline-block; margin: 0 .5em; }
.qr-card-title { font-weight: bold; font-size: calc(var(--lf) * 1.9); line-height: 1.1; }   /* أكبر من اسم المحل (الحجمان تبادلا بطلب المالك 2026-11-24) */
.qr-card-body { display: flex; align-items: center; gap: 1.5mm; min-height: 0; }
.qr-card-tablewrap { flex: 1 1 0; min-width: 0; }
.qr-card-table { width: 100%; border-collapse: collapse; table-layout: fixed; }   /* fixed + 100%: المكان الطويل يُقتطع بـ … ولا يدفع الرمز */
.qr-card-table th, .qr-card-table td { border: .25mm solid #000; padding: .2em .5em; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-card-table th { font-weight: normal; width: 45%; }
.qr-card-date { font-weight: bold; font-size: calc(var(--lf) * 1.15); }
/* المكان يظهر كاملًا (طلب المالك): يلتف على أسطر؛ في البطاقات الصغيرة حتى سطرين، وفي الطويلة (×4) بلا حد */
.qr-card-table td.qr-card-loc { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.qr-card-loc-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qr-card-tall .qr-card-loc-text { display: block; }
.qr-card-code { flex: 0 0 var(--qr); }
.qr-card-code svg { width: var(--qr); height: var(--qr); display: block; }
.qr-card-validity { font-weight: bold; font-size: calc(var(--lf) * 1.6); line-height: 1.1; }   /* أكبر بطلب المالك */
/* البطاقة الطويلة (×4، 99.1×139): الاسم يلتف حتى سطرين، الجدول بالعرض كله والرمز في الوسط تحته */
.qr-card-tall { padding: 4mm 4mm 3mm; }
.qr-card-tall .qr-card-shop { white-space: normal; font-size: calc(var(--lf) * 1.6); line-height: 1.15;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qr-card-tall .qr-card-addr { white-space: normal; }
.qr-card-tall .qr-card-body { flex-direction: column; gap: 3mm; }
.qr-card-tall .qr-card-tablewrap { width: 100%; flex: 0 0 auto; }
.qr-card-tall .qr-card-table th, .qr-card-tall .qr-card-table td { padding: .35em .6em; }
.qr-card-tall .qr-card-table th { width: 42%; }
.qr-card-tall .qr-card-code { flex: 0 0 auto; }
.qr-card-tall .qr-card-code svg { margin: 0 auto; }
/* اسم طويل + مكان طويل معًا: الرمز وحده يصغر (حتى 22mm، يبقى مقروءًا) بدل أن تغطيه "مدة الصلاحية" (2026-12-02) */
.qr-card-tall > * { flex-shrink: 0; }
.qr-card-tall > .qr-card-body { flex: 0 1 auto; min-height: 0; }
.qr-card-tall .qr-card-code { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; }
.qr-card-tall .qr-card-code svg { flex: 0 1 var(--qr); min-height: 22mm; }
/* حروف Noto أنزل من السطر الضيق: overflow:hidden كان يقطع نقطتي الياء. حشو يقابله هامش سالب = نفس المقاس بلا قطع (2026-12-02) */
.qr-card-shop, .qr-card-addr, .qr-card-tel { flex-shrink: 0; padding-block: .3em; margin-block: -.3em; }
/* المقتطع بسطرين (line-clamp): سطر أعلى بدل الحشو، وإلا يطلّ السطر الثالث المخفي */
.qr-card-tall .qr-card-shop { line-height: 1.4; padding-block: 0; margin-block: -.25em; }   /* سطران = 2.3em كما كان */
.qr-card:not(.qr-card-tall) .qr-card-table td.qr-card-loc { padding-block: 0; line-height: 1.4; }   /* 2×1.4 = 2×1.2 + الحشو القديم */
.qr-card-tall .qr-card-loc-text { overflow: visible; }

@media print {
    .print-body { background: #fff !important; }
    /* الصفحة الورقية = @page بهوامشه؛ إطار "العارض" يختفي، وكل ورقة تبدأ صفحة جديدة */
    .print-pages { padding: 0; zoom: 1 !important; }
    .sheet-page { width: auto; height: auto; margin: 0; padding: 0 !important; box-shadow: none; overflow: visible; break-after: page; }
    .sheet-page:last-child { break-after: auto; }
}

/* ===== الدعم الفني (طلب المالك 2026-11-24) ===== */
.min-w-0 { min-width: 0; }
.side-link { position: relative; }
/* شارة غير المقروء بجانب "الدعم" في القائمة الجانبية */
.side-badge {
    margin-inline-start: auto;
    min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
    border-radius: 999px; background: #dc3545; color: #fff;
    font-size: .75rem; font-weight: 700; line-height: 1.35rem; text-align: center;
}
@media (min-width: 992px) {
    /* القائمة المطويّة: الشارة نقطة بعدد صغير فوق الأيقونة */
    .sidebar-collapsed .side-link span.side-badge { display: inline-block; position: absolute; top: .1rem; inset-inline-end: .35rem; min-width: 1.1rem; height: 1.1rem; line-height: 1.1rem; font-size: .65rem; padding: 0 .25rem; }
}
.support-box { display: flex; flex-direction: column; gap: .5rem; }
/* الخلفية: لون الموقع خفيفًا + رموز المنصة (من رسمنا) كقناع بلون الموقع — تتبع اللون المختار والمظهر الداكن */
.support-wall {
    position: relative; isolation: isolate; overflow: hidden;
    border: 1px solid var(--bs-border-color); border-radius: .75rem;
    background: color-mix(in srgb, var(--brand) 7%, var(--bs-body-bg));
}
.support-wall::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: var(--brand); opacity: .13;
    -webkit-mask: url("/img/support-pattern.svg") repeat top left / 180px 180px;
    mask: url("/img/support-pattern.svg") repeat top left / 180px 180px;
}
[data-bs-theme="dark"] .support-wall { background: color-mix(in srgb, var(--brand) 8%, var(--bs-body-bg)); }
[data-bs-theme="dark"] .support-wall::before { opacity: .16; }
.support-thread {
    display: flex; flex-direction: column; gap: .5rem;
    height: calc(100vh - 21rem); min-height: 18rem; overflow-y: auto;
    padding: .75rem;
}
.msg { max-width: 85%; padding: .45rem .75rem .3rem; border-radius: .85rem; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.msg-theirs { align-self: flex-start; background: var(--bs-body-bg); border-start-start-radius: .25rem; }
.msg-mine { align-self: flex-end; background: color-mix(in srgb, var(--brand) 22%, var(--bs-body-bg)); color: var(--bs-body-color); border-start-end-radius: .25rem; }
/* ذيل الفقاعة في الزاوية العليا (مثل WhatsApp، طلب المالك 2026-11-26): مثلث بلون الفقاعة يبرز للخارج والزاوية مربعة؛
   أول فقاعة فقط من سلسلة نفس الطرف — التالية بلا ذيل وبزاوية مستديرة قليلًا */
.msg { position: relative; }
.msg-theirs { border-start-start-radius: 0; }
.msg-mine { border-start-end-radius: 0; }
.msg-theirs::before, .msg-mine::before {
    content: ""; position: absolute; top: 0; width: .55rem; height: .8rem; background: inherit;
}
.msg-theirs::before { inset-inline-start: -.55rem; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.msg-mine::before { inset-inline-end: -.55rem; clip-path: polygon(0 0, 100% 0, 0 100%); }
[dir="rtl"] .msg-theirs::before { clip-path: polygon(0 0, 100% 0, 0 100%); }
[dir="rtl"] .msg-mine::before { clip-path: polygon(0 0, 100% 0, 100% 100%); }
.msg-theirs + .msg-theirs, .msg-mine + .msg-mine { margin-top: -.25rem; }
.msg-theirs + .msg-theirs { border-start-start-radius: .85rem; }
.msg-mine + .msg-mine { border-start-end-radius: .85rem; }
.msg-theirs + .msg-theirs::before, .msg-mine + .msg-mine::before { display: none; }
.support-wall .msg-theirs { margin-inline-start: .45rem; }
.support-wall .msg-mine { margin-inline-end: .45rem; }
/* حالة المحل عند المدير (ألوان ثابتة): .active أخضر "نشط الآن"، .idle أصفر "غير نشط" (الموقع مفتوح)، بلا class رمادي غير متصل */
.presence { display: inline-flex; align-items: center; gap: .3rem; color: var(--bs-secondary-color); white-space: nowrap; }
.presence-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #adb5bd; flex-shrink: 0; }
.presence.active { color: #198754; font-weight: 600; }
[data-bs-theme="dark"] .presence.active { color: #4cc38a; }
.presence.active .presence-dot { background: #22c55e; box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 30%, transparent); }
.presence.idle { color: #a16207; }
[data-bs-theme="dark"] .presence.idle { color: #facc15; }
.presence.idle .presence-dot { background: #f5b301; }
.chat-avatar { position: relative; }
.chat-avatar.active::after, .chat-avatar.idle::after {
    content: ""; position: absolute; bottom: 0; inset-inline-end: 0; width: .7rem; height: .7rem; border-radius: 50%;
    background: #22c55e; border: 2px solid var(--bs-body-bg);
}
.chat-avatar.idle::after { background: #f5b301; }
.support-older {align-self: center; background: var(--bs-body-bg); border-radius: 1rem; padding: .25rem .9rem; box-shadow: 0 1px 2px rgba(0,0,0,.12); color: var(--bs-secondary-color); }
.support-empty { background: var(--bs-body-bg); border-radius: .75rem; align-self: center; padding: .5rem 1rem !important; margin-top: 3rem; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.msg-body { overflow-wrap: anywhere; line-height: 1.6; }   /* النص في .msg-text (pre-wrap)؛ هنا لا pre-wrap: مسافات Razor حول الصورة */
.msg-body + .msg-body { margin-top: .3rem; }   /* رسائل نفس الدقيقة في إطار واحد (مثل Messenger) */
/* روابط بلا خط تحتها (طلب المالك 2026-11-25)؛ الخط يظهر فقط عند مرور الفأرة */
.msg-body a { color: #0b62c4; text-decoration: none; unicode-bidi: isolate; }   /* الروابط (support.js linkify) */
.link-plain { text-decoration: none; }
.msg-body a:hover { text-decoration: underline; }   /* الاستثناء الوحيد: روابط رسائل المحادثة تُسطَّر عند المرور بالفأرة (طلب المالك 2026-11-27) */
[data-bs-theme="dark"] .msg-body a { color: #6cb8ff; }
.msg-meta { display: flex; gap: .4rem; justify-content: flex-end; font-size: .72rem; color: var(--bs-secondary-color); margin-top: .15rem; }
.msg-check { letter-spacing: -.2em; font-weight: 700; }
/* ✓ أُرسلت (رمادي) / ✓✓ وصلت (رمادي) / ✓✓ قُرئت (أزرق ثابت لا يتبع لون الموقع — طلب المالك 2026-11-25) */
.msg-check.seen { color: #0b74e5; }
[data-bs-theme="dark"] .msg-check.seen { color: #53b1ff; }
/* المحادثة تملأ النافذة تحت الشريط، بلا حواف (ViewData["Chat"]، طلب المالك 2026-11-24) */
.app-content.app-content-chat { padding: 0; display: flex; }
.page-chat {
    flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; padding-bottom: 0 !important;
    height: calc(100vh - 56px); height: calc(100dvh - 56px);
}
/* رأس المحادثة: لون الموقع بتدرّج خفيف مع رموز الخلفية نفسها (من رسمنا) — طلب المالك */
.page-chat .chat-head {
    flex-shrink: 0; padding: .6rem 1rem; position: relative; isolation: isolate; overflow: hidden;
    background: linear-gradient(to left, color-mix(in srgb, var(--brand) 20%, var(--bs-body-bg)), color-mix(in srgb, var(--brand) 9%, var(--bs-body-bg)));
    border-bottom: 1px solid color-mix(in srgb, var(--brand) 25%, var(--bs-border-color));
}
[dir="ltr"] .page-chat .chat-head { background: linear-gradient(to right, color-mix(in srgb, var(--brand) 20%, var(--bs-body-bg)), color-mix(in srgb, var(--brand) 9%, var(--bs-body-bg))); }
.page-chat .chat-head::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: var(--brand); opacity: .1;
    -webkit-mask: url("/img/support-pattern.svg") repeat center / 120px 120px;
    mask: url("/img/support-pattern.svg") repeat center / 120px 120px;
}
.chat-head-avatar { width: 2.6rem; height: 2.6rem; font-size: 1.15rem; background: var(--brand); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-body-bg) 70%, transparent); }
.page-chat .support-box { flex: 1 1 auto; min-height: 0; gap: 0; }
.page-chat .support-wall { flex: 1 1 auto; min-height: 0; border: 0; border-radius: 0; }
.page-chat .support-thread {
    height: auto; min-height: 0;
    /* على الشاشات العريضة: الرسائل في عمود وسط مريح للقراءة، والخلفية بالعرض كله */
    padding: 1rem max(.75rem, calc((100% - 900px) / 2));
}
.page-chat .msg { max-width: min(85%, 640px); }
.support-wall { display: flex; flex-direction: column; }
.support-thread { flex: 1 1 auto; }
/* حقل الكتابة عائم فوق الخلفية في أسفل المحادثة: شريط مستدير أبيض وزر إرسال دائري بلون الموقع (طلب المالك) */
.support-compose { flex-shrink: 0; padding: .5rem .75rem .75rem; }
.page-chat .support-compose { padding-inline: max(.75rem, calc((100% - 900px) / 2)); }
.support-form {
    display: flex; align-items: flex-end; gap: .4rem;
    background: var(--bs-body-bg); border-radius: 1.6rem; padding: .3rem .3rem .3rem .4rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.support-form:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent), 0 1px 3px rgba(0,0,0,.15); }
.support-input {
    flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--bs-body-color);
    resize: none; padding: .35rem .75rem; line-height: 1.5; max-height: 160px; overflow-y: auto;
}
/* الزر 2.2rem (كان 2.6rem) والرمز بنفس حجمه، والحقل بنفس الارتفاع ← الإطار أقل ارتفاعًا (طلب المالك 2026-11-26) */
.support-send {
    flex-shrink: 0; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%;
    background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.support-send:hover { background: var(--brand-dark); }
.support-send:disabled { opacity: .6; }
.support-send svg { width: 1.2rem; height: 1.2rem; margin-inline-start: -.1rem; }
[dir="rtl"] .support-send svg { transform: scaleX(-1); }
/* ---------- صور الدعم (سكربت 38، طلب المالك 2026-11-26) ---------- */
.support-attach {
    flex-shrink: 0; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: transparent;
    color: var(--bs-secondary-color); display: inline-flex; align-items: center; justify-content: center;
}
.support-attach:hover { color: var(--brand-text); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.support-attach svg { width: 1.25rem; height: 1.25rem; }
.support-attach.d-none { display: none; }
/* المعاينة قبل الإرسال: فوق الحقل، مصغّرة + الاسم + ✕ */
.support-preview { display: flex; align-items: center; gap: .6rem; width: fit-content; max-width: 100%; margin-bottom: .4rem; padding: .35rem .5rem;
    background: var(--bs-body-bg); border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.support-preview.d-none { display: none; }
.support-preview img { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: .5rem; flex-shrink: 0; }
.support-preview-name { max-width: 14rem; }
.support-preview.sending img { opacity: .5; }
.support-preview .btn-close { flex-shrink: 0; }
/* الصورة في الفقاعة: بنسبتها (width/height محجوزة)، حتى 300×320 */
.msg-image { display: block; margin: .1rem 0 .25rem; }
.msg-image img { display: block; max-width: min(100%, 300px); max-height: 320px; width: auto; height: auto; object-fit: contain; border-radius: .6rem; cursor: zoom-in; background: var(--bs-secondary-bg); }
.msg-img-gone { font-size: .82rem; color: var(--bs-secondary-color); font-style: italic; padding: .15rem 0; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-body + .msg-body .msg-image { margin-top: .3rem; }
/* السحب والإفلات فوق المحادثة */
.support-box.support-drop .support-wall { outline: 3px dashed var(--brand); outline-offset: -6px; }
/* تعديل الرسائل وحذفها (سكربت 39، طلب المالك 2026-11-27) */
.msg-body { position: relative; }
.msg-edited { display: block; font-size: .7rem; opacity: .7; font-style: italic; text-align: end; }
.msg-deleted-text { font-size: .85rem; font-style: italic; opacity: .75; }
/* زر ⌄ على الرسالة: يظهر عند المرور بالفأرة، وخفيفًا دائمًا على شاشات اللمس */
.msg-more { position: absolute; top: -.2rem; inset-inline-end: -.35rem; width: 1.5rem; height: 1.5rem; padding: 0; border: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: inherit; background: transparent; opacity: 0; transition: opacity .15s, background-color .15s; }
.msg-more svg { width: 1rem; height: 1rem; }
.msg-body:hover > .msg-more, .msg-more:focus-visible { opacity: .85; }
.msg-more:hover { background: rgba(0,0,0,.12); opacity: 1; }
@media (pointer: coarse) { .msg-more { opacity: .45; } }
.msg-body:has(> .msg-more) .msg-text, .msg-body:has(> .msg-more) .msg-deleted-text { padding-inline-end: 1.1rem; }
.msg-menu { position: fixed; z-index: 1080; min-width: 9rem; margin: 0; }
/* شريط "تعديل الرسالة" فوق حقل الكتابة */
.support-editing { display: flex; align-items: center; gap: .5rem; max-width: 100%; margin-bottom: .4rem; padding: .35rem .6rem;
    background: var(--bs-body-bg); border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.15); border-inline-start: 4px solid var(--brand); color: var(--brand-text); }
.support-editing.d-none { display: none; }
.support-editing .support-editing-text { flex: 1; min-width: 0; color: var(--bs-secondary-color); }
.support-editing .btn-close { flex-shrink: 0; font-size: .7rem; }
/* التكبير داخل الصفحة */
.support-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 1rem; cursor: zoom-out; }
.support-lightbox.d-none { display: none; }
.support-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: .25rem; }
/* مفتاح "الصور" في رأس المحادثة (طلب المالك 2026-11-26): مفتاح فقط بلا إطار ولا شكل زر؛ الكلمة والأيقونة بلون الموقع،
   المفتاح بلون الموقع الفاتح وهو مطفأ، وأخضر وهو مشغّل */
.chat-head-switch { padding: 0 .2rem; font-size: .875rem; }
.chat-head-switch .form-check { display: flex; align-items: center; gap: .45rem; padding: 0; min-height: 0; }
.chat-head-switch .form-check-input {
    float: none; margin: 0; cursor: pointer; box-shadow: none; width: 2.4em; height: 1.3em;
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-color: color-mix(in srgb, var(--brand) 45%, #fff); border-color: var(--brand);
}
.chat-head-switch .form-check-input:checked { background-color: #22c55e; border-color: #16a34a; }
.chat-head-switch .form-check-input:focus { box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 25%, transparent); }
.chat-head-switch .form-check-label { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; color: var(--brand-text); font-weight: 700; }
.chat-head-sub .presence { font-size: inherit; }
.support-lightbox .btn-close { position: absolute; top: 1rem; inset-inline-end: 1rem; }
/* "يكتب الآن..." فوق حقل الكتابة على جهة رسائل الطرف الآخر (البداية)، بثلاث نقاط متحركة (طلب المالك 2026-11-26) */
.support-typing { display: flex; width: fit-content; align-items: center; gap: .45rem; margin-bottom: .4rem; padding: .3rem .75rem;
    background: var(--bs-body-bg); color: var(--bs-secondary-color); font-size: .82rem; border-radius: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.support-typing.d-none { display: none; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); opacity: .35; animation: typing-dot 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .7; } }
.support-error { background: var(--bs-body-bg); color: var(--err, #dc3545); border-radius: .6rem; padding: .3rem .75rem; margin-bottom: .4rem; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
/* صفحات الدعم عند المدير مثل Messenger: قائمة المحلات على جانب والمحادثة على الآخر (طلب المالك 2026-11-24) */
.chat-split { flex: 1 1 auto; min-height: 0; display: flex; }
.chat-pane { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.chat-pane > .support-wall { display: flex; }
.chat-list { width: 100%; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bs-body-bg); }
@media (min-width: 992px) { .chat-list { width: 330px; border-inline-end: 1px solid var(--bs-border-color); } }
@media (max-width: 991.98px) { .chat-split.has-thread .chat-list { display: none; } }
/* إطار البحث بنفس تدرّج رأس المحادثة .chat-head (أعلى الصفحة شريط واحد متصل — الخيار ج، طلب المالك 2026-11-26)؛ الحقل نفسه يبقى فاتحًا.
   لذلك المحل المحدد رمادي + شريط بلون الموقع على جانبه (مثل Messenger) لا بلون الموقع الخفيف */
.chat-list-search {
    padding: .6rem .75rem;
    background: linear-gradient(to left, color-mix(in srgb, var(--brand) 20%, var(--bs-body-bg)), color-mix(in srgb, var(--brand) 9%, var(--bs-body-bg)));
    border-bottom: 1px solid color-mix(in srgb, var(--brand) 25%, var(--bs-border-color));
}
[dir="ltr"] .chat-list-search { background: linear-gradient(to right, color-mix(in srgb, var(--brand) 20%, var(--bs-body-bg)), color-mix(in srgb, var(--brand) 9%, var(--bs-body-bg))); }
.chat-list-search .form-control { background-color: var(--bs-body-bg); }
.chat-list-items { flex: 1 1 auto; overflow-y: auto; }
.chat-item { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; color: var(--bs-body-color); text-decoration: none; border-bottom: 1px solid var(--bs-border-color-translucent); }
.chat-item:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.chat-item.active { background: var(--bs-secondary-bg); box-shadow: inset -4px 0 0 var(--brand); }
[dir="ltr"] .chat-item.active { box-shadow: inset 4px 0 0 var(--brand); }
.chat-avatar {
    flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--brand) 16%, var(--bs-body-bg)); color: var(--brand-text); font-weight: 700; font-size: 1.1rem;
}
.chat-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.chat-item-top, .chat-item-bottom { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.chat-item-name { flex: 1 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-when { flex-shrink: 0; font-size: .72rem; color: var(--bs-secondary-color); }
.chat-item-last { flex: 1 1 auto; min-width: 0; font-size: .85rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* "يكتب الآن..." مكان آخر رسالة في قائمة المحادثات (support-list.js) */
.chat-item-typing { display: none; flex: 1 1 auto; align-items: center; gap: .4rem; font-size: .85rem; color: var(--brand); font-weight: 600; }
.chat-item.is-typing .chat-item-typing { display: inline-flex; }
.chat-item.is-typing .chat-item-last { display: none; }
.chat-item.unread .chat-item-name, .chat-item.unread .chat-item-last { font-weight: 700; color: var(--bs-body-color); }
.chat-item.unread .chat-item-when { color: var(--brand-text); font-weight: 700; }
/* تنبيه رسالة دعم داخل الموقع (support-notify.js، طلب المالك 2026-11-26): الصفحة ظاهرة ونشطة ← بطاقة صغيرة أعلى الصفحة
   على الجانب المقابل للقائمة الجانبية، تنزلق وتختفي وحدها بعد 6 ثوانٍ */
.support-toast {
    position: fixed; top: 4.25rem; inset-inline-end: 1rem; z-index: 1090;
    display: flex; align-items: flex-start; gap: .65rem;
    width: 340px; max-width: calc(100vw - 2rem);
    padding: .75rem .85rem; border-radius: .9rem;
    background: var(--card-bg, var(--bs-body-bg)); color: var(--bs-body-color); text-decoration: none;
    border: 1px solid var(--bs-border-color); border-inline-start: 4px solid var(--brand);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    opacity: 0; transform: translateY(-12px); transition: opacity .25s, transform .25s;
}
.support-toast.show { opacity: 1; transform: none; }
.support-toast:hover { color: var(--bs-body-color); box-shadow: 0 12px 34px rgba(0, 0, 0, .24); }
.support-toast-icon { width: 2rem; height: 2rem; flex-shrink: 0; }
.support-toast-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.support-toast-text strong { font-size: .92rem; }
/* نص الرسالة حتى 3 أسطر (الخادم يرسل أول 140 حرفًا) — سطر واحد كان يقصّها (ملاحظة المالك) */
.support-toast-body { font-size: .88rem; color: var(--bs-secondary-color); margin-top: .15rem; overflow: hidden; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.support-toast-close { flex-shrink: 0; font-size: .7rem; margin-top: .15rem; }

/* اختيار موقع المحل على الخريطة (Shared/_MapPicker، Leaflet) */
.map-picker-map { height: 280px; border-radius: .6rem; border: 1px solid var(--input-border, var(--bs-border-color)); z-index: 0; }
.map-picker-map .leaflet-control-attribution { font-size: 10px; }
[data-bs-theme=dark] .map-picker-map .leaflet-tile-pane { filter: brightness(.8) contrast(1.1); }

/* ==========================================================================
   الواجهة العامة (طلب المالك 2026-12-01): الصفحة الرئيسية للزائر، الأسعار، شروط الخدمة — _PublicLayout
   كل الرسوم من رسمنا (HTML/SVG)، بألوان الموقع (--brand) وتعمل بالمظهر الداكن
   ========================================================================== */
.pub-body { background: var(--app-bg); }
.pub-header {
    position: sticky; top: 0; z-index: 1030;
    background: color-mix(in srgb, var(--card-bg) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--card-border);
}
.pub-nav { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block: .6rem; flex-wrap: wrap; }
.pub-brand { display: inline-flex; align-items: center; gap: .45rem; font-size: 1.4rem; font-weight: 800; color: var(--brand-text); }
.pub-brand:hover { color: var(--brand-text); }
.pub-brand-sm { font-size: 1.15rem; }
.pub-links { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.pub-link { color: var(--bs-body-color); padding: .4rem .7rem; border-radius: .55rem; font-weight: 500; }
.pub-link:hover { background: var(--brand-soft); color: var(--brand-text); }
.pub-link.active { color: var(--brand-text); font-weight: 700; }
.pub-login { padding-inline: 1.1rem; border-radius: 2rem; font-weight: 700; }
@media (max-width: 575.98px) {
    .pub-header { position: static; }   /* على الهاتف الرأس سطران أو ثلاثة: لا يُثبَّت أعلى الشاشة */
    .pub-nav { justify-content: center; }
    .pub-link { padding: .35rem .5rem; font-size: .92rem; }
}
.pub-footer { border-top: 1px solid var(--card-border); background: var(--card-bg); padding: 1.75rem 0 1.25rem; }
.pub-footer a:not(.pub-brand) { color: var(--bs-secondary-color); }
.pub-footer a:not(.pub-brand):hover { color: var(--brand-text); }

/* ---------- البطل ---------- */
.land-hero {
    position: relative; overflow: hidden; padding: 4rem 0 4.5rem;
    background:
        radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
        radial-gradient(40rem 24rem at 0% 110%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%);
}
.land-hero::before {   /* رموز الموقع (مطفأة، لهب، جرس...) خفيفة في الخلفية — نفس رسم خلفية المحادثة */
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .06; background: var(--brand);
    -webkit-mask: url("/img/support-pattern.svg") repeat top left / 200px 200px;
    mask: url("/img/support-pattern.svg") repeat top left / 200px 200px;
}
.land-hero > .container { position: relative; }
.land-hero-sm { padding: 3rem 0 2.5rem; }
.land-kicker {
    display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; border-radius: 2rem;
    background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: .9rem;
}
.land-kicker-icon { width: 1rem; height: 1rem; }
.land-title { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; line-height: 1.35; margin: 1rem 0 .9rem; }
.land-mark { color: var(--brand-text); }
.land-lead { font-size: 1.15rem; line-height: 1.9; color: var(--bs-secondary-color); }
.land-cta { border-radius: 2rem; padding-inline: 1.6rem; font-weight: 700; box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 35%, transparent); }
.land-cta-2 { border-radius: 2rem; padding-inline: 1.4rem; }
.land-trust { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--bs-secondary-color); font-size: .95rem; }
.land-trust li, .land-checks li { display: inline-flex; align-items: center; gap: .4rem; }
.land-trust-icon { width: 1.1rem; height: 1.1rem; color: #198754; flex-shrink: 0; }

/* الهاتف والرسالة (رسم HTML/CSS) */
.land-visual { position: relative; height: 470px; max-width: 440px; margin-inline: auto; }
.land-glow { position: absolute; inset: 12% 10%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 30%, transparent), transparent 65%); filter: blur(10px); }
.land-ext { position: absolute; width: 150px; height: 212px; inset-inline-start: 0; bottom: 8px; transform: rotate(-8deg); filter: drop-shadow(0 18px 24px rgba(0,0,0,.18)); }
.land-phone {
    position: absolute; inset-inline-end: 34px; top: 10px; width: 250px; height: 440px;
    border-radius: 2.4rem; background: #1b1e22; padding: 11px; box-shadow: 0 30px 60px rgba(0,0,0,.25);
    transform: rotate(3deg);
}
.land-phone-notch { position: absolute; top: 11px; left: 50%; width: 80px; height: 20px; margin-left: -40px; background: #1b1e22; border-radius: 0 0 .8rem .8rem; z-index: 2; }
.land-phone-screen { height: 100%; border-radius: 1.8rem; background: var(--app-bg); overflow: hidden; padding: 2rem .7rem .7rem; display: flex; flex-direction: column; gap: .6rem; }
.land-phone-top { display: flex; align-items: center; gap: .5rem; padding-bottom: .55rem; border-bottom: 1px solid var(--card-border); }
.land-phone-sub { font-size: .7rem; color: var(--bs-secondary-color); }
.land-avatar { width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.land-avatar-icon { width: 1rem; height: 1rem; }
.land-sms {
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 1rem; border-start-start-radius: .3rem;
    padding: .6rem .75rem; font-size: .82rem; line-height: 1.7; box-shadow: 0 2px 8px rgba(0,0,0,.06); max-width: 92%;
    animation: land-pop .6s ease-out backwards .1s;
}
.land-sms-reply { align-self: flex-end; background: var(--brand); color: #fff; border-color: transparent; border-start-start-radius: 1rem; border-start-end-radius: .3rem; animation-delay: .6s; }
.land-sms-time { font-size: .65rem; opacity: .65; text-align: end; margin-top: .15rem; }
.land-float {
    position: absolute; display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 1rem;
    background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: 0 14px 34px rgba(0,0,0,.14); z-index: 3;
    animation: land-float 5s ease-in-out infinite;
}
.land-float-1 { inset-inline-end: -6px; top: 74%; }
.land-float-2 { inset-inline-start: -8px; top: 30%; animation-delay: 1.5s; }
.land-float-icon { width: 2.2rem; height: 2.2rem; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-text); }
.land-float-icon.is-ok { background: color-mix(in srgb, #198754 15%, transparent); color: #198754; }
.land-icon-sm { width: 1.15rem; height: 1.15rem; }
.land-float-num { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.land-float-label { font-size: .78rem; color: var(--bs-secondary-color); }
.land-float-2 .land-float-label { color: var(--bs-body-color); }
@keyframes land-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes land-pop { from { transform: translateY(8px) scale(.97); } to { transform: none; } }   /* بلا opacity: النص ظاهر ولو لم تعمل الحركة */
@media (prefers-reduced-motion: reduce) { .land-float, .land-sms { animation: none; } }
@media (max-width: 575.98px) {
    .land-visual { height: 420px; }
    .land-phone { width: 220px; height: 400px; inset-inline-end: 50%; margin-inline-end: -110px; }
    .land-ext { width: 110px; height: 156px; }
    .land-float-1 { inset-inline-end: 0; }
    .land-float-2 { inset-inline-start: 0; top: 22%; }
}

/* ---------- الأقسام ---------- */
.land-section { padding: 4.5rem 0; }
.land-section-alt { background: var(--card-bg); border-block: 1px solid var(--card-border); }
.land-h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; text-align: center; margin-bottom: .6rem; }
.land-sub { text-align: center; color: var(--bs-secondary-color); font-size: 1.08rem; max-width: 40rem; margin: 0 auto; }
.land-h3 { font-size: 1.15rem; font-weight: 700; margin: .9rem 0 .45rem; }
.land-icon { width: 1.5rem; height: 1.5rem; }
.land-step, .land-feature {
    height: 100%; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 1.25rem; padding: 1.6rem;
    box-shadow: var(--card-shadow); transition: transform .2s, box-shadow .2s;
}
.land-section-alt .land-feature { background: var(--app-bg); }
.land-step:hover, .land-feature:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,.1); }
.land-step { position: relative; }
.land-step-num {
    position: absolute; top: 1.1rem; inset-inline-end: 1.2rem; font-size: 2.6rem; font-weight: 800; line-height: 1;
    color: color-mix(in srgb, var(--brand) 18%, transparent);
}
.land-step-icon, .land-feature-icon {
    width: 3.1rem; height: 3.1rem; border-radius: 1rem; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand-text);
}
.land-step-icon { background: var(--brand); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent); }
.land-checks { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .6rem; font-size: 1.02rem; }

/* بطاقة مراقبة تجريبية (مثل البطاقة المطبوعة) */
.land-card-demo {
    max-width: 420px; margin-inline: auto; background: #fff; color: #212529; border-radius: 1rem; padding: 1.25rem 1.25rem 1rem;
    border: 2px solid #212529; box-shadow: 0 24px 50px rgba(0,0,0,.16); transform: rotate(-2deg); text-align: center;
}
.land-card-shop { font-size: 1.45rem; font-weight: 800; color: #b02a37; }
.land-card-addr { font-size: .85rem; color: #555; }
.land-card-kind { display: inline-block; margin: .6rem 0; padding: .15rem .9rem; border-radius: 2rem; background: #212529; color: #fff; font-weight: 700; font-size: .9rem; }
.land-card-body { display: flex; gap: .8rem; align-items: center; }
.land-card-table { flex: 1; border-collapse: collapse; font-size: .85rem; text-align: start; }
.land-card-table th, .land-card-table td { border: 1px solid #212529; padding: .3rem .45rem; }
.land-card-table th { background: #f1f1f1; font-weight: 700; white-space: nowrap; }
.land-qr { width: 96px; height: 96px; flex-shrink: 0; fill: #212529; background: #fff; }
.land-card-foot { margin-top: .7rem; font-size: .85rem; font-weight: 700; }

.land-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.75rem; }
.land-chip { padding: .5rem 1.1rem; border-radius: 2rem; background: var(--app-bg); border: 1px solid var(--card-border); font-weight: 600; }

/* شريط الدعوة الأخير */
.land-band {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
    padding: 2.5rem; border-radius: 1.5rem; color: #fff; position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 24px 50px color-mix(in srgb, var(--brand) 35%, transparent);
}
.land-band::before {
    content: ""; position: absolute; inset: 0; opacity: .12; background: #fff; pointer-events: none;
    -webkit-mask: url("/img/support-pattern.svg") repeat center / 160px 160px; mask: url("/img/support-pattern.svg") repeat center / 160px 160px;
}
.land-band > * { position: relative; }
.land-band-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin-bottom: .4rem; }
.land-band-btn { color: var(--brand) !important; font-weight: 800; border-radius: 2rem; padding-inline: 1.5rem; }
.land-band .btn-outline-light { border-radius: 2rem; }

/* ---------- الأسعار ---------- */
.price-trial {
    display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; margin-top: 1rem;
    padding: .75rem 1.1rem; border-radius: 1rem; background: var(--card-bg); border: 1px dashed var(--brand-text);
}
.price-card {
    height: 100%; display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 1.4rem; padding: 1.75rem 1.5rem; box-shadow: var(--card-shadow); transition: transform .2s, box-shadow .2s;
    border-top: 5px solid var(--brand);
}
.price-card:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(0,0,0,.12); }
.price-name { font-size: 1.4rem; font-weight: 800; margin: 0; }
.price-desc { color: var(--bs-secondary-color); margin-top: .2rem; }
.price-amount { margin: 1.1rem 0 .9rem; font-size: 2.2rem; font-weight: 800; color: var(--brand-text); line-height: 1.2; }
.price-amount span { font-size: .95rem; font-weight: 500; color: var(--bs-secondary-color); }
.price-periods { display: grid; gap: .45rem; padding: .8rem; border-radius: .9rem; background: var(--app-bg); margin-bottom: 1.1rem; font-size: .92rem; }
.price-period { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; justify-content: space-between; }
.price-free { width: 100%; font-size: .8rem; color: #198754; font-weight: 600; }
.price-features { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .55rem; }
.price-features li { display: flex; align-items: flex-start; gap: .5rem; }
.price-features li.is-off { color: var(--bs-secondary-color); }
.price-check { width: 1.15rem; height: 1.15rem; color: #198754; flex-shrink: 0; margin-top: .2rem; }
.price-check.is-off { color: var(--bs-secondary-color); }
.price-faq { display: grid; gap: .75rem; }
.price-faq-item { background: var(--app-bg); border: 1px solid var(--card-border); border-radius: 1rem; padding: 1rem 1.2rem; }
.price-faq-item summary { font-weight: 700; cursor: pointer; }
.price-faq-item p { margin: .7rem 0 0; color: var(--bs-secondary-color); line-height: 1.9; }

/* ---------- شروط الخدمة ---------- */
.terms-wrap { display: grid; gap: 2rem; max-width: 64rem; }
@media (min-width: 992px) { .terms-wrap { grid-template-columns: 16rem 1fr; align-items: start; } .terms-toc { position: sticky; top: 5.5rem; } }
.terms-toc { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 1rem; padding: 1.1rem 1.2rem; }
.terms-toc ol { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .35rem; font-size: .92rem; }
.terms-toc a { color: var(--bs-body-color); }
.terms-toc a:hover { color: var(--brand-text); }
.terms-body { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 1.25rem; padding: 1.75rem; box-shadow: var(--card-shadow); }
.terms-section { scroll-margin-top: 5.5rem; }
.terms-section + .terms-section { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--card-border); }
.terms-section h2 { font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: .6rem; }
.terms-section p { margin: .6rem 0 0; line-height: 2; white-space: pre-line; }
.terms-num { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }