﻿body {
    font-family: 'Cairo', sans-serif;
}

.fade-in {
    animation: fadeIn 1s ease-in;
}

@@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}


/* ============================================= */
/* ==      MODERN DASHBOARD STYLES            == */
/* ============================================= */

/* Main dashboard container */
.dashboard-page-container {
    padding: 1.5rem;
    background-color: #f4f7f6; /* A very light, neutral background */
    min-height: 100vh;
}

/* Base card styling */
.dashboard-card-modern {
    background: rgba(255, 255, 255, 0.6); /* Semi-transparent background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    padding: 1.5rem;
    width: 100%;
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

/* Animation for cards loading */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header style within a card */
.dashboard-header {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.dashboard-subheader {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Statistic cards */
.stat-card-animated {
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid transparent;
}

    .stat-card-animated:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 123, 255, 0.5);
    }

    .stat-card-animated .stat-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
        display: inline-block;
    }

    .stat-card-animated .stat-title {
        font-size: 0.9rem;
        color: #555;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .stat-card-animated .stat-value {
        font-size: 2rem;
        font-weight: 700;
        color: #222;
    }

    /* Assigning colors to icons */
    .stat-card-animated.stat-total .stat-icon {
        color: #0d6efd;
    }

    .stat-card-animated.stat-available .stat-icon {
        color: #198754;
    }

    .stat-card-animated.stat-busy .stat-icon {
        color: #ffc107;
    }

    .stat-card-animated.stat-service .stat-icon {
        color: #dc3545;
    }


/* Profile Block */
.profile-block-modern {
    text-align: center;
    padding: 2rem 1rem;
    animation-delay: 0.2s; /* Delay animation to appear after main content */
}

    .profile-block-modern .profile-img {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        object-fit: cover;
        border: 4px solid #fff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        margin-bottom: 1rem;
    }

    .profile-block-modern .company-logo {
        max-width: 100px;
        max-height: 40px;
        margin-top: 1rem;
    }

    .profile-block-modern .username {
        font-size: 1.5rem;
        font-weight: 600;
        margin-top: 1rem;
        color: #333;
    }

    .profile-block-modern .user-email {
        font-size: 0.9rem;
        color: #777;
    }

