﻿:root {
    --ui-primary: #0d6efd;
    --ui-success: #20c997;
    --ui-warning: #ffc107;
    --ui-danger: #d32f2f;
    --ui-light: #f8fafd;
    --ui-border: #e3eafc;
    --ui-radius: 1rem;
    --ui-font: 'Cairo', sans-serif;
}

/* Cards */
.ui-card {
    background: #fff;
    border-radius: var(--ui-radius);
    box-shadow: 0 2px 12px rgba(13,110,253,0.07);
    padding: 2rem 2rem 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.ui-card-filters {
    padding: 1.5rem 2rem;
}

.ui-card-table {
    padding: 1.2rem 1rem 1rem 1rem;
}

/* Page header */
.ui-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2.5rem 0 1.5rem 0;
    gap: 1rem;
}

    .ui-page-header h2 {
        font-weight: 700;
        color: #003366;
        font-size: 2rem;
        margin: 0;
        display: flex;
        align-items: center;
    }

/* Labels */
.ui-label {
    display: block;
    font-size: 1.01rem;
    color: #888;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

/* Filters */
.ui-filters {
    margin-bottom: 0;
}

.ui-input {
    border: 1.5px solid var(--ui-border);
    border-radius: 0.6rem;
    padding: 0.55rem 1rem;
    font-size: 1.07rem;
    background: var(--ui-light);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--ui-font);
    width: 100%;
}

    .ui-input:focus {
        border-color: var(--ui-primary);
        box-shadow: 0 0 0 2px #0d6efd22;
        background: #fff;
        outline: none;
    }

/* Table */
.ui-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.ui-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: var(--ui-radius);
    box-shadow: 0 2px 12px rgba(13,110,253,0.07);
    font-family: var(--ui-font);
}

    .ui-table th, .ui-table td {
        padding: 0.9rem 1rem;
        border-bottom: 1px solid var(--ui-border);
        text-align: center;
        vertical-align: middle;
        font-size: 1.07rem;
    }

/* ─────────────────────────────────────────────────────────────
   محاذاة موحّدة: الرأس والخلية في العمود الواحد على محور واحد.

   كان بعض الشاشات يضع text-end على الخلية دون رأسها، فيجلس العنوان
   في المنتصف والرقم على الطرف فلا يقع العمود تحت عنوانه. القاعدة
   أدناه توحّدهما في المنتصف عبر كل جداول النظام، وتلغي أي تجاوز
   موضعي — فالتناسق قاعدةٌ لا اجتهاد كل شاشة.

   الأرقام تصطف بخانات ثابتة (tabular-nums) فتُقرأ رغم التوسيط.
   ــ للخروج عن التوسيط عمدًا: ui-cell-start أو ui-cell-end.
   ───────────────────────────────────────────────────────────── */
/* يقتصر على ui-table: قاعدتها الأصلية توسّط الرأس والخلية معًا، وكل
   الاختلال جاء من text-end على الخلية دون رأسها. الأصناف الأخرى
   (iv-table وأخواتها) لها أنماطها الخاصة في صفحاتها وهي متناسقة أصلًا،
   فالتدخّل فيها يكسرها لأن نمط الصفحة يغلب هذا الملف. */
.ui-table th[class*="text-"], .ui-table td[class*="text-"] {
    text-align: center;
}

.ui-table th, .ui-table td { font-variant-numeric: tabular-nums; }

/* خروجٌ صريح عن التوسيط حين يلزم */
.ui-table th.ui-cell-start, .ui-table td.ui-cell-start { text-align: start !important; }
.ui-table th.ui-cell-end,   .ui-table td.ui-cell-end   { text-align: end !important; }

    .ui-table th {
        background: #152f71;
        color: #000000;
        font-weight: 700;
        border-top: 1px solid var(--ui-border);
    }

    .ui-table tr:last-child td {
        border-bottom: none;
    }

.ui-table-striped tr:nth-child(even) {
    background: #f4f8fd;
}

.ui-table tr:hover td {
    background: #e3eafc;
}

/* Buttons */
.ui-btn {
    border: none;
    border-radius: 0.6rem;
    padding: 0.5rem 1.2rem;
    font-size: 1.07rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    font-family: var(--ui-font);
    background: #e3eafc;
    color: #003366;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

    .ui-btn:hover, .ui-btn:focus {
        background: var(--ui-primary);
        color: #fff;
    }

.ui-btn-primary {
    background: var(--ui-primary);
    color: #fff;
}

    .ui-btn-primary:hover, .ui-btn-primary:focus {
        background: #0a58ca;
    }

.ui-btn-success {
    background: var(--ui-success);
    color: #fff;
}

    .ui-btn-success:hover, .ui-btn-success:focus {
        background: #198754;
    }

.ui-btn-warning {
    background: var(--ui-warning);
    color: #fff;
}

    .ui-btn-warning:hover, .ui-btn-warning:focus {
        background: #e0a800;
    }

.ui-btn-danger {
    background: var(--ui-danger);
    color: #fff;
}

    .ui-btn-danger:hover, .ui-btn-danger:focus {
        background: #a31515;
    }

.ui-btn-secondary {
    background: #f0f2f7;
    color: #003366;
}

    .ui-btn-secondary:hover, .ui-btn-secondary:focus {
        background: #e3eafc;
    }

.ui-btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.98rem;
}

/* Pagination */
.ui-pagination-nav {
    display: flex;
    justify-content: center;
    margin: 2rem 0 0 0;
}

