/* ==========================================================================
   مشجرة آل الشيخ سعد تاج العارفين - نظام التصميم والتنسيقات الفاخرة
   Heritage & Modern Arabic Family Tree Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700&display=swap');

:root {
    --bg-main: #0c1219;
    --bg-secondary: #131c26;
    --bg-card: rgba(22, 33, 46, 0.92);
    --bg-card-hover: rgba(30, 44, 61, 0.98);
    --bg-card-highlight: rgba(26, 47, 40, 0.95);
    
    --border-color: rgba(212, 175, 55, 0.22);
    --border-card: rgba(255, 255, 255, 0.1);
    --border-highlight: #10b981;
    --border-gold: #d4af37;

    --gold-primary: #d4af37;
    --gold-light: #f5d77f;
    --gold-dark: #997d29;
    --gold-glow: rgba(212, 175, 55, 0.35);

    --emerald-primary: #10b981;
    --emerald-light: #34d399;
    --emerald-dark: #065f46;
    --emerald-glow: rgba(16, 185, 129, 0.35);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-gold: #f3d068;

    --accent-blue: #38bdf8;
    --accent-rose: #fb7185;
    --accent-amber: #f59e0b;
    --accent-purple: #c084fc;

    --font-heading: 'Amiri', serif;
    --font-ui: 'Cairo', sans-serif;
    --font-body: 'Tajawal', sans-serif;

    --card-w: 220px;
    --card-min-h: 96px;
    --line-color: rgba(212, 175, 55, 0.4);
    --line-active: #38bdf8;
    
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.25);
    --shadow-emerald: 0 0 25px rgba(16, 185, 129, 0.3);

    /* موازنة الخط ومقاييس الشاشة */
    --tree-font-scale: 1;
    --ui-font-scale: 1;
    --card-scale: 1;
    --screen-zoom: 1;
}

/* التنسيق الأساسي */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    direction: rtl;
    font-family: var(--font-ui);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    user-select: none;
}

/* خلفية بنمط شبكة ونقوش إسلامية خافتة */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
    background: 
        radial-gradient(circle at 50% 10%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 10% 90%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        linear-gradient(to bottom, #090e14, #0f1722);
}

/* شريط الرأس العلوي الفاخر والأنيق */
.app-header {
    height: 48px;
    background: #0b111a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1000;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    flex-shrink: 0;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.app-header::-webkit-scrollbar {
    display: none;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    min-width: max-content;
}

.brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2a220e, #1a3026);
    border: 1px solid var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-primary);
    font-size: 14px;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.brand-titles h1 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    white-space: nowrap;
    line-height: 1.2;
}

.brand-titles .subtitle {
    font-size: 8.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    line-height: 1.2;
}

.badge-tag {
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald-light);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 8.5px;
    font-weight: 600;
}

/* شريط البحث السريع المدمج */
.header-search {
    position: relative;
    width: 135px;
    flex-shrink: 1;
    transition: width 0.25s ease;
}

.header-search:focus-within {
    width: 175px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    width: 100%;
    background: rgba(22, 33, 46, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 5px 30px 5px 10px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 11.5px;
    outline: none;
    transition: all 0.25s ease;
}

.search-input-wrapper input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
    background: rgba(25, 38, 54, 0.95);
}

.search-icon {
    position: absolute;
    right: 9px;
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
}

.search-dropdown {
    position: absolute;
    top: 115%;
    right: 0;
    left: 0;
    background: #152230;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
    display: none;
    z-index: 200;
}

.search-result-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: rgba(212, 175, 55, 0.12);
}

.search-item-info strong {
    color: var(--text-primary);
    font-size: 12px;
}

.search-item-info span {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
}

