html, body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* الحقول اللي عنوانها جوه الخانة (form-floating): النص التوضيحي مخفي عشان مايتكتبش فوق العنوان */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: transparent;
}
/* ---- الطباعة (قسيمة الراتب) ---- */
@media print {
    .sidebar, .top-row, .no-print, #blazor-error-ui {
        display: none !important;
    }

    .page {
        display: block !important;
    }

    article.content {
        padding: 0 !important;
    }

    .card {
        border: none !important;
    }
}

.stat-card {
    border-radius: 0.75rem;
}

.table-money td, .table-money th {
    white-space: nowrap;
}

/* ---------- الخدمة الذاتية (موبايل أولًا) ---------- */
.portal { max-width: 900px; margin-inline: auto; }
.portal-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--bs-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; flex-shrink: 0;
}
.portal-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: .25rem; }
.portal-tabs::-webkit-scrollbar { display: none; }
.portal-tabs .nav-link { white-space: nowrap; }
@media (max-width: 640px) {
    .content { padding-inline: .75rem !important; }
    .portal .card-body { padding: .85rem; }
}

/* ---------- لوحة خط التوظيف ---------- */
.pipeline-board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.pipeline-col { flex: 0 0 250px; background: #f3f4f6; border-radius: .5rem; padding: .5rem; min-height: 140px; }
.pipeline-col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .9rem; padding: .25rem .25rem .5rem; }
.pipeline-card { border-color: #e5e7eb; }
.pipeline-card .badge { font-weight: 500; }
.stars { color: #f59e0b; font-size: .8rem; letter-spacing: -1px; white-space: nowrap; }
.star-input button { border: 0; background: none; font-size: 1.4rem; color: #d1d5db; padding: 0 .1rem; line-height: 1; }
.star-input button.on { color: #f59e0b; }

/* ---------- صفحة التوظيف العامة ---------- */
.careers-hero { background: linear-gradient(135deg, rgb(5, 39, 103), #3a0647); color: #fff; border-radius: .75rem; padding: 2rem 1.5rem; }
.careers-job { transition: box-shadow .15s; }
.careers-job:hover { box-shadow: 0 .25rem .75rem rgba(0,0,0,.08); }
.pre-line { white-space: pre-line; }

/* ---------- مصفوفة الأداء × الإمكانيات ---------- */
.nine-box { display: grid; grid-template-columns: 1.5rem 1fr; grid-template-rows: 1fr auto; gap: .25rem; }
.nine-box-ylabel { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; color: #52514e; font-size: .8rem; }
.nine-box-xlabel { grid-column: 2; text-align: center; color: #52514e; font-size: .8rem; }
.nine-box-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #fcfcfb; }
.nine-box-cell { min-height: 130px; padding: .5rem; border-radius: 4px; }
.nine-box-title { font-weight: 600; font-size: .8rem; margin-bottom: .25rem; display: flex; justify-content: space-between; gap: .25rem; }
.nb-high { background: #e6f4ea; }
.nb-mid { background: #f0efec; }
.nb-low { background: #fbe9e7; }
.score-picker .btn { min-width: 2rem; }

/* ---------- توزيع إجابات الاستبيان ---------- */
.dist-bar { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; background: #fcfcfb; }
.dist-seg { height: 100%; }
.dist-legend { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .75rem; color: #52514e; margin-top: .3rem; }
.dist-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: .3rem; vertical-align: middle; }

/* ---------- الرسوم البيانية ---------- */
.viz { background: #fcfcfb; border: 1px solid rgba(11,11,11,.10); border-radius: .5rem; padding: .85rem 1rem; height: 100%; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .5rem; }
.viz-title { font-weight: 600; color: #0b0b0b; }
.viz-sub { font-size: .75rem; color: #52514e; }
.viz-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .75rem; color: #52514e; margin-bottom: .5rem; }
.viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: .35rem; vertical-align: middle; }
.vz-plot { position: relative; margin-inline-start: 3.2rem; }
.vz-grid { position: absolute; inset: 0; }
.vz-gridline { position: absolute; inset-inline: 0; border-top: 1px solid #e1e0d9; }
.vz-gridline:last-child { border-top-color: #c3c2b7; }
.vz-gridline span { position: absolute; inset-inline-start: -3.2rem; width: 3rem; transform: translateY(-50%); font-size: .7rem; color: #898781; text-align: end; font-variant-numeric: tabular-nums; }
.vz-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.vz-slot { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; position: relative; outline: none; }
.vz-col { width: min(24px, 40%); border-radius: 4px 4px 0 0; min-height: 0; }
.vz-stack { width: min(24px, 60%); display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.vz-seg { min-height: 1px; }
.vz-slot:hover, .vz-slot:focus { background: rgba(42,120,214,.06); }
[data-tip]:hover::after, [data-tip]:focus::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: #0b0b0b; color: #fff; font-size: .72rem; padding: .25rem .5rem; border-radius: 4px; white-space: nowrap; z-index: 5; pointer-events: none;
}
.vz-xlabels { display: flex; gap: 2px; margin-inline-start: 3.2rem; margin-top: .25rem; }
.vz-xlabels span { flex: 1; text-align: center; font-size: .7rem; color: #898781; white-space: nowrap; overflow: visible; }
.vz-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.vz-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #2a78d6; box-shadow: 0 0 0 2px #fcfcfb; opacity: 0; outline: none; }
.vz-dot::before { content: ""; position: absolute; inset: -8px; }
.vz-dot:hover, .vz-dot:focus, .vz-dot-end { opacity: 1; }
.vz-end-label { position: absolute; inset-inline-end: -.25rem; font-size: .75rem; font-weight: 600; color: #0b0b0b; transform: translateX(-100%); }
.vz-bar-row { display: grid; grid-template-columns: minmax(80px, 30%) 1fr; align-items: center; gap: .5rem; padding: .2rem 0; font-size: .8rem; }
.vz-bar-name { color: #52514e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-bar-track { display: flex; align-items: center; gap: .4rem; }
.vz-bar { height: 12px; border-radius: 4px 0 0 4px; min-width: 2px; }
.vz-bar-value { color: #0b0b0b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-tile { background: #fcfcfb; border: 1px solid rgba(11,11,11,.10); border-radius: .5rem; padding: .75rem 1rem; height: 100%; }
.kpi-tile .kpi-label { font-size: .78rem; color: #52514e; }
.kpi-tile .kpi-value { font-size: 1.6rem; font-weight: 700; color: #0b0b0b; line-height: 1.2; }
.kpi-tile .kpi-note { font-size: .72rem; color: #898781; }

/* الأرقام جوه نص عربي: عزل الاتجاه عشان «+18» ماتتقلبش */
.ltr-num { unicode-bidi: isolate; direction: ltr; display: inline-block; }
[dir=rtl] .vz-gridline span { right: -3.2rem; left: auto; inset-inline-start: auto; text-align: left; unicode-bidi: isolate; direction: ltr; }
[dir=rtl] .vz-end-label { inset-inline-end: auto; left: -.25rem; }
/* الإنجليزي (من الشمال لليمين) */
[dir=ltr] .vz-gridline span { left: -3.2rem; right: auto; inset-inline-start: auto; text-align: right; }
[dir=ltr] .vz-end-label { inset-inline-end: auto; right: -.25rem; left: auto; transform: translateX(100%); }
[dir=ltr] .vz-bar { border-radius: 0 4px 4px 0; }
[dir=ltr] html, [dir=ltr] body, html[dir=ltr], html[dir=ltr] body { font-family: 'Segoe UI', 'Cairo', Tahoma, sans-serif; }

/* ---------- رسائل الحفظ والأخطاء (Popup) ---------- */
.toast-host { position: fixed; top: 4.25rem; inset-inline-end: 1.25rem; z-index: 1090; width: max-content; max-width: min(440px, calc(100vw - 2rem)); }
.app-toast { display: flex; align-items: flex-start; gap: .75rem; padding: .8rem 1rem; border-radius: .6rem; color: #fff; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.2); animation: app-toast-in .2s ease-out; }
.app-toast-success { background: #157347; }
.app-toast-error { background: #b02a37; }
.app-toast-icon { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.app-toast-body { flex: 1; line-height: 1.55; padding-top: .05rem; white-space: pre-line; }
.app-toast .btn-close { flex-shrink: 0; margin-top: .15rem; }
@keyframes app-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
    .toast-host { top: auto; bottom: 1rem; inset-inline: .75rem; width: auto; max-width: none; }
}
@media print { .toast-host { display: none !important; } }

/* ---------- خطوات التشغيل ---------- */
.setup-step { display: flex; align-items: flex-start; gap: .85rem; padding-block: .85rem; }
.setup-num { width: 2rem; height: 2rem; border-radius: 50%; border: 1.5px solid #c3c2b7; color: #52514e; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.setup-done .setup-num { background: #198754; border-color: #198754; color: #fff; }
.setup-next { background: #f2f7fd; }
.setup-next .setup-num { border-color: #1b6ec2; color: #1b6ec2; border-width: 2px; }
@media (max-width: 640px) { .setup-step { flex-wrap: wrap; } .setup-step > .text-nowrap { width: 100%; padding-inline-start: 2.85rem; } }

/* ---------- الإشعارات ---------- */
.notif-bell { position: relative; text-decoration: none; font-size: 1.15rem; line-height: 1; }
.notif-count { position: absolute; top: -.45rem; inset-inline-end: -.7rem; background: #dc3545; color: #fff; border-radius: 999px; font-size: .65rem; font-weight: 700; padding: .1rem .35rem; min-width: 1.1rem; text-align: center; }
.notif-unread { background: #f2f7fd; }

/* ---------- تطبيق الموبايل: صفحة التحميل والإعلان ---------- */
.qr-image { display: inline-block; line-height: 0; }
.qr-image svg { width: 100%; height: 100%; display: block; }
.app-icon-tile { width: 72px; height: 72px; border-radius: 18px; background: #F2A541; color: #1B1405; font-weight: 800; font-size: 1.6rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.install-step { position: relative; height: 100%; border: 1px solid #e3e0d8; border-radius: .75rem; padding: 1rem; background: #fff; display: flex; flex-direction: column; gap: .5rem; }
.install-step-num { position: absolute; top: -.7rem; inset-inline-start: .9rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #1b6ec2; color: #fff; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; }
.install-mock { background: #0E1B3D; border-radius: .6rem; padding: .75rem; min-height: 86px; display: flex; flex-direction: column; justify-content: center; gap: .4rem; color: #F6F4EF; font-size: .8rem; }
.install-mock-bar, .install-mock-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: #18295A; border-radius: .4rem; padding: .45rem .6rem; }
.install-toggle { width: 2rem; height: 1.1rem; border-radius: 999px; background: #2A78D6; position: relative; flex-shrink: 0; }
.install-toggle::after { content: ""; position: absolute; top: .15rem; inset-inline-end: .15rem; width: .8rem; height: .8rem; border-radius: 50%; background: #fff; }
.install-mock-dialog { background: #F6F4EF; color: #0E1B3D; border-radius: .4rem; padding: .5rem .6rem; }
.install-mock-link { color: #1b6ec2; font-weight: 700; margin-top: .25rem; }
.install-mock-field { background: #F6F4EF; color: #0E1B3D; border-radius: .35rem; padding: .25rem .5rem; direction: ltr; text-align: start; }
.print-only { display: none; }
@media print {
    .print-only { display: block !important; }
    .app-poster { text-align: center; padding-top: 2cm; }
    .app-poster-title { font-size: 34pt; font-weight: 800; margin-bottom: .3cm; }
    .app-poster-sub { font-size: 15pt; margin-bottom: 1cm; }
    .app-poster-url { font-size: 15pt; margin: .6cm 0 1cm; }
    .app-poster-steps { display: inline-block; text-align: start; font-size: 14pt; line-height: 1.8; }
    .cred-cards { display: grid !important; grid-template-columns: 1fr 1fr; gap: .5cm; }
    .cred-card { break-inside: avoid; border: 1px dashed #888; border-radius: 8px; padding: .4cm; display: flex; gap: .4cm; align-items: center; }
}

/* ---------- مرفقات القرارات ---------- */
.attach-chip { display: inline-flex; align-items: center; gap: .25rem; background: #f2f7fd; border: 1px solid #cfe0f5; border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; color: #0e1b3d; max-width: 100%; }
.attach-chip-btn { cursor: pointer; }
.attach-chip-btn:hover { background: #e3eefb; }
.btn-close-sm { width: .55rem; height: .55rem; padding: .15rem; }
.notif-attachments { padding-inline-start: 2.6rem; }

/* ---------- خطوات الاستيراد من Excel ---------- */
.import-steps { display: flex; flex-direction: column; gap: .75rem; }
.import-step { display: flex; align-items: flex-start; gap: .75rem; }
.import-step-num { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #e6f2ea; color: #198754; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: .05rem; }

/* ---------- خطاب للطباعة ---------- */
.letter-page { max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid #e3e0d8; padding: 3rem 3.5rem; min-height: 900px; font-size: 1.05rem; }
.letter-company { font-size: 1.5rem; font-weight: 800; border-bottom: 2px solid #0e1b3d; padding-bottom: .5rem; }
.letter-date { margin-top: .75rem; color: #52514e; }
.letter-title { text-align: center; font-size: 1.4rem; font-weight: 700; margin: 2.5rem 0 1.5rem; text-decoration: underline; }
.letter-body { white-space: pre-line; line-height: 2.1; outline: none; }
.letter-body:focus { background: #fffbe6; }
.letter-sign { margin-top: 4rem; margin-inline-start: auto; width: 240px; text-align: center; }
.letter-sign-line { border-bottom: 1px dotted #888; height: 2.5rem; }
@media print { .letter-page { border: none; padding: 0; min-height: 0; } }

/* عناصر بتتداس (كروت الفلاتر في لوحة المنصة) */
.cursor-pointer { cursor: pointer; }

/* قوائم «إضافة ▾» و«حفظ ▾» في شاشات الحسابات: النص من اليمين، خط أكبر، وفاصل بين كل اختيار */
.erp-menu {
    padding: .3rem 0;
    min-width: 200px;
    overflow: hidden;
}

.erp-menu .dropdown-item {
    display: block;
    width: 100%;
    text-align: start;
    padding: .65rem 1.1rem;
    font-size: .95rem;
    line-height: 1.4;
    white-space: nowrap;
    color: #212529;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #eceff3;
}

.erp-menu .dropdown-item:last-child {
    border-bottom: 0;
}

.erp-menu .dropdown-item:hover,
.erp-menu .dropdown-item:focus {
    background: #eef4ff;
    color: #0d6efd;
}

.erp-menu .dropdown-item:disabled {
    color: #adb5bd;
    background: transparent;
}

/* ===== تذاكر الموارد البشرية ===== */
.tk-thread { display: flex; flex-direction: column; gap: .6rem; }
.tk-msg { display: flex; }
.tk-msg.tk-emp { justify-content: flex-start; }
.tk-msg.tk-team { justify-content: flex-end; }
.tk-bubble { max-width: min(680px, 92%); border-radius: .9rem; padding: .6rem .85rem; background: #f4f6f8; border: 1px solid rgba(0,0,0,.06); }
.tk-team .tk-bubble { background: #eaf3ff; border-color: #cfe2ff; }
.tk-note .tk-bubble { background: #fff8db; border: 1px dashed #e6c74a; }
.tk-meta { font-size: .75rem; color: #6c757d; margin-bottom: .2rem; }
.tk-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-event { text-align: center; font-size: .75rem; color: #6c757d; }
.tk-event span { opacity: .75; }
.tk-file { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-counter { cursor: pointer; transition: box-shadow .15s; }
.tk-counter:hover, .tk-counter.active { box-shadow: 0 0 0 2px var(--bs-primary); }
.tk-counter .kpi-value { font-size: 1.4rem; }
.tk-row-unread td:first-child { border-inline-start: 3px solid var(--bs-primary); }
.tk-stars button { font-size: 1.6rem; line-height: 1; background: none; border: 0; color: #d0d4d8; padding: 0 .1rem; }
.tk-stars button.on { color: #f5a524; }
.tk-faq { border-inline-start: 3px solid #1baf7a; }