.ui-pagination {
    display: flex;
    gap: 0.2rem;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.ui-page-btn {
    border: none;
    border-radius: 0.5rem;
    padding: 0.45rem 1rem;
    font-size: 1.07rem;
    font-weight: 600;
    background: #f0f2f7;
    color: #003366;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    min-width: 2.4rem;
    outline: none;
    margin: 0 0.1rem;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ui-page-btn.active,
    .ui-page-btn:focus,
    .ui-page-btn:hover:not(:disabled) {
        background: var(--ui-primary, #0d6efd);
        color: #fff;
    }

    .ui-page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background: #f8fafd;
        color: #bbb;
    }

.ui-page-dots {
    color: #bbb;
    font-size: 1.2rem;
    padding: 0 0.4rem;
    user-select: none;
}

@media (max-width: 575px) {
    .ui-pagination-nav {
        margin: 1.2rem 0 0 0;
    }

    .ui-page-btn {
        padding: 0.37rem 0.7rem;
        font-size: 0.97rem;
        min-width: 2rem;
    }

    .ui-page-dots {
        font-size: 1.1rem;
    }
}


/* Modal */
.ui-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.ui-modal-dialog {
    max-width: 520px;
    width: 100%;
}

.ui-modal-content {
    background: #fff;
    border-radius: 1.1rem;
    box-shadow: 0 8px 40px rgba(0,51,102,0.13);
    overflow: hidden;
    animation: fadeIn 0.3s;
}

.ui-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--ui-border);
    background: var(--ui-light);
}



.ui-modal-close {
    background: none;
    border: none;
    font-size: 1.7rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

    .ui-modal-close:hover {
        color: var(--ui-danger);
    }

.ui-modal-body {
    padding: 1.1rem 1.5rem;
}

.ui-modal-footer {
    padding: 1.1rem 1.5rem 1.1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    border-top: 1px solid var(--ui-border);
    background: var(--ui-light);
}

.ui-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.18);
    z-index: 1999;
}

.ui-modal.show {
    display: flex;
}

/* Validation message */
.ui-validation-message {
    color: var(--ui-danger);
    font-size: 1rem;
    margin-top: 0.5rem;
    min-height: 1.3em;
}

/* Responsive */
@media (max-width: 991px) {
    .ui-page-header h2 {
        font-size: 1.3rem;
    }

    .ui-card, .ui-card-filters, .ui-card-table {
        padding: 1.2rem 0.7rem;
    }

    .ui-modal-dialog {
        max-width: 99vw;
    }
}

@media (max-width: 575px) {
    .ui-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
    }

    .ui-card, .ui-card-filters, .ui-card-table {
        padding: 0.7rem 0.2rem;
    }

    .ui-label {
        font-size: 0.98rem;
    }

    .ui-table th, .ui-table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.98rem;
    }

    .ui-modal-header, .ui-modal-body, .ui-modal-footer {
        padding: 0.7rem 0.8rem;
    }
}

.ui-card-form {
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.06);
    padding: 1.2rem 1rem 1rem 1rem;
    margin-bottom: 1.2rem;
}

.ui-card-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.ui-modal-fullscreen {
    align-items: stretch !important;
    justify-content: stretch !important;
}

    .ui-modal-fullscreen .ui-modal-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .ui-modal-fullscreen .ui-modal-content {
        height: 100vh !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .ui-modal-fullscreen .ui-modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
    }

@media (max-width: 991px) {
    .ui-modal-fullscreen {
        align-items: stretch !important;
        justify-content: stretch !important;
    }

        .ui-modal-fullscreen .ui-modal-dialog,
        .ui-modal-fullscreen .ui-modal-content {
            width: 100vw !important;
            max-width: 100vw !important;
            height: 100vh !important;
            border-radius: 0 !important;
        }

        .ui-modal-fullscreen .ui-modal-body {
            flex: 1 1 auto;
            overflow-y: auto;
        }
}

.ui-validation-center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    min-width: 260px;
    max-width: 90vw;
    background: #fff5f5;
    color: #d32f2f;
    border: 2px solid #ffcdd2;
    border-radius: 1rem;
    padding: 1.1rem 2rem;
    font-size: 1.13rem;
    font-weight: 700;
    box-shadow: 0 8px 40px #d32f2f33;
    z-index: 5000;
    opacity: 0;
    animation: validationCenterIn 0.7s cubic-bezier(.4,0,.2,1) forwards;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.ui-validation-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #d32f2f;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
    user-select: none;
}

    .ui-validation-close:hover {
        color: #a00e0e;
    }

@keyframes validationCenterIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -55%) scale(0.8);
    }

    60% {
        opacity: 1;
        transform: translate(-50%, -48%) scale(1.05);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -52%) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}





.ui-select-search-container {
    position: relative;
}

.ui-select-search-display {
    cursor: pointer;
}

.ui-select-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    z-index: 99999 !important;
    padding: 8px;
    margin-top: 4px;
}

/* Ensure table cells allow overflow for dropdown */
.table td {
    position: relative;
    overflow: visible !important;
}

.table th {
    position: relative;
    overflow: visible !important;
}

/* Ensure table allows overflow */
.table-responsive {
    overflow: visible !important;
}

.table {
    overflow: visible !important;
}

    /* Ensure tfoot doesn't block dropdown */
    .table tfoot {
        position: relative;
        z-index: 1;
    }

        .table tfoot td {
            position: relative;
            z-index: 1;
        }