/* Info List */
.info-list-modern {
    margin-top: 2rem;
    text-align: left;
}

    .info-list-modern h4 {
        font-size: 1.1rem;
        font-weight: 600;
        border-bottom: 2px solid #eee;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }

    .info-list-modern div {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        font-size: 0.95rem;
    }

        .info-list-modern div span {
            font-weight: 500;
            color: #555;
        }

/* Chart container styling */
.chart-container-modern {
    padding: 1rem;
    margin-top: 2rem;
}

    .chart-container-modern h4 {
        text-align: center;
        font-weight: 600;
        color: #444;
        margin-bottom: 1.5rem;
    }

.table-responsive {
    overflow: visible !important; /* علشان يظهر الـ dropdown بره */
    position: relative;
    z-index: 1;
}

.table {
    position: relative;
    z-index: 1;
}

.table-responsive {
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.table td {
    position: relative;
    overflow: visible !important;
    z-index: 1;
}

/* خاص بالمكونات اللي بتفتح dropdown (زي Selects مخصصة أو مكتبات) */
.dropdown-menu,
.blazor-dropdown-panel,
.custom-select-panel,
.autocomplete-panel {
    position: absolute !important;
    z-index: 9999 !important;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tree-dropdown {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.account-tree-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.account-tree-node {
    margin: 2px 0;
}

    .account-tree-node > div {
        display: flex;
        align-items: center;
        gap: 6px;
    }

.tree-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #007bff;
}

.selectable {
    cursor: pointer;
    color: #212529;
    transition: background 0.2s, color 0.2s;
}

    .selectable:hover {
        background: #007bff;
        color: white;
        padding: 2px 5px;
        border-radius: 5px;
    }

.journal-lines-container {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.journal-lines-table {
    height: 100vh;
    overflow-y: auto;
    display: block;
}

    .journal-lines-table table {
        width: 100%;
        border-collapse: collapse;
    }

.tree-dropdown {
    position: absolute !important;
    z-index: 2000 !important; /* فوق المودال */
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0px 6px 15px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .row.g-3 label {
        font-weight: bold;
        font-size: 0.9rem;
    }
}

#containersMap {
    width: 100%;
    height: 520px;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.leaflet-popup-content {
    direction: rtl;
}



/* شكل الدبوس الأساسي */
.marker-pin {
    position: relative;
    width: 20px;
    height: 20px;
    background: #2e86de; /* أزرق افتراضي */
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: -1px 1px 2px rgba(0,0,0,0.3);
}

    /* النقطة في وسط الدبوس */
    .marker-pin::after {
        content: "";
        width: 10px;
        height: 10px;
        background: white;
        border-radius: 50%;
        position: absolute;
        top: 5px;
        left: 5px;
    }

/* أحمر مع موجات */
.marker-alert {
    background: red;
}

    .marker-alert::before, .marker-alert::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        border: 2px solid red;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        animation: wave 1.5s infinite;
    }

    .marker-alert::after {
        animation-delay: 0.75s;
    }

/* برتقالي مع موجات */
.marker-warning {
    background: orange;
}

    .marker-warning::before, .marker-warning::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        border: 2px solid orange;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        animation: wave 1.5s infinite;
    }

    .marker-warning::after {
        animation-delay: 0.75s;
    }

/* أنيميشن الموجات */
@keyframes wave {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}
/* حاوية بدبوس */
.bin-pin {
    position: relative;
    width: 36px;
    height: 48px;
}

/* سن الدبوس */
.pin-tail {
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid currentColor; /* لون حسب الحالة */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

/* جسم الدبوس + SVG */
.pin-body {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 14px;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* SVG أيقونة الحاوية */
.bin-svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* الألوان الافتراضية (عادي) */
.pin-normal {
    color: #2e86de;
}
    /* tail color */
    .pin-normal .bin-lid,
    .pin-normal .bin-handle,
    .pin-normal .bin-body,
    .pin-normal .bin-line {
        fill: #2e86de;
    }

/* حالة اقتراب من الصفر (تحذير) */
.pin-warning {
    color: #ff9800;
}
    /* tail */
    .pin-warning .bin-lid,
    .pin-warning .bin-handle,
    .pin-warning .bin-body,
    .pin-warning .bin-line {
        fill: #ff9800;
    }

/* حالة صفر أو أقل (تنبيه قوي) */
.pin-alert {
    color: #e53935;
}
    /* tail */
    .pin-alert .bin-lid,
    .pin-alert .bin-handle,
    .pin-alert .bin-body,
    .pin-alert .bin-line {
        fill: #e53935;
    }

/* موجات */
.pin-wave {
    position: absolute;
    left: 50%;
    bottom: 24px; /* مركز الدائرة عند منتصف جسم الدبوس */
    transform: translate(-50%, 50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: .85;
    pointer-events: none;
    animation: pin-wave 1.8s infinite ease-out;
    filter: drop-shadow(0 0 2px rgba(0,0,0,.12));
}

/* موجتين بتأخير بسيط */
.wave-2 {
    animation-delay: .9s;
}

/* إظهار الموجات فقط في التحذير/التنبيه */
.pin-normal .pin-wave {
    display: none;
}

.pin-warning .pin-wave,
.pin-alert .pin-wave {
    display: block;
}

@keyframes pin-wave {
    0% {
        transform: translate(-50%, 50%) scale(1);
        opacity: .7;
    }

    100% {
        transform: translate(-50%, 50%) scale(3.2);
        opacity: 0;
    }
}

/* تحسين البوب‑أب RTL */
.leaflet-popup-content {
    direction: rtl;
}

.dropdown .dropdown-menu {
    min-width: 200px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 14px;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.1);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
}

.dropdown-item i {
    width: 18px;
}
/* أزرار الأكشن في الجدول */
.cx-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: .5rem;
    align-items: center;
}

.cx-th-actions {
    text-align: center;
}

/* نمط زر تحذيري/معلوماتي صغير */
.cx-btn.cx-btn--sm {
    padding: .25rem .5rem;
    font-size: .85rem;
    border-radius: .5rem;
}

.cx-btn.cx-btn--warn {
    background: #fff5f0;
    border: 1px solid #ff8860;
}

.cx-btn.cx-btn--info {
    background: #f0f7ff;
    border: 1px solid #6aa6ff;
}

.cx-btn.cx-btn--ghost {
    background: transparent;
    border: 1px dashed #bfbfbf;
}

.cx-btn.cx-btn--primary {
    background: #1f6feb;
    color: #fff;
    border: none;
}

/* Modal tweaks للأكشن */
.cx-modal .cx-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
}

@media (max-width: 768px) {
    .cx-modal .cx-grid {
        grid-template-columns: 1fr;
    }
}

/* Checkbox inline */
.cx-field--inline {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.cx-checkbox {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    user-select: none;
}



/* حل محسن لإخفاء UI إعادة الاتصال - يمنع التجميد */
#components-reconnect-modal,
.components-reconnect-modal,
.components-reconnect-shield {
    /* بدلاً من display: none، نستخدم visibility + position */
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    z-index: -1 !important;
    overflow: hidden !important;
    /* منع أي تأثيرات بصرية */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    /* منع التفاعل مع لوحة المفاتيح */
    tabindex: -1;
}

    /* إخفاء أي عناصر فرعية قد تظهر */
    #components-reconnect-modal *,
    .components-reconnect-modal *,
    .components-reconnect-shield * {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        display: none !important;
    }

/* حل محسن لإطار الأخطاء - بدون تجميد */
.blazor-error-boundary {
    /* إبقاء العنصر موجود لكن مخفي */
    border: 0 !important;
    background: transparent !important;
    color: transparent !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    /* منع التفاعل */
    pointer-events: none !important;
    user-select: none !important;
    z-index: -1 !important;
}

    /* إخفاء رسائل الأخطاء نفسها */
    .blazor-error-boundary * {
        visibility: hidden !important;
        opacity: 0 !important;
        color: transparent !important;
        background: transparent !important;
        border: none !important;
        display: none !important;
    }

/* إخفاء أي spinners أو loaders افتراضية */
.reconnect-modal__spinner,
.blazor-loading,
.loading-overlay,
.reconnection-display {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
}

/* منع ظهور أي رسائل حالة الاتصال */
[data-blazor-reconnect],
[class*="reconnect"],
[class*="blazor-reconnect"] {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -1 !important;
}

/* تحسين الأداء - منع العمليات غير الضرورية */
#components-reconnect-modal,
.components-reconnect-modal,
.components-reconnect-shield,
.blazor-error-boundary {
    /* منع العمليات المكلفة */
    transform: none !important;
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
    /* تحسين الذاكرة */
    contain: layout style paint !important;
}

/* حل بديل للمتصفحات القديمة */
@supports not (visibility: hidden) {
    #components-reconnect-modal,
    .components-reconnect-modal,
    .components-reconnect-shield {
        position: absolute !important;
        left: -10000px !important;
        top: -10000px !important;
        width: 1px !important;
        height: 1px !important;
        clip: rect(0, 0, 0, 0) !important;
    }
}

/* منع أي modal overlays من التداخل */
body:has(.components-reconnect-modal),
body:has(#components-reconnect-modal) {
    overflow: auto !important;
    pointer-events: auto !important;
}

/* تأكد من أن المحتوى الأساسي يعمل */
.main-content,
.app-content,
#app,
.blazor-app {
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* حماية إضافية من التجميد */
html, body {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

/* إزالة أي backdrop blur قد يبطئ الأداء */
*[class*="reconnect"],
*[class*="blazor-error"] {
    backdrop-filter: none !important;
    filter: none !important;
}

.category-tree .node-row {
    padding: .4rem .6rem;
    border-radius: .5rem;
    transition: background .15s;
}

    .category-tree .node-row:hover {
        background: rgba(0,0,0,.03);
    }


/* Products Management Custom Styles */
/* يجب وضع هذا الملف في wwwroot/css/products-management.css */

/* ========================================
   KPI Cards - بطاقات المؤشرات
======================================== */
.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f0f0f0;
}

    .kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.kpi-card-primary .kpi-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.kpi-card-success .kpi-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.kpi-card-warning .kpi-icon {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #d97706;
}

.kpi-card-info .kpi-icon {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #0891b2;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 5px;
    font-weight: 500;
}

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.kpi-percentage {
    font-size: 12px;
    color: #059669;
    margin-top: 4px;
    font-weight: 600;
}

/* ========================================
   Bulk Actions Bar
======================================== */
.bulk-actions-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.bulk-actions-buttons .btn {
    margin: 0 4px;
}

/* ========================================
   Unit Cards في تبويب الوحدات
======================================== */
.unit-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
}

    .unit-card:hover {
        border-color: #667eea;
        background: white;
    }

.unit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.unit-card-title {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
}

.unit-price-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ========================================
   Image Upload Preview
======================================== */
.image-upload-wrapper {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
    background: #f9fafb;
}

    .image-upload-wrapper:hover {
        border-color: #667eea;
        background: white;
    }

    .image-upload-wrapper.has-image {
        border-style: solid;
        border-color: #10b981;
    }

.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Pricing Alert Box
======================================== */
.pricing-alert {
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    border: 2px solid #818cf8;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .pricing-alert i {
        font-size: 24px;
        color: #4f46e5;
    }

.pricing-alert-content {
    flex: 1;
}

.pricing-alert-title {
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 5px;
}

.pricing-alert-text {
    color: #4338ca;
    font-size: 14px;
}

/* ========================================
   Tab Enhancement
======================================== */
.nav-tabs {
    border-bottom: 2px solid #e5e7eb;
}

    .nav-tabs .nav-link {
        border: none;
        border-bottom: 3px solid transparent;
        color: #6b7280;
        font-weight: 600;
        padding: 12px 20px;
        transition: all 0.2s;
    }

        .nav-tabs .nav-link:hover {
            color: #667eea;
            border-bottom-color: #c7d2fe;
        }

        .nav-tabs .nav-link.active {
            color: #667eea;
            background: transparent;
            border-bottom-color: #667eea;
        }

        .nav-tabs .nav-link .badge {
            margin-right: 5px;
        }

/* ========================================
   Enhanced Input Fields
======================================== */
.ui-input:focus,
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========================================
   Calculate Button Style
======================================== */
.btn-calculate {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

    .btn-calculate:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    .btn-calculate i {
        margin-left: 5px;
    }

/* ========================================
   Price Display with VAT
======================================== */
.price-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.price-excl {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.price-incl {
    font-size: 14px;
    color: #059669;
    font-weight: 600;
}

    .price-incl::before {
        content: "شامل الضريبة: ";
        font-weight: 400;
        color: #6b7280;
    }

/* ========================================
   Unit Factor Badge
======================================== */
.unit-factor-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

/* ========================================
   Loading Skeleton
======================================== */
.table-skeleton {
    padding: 20px;
}

.skeleton-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-cell {
    background: #e5e7eb;
    border-radius: 4px;
    height: 40px;
    flex: 1;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ========================================
   Empty State
======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

    .empty-state i {
        font-size: 64px;
        color: #d1d5db;
        margin-bottom: 20px;
    }

    .empty-state h3 {
        color: #6b7280;
        font-weight: 600;
        margin-bottom: 10px;
    }

    .empty-state p {
        color: #9ca3af;
    }

/* ========================================
   Modal Enhancements
======================================== */
.ui-modal-fullscreen .ui-modal-dialog {
    margin: 20px;
    max-height: calc(100vh - 40px);
}

.ui-modal-body {
    padding: 25px;
}

.ui-modal-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* ========================================
   Alert Boxes Enhancement
======================================== */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    color: #1e3a8a;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

/* ========================================
   Responsive Enhancements
======================================== */
@media (max-width: 768px) {
    .kpi-card {
        padding: 15px;
    }

    .kpi-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .kpi-value {
        font-size: 22px;
    }

    .bulk-actions-bar {
        padding: 10px 0;
    }

    .nav-tabs .nav-link {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ========================================
   Print Styles
======================================== */
@media print {
    .bulk-actions-bar,
    .ui-page-header-enhanced,
    .filter-header,
    .btn,
    .pagination {
        display: none !important;
    }

    .ui-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}


/* قسم الاتصال */
.tech-contact {
    padding: 6rem 1rem 4rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    direction: rtl; /* اتجاه النص العام للقسم */
}

.tech-contact__container {
    max-width: 1200px;
    margin: 0 auto;
}

.tech-contact__header {
    margin-bottom: 2rem;
    text-align: center;
}

.tech-contact__icon {
    font-size: 2.5rem;
    color: #007bff;
    margin-bottom: 1rem;
    display: inline-block;
}

.tech-contact__title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.tech-contact__subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 0;
}

.tech-contact__branch {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.tech-contact__branch-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 1rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.tech-contact__details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tech-contact__detail-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

    .tech-contact__detail-item:last-child {
        margin-bottom: 0;
    }

.tech-contact__detail-icon {
    font-size: 1.1rem;
    color: #007bff;
    margin-top: 0.2rem;
    margin-left: 0.75rem;
    min-width: 1.5rem; /* لضمان محاذاة جيدة */
}

.tech-contact__detail-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #34495e;
}

    /* تعديل جديد: لجعل أرقام الهواتف وعناصر معينة تظهر من اليسار لليمين */
    .tech-contact__detail-text a {
        color: #007bff;
        text-decoration: none;
        /* تطبيق LTR على روابط الأرقام */
        direction: ltr;
        unicode-bidi: embed;
    }

        .tech-contact__detail-text a:hover {
            text-decoration: underline;
        }

.tech-contact__form-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    height: fit-content;
    top: 0; /* لضمان التثبيت عند التمرير في حالة وجود تأثير sticky */
}

.tech-contact__form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tech-contact__input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

    .tech-contact__input:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

.tech-contact__checkbox {
    width: 1.25em;
    height: 1.25em;
}

.tech-contact__submit-btn {
    background-color: #007bff;
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    transition: background-color 0.3s ease;
}

    .tech-contact__submit-btn:hover {
        background-color: #0056b3;
    }

.tech-contact__note {
    font-size: 0.8rem;
    color: #7f8c8d;
    text-align: center;
    margin: 0;
}

/* تحسينات للتصميم عند الشاشات الصغيرة */
@media (max-width: 991.98px) {
    .tech-contact {
        padding: 4rem 1rem 2rem;
    }

    .tech-contact__title {
        font-size: 1.8rem;
    }

    .tech-contact__form-container {
        margin-top: 1.5rem;
    }
}

/* فئة إضافية اختيارية يمكن استخدامها لعناصر LTR أخرى */
.sa-ltr {
    direction: ltr;
    unicode-bidi: embed;
}


.ui-uploader {
    border: 2px dashed var(--bd-border, #dbe0ea);
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(180deg, #fff, #fafbff);
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .ui-uploader:hover {
        border-color: var(--bd-primary, #4f46e5);
        box-shadow: 0 4px 18px rgba(0,0,0,.04);
    }

    .ui-uploader.is-uploading {
        opacity: .9;
    }

.ui-uploader-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ui-uploader-icon {
    font-size: 28px;
    color: var(--bd-primary, #4f46e5);
}

.ui-uploader-text .title {
    font-weight: 600;
}

.ui-uploader-text .hint {
    color: #6b7280;
    font-size: .875rem;
}

.ui-uploader-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bd-primary, #4f46e5);
    color: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(79,70,229,.25);
}

    .ui-uploader-btn:hover {
        filter: brightness(1.05);
    }

    .ui-uploader-btn:active {
        transform: translateY(1px);
    }

.ui-uploader-progress {
    margin-top: 12px;
}

.ui-progress {
    height: 8px;
    background: #eef1f6;
    border-radius: 999px;
    overflow: hidden;
}

.ui-progress-inner {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #22c55e, #10b981);
    transition: width .15s ease;
}

.ui-progress-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    margin-top: 8px;
    font-size: .9rem;
}

.ui-uploader-error {
    margin-top: 10px;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: .9rem;
}



.assign-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
    padding: 10px 12px;
}

.assign-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 8px;
}

.assign-panel-body {
    max-height: 220px;
    overflow: auto;
}

.assign-panel-footer {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.status-select, .visibility-select {
    min-width: 130px;
}

.ui-link-btn {
    color: var(--bd-primary,#4f46e5);
    text-decoration: underline;
}



/* ===== Card header & meta ===== */
.ui-card .card-header {
    position: sticky;
    top: 0;
    z-index: 3;
    backdrop-filter: blur(6px);
}

.ui-card .card-header {
    background: linear-gradient(180deg,#fff, #fafbff);
    border-bottom: 1px solid #eef1f6;
}

/* ===== Table polish ===== */
.ui-table-responsive {
    max-height: 68vh;
    overflow: auto;
}

.ui-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 2;
    box-shadow: 0 1px 0 #e8edf3;
}

.ui-table tr.table-row-hover:hover {
    background: #fbfdff;
}

.ui-table td, .ui-table th {
    vertical-align: middle;
}

/* Zebra rows for readability */
.ui-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

/* ===== Segmented controls (Status/Visibility) ===== */
.segmented {
    display: inline-flex;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: .85rem;
    background: #fff;
    border: 0;
    cursor: pointer;
    transition: background .15s, color .15s;
}

    .seg-btn:hover {
        background: #f1f5f9;
    }

    .seg-btn.active {
        background: #eef2ff;
        color: #4338ca;
        font-weight: 600;
    }

    .seg-btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

/* Badges spacing */
.badge {
    font-weight: 600;
}

/* ===== Instructors popover ===== */
.assign-wrap {
    position: relative;
    display: inline-block;
}

.assign-pop {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    min-width: 320px;
    max-width: 420px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    padding: 10px;
    z-index: 5;
}

    .assign-pop:before {
        content: "";
        position: absolute;
        left: 14px;
        top: -8px;
        width: 14px;
        height: 14px;
        background: #fff;
        transform: rotate(45deg);
        border-left: 1px solid #e5e7eb;
        border-top: 1px solid #e5e7eb;
    }

    .assign-pop .assign-foot {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 8px;
    }

/* ===== Row busy overlay ===== */
.row-busy {
    position: relative;
}

    .row-busy::after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(255,255,255,.55);
        backdrop-filter: blur(2px);
    }

    .row-busy .row-spinner {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 4;
    }

/* ===== Toast (lightweight) ===== */
.toast-bar {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.toast {
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .95rem;
}

    .toast.success {
        background: #065f46;
    }

    .toast.danger {
        background: #991b1b;
    }

    .toast.info {
        background: #1e3a8a;
    }



/* Org bar */
.kdx-orgbar {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin: .5rem 0 1rem
}

.kdx-orgbar__left, .kdx-orgbar__right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap
}

.kdx-orgcard {
    display: flex;
    gap: .6rem;
    align-items: center;
    background: #fff;
    border: 1px solid var(--kdx-border,#eef1f5);
    border-radius: 14px;
    padding: .5rem .75rem;
    box-shadow: var(--kdx-shadow,0 6px 18px rgba(16,24,40,.06))
}

.kdx-orgcard__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    color: #2563eb
}

.kdx-orgcard__title {
    font-size: .85rem;
    color: #64748b
}

.kdx-orgcard__value {
    font-weight: 800;
    color: #0f172a
}

.kdx-userchip {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: #fff;
    border: 1px solid var(--kdx-border,#eef1f5);
    border-radius: 999px;
    padding: .3rem .6rem
}

.kdx-userchip__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #1f2937;
    color: #fff;
    font-weight: 800
}

.kdx-userchip__name {
    font-weight: 700
}

.kdx-userchip__role {
    font-size: .8rem;
    color: #64748b
}

/* Quick actions */
.kdx-quick {
    display: grid;
    gap: .6rem
}

    .kdx-quick.grid-4 {
        grid-template-columns: repeat(4, minmax(0,1fr))
    }

@@media(max - width:992px) {
    .kdx-quick.grid-4 {
        grid-template-columns: repeat(2, minmax(0,1fr))
    }
}

.kdx-quick__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--kdx-border,#eef1f5);
    background: #fff;
    border-radius: 12px;
    padding: .6rem .75rem;
    text-decoration: none;
    color: #111
}

    .kdx-quick__item:hover {
        background: #f8fafc
    }

/* Map */
.kdx-map {
    width: 100%;
    height: 520px;
    border-radius: 16px;
    border: 1px solid var(--kdx-border,#eef1f5)
}


:root {
    --topbar-h: 56px;
}
/* عدّلها حسب ارتفاع الهيدر عندك */

.user-dropdown-menu {
    position: fixed; /* مهم: يفصلها عن أي overflow */
    right: 12px; /* التصاق يمين الشاشة (عدّلها لو عايز) */
    top: var(--topbar-h); /* تحت التوب بار */
    min-width: 220px;
    z-index: 2000; /* أعلى من أي عناصر تانية */
    border-radius: 12px;
}

.dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1990; /* أقل من المنيو بقليل */
    background: transparent; /* بس لالتقاط النقرات */
}

/* لو التوب بار أطول على الموبايل، حدّد ارتفاع مختلف بميديا كويري */
@media (max-width: 992px) {
    :root {
        --topbar-h: 64px;
    }
}
