﻿
html, body {
    font-family: Tahoma, 'Segoe UI', Geneva, Verdana, sans-serif;
    /*font-family: 'Sakkal Majalla', 'Tajawal', 'Cairo', 'Noto Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/
    margin: 0;
    padding: 0;
    user-select: none;
}

h1:focus {
    outline: none;
}

input:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }







.app-button {
    border: none;
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    background-color: #0078d4;
    color: #fff;
}

    .app-button:hover:not(:disabled) {
        background-color: #106ebe;
    }

    .app-button:disabled {
        background-color: #ccc;
        color: #888;
        cursor: not-allowed;
        opacity: 0.6;
    }

.loader {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.spin {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}




/* DGV */
/* DGV */
:root {
    --border-color: #abc;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --range-bg-color: rgba(0, 123, 255, 0.18);
    --row-bg-color: rgba(0, 123, 255, 0.1);
    --cell-height: 34px;
}

.mx-table-container {
    overflow: auto;
    border: 1px solid var(--border-color);
    outline: none;
    box-sizing: border-box;
    /* ✅ containment — يمنع reflow / recalc من التسرب خارج الحاوية */
    contain: layout style paint;
    /* ✅ تسريع الـ scroll على GPU */
    transform: translateZ(0);
    will-change: scroll-position;
}

.mx-table {
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    width: max-content;
    border-bottom: 1px solid var(--border-color);
}

    .mx-table thead {
        position: sticky;
        top: 0;
        z-index: 10;
    }

.mx-th {
    box-shadow: 0 1px 0 0 var(--border-color);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    position: relative;
    cursor: pointer;
    background-color: #f2f2f2;
    padding: 1px 6px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    color: #333;
}

.mx-td {
    font-weight: 400;
    font-size: 14px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    overflow: visible;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    position: relative;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.mx-table tbody .mx-td.selected-range {
    border-color: var(--border-color) !important;
    background-color: var(--range-bg-color) !important;
    z-index: 4;
}

.mx-table tbody tr[data-selected="true"] td,
.mx-table tbody tr.selected-row td {
    background-color: var(--row-bg-color) !important;
}

.cell-input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    padding: 0 !important;
    margin: 0;
    font-size: inherit;
    color: inherit;
    box-sizing: border-box;
    vertical-align: middle;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.resizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
    z-index: 10;
}

    .resizer:hover,
    .resizer.resizing {
        background-color: gray;
    }

.mx-action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

    .mx-action-btn:hover {
        background-color: var(--primary-hover);
    }

.mx-btn-secondary {
    background-color: #6c757d;
}

    .mx-btn-secondary:hover {
        background-color: #5a6268;
    }

.mx-context-menu {
    position: fixed;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
}

.mx-context-item {
    font-weight: 500;
    padding: 6px;
    cursor: pointer;
    font-size: 14px;
    border-right: 14px solid #dee2e6;
    color: #333;
    border-bottom: 1px solid #ced4da;
}

    .mx-context-item:hover {
        background-color: #f1f1f1;
    }

    .mx-context-item.disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }

        .mx-context-item.disabled:hover {
            background-color: transparent;
        }







/* ============ SmartList Panel ============ */
.smart-list-panel {
    position: fixed;
    background: #ffffff;
    border: 1px solid #b8c4d0;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: visible; /* للسهم */
    z-index: 1010;
    font-family: inherit;
    animation: smart-list-pop 120ms ease-out;
}

@keyframes smart-list-pop {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============ السهم ============ */
.smart-list-caret {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffffff;
    z-index: 1;
    pointer-events: none;
}

.smart-list-caret-top {
    top: -7px;
    border-top: 1px solid #b8c4d0;
    border-left: 1px solid #b8c4d0;
    transform: rotate(45deg);
    border-top-left-radius: 2px;
}

.smart-list-caret-bottom {
    bottom: -7px;
    border-bottom: 1px solid #b8c4d0;
    border-right: 1px solid #b8c4d0;
    transform: rotate(45deg);
    border-bottom-right-radius: 2px;
}

/* ============ الرأس ============ */
.smart-list-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    height: 30px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, #f8fafc, #eef2f7);
    border-bottom: 1px solid #dde4ec;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 12px;
    color: #4a5568;
    user-select: none;
}

.smart-list-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    background: #007bff;
    color: #ffffff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.smart-list-title {
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ============ الجسم ============ */
.smart-list-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #ffffff;
}

    /* إزالة حدود DGVRead الداخلية لتندمج مع اللوحة */
    .smart-list-body .mx-table-container {
        border: none !important;
        border-radius: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
    }

/* ============ الذيل ============ */
.smart-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    padding: 0 10px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, #f8fafc, #eef2f7);
    border-top: 1px solid #dde4ec;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    font-size: 11px;
    color: #6c757d;
    user-select: none;
}

.smart-list-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .smart-list-hint kbd {
        display: inline-block;
        padding: 1px 5px;
        font-size: 10px;
        font-family: inherit;
        color: #495057;
        background: #ffffff;
        border: 1px solid #ced4da;
        border-bottom-width: 2px;
        border-radius: 3px;
        line-height: 1.4;
        min-width: 14px;
        text-align: center;
    }

.smart-list-sep {
    color: #adb5bd;
    margin: 0 2px;
}

.smart-list-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-family: inherit;
    border: 1px solid #ced4da;
    background: #ffffff;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

    .smart-list-btn:hover {
        background: #f1f3f5;
        border-color: #adb5bd;
        color: #212529;
    }

    .smart-list-btn:active {
        background: #e9ecef;
    }

    .smart-list-btn:focus {
        outline: 2px solid #007bff;
        outline-offset: 1px;
    }