/* Dropdown must be above everything including tfoot */
.ui-select-search-container {
    position: relative;
    z-index: 10;
}

    /* When dropdown is open, container should have high z-index */
    .ui-select-search-container.dropdown-open {
        position: relative;
        z-index: 999999 !important;
    }

.ui-select-search-dropdown {
    position: absolute !important;
    z-index: 999999 !important;
    background: #fff !important;
}

/* Ensure parent containers allow dropdown overflow when dropdown is open */
.ui-select-search-container.dropdown-open {
    overflow: visible !important;
}

    /* Force overflow visible on all parent elements when dropdown is open */
    .ui-select-search-container.dropdown-open,
    .ui-select-search-container.dropdown-open * {
        overflow: visible !important;
    }

/* Ensure Bootstrap columns and rows allow dropdown overflow */
.col-md-4,
.col-12,
.col-md-6,
.col-lg-4,
.col-lg-6,
[class*="col-"] {
    position: relative;
}

/* When dropdown is open, ensure all ancestors allow overflow */
body:has(.ui-select-search-container.dropdown-open) .row,
body:has(.ui-select-search-container.dropdown-open) [class*="col-"] {
    overflow: visible !important;
}

/* Fix: form-card and its body must allow dropdown overflow */
body:has(.ui-select-search-container.dropdown-open) .form-card,
body:has(.ui-select-search-container.dropdown-open) .form-card__body,
body:has(.ui-select-search-container.dropdown-open) .form-card__header {
    overflow: visible !important;
}

.form-card {
    overflow: visible !important;
}

.form-card__body {
    overflow: visible !important;
}

/* Fix: row inside form-card must allow overflow */
.form-card__body .row {
    overflow: visible !important;
}

/* Ensure tbody and cells have proper stacking */
.table tbody {
    position: relative;
    z-index: 2;
}

    .table tbody td {
        position: relative;
        z-index: 2;
    }

/* Lower z-index for tfoot to ensure dropdown appears above */
.table tfoot {
    position: relative;
    z-index: 1 !important;
}

    .table tfoot td {
        position: relative;
        z-index: 1 !important;
    }

/* Fix: ensure the dropdown container gets elevated z-index when open */
.ui-select-search-container.dropdown-open {
    z-index: 999999 !important;
    position: relative !important;
}

.ui-select-search-container.dropdown-open .ui-select-search-dropdown {
    position: absolute !important;
    z-index: 999999 !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
}

/* Force all ancestors of open dropdown to allow overflow */
.form-card:has(.dropdown-open),
.form-card__body:has(.dropdown-open),
.row:has(.dropdown-open),
[class*="col-"]:has(.dropdown-open) {
    overflow: visible !important;
    z-index: auto !important;
}

.ui-select-search-list {
    max-height: 200px;
    overflow-y: auto;
}

.ui-select-search-item {
    padding: 5px;
    cursor: pointer;
}

    .ui-select-search-item:hover {
        background: #f1f1f1;
    }

.ui-card-form .ui-card-title {
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    color: #333;
}

.ui-validation-center {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #a94442;
    padding: 0.75rem;
    border-radius: 0.25rem;
    text-align: center;
}

.ui-validation-close {
    float: right;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 10px;
}

.ui-container {
    max-width: 180vh;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

.ui-logo-upload-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
}

.ui-logo-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: #f8fafd;
    border: 2px dashed #e3eafc;
    border-radius: 1rem;
    padding: 2.2rem 1.2rem;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    font-weight: 600;
    color: #003366;
    text-align: center;
    width: 100%;
    max-width: 320px;
    min-height: 120px;
    position: relative;
}

    .ui-logo-upload-label:hover,
    .ui-logo-upload-label:focus {
        border-color: #0d6efd;
        background: #e3eafc;
        color: #0d6efd;
    }

.ui-logo-upload-icon {
    font-size: 2.5rem;
    color: #0d6efd;
    margin-bottom: 0.3rem;
}

.ui-logo-upload-input {
    display: none;
}

.ui-logo-preview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

    .ui-logo-preview img {
        max-height: 100px;
        max-width: 180px;
        border-radius: 0.7rem;
        box-shadow: 0 2px 12px #0d6efd12;
        background: #fff;
        border: 1.5px solid #e3eafc;
        padding: 0.2rem;
    }

.status-badge {
    display: inline-block;
    padding: 0.35em 1.1em;
    border-radius: 1.2em;
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 90px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.status-available {
    background: #20c997;
}

.status-busy {
    background: #ffc107;
    color: #222;
}

.status-outofservice {
    background: #d32f2f;
}

.status-default {
    background: #bdbdbd;
}

.ui-btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
}