/* شريط الأدوات */
.header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.btn-tool {
    background: rgba(26, 38, 52, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 4px 8px;
    height: 29px;
    border-radius: 7px;
    font-family: var(--font-ui);
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-tool:hover {
    background: rgba(36, 52, 72, 0.95);
    border-color: var(--gold-primary);
    color: var(--gold-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-tool.primary {
    background: linear-gradient(135deg, #997d29, #d4af37);
    color: #0b1118;
    border: none;
    font-weight: 700;
}

.btn-tool.primary:hover {
    background: linear-gradient(135deg, #b09130, #f5d77f);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
    transform: translateY(-1px);
}

.btn-tool.emerald {
    background: linear-gradient(135deg, #065f46, #10b981);
    color: #ffffff;
    border: none;
    font-weight: 700;
}

.btn-tool.emerald:hover {
    background: linear-gradient(135deg, #087f5b, #34d399);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

/* أزرار التحكم بالزووم وموازنة الخط العائمة */
.floating-controls {
    position: fixed !important;
    bottom: 18px !important;
    left: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    z-index: 999 !important;
    background: #0f1722 !important;
    padding: 6px 5px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.2) !important;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    contain: layout style;
    touch-action: manipulation;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.control-group-label {
    font-size: 8.5px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}

.control-divider {
    height: 1px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    margin: 3px 0;
}

.btn-control {
    width: 36px;
    height: 36px;
    background: rgba(25, 38, 52, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 10px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-control:hover {
    background: var(--gold-primary);
    color: #0c1219;
    border-color: var(--gold-light);
    transform: scale(1.06);
}

.btn-control:active {
    transform: scale(0.96);
}

.btn-control.btn-indicator {
    font-size: 10px;
    font-weight: 800;
    font-family: var(--font-ui);
    color: var(--gold-light);
    background: rgba(10, 16, 24, 0.9);
    border-color: rgba(212, 175, 55, 0.35);
    padding: 0 2px;
    height: 24px;
    line-height: 24px;
    width: 36px;
}

.btn-control.font-btn {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 15px;
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.btn-control.font-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

.btn-control.screen-btn {
    font-size: 13px;
    color: var(--emerald-light);
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-control.screen-btn:hover {
    background: var(--emerald-primary);
    color: #ffffff;
}

/* زر قائمة الأدوات للجوال */
.btn-mobile-menu-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(26, 38, 52, 0.95);
    border: 1.5px solid var(--gold-primary);
    color: var(--gold-light);
    padding: 6px 12px;
    border-radius: 10px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-mobile-menu-toggle:hover {
    background: var(--gold-primary);
    color: #0b1118;
}

/* شريط اتجاه المشجرة والإحصائيات العائم */
.floating-status-bar {
    position: fixed !important;
    bottom: 18px !important;
    right: 18px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #0f1722 !important;
    padding: 6px 14px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8) !important;
    font-size: 11px !important;
    color: var(--text-secondary) !important;
    z-index: 998 !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    contain: layout style;
    touch-action: manipulation;
}

.status-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-stat strong {
    color: var(--gold-light);
    font-weight: 700;
}

/* مساحة الكانفاس التفاعلية الرئيسية (نظام إحداثيات ديكارتي دقيق LTR) */
.tree-viewport {
    flex: 1;
    position: relative;
    width: 100%;
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    overflow: hidden;
    cursor: grab;
    direction: ltr !important;
    text-align: left !important;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    touch-action: none; /* تفعيل تحكم كامل باللمس المتعدد (Pinch & Pan) */
}

.tree-viewport.grabbing {
    cursor: grabbing;
}

.tree-content {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    direction: ltr !important;
    text-align: left !important;
    transform-origin: 0 0;
    pointer-events: none;
    will-change: transform;
}

/* طبقة SVG للخطوط والروابط الأسرية - مطابقة تماماً لإحداثيات البطاقات */
.tree-svg-layer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    direction: ltr !important;
    pointer-events: none;
    overflow: visible !important;
    z-index: 10;
}

.tree-nodes-layer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    direction: ltr !important;
    pointer-events: none;
    z-index: 20;
}

.tree-link {
    fill: none !important;
    stroke: #ffffff !important;
    stroke-width: 2.5px !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tree-link.highlight {
    stroke: #34d399 !important;
    stroke-width: 3px !important;
}

.tree-link.gold-ancestor {
    stroke: #ffffff !important;
    stroke-width: 2.5px !important;
}

/* سهم أبيض ناصع متناسق المقاس وواضح تماماً */
.tree-arrow {
    fill: #ffffff !important;
    stroke: #ffffff !important;
    stroke-width: 1px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tree-arrow.highlight {
    fill: #34d399 !important;
    stroke: #34d399 !important;
}

/* نسب الشخص واسم الأب المعروض على البطاقة */
.person-patronymic {
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 4px;
    font-weight: 500;
}

/* زر الإضافة السريعة على البطاقة */
.btn-quick-add-child {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 5px;
    width: fit-content;
}

.btn-quick-add-child:hover {
    background: #10b981;
    border-color: #34d399;
    color: #ffffff;
    transform: scale(1.04);
}

/* صندوق عرض الأب المختار في نموذج الإضافة */
.selected-father-preview {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #a7f3d0;
    margin-top: 4px;
}

/* تنسيقات نمط الطباعة والتصدير ذو الخلفية الفاتحة (Light Theme Export) */
body.export-light-mode {
    background: #ffffff !important;
    color: #1e293b !important;
}

body.export-light-mode .app-container {
    background: #ffffff !important;
}

body.export-light-mode .person-node {
    background: #ffffff !important;
    border: 2px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
}

body.export-light-mode .person-node .person-name {
    color: #0f172a !important;
}

body.export-light-mode .person-node.ancestor-root {
    background: #fffbeb !important;
    border: 2px solid #d97706 !important;
}

body.export-light-mode .person-node.ancestor-root .person-name {
    color: #b45309 !important;
}

body.export-light-mode .person-node.mahfouz-branch {
    background: #ecfdf5 !important;
    border: 2px solid #059669 !important;
}

body.export-light-mode .person-node.mahfouz-branch .person-name {
    color: #047857 !important;
}

body.export-light-mode .tree-link {
    stroke: #0f172a !important;
    stroke-width: 3px !important;
}

body.export-light-mode svg marker path {
    fill: #0f172a !important;
}

body.export-light-mode svg marker#arrow-highlight path {
    fill: #059669 !important;
}

body.export-light-mode svg marker#arrow-gold path {
    fill: #d97706 !important;
}

body.export-light-mode .tree-link.highlight {
    stroke: #059669 !important;
    stroke-width: 3.5px !important;
}

body.export-light-mode .tree-link.gold-ancestor {
    stroke: #d97706 !important;
    stroke-width: 3.5px !important;
}

body.export-light-mode .date-badge {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0284c7 !important;
}

body.export-light-mode .note-badge {
    background: #fef3c7 !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

/* تنسيقات الطباعة القياسية @media print */
@media print {
    body {
        overflow: visible !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    .app-header,
    .floating-controls,
    .floating-status-bar,
    .modal-overlay {
        display: none !important;
    }

    .app-container {
        height: auto !important;
        width: 100% !important;
        background: transparent !important;
    }

    .tree-viewport {
        overflow: visible !important;
        height: auto !important;
        width: 100% !important;
        cursor: default !important;
        background: transparent !important;
    }

    .tree-content {
        position: static !important;
        transform: none !important;
    }
}

/* طبقة بطاقات الأفراد (DOM Nodes) */
.tree-nodes-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* تصميم بطاقة الشخص - فرض الاتجاه من اليمين إلى اليسار */
.person-node {
    position: absolute;
    width: calc(var(--card-w) * var(--card-scale, 1));
    min-height: calc(var(--card-min-h) * var(--card-scale, 1));
    background: #16212e;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: calc(10px * var(--card-scale, 1)) calc(12px * var(--card-scale, 1));
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: center;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: embed;
}

@media (hover: hover) and (pointer: fine) {
    .person-node {
        transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }
    .person-node:hover {
        background: var(--bg-card-hover);
        border-color: var(--gold-primary);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6), var(--shadow-glow);
        z-index: 50;
    }
}

/* البطاقة المميزة للجد الأكبر (الشيخ سعد تاج العارفين) */
.person-node.ancestor-root {
    background: linear-gradient(145deg, rgba(38, 28, 12, 0.95), rgba(20, 30, 24, 0.95));
    border: 2px solid var(--gold-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

.person-node.ancestor-root .person-name {
    font-family: var(--font-heading);
    font-size: calc(16px * var(--tree-font-scale, 1));
    color: var(--gold-light);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* بطاقة جد بيت محفوظ الشيخ (السهم الأخضر) */
.person-node.mahfouz-branch {
    background: linear-gradient(145deg, rgba(12, 38, 28, 0.95), rgba(18, 30, 42, 0.95));
    border: 2px solid var(--emerald-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), var(--shadow-emerald);
}

.person-node.mahfouz-branch .person-name {
    color: #a7f3d0;
}

/* رأس البطاقة */
.node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    direction: rtl !important;
    text-align: right !important;
}

.node-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.person-node.ancestor-root .node-avatar {
    background: rgba(212, 175, 55, 0.25);
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}

.person-node.mahfouz-branch .node-avatar {
    background: rgba(16, 185, 129, 0.25);
    color: var(--emerald-primary);
    border-color: var(--emerald-primary);
}

/* زر طي وفرد الفروع */
.toggle-collapse-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-collapse-btn:hover {
    background: var(--gold-primary);
    color: #0b1118;
    transform: scale(1.15);
}

.node-children-count {
    font-size: calc(10px * var(--tree-font-scale, 1));
    color: var(--text-muted);
}

/* اسم الشخص بالاتجاه العربي الأصيل */
.person-name {
    font-size: calc(14px * var(--tree-font-scale, 1));
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 4px;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: embed;
}

/* نسب الشخص واسم الأب */
.person-patronymic {
    font-size: calc(12px * var(--tree-font-scale, 1));
    color: #cbd5e1;
    margin-bottom: 4px;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: embed;
}

/* شارات التواريخ (الهجري والميلادي معاً) */
.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #7dd3fc;
    font-size: calc(10.5px * var(--tree-font-scale, 1));
    padding: 2px 7px;
    border-radius: 6px;
    margin-top: 4px;
    width: fit-content;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: embed;
}

/* شارات الملاحظات والقبور */
.note-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--gold-light);
    font-size: calc(10px * var(--tree-font-scale, 1));
    padding: 2px 6px;
    border-radius: 6px;
    margin-top: 5px;
    width: fit-content;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: embed;
}

/* أزرار اختيار الرموز والألوان للجد والفخذ */
.btn-symbol-preset {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-symbol-preset:hover,
.btn-symbol-preset.selected {
    background: rgba(212, 175, 55, 0.35) !important;
    border-color: #ffffff !important;
    transform: scale(1.18) !important;
    box-shadow: 0 0 12px var(--gold-glow) !important;
}

.btn-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-color-swatch:hover,
.btn-color-swatch.selected {
    transform: scale(1.28) !important;
    border-color: #ffffff !important;
    outline: 2px solid #ffffff !important;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.9) !important;
}

/* تنسيقات المربعات ذات اللون المخصص والشعارات */
.person-node.has-custom-color {
    border-width: 2.5px !important;
}

.person-node.has-custom-color:hover {
    border-color: var(--custom-node-color, var(--gold-primary)) !important;
    background: var(--custom-node-bg-hover, var(--bg-card-hover)) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 30px var(--custom-node-glow, var(--gold-glow)) !important;
    z-index: 50;
}

.person-name-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    font-size: 1.25em;
    vertical-align: middle;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}

.clan-branch-badge {
    animation: fadeIn 0.3s ease-in-out;
}

/* ==========================================================================
   نظام الحماية والتحكم بمستويات الصلاحيات (Security & RBAC System)
   ========================================================================== */
body[data-role="viewer"] .role-editor-only,
body[data-role="viewer"] .role-admin-only,
body:not([data-role="editor"]):not([data-role="admin"]) .role-editor-only,
body:not([data-role="admin"]) .role-admin-only {
    display: none !important;
}

/* --------------------------------------------------------------------------
   شاشة الدخول الرئيسية المشفرة (Encrypted Login Portal Gate)
   -------------------------------------------------------------------------- */
.login-gate-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 25%, #131d36 0%, #080d19 60%, #03060c 100%);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    backdrop-filter: blur(25px);
}

.login-card-container {
    width: 100%;
    max-width: 460px;
    background: rgba(15, 23, 42, 0.88);
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 50px rgba(212, 175, 55, 0.15);
    border-radius: 24px;
    padding: 34px 28px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    animation: loginCardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardPop {
    from { opacity: 0; transform: scale(0.94) translateY(18px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-card-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), var(--gold-light), transparent);
}

.login-brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-emblem {
    font-size: 46px;
    line-height: 1;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.6));
    animation: crownFloat 3s ease-in-out infinite alternate;
}

@keyframes crownFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

.login-tree-title {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 30%, var(--gold-light) 75%, var(--gold-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.login-tree-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.login-security-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
}

.login-form-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-error-banner {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    animation: shake 0.35s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(10, 16, 29, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: #ffffff;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.25s ease;
}

.login-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    outline: none;
    background: rgba(15, 23, 42, 0.95);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-left: 44px;
}

.btn-toggle-eye {
    position: absolute;
    left: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-toggle-eye:hover {
    color: #ffffff;
}

.btn-login-submit {
    margin-top: 8px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: #0d121c;
    border: none;
    border-radius: 12px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.btn-login-submit:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.5);
}

.btn-login-submit:active {
    transform: translateY(0);
}

.login-footer-info {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.security-features-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   شريط الرأس العلوي: شارة المستخدم والقوائم
   -------------------------------------------------------------------------- */
.user-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 999px;
    padding: 2px 7px 2px 4px;
    cursor: default;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.user-profile-badge:hover {
    border-color: var(--gold-light);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.user-role-icon {
    font-size: 12px;
}

.user-display-name {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role-pill {
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.user-role-pill.level-1 {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.user-role-pill.level-2 {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

.user-role-pill.level-3 {
    background: rgba(239, 68, 68, 0.22);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

/* --------------------------------------------------------------------------
   جداول وبطاقات إدارة المستخدمين
   -------------------------------------------------------------------------- */
.users-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 16, 29, 0.6);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: right;
}

.users-table th {
    background: rgba(15, 23, 42, 0.95);
    color: var(--gold-light);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    white-space: nowrap;
}

.users-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.users-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.auth-badge-btn {
    transition: all 0.25s ease;
}
.auth-badge-btn.level-1 {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.16) !important;
    color: #93c5fd !important;
}
.auth-badge-btn.level-2 {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.22) !important;
    color: #fcd34d !important;
}
.auth-badge-btn.level-3 {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}

.note-badge.burial {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.note-badge.highlight-star {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   النوافذ المنبثقة (Modals & Drawers)
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 10, 15, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #141f2d;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 580px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.15s;
}

.btn-close-modal:hover {
    color: #ef4444;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* تنسيق تبويبات محول التاريخ */
.tabs-header {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 12px;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   تنسيقات جدول إدارة قاعدة البيانات وتعديل الأسماء
   -------------------------------------------------------------------------- */
.db-table-container {
    max-height: 460px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(10, 16, 23, 0.85);
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: right;
}

.db-table th {
    background: rgba(19, 28, 38, 0.98);
    color: var(--gold-light);
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 700;
}

.db-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    vertical-align: middle;
}

.db-table tr:hover {
    background: rgba(212, 175, 55, 0.08);
}

.db-table tr.highlight-pulse {
    animation: dbRowPulse 2.5s ease-out forwards;
}

@keyframes dbRowPulse {
    0% {
        background-color: rgba(212, 175, 55, 0.45);
        outline: 2px solid var(--gold-primary);
    }
    40% {
        background-color: rgba(212, 175, 55, 0.25);
        outline: 2px solid var(--gold-light);
    }
    100% {
        background-color: transparent;
        outline: 2px solid transparent;
    }
}

.btn-action-small {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-action-small:hover {
    background: var(--gold-primary);
    color: #0b1118;
    border-color: var(--gold-light);
}

.btn-action-small.danger {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-action-small.danger:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 9px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--gold-primary);
    color: #0c1219;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.converter-card {
    background: rgba(22, 33, 46, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-control {
    background: rgba(14, 22, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.form-control:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.converter-result-box {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.result-main {
    font-size: 22px;
    font-weight: 800;
    color: var(--gold-light);
    margin-bottom: 4px;
}

.result-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

/* سلسلة النسب (Lineage Trail) */
.lineage-trail {
    background: rgba(12, 18, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.lineage-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.lineage-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-primary);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* زر حفظ النموذج */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* تنبيه توضيحي */
.info-callout {
    background: rgba(56, 189, 248, 0.08);
    border-right: 3px solid var(--accent-blue);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    color: #bae6fd;
    line-height: 1.5;
}

/* شريط تمرير أنيق */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* ==========================================================================
   التجاوب الكامل مع الهواتف والشاشات الصغيرة (Mobile & Tablet Responsiveness)
   ========================================================================== */

/* أجهزة التابلت والشاشات المتوسطة (<= 1100px) */
@media (max-width: 1100px) {
    .app-header {
        padding: 0 14px;
        gap: 10px;
    }
    .header-brand h1 {
        font-size: 16px;
    }
    .badge-tag {
        font-size: 9px;
        padding: 1px 5px;
    }
    .header-search {
        width: 200px;
    }
    .btn-tool {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* شاشات الهواتف والتابلت والشاشات المتوسطة (<= 1050px) */
@media (max-width: 1050px) {
    .app-header {
        height: 48px;
        padding: 0 10px;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
    }

    .brand-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
        border-radius: 8px;
    }

    .header-brand h1 {
        font-size: 12.5px;
    }

    .brand-titles .subtitle {
        font-size: 8.5px;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        gap: 3px;
        white-space: nowrap;
    }

    .badge-tag {
        font-size: 8px;
        padding: 1px 4px;
    }

    .header-search {
        width: auto;
        flex: 1;
        max-width: 160px;
        margin: 0 4px;
    }

    .search-input-wrapper input {
        padding: 4px 24px 4px 6px;
        font-size: 10.5px;
        border-radius: 14px;
        height: 28px;
    }

    .search-icon {
        right: 7px;
        font-size: 10px;
    }

    /* إظهار زر قائمة الأدوات */
    .btn-mobile-menu-toggle {
        display: inline-flex !important;
        padding: 4px 8px;
        font-size: 11px;
        height: 28px;
    }

    /* قائمة الأدوات المنبثقة للجوال */
    .header-actions {
        display: none !important;
        position: absolute;
        top: 48px;
        right: 8px;
        left: 8px;
        background: #0d141e;
        border: 1.5px solid var(--border-color);
        border-radius: 16px;
        padding: 12px;
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 55, 0.2);
        z-index: 500;
        display: none;
        flex-direction: column;
        gap: 8px;
        max-height: calc(100vh - 65px);
        overflow-y: auto;
        animation: mobileMenuSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .header-actions.mobile-open {
        display: flex !important;
    }

    @keyframes mobileMenuSlide {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .header-actions .btn-tool {
        width: 100%;
        justify-content: center;
        padding: 9px 12px;
        font-size: 12px;
        border-radius: 10px;
        height: auto;
    }

    .header-actions .user-profile-badge {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
        border-radius: 12px;
        margin-bottom: 4px;
        height: auto;
    }

    .tree-viewport {
        height: calc(100vh - 48px);
        height: calc(100dvh - 48px);
    }

    /* أزرار التحكم العائمة على الجوال */
    .floating-controls {
        position: fixed !important;
        bottom: 12px !important;
        left: 8px !important;
        padding: 5px 4px !important;
        border-radius: 14px !important;
        gap: 3px !important;
        background: #0f1722 !important;
        border: 1px solid rgba(212, 175, 55, 0.35) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8) !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        contain: layout style;
        touch-action: manipulation;
    }

    .btn-control {
        width: 32px;
        height: 32px;
        font-size: 13px;
        border-radius: 8px;
    }

    .btn-control.btn-indicator {
        height: 20px;
        line-height: 20px;
        font-size: 9px;
        width: 32px;
    }

    /* شريط الإحصائيات على الجوال */
    .floating-status-bar {
        position: fixed !important;
        bottom: 12px !important;
        right: 8px !important;
        padding: 5px 8px !important;
        border-radius: 10px !important;
        font-size: 10px !important;
        gap: 5px !important;
        max-width: calc(100vw - 110px) !important;
        background: #0f1722 !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8) !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        contain: layout style;
        touch-action: manipulation;
    }

    .floating-status-bar .btn-tool {
        padding: 3px 6px;
        font-size: 10px;
    }

    /* النوافذ المنبثقة على الجوال */
    .modal-box {
        width: 95% !important;
        max-width: 95% !important;
        margin: 8px !important;
        padding: 14px !important;
        border-radius: 16px !important;
        max-height: 90vh !important;
    }

    .modal-header {
        padding: 12px 14px !important;
    }

    .modal-body {
        padding: 12px 6px !important;
    }

    .modal-footer {
        padding: 10px 14px !important;
        flex-wrap: wrap;
    }

    .db-table-container {
        max-height: 55vh !important;
    }

    .login-card-container {
        padding: 24px 18px;
        margin: 10px;
        border-radius: 20px;
    }

    .login-tree-title {
        font-size: 17px;
    }
}

