/* إعدادات الخطوط والخلفية الأساسية */
html {
    /* تصغير لطيف ومتناسق لكل مقاسات Bootstrap المعتمدة على rem. */
    font-size: 15px;
}

html, body {
    font-family: 'Tajawal', "Cairo", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F8FAFC; /* لون خلفية النظام لؤلؤي أنيق جداً */
    color: #1E293B;
    direction: rtl;
    text-align: right;
}

select[data-searchable-select-initialized],
.searchable-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.searchable-select { width: 100%; }

.searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: .55rem .8rem;
    color: #334155;
    font: inherit;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.searchable-select-trigger:hover { background: #fff; border-color: #93c5fd; }
.searchable-select-trigger:focus-visible { outline: 0; border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, .12); }
.searchable-select-trigger:disabled { color: #94a3b8; cursor: not-allowed; background: #f1f5f9; }
.searchable-select-trigger.is-placeholder { color: #64748b; }
.searchable-select-icon { color: #2563eb; font-size: .9rem; }

.select-dialog-open { overflow: hidden; }

.select-dialog-overlay {
    position: fixed;
    z-index: 2500;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(3px);
}

.select-dialog-overlay[hidden] { display: none; }

.select-dialog {
    display: flex;
    flex-direction: column;
    width: min(100%, 620px);
    max-height: min(78vh, 680px);
    overflow: hidden;
    background: #fff;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
}

.select-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
}

.select-dialog-header h2 { margin: 0; color: #0f172a; font-size: 1.05rem; font-weight: 800; }

.select-dialog-close {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #64748b;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 6px;
}

.select-dialog-close:hover { color: #b91c1c; background: #fef2f2; }

.select-dialog-search-wrap {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 1rem 1.1rem .75rem;
    padding: 0 .8rem;
    color: #2563eb;
    background: #f8fafc;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
}

.select-dialog-search {
    width: 100%;
    height: 42px;
    color: #334155;
    font: inherit;
    background: transparent;
    border: 0;
    outline: 0;
}

.select-dialog-options { padding: 0 .55rem .55rem; overflow: auto; }

.select-dialog-option {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: .6rem .8rem;
    color: #334155;
    font: inherit;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 6px;
}

.select-dialog-option:hover, .select-dialog-option:focus-visible { color: #1d4ed8; background: #eff6ff; outline: 0; }
.select-dialog-option.is-selected { color: #1d4ed8; background: #dbeafe; }
.select-dialog-option.is-placeholder { color: #64748b; }
.select-dialog-option:disabled { color: #94a3b8; cursor: not-allowed; background: transparent; }
.select-dialog-empty { margin: 1.5rem 0; color: #64748b; text-align: center; }

.erp-form-validation-hint {
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    color: #991b1b;
    font-size: .88rem;
    font-weight: 800;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

input.erp-invalid-required,
select.erp-invalid-required,
textarea.erp-invalid-required {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important;
}

@media (max-width: 575.98px) {
    .select-dialog-overlay { padding: .5rem; align-items: end; }
    .select-dialog { width: 100%; max-height: 82vh; }
}

/* نمط موحد لشاشات الإدخال: القائمة تظهر أولاً، والنموذج يُفتح عند الإضافة أو التعديل. */
.crud-editor-collapsed {
    display: none !important;
}

.crud-list-collapsed {
    display: none !important;
}

.crud-editor-page {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto !important;
    border: 1px solid #d6e5e1 !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08) !important;
}

.crud-editor-page::before {
    display: block;
    padding: .8rem 1.25rem;
    color: #134e4a;
    font-size: .78rem;
    font-weight: 800;
    content: 'نافذة إدخال البيانات';
    background: #ecfdf5;
    border-bottom: 1px solid #cce8e1;
}

@media (max-width: 575.98px) {
    .crud-editor-page {
        width: 100%;
    }
}

.crud-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0 1rem;
}

.crud-list-toolbar--with-tools {
    flex-wrap: wrap;
}

.crud-list-toolbar--clean-list {
    flex-wrap: wrap;
    padding-inline: 1.5rem;
}

.crud-list-toolbar__title {
    color: #64748b;
    font-size: .86rem;
    font-weight: 800;
}

.crud-add-button {
    min-height: 38px;
    padding: .45rem 1rem;
    font-weight: 800;
    box-shadow: 0 5px 12px rgba(37, 99, 235, .16);
}

.crud-close-button {
    min-height: 38px;
}

/* أدوات الجداول الموحدة: البحث في جميع شاشات البيانات والصفوف في شاشات العمليات. */
.table-tools-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 1.1rem;
}

.table-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    margin-inline-start: auto;
}

.table-tools--full-width {
    flex: 1 1 100%;
    width: 100%;
    margin-inline-start: 0;
}

.table-tools--full-width .table-search-box {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
}

.table-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: clamp(210px, 24vw, 290px);
    height: 42px;
    padding: 0 .45rem 0 .6rem;
    color: #3b82f6;
    background: linear-gradient(135deg, #f8fbff, #ffffff);
    border: 1px solid #d5e3f4;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .035);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.table-search-box:hover {
    border-color: #93c5fd;
    background: #ffffff;
}

.table-search-box:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .12), 0 6px 14px rgba(37, 99, 235, .08);
}

.table-search-box__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 29px;
    height: 29px;
    color: #2563eb;
    font-size: .83rem;
    background: #eaf3ff;
    border-radius: 8px;
}

.table-search-box input {
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0 .55rem;
    color: #334155;
    font: inherit;
    font-size: .84rem;
    font-weight: 650;
    background: transparent;
    border: 0;
    outline: 0;
}

.table-search-box input::placeholder { color: #94a3b8; font-weight: 600; }

.table-search-box__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 27px;
    height: 27px;
    padding: 0;
    color: #64748b;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 7px;
}

.table-search-box__clear:hover { color: #1d4ed8; background: #dbeafe; }

.table-match-count {
    min-width: max-content;
    padding: .31rem .62rem;
    color: #52647a;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
    background: #f1f5f9;
    border: 1px solid #e5edf7;
    border-radius: 999px;
}

.table-row-limit label {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    color: #475569;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}

.table-row-limit input {
    width: 58px;
    height: 34px;
    padding: .2rem .35rem;
    text-align: center;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    outline: 0;
}

.table-pager {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: #475569;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .table-tools-toolbar,
    .table-tools {
        justify-content: stretch;
        width: 100%;
    }
    .table-tools { flex-wrap: wrap; }
    .table-search-box { flex: 1 1 100%; width: 100%; }
}

/* نافذة تأكيد الحذف الموحدة. */
.erp-confirm-overlay {
    position: fixed;
    z-index: 2200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(4px);
    animation: erp-confirm-overlay-in .16s ease-out;
}

.erp-confirm-overlay.is-leaving {
    animation: erp-confirm-overlay-out .16s ease-in forwards;
}

.erp-confirm-dialog {
    width: min(100%, 420px);
    padding: 2rem;
    text-align: center;
    background: #fff;
    border: 1px solid #fee2e2;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    animation: erp-confirm-dialog-in .2s ease-out;
}

.erp-record-overlay {
    z-index: 2200;
    direction: rtl;
    background: rgba(15, 35, 42, .58);
    animation: erp-confirm-overlay-in .16s ease-out;
}

.erp-record-overlay .modal-dialog {
    animation: erp-confirm-dialog-in .2s ease-out;
}

.erp-record-source-action {
    display: none !important;
}

.erp-record-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.erp-record-field {
    min-width: 0;
    min-height: 68px;
    padding: .75rem .85rem;
    background: #f8fbfb;
    border: 1px solid #dce7e8;
    border-radius: 7px;
}

.erp-record-field span,
.erp-record-field strong {
    display: block;
}

.erp-record-field span {
    margin-bottom: .25rem;
    color: #728287;
    font-size: .75rem;
    font-weight: 700;
}

.erp-record-field strong {
    color: #183c44;
    overflow-wrap: anywhere;
}

.erp-record-detail-loading {
    margin-top: 1rem;
    padding: 1rem;
    color: #456068;
    background: #f8fbfb;
    border: 1px solid #dce7e8;
    border-radius: 7px;
}

.erp-record-readonly {
    min-height: 38px;
    overflow-wrap: anywhere;
}

.erp-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: .9rem;
    color: #dc2626;
    font-size: 1.45rem;
    background: #fef2f2;
    border-radius: 50%;
}

.erp-notification-dialog {
    border-color: #dbe5f0;
}

.erp-notification-success .erp-confirm-icon {
    color: #15803d;
    background: #f0fdf4;
}

.erp-notification-warning .erp-confirm-icon {
    color: #b45309;
    background: #fffbeb;
}

.erp-notification-info .erp-confirm-icon {
    color: #0369a1;
    background: #f0f9ff;
}

.erp-notification-danger .erp-confirm-icon {
    color: #dc2626;
    background: #fef2f2;
}

.erp-confirm-dialog h2 {
    margin: 0 0 .65rem;
    color: #0f172a;
    font-size: 1.16rem;
    font-weight: 800;
}

.erp-confirm-dialog p {
    margin: 0;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.8;
}

.erp-confirm-actions {
    display: flex;
    justify-content: center;
    gap: .65rem;
    margin-top: 1.5rem;
}

@keyframes erp-confirm-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes erp-confirm-overlay-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes erp-confirm-dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 575.98px) {
    html { font-size: 14px; }
    .crud-list-toolbar { align-items: stretch; flex-direction: column; }
    .crud-add-button { width: 100%; }
    .erp-confirm-dialog { padding: 1.5rem; }
}

/* ترويسة الصفحات */
.erp-page-header {
    margin-bottom: 1.5rem;
}

.page-icon-wrapper {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    color: #2563EB;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.erp-page-title {
    margin: 0;
    font-weight: 800;
    font-size: 1.5rem;
    color: #0F172A;
}

.erp-page-subtitle {
    margin: 0;
    color: #64748B;
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

/* الكروت (Cards) */
.erp-card {
    border-radius: 16px;
    background: #FFFFFF;
}

.text-primary-dark {
    color: #1E3A8A;
}

/* حقول الإدخال العصرية */
.custom-input {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    color: #334155;
    font-weight: 500;
}

    .custom-input:focus {
        background-color: #FFFFFF;
        border-color: #3B82F6;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }

/* مفتاح التبديل (Switch) */
.custom-switch .form-check-input {
    width: 2.8em;
    height: 1.4em;
    cursor: pointer;
}

    .custom-switch .form-check-input:checked {
        background-color: #10B981; /* أخضر زمردي جميل عند التفعيل */
        border-color: #10B981;
    }

/* أزرار الحفظ الأساسية */
.btn-primary {
    background-color: #2563EB;
    border-color: #2563EB;
    border-radius: 10px;
}

    .btn-primary:hover {
        background-color: #1D4ED8;
        border-color: #1D4ED8;
        transform: translateY(-1px);
    }

/* التنبيهات (Alerts) */
.alert-success-soft {
    background-color: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
}

.alert-danger-soft {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    border-radius: 12px;
}

/* الجدول الذكي (Smart Table) */
.erp-modern-table {
    width: 100%;
}

    .erp-modern-table th {
        background-color: #F8FAFC;
        color: #64748B;
        font-weight: 700;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 1rem;
        border-bottom: 2px solid #E2E8F0;
    }

    .erp-modern-table td {
        padding: 1rem;
        border-bottom: 1px solid #F1F5F9;
        color: #475569;
    }

.table-row-hover:hover td {
    background-color: #F8FAFC;
}

/* معاينة التقارير داخل النظام دون الحاجة إلى عارض PDF. */
.internal-report-viewer {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dbe5f0;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

.internal-report-viewer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.5rem;
    color: #ffffff;
    background: #173c73;
}

.internal-report-viewer__eyebrow {
    display: block;
    margin-bottom: .3rem;
    color: #bfdbfe;
    font-size: .78rem;
    font-weight: 800;
}

.internal-report-viewer__header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.internal-report-viewer__header p {
    margin: .45rem 0 0;
    color: #dbeafe;
    font-size: .84rem;
}

.internal-report-viewer__body { padding: 1.25rem; }

.internal-report-viewer__empty {
    padding: 3rem 1rem;
    color: #64748b;
    text-align: center;
}

.internal-report-viewer__empty i {
    display: block;
    margin-bottom: .6rem;
    color: #94a3b8;
    font-size: 1.7rem;
}

.internal-report-branch { margin-bottom: 1.35rem; }
.internal-report-branch:last-child { margin-bottom: 0; }

.internal-report-branch > h3 {
    margin: 0;
    padding: .7rem 1rem;
    color: #173c73;
    font-size: 1rem;
    font-weight: 800;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 8px 8px 0 0;
}

.internal-report-account {
    border: 1px solid #dbe5f0;
    border-top: 0;
}

.internal-report-account > h4 {
    margin: 0;
    padding: .75rem 1rem;
    color: #334155;
    font-size: .92rem;
    font-weight: 800;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.internal-report-subaccount { border-bottom: 1px solid #e2e8f0; }
.internal-report-subaccount:last-child { border-bottom: 0; }

.internal-report-subaccount__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1rem;
    background: #ffffff;
}

.internal-report-subaccount__header strong {
    display: block;
    margin-top: .1rem;
    color: #1e293b;
    font-size: .9rem;
}

.internal-report-balances {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
}

.internal-report-balances span {
    padding: .32rem .5rem;
    color: #64748b;
    font-size: .74rem;
    white-space: nowrap;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.internal-report-balances b {
    margin-inline-start: .25rem;
    color: #1e293b;
    font-family: Consolas, "Courier New", monospace;
}

.internal-report-movements thead th {
    padding: .65rem .8rem;
    color: #475569;
    font-size: .76rem;
    font-weight: 800;
    background: #f8fafc;
}

.internal-report-movements td { padding: .68rem .8rem; }

@media (max-width: 767.98px) {
    .internal-report-viewer__header,
    .internal-report-subaccount__header { align-items: stretch; flex-direction: column; }
    .internal-report-viewer__header .btn { width: 100%; }
    .internal-report-viewer__body { padding: .75rem; }
    .internal-report-balances { justify-content: flex-start; }
}

/* الشارات (Badges) */
.code-badge {
    background-color: #F1F5F9;
    color: #334155;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid #E2E8F0;
}

.bg-success-soft {
    background-color: #DCFCE7;
    color: #166534;
    padding: 0.4em 0.8em;
}

.bg-secondary-soft {
    background-color: #F1F5F9;
    color: #64748B;
    padding: 0.4em 0.8em;
}

/* لوحات التحكم التفاعلية */
.dashboard-hero {
    position: relative;
    overflow: hidden;
    padding: 1.8rem;
    color: #fff;
    background: linear-gradient(125deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    border-radius: 22px;
    box-shadow: 0 18px 38px rgba(30, 58, 138, .2);
}
.dashboard-hero::after { content: ''; position: absolute; inset: auto -7rem -11rem auto; width: 20rem; height: 20rem; background: rgba(255,255,255,.1); border-radius: 50%; }
.dashboard-hero h1 { position: relative; z-index: 1; margin: 0; font-size: clamp(1.55rem, 3vw, 2.2rem); font-weight: 800; }
.dashboard-hero p { position: relative; z-index: 1; max-width: 48rem; margin: .45rem 0 0; color: #dbeafe; line-height: 1.8; }
.dashboard-hero .btn { position: relative; z-index: 1; border-radius: 10px; font-weight: 700; }
.dashboard-kpi { height: 100%; padding: 1.2rem; background: #fff; border: 1px solid #e7eef8; border-radius: 18px; box-shadow: 0 8px 20px rgba(15, 23, 42, .045); transition: transform .2s ease, box-shadow .2s ease; }
.dashboard-kpi:hover { transform: translateY(-3px); box-shadow: 0 14px 25px rgba(15, 23, 42, .09); }
.dashboard-kpi__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: .8rem; color: #1d4ed8; font-size: 1.25rem; background: #eff6ff; border-radius: 13px; }
.dashboard-kpi--success .dashboard-kpi__icon { color: #047857; background: #ecfdf5; }
.dashboard-kpi--warning .dashboard-kpi__icon { color: #b45309; background: #fffbeb; }
.dashboard-kpi--violet .dashboard-kpi__icon { color: #6d28d9; background: #f5f3ff; }
.dashboard-kpi__label { display: block; color: #64748b; font-size: .84rem; font-weight: 700; }
.dashboard-kpi__value { display: block; margin-top: .2rem; color: #0f172a; font-size: 1.8rem; font-weight: 800; line-height: 1.35; }
.dashboard-kpi__hint { display: block; margin-top: .15rem; color: #94a3b8; font-size: .77rem; }
.dashboard-panel { height: 100%; overflow: hidden; background: #fff; border: 1px solid #e7eef8; border-radius: 18px; box-shadow: 0 8px 20px rgba(15, 23, 42, .04); }
.dashboard-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid #eef2f7; }
.dashboard-panel__header h2 { margin: 0; color: #1e293b; font-size: 1rem; font-weight: 800; }
.dashboard-action { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.15rem; color: #334155; text-decoration: none; border-bottom: 1px solid #f1f5f9; transition: background .18s ease, padding .18s ease; }
.dashboard-action:last-child { border-bottom: 0; }
.dashboard-action:hover { padding-inline-start: 1.35rem; color: #1d4ed8; background: #f8fbff; }
.dashboard-action i { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 35px; height: 35px; color: #2563eb; background: #eff6ff; border-radius: 10px; }
.dashboard-action small { display: block; margin-top: .1rem; color: #94a3b8; }
.dashboard-progress { height: 9px; overflow: hidden; background: #eaf0f8; border-radius: 999px; }
.dashboard-progress > span { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #38bdf8); border-radius: inherit; }
.dashboard-empty { padding: 2.25rem 1rem; color: #94a3b8; text-align: center; }
.dashboard-empty i { display: block; margin-bottom: .6rem; font-size: 1.6rem; }
@media (max-width: 575.98px) { .dashboard-hero { padding: 1.35rem; border-radius: 18px; } .dashboard-hero .btn { width: 100%; margin-top: .9rem !important; } }

/* أزرار العمليات المصغرة (Action Buttons) */
.crud-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 1.1rem;
}

.btn-action-edit {
    background-color: #EFF6FF;
    color: #2563EB;
}

    .btn-action-edit:hover {
        background-color: #2563EB;
        color: #FFFFFF;
        transform: translateY(-3px);
        box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    }

.btn-action-test {
    color: #0891b2;
    background-color: #ecfeff;
}

    .btn-action-test:hover:not(:disabled) {
        color: #ffffff;
        background-color: #0891b2;
        box-shadow: 0 4px 6px rgba(8, 145, 178, 0.2);
        transform: translateY(-3px);
    }

.btn-action-test:disabled {
    cursor: wait;
    opacity: .55;
}

.btn-action-delete {
    background-color: #FEF2F2;
    color: #EF4444;
}

    .btn-action-delete:hover {
        background-color: #EF4444;
        color: #FFFFFF;
        transform: translateY(-3px);
        box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
    }

    /* نظام التصميم الموحد لشاشات الإدارة */
    .content {
        max-width: 1680px;
        margin: 0 auto;
    }

    .erp-page-header {
        position: relative;
        display: flex;
        align-items: center;
        min-height: 86px;
        padding: 1.25rem 1.5rem;
        overflow: hidden;
        background: linear-gradient(115deg, #ffffff 0%, #f5f9ff 62%, #e7f0ff 100%);
        border: 1px solid #dbeafe;
        border-radius: 18px;
        box-shadow: 0 10px 30px rgba(30, 64, 175, 0.07);
    }

    .erp-page-header::after {
        position: absolute;
        top: -56px;
        left: -42px;
        width: 170px;
        height: 170px;
        content: '';
        pointer-events: none;
        background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 68%);
    }

    .erp-page-header > * {
        position: relative;
        z-index: 1;
    }

    .erp-page-header .page-icon-wrapper {
        width: 54px;
        height: 54px;
        color: #ffffff;
        background: linear-gradient(135deg, #2563eb, #0f4cbd);
        box-shadow: 0 10px 20px rgba(37, 99, 235, 0.23);
    }

    .erp-page-title {
        font-size: clamp(1.35rem, 2vw, 1.7rem);
        letter-spacing: -0.025em;
    }

    .erp-card {
        overflow: visible;
        border: 1px solid #e5edf7 !important;
        border-radius: 18px;
        box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055) !important;
        transition: box-shadow 0.2s ease, transform 0.2s ease;
    }

    .erp-card:hover {
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08) !important;
    }

    .erp-card > .card-header {
        padding: 1rem 1.25rem;
        font-weight: 800;
        color: #173c73;
        background: linear-gradient(90deg, #f8fbff, #ffffff);
        border-bottom: 1px solid #edf2f7;
    }

    .erp-card > .card-body {
        padding: 1.25rem;
    }

    /* دعم تلقائي للشاشات القديمة المبنية بمكونات Bootstrap القياسية. */
    article .card:not(.erp-card) {
        overflow: visible;
        border: 1px solid #e5edf7;
        border-radius: 16px;
        box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
    }

    article .card:not(.erp-card) > .card-header {
        padding: 0.95rem 1.2rem;
        font-weight: 800;
        color: #173c73;
        background: linear-gradient(90deg, #f8fbff, #ffffff);
        border-bottom: 1px solid #edf2f7;
    }

    article .card:not(.erp-card) > .card-body {
        padding: 1.2rem;
    }

    article .form-label,
    article label.form-label {
        margin-bottom: 0.45rem;
        color: #475569;
        font-size: 0.82rem;
        font-weight: 800;
    }

    article .form-control,
    article .form-select {
        min-height: 44px;
        color: #334155;
        border-color: #dbe5f0;
        border-radius: 10px;
        box-shadow: none;
    }

    article textarea.form-control {
        min-height: 96px;
    }

    article .form-control:focus,
    article .form-select:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    }

    article .table-responsive,
    article .erp-table-scroll {
        position: relative;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-gutter: stable;
        border: 1px solid #e5edf7;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.035);
    }

    article .table:not(.erp-modern-table) {
        margin-bottom: 0;
    }

    article .table:not(.erp-modern-table) thead th {
        padding: 0.9rem 1rem;
        color: #52647a;
        font-size: 0.82rem;
        font-weight: 800;
        background: #f8fbff;
        border-bottom-color: #dfe9f5;
    }

    article .table:not(.erp-modern-table) td {
        padding: 0.85rem 1rem;
        vertical-align: middle;
        border-bottom-color: #edf2f7;
    }

    article .table:not(.erp-modern-table) tbody tr:hover {
        background: #f8fbff;
    }

    .erp-form-grid > [class*='col-'] {
        position: relative;
    }

    .erp-form-grid .form-label {
        margin-bottom: 0.45rem;
        color: #475569 !important;
        font-size: 0.8rem;
        font-weight: 800 !important;
    }

    .erp-form-grid .form-control,
    .erp-form-grid .form-select,
    .input-group .form-control,
    .input-group .form-select {
        min-height: 44px;
        border-color: #dbe5f0;
        border-radius: 10px;
        box-shadow: none;
    }

    .erp-form-grid .form-control:focus,
    .erp-form-grid .form-select:focus,
    .input-group .form-control:focus,
    .input-group .form-select:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    }

    .erp-table,
    .erp-modern-table {
        margin-bottom: 0;
    }

    .erp-table thead th,
    .erp-modern-table thead th {
        color: #52647a;
        background: #f8fbff;
        border-bottom-color: #dfe9f5;
    }

    .erp-table tbody tr,
    .erp-modern-table tbody tr {
        transition: background-color 0.18s ease, transform 0.18s ease;
    }

    .erp-table tbody tr:hover,
    .erp-modern-table tbody tr:hover {
        background: #f8fbff;
    }

    .erp-table td,
    .erp-modern-table td {
        vertical-align: middle;
    }

    /* تصميم موحد لقوائم البيانات: رأس واضح، أعمدة مفصولة، وصفوف سهلة المسح. */
    article .table-responsive > table,
    article .erp-table-scroll > table {
        border-collapse: separate;
        border-spacing: 0;
    }

    article .table-responsive > table thead th,
    article .erp-table-scroll > table thead th {
        padding: 0.9rem 1rem;
        color: #ffffff !important;
        font-size: 0.82rem;
        font-weight: 800;
        white-space: nowrap;
        background: #0f766e !important;
        border-color: rgba(255, 255, 255, 0.24) !important;
        border-bottom: 2px solid #115e59 !important;
    }

    article .table-responsive > table thead th + th,
    article .erp-table-scroll > table thead th + th {
        border-right: 1px solid rgba(255, 255, 255, 0.24);
    }

    article .table-responsive > table tbody td,
    article .erp-table-scroll > table tbody td {
        padding: 0.82rem 1rem;
        color: #334155;
        border-bottom: 1px solid #dbe7e5;
        border-left: 1px solid #e7f0ee;
    }

    article .table-responsive > table tbody tr:nth-child(even),
    article .erp-table-scroll > table tbody tr:nth-child(even) {
        background: #f5fbfa;
    }

    article .table-responsive > table tbody tr:hover,
    article .erp-table-scroll > table tbody tr:hover {
        background: #e8f5f2 !important;
        box-shadow: inset 4px 0 0 #f59e0b;
    }

    article .table-responsive > table tfoot th,
    article .table-responsive > table tfoot td,
    article .erp-table-scroll > table tfoot th,
    article .erp-table-scroll > table tfoot td {
        padding: 0.82rem 1rem;
        color: #134e4a;
        font-weight: 800;
        background: #ecfdf5;
        border-color: #b7e4da;
    }

    @media (max-width: 767.98px) {
        article .table-responsive,
        article .erp-table-scroll {
            padding-bottom: 0.65rem;
            scrollbar-width: auto;
            scrollbar-color: #64748b #e2e8f0;
        }

        article .table-responsive::-webkit-scrollbar,
        article .erp-table-scroll::-webkit-scrollbar {
            height: 12px;
        }

        article .table-responsive::-webkit-scrollbar-track,
        article .erp-table-scroll::-webkit-scrollbar-track {
            background: #e2e8f0;
            border-radius: 999px;
        }

        article .table-responsive::-webkit-scrollbar-thumb,
        article .erp-table-scroll::-webkit-scrollbar-thumb {
            background: #64748b;
            border: 3px solid #e2e8f0;
            border-radius: 999px;
        }

        article .table-responsive > table,
        article .erp-table-scroll > table {
            width: max-content;
            min-width: 100%;
        }

        article .table-responsive > table th,
        article .table-responsive > table td,
        article .erp-table-scroll > table th,
        article .erp-table-scroll > table td {
            white-space: nowrap;
        }
    }

    /* قائمة قابلة للبحث: يظهر مربع البحث أولاً عند فتح أي قائمة في النظام. */
    .searchable-select {
        position: relative;
        width: 100%;
        min-width: 0;
    }

    .searchable-select-native {
        display: none !important;
    }

    .searchable-select-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 44px;
        padding: 0.55rem 0.85rem;
        overflow: hidden;
        color: #334155;
        font: inherit;
        font-weight: 600;
        text-align: right;
        cursor: pointer;
        background: #ffffff;
        border: 1px solid #dbe5f0;
        border-radius: 10px;
        transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    }

    .searchable-select-trigger:hover {
        background: #f8fbff;
        border-color: #93c5fd;
    }

    .searchable-select.is-open .searchable-select-trigger,
    .searchable-select-trigger:focus-visible {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.13);
    }

    .searchable-select-value {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .searchable-select-trigger.is-placeholder,
    .searchable-select-option.is-placeholder {
        color: #64748b;
    }

    .searchable-select-chevron {
        flex: 0 0 auto;
        margin-right: 0.75rem;
        color: #64748b;
        font-size: 0.75rem;
        transition: transform 0.2s ease;
    }

    .searchable-select.is-open .searchable-select-chevron {
        transform: rotate(180deg);
    }

    .searchable-select-panel {
        position: absolute;
        z-index: 1080;
        top: calc(100% + 0.45rem);
        right: 0;
        left: 0;
        display: none;
        padding: 0.6rem;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid #cbdcf0;
        border-radius: 13px;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.17);
        backdrop-filter: blur(12px);
    }

    .searchable-select.is-open .searchable-select-panel {
        display: block;
        animation: searchable-select-enter 0.16s ease-out;
    }

    .searchable-select-search-wrap {
        position: relative;
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
    }

    .searchable-select-search-wrap > i {
        position: absolute;
        right: 0.75rem;
        color: #64748b;
    }

    .searchable-select-search {
        width: 100%;
        min-height: 40px;
        padding: 0.45rem 2.2rem 0.45rem 0.75rem;
        color: #1e293b;
        background: #f8fafc;
        border: 1px solid #dbe5f0;
        border-radius: 9px;
        outline: none;
    }

    .searchable-select-search:focus {
        background: #ffffff;
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.11);
    }

    .searchable-select-options {
        max-height: 235px;
        padding-left: 0.15rem;
        overflow-y: auto;
    }

    .searchable-select-option {
        display: block;
        width: 100%;
        padding: 0.62rem 0.75rem;
        color: #334155;
        text-align: right;
        cursor: pointer;
        background: transparent;
        border: 0;
        border-radius: 8px;
        transition: background-color 0.14s ease, color 0.14s ease;
    }

    .searchable-select-option:hover,
    .searchable-select-option:focus-visible {
        color: #1d4ed8;
        outline: none;
        background: #eff6ff;
    }

    .searchable-select-option.is-selected {
        color: #1d4ed8;
        font-weight: 800;
        background: #dbeafe;
    }

    .searchable-select-option:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }

    .searchable-select-empty {
        padding: 1rem;
        color: #64748b;
        font-size: 0.9rem;
        text-align: center;
    }

    @keyframes searchable-select-enter {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @media (max-width: 768px) {
        .erp-page-header {
            min-height: 72px;
            padding: 1rem;
            border-radius: 14px;
        }

        .erp-card {
            border-radius: 14px;
        }
    }

/* ========================================================================== */
/* Biometric command design system                                            */
/* ========================================================================== */
:root {
    --bio-ink: #102b30;
    --bio-deep: #082f36;
    --bio-teal: #0f766e;
    --bio-mint: #43b99e;
    --bio-copper: #d6923b;
    --bio-paper: #f3f7f6;
    --bio-line: #d6e4e0;
}

html, body { color: var(--bio-ink); background: var(--bio-paper); }

.login-host { min-height: 100vh; }

#blazor-error-ui {
    position: fixed;
    z-index: 3000;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    padding: .7rem 1.25rem;
    color: #713f12;
    background: #fef3c7;
    border-top: 1px solid #fcd34d;
    box-shadow: 0 -8px 24px rgba(16, 43, 48, .12);
}

#blazor-error-ui .dismiss { position: absolute; top: .55rem; left: .75rem; cursor: pointer; }

.erp-content-scroll {
    background-color: var(--bio-paper);
    background-image: linear-gradient(rgba(15, 118, 110, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 118, 110, .025) 1px, transparent 1px);
    background-size: 28px 28px;
}

.brand-emblem--biometric { position: relative; font-size: 1.45rem; background: var(--bio-teal); }
.brand-emblem--biometric span { position: absolute; inset: -5px; border: 1px solid rgba(15, 118, 110, .25); border-radius: 11px; animation: bio-mark-pulse 2.5s ease-out infinite; }

.header-biometric-link {
    align-items: center;
    gap: .65rem;
    min-width: 190px;
    min-height: 46px;
    padding: .38rem .62rem;
    color: #24484d;
    text-decoration: none;
    background: #f2f9f7;
    border: 1px solid #cce3dd;
    border-radius: 8px;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.header-biometric-link:hover { color: #0b5f59; background: #fff; border-color: #7ec3b5; transform: translateY(-1px); }
.header-biometric-link__signal { display: grid; width: 32px; height: 32px; place-items: center; flex: 0 0 auto; color: #fff; background: var(--bio-teal); border-radius: 7px; }
.header-biometric-link > span:nth-child(2) { display: flex; flex: 1; min-width: 0; flex-direction: column; line-height: 1.2; }
.header-biometric-link small { color: #71898b; font-size: .62rem; font-weight: 800; }
.header-biometric-link strong { margin-top: .18rem; color: #193f43; font-size: .76rem; white-space: nowrap; }
.header-biometric-link > i { color: var(--bio-copper); font-size: .75rem; }

.sidebar-biometric-status {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: .6rem;
    margin-top: 1rem;
    padding: .65rem;
    color: #d9f2ec;
    text-decoration: none;
    background: #103c40;
    border: 1px solid #25585a;
    border-radius: 8px;
}
.sidebar-biometric-status:hover { color: #fff; background: #0d4d4d; }
.sidebar-biometric-status > span { display: grid; width: 36px; height: 36px; place-items: center; color: #f4bd67; background: #092c30; border-radius: 7px; }
.sidebar-biometric-status div { display: flex; min-width: 0; flex-direction: column; line-height: 1.2; }
.sidebar-biometric-status strong { font-size: .78rem; }
.sidebar-biometric-status small { margin-top: .2rem; color: #9bc6be; font-size: .63rem; white-space: nowrap; }
.sidebar-biometric-status > i { color: #f4bd67; font-size: .7rem; }

.erp-page-header, .erp-card, article .card:not(.erp-card), article .table-responsive, article .erp-table-scroll, .dashboard-panel, .dashboard-kpi { border-radius: 8px !important; }
.erp-page-header { background: #fff; border-color: var(--bio-line); box-shadow: 0 8px 24px rgba(16, 43, 48, .06); }
.erp-page-header::after { display: none; }
.erp-page-header .page-icon-wrapper { color: #fff !important; background: var(--bio-teal) !important; border-radius: 8px; box-shadow: 0 8px 18px rgba(15, 118, 110, .2); }
.erp-page-title { color: var(--bio-ink); letter-spacing: 0; }
.erp-card, article .card:not(.erp-card) { border-color: var(--bio-line) !important; box-shadow: 0 8px 24px rgba(16, 43, 48, .05) !important; }
.erp-card > .card-header, article .card:not(.erp-card) > .card-header { color: #174d4c; background: #f7faf9; border-bottom-color: #e4eeeb; }
.custom-input, article .form-control, article .form-select, .searchable-select-trigger { border-radius: 7px; }
.custom-input:focus, article .form-control:focus, article .form-select:focus { border-color: var(--bio-teal); box-shadow: 0 0 0 4px rgba(15, 118, 110, .11); }
.btn { border-radius: 7px; }
.btn-primary { background: var(--bio-teal); border-color: var(--bio-teal); }
.btn-primary:hover, .btn-primary:focus { background: #0b625c; border-color: #0b625c; }
article .table-responsive > table thead th, article .erp-table-scroll > table thead th { background: var(--bio-deep) !important; border-bottom-color: #051f24 !important; }
article .table-responsive > table tbody tr:hover, article .erp-table-scroll > table tbody tr:hover { background: #edf8f5 !important; box-shadow: inset 3px 0 0 var(--bio-copper); }

.command-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
    align-items: center;
    min-height: 405px;
    overflow: hidden;
    color: #fff;
    background-color: var(--bio-deep);
    background-image: linear-gradient(rgba(158, 219, 206, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(158, 219, 206, .045) 1px, transparent 1px), linear-gradient(120deg, #082c32 0%, #0c4142 66%, #183941 100%);
    background-size: 30px 30px, 30px 30px, auto;
    border: 1px solid #28545a;
    border-radius: 8px;
    box-shadow: 0 22px 50px rgba(8, 47, 54, .2);
}
.command-hero__copy { position: relative; z-index: 2; padding: clamp(2rem, 5vw, 4.2rem); }
.command-eyebrow { display: inline-flex; align-items: center; gap: .55rem; padding: .46rem .7rem; color: #c3ece3; font-size: .75rem; font-weight: 800; background: rgba(3, 27, 30, .42); border: 1px solid rgba(160, 221, 208, .24); border-radius: 7px; }
.live-dot { width: 8px; height: 8px; background: #55e0b0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(85, 224, 176, .52); animation: bio-live-pulse 1.8s ease-out infinite; }
.command-hero h1 { max-width: 680px; margin: 1.15rem 0 .75rem; font-size: clamp(2rem, 4vw, 3.35rem); font-weight: 900; line-height: 1.32; letter-spacing: 0; }
.command-hero h1 strong { display: block; color: #f4bd67; }
.command-hero p { max-width: 620px; margin: 0; color: #c7dfdc; font-size: 1rem; line-height: 1.9; }
.command-hero__actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.6rem; }
.command-hero__actions .btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 46px; padding: .6rem 1rem; font-weight: 800; }
.command-primary { color: #123235; background: #f4bd67; border-color: #f4bd67; }
.command-primary:hover { color: #102b30; background: #ffd285; border-color: #ffd285; }
.command-secondary { color: #e5f4f1; background: rgba(255, 255, 255, .07); border-color: rgba(204, 234, 228, .28); }
.command-secondary:hover { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(204, 234, 228, .5); }

.biometric-stage { position: relative; width: min(100%, 520px); height: clamp(330px, 26vw, 370px); margin: 1.25rem auto; overflow: hidden; }
.stage-grid { position: absolute; inset: 8%; background-image: linear-gradient(rgba(153, 223, 207, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(153, 223, 207, .055) 1px, transparent 1px); background-size: 22px 22px; border: 1px solid rgba(151, 211, 198, .1); border-radius: 8px; }
.scan-beam { position: absolute; z-index: 3; top: 15%; right: 8%; left: 8%; height: 1px; background: linear-gradient(90deg, transparent, #f4bd67, transparent); box-shadow: 0 0 14px #f4bd67; animation: bio-stage-scan 4s ease-in-out infinite; }
.fingerprint-orbit { position: absolute; top: 50%; left: 50%; border: 1px dashed rgba(105, 216, 191, .34); border-radius: 50%; transform: translate(-50%, -50%); }
.fingerprint-orbit--outer { width: 235px; height: 235px; animation: bio-orbit 18s linear infinite; }
.fingerprint-orbit--inner { width: 176px; height: 176px; border-style: solid; border-color: rgba(244, 189, 103, .28); animation: bio-orbit-reverse 12s linear infinite; }
.fingerprint-core { position: absolute; z-index: 2; top: 50%; left: 50%; display: grid; width: 126px; height: 126px; place-items: center; color: #e9fff9; font-size: 4.6rem; background: #09272c; border: 1px solid #4c8d85; border-radius: 50%; box-shadow: 0 0 36px rgba(83, 216, 183, .19); transform: translate(-50%, -50%); }
.signal-node { position: absolute; z-index: 4; display: grid; width: 58px; height: 58px; place-items: center; color: #b9e9de; font-size: 1.25rem; background: #123b40; border: 1px solid #397068; border-radius: 8px; box-shadow: 0 9px 24px rgba(0, 16, 18, .3); }
.signal-node small { position: absolute; top: calc(100% + .35rem); color: #a8cbc5; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.signal-node--device { top: 14%; right: 12%; }
.signal-node--cloud { top: 15%; left: 12%; color: #f4bd67; border-color: #866a3c; }
.signal-node--system { bottom: 15%; left: 50%; color: #fff; transform: translateX(-50%); }
.data-packet { position: absolute; z-index: 5; width: 8px; height: 8px; background: #67d7bd; border-radius: 50%; box-shadow: 0 0 12px #67d7bd; }
.data-packet--one { top: 25%; right: 24%; animation: bio-packet-one 3s ease-in-out infinite; }
.data-packet--two { bottom: 25%; left: 49%; background: #f4bd67; box-shadow: 0 0 12px #f4bd67; animation: bio-packet-two 2.7s ease-in-out infinite; }
.stage-status { position: absolute; z-index: 5; right: 50%; bottom: 4%; display: flex; align-items: center; gap: .45rem; min-width: max-content; padding: .45rem .7rem; color: #cbe5df; font-size: .68rem; font-weight: 800; background: rgba(5, 28, 31, .78); border: 1px solid rgba(179, 224, 214, .17); border-radius: 7px; transform: translateX(50%); }
.stage-status span { width: 7px; height: 7px; border-radius: 50%; }
.stage-status .is-online { background: #55e0b0; box-shadow: 0 0 8px #55e0b0; }
.stage-status .is-offline { background: #e6a64d; box-shadow: 0 0 8px #e6a64d; }

.biometric-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.biometric-kpi { display: flex; align-items: center; gap: .9rem; min-height: 118px; padding: 1rem; background: #fff; border: 1px solid var(--bio-line); border-radius: 8px; box-shadow: 0 8px 22px rgba(16, 43, 48, .045); }
.biometric-kpi__icon { display: grid; width: 48px; height: 48px; place-items: center; flex: 0 0 auto; color: var(--bio-teal); font-size: 1.3rem; background: #edf8f5; border-radius: 8px; }
.biometric-kpi > div { display: flex; min-width: 0; flex-direction: column; }
.biometric-kpi small { color: #718487; font-size: .7rem; font-weight: 800; }
.biometric-kpi strong { margin: .1rem 0; color: var(--bio-ink); font-size: 1.65rem; line-height: 1.2; }
.biometric-kpi span:not(.biometric-kpi__icon) { overflow: hidden; color: #91a1a2; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.biometric-kpi--live .biometric-kpi__icon { color: #fff; background: var(--bio-teal); }
.biometric-kpi--amber .biometric-kpi__icon { color: #985f19; background: #fff4e2; }

.ops-panel { overflow: hidden; background: #fff; border: 1px solid var(--bio-line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 43, 48, .045); }
.ops-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid #e7efed; }
.ops-panel__header > div > span { color: var(--bio-teal); font-size: .66rem; font-weight: 900; }
.ops-panel__header h2 { margin: .22rem 0 0; color: var(--bio-ink); font-size: 1rem; font-weight: 900; }
.ops-panel__mark { color: var(--bio-copper); font-size: 1.2rem; }
.ops-health { display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .55rem; font-size: .65rem; font-weight: 800; border-radius: 6px; }
.ops-health--up { color: #087052; background: #eaf8f3; }
.ops-health--down { color: #985f19; background: #fff4e2; }
.sync-pipeline { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: .55rem; padding: 1.25rem; }
.pipeline-step { position: relative; display: flex; min-width: 0; min-height: 145px; padding: 1rem; flex-direction: column; justify-content: center; color: #31565a; text-decoration: none; background: #f7faf9; border: 1px solid #dce9e6; border-radius: 8px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.pipeline-step:hover { color: #174d4c; border-color: #8fc7ba; box-shadow: 0 9px 20px rgba(15, 118, 110, .09); transform: translateY(-2px); }
.pipeline-step--active { color: #eefaf7; background: var(--bio-deep); border-color: var(--bio-deep); }
.pipeline-step--active:hover { color: #fff; }
.pipeline-step__number { position: absolute; top: .65rem; left: .65rem; color: #9db1b0; font-size: .62rem; font-weight: 900; }
.pipeline-step > i { margin-bottom: .7rem; color: var(--bio-copper); font-size: 1.35rem; }
.pipeline-step strong { font-size: .82rem; }
.pipeline-step small { margin-top: .28rem; color: #879b9c; font-size: .65rem; line-height: 1.5; }
.pipeline-step--active small { color: #a9cbc5; }
.pipeline-link { display: grid; place-items: center; color: #91aaa7; }
.last-sync-strip { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: .75rem; margin: 0 1.25rem 1.25rem; padding: .85rem; background: #eef8f5; border: 1px solid #cfe6df; border-radius: 8px; }
.last-sync-strip__icon { display: grid; width: 40px; height: 40px; place-items: center; color: #fff; background: var(--bio-teal); border-radius: 7px; }
.last-sync-strip > div { display: flex; min-width: 0; flex-direction: column; }
.last-sync-strip small { color: #718b88; font-size: .65rem; font-weight: 800; }
.last-sync-strip strong { overflow: hidden; margin-top: .15rem; color: #174d4c; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.last-sync-strip__count { align-items: center; padding-inline-start: .8rem; border-inline-start: 1px solid #c6ddd7; }
.last-sync-strip__count strong { color: var(--bio-copper); font-size: 1.15rem; }
.command-links { display: flex; flex-direction: column; }
.command-links a { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: .75rem; min-height: 72px; padding: .75rem 1.15rem; color: #31565a; text-decoration: none; border-bottom: 1px solid #edf2f1; transition: color .18s ease, background-color .18s ease; }
.command-links a:last-child { border-bottom: 0; }
.command-links a:hover { color: var(--bio-teal); background: #f3f9f7; }
.command-links > a > i:first-child { display: grid; width: 40px; height: 40px; place-items: center; color: var(--bio-teal); background: #edf8f5; border-radius: 7px; }
.command-links > a > i:last-child { color: var(--bio-copper); }
.command-links span { display: flex; min-width: 0; flex-direction: column; }
.command-links strong { font-size: .8rem; }
.command-links small { margin-top: .18rem; overflow: hidden; color: #8a9b9c; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }

/* HR command center */
.hr-command-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    align-items: center;
    min-height: 355px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(118deg, #082f36 0%, #0d4645 64%, #183b41 100%);
    border: 1px solid #28565a;
    border-radius: 8px;
    box-shadow: 0 20px 46px rgba(8, 47, 54, .18);
}
.hr-command-hero::before { position: absolute; inset: 0; content: ''; pointer-events: none; background-image: linear-gradient(rgba(157, 221, 207, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(157, 221, 207, .045) 1px, transparent 1px); background-size: 28px 28px; }
.hr-command-hero__copy { position: relative; z-index: 2; padding: clamp(2rem, 4vw, 3.4rem); }
.hr-command-eyebrow { display: inline-flex; align-items: center; gap: .55rem; padding: .42rem .68rem; color: #c7ebe3; font-size: .7rem; font-weight: 900; background: rgba(3, 27, 30, .4); border: 1px solid rgba(160, 221, 208, .22); border-radius: 7px; }
.hr-command-hero h1 { max-width: 660px; margin: 1rem 0 .7rem; font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 900; line-height: 1.32; letter-spacing: 0; }
.hr-command-hero h1 strong { display: block; color: #f4bd67; }
.hr-command-hero p { max-width: 620px; margin: 0; color: #c6ded9; font-size: .94rem; line-height: 1.9; }
.hr-command-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.45rem; }
.hr-command-actions .btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .58rem 1rem; font-weight: 800; }

.hr-attendance-visual { position: relative; z-index: 1; width: min(calc(100% - 2.5rem), 455px); height: 295px; margin: 1.5rem auto; overflow: hidden; background: rgba(4, 30, 33, .6); border: 1px solid rgba(151, 211, 198, .22); border-radius: 8px; box-shadow: 0 18px 38px rgba(0, 19, 21, .25); }
.hr-visual-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(153, 223, 207, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(153, 223, 207, .045) 1px, transparent 1px); background-size: 20px 20px; }
.hr-visual-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: .75rem .9rem; color: #b8d8d2; font-size: .65rem; font-weight: 800; border-bottom: 1px solid rgba(151, 211, 198, .13); }
.hr-visual-head span { display: inline-flex; align-items: center; gap: .4rem; }
.hr-visual-head span i { color: #55e0b0; }
.hr-visual-head strong { color: #789b98; font-family: Consolas, monospace; font-size: .62rem; }
.hr-fingerprint-radar { position: absolute; top: 48%; right: 29%; display: grid; width: 118px; height: 118px; place-items: center; color: #e9fff9; font-size: 4rem; background: #08272c; border: 1px solid #4b8d84; border-radius: 50%; box-shadow: 0 0 34px rgba(83, 216, 183, .18); transform: translate(50%, -50%); }
.hr-radar-ring { position: absolute; top: 50%; left: 50%; border: 1px dashed rgba(105, 216, 191, .32); border-radius: 50%; transform: translate(-50%, -50%); }
.hr-radar-ring--outer { width: 172px; height: 172px; animation: bio-orbit 18s linear infinite; }
.hr-radar-ring--inner { width: 142px; height: 142px; border-style: solid; border-color: rgba(244, 189, 103, .2); animation: bio-orbit-reverse 12s linear infinite; }
.hr-radar-scan { position: absolute; z-index: 2; right: 13px; left: 13px; height: 1px; background: #f4bd67; box-shadow: 0 0 10px #f4bd67; animation: hr-radar-scan 2.8s ease-in-out infinite; }
.hr-live-count { position: absolute; top: 44%; left: 9%; display: flex; flex-direction: column; transform: translateY(-50%); }
.hr-live-count strong { color: #f4bd67; font-size: 2.25rem; font-weight: 900; line-height: 1; }
.hr-live-count span { margin-top: .38rem; color: #a9c9c3; font-size: .65rem; font-weight: 800; }
.hr-visual-summary { position: absolute; z-index: 2; right: .85rem; bottom: .8rem; left: .85rem; display: grid; grid-template-columns: repeat(3, 1fr); padding: .62rem; background: rgba(12, 58, 61, .74); border: 1px solid rgba(151, 211, 198, .14); border-radius: 7px; backdrop-filter: blur(6px); }
.hr-visual-summary > span { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: .12rem .38rem; padding: 0 .45rem; border-inline-start: 1px solid rgba(151, 211, 198, .13); }
.hr-visual-summary > span:last-child { border-inline-start: 0; }
.hr-visual-summary i { grid-row: 1 / 3; color: #65cdb6; }
.hr-visual-summary strong { color: #fff; font-size: .82rem; }
.hr-visual-summary small { color: #94b5af; font-size: .56rem; }

.hr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.hr-kpi { position: relative; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: .85rem; min-height: 112px; padding: 1rem; overflow: hidden; background: #fff; border: 1px solid var(--bio-line); border-radius: 8px; box-shadow: 0 8px 22px rgba(16, 43, 48, .045); }
.hr-kpi__icon { display: grid; width: 48px; height: 48px; place-items: center; color: var(--bio-teal); font-size: 1.25rem; background: #edf8f5; border-radius: 8px; }
.hr-kpi > div { display: flex; min-width: 0; flex-direction: column; }
.hr-kpi small { color: #718487; font-size: .68rem; font-weight: 800; }
.hr-kpi strong { margin: .08rem 0; color: var(--bio-ink); font-size: 1.62rem; line-height: 1.2; }
.hr-kpi div span { overflow: hidden; color: #91a1a2; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.hr-kpi__trend { align-self: start; color: #a5b7b5; font-size: .8rem; }
.hr-kpi--live { color: #fff; background: var(--bio-teal); border-color: var(--bio-teal); }
.hr-kpi--live .hr-kpi__icon { color: #fff; background: rgba(255, 255, 255, .13); }
.hr-kpi--live small, .hr-kpi--live div span { color: #c7e9e2; }
.hr-kpi--live strong { color: #fff; }
.hr-kpi__pulse { position: absolute; top: .75rem; left: .75rem; width: 8px; height: 8px; background: #74edc5; border-radius: 50%; animation: bio-live-pulse 1.8s ease-out infinite; }
.hr-kpi--copper .hr-kpi__icon { color: #985f19; background: #fff4e2; }

.hr-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 1rem; }
.hr-workflow-panel, .hr-leave-panel, .hr-quick-panel { overflow: hidden; background: #fff; border: 1px solid var(--bio-line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 43, 48, .045); }
.hr-workflow-panel { grid-column: 1; }
.hr-leave-panel { grid-column: 2; }
.hr-quick-panel { grid-column: 1 / -1; }
.hr-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 70px; padding: 1rem 1.15rem; border-bottom: 1px solid #e7efed; }
.hr-panel-header > div > span { color: var(--bio-teal); font-size: .64rem; font-weight: 900; }
.hr-panel-header h2 { margin: .18rem 0 0; color: var(--bio-ink); font-size: .98rem; font-weight: 900; }
.hr-panel-header > a { display: inline-flex; align-items: center; gap: .35rem; color: var(--bio-teal); font-size: .68rem; font-weight: 800; text-decoration: none; }
.hr-panel-header > i { color: var(--bio-copper); }
.hr-attendance-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: .55rem; padding: 1.15rem; }
.hr-flow-step { position: relative; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: .65rem; min-height: 96px; padding: .85rem; color: #31565a; text-decoration: none; background: #f7faf9; border: 1px solid #dce9e6; border-radius: 8px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.hr-flow-step:hover { color: #174d4c; border-color: #8fc7ba; box-shadow: 0 9px 20px rgba(15, 118, 110, .09); transform: translateY(-2px); }
.hr-flow-step > span { position: absolute; top: .45rem; left: .5rem; color: #9db1b0; font-size: .55rem; font-weight: 900; }
.hr-flow-step > i { display: grid; width: 38px; height: 38px; place-items: center; color: var(--bio-teal); background: #e9f6f2; border-radius: 7px; }
.hr-flow-step div { display: flex; min-width: 0; flex-direction: column; }
.hr-flow-step strong { font-size: .75rem; }
.hr-flow-step small { margin-top: .22rem; color: #879b9c; font-size: .58rem; line-height: 1.45; }
.hr-flow-step--active { color: #eefaf7; background: var(--bio-deep); border-color: var(--bio-deep); }
.hr-flow-step--active:hover { color: #fff; }
.hr-flow-step--active > i { color: #172f31; background: #f4bd67; }
.hr-flow-step--active small { color: #a9cbc5; }
.hr-flow-arrow { color: #91aaa7; }
.hr-workflow-note { display: flex; align-items: center; gap: .7rem; margin: 0 1.15rem 1.15rem; padding: .75rem .85rem; color: #1b5954; background: #eef8f5; border: 1px solid #cfe6df; border-radius: 7px; }
.hr-workflow-note > i { color: var(--bio-teal); }
.hr-workflow-note span { display: flex; flex-direction: column; }
.hr-workflow-note strong { font-size: .72rem; }
.hr-workflow-note small { margin-top: .15rem; color: #718b88; font-size: .62rem; }
.hr-leave-metrics { display: grid; grid-template-columns: repeat(3, 1fr); padding: 1.15rem; }
.hr-leave-metrics > div { display: flex; min-width: 0; padding: .25rem .7rem; flex-direction: column; border-inline-start: 1px solid #e4eeeb; }
.hr-leave-metrics > div:last-child { border-inline-start: 0; }
.hr-leave-metrics span { color: #718487; font-size: .62rem; font-weight: 800; }
.hr-leave-metrics strong { margin: .2rem 0; color: var(--bio-ink); font-size: 1.5rem; }
.hr-leave-metrics small { color: #9aa8a8; font-size: .57rem; }
.hr-panel-action { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: .65rem; margin: 0 1.15rem 1.15rem; padding: .75rem; color: #31565a; text-decoration: none; background: #f7faf9; border: 1px solid #dce9e6; border-radius: 7px; }
.hr-panel-action:hover { color: var(--bio-teal); background: #edf8f5; }
.hr-panel-action > i:first-child { display: grid; width: 38px; height: 38px; place-items: center; color: #985f19; background: #fff4e2; border-radius: 7px; }
.hr-panel-action span { display: flex; flex-direction: column; }
.hr-panel-action strong { font-size: .72rem; }
.hr-panel-action small { margin-top: .15rem; color: #8a9b9c; font-size: .59rem; }
.hr-panel-action > i:last-child { color: var(--bio-copper); }
.hr-quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.hr-quick-grid a { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: .7rem; min-height: 88px; padding: .9rem 1.1rem; color: #31565a; text-decoration: none; border-inline-start: 1px solid #edf2f1; transition: color .18s ease, background-color .18s ease; }
.hr-quick-grid a:last-child { border-inline-start: 0; }
.hr-quick-grid a:hover { color: var(--bio-teal); background: #f3f9f7; }
.hr-quick-grid > a > i { display: grid; width: 42px; height: 42px; place-items: center; color: var(--bio-teal); background: #edf8f5; border-radius: 7px; }
.hr-quick-grid span { display: flex; min-width: 0; flex-direction: column; }
.hr-quick-grid strong { font-size: .75rem; }
.hr-quick-grid small { margin-top: .18rem; color: #8a9b9c; font-size: .6rem; }

@keyframes hr-radar-scan { 0%, 100% { top: 22%; opacity: .25; } 50% { top: 78%; opacity: 1; } }

@keyframes bio-live-pulse { 70% { box-shadow: 0 0 0 8px rgba(85, 224, 176, 0); } 100% { box-shadow: 0 0 0 0 rgba(85, 224, 176, 0); } }
@keyframes bio-mark-pulse { from { transform: scale(.92); opacity: .75; } to { transform: scale(1.22); opacity: 0; } }
@keyframes bio-stage-scan { 0%, 100% { top: 15%; opacity: .2; } 50% { top: 82%; opacity: 1; } }
@keyframes bio-orbit { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes bio-orbit-reverse { from { transform: translate(-50%, -50%) rotate(360deg); } to { transform: translate(-50%, -50%) rotate(0); } }
@keyframes bio-packet-one { 0%, 100% { top: 25%; right: 24%; opacity: 0; } 45% { top: 43%; right: 43%; opacity: 1; } 70% { top: 48%; right: 48%; opacity: 0; } }
@keyframes bio-packet-two { 0%, 100% { bottom: 25%; left: 49%; opacity: 0; } 45% { bottom: 39%; left: 49%; opacity: 1; } 80% { bottom: 47%; left: 49%; opacity: 0; } }

@media (max-width: 1199.98px) {
    .command-hero { grid-template-columns: 1fr 360px; }
    .biometric-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hr-command-hero { grid-template-columns: 1fr 350px; }
    .hr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hr-dashboard-grid { grid-template-columns: 1fr; }
    .hr-workflow-panel, .hr-leave-panel, .hr-quick-panel { grid-column: 1; }
}

@media (max-width: 991.98px) {
    .command-hero { grid-template-columns: 1fr; }
    .biometric-stage { width: min(100%, 440px); height: 330px; margin-top: -1rem; }
    .hr-command-hero { grid-template-columns: 1fr; }
    .hr-attendance-visual { margin-top: -.5rem; }
    .hr-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .hr-quick-grid a:nth-child(2) { border-inline-start: 0; }
    .hr-quick-grid a:nth-child(-n+2) { border-bottom: 1px solid #edf2f1; }
}

@media (max-width: 767.98px) {
    .command-hero { min-height: 0; }
    .command-hero__copy { padding: 1.5rem; }
    .command-hero h1 { font-size: 2rem; }
    .biometric-stage { height: 305px; margin-bottom: 1rem; transform: scale(.9); transform-origin: center; }
    .sync-pipeline { grid-template-columns: 1fr; }
    .pipeline-link { height: 18px; transform: rotate(-90deg); }
    .pipeline-step { min-height: 110px; }
    .hr-command-hero { min-height: 0; }
    .hr-command-hero__copy { padding: 1.5rem; }
    .hr-command-hero h1 { font-size: 2rem; }
    .hr-attendance-flow { grid-template-columns: 1fr; }
    .hr-flow-arrow { height: 16px; transform: rotate(-90deg); text-align: center; }
}

@media (max-width: 575.98px) {
    .biometric-kpis { grid-template-columns: 1fr; }
    .biometric-kpi { min-height: 96px; }
    .command-hero__actions .btn { width: 100%; justify-content: center; }
    .biometric-stage { width: 360px; max-width: 116%; height: 285px; margin-inline: -8%; }
    .fingerprint-orbit--outer { width: 210px; height: 210px; }
    .fingerprint-orbit--inner { width: 155px; height: 155px; }
    .fingerprint-core { width: 110px; height: 110px; font-size: 4rem; }
    .last-sync-strip { grid-template-columns: 40px 1fr; }
    .last-sync-strip__count { grid-column: 1 / -1; padding: .65rem 0 0; border-inline-start: 0; border-top: 1px solid #c6ddd7; }
    .ops-panel__header { align-items: flex-start; flex-direction: column; }
    .hr-kpis { grid-template-columns: 1fr; }
    .hr-kpi { min-height: 98px; }
    .hr-command-actions .btn { width: 100%; justify-content: center; }
    .hr-attendance-visual { width: calc(100% - 1.5rem); height: 280px; }
    .hr-fingerprint-radar { right: 50%; top: 44%; transform: translate(50%, -50%) scale(.86); }
    .hr-live-count { display: none; }
    .hr-visual-summary > span { padding: 0 .2rem; }
    .hr-panel-header { align-items: flex-start; }
    .hr-leave-metrics { padding: .9rem .45rem; }
    .hr-leave-metrics > div { padding-inline: .45rem; }
    .hr-quick-grid { grid-template-columns: 1fr; }
    .hr-quick-grid a, .hr-quick-grid a:nth-child(2) { border-inline-start: 0; border-bottom: 1px solid #edf2f1; }
    .hr-quick-grid a:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot, .brand-emblem--biometric span, .scan-beam, .fingerprint-orbit, .data-packet, .hr-radar-ring, .hr-radar-scan, .hr-kpi__pulse { animation: none; }
}