.ui-btn-warning {
    background-color: #ffc107;
    color: #212529;
    border-radius: 0.4rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .ui-btn-warning:hover {
        background-color: #e0a800;
    }

.ui-select-search-display.disabled {
    background: #eee;
    cursor: not-allowed;
}

.ui-modal.show {
    animation: fadeSlide 0.4s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-tree-container {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    font-family: 'Cairo', sans-serif;
}

.account-tree-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

    .account-tree-header h3 {
        font-size: 1.3rem;
        font-weight: bold;
        color: #4A148C;
    }

.tree-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tree-filter {
    min-width: 220px;
    border-radius: 8px;
}

.list-group {
    list-style: none;
    padding-left: 0;
}

.account-node {
    border: 1px solid #e4e4e4;
    margin: 8px 0;
    border-radius: 8px;
    padding: 12px;
    background: #fdfdfd;
    transition: all 0.2s ease-in-out;
}

    .account-node:hover {
        background: #fafafa;
        border-color: #d0d0d0;
    }

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.node-toggle {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #4A148C;
}

.node-code {
    font-weight: bold;
    color: #4A148C;
    font-size: 0.9rem;
}

.node-title {
    font-size: 0.9rem;
    color: #333;
}

.node-actions button {
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 4px 8px;
}

.child-list {
    margin-top: 10px;
    margin-left: 25px;
    padding-left: 15px;
    border-left: 2px dashed #ccc;
}

.bg-codeiks-primary {
    background: linear-gradient(135deg, #0E2A47, #15406E);
    color: #fff;
}

.bg-codeiks-accent {
    background: linear-gradient(135deg, #4DD0A1, #34BFA3);
    color: #fff;
}

.bg-codeiks-mix {
    background: linear-gradient(135deg, #0E2A47, #4DD0A1);
    color: #fff;
}

.stat-card-modern {
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .stat-card-modern:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    }

.stat-body {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.pwa-install-banner {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0,0,0,.25);
    z-index: 2000;
}

.pwa-card {
    width: min(540px, 92vw);
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 16px 14px 18px;
    box-shadow: 0 -8px 24px rgba(0,0,0,.12);
    font-family: 'Cairo', system-ui, sans-serif;
}

.pwa-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: #0d6efd;
}

.pwa-desc {
    color: #234;
    margin-bottom: 10px;
}

.pwa-actions {
    display: flex;
    gap: 8px;
}

.pwa-btn {
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    background: #0d6efd;
    color: #fff;
    flex: 1 1 auto;
}

    .pwa-btn.pwa-secondary {
        background: #e9eefc;
        color: #0d6efd;
    }

@media (min-width: 576px) {
    .pwa-install-banner {
        align-items: center;
    }

    .pwa-card {
        border-radius: 16px;
    }
}

.ui-table-sort {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}
/* ====== Cards & Container ====== */
.ix-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,.06);
}

.ix-card-table {
    padding: 0;
    overflow: hidden;
}

/* ====== Table ====== */
.ix-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.ix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

    .ix-table thead th {
        background: #f8fafc;
        color: #223;
        font-weight: 600;
        padding: 12px 14px;
        white-space: nowrap;
        position: relative;
    }

    .ix-table tbody td {
        padding: 12px 14px;
        border-top: 1px solid #eef1f5;
        vertical-align: middle;
    }

    .ix-table tbody tr:nth-child(even) {
        background: #fcfdff;
    }

    .ix-table tbody tr:hover {
        background: #f5f9ff;
    }

/* Sticky header */
.ix-thead-sticky th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Select & Actions columns */
.ix-col-select {
    width: 46px;
    text-align: center;
}

.ix-col-actions {
    white-space: nowrap;
}

/* Checkbox */
.ix-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Sort button */
.ix-table-sort {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #1f2937;
}

    .ix-table-sort:hover {
        color: #0f172a;
    }

.ix-sort-neutral {
    opacity: .5;
    font-size: 0.95rem;
}

.ix-sort-active {
    font-weight: 600;
    margin-left: -0.2rem;
}

.ix-table th .ix-sort-active:empty::before {
    content: '';
}
/* اخفاء لو مفيش سهم نشط */

/* Badges */
.ix-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .25rem .6rem;
    font-size: .75rem;
    font-weight: 600;
}

.ix-badge-success {
    background: #e7f7ef;
    color: #0b7a45;
}

.ix-badge-warn {
    background: #fff6e5;
    color: #9a6a00;
}

.ix-badge-danger {
    background: #fdecea;
    color: #b42318;
}

.ix-badge-muted {
    background: #eef2f7;
    color: #475569;
}

/* Buttons */
.ix-btn {
    border: 0;
    border-radius: 10px;
    padding: .45rem .75rem;
    font-weight: 600;
    cursor: pointer;
    background: #eef2ff;
    color: #1e3a8a;
    transition: transform .05s ease, box-shadow .2s;
}

    .ix-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 14px rgba(0,0,0,.08);
    }

    .ix-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.ix-btn-sm {
    padding: .35rem .55rem;
    font-size: .85rem;
}

.ix-btn-info {
    background: #e6f1ff;
    color: #0b4ea2;
}

.ix-btn-danger {
    background: #fee2e2;
    color: #991b1b;
}

.ix-btn-success {
    background: #dcfce7;
    color: #166534;
}

/* Actions cell layout */
.ix-actions {
    display: inline-flex;
    gap: .35rem;
}

/* ====== Mobile Responsive (transform table -> cards) ====== */
@media (max-width: 768px) {
    .ix-table thead {
        display: none;
    }

    .ix-table, .ix-table tbody, .ix-table tr, .ix-table td {
        display: block;
        width: 100%;
    }

    .ix-row {
        background: #fff;
        margin: 10px 0;
        border: 1px solid #eef1f5;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,.04);
        overflow: hidden;
    }

        .ix-row:hover {
            background: #fff;
        }

        .ix-row > td {
            border: 0;
            border-top: 1px solid #f1f5f9;
            padding: 10px 14px;
        }

            .ix-row > td:first-child {
                border-top: 0;
            }

            .ix-row > td[data-label]::before {
                content: attr(data-label);
                display: block;
                font-weight: 600;
                color: #334155;
                margin-bottom: 4px;
                font-size: .85rem;
            }

    .ix-col-actions {
        padding-bottom: 12px;
    }

    .ix-col-select {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-top: 12px;
    }

    .text-end {
        text-align: left !important;
    }
}

/* ====== Nice scroll (optional) ====== */
.ix-table-responsive::-webkit-scrollbar {
    height: 8px;
}

.ix-table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}

.ix-table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}

:root {
    --kdx-bg: #f7f8fb;
    --kdx-card: #ffffff;
    --kdx-text: #0f172a;
    --kdx-muted: #64748b;
    --kdx-border: #eef1f5;
    --kdx-blue: #2563eb;
    --kdx-green: #16a34a;
    --kdx-red: #dc2626;
    --kdx-amber: #d97706;
    --kdx-shadow: 0 6px 18px rgba(16,24,40,.06);
    --kdx-radius: 18px;
    --kdx-radius-lg: 20px;
    --kdx-gap: 1.25rem;
    --kdx-font: 'Cairo',system-ui,Arial,sans-serif;
}

html, body {
    font-family: var(--kdx-font);
}

.kdx-container {
    padding: 1.25rem 1.25rem 2rem;
}

/* Header */
.kdx-header {
    margin-bottom: 1rem;
}

.kdx-header__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--kdx-text);
}

.kdx-header__subtitle {
    font-size: .95rem;
    color: var(--kdx-muted);
    margin: 4px 0 0
}

/* Card */
.kdx-card {
    background: var(--kdx-card);
    border: 1px solid var(--kdx-border);
    border-radius: var(--kdx-radius);
    box-shadow: var(--kdx-shadow);
}

.kdx-card--panel {
    padding: 1rem;
}

.kdx-card--chart {
    padding: 1rem;
}

.kdx-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem
}

.kdx-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--kdx-text);
    margin: 0
}

.kdx-card__body {
}

/* KPI */
.kdx-kpi {
    position: relative;
    background: var(--kdx-card);
    border: 1px solid var(--kdx-border);
    border-radius: var(--kdx-radius-lg);
    padding: 1rem;
    box-shadow: var(--kdx-shadow);
    overflow: hidden;
}

.kdx-kpi__body {
    display: flex;
    gap: .9rem;
    align-items: center
}

.kdx-kpi__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #f1f5ff;
    color: var(--kdx-blue);
    font-size: 20px;
}

.kdx-kpi__label {
    color: var(--kdx-muted);
    font-size: .9rem;
}

.kdx-kpi__value {
    color: var(--kdx-text);
    font-weight: 800;
    font-size: 1.4rem;
    line-height: 1.2
}

.kdx-kpi__meta {
    margin-top: .25rem
}

.kdx-kpi__sparkline {
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    height: 46px;
    background: linear-gradient(to top, rgba(37,99,235,.06), transparent);
    pointer-events: none;
}

/* KPI modifiers */
.kdx-kpi--positive .kdx-kpi__icon {
    background: #ecfdf5;
    color: var(--kdx-green);
}

.kdx-kpi--warning .kdx-kpi__icon {
    background: #fff7ed;
    color: var(--kdx-amber);
}

.kdx-kpi--neutral .kdx-kpi__icon {
    background: #eff6ff;
    color: var(--kdx-blue);
}

.kdx-kpi--info .kdx-kpi__icon {
    background: #eef2ff;
    color: #4f46e5;
}

.kdx-kpi--danger .kdx-kpi__icon {
    background: #fef2f2;
    color: var(--kdx-red);
}

/* Pills & trend */
.kdx-pill {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #334155;
    font-size: .75rem;
    border: 1px solid #e5e7eb;
}

.kdx-pill--muted {
    background: #f8fafc;
    color: #64748b
}

.kdx-trend {
    font-weight: 700;
    font-size: .85rem
}

.kdx-trend--up {
    color: var(--kdx-green)
}

.kdx-trend--down {
    color: var(--kdx-red)
}

/* Map */
.kdx-map {
    width: 100%;
    height: 520px;
    border-radius: 16px;
    border: 1px solid var(--kdx-border);
}

/* Alerts & loading */
.kdx-alert {
    border-radius: 12px;
}

.kdx-loading {
    min-height: 80vh;
    display: grid;
    place-items: center
}

/* RTL niceties */
[dir="rtl"] .kdx-kpi__sparkline {
    inset-inline-start: auto;
    inset-inline-end: 0
}

.kdx-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .75rem
}

.kdx-branch {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border: 1px solid var(--kdx-border);
    border-radius: 12px;
    padding: .5rem .75rem;
    box-shadow: var(--kdx-shadow)
}

.kdx-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px
}

    .kdx-switch input {
        display: none
    }

.kdx-switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #e5e7eb;
    border-radius: 999px;
    transition: .2s
}

    .kdx-switch__slider:before {
        content: "";
        position: absolute;
        height: 18px;
        width: 18px;
        inset-block-start: 3px;
        inset-inline-end: 21px;
        background: #fff;
        border-radius: 50%;
        transition: .2s;
        box-shadow: 0 1px 2px rgba(0,0,0,.15)
    }

.kdx-switch input:checked + .kdx-switch__slider {
    background: #22c55e
}

    .kdx-switch input:checked + .kdx-switch__slider:before {
        inset-inline-end: 3px
    }

.kdx-switch__label {
    color: var(--kdx-muted);
    font-size: .9rem
}

.kdx-range {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap
}

.kdx-chip {
    border: 1px solid var(--kdx-border);
    background: #fff;
    border-radius: 999px;
    padding: .25rem .6rem;
    font-size: .85rem
}

.kdx-date {
    border: 1px solid var(--kdx-border);
    border-radius: 10px;
    padding: .3rem .5rem;
    background: #fff
}

.kdx-search {
    position: relative;
    background: #fff;
    border: 1px solid var(--kdx-border);
    border-radius: 12px;
    padding: .35rem .75rem;
    display: flex;
    align-items: center;
    gap: .5rem
}

    .kdx-search input {
        border: none;
        outline: none;
        min-width: 220px
    }

.kdx-quick {
    display: grid;
    gap: .6rem
}

    .kdx-quick.grid-2 {
        grid-template-columns: repeat(2,1fr)
    }

.kdx-quick__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--kdx-border);
    background: #fff;
    border-radius: 12px;
    padding: .6rem .75rem;
    text-decoration: none;
    color: #111
}

    .kdx-quick__item:hover {
        background: #f8fafc
    }

.kdx-table thead th {
    font-weight: 700;
    border-bottom: 1px solid var(--kdx-border)
}

.kdx-table td, .kdx-table th {
    vertical-align: middle
}

.kdx-tag {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    border: 1px solid var(--kdx-border)
}

.kdx-tag--ok {
    background: #ecfdf5;
    color: #065f46
}

.kdx-tag--muted {
    background: #f3f4f6;
    color: #475569
}

.kdx-insights {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap
}

.kdx-insight {
    background: #f8fafc;
    border: 1px solid var(--kdx-border);
    border-radius: 999px;
    padding: .25rem .6rem;
    font-size: .83rem;
    color: #111
}
/* Theme: Codeiks */
.kdx-theme--codeiks {
    --kdx-bg: #f7f9fc;
    --kdx-card: #ffffff;
    --kdx-text: #0f172a;
    --kdx-muted: #64748b;
    --kdx-border: #eef1f5;
    --kdx-blue: #1d4ed8; /* الأساسي */
    --kdx-green: #16a34a; /* صافي/نمو */
    --kdx-red: #ef4444; /* الاعتمادات */
    --kdx-amber: #f59e0b; /* تحذير */
}

/* تطعيمات صغيرة للـ KPI حسب اللون */
.kdx-kpi--positive .kdx-kpi__icon {
    background: #ecfdf5;
    color: var(--kdx-green)
}

.kdx-kpi--danger .kdx-kpi__icon {
    background: #fef2f2;
    color: var(--kdx-red)
}

.kdx-kpi--warning .kdx-kpi__icon {
    background: #fff7ed;
    color: var(--kdx-amber)
}

.kdx-kpi--neutral .kdx-kpi__icon {
    background: #eff6ff;
    color: var(--kdx-blue)
}

.menu-tree {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 8px 6px;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    border-radius: 8px;
    margin-left: var(--indent, 0);
}

    .tree-row:hover {
        background: #f8f9fa;
    }

.tree-toggle, .tree-spacer {
    width: 24px;
    text-align: center;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.tree-check {
    margin-inline-start: 4px;
}

.tree-title {
    font-weight: 600;
}

.tree-meta {
    margin-inline-start: auto;
}
/* كان عندك: margin-left: var(--indent, 0); */
/* خليها خواص منطقية تدعم RTL/LTR */
.tree-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    border-radius: 8px;
    margin-inline-start: var(--indent, 0); /* ← أهم سطر */
}

    .tree-row:hover {
        background: #f8f9fa;
    }

.tree-toggle, .tree-spacer {
    width: 24px;
    text-align: center;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.tree-check {
    margin-inline-start: 4px;
}

.tree-title {
    font-weight: 600;
}

.tree-meta {
    margin-inline-start: auto;
}

[dir="rtl"] .tree-row {
    margin-right: var(--indent, 0);
}

[dir="ltr"] .tree-row {
    margin-left: var(--indent, 0);
}

.menu-tree {
    position: relative;
}

.tree-row {
    position: relative;
    padding-block: .25rem;
}

    /* خط أفقي قصير من العقدة لداخل الشجرة */
    .tree-row::before {
        content: "";
        position: absolute;
        top: 50%;
        inset-inline-start: calc(var(--indent, 0) - 12px);
        width: 12px;
        height: 1px;
        background: #e0e0e0;
    }

    /* خط عمودي يستمر بين الإخوة (يبان أحلى مع أولاد كُثُر) */
    .tree-row:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 50%;
        bottom: -12px;
        inset-inline-start: calc(var(--indent, 0) - 12px);
        width: 1px;
        background: #e0e0e0;
    }

.udb {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.udb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--kdx-border,#eef1f5);
    border-radius: 14px;
    padding: .6rem .8rem;
    box-shadow: var(--kdx-shadow,0 6px 18px rgba(16,24,40,.06));
}

.udb-title {
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.udb-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.udb-picker {
    background: #fff;
    border: 1px solid var(--kdx-border,#eef1f5);
    border-radius: 14px;
    padding: .7rem;
}

.udb-picker__grid {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(4,minmax(0,1fr));
}

.udb-picker__item {
    border: 1px dashed #cfd7e3;
    border-radius: 12px;
    padding: .7rem;
    background: #fafbff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    transition: all .15s ease;
}

    .udb-picker__item:hover {
        background: #f3f6ff;
        border-color: #a9b7d1;
    }

.udb-picker__icon {
    font-size: 1.4rem;
    color: #4f46e5;
}

.udb-picker__title {
    font-weight: 700;
}

.udb-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(12, minmax(0,1fr));
}

.udb-card {
    grid-column: span 6; /* default half width */
    background: #fff;
    border: 1px solid var(--kdx-border,#eef1f5);
    border-radius: 16px;
    box-shadow: var(--kdx-shadow,0 6px 18px rgba(16,24,40,.06));
}

@media (max-width: 992px) {
    .udb-card {
        grid-column: span 12;
    }
}

.udb-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .6rem .8rem;
    border-bottom: 1px solid #f1f4f8;
}

.udb-card__title {
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.udb-card__tools {
    display: flex;
    gap: .25rem;
}

.udb-ghost {
    background: transparent;
    border: 0;
    padding: .25rem .4rem;
    border-radius: 8px;
    cursor: pointer;
    color: #475569;
}

    .udb-ghost:hover {
        background: #f8fafc;
    }

.udb-card__body {
    padding: .8rem;
}

.kpi {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kpi__value {
    font-size: 1.6rem;
    font-weight: 900;
}

.kpi__label {
    color: #64748b;
    font-weight: 600;
}

.kpi--neutral .kpi__value {
    color: #111827;
}

.kpi--warning .kpi__value {
    color: #c2410c;
}

.kpi--positive .kpi__value {
    color: #047857;
}

.qa-grid {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(4,minmax(0,1fr));
}

@media (max-width: 992px) {
    .qa-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

.qa-item {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: .55rem .65rem;
    border: 1px solid #eef1f5;
    border-radius: 12px;
    text-decoration: none;
    color: #111;
    background: #fff;
    transition: background .15s ease, transform .05s ease;
}

    .qa-item:hover {
        background: #f8fafc;
        transform: translateY(-1px);
    }

.chart-placeholder {
    height: 280px;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #64748b;
    background: linear-gradient(180deg,#fff, #fafbff);
}

.je-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--je-line);
    font-size: 14px;
    cursor: pointer;
}
/* app.css */
.je-htmlarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
    font-family: "Cairo", Arial, sans-serif;
}

.je-preview table {
    width: 100%;
    border-collapse: collapse
}

.je-preview th, .je-preview td {
    border: 1px solid #e2e8f0;
    padding: .35rem .5rem
}

/* ══════════════════════════════════════════════════════════════════
   Smart Select – uisl-*
   Dropdown uses position:fixed → always renders above every element
══════════════════════════════════════════════════════════════════ */

/* ── Trigger ── */
.uisl-trigger {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .875rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    min-height: 42px;
    user-select: none;
    position: relative;
    width: 100%;
}
.uisl-trigger:hover { border-color: #94a3b8; }
.uisl-trigger.open  { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.uisl-trigger.open-green { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }

.uisl-placeholder { color: #94a3b8; flex: 1; font-size: .88rem; }
.uisl-value       { flex: 1; color: #1a2332; font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uisl-icon        { color: #94a3b8; font-size: 1rem; flex-shrink: 0; }
.uisl-chevron     { color: #94a3b8; font-size: .78rem; flex-shrink: 0; margin-inline-start: auto; transition: transform .2s; }
.uisl-chevron.rotated { transform: rotate(180deg); }

.uisl-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 700; color: #fff; flex-shrink: 0;
    letter-spacing: 0;
}
.uisl-code-badge {
    font-size: .72rem; color: #64748b; background: #f1f5f9;
    border-radius: 6px; padding: .1rem .4rem; flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

/* ── Dropdown (fixed via JS) ── */
.uisl-dropdown {
    position: fixed;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.16), 0 4px 16px rgba(0,0,0,.08);
    border: 1px solid #e8edf2;
    z-index: 99999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Search box ── */
.uisl-search-box {
    display: flex; align-items: center; gap: .5rem;
    padding: .7rem .875rem;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    flex-shrink: 0;
}
.uisl-search-icon  { color: #94a3b8; font-size: .88rem; flex-shrink: 0; }
.uisl-search-input { flex: 1; border: none; background: transparent; outline: none; font-size: .88rem; color: #1a2332; }
.uisl-search-input::placeholder { color: #94a3b8; }
.uisl-search-clear {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    padding: 0; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background .1s, color .1s; flex-shrink: 0;
}
.uisl-search-clear:hover { background: #e2e8f0; color: #475569; }

/* ── Results info bar ── */
.uisl-results-info {
    padding: .25rem .875rem;
    font-size: .73rem; color: #94a3b8;
    background: #fafbfc;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

/* ── Scrollable list ── */
.uisl-list { overflow-y: auto; flex: 1; }

/* ── Items ── */
.uisl-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .875rem;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid #f8fafc;
}
.uisl-item:last-child { border-bottom: none; }
.uisl-item:hover    { background: #f8fafc; }
.uisl-item.selected { background: #eff6ff; }
/* Keyboard highlight (SearchableSelect arrow-key navigation) */
.uisl-item.kb-active { background: #eef2ff; box-shadow: inset 3px 0 0 #4f46e5; }
.uisl-item-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.uisl-item-avatar-loc {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg,#10b981,#047857);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff; flex-shrink: 0;
}
.uisl-item-info  { flex: 1; min-width: 0; }
.uisl-item-name  { font-size: .87rem; font-weight: 500; color: #1a2332; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uisl-item-sub   { font-size: .74rem; color: #94a3b8; margin-top: .1rem; }
.uisl-item-code  { font-size: .72rem; color: #64748b; background: #f1f5f9; border-radius: 5px; padding: .05rem .35rem; border: 1px solid #e2e8f0; }
.uisl-check-icon { color: #3b82f6; font-size: 1.1rem; flex-shrink: 0; }

/* ── Empty state ── */
.uisl-empty { padding: 2rem 1rem; text-align: center; color: #94a3b8; font-size: .88rem; }
.uisl-empty-icon { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .4; }

/* ── Footer / Add button ── */
.uisl-footer {
    padding: .6rem .75rem;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    flex-shrink: 0;
}
.uisl-add-btn {
    width: 100%; padding: .5rem;
    background: none;
    border: 1.5px dashed #3b82f6;
    border-radius: 8px;
    color: #3b82f6; font-size: .84rem; font-weight: 600;
    cursor: pointer; transition: background .15s;
    display: flex; align-items: center; justify-content: center;
}
.uisl-add-btn:hover { background: #eff6ff; }
.uisl-add-btn-green {
    border-color: #10b981; color: #10b981;
}
.uisl-add-btn-green:hover { background: #f0fdf4; }

/* ── Skeleton loader ── */
@keyframes uisl-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.uisl-skeleton { padding: .5rem .875rem; }
.uisl-skeleton-item { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; }
.uisl-skeleton-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);
    background-size: 200% 100%; animation: uisl-shimmer 1.4s infinite;
}
.uisl-skeleton-text { flex: 1; }
.uisl-skeleton-line {
    border-radius: 4px; margin-bottom: .35rem;
    background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);
    background-size: 200% 100%; animation: uisl-shimmer 1.4s infinite;
}

/* Readonly / disabled trigger */
.uisl-trigger.readonly {
    opacity: .6; cursor: not-allowed; background: #f8fafc; pointer-events: none;
}

/* Container status badges */
.uisl-status {
    font-size: .68rem; font-weight: 600; border-radius: 20px;
    padding: .1rem .5rem; white-space: nowrap; flex-shrink: 0; border: 1px solid;
}
.uisl-status-free { background:#dcfce7; color:#15803d; border-color:#86efac; }
.uisl-status-busy { background:#fee2e2; color:#dc2626; border-color:#fca5a5; }
.uisl-status-na   { background:#f1f5f9; color:#475569; border-color:#e2e8f0; }

/* Generic icon tile (square) for non-person selects */
.uisl-item-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; color: #fff; flex-shrink: 0;
}
.uisl-trigger-icon {
    width: 26px; height: 26px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; color: #fff; flex-shrink: 0;
}

/* مصدر سعر السطر وحدّاه في شاشة الفاتورة */
.ai-pricesrc {
    display: flex; flex-wrap: wrap; gap: .25rem .5rem;
    margin-top: .25rem; font-size: .68rem; font-weight: 600;
}
.ai-pricesrc__list { color: #4338ca; display: inline-flex; align-items: center; gap: .2rem; }
.ai-pricesrc__lim  { color: #64748b; }
/* تجاوز الحد يُلوَّن قبل الحفظ، فلا يُفاجأ المستخدم بالرفض */
.ai-pricesrc__lim.is-bad { color: #b91c1c; font-weight: 800; }

/* منتقي نوع سطر عرض السعر — كنظيره في الفاتورة */
.aq-ltt-bar { display: flex; gap: .4rem; flex-wrap: wrap; }
.aq-ltt {
    display: inline-flex; align-items: center; gap: .35rem;
    border: 1.5px solid #e3eafc; background: #fff; color: #64748b;
    border-radius: 8px; padding: .35rem .85rem; cursor: pointer;
    font-family: var(--ui-font); font-size: .82rem; font-weight: 600; transition: .15s;
}
.aq-ltt:hover { border-color: #cbd5e1; color: #334155; }
.aq-ltt-on { background: #0E2A47; border-color: #0E2A47; color: #fff; }
/* الرصيد في عرض السعر للعلم لا للمنع: العرض يُسعّر ما ليس في المخزن */
.aq-stock {
    border: 1.5px solid #e3eafc; border-radius: .6rem; background: #f8fafd;
    padding: .55rem 1rem; font-weight: 700; color: #334155;
    font-variant-numeric: tabular-nums;
}
.aq-stock__u { font-size: .72rem; font-weight: 600; color: #94a3b8; margin-inline-start: .3rem; }


/* ───────── تلميح تحت الحقل ─────────
   نصٌّ يشرح أثر الحقل، لا يزاحم عنوانه. */
.ui-hint {
    display: block;
    margin-block-start: .25rem;
    font-size: .74rem;
    line-height: 1.5;
    color: #64748b;
}

/* ───────── مربّع اختيار بعنوانه ─────────
   العنوان جزء من هدف النقر: مربّع ١٦px وحده هدفٌ ضيّق. */
.ui-check {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    user-select: none;
}
.ui-check input[type="checkbox"] {
    inline-size: 1.05rem;
    block-size: 1.05rem;
    accent-color: #2563eb;
    cursor: pointer;
    margin: 0;
    flex: none;
}
.ui-check:hover { color: #2563eb; }
