/* =====================================================================
   HR Employee Services Portal — Theme "Navy & Cobalt"
   IBM Plex Sans Arabic · هرمية بالخطوط والحدود بدل الظلال · RTL
   ===================================================================== */

:root {
    --navy-950: #0B1A3A;
    --navy-900: #12295A;
    --navy-800: #1B3A78;
    --cobalt-700: #1C43A0;
    --cobalt-600: #2350B8;
    --cobalt-500: #3B6AD6;
    --sky-400: #5B8DEF;
    --sky-200: #BFD3F7;
    --sky-100: #E3ECFB;
    --sky-50:  #F1F5FD;

    --ink-900: #0F1B2D;
    --ink-700: #2E3B52;
    --ink-500: #4A5B73;
    --ink-400: #6B7A90;
    --ink-300: #98A4B5;

    --line: #DCE3EE;
    --line-soft: #E8EDF4;
    --mist: #EEF2F8;
    --paper: #F4F6FA;
    --surface: #FFFFFF;

    --teal-700: #0B6A73;  --teal-100: #DDF1F2;
    --green-700: #1B6E4F; --green-100: #DDF1E7;
    --amber-700: #99600C; --amber-500: #C98A12; --amber-100: #FBEFD8;
    --red-700: #9E3524;   --red-600: #B4432F;   --red-100: #F9E4DF;
    --violet-700: #4B3D9E; --violet-100: #E9E6F8;

    --r-sm: 6px;
    --r: 10px;
    --sidebar-w: 256px;
    --topbar-h: 60px;
    --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
    --focus: 0 0 0 3px rgba(91, 141, 239, .35);
}

* { box-sizing: border-box; }
html, body {
    margin: 0; background: var(--paper); color: var(--ink-900);
    font-family: var(--font); font-size: 14.5px; line-height: 1.6;
    text-align: start; -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--sky-200); color: var(--ink-900); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
svg.ic { flex: none; vertical-align: -3px; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } .reveal { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Top navigation */
.navbar { position: sticky; top: 0; z-index: 50; background: var(--navy-900); color: #fff; transition: box-shadow .2s; }
.navbar.scrolled { box-shadow: 0 6px 24px rgba(11, 26, 58, .22); }
.nav-in { max-width: 1440px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand .mark { width: 36px; height: 36px; border-radius: 8px; background: var(--cobalt-600); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; letter-spacing: .5px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.brand .txt { display: flex; flex-direction: column; line-height: 1.3; }
.brand .txt b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.brand .txt small { font-size: 12px; color: rgba(255,255,255,.55); white-space: nowrap; }
.menu { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; height: 100%; }
.m-link, .m-btn {
    position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 13px; border-radius: var(--r-sm);
    font-family: var(--font); font-size: 14px; font-weight: 500; color: rgba(255,255,255,.78); background: none; border: none; cursor: pointer; white-space: nowrap;
    transition: color .15s, background-color .15s;
}
.m-link:hover, .m-btn:hover, .m-drop.open > .m-btn { color: #fff; background: rgba(255,255,255,.07); }
.m-link.active, .m-drop.active > .m-btn { color: #fff; }
.m-link.active::after, .m-drop.active > .m-btn::after { content: ''; position: absolute; inset-inline: 13px; bottom: -12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--sky-400); }
.m-btn .caret { transform: rotate(-90deg); opacity: .6; transition: transform .2s; }
.m-drop.open > .m-btn .caret { transform: rotate(90deg); }
.dot-count { background: var(--sky-400); color: var(--navy-950); font-size: 11px; font-weight: 700; border-radius: 9px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; }
.m-drop { position: relative; height: 100%; display: flex; align-items: center; }
.m-panel {
    position: absolute; top: calc(100% - 4px); inset-inline-start: 0; min-width: 300px; padding: 8px; z-index: 60;
    background: var(--surface); color: var(--ink-900); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: 0 18px 48px rgba(11, 26, 58, .20), 0 2px 6px rgba(11, 26, 58, .08);
    opacity: 0; visibility: hidden; transform: translateY(8px) scale(.985); transform-origin: top right;
    transition: opacity .18s ease, transform .22s cubic-bezier(.2,.8,.2,1), visibility 0s linear .22s;
}
.m-panel.wide { display: grid; grid-template-columns: repeat(2, minmax(250px, 1fr)); gap: 2px; min-width: 560px; }
.m-panel.align-end { inset-inline-start: auto; inset-inline-end: 0; transform-origin: top left; min-width: 270px; }
.m-panel.wide.align-end { min-width: 560px; }
.m-drop.open > .m-panel, .no-js .m-drop:hover > .m-panel, .no-js .m-drop:focus-within > .m-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.m-panel::before { content: ''; position: absolute; top: -12px; inset-inline: 0; height: 12px; }
.m-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink-900); }
.m-item:hover, .m-item:focus-visible { background: var(--sky-50); }
.m-item.active { background: var(--sky-100); }
.mi-ic { width: 36px; height: 36px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--mist); color: var(--cobalt-700); transition: background-color .15s, color .15s; }
.m-item:hover .mi-ic, .m-item.active .mi-ic { background: var(--cobalt-600); color: #fff; }
.mi-txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.mi-txt b { font-size: 14px; font-weight: 500; }
.mi-txt small { font-size: 12.5px; color: var(--ink-400); }
.m-item .nav-count { margin-inline-start: auto; background: var(--cobalt-600); color: #fff; font-size: 11.5px; font-weight: 600; border-radius: 10px; padding: 0 7px; line-height: 20px; min-width: 22px; text-align: center; }
.u-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.u-head b { display: block; font-size: 14.5px; } .u-head small { display: block; color: var(--ink-400); font-size: 12.5px; }
.nav-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.navbar .icon-btn { position: relative; width: 40px; height: 40px; border-radius: var(--r-sm); border: none; background: none; display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,.8); cursor: pointer; }
.navbar .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.notif-bell .badge-dot { position: absolute; top: 3px; inset-inline-end: -1px; background: #E5533D; color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: none; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--navy-900); }
.notif-bell.has-updates .badge-dot { display: flex; }
.notif-bell.ping { animation: ping .7s ease 2; }
@keyframes ping { 30% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } }
.who { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 10px; border-radius: var(--r-sm); background: none; border: none; color: #fff; cursor: pointer; font-family: var(--font); }
.who:hover, .user-drop.open > .who { background: rgba(255,255,255,.08); }
.who .caret { transform: rotate(-90deg); opacity: .6; }
.who-txt { display: flex; flex-direction: column; line-height: 1.3; text-align: start; }
.who-txt b { font-size: 13.5px; font-weight: 500; }
.who-txt small { font-size: 12px; color: rgba(255,255,255,.55); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--sky-100); color: var(--cobalt-700); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.avatar.lg { width: 42px; height: 42px; font-size: 15px; }
.nav-toggle { display: none !important; }
.nav-progress { position: fixed; top: 0; inset-inline-end: 0; height: 3px; width: 0; background: var(--sky-400); z-index: 100; box-shadow: 0 0 10px rgba(91,141,239,.7); opacity: 0; transition: width .4s ease, opacity .3s; }
.nav-progress.run { opacity: 1; width: 75%; transition: width 8s cubic-bezier(.1,.7,.2,1), opacity .2s; }

.main-col { display: block; min-width: 0; }
.page-wrap { max-width: 1320px; margin: 0 auto; padding: 30px 28px 48px; width: 100%; animation: pageIn .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 14px; }
.page-head h1 { font-size: 25px; margin: 0; line-height: 1.3; font-weight: 600; }
.page-head p.sub { color: var(--ink-500); margin: 6px 0 0; font-size: 14px; max-width: 70ch; }
.eyebrow { display: none; }
.crumb { font-size: 13px; color: var(--ink-400); margin-bottom: 4px; }
.crumb a { color: var(--cobalt-600); }
.crumb a:hover { text-decoration: underline; }
footer.appfoot { text-align: center; font-size: 12.5px; color: var(--ink-400); padding: 36px 0 4px; border-top: 1px solid var(--line-soft); margin-top: 36px; display: flex; flex-direction: column; gap: 4px; }
.credit { font-size: 12.5px; color: var(--ink-400); letter-spacing: .1px; }
.appfoot .credit { color: var(--ink-500); }

@media (max-width: 1600px) { .brand .txt { display: none; } }
@media (max-width: 1400px) { .m-link, .m-btn { padding: 0 10px; } }
@media (max-width: 1180px) { .m-link, .m-btn { padding: 0 9px; font-size: 14px; } }
@media (max-width: 1440px) { html[dir="ltr"] .brand .txt { display: none; } }
@media (min-width: 1091px) and (max-width: 1180px) { html[dir="ltr"] .m-link, html[dir="ltr"] .m-btn { padding: 0 5px; font-size: 13.5px; } }
@media (max-width: 1090px) {
    .nav-toggle { display: inline-flex !important; }
    .who-txt, .who .caret { display: none; }
    .menu {
        position: fixed; top: 64px; inset-inline: 0; bottom: 0; background: var(--navy-900); flex-direction: column; align-items: stretch;
        padding: 12px 16px 40px; gap: 2px; overflow-y: auto; height: auto; display: none;
    }
    .navbar.nav-open .menu { display: flex; }
    .m-link, .m-btn { width: 100%; justify-content: flex-start; height: 46px; font-size: 15px; }
    .m-btn .caret { margin-inline-start: auto; }
    .m-link.active::after, .m-drop.active > .m-btn::after { inset-inline: auto; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; height: auto; border-radius: 3px; }
    .m-drop { height: auto; flex-direction: column; align-items: stretch; }
    .menu .m-panel, .menu .m-panel.wide { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; background: rgba(255,255,255,.04); min-width: 0; display: none; grid-template-columns: minmax(0, 1fr); margin: 2px 0 6px; transition: none; }
    .menu .m-drop.open > .m-panel { display: block; }
    .menu .m-item { color: #fff; }
    .menu .m-item:hover, .menu .m-item.active { background: rgba(255,255,255,.08); }
    .menu .mi-ic { background: rgba(255,255,255,.1); color: #fff; }
    .menu .mi-txt small { color: rgba(255,255,255,.5); }
    .page-wrap { padding: 20px 16px 40px; }
    .nav-in { padding: 0 14px; gap: 10px; }
}

/* ---------------------------------------------------------------- Motion & feedback */
.toasts { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 44px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--navy-950); color: #fff; border-radius: var(--r); padding: 13px 16px; box-shadow: 0 16px 40px rgba(11,26,58,.3); font-size: 14px; line-height: 1.7; border-inline-start: 4px solid var(--sky-400); opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .3s cubic-bezier(.2,.8,.2,1); }
.toast.in { opacity: 1; transform: none; }
.toast.t-error { border-inline-start-color: #E5533D; } .toast.t-success { border-inline-start-color: #3FBF8A; } .toast.t-warn { border-inline-start-color: var(--amber-500); }
.toast .t-x { margin-inline-start: auto; background: none; border: none; color: rgba(255,255,255,.6); cursor: pointer; padding: 2px; }
.toast .t-x:hover { color: #fff; }
.toast a { color: var(--sky-200); text-decoration: underline; }
.modal-back { position: fixed; inset: 0; background: rgba(11,26,58,.5); z-index: 130; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.modal-back.in { opacity: 1; }
.modal { background: var(--surface); border-radius: 12px; padding: 24px; width: 100%; max-width: 420px; box-shadow: 0 30px 80px rgba(11,26,58,.35); transform: translateY(10px) scale(.98); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.modal-back.in .modal { transform: none; }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { margin: 0 0 20px; color: var(--ink-500); line-height: 1.8; }
.modal .row-gap { justify-content: flex-end; }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.to-top { position: fixed; bottom: 22px; inset-inline-end: 22px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--navy-900); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 22px rgba(11,26,58,.14); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s; z-index: 40; }
.to-top svg { transform: rotate(90deg); }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--cobalt-600); color: #fff; border-color: var(--cobalt-600); }
.reveal { opacity: 0; transform: translateY(10px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .45s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.flash-hidden { display: none !important; }

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent;
    font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
    transition: background-color .12s, border-color .12s, color .12s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cobalt-600); color: #fff; }
.btn-primary:hover { background: var(--cobalt-700); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink-700); }
.btn-outline:hover { border-color: var(--cobalt-500); color: var(--cobalt-700); }
.btn-danger { background: var(--surface); border-color: #EBC3BA; color: var(--red-700); }
.btn-danger:hover { background: var(--red-100); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.copied { border-color: var(--green-700); color: var(--green-700); }
.btn-link { background: none; border: none; color: var(--red-700); cursor: pointer; font-family: var(--font); padding: 0; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Panels */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.card + .card, form.card + .card, .card + form.card, form.card + form.card { margin-top: 16px; }
.card-title { margin: 0 0 14px; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sub-title { font-size: 14px; font-weight: 600; margin: 18px 0 8px; color: var(--ink-700); }
.section-title { font-size: 17px; font-weight: 600; margin: 8px 0 12px; }
.card-mgmt { border-top: 3px solid var(--red-600); }

/* KPI: شريط مؤشرات متصل (بدل بطاقات متفرقة) */
.kpi-grid, .stat-band {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    margin-bottom: 20px; overflow: hidden;
}
.kpi, .stat-band > a, .stat-band > div {
    padding: 16px 20px; border-inline-start: 1px solid var(--line-soft); position: relative; display: block; min-width: 0;
}
.kpi:first-child, .stat-band > :first-child { border-inline-start: none; }
a.kpi:hover, .stat-band > a:hover { background: var(--sky-50); }
.kpi-label, .stat-band span { display: block; font-size: 13px; color: var(--ink-500); }
.kpi-value, .stat-band b { display: block; font-size: 28px; font-weight: 600; line-height: 1.25; margin-top: 4px; color: var(--ink-900); }
.kpi-sub, .stat-band small { display: block; font-size: 12px; color: var(--ink-400); margin-top: 2px; }
.kpi .kpi-value.small-num { font-size: 22px; }
.kpi.warn .kpi-value, .stat-band .is-warn b { color: var(--amber-700); }
.kpi.danger .kpi-value { color: var(--red-600); }
.kpi.mgmt .kpi-value { color: var(--red-600); }
.stat-band .is-good b { color: var(--green-700); }
.kpi.mgmt::after, .kpi.warn::after, .kpi.danger::after, .kpi.k-orange::after, .kpi.k-teal::after, .kpi.k-purple::after {
    content: ''; position: absolute; top: 16px; inset-inline-end: 16px; width: 7px; height: 7px; border-radius: 50%;
}
.kpi.mgmt::after, .kpi.danger::after { background: var(--red-600); }
.kpi.warn::after, .kpi.k-orange::after { background: var(--amber-500); }
.kpi.k-teal::after { background: var(--teal-700); }
.kpi.k-purple::after { background: var(--violet-700); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card, .grid-2 > form.card + .card { margin-top: 0; }
@media (max-width: 960px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- Tables */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
table.data thead th {
    background: var(--mist); color: var(--ink-500); text-align: start; padding: 10px 14px;
    font-weight: 500; font-size: 13px; white-space: nowrap; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 2;
}
table.data tbody td { padding: 11px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:first-child td { border-top: none; }
table.data tbody tr:hover { background: var(--sky-50); }
.card table.data { border: none; }
table.data.compact tbody td { padding: 8px 10px; }
.ticket-code { font-weight: 600; color: var(--cobalt-600); white-space: nowrap; }
tr.row-mgmt { background: #FDF6F4; }
tr.row-mgmt td:first-child { box-shadow: inset -3px 0 0 var(--red-600); }
tr.row-urgent td:first-child { box-shadow: inset -3px 0 0 var(--amber-500); }
tr.row-new td:first-child { box-shadow: inset -3px 0 0 var(--cobalt-600); }
tr.row-new td { font-weight: 500; }
.subject-cell { max-width: 320px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.row-gap form { margin: 0; }

/* ---------------------------------------------------------------- Badges & chips */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; line-height: 1.6; }
.st-new { background: var(--sky-100); color: var(--cobalt-700); }
.st-in_progress { background: var(--teal-100); color: var(--teal-700); }
.st-pending_employee { background: var(--amber-100); color: var(--amber-700); }
.st-approved { background: #DCE8FB; color: var(--navy-800); }
.st-completed { background: var(--green-100); color: var(--green-700); }
.st-rejected { background: var(--red-100); color: var(--red-700); }
.st-closed { background: var(--mist); color: var(--ink-500); }
.st-cancelled { background: var(--mist); color: var(--ink-400); text-decoration: line-through; }
.badge-p-low { background: var(--mist); color: var(--ink-500); }
.badge-p-mid { background: var(--sky-50); color: var(--ink-700); border: 1px solid var(--line); }
.badge-p-high { background: var(--amber-100); color: var(--amber-700); }
.badge-p-urgent { background: var(--red-600); color: #fff; }
.di-required { background: var(--mist); color: var(--ink-700); }
.di-under_review { background: var(--amber-100); color: var(--amber-700); }
.di-approved { background: var(--green-100); color: var(--green-700); }
.di-rejected { background: var(--red-100); color: var(--red-700); }
.sg-new { background: var(--sky-100); color: var(--cobalt-700); }
.sg-screening { background: #E4EAF3; color: var(--ink-700); }
.sg-shortlisted { background: var(--violet-100); color: var(--violet-700); }
.sg-interview { background: var(--teal-100); color: var(--teal-700); }
.sg-offer { background: var(--amber-100); color: var(--amber-700); }
.sg-hired { background: var(--green-100); color: var(--green-700); }
.sg-rejected { background: var(--red-100); color: var(--red-700); }
.sg-withdrawn { background: var(--mist); color: var(--ink-400); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; line-height: 1.7; }
.chip-blue { background: var(--sky-100); color: var(--cobalt-700); }
.chip-teal { background: var(--teal-100); color: var(--teal-700); }
.chip-purple { background: var(--violet-100); color: var(--violet-700); }
.chip-orange { background: var(--amber-100); color: var(--amber-700); }
.chip-red { background: var(--red-100); color: var(--red-700); }
.chip-red-solid { background: var(--red-600); color: #fff; }
.chip-gray { background: var(--mist); color: var(--ink-700); }
.tiny { font-size: 11.5px !important; padding: 0 7px !important; }
.conf-mark { color: var(--violet-700); }

/* ---------------------------------------------------------------- Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.inner { display: grid; }
@media (max-width: 760px) { .form-grid, .form-grid.inner { grid-template-columns: minmax(0, 1fr); } }
label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; color: var(--ink-700); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=month], input[type=datetime-local], input[type=number],
input[type=tel], input[type=url], input[type=search], select, textarea {
    width: 100%; height: 40px; padding: 0 12px; border: 1px solid #C9D3E1; border-radius: var(--r-sm);
    font-family: var(--font); font-size: 14.5px; background: var(--surface); color: var(--ink-900);
    transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.7; }
select { padding-inline-end: 8px; }
input[type=file] { width: 100%; padding: 8px; border: 1px dashed #B7C4D8; border-radius: var(--r-sm); background: var(--sky-50); font-family: var(--font); font-size: 13px; }
input:hover, select:hover, textarea:hover { border-color: #AEBBD0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalt-500); box-shadow: var(--focus); }
input[readonly] { background: var(--sky-50); }
.readonly-val { padding: 9px 12px; border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--line-soft); min-height: 40px; font-size: 14.5px; color: var(--ink-700); }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; margin: 4px 0; color: var(--ink-700); }
label.check input { width: 16px; height: 16px; accent-color: var(--cobalt-600); }
label.inline { display: inline; margin: 0; }
.hint { font-size: 12.5px; color: var(--ink-400); margin-top: 5px; }
.req { color: var(--red-600); }
.lock { color: var(--ink-400); font-size: 12px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-sep { font-weight: 600; color: var(--navy-800); border-bottom: 1px solid var(--line); padding-bottom: 6px; font-size: 14px; margin-top: 4px; }
.input-sm { height: 32px !important; font-size: 13px !important; max-width: 200px; }
.file-sm { max-width: 280px; font-size: 12.5px !important; padding: 5px !important; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; padding: 14px 16px; }
.filters input[type=text] { flex: 1 1 260px; width: auto; }
.filters select, .filters input[type=date] { width: auto; flex: 0 1 170px; }
.filters label.check { margin: 0; }

/* ---------------------------------------------------------------- Alerts */
.alert { padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid; border-inline-start-width: 4px; }
.alert-error { background: var(--red-100); color: var(--red-700); border-color: #EBC3BA; border-inline-start-color: var(--red-600); }
.alert-success { background: var(--green-100); color: var(--green-700); border-color: #BFE0CF; border-inline-start-color: var(--green-700); }
.alert-warn { background: var(--amber-100); color: var(--amber-700); border-color: #EDD5A8; border-inline-start-color: var(--amber-500); }
.alert-info { background: var(--sky-50); color: var(--navy-800); border-color: var(--sky-200); border-inline-start-color: var(--cobalt-600); }
.alert-conf { background: var(--violet-100); color: var(--violet-700); border-color: #D3CDEF; border-inline-start-color: var(--violet-700); }
.alert-mgmt { background: var(--red-100); color: var(--red-700); border-color: #EBC3BA; border-inline-start-color: var(--red-600); font-weight: 500; }
.alert ul { margin: 8px 0 0; padding-inline-start: 20px; }

/* ---------------------------------------------------------------- Utilities */
.link { color: var(--cobalt-600); font-weight: 500; }
.link:hover { text-decoration: underline; }
.muted { color: var(--ink-400); }
.small { font-size: 13px; }
.bold { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.text-red { color: var(--red-600); }
.text-amber { color: var(--amber-700); }
.text-blue { color: var(--cobalt-700); }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; } .mt-xs { margin-top: 5px; } .mb { margin-bottom: 16px; } .sp { height: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-500); }
.empty-state .glyph:empty { display: none; }
.plain-list, .doc-mini-list, .file-list { list-style: none; margin: 0; padding: 0; }
.plain-list li, .doc-mini-list li, .file-list li { padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.plain-list li:first-child, .doc-mini-list li:first-child, .file-list li:first-child { border-top: none; }
.file-link { color: var(--cobalt-600); font-weight: 500; word-break: break-all; }
.file-link:hover { text-decoration: underline; }
.check-table { width: 100%; margin-bottom: 16px; font-size: 13.5px; border-collapse: collapse; }
.check-table td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.check-table td:last-child { text-align: end; font-weight: 600; }
.check-table td.ok { color: var(--green-700); } .check-table td.bad { color: var(--red-600); }

/* ---------------------------------------------------------------- Pagination / tabs */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 34px; height: 34px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 13.5px; padding: 0 8px; }
.pagination a { background: var(--surface); border: 1px solid var(--line); }
.pagination a:hover { border-color: var(--cobalt-500); color: var(--cobalt-700); }
.pagination span.current { background: var(--navy-900); color: #fff; }
.pagination span.gap { color: var(--ink-300); }
.pagination-info { text-align: center; font-size: 13px; color: var(--ink-400); margin-top: 8px; }
.pill-tabs { display: flex; gap: 2px; margin-bottom: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.pill-tabs a { padding: 9px 14px; font-size: 14px; color: var(--ink-500); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pill-tabs a:hover { color: var(--ink-900); }
.pill-tabs a.active { color: var(--cobalt-700); border-bottom-color: var(--cobalt-600); font-weight: 600; }

/* ---------------------------------------------------------------- Progress */
.progress { display: inline-block; vertical-align: middle; width: calc(100% - 48px); max-width: 220px; height: 6px; border-radius: 3px; background: var(--mist); overflow: hidden; }
.progress > div { height: 100%; background: var(--red-600); }
.progress.mid > div { background: var(--amber-500); }
.progress.full > div, .progress.high > div { background: var(--cobalt-600); }
.progress-txt { display: inline-block; width: 42px; text-align: end; font-size: 13px; font-weight: 600; margin-inline-start: 6px; }
.mini-stat { display: flex; flex-direction: column; gap: 8px; }
.mini-stat > span { font-size: 13px; color: var(--ink-500); }
.mini-stat-inline { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 14px; min-width: 300px; }

/* ---------------------------------------------------------------- Module picker */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.module-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.module-card:hover { border-color: var(--cobalt-500); background: var(--sky-50); }
.module-card .mc-icon { width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; background: var(--sky-100); color: var(--cobalt-700); }
.module-card b { font-size: 16px; font-weight: 600; }
.module-card small { color: var(--ink-500); font-size: 13.5px; line-height: 1.7; }
.module-grid.compact .module-card { padding: 12px 14px; flex-direction: row; align-items: center; gap: 12px; }
.module-grid.compact .mc-icon { width: 36px; height: 36px; margin: 0; }
.mc-teal .mc-icon { background: var(--teal-100); color: var(--teal-700); }
.mc-purple .mc-icon { background: var(--violet-100); color: var(--violet-700); }
.mc-orange .mc-icon { background: var(--amber-100); color: var(--amber-700); }
.mc-red .mc-icon { background: var(--red-100); color: var(--red-700); }

/* ---------------------------------------------------------------- Profile */
.profile-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; border-top: 3px solid var(--navy-900); }
.ph-avatar { width: 72px; height: 72px; border-radius: 12px; background: var(--navy-900); color: #fff; font-size: 26px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ph-main h1 { margin: 0; font-size: 22px; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ph-stats { display: flex; gap: 28px; }
.ph-stats div { display: flex; flex-direction: column; }
.ph-stats small { color: var(--ink-400); font-size: 12.5px; } .ph-stats b { font-size: 15px; font-weight: 600; }
.ph-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 14px; }
@media (max-width: 900px) { .profile-hero { grid-template-columns: minmax(0, 1fr); } .ph-stats { flex-wrap: wrap; } }
.profile-grid { columns: 2; column-gap: 16px; margin-top: 16px; }
.profile-grid > .card { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 16px; }
.profile-grid .card + .card { margin-top: 0; }
@media (max-width: 900px) { .profile-grid { columns: 1; } }
dl.kv { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; margin: 0; }
dl.kv dt, dl.kv dd { padding: 9px 0; border-top: 1px solid var(--line-soft); margin: 0; font-size: 14px; }
dl.kv dt { color: var(--ink-400); padding-inline-end: 12px; }
dl.kv dt:first-of-type, dl.kv dt:first-of-type + dd { border-top: none; }

/* ---------------------------------------------------------------- Request view */
.ticket-head { border-top: 3px solid var(--cobalt-600); }
.ticket-head.is-mgmt { border-top-color: var(--red-600); }
.th-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.th-code { font-weight: 600; color: var(--ink-400); font-size: 13.5px; }
.ticket-head h1 { margin: 2px 0 12px; font-size: 21px; }
.th-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.th-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.th-meta small { display: block; color: var(--ink-400); font-size: 12.5px; }
.th-meta b { font-size: 14px; font-weight: 500; }
.stepper-card { margin-top: 16px; overflow-x: auto; }
.stepper { display: flex; min-width: 560px; }
.step { flex: 1; text-align: center; position: relative; padding: 0 6px; }
.step::after { content: ''; position: absolute; top: 15px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.step:last-child::after { display: none; }
.step .dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; background: var(--surface); color: var(--ink-400); border: 2px solid var(--line); }
.step b { display: block; font-size: 13.5px; font-weight: 500; }
.step small { display: block; font-size: 12px; color: var(--ink-400); margin-top: 2px; }
.step-done .dot { background: var(--cobalt-600); border-color: var(--cobalt-600); color: #fff; }
.step-done::after { background: var(--cobalt-500); }
.step-current .dot { border-color: var(--cobalt-600); color: var(--cobalt-700); box-shadow: 0 0 0 4px var(--sky-100); }
.step-current b { color: var(--cobalt-700); font-weight: 600; }
.step-rejected .dot { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; margin-top: 16px; align-items: start; }
.view-grid .card + .card { margin-top: 16px; }
@media (max-width: 1040px) { .view-grid { grid-template-columns: minmax(0, 1fr); } }
.desc-box { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 14px 16px; margin-top: 14px; line-height: 1.9; }
.decision-box { background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: var(--r-sm); padding: 14px 16px; margin-top: 14px; line-height: 1.9; }
.muted-box { background: var(--paper); border-radius: var(--r-sm); padding: 8px 10px; margin-top: 6px; font-size: 13.5px; }
.approval { padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.approval:first-of-type { border-top: none; }
.approval.approved b { color: var(--green-700); } .approval.rejected b { color: var(--red-700); }
.comments { display: flex; flex-direction: column; gap: 10px; }
.comment { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 14px; max-width: 88%; }
.comment.mine { background: var(--sky-50); border-color: var(--sky-200); margin-inline-start: auto; }
.comment.internal { background: var(--amber-100); border: 1px dashed #E1C07D; }
.comment .c-head { font-size: 13.5px; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.comment .c-body { line-height: 1.8; }
.action-card { border: 1px solid var(--cobalt-500); box-shadow: inset 0 3px 0 var(--cobalt-600); }

/* Timeline */
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; inset-inline-start: -21px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--cobalt-500); }
.timeline-item.event-created::before, .timeline-item.event-submitted::before { background: var(--cobalt-600); }
.timeline-item.event-rejected::before { border-color: var(--red-600); }
.timeline-item.event-approved::before, .timeline-item.event-hired::before { border-color: var(--green-700); background: var(--green-700); }
.timeline-item.event-note::before { border-color: var(--ink-300); }
.t-head { font-size: 14px; font-weight: 500; }
.t-meta { font-size: 12.5px; color: var(--ink-400); margin-top: 1px; }
.t-desc { font-size: 14px; margin-top: 4px; white-space: pre-wrap; color: var(--ink-700); }

/* ---------------------------------------------------------------- Documents */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.doc-cards .card + .card { margin-top: 0; }
.doc-card { display: block; }
.doc-card:hover { border-color: var(--cobalt-500); }
.doc-card.needs-action { border-top: 3px solid var(--amber-500); }
.doc-card .cta { margin-top: 10px; font-weight: 600; color: var(--amber-700); font-size: 13.5px; }
.doc-item-mini { list-style: none; padding: 0; margin: 10px 0 0; }
.doc-item-mini li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 13.5px; border-top: 1px solid var(--line-soft); }
.doc-items { display: flex; flex-direction: column; }
.doc-item { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.doc-item:first-child { border-top: none; }
.doc-item.di-row-rejected { background: #FDF4F2; border-radius: var(--r-sm); padding-inline: 12px; }
.doc-item.di-row-under_review { background: #FDF8EE; border-radius: var(--r-sm); padding-inline: 12px; }
.di-main { flex: 1 1 320px; }
.di-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.review-box { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.reject-reason { color: var(--red-700); font-size: 13px; margin-top: 5px; }
.doc-type-table { width: 100%; border-collapse: collapse; }
.doc-type-table th { text-align: start; font-size: 13px; color: var(--ink-400); font-weight: 500; padding: 4px; }
.doc-type-table td { padding: 3px 4px; border-top: 1px solid var(--line-soft); }
.checkbox-list { border: 1px solid #C9D3E1; border-radius: var(--r-sm); padding: 6px 12px; max-height: 190px; overflow-y: auto; background: var(--surface); }
.checkbox-list.tall { max-height: 360px; margin-top: 8px; }
.checkbox-list label { display: flex; align-items: center; gap: 8px; font-weight: 400; padding: 6px 2px; margin: 0; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.checkbox-list label:last-child { border-bottom: none; }
.checkbox-list input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--cobalt-600); }
.role-hint { color: var(--ink-400); font-size: 12.5px; }

/* ---------------------------------------------------------------- Policies */
.policy-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.policy-meta small { display: block; color: var(--ink-400); font-size: 12.5px; }
.policy-meta b { font-weight: 500; }
.policy-body { line-height: 2; font-size: 15px; margin-top: 16px; max-width: none; }
.policy-body > * { max-width: 78ch; }
.policy-body table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.policy-body td, .policy-body th { border: 1px solid var(--line); padding: 6px 10px; }
.policy-file { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.ack-card { border-color: var(--cobalt-500); background: var(--sky-50); font-weight: 500; }
.ack-card.done { border-color: #BFE0CF; background: var(--green-100); color: var(--green-700); }
.quick-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick-cards .card + .card { margin-top: 0; }
.quick-card { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; }
.quick-card:hover { border-color: var(--cobalt-500); }
.quick-card .qc-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 8px; background: var(--navy-900); color: #fff; display: flex; align-items: center; justify-content: center; }
.quick-card b { font-size: 16px; font-weight: 600; } .quick-card small { color: var(--ink-500); }
.policy-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .policy-layout { grid-template-columns: minmax(0, 1fr); } }
.policy-cats { padding: 8px; display: flex; flex-direction: column; gap: 1px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.policy-cats a { padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-700); }
.policy-cats a:hover { background: var(--mist); }
.policy-cats a.active { background: var(--sky-100); color: var(--cobalt-700); font-weight: 600; }
.group-title { font-size: 15px; font-weight: 600; margin: 4px 0 10px; color: var(--ink-700); }
.policy-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.policy-list .card + .card { margin-top: 0; }
.policy-item { display: block; padding: 14px 18px; }
.policy-item:hover { border-color: var(--cobalt-500); }

/* ---------------------------------------------------------------- Dashboard bits */
.todo-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-sm); margin-bottom: 6px; font-size: 14px; border: 1px solid var(--line-soft); background: var(--paper); }
.todo-item:hover { border-color: var(--cobalt-500); background: var(--sky-50); }
.todo-item.mgmt { border-inline-start: 3px solid var(--red-600); }
.chart-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 960px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
.chart-card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
canvas { max-width: 100%; }

/* Notifications */
.notif-list { padding: 4px; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r-sm); border-bottom: 1px solid var(--line-soft); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--sky-50); }
.notif-item.unread { background: #F7F9FE; }
.notif-item.unread .ni-body b { color: var(--cobalt-700); }
.ni-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--mist); color: var(--ink-500); display: flex; align-items: center; justify-content: center; flex: none; }
.notif-item.np-high .ni-icon { background: var(--amber-100); color: var(--amber-700); }
.notif-item.np-urgent .ni-icon, .notif-item.np-management .ni-icon { background: var(--red-100); color: var(--red-700); }
.ni-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ni-body b { font-weight: 500; }
.ni-body small { color: var(--ink-500); font-size: 13px; }
.ni-time { font-size: 12.5px; color: var(--ink-400); white-space: nowrap; }

/* Rich text */
.rich-editor { width: 100%; min-height: 160px; max-height: 520px; overflow-y: auto; padding: 12px 14px; border: 1px solid #C9D3E1; border-radius: var(--r-sm); font-family: var(--font); font-size: 15px; background: var(--surface); line-height: 1.9; }
.rich-editor:focus { outline: none; border-color: var(--cobalt-500); box-shadow: var(--focus); }
.rich-editor:empty::before { content: attr(data-placeholder); color: var(--ink-300); }
.rich-editor img, .rich-content img { max-width: 100%; border-radius: var(--r-sm); margin: 8px 0; display: block; }
.rich-content ol, .rich-content ul, .rich-editor ol, .rich-editor ul { padding-inline-start: 22px; }
.rich-content h3, .rich-content h4 { color: var(--navy-800); margin: 18px 0 8px; }
.editor-hint { font-size: 12.5px; color: var(--ink-400); margin-top: 6px; }

/* ---------------------------------------------------------------- Recruitment (internal) */
.share-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.share-box p { margin: 2px 0 0; color: rgba(255,255,255,.65) !important; }
.share-field { display: flex; gap: 8px; align-items: center; flex: 1 1 420px; max-width: 620px; }
.share-field input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.share-field .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.share-field .btn-outline:hover { border-color: #fff; color: #fff; }
.funnel { display: flex; flex-direction: column; gap: 4px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 12px; align-items: center; padding: 5px 6px; border-radius: var(--r-sm); }
.funnel-row:hover { background: var(--sky-50); }
.f-label { font-size: 13.5px; color: var(--ink-700); }
.f-bar { height: 10px; background: var(--mist); border-radius: 5px; overflow: hidden; }
.sg-bar { display: block; height: 100%; border-radius: 5px; background: var(--cobalt-600); }
.sg-bar.sg-hired { background: var(--green-700); } .sg-bar.sg-rejected, .sg-bar.sg-withdrawn { background: var(--ink-300); }
.sg-bar.sg-interview { background: var(--teal-700); } .sg-bar.sg-offer { background: var(--amber-500); }
.f-num { font-weight: 600; text-align: end; }
.pipeline { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.pipeline span { flex: 1 1 110px; text-align: center; padding: 8px 6px; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-400); border-radius: var(--r-sm); }
.pipeline span.done { background: var(--sky-50); color: var(--cobalt-700); border-color: var(--sky-200); }
.pipeline span.cur { background: var(--cobalt-600); color: #fff; border-color: var(--cobalt-600); font-weight: 600; }
.pipeline span.stop { background: var(--red-100); color: var(--red-700); border-color: #EBC3BA; font-weight: 600; }
.stars { display: inline-flex; gap: 1px; color: var(--line); vertical-align: middle; }
.stars .on { color: var(--amber-500); } .stars .on svg { fill: currentColor; }
.rate-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rate-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate-input label { margin: 0; cursor: pointer; color: var(--line); }
.rate-input input:checked ~ label, .rate-input label:hover, .rate-input label:hover ~ label { color: var(--amber-500); }
.rate-input input:checked ~ label svg, .rate-input label:hover svg, .rate-input label:hover ~ label svg { fill: currentColor; }
.rate-input input:focus-visible + label { box-shadow: var(--focus); border-radius: 4px; }
.email-box { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* ---------------------------------------------------------------- Login */
.login-page { background: var(--paper); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); }
.login-side {
    background: var(--navy-900); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: flex-end;
    background-image: linear-gradient(var(--navy-900), var(--navy-900)), repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 64px);
    background-blend-mode: normal; position: relative; overflow: hidden;
}
.login-side::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 72px), repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 72px); }
.login-side > * { position: relative; }
.login-side .mark { width: 52px; height: 52px; border-radius: 10px; background: var(--cobalt-600); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; margin-bottom: auto; }
.login-side h2 { font-size: 34px; margin: 0 0 10px; font-weight: 600; line-height: 1.35; max-width: 16ch; }
.login-side p { font-size: 17px; color: rgba(255,255,255,.72); margin: 0; max-width: 34ch; line-height: 1.8; }
.login-card { background: var(--surface); padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.login-card h1 { font-size: 24px; margin: 0; }
.login-card p.sub { color: var(--ink-500); margin: 4px 0 28px; }
.login-card .btn-primary { width: 100%; margin-top: 22px; }
.login-card .mark { display: none; }
.login-hint { margin-top: 20px; font-size: 13px; color: var(--ink-400); }
@media (max-width: 860px) { .login-shell { grid-template-columns: minmax(0, 1fr); } .login-side { padding: 28px; min-height: 180px; } .login-side .mark { margin-bottom: 18px; } .login-side h2 { font-size: 24px; } .login-card { padding: 32px 24px; } }
/* صفحة التثبيت تستخدم login-card منفردة */
body:not(.login-page) .login-shell { display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--navy-900); }
body:not(.login-page) .login-card { border-radius: var(--r); max-width: 540px; width: 100%; padding: 36px; }
body:not(.login-page) .login-card .mark { display: flex; width: 44px; height: 44px; border-radius: 8px; background: var(--cobalt-600); color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 16px; }

/* ---------------------------------------------------------------- Public careers */
body.public { background: var(--paper); overflow-x: hidden; }
.pub-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.pub-top { background: var(--navy-900); color: #fff; }
.pub-top-in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.pub-brand { display: flex; align-items: center; gap: 12px; }
.pub-brand b { display: block; font-size: 16px; font-weight: 600; }
.pub-brand small { display: block; font-size: 12.5px; color: rgba(255,255,255,.6); }
.pub-mark { width: 40px; height: 40px; border-radius: 8px; background: var(--cobalt-600); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.pub-link { color: rgba(255,255,255,.8); font-size: 14px; }
.pub-link:hover { color: #fff; }
.pub-main { padding-top: 0; padding-bottom: 56px; min-height: 70vh; }
.pub-hero { background: var(--navy-900); color: #fff; margin: 0 calc(50% - 50vw) 28px; padding: 40px calc(50vw - 50% + 24px) 64px; border-top: 1px solid rgba(255,255,255,.08); }
.pub-hero h1 { font-size: 36px; margin: 0 0 12px; font-weight: 600; line-height: 1.3; max-width: 22ch; }
.pub-hero p { font-size: 17px; margin: 0; color: rgba(255,255,255,.72); max-width: 58ch; line-height: 1.8; }
.pub-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: -46px 0 18px; position: relative; }
.pub-filter a { padding: 7px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--ink-700); }
.pub-filter a.on { background: var(--cobalt-600); border-color: var(--cobalt-600); color: #fff; }
.job-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.job-row { display: flex; justify-content: space-between; gap: 24px; padding: 22px 24px; border-top: 1px solid var(--line-soft); align-items: center; }
.job-row:first-child { border-top: none; }
.job-row h2 { margin: 0 0 8px; font-size: 19px; font-weight: 600; }
.job-row h2 a:hover { color: var(--cobalt-600); }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-500); }
.job-meta span { display: inline-flex; align-items: center; gap: 6px; }
.job-meta.col { flex-direction: column; gap: 8px; margin: 12px 0 8px; }
.job-excerpt { margin: 10px 0 0; color: var(--ink-700); max-width: 72ch; line-height: 1.8; }
.job-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.job-side small { color: var(--ink-400); font-size: 13px; }
@media (max-width: 720px) { .job-row { flex-direction: column; align-items: stretch; } .job-side { align-items: stretch; } .pub-hero h1 { font-size: 27px; } }
.pub-empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 36px 24px; text-align: center; color: var(--ink-500); }
.job-list .pub-empty { border: none; }
.pub-general { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding: 22px 24px; border: 1px dashed #B7C4D8; border-radius: var(--r); background: var(--sky-50); }
.pub-general h2 { margin: 0 0 4px; font-size: 18px; }
.pub-general p { margin: 0; color: var(--ink-500); }
.apply-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 28px; }
@media (max-width: 920px) { .apply-layout { grid-template-columns: minmax(0, 1fr); } }
.apply-job { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--cobalt-600); border-radius: var(--r); padding: 22px; position: sticky; top: 20px; }
.apply-job h1 { font-size: 22px; margin: 0; line-height: 1.4; }
.apply-job h3 { font-size: 14.5px; margin: 18px 0 6px; color: var(--navy-800); }
.job-text { font-size: 14px; line-height: 1.9; color: var(--ink-700); }
.apply-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 26px 26px; }
.apply-form fieldset { border: none; padding: 18px 0; margin: 0; border-bottom: 1px solid var(--line-soft); }
.apply-form legend { font-size: 16px; font-weight: 600; padding: 0; margin-bottom: 14px; color: var(--navy-900); }
.apply-form .consent { margin: 18px 0; align-items: flex-start; line-height: 1.7; }
.apply-form .consent input { margin-top: 4px; }
.apply-form .btn-lg { width: 100%; }
.hp { position: absolute; inset-inline-start: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
.pub-done { max-width: 560px; margin: 48px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 40px 32px; text-align: center; }
.pub-done h1 { margin: 12px 0 18px; font-size: 26px; }
.pub-done p { color: var(--ink-500); line-height: 1.9; }
.done-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--green-100); color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; }
.done-code { font-size: 26px; font-weight: 700; color: var(--navy-900); letter-spacing: 1px; margin: -6px 0 16px; direction: ltr; }
.pub-foot { border-top: 1px solid var(--line); padding: 20px 0; font-size: 13px; color: var(--ink-400); background: var(--surface); }

/* ---------------------------------------------------------------- Print */
.report-letterhead { display: none; }
@media print {
    .navbar, .to-top, .toasts, .nav-progress, .no-print, .btn, form button, .pill-tabs, .pagination, .view-side, .filters, .ph-actions { display: none !important; }
    .app-shell { display: block !important; }
    .page-wrap { padding: 0 !important; max-width: 100% !important; }
    .report-letterhead { display: block; text-align: center; margin-bottom: 20px; border-bottom: 2px solid var(--navy-900); padding-bottom: 12px; }
    .report-letterhead h1 { margin: 0; color: var(--navy-900); }
    .card { break-inside: avoid; }
    .view-grid { grid-template-columns: minmax(0, 1fr); }
    body { background: #fff !important; }
}

/* ---------------------------------------------------------------- Choices (public form) */
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border: 1px solid #C9D3E1; border-radius: var(--r-sm); font-weight: 400; transition: all .15s; }
.choice:hover span { border-color: var(--cobalt-500); }
.choice input:checked + span { background: var(--sky-100); border-color: var(--cobalt-600); color: var(--cobalt-700); font-weight: 500; }
.choice input:focus-visible + span { box-shadow: var(--focus); }
.pub-foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.login-card .credit { margin-top: auto; padding-top: 28px; }

/* ---------------------------------------------------------------- Form builder */
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.builder-layout aside { position: sticky; top: 84px; }
@media (max-width: 1040px) { .builder-layout { grid-template-columns: minmax(0, 1fr); } .builder-layout aside { position: static; } }
.b-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 10px; margin-bottom: 14px; }
.b-section h3 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.b-section h3 small { font-size: 12.5px; color: var(--ink-400); font-weight: 400; }
.b-list { list-style: none; margin: 0; padding: 0; min-height: 44px; border-radius: var(--r-sm); transition: background-color .15s; }
.b-list.drag-over { background: var(--sky-50); outline: 2px dashed var(--sky-200); outline-offset: 2px; }
.b-list:empty::after { content: 'اسحب خانة هنا'; display: block; text-align: center; color: var(--ink-300); padding: 12px; font-size: 13px; }
.b-item { border: 1px solid var(--line-soft); border-radius: var(--r-sm); margin-bottom: 6px; background: var(--surface); transition: box-shadow .15s, border-color .15s, opacity .15s; }
.b-item:hover { border-color: var(--line); }
.b-item.off { background: var(--paper); }
.b-item.off .b-main b { color: var(--ink-400); text-decoration: line-through; }
.b-item.dragging { opacity: .45; }
.b-item.flash-hl { box-shadow: 0 0 0 3px var(--sky-200); border-color: var(--cobalt-500); }
.b-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; }
.b-handle { display: grid; grid-template-columns: repeat(2, 4px); gap: 3px; padding: 6px 4px; cursor: grab; flex: none; }
.b-handle i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-300); }
.b-handle i:nth-child(n) { box-shadow: 7px 0 0 var(--ink-300); }
.b-item:hover .b-handle i { background: var(--cobalt-500); box-shadow: 7px 0 0 var(--cobalt-500); }
.b-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.b-main b { font-weight: 500; }
.b-main small { color: var(--ink-400); font-size: 12.5px; }
.b-actions { display: flex; gap: 6px; align-items: center; }
.b-actions form { margin: 0; }
.b-edit { padding: 6px 14px 16px; border-top: 1px dashed var(--line); }
.b-saved { position: sticky; bottom: 16px; margin: 0 auto; width: max-content; background: var(--green-700); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
[data-panel].flash-hl { box-shadow: 0 0 0 3px var(--sky-200); border-color: var(--cobalt-500); }

/* ---------------------------------------------------------------- Recruitment analytics */
.stat-band.slim { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--paper); }
.stat-band.slim > div { padding: 13px 18px; }
.stat-band.slim b { font-size: 22px; }
.stat-band.slim b.t-sm { font-size: 18px; line-height: 1.6; }
.quick-range { gap: 6px; }
.quick-range .chip { cursor: pointer; }
.quick-range .chip:hover { border-color: var(--cobalt-500); }
.dist { display: flex; flex-direction: column; gap: 2px; }
.dist-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 74px; gap: 12px; align-items: center; padding: 6px 8px; border-radius: var(--r-sm); font-size: 14px; }
a.dist-row:hover { background: var(--sky-50); }
a.dist-row:hover .d-label { color: var(--cobalt-700); }
.dist-row.zero { opacity: .5; }
.d-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-700); }
.d-bar { height: 8px; background: var(--mist); border-radius: 4px; overflow: hidden; }
.d-bar > span { display: block; height: 100%; background: var(--cobalt-600); border-radius: 4px; transform-origin: right; animation: growBar .7s cubic-bezier(.2,.8,.2,1) both; }
.dist-row:nth-child(2n) .d-bar > span { background: var(--sky-400); }
@keyframes growBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.d-num { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; font-weight: 600; white-space: nowrap; }
.d-num small { font-weight: 400; color: var(--ink-400); font-size: 12px; min-width: 32px; text-align: end; }
.donut-wrap { max-width: 260px; margin: 0 auto 10px; }
.split-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--mist); width: 90px; margin-bottom: 3px; }
.split-bar .m { background: var(--cobalt-600); } .split-bar .f { background: var(--teal-700); }
.card-title small { font-weight: 400; font-size: 12.5px; }

/* ---------------------------------------------------------------- Leaves */
.chip-green { background: var(--green-100); color: var(--green-700); }
.mc-green .mi-ic, .mc-green .mc-icon { background: var(--green-100); color: var(--green-700); }
.balance-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.bal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; border-top: 3px solid var(--cobalt-600); display: flex; flex-direction: column; gap: 2px; }
.bal span { font-size: 13.5px; color: var(--ink-500); }
.bal b { font-size: 30px; font-weight: 600; line-height: 1.2; }
.bal small { font-size: 12.5px; color: var(--ink-400); }
.bal .progress { width: 100%; max-width: none; margin-top: 8px; }
.lc-teal { border-top-color: var(--teal-700); } .lc-orange { border-top-color: var(--amber-500); } .lc-purple { border-top-color: var(--violet-700); }
.lc-red { border-top-color: var(--red-600); } .lc-gray { border-top-color: var(--ink-300); } .lc-green { border-top-color: var(--green-700); }
.lv-calc { padding: 12px 14px; border-radius: var(--r-sm); background: var(--paper); border: 1px dashed var(--line); color: var(--ink-500); font-size: 14px; }
.lv-calc.ok { background: var(--sky-50); border-color: var(--sky-200); color: var(--navy-800); font-weight: 500; }
.lv-calc.bad { background: var(--red-100); border-color: #EBC3BA; color: var(--red-700); font-weight: 500; }
.today-leave .chip { font-size: 13px; }
.leave-box .stat-band { margin-bottom: 10px; }
.bal-table td { vertical-align: top; }
.bal-cell { display: flex; gap: 6px; margin-bottom: 4px; }
.bal-cell input { width: 78px; height: 34px; padding: 0 8px; font-size: 14px; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .form-grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lt-new { border-style: dashed; background: var(--sky-50); }

/* ---------------------------------------------------------------- Permissions */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.group-grid .card + .card { margin-top: 0; }
.group-card h3 { margin: 0; font-size: 17px; }
.group-card p { margin: 6px 0 12px; }
.gc-stats { display: flex; gap: 18px; margin-bottom: 14px; font-size: 13.5px; color: var(--ink-500); }
.gc-stats b { color: var(--ink-900); font-size: 18px; }
.perm-matrix th.c, .perm-matrix td.c { text-align: center; width: 90px; }
.perm-matrix .sec-row td { background: var(--paper); font-weight: 600; color: var(--navy-800); padding-top: 14px; }
.sec-set { margin-inline-start: 12px; font-weight: 400; }
.sec-set .btn-link { color: var(--cobalt-600); margin-inline-start: 8px; font-size: 12.5px; }
.perm-dot { display: inline-flex; margin: 0; cursor: pointer; }
.perm-dot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.perm-dot span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C9D3E1; background: var(--surface); transition: all .15s; display: block; }
.perm-dot:hover span { border-color: var(--cobalt-500); }
.perm-dot input:checked + span { border-width: 6px; }
.perm-dot.lv0 input:checked + span { border-color: var(--ink-300); }
.perm-dot.lv1 input:checked + span { border-color: var(--sky-400); }
.perm-dot.lv2 input:checked + span { border-color: var(--cobalt-600); }
.perm-dot.lv3 input:checked + span { border-color: var(--navy-900); }
.perm-dot input:focus-visible + span { box-shadow: var(--focus); }
.perm-dot input:disabled + span { opacity: .6; cursor: not-allowed; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 8px; z-index: 5; }
.ro-hidden { display: none !important; }
.ro-locked { opacity: .75; }
.ro-note { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- Approval flows */
.flow-card { border-top: 3px solid var(--cobalt-600); }
.flow-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.flow-head .flow-name { max-width: 320px; font-weight: 600; font-size: 16px; }
.flow-steps { list-style: none; margin: 0 0 14px; padding: 0; counter-reset: none; position: relative; }
.flow-step { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line-soft); position: relative; }
.flow-step:first-child { border-top: none; }
.fs-num { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-900); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.flow-step:not(:last-child) .fs-num::after { content: ''; position: absolute; top: 46px; bottom: -12px; inset-inline-start: 15px; width: 2px; background: var(--line); }
.fs-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fs-row input[type=text] { max-width: 240px; }
.fs-row select { max-width: 220px; }
.fs-row .check { margin: 0 6px; }
.fs-pick { margin-top: 10px; max-width: 560px; }
.fs-pick .checkbox-list { max-height: 200px; margin-top: 6px; }
.fs-tools { display: flex; gap: 4px; }
.fs-tools form { margin: 0; }
.arr-up svg { transform: rotate(90deg); } .arr-down svg { transform: rotate(-90deg); }

/* ---------------------------------------------------------------- Live dashboards */
.dash-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-title h1 { margin: 0; font-size: 24px; }
.dash-title .sub { margin: 4px 0 0; color: var(--ink-500); }
.dash-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--green-700); font-weight: 500; margin-inline-end: 6px; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: #2FA36B; box-shadow: 0 0 0 0 rgba(47,163,107,.6); animation: livePulse 2s infinite; }
.live-dot.off { color: var(--ink-400); } .live-dot.off i { background: var(--ink-300); animation: none; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(47,163,107,.55); } 70% { box-shadow: 0 0 0 8px rgba(47,163,107,0); } 100% { box-shadow: 0 0 0 0 rgba(47,163,107,0); } }
.dash-frame { position: relative; height: max(var(--h, 820px), calc(100vh - 230px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.dash-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dash-frame:fullscreen { height: 100vh; border-radius: 0; border: 0; }
.dash-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-500); background: var(--paper); z-index: 1; transition: opacity .3s, visibility .3s; }
.dash-loading.done { opacity: 0; visibility: hidden; }
.dash-loading .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--cobalt-600); border-top-color: transparent; animation: spin .8s linear infinite; }
.dash-hint { margin-top: 10px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dash-grid .card + .card { margin-top: 0; }
.dash-card { display: flex; align-items: center; gap: 14px; }
.dash-card:hover { border-color: var(--cobalt-500); background: var(--sky-50); }
.dc-ic { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--sky-100); color: var(--cobalt-700); }
.dc-powerbi { background: var(--amber-100); color: var(--amber-700); }
.dc-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dc-txt b { font-weight: 600; } .dc-txt small { color: var(--ink-400); }
.dc-meta { font-size: 12.5px; color: var(--ink-400); white-space: nowrap; }
.home-dash { margin-bottom: 18px; }
.home-dash .dash-frame { height: var(--h, 560px); }
.home-dash .card-title .live-dot { margin-inline-start: 8px; }
.howto ol { margin: 0; padding-inline-start: 20px; line-height: 2; }
.feed-card.off { opacity: .7; }
.feed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 8px; }
@media (max-width: 960px) { .feed-grid { grid-template-columns: minmax(0, 1fr); } }
.feed-card .share-field { max-width: none; }
textarea.code { font-family: Consolas, 'Courier New', monospace; font-size: 12.5px; background: var(--paper); line-height: 1.6; direction: ltr; text-align: end; }
.cols-list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.cols-list span { color: var(--ink-500); } .cols-list b { color: var(--ink-900); font-weight: 500; }

/* ---------------------------------------------------------------- System update */
.upload-box { display: flex; gap: 18px; align-items: flex-start; border: 1px dashed #B7C4D8; background: var(--sky-50); }
.ub-ic { width: 56px; height: 56px; border-radius: 12px; background: var(--navy-900); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.ub-body h3 { margin: 2px 0 4px; font-size: 17px; }
.update-review { border-top: 3px solid var(--cobalt-600); }
.update-review .notes li { padding: 6px 0; }
.update-review .notes li::before { content: '— '; color: var(--cobalt-600); }
.file-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 10px; font-size: 13px; }
.file-cols ul { margin: 6px 0 0; padding-inline-start: 18px; max-height: 240px; overflow-y: auto; color: var(--ink-500); }
.appfoot .ver { font-size: 12px; color: var(--ink-300); }

/* ---------------------------------------------------------------- Daily rounds */
.score { display: inline-block; font-weight: 700; padding: 2px 10px; border-radius: 999px; font-size: 13px; background: var(--mist); }
.score.sc-good, .sc-good .score-num { color: var(--green-700); } .score.sc-good { background: var(--green-100); }
.score.sc-mid, .sc-mid .score-num { color: var(--amber-700); } .score.sc-mid { background: var(--amber-100); }
.score.sc-bad, .sc-bad .score-num { color: var(--red-600); } .score.sc-bad { background: var(--red-100); }
.d-bar > span.sc-good { background: var(--green-700); } .d-bar > span.sc-mid { background: var(--amber-500); } .d-bar > span.sc-bad { background: var(--red-600); }
.dist.comp .dist-row { grid-template-columns: minmax(150px, 45%) 1fr 50px; }
.inline-score { display: flex; align-items: center; gap: 10px; } .inline-score .d-bar { width: 120px; }
.check-list { display: flex; flex-direction: column; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line-soft); }
.check-row:first-child { border-top: none; }
.check-list.compact .check-row { padding: 8px 2px; font-size: 14px; }
.cr-label { font-weight: 500; line-height: 1.6; }
.yn { display: flex; gap: 6px; flex: none; }
.yn label { margin: 0; cursor: pointer; }
.yn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yn span { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid #C9D3E1; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--ink-500); background: var(--surface); transition: all .15s; white-space: nowrap; }
.yn .yes input:checked + span { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.yn .no input:checked + span { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.yn input:focus-visible + span { box-shadow: var(--focus); }
.yn-val { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.yn-val.ok { color: var(--green-700); } .yn-val.bad { color: var(--red-600); }
.score-meter { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; margin-top: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line-soft); }
.score-meter span { color: var(--ink-500); font-weight: 500; }
.score-meter b { font-size: 26px; text-align: end; }
.score-meter .sm-bar { grid-column: 1 / -1; height: 10px; background: var(--mist); border-radius: 5px; overflow: hidden; }
.score-meter .sm-bar i { display: block; height: 100%; width: 0; background: var(--ink-300); transition: width .35s ease, background-color .2s; }
.score-meter small { grid-column: 1 / -1; color: var(--ink-400); }
.score-meter.sc-good b { color: var(--green-700); } .score-meter.sc-good .sm-bar i { background: var(--green-700); }
.score-meter.sc-mid b { color: var(--amber-700); } .score-meter.sc-mid .sm-bar i { background: var(--amber-500); }
.score-meter.sc-bad b { color: var(--red-600); } .score-meter.sc-bad .sm-bar i { background: var(--red-600); }
.score-meter.big { margin-top: 0; } .score-meter.big b { font-size: 36px; }
.v-block { border: 1px solid #EBC3BA; border-inline-start: 4px solid var(--red-600); background: #FDF8F7; border-radius: var(--r-sm); padding: 12px 14px 4px; margin-bottom: 12px; }
.v-block .v-num { color: var(--red-700); }
.v-emp-hint.ok { color: var(--green-700); }
.v-card { border: 1px solid var(--line-soft); border-inline-start: 4px solid var(--amber-500); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 10px; }
.v-card.corrected { border-inline-start-color: var(--green-700); background: var(--paper); }
.v-desc { margin: 8px 0 0; color: var(--ink-700); line-height: 1.8; }
.v-emp-box { text-align: end; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.v-fix { margin-top: 8px; font-size: 13px; color: var(--green-700); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.v-fix-form { display: flex; gap: 8px; margin-top: 10px; }
.v-fix-form input { height: 32px; font-size: 13.5px; }
.inline-form { display: inline; margin: 0; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.photo-grid img { width: 150px; height: 110px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: var(--r); margin-bottom: 10px; }
.bulk-bar input[type=text] { max-width: 320px; height: 34px; }
.item-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line-soft); margin: 0; }
.item-row:first-of-type { border-top: none; }
.item-row .ord { width: 64px; flex: none; }
.item-row.new input[type=text] { border-style: dashed; }
.import-notes { margin: 6px 0 10px; padding-inline-start: 18px; line-height: 1.9; }
@media (max-width: 640px) {
    .check-row { flex-direction: column; align-items: stretch; }
    .yn { width: 100%; } .yn label { flex: 1; } .yn span { width: 100%; justify-content: center; height: 46px; }
    .round-form .btn-lg { width: 100%; }
}
@media (max-width: 640px) { .form-grid.g3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- Attendance */
.row-urgent td { background: #FDF8F7; }
.att-sheet td { vertical-align: top; }
.att-detail td { background: var(--paper); padding: 12px 16px; }
.punch-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.punch { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }
.punch small { color: var(--ink-400); }
.punch.ignored { opacity: .5; text-decoration: line-through; }
.att-edit { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.att-edit form { margin: 0; }
.att-edit input, .att-edit select { height: 34px; font-size: 13.5px; width: auto; }
.att-edit input.mini { width: 74px; }
.dev-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 8px; background: var(--ink-300); }
.dev-dot.ok { background: #2FA36B; } .dev-dot.warn { background: var(--amber-500); } .dev-dot.bad { background: var(--red-600); }
.pat-strip { display: flex; flex-wrap: wrap; gap: 4px; }
.pat-strip span { padding: 2px 8px; border-radius: 4px; background: var(--mist); color: var(--ink-400); font-size: 12px; }
.pat-strip span.on { background: var(--sky-100); color: var(--cobalt-700); }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.assign-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.assign-bar > div { min-width: 160px; }
.roster-wrap { max-height: 70vh; overflow: auto; }
.roster th, .roster td { padding: 4px 4px; text-align: center; white-space: nowrap; }
.roster th.we { background: #F1ECE1; } .roster th.today { background: var(--sky-100); }
.roster .sticky-col { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 2; text-align: start; min-width: 170px; }
.roster thead th { position: sticky; top: 0; z-index: 3; }
.roster thead th.sticky-col { z-index: 4; }
.roster select { height: 30px; padding: 0 4px; font-size: 12.5px; min-width: 64px; border-color: transparent; background: transparent; }
.roster td.rc:hover select { border-color: var(--line); }
.roster td.is-set { background: var(--sky-50); } .roster td.is-set select { color: var(--cobalt-700); font-weight: 600; }
.roster td.is-off { background: #F4F1EA; } .roster td.is-off select { color: var(--ink-500); }
.roster td.changed { box-shadow: inset 0 0 0 2px var(--amber-500); }
.rule-table input { height: 32px; }
hr.sep { border: none; border-top: 1px solid var(--line-soft); margin: 16px 0; }
/* المبيت والأسعار */
.stay-line th, .stay-line td { padding: 6px 2px; text-align: center; min-width: 22px; }
.stay-line td.on { background: var(--sky-200); }
.stay-line td.on.first { border-inline-start: 3px solid var(--cobalt-600); }
.stay-line td.on.last { border-inline-end: 3px solid var(--cobalt-600); }
.stay-line th.today { background: var(--sky-100); }
.stay-line .sticky-col { position: sticky; inset-inline-start: 0; background: var(--surface); text-align: start; min-width: 180px; z-index: 1; }
.w-auto { width: auto; }
.rates-grid input { width: 96px; height: 34px; }
.rates-grid input.custom { background: var(--sky-50); border-color: var(--cobalt-500); font-weight: 600; }
.rates-grid .def-row td { background: var(--paper); }
/* الجداول والتغطية */
.var-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 900px) { .var-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vd { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; background: var(--surface); }
.vd b { display: block; margin-bottom: 6px; font-weight: 500; }
.vd select { height: 34px; font-size: 13px; }
.vd.is-off { background: #F4F1EA; }
.vnew { display: flex; gap: 4px; margin-top: 6px; } .vnew input { height: 32px; font-size: 12.5px; padding: 0 4px; }
.ex-row { margin-bottom: 6px; } .ex-row select, .ex-row input { height: 34px; }
.cov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cov-grid .card + .card { margin-top: 0; }
.cov-n { font-size: 13px; margin: 6px 0 8px; } .text-green { color: var(--green-700); }
.cov-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.cov-list li { padding: 4px 0; border-top: 1px solid var(--line-soft); }
.cov-list li.rest { color: var(--ink-400); } .cov-list li.miss a { color: var(--red-700); }
/* الجداول المتغيرة للموظفين */
.es-grid th, .es-grid td { padding: 6px 6px; white-space: nowrap; }
.es-grid .sticky-col { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 190px; }
.es-grid select { height: 34px; font-size: 13px; min-width: 104px; padding: 0 6px; }
.es-grid select.is-set { background: var(--sky-50); border-color: var(--sky-200); color: var(--cobalt-700); font-weight: 500; }
.es-grid select.is-off { background: #F4F1EA; color: var(--ink-500); }
.es-grid tr[data-changed] td { background: #FFFBEF; }
.off-n.ok { color: var(--green-700); font-weight: 600; } .off-n.bad { color: var(--red-600); font-weight: 600; }
.dept-shifts .chip { gap: 6px; } .dept-shifts .chip .btn-link { color: var(--cobalt-700); font-size: 15px; line-height: 1; }

.es-grid thead th.sticky-col, .roster thead th.sticky-col, .stay-line thead th.sticky-col { background: var(--mist); }
/* صلاحية كاملة */
.admin-box > summary { cursor: pointer; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.admin-box[open] > summary { margin-bottom: 4px; }
.danger-zone { margin-top: 14px; padding: 12px 14px; border: 1px dashed #E3B4AA; background: #FDF6F4; border-radius: var(--r-sm); }
/* البحث المتطور */
mark.hl { background: #FFE58A; color: inherit; padding: 0 1px; border-radius: 2px; }
.ss { position: relative; }
.ss .ss-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; inset: 0; }
.ss-input { width: 100%; background-image: linear-gradient(45deg, transparent 50%, var(--ink-400) 50%), linear-gradient(135deg, var(--ink-400) 50%, transparent 50%); background-position: 14px 52%, 9px 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-start: 12px; }
.ss.open .ss-input { border-color: var(--cobalt-500); box-shadow: var(--focus); }
.ss-list { position: absolute; top: calc(100% + 4px); inset-inline: 0; z-index: 40; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 12px 32px rgba(11,26,58,.16); padding: 4px; min-width: 220px; }
.ss-opt { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1.5; }
.ss-opt:hover, .ss-opt.act { background: var(--sky-50); }
.ss-opt.sel { font-weight: 600; color: var(--cobalt-700); }
.ss-opt.ss-empty { color: var(--ink-400); }
.ss-none, .eq-hint { padding: 10px; color: var(--ink-400); font-size: 13px; }
.filters .ss { min-width: 170px; }
.emp-quick { position: relative; }
.eq-panel { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 380px; max-width: calc(100vw - 30px); background: var(--surface); color: var(--ink-900); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 18px 48px rgba(11,26,58,.22); padding: 10px; z-index: 70; }
.eq-panel input { width: 100%; }
.eq-results { max-height: 380px; overflow-y: auto; margin-top: 6px; }
.eq-row { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 6px; color: var(--ink-900); }
.eq-row:hover { background: var(--sky-50); }
.eq-row span { font-size: 12.5px; color: var(--ink-400); }
.eq-row.left { opacity: .6; }
/* اللغة */
.lang-btn { font-weight: 700; font-size: 13px; letter-spacing: .3px; }
html[dir="ltr"] .m-btn .caret, html[dir="ltr"] .who .caret { transform: rotate(-90deg); }
html[dir="ltr"] .m-panel { transform-origin: top left; }
html[dir="ltr"] .m-panel.align-end { transform-origin: top right; }
html[dir="ltr"] body { font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
html[dir="ltr"] .to-top svg { transform: rotate(90deg); }
.th-admin { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.direct-approve { margin-top: 14px; padding: 10px 14px; background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: var(--r-sm); }
.tr-table td { vertical-align: middle; } .tr-table input { width: 100%; height: 34px; }
.tr-table input.custom { background: var(--sky-50); border-color: var(--cobalt-500); }

/* ================================================================ صفحة الموظفين (3.6) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon-only { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--ink-500); cursor: pointer; padding: 0; list-style: none; }
.icon-only::-webkit-details-marker { display: none; }
.icon-only:hover { background: var(--mist); color: var(--cobalt-700); }
.ellip { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-s { margin-bottom: 10px; }
.tab-n { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--mist); color: var(--ink-500); font-size: 11.5px; font-weight: 600; line-height: 18px; text-align: center; }
.pill-tabs a.active .tab-n, .btn .tab-n { background: var(--sky-100); color: var(--cobalt-700); }

/* المؤشرات */
.emp-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.emp-kpis > a { transition: background-color .15s; }
.emp-kpis > a.on { background: var(--sky-50); box-shadow: inset 0 -3px 0 var(--cobalt-600); }
.emp-kpis b { font-size: 26px; }
.emp-dist { padding: 12px 18px; margin-bottom: 16px; }
.emp-dist summary { cursor: pointer; font-size: 14px; }
.dist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 28px; margin-top: 12px; }
.dist-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 38px 38px; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; font-size: 13.5px; }
.dist-row:hover, .dist-row.on { background: var(--sky-50); }
.dist-row.on .dist-name { font-weight: 600; color: var(--cobalt-700); }
.dist-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-bar { height: 8px; border-radius: 4px; background: var(--mist); overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 4px; background: var(--cobalt-500); }
.dist-row b { text-align: end; }

/* الفلاتر */
.emp-status-tabs { margin-bottom: 12px; }
.emp-filters { display: block; padding: 12px 14px; margin-bottom: 10px; }
.ef-main { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ef-main input[type=search] { flex: 1 1 300px; width: auto; }
.ef-main select, .ef-main .ss { flex: 0 1 190px; width: auto; }
.adv-toggle[aria-expanded="true"] { border-color: var(--cobalt-500); color: var(--cobalt-700); background: var(--sky-50); }
.ef-adv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ef-adv label { font-size: 12.5px; color: var(--ink-500); margin-bottom: 4px; }
.ef-adv .full { grid-column: 1 / -1; }
.ef-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ef-checks label.check { color: var(--ink-700); font-size: 13.5px; margin: 0; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.af-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 14px; background: var(--sky-100); color: var(--cobalt-700); font-size: 12.5px; font-weight: 500; }
.af-chip span { font-size: 10px; opacity: .7; }
.af-chip:hover { background: var(--red-100); color: var(--red-700); }

/* شريط الأدوات */
.emp-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 2px; gap: 2px; }
.seg a, .seg label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; font-size: 13px; color: var(--ink-500); cursor: pointer; margin: 0; }
.seg a:hover, .seg label:hover { color: var(--ink-900); background: var(--mist); }
.seg a.on, .seg label:has(input:checked) { background: var(--cobalt-600); color: #fff; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.per-pick { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.per-pick select { width: auto; height: 32px; padding: 0 8px; }
.tb-drop { position: relative; }
.tb-drop > summary { list-style: none; }
.tb-drop > summary::-webkit-details-marker { display: none; }
.tb-panel { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 45; width: 340px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px rgba(11,26,58,.18); padding: 10px; }
.tb-group { font-size: 11.5px; font-weight: 600; color: var(--ink-400); padding: 8px 6px 4px; text-transform: uppercase; }
.view-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-radius: 6px; }
.view-item a { flex: 1; padding: 7px 8px; font-size: 14px; }
.view-item:hover, .view-item.on { background: var(--sky-50); }
.view-item.on a { font-weight: 600; color: var(--cobalt-700); }
.view-item form { margin: 0; }
.view-save { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.view-save label { font-size: 12.5px; color: var(--ink-500); }
.view-save input[type=text] { flex: 1; min-width: 0; }
.view-save .row-gap { flex-wrap: nowrap; }

/* الجدول */
.emp-table-wrap { max-height: calc(100vh - 150px); overflow: auto; }
.emp-table thead th { position: sticky; top: 0; z-index: 3; background: var(--mist); box-shadow: 0 1px 0 var(--line); }
.emp-table td.sel-col, .emp-table th.sel-col { width: 36px; padding-inline-end: 0; }
.emp-table input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--cobalt-600); }
.emp-table tbody tr { cursor: default; }
.emp-table tbody tr.is-sel { background: var(--sky-50); }
.emp-table .act-col { width: 70px; white-space: nowrap; text-align: end; }
.emp-table .act-col > * { vertical-align: middle; }
.th-sort { display: inline-flex; align-items: center; gap: 5px; color: inherit; white-space: nowrap; }
.th-sort i { width: 0; height: 0; border-inline: 4px solid transparent; border-top: 5px solid var(--ink-300); opacity: 0; transition: opacity .15s; }
.th-sort:hover i { opacity: 1; }
.th-sort.on { color: var(--cobalt-700); }
.th-sort.on i { opacity: 1; border-top-color: var(--cobalt-600); }
.th-sort.on.asc i { transform: rotate(180deg); }
.name-cell { min-width: 220px; }
.nc { display: flex; align-items: center; gap: 10px; }
.emp-av { width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; background: var(--sky-100); color: var(--cobalt-700); border: 1px solid rgba(15,27,45,.06); }
.emp-av.xl { width: 72px; height: 72px; font-size: 24px; }
.emp-av.lg { width: 56px; height: 56px; font-size: 19px; }
.emp-av.t2 { background: var(--teal-100); color: var(--teal-700); }
.emp-av.t3 { background: var(--violet-100); color: var(--violet-700); }
.emp-av.t4 { background: var(--amber-100); color: var(--amber-700); }
.emp-av.t5 { background: var(--green-100); color: var(--green-700); }
.emp-av.t6 { background: var(--red-100); color: var(--red-700); }
.chip.es-active { background: var(--green-100); color: var(--green-700); }
.chip.es-probation { background: var(--sky-100); color: var(--cobalt-700); }
.chip.es-on_leave { background: var(--teal-100); color: var(--teal-700); }
.chip.es-suspended { background: var(--amber-100); color: var(--amber-700); }
.chip.es-resigned, .chip.es-terminated { background: var(--mist); color: var(--ink-500); }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; }
.rm-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 14px 36px rgba(11,26,58,.18); padding: 5px; text-align: start; }
.rm-panel a, .rm-panel button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13.5px; color: var(--ink-700); background: none; border: none; cursor: pointer; text-align: start; white-space: nowrap; }
.rm-panel a:hover, .rm-panel button:hover { background: var(--sky-50); color: var(--cobalt-700); }
.rm-panel svg { color: var(--ink-400); }

/* الكروت */
.emp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cards-all { grid-column: 1 / -1; margin: 0; }
.emp-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px 14px; text-align: center; transition: border-color .15s, box-shadow .15s; }
.emp-card:hover { border-color: var(--sky-200); box-shadow: 0 8px 24px rgba(11,26,58,.07); }
.emp-card.is-sel { border-color: var(--cobalt-500); box-shadow: 0 0 0 2px var(--sky-200); }
.emp-card > .sel { position: absolute; top: 12px; inset-inline-start: 12px; width: 16px; height: 16px; accent-color: var(--cobalt-600); }
.ec-menu { position: absolute; top: 8px; inset-inline-end: 8px; }
.ec-photo { background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%; }
.ec-name { margin-top: 8px; line-height: 1.4; }
.ec-job { font-size: 13px; color: var(--ink-500); margin-top: 2px; }
.ec-tags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.ec-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 13px; text-align: start; }
.ec-meta dt { color: var(--ink-400); }
.ec-meta dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* شجرة المديرين */
.org-tree { padding: 16px 18px; }
.tree-root, .tree-root ul { list-style: none; margin: 0; padding: 0; }
.tree-root ul { padding-inline-start: 28px; margin-inline-start: 18px; border-inline-start: 1px dashed var(--line); }
.tree-root li { margin: 6px 0; position: relative; }
.tree-root ul > li::before { content: ''; position: absolute; top: 24px; inset-inline-start: -28px; width: 24px; border-top: 1px dashed var(--line); }
.tree-root summary { list-style: none; cursor: pointer; }
.tree-root summary::-webkit-details-marker { display: none; }
.tn-card { display: inline-flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 280px; max-width: 100%; }
.tree-root summary .tn-card { border-inline-start: 3px solid var(--cobalt-500); }
.tree-root details[open] > summary .tn-card { background: var(--sky-50); }
.tn-txt { display: flex; flex-direction: column; line-height: 1.35; flex: 1; min-width: 0; }
.tn-count { background: var(--cobalt-600); color: #fff; border-radius: 12px; padding: 0 9px; font-size: 12px; font-weight: 600; line-height: 22px; white-space: nowrap; }
.tn-count small { opacity: .75; font-weight: 500; }
.tree-root.flat { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px 12px; margin-top: 10px; }
.tree-root.flat li { margin: 0; }
.tree-root.flat .tn-card { min-width: 0; width: 100%; }
.tree-solo { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.tree-solo > summary { cursor: pointer; color: var(--ink-500); }
/* 3.21: الإدارة التنفيذية في رأس الهيكل */
.org-exec { padding: 16px 18px; }
.oe-title { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.oe-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.oe-stats span { background: var(--sky-50); border: 1px solid var(--line-soft); border-radius: 10px; padding: 4px 10px; font-size: 13px; color: var(--ink-500); }
.oe-stats b { color: var(--ink-900); font-size: 15px; margin-inline-end: 3px; }
.oe-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.oe-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); min-width: 260px; flex: 0 1 340px; }
.oe-card > div { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.oe-card .emp-av { width: 48px; height: 48px; font-size: 18px; }
.oe-ceo { border: 2px solid #C9932E; background: linear-gradient(135deg, #FFF8EA, var(--surface)); }
.oe-dep { border: 2px solid var(--cobalt-500); background: linear-gradient(135deg, var(--sky-50), var(--surface)); }
.oe-empty { border-style: dashed; color: var(--ink-500); }
.oe-role { font-size: 12px; font-weight: 700; color: var(--cobalt-600); }
.oe-ceo .oe-role { color: #9A6B12; }
.oe-edit { margin-top: 12px; } .oe-edit > summary { cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.oe-edit form { margin: 10px 0 0; align-items: flex-end; } .oe-edit label { display: flex; flex-direction: column; gap: 4px; }
.tn-role { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 6px; align-self: flex-start; margin-bottom: 2px; }
.tn-role.ceo { background: #F6E3B8; color: #7A5410; } .tn-role.dep { background: var(--sky-50); color: var(--cobalt-600); border: 1px solid var(--line-soft); }
.tree-root summary .tn-card.tn-ceo, .tn-card.tn-ceo { border: 2px solid #C9932E; background: #FFF8EA; }
.tree-root summary .tn-card.tn-dep, .tn-card.tn-dep { border: 2px solid var(--cobalt-500); }
.tree-tools { flex-wrap: wrap; gap: 8px; }
.org-tree .tn-hit { outline: 2px solid #E9A25B; outline-offset: 1px; }
.org-tree.searching .tree-help { display: none; }
@media print { .oe-edit, .tree-tools, .tree-help { display: none !important; } .org-tree details:not([open]) > ul { display: block; } }

/* الإجراءات الجماعية */
#bulkBar.bulk-bar { position: fixed; bottom: 18px; inset-inline: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 32px); z-index: 60; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--navy-900); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 18px 48px rgba(11,26,58,.35); }
#bulkBar.bulk-bar[hidden] { display: none; }
.bb-info { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bb-info b { background: var(--sky-400); color: var(--navy-950); border-radius: 12px; padding: 0 9px; line-height: 22px; }
.bb-info .link, .bb-info .muted { color: var(--sky-200); background: none; border: none; cursor: pointer; font: inherit; font-size: 13px; }
.bb-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bb-actions .btn-outline { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.bb-actions .btn-outline:hover { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }
.bb-actions .btn-link { color: var(--sky-200); margin-inline-start: 6px; }
body.has-bulk .page-wrap { padding-bottom: 90px; }
.modal.wide { max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; }
.modal label { display: block; }
.modal select, .modal input[type=text], .modal input[type=date], .modal textarea { width: 100%; }
.modal .row-gap { justify-content: flex-end; }
.emp-modal[hidden] { display: none; }
.col-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; margin-top: 8px; }
.col-picks label.check { margin: 0; font-size: 13.5px; }
.ex-kind { margin-top: 4px; }

/* المعاينة السريعة */
.qv-shade { position: fixed; inset: 0; background: rgba(11,26,58,.28); z-index: 110; }
.qv-drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 440px; max-width: 100vw; background: var(--surface); z-index: 120; box-shadow: 0 0 60px rgba(11,26,58,.3); display: flex; flex-direction: column; animation: qvIn .22s cubic-bezier(.2,.8,.2,1); }
@keyframes qvIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
html[dir="ltr"] .qv-drawer { animation-name: qvInL; }
@keyframes qvInL { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.qv-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.qv-body { flex: 1; overflow-y: auto; padding: 18px; }
.qv-loading { color: var(--ink-400); text-align: center; padding: 40px 0; }
.qv-hero { display: flex; gap: 14px; align-items: center; }
.qv-hero h2 { font-size: 18px; margin: 0; line-height: 1.35; }
.qv-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.qv-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 16px 0; }
.qv-actions .btn { justify-content: flex-start; }
.qv-sec { margin-top: 16px; }
.qv-sec h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink-400); font-weight: 600; }
.qv-kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.qv-kv dt { color: var(--ink-500); }
.qv-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.qv-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qv-stats div { padding: 8px; text-align: center; border-inline-start: 1px solid var(--line-soft); }
.qv-stats div:first-child { border-inline-start: none; }
.qv-stats b { display: block; font-size: 18px; }
.qv-stats small { font-size: 11.5px; color: var(--ink-500); }
.qv-bal { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.qv-bal:first-of-type { border-top: none; }

/* الصورة في الملف وتعديل البيانات */
.ph-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ph-avatar { overflow: hidden; }
.photo-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.navbar .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.navbar .avatar { overflow: hidden; }

@media (max-width: 760px) {
    .emp-toolbar { flex-direction: column; align-items: stretch; }
    .seg { overflow-x: auto; }
    #bulkBar.bulk-bar { bottom: 8px; padding: 8px 10px; }
    .qv-actions { grid-template-columns: minmax(0, 1fr); }
    .dist-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print { .emp-toolbar, .bulk-bar, .emp-dist, .active-filters, .sel-col, .act-col, .ec-menu, .emp-card > .sel, .qv-drawer, .qv-shade { display: none !important; } .emp-table-wrap { max-height: none; overflow: visible; } }
.emp-table tbody tr.qv-on { background: var(--sky-100); }
.qv-drawer[hidden], .qv-shade[hidden], .ef-adv[hidden] { display: none; }
button.link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
.modal.wide { overflow: visible; }
.modal.wide.tall { overflow-y: auto; }

/* ===================== الجزاءات ومستوى الالتزام (3.7) ===================== */
.cmp { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 13px; background: var(--mist); cursor: help; outline: none; }
.cmp b { font-weight: 700; }
.cmp.cmp-good { background: var(--green-100); color: var(--green-700); }
.cmp.cmp-mid { background: var(--amber-100); color: var(--amber-700); }
.cmp.cmp-bad { background: var(--red-100); color: var(--red-600); }
.cmp.cmp-na { color: var(--ink-400); }
.cmp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red-600); display: inline-block; }
b.cmp-good, .qv-stats b.cmp-good { color: var(--green-700); } b.cmp-mid { color: var(--amber-700); } b.cmp-bad { color: var(--red-600); }
.cmp .cmp-tip { display: none; }
.cmp-float { position: fixed; z-index: 200; width: 290px; background: var(--surface); color: var(--ink-700); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 14px 36px rgba(11,26,58,.2); padding: 10px 12px; font-size: 13px; pointer-events: none; text-align: start; white-space: normal; }
.cmp-float .ct-head { font-weight: 600; margin-bottom: 6px; color: var(--navy-800); }
.cmp-float .ct-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.cmp-float .ct-row small { grid-column: 1 / -1; font-size: 12px; }
.cmp-float .ct-bar { grid-column: 1 / -1; height: 5px; background: var(--mist); border-radius: 3px; overflow: hidden; }
.cmp-float .ct-bar i { display: block; height: 100%; background: var(--ink-300); }
.cmp-float .ct-bar i.cmp-good { background: var(--green-700); } .cmp-float .ct-bar i.cmp-mid { background: var(--amber-500); } .cmp-float .ct-bar i.cmp-bad { background: var(--red-600); }
.qv-sec h4 .cmp { margin-inline-start: 6px; }

.snc-calc { padding: 12px 14px; border-radius: var(--r-sm); background: var(--paper); border: 1px dashed var(--line); color: var(--ink-500); font-size: 14px; line-height: 1.8; }
.snc-calc.ok { background: var(--sky-50); border-color: var(--sky-200); color: var(--navy-800); }
.snc-calc.warn { background: var(--amber-100); border-color: #EDD5A8; color: var(--amber-700); }
.snc-top { margin: -6px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.emp-cell { display: flex; align-items: center; gap: 10px; }
.emp-av.sm { width: 30px; height: 30px; font-size: 12px; }
tr.row-off td { opacity: .55; }
.snc-cancel .rm-panel { padding: 10px; min-width: 260px; }
.snc-cancel .rm-panel button { justify-content: center; color: #fff; }
.reg-cat { margin: 18px 0 8px; color: var(--navy-800); }
.reg-table td { vertical-align: middle; }
.rule-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rule-form .ord { width: 70px; flex: none; }
.rule-form .grow { flex: 1 1 260px; }
.rule-form select { width: auto; max-width: 170px; }
.rule-form.new { padding-top: 6px; }
tr.rule-edit td { background: var(--sky-50); }
.center { text-align: center; }

/* ---------------------------------------------------------------- 3.8 ملف الموظف 360 */
.e360-hero .emp-av.xl { width: 84px; height: 84px; border-radius: 14px; font-size: 28px; }
.e360-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 14px; }
.e360-kpis b { font-size: 22px; }
.e360-kpis b.small-num { font-size: 16px; padding-top: 6px; }
.e360-kpis b .cmp { font-size: 15px; }
.e360-kpis b.cmp-good { color: var(--green-700); } .e360-kpis b.cmp-mid { color: var(--amber-700); } .e360-kpis b.cmp-bad { color: var(--red-600); }
.e360-tabs { flex-wrap: wrap; }
.e360-tabs a { white-space: nowrap; }
.e360-cmp { grid-template-columns: repeat(3, 1fr); }
.e360-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.e360-tl li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.e360-tl li:last-child { border-bottom: none; }
.e360-tl.compact li { padding: 6px 0; }
.e360-tl-date { font-size: 12.5px; color: var(--ink-500); padding-top: 2px; }
.e360-tl li.e360-tl-year { display: block; border: none; padding: 14px 0 4px; font-weight: 600; color: var(--ink-900); font-size: 15px; }
.e360-tl li.k-sanction .e360-tl-date, .e360-tl li.k-exit .e360-tl-date { color: var(--red-600); }
.e360-kind-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.e360-kind-filter a.chip { text-decoration: none; }
.e360-team { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.e360-team li { display: flex; align-items: center; gap: 8px; }
.e360-dq { display: flex; flex-wrap: wrap; gap: 6px; }
tr.is-cancelled td { opacity: .55; }
.dq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .dq-grid { grid-template-columns: minmax(0, 1fr); } }
.dq-list { list-style: none; margin: 0; padding: 0; }
.dq-list li a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-900); }
.dq-list li a:hover, .dq-list li.on a { background: var(--sky-50); }
.dq-list li.on a { box-shadow: inset 3px 0 0 var(--cobalt-600); }
.dq-list li b { font-size: 16px; }
.dq-list li.zero a { color: var(--ink-400); }
.dq-list li.zero b { color: var(--green-700); }
.e360-chg { font-size: 13px; margin-top: 2px; }
.dq-grid > .card { margin: 0; }
.stat-band .e360-cmpwrap { margin-top: 6px; }
.stat-band .e360-cmpwrap .cmp { display: inline-flex; font-size: 15px; }
.stat-band .e360-cmpwrap .cmp b { display: inline; font-size: inherit; margin: 0; color: inherit; }
.stat-band .cmp-tip, .stat-band .cmp-tip span { display: none; }
.stat-band .e360-cmpwrap .cmp-dot { display: inline-block; }
.dq-mig { grid-template-columns: repeat(5, 1fr); }

/* ---------------------------------------------------------------- 3.9 المستندات والمؤهلات والمعالين والعهد */
.rec-form > summary { cursor: pointer; font-weight: 600; color: var(--cobalt-700); list-style: none; display: flex; align-items: center; gap: 6px; }
.rec-form > summary::-webkit-details-marker { display: none; }
.rec-form[open] > summary { margin-bottom: 4px; }
.row-actions { white-space: nowrap; }
.row-actions .inline-form, .row-actions > a { margin-inline-start: 4px; }
.row-actions .input-sm { width: 140px; display: inline-block; margin-inline-start: 4px; }
.req-docs { list-style: none; margin: 0; padding: 0; }
.req-docs li { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.req-docs li:last-child { border-bottom: none; }
.doc-types td { vertical-align: middle; }
.doc-types select[multiple] { min-width: 220px; height: auto; }

/* ---------------------------------------------------------------- 3.10 التدريب وتقييم الأداء */
.e360-cmp { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
.perf-score { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; background: var(--mist); color: var(--ink-700); white-space: nowrap; }
.perf-score b { font-size: 14px; }
.perf-score.cmp-good { background: var(--green-100); color: var(--green-700); }
.perf-score.cmp-mid { background: var(--amber-100); color: var(--amber-700); }
.perf-score.cmp-bad { background: var(--red-100); color: var(--red-700); }
.perf-big .perf-score { font-size: 16px; padding: 6px 16px; }
.perf-big .perf-score b { font-size: 22px; }
.perf-pt { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; background: var(--mist); color: var(--ink-700); }
.perf-pt.p5 { background: var(--green-100); color: var(--green-700); }
.perf-pt.p4 { background: var(--teal-100); color: var(--teal-700); }
.perf-pt.p3 { background: var(--sky-100); color: var(--cobalt-700); }
.perf-pt.p2 { background: var(--amber-100); color: var(--amber-700); }
.perf-pt.p1 { background: var(--red-100); color: var(--red-700); }
.perf-legend { display: inline-flex; align-items: center; gap: 4px; margin-inline-end: 12px; }
.perf-legend .perf-pt { width: 20px; height: 20px; font-size: 11px; }
.perf-sel { min-width: 140px; }
.perf-table td { vertical-align: middle; }
.perf-crit input[type=text] { width: 100%; }
.perf-crit-list { list-style: none; margin: 0; padding: 0; }
.perf-crit-list li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.perf-crit-list li:last-child { border-bottom: none; }
.perf-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.perf-steps span { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; background: var(--mist); color: var(--ink-400); }
.perf-steps span.done { background: var(--green-100); color: var(--green-700); }
.perf-steps span.now { background: var(--cobalt-600); color: #fff; font-weight: 600; }
@media (max-width: 640px) { .e360-cmp { grid-template-columns: repeat(2, 1fr); } .perf-sel { min-width: 0; width: 100%; } }

/* ---------------------------------------------------------------- 3.11 المرتبات وعلاقات الموظفين والفلاتر */
.payslip { font-size: 14px; }
.ps-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 2px solid var(--ink-900); }
.ps-head b { font-size: 16px; }
.ps-emp { text-align: end; }
.ps-att { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0; color: var(--ink-500); font-size: 13px; border-bottom: 1px solid var(--line-soft); }
.ps-att b { color: var(--ink-900); }
.ps-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 14px 0; }
.ps-col h4 { margin: 0 0 6px; font-size: 14px; }
.ps-col table { width: 100%; border-collapse: collapse; }
.ps-col td { padding: 6px 4px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ps-col td:last-child { text-align: end; white-space: nowrap; }
.ps-col td small { display: block; color: var(--ink-400); font-size: 12px; }
.ps-col tr.ps-total td { font-weight: 700; border-bottom: none; border-top: 1px solid var(--line); }
.ps-net { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--mist); border-radius: var(--r-sm); }
.ps-net b { font-size: 20px; }
.ps-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 10px; color: var(--ink-500); }
.sal-sum { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 14px; background: var(--mist); border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink-500); }
.sal-sum b { color: var(--ink-900); }
.pay-table td { vertical-align: middle; }
form.inline { display: inline; }
.text-orange { color: var(--amber-700); }
.er-log { list-style: none; margin: 0; padding: 0; }
.er-log li { padding: 10px 0 10px 0; border-bottom: 1px solid var(--line-soft); }
.er-log li:last-child { border-bottom: none; }
.er-log li.k-investigation { border-inline-start: 3px solid var(--red-600); padding-inline-start: 10px; }
.er-log li.k-action { border-inline-start: 3px solid var(--cobalt-600); padding-inline-start: 10px; }
.er-log li.k-status { color: var(--ink-500); }
.quick-search { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.quick-search .chip { text-decoration: none; }
.ef-range { display: flex; gap: 6px; }
.ef-range input { min-width: 0; flex: 1; }
@media (max-width: 640px) { .ps-cols { grid-template-columns: minmax(0, 1fr); } .ps-emp { text-align: start; } }
@media print { .ps-net { background: #F3F6FA; } }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) { .stat-band b.small-num { font-size: 19px; overflow-wrap: anywhere; } }
.cmp-trend { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.cmp-trend > span { display: inline-flex; flex-direction: column; align-items: center; min-width: 30px; }
.cmp-trend small { color: var(--ink-500, #6B7A90); font-size: 11px; }
.stat-band > .band-row-start, .kpi-grid > .band-row-start { border-inline-start: none; }
.stat-band > .band-next-row, .kpi-grid > .band-next-row { border-top: 1px solid var(--line-soft); }

/* 3.12 — صلاحيات الصفحات وسرية الأجور */
.empty-perm { text-align: center; padding: 48px 20px; color: var(--ink-500); }
.empty-perm h3 { margin: 12px 0 6px; color: var(--ink-900, #0F1B2D); }
.sa-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 6px; }
.sa-level { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #C9D3E1; border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; margin: 0; font-weight: 400; }
.sa-level input { margin-top: 4px; }
.sa-level span { display: flex; flex-direction: column; gap: 2px; }
.sa-level small { color: var(--ink-500); font-size: 12.5px; }
.sa-level:has(input:checked) { border-color: var(--cobalt-600); background: rgba(37, 99, 235, .05); }
.checkbox-list.is-off { opacity: .5; }
.perm-ov { border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px 14px; }
.perm-ov summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.perm-ov[open] summary { margin-bottom: 10px; }
.perm-dot.lvg input:checked + span { border-color: var(--ink-300); border-width: 6px; }
.perm-row.is-ov td:first-child { box-shadow: inset 3px 0 0 var(--cobalt-600); }
html[dir="rtl"] .perm-row.is-ov td:first-child { box-shadow: inset -3px 0 0 var(--cobalt-600); }
/* 3.12.1 — نظام القبض */
.card[hidden], [data-pay-rates] [hidden], .form-grid > div[hidden] { display: none !important; }
.pay-chip { white-space: nowrap; }
#salForm fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* 3.13 — جداول الموظفين */
.es-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: var(--r); margin-bottom: 10px; }
.es-toolbar select { height: 34px; font-size: 13px; max-width: 240px; }
.es-grid select { min-width: 215px; }
.es-grid .es-grace { width: 76px; height: 34px; }
.es-grid .es-cur { white-space: normal; max-width: 260px; }
.grace-card { align-items: center; }
.grace-card .hint { flex-basis: 100%; margin: 0; }
.roster select { min-width: 130px; }

/* 3.15.1: إذن من الحضور اليومي */
.perm-btn{margin-top:4px}
.btn-xs{padding:2px 8px;font-size:12px;line-height:1.6}
.perm-dlg{border:0;border-radius:14px;padding:20px;width:min(520px,calc(100vw - 32px));box-shadow:0 20px 50px rgba(0,0,0,.25)}
.perm-dlg::backdrop{background:rgba(15,23,42,.45)}

/* 3.15.2: اقتراحات البحث من أول حرف */
.ss.sg > input { width: 100%; }
.sg .ss-opt { display: flex; flex-direction: column; gap: 1px; }
.sg .ss-opt small { color: var(--ink-400); font-size: 12px; }
.sg .ss-opt.sg-dim { opacity: .6; }
.sg .ss-list { min-width: 280px; }

/* 3.16 — تقييم الأداء */
.form-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.perf-crit-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.perf-dept-list { padding: 10px; display: flex; flex-direction: column; gap: 2px; max-height: 75vh; overflow: auto; }
.perf-dept-list .card-title { padding: 4px 8px; }
.perf-dept-list .pdl { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px; color: var(--ink-700); }
.perf-dept-list .pdl small { color: var(--ink-500); font-size: 12px; }
.perf-dept-list .pdl:hover { background: var(--mist); }
.perf-dept-list .pdl.on { background: var(--sky-100); color: var(--cobalt-700); }
.perf-crit input[type=text] { width: 100%; }
.perf-crit-list { margin: 0; padding-inline-start: 18px; } .perf-crit-list li { margin: 4px 0; }
.perf-wparts { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.perf-wparts span { background: var(--mist); border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.perf-wparts b { color: var(--cobalt-700); margin-inline-end: 4px; }
.pill-tabs.sm a { padding: 6px 10px; font-size: 13px; }
.perf-parts tr.tot td { background: var(--mist); }
.perf-annual h4 { margin: 14px 0 6px; }
@media (max-width: 900px) {
    .form-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .perf-crit-layout { grid-template-columns: minmax(0, 1fr); }
    .perf-dept-list { max-height: none; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 560px) { .form-grid.g4 { grid-template-columns: minmax(0, 1fr); } }

/* 3.17 — فلاتر صفحة الموظفين */
.ef-main { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 10px; align-items: center; }
.ef-main input[type=search], .ef-main select, .ef-main .ss { width: 100%; min-width: 0; flex: none; }
.ef-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ef-btns .btn { white-space: nowrap; }
.qs-drop > summary.is-on { border-color: var(--cobalt-600); color: var(--cobalt-700); background: var(--sky-100); }
.qs-panel { width: 300px; padding: 6px; display: flex; flex-direction: column; }
html[dir=rtl] .qs-panel { inset-inline-start: auto; inset-inline-end: 0; }
html[dir=ltr] .qs-panel { inset-inline-start: auto; inset-inline-end: 0; }
.qs-item { padding: 8px 10px; border-radius: 8px; color: var(--ink-700); font-size: 13.5px; }
.qs-item:hover { background: var(--mist); } .qs-item.on { background: var(--sky-100); color: var(--cobalt-700); font-weight: 600; }
.ef-adv { display: block; }
.ef-sec { margin: 0 0 14px; }
.ef-h { font-size: 13px; font-weight: 700; color: var(--ink-900); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ef-h::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.ef-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; align-items: end; }
.ef-grid > div { min-width: 0; }
.ef-grid select, .ef-grid input:not([type=checkbox]), .ef-grid .ss { width: 100%; min-width: 0; }
.ef-adv-foot { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px dashed var(--line); padding-top: 10px; }
@media (max-width: 1100px) { .ef-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ef-main input[type=search] { grid-column: 1 / -1; } .ef-btns { grid-column: 1 / -1; } }
@media (max-width: 600px) { .ef-main { grid-template-columns: minmax(0, 1fr); } }

/* 3.17 — الشريط العلوي: الرئيسية أيقونة، والقوائم اللي مش هتكفي بتدخل تحت "المزيد" */
.m-hidden { display: none !important; }
.m-more[hidden] { display: none !important; }
.m-home { padding: 0 10px; }
.m-home-txt { display: none; }
.mm-panel.wide { grid-template-columns: repeat(2, minmax(260px, 1fr)); max-height: calc(100vh - 90px); overflow-y: auto; }
.mm-sec { display: flex; flex-direction: column; gap: 2px; }
.mm-h { font-size: 12px; font-weight: 700; color: var(--ink-400); padding: 8px 10px 4px; text-transform: uppercase; letter-spacing: .3px; }
@media (max-width: 1090px) { .m-home-txt { display: inline; } .m-home { padding: 0 13px; } }

/* 3.17 — الحذف من النظام */
.filters.purge-filter { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters.purge-filter > div { min-width: 220px; flex: 0 1 260px; } .filters.purge-filter > div.grow { flex: 1 1 260px; } .filters.purge-filter > div:last-child { min-width: 0; flex: 0 0 auto; }
.filters.purge-filter select, .filters.purge-filter input { width: 100%; max-width: none; flex: none; } .filters.purge-filter .ss { width: 100%; }
.purge-foot { display: flex; justify-content: flex-end; }
/* 3.17 — مديري الأقسام في الفروع */
.dm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; }
.dm-grid > .dm-card { margin: 0 !important; }
.dm-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.dm-row label { margin: 0; font-size: 13px; color: var(--ink-500); }
.dm-row select, .dm-row .ss { width: 100%; min-width: 0; }
.dm-gm label { color: var(--ink-900); font-weight: 600; }
@media (max-width: 560px) { .dm-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
/* 3.17 — الموبايل: القوايم المخفية في الشريط العلوي متعملش scroll بالعرض، والفلاتر والصفوف تلف */
.navbar { overflow-x: clip; }
@media (max-width: 700px) {
    .filters select, .filters input, .filters .ss { max-width: 100%; min-width: 0; }
    .item-row { flex-wrap: wrap; }
    .item-row > input[type=text] { flex: 1 1 100%; }
}
@media (max-width: 700px) { .chip { white-space: normal; max-width: 100%; } }

/* 3.17: مسافة بين كارت وشبكة أرقام بعده */
.card + .kpi-grid { margin-top: 16px; }

/* 3.18: فترة في الحضور اليومي */
.filters .att-range { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted, #6A7A90); }
.filters .att-range input { width: auto; }
.att-range-tot { margin-bottom: 12px; }

/* 3.19: اللوجو */
.brand .brand-logo { height: 38px; max-width: 120px; object-fit: contain; }
.login-side .login-logo { max-height: 90px; max-width: 220px; object-fit: contain; margin-bottom: 14px; }
.pub-brand .pub-logo { height: 42px; max-width: 140px; object-fit: contain; }
.hd-org, .ps-org { display: flex; gap: 12px; align-items: center; }
.doc-logo { max-height: 56px; max-width: 150px; object-fit: contain; }
.print-brand { display: none; }
@media print {
    .print-brand { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid #0F1B2D; padding-bottom: 10px; margin-bottom: 16px; }
    .print-brand .pb-logo { max-height: 56px; max-width: 150px; object-fit: contain; }
    .print-brand b { font-size: 16px; display: block; } .print-brand small { display: block; color: #4A5B73; }
    .print-brand .pb-title { margin-inline-start: auto; text-align: end; font-weight: 600; }
}
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.logo-card .logo-prev { height: 110px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#F1F4F9 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid var(--line, #DCE3EC); border-radius: 10px; margin-bottom: 10px; }
.logo-card .logo-prev img { max-height: 90px; max-width: 85%; object-fit: contain; }
.logo-card .logo-prev.empty span { color: var(--muted, #6A7A90); font-size: 13px; }
.logo-card input[type=file] { max-width: 100%; min-width: 0; flex: 1; }
@media print { .report-letterhead .doc-logo { display: block; margin: 0 auto 8px; } }

/* 3.20: طباعة التقارير — رأس موحّد باللوجو والفلاتر، والجداول بعرض الصفحة */
.print-brand .pb-filters:empty { display: none; }
@media print {
    @page { margin: 12mm 10mm; }
    .print-brand { flex-wrap: wrap; }
    .print-brand .pb-filters { flex-basis: 100%; font-size: 12px; color: #4A5B73; }
    .print-brand .pb-title small { display: block; font-weight: 400; color: #4A5B73; }
    body { background: #fff !important; }
    .table-wrap, .emp-table-wrap, .scroll-x { overflow: visible !important; max-height: none !important; box-shadow: none !important; }
    table.data { font-size: 11px; } table.data th, table.data td { padding: 5px 6px !important; }
    table.data thead { display: table-header-group; } table.data tr { break-inside: avoid; }
    .page-head h1 { font-size: 20px; } .print-brand ~ .page-head h1, .page-head .crumb, .ro-note, .alert, .flash { display: none !important; }
    .stat-band, .kpi-grid { break-inside: avoid; }
    tr[onclick] { cursor: default; } table.data input[type=checkbox], .sel-col { display: none !important; }
}
.fs-cond .cond-tag { background: #FFF3DC; color: #7A5410; border: 1px solid #F0D9A8; border-radius: 8px; padding: 2px 8px; font-weight: 600; }
@media (max-width: 640px) {
    .tn-card { min-width: 0; width: 100%; }
    .tree-root ul { padding-inline-start: 10px; margin-inline-start: 6px; }
    .tree-root ul > li::before { inset-inline-start: -10px; width: 8px; }
    .oe-card { min-width: 0; flex: 1 1 100%; }
}
/* 3.22: شريط نطاق مسئوليات الموارد البشرية */
.scope-note { display: inline-flex; align-items: center; gap: 6px; background: var(--sky-50); border: 1px solid var(--line-soft); color: var(--ink-500); border-radius: 10px; padding: 5px 12px; margin-bottom: 12px; }
.scope-note b { color: var(--cobalt-700); }
/* 3.23: الهيكل التنظيمي كمخطط رأسي في النص */
.oc-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.oc-switch button { background: var(--surface); border: 0; padding: 6px 12px; font: inherit; font-size: 13px; color: var(--ink-500); display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.oc-switch button.on { background: var(--cobalt-600); color: #fff; }
.oc-zoom { display: inline-flex; align-items: center; gap: 4px; }
.oc-zv { min-width: 44px; text-align: center; font-size: 12px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.oc-viewport { direction: ltr; position: relative; overflow: auto; min-height: 260px; max-height: 78vh; border: 1px solid var(--line-soft); border-radius: 14px; cursor: grab;
    background: radial-gradient(circle, rgba(35,80,184,.09) 1px, transparent 1.2px) 0 0 / 22px 22px, linear-gradient(180deg, #FBFCFE, #F4F7FC); }
.oc-viewport.dragging { cursor: grabbing; user-select: none; }
.oc-canvas { display: inline-block; min-width: 100%; padding: 28px 40px 40px; transform-origin: 0 0; }
.oc, .oc ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; direction: ltr; }
.oc ul { padding-top: 26px; position: relative; }
.oc li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 8px 0; }
.oc > li { padding-top: 0; }
/* الخطوط: خط أفقي فوق كل الإخوات وخط نازل لكل واحد */
.oc li::before, .oc li::after { content: ''; position: absolute; top: 0; width: 50%; height: 26px; border-top: 2px solid #B9C6DD; }
.oc li::before { right: 50%; }
.oc li::after { left: 50%; border-left: 2px solid #B9C6DD; }
.oc li:only-child::before, .oc li:only-child::after { display: none; }
.oc li:only-child { padding-top: 0; }
.oc li:first-child::before, .oc li:last-child::after { border: 0 none; }
.oc li:last-child::before { border-right: 2px solid #B9C6DD; border-radius: 0 10px 0 0; }
.oc li:first-child::after { border-radius: 10px 0 0 0; }
.oc > li::before, .oc > li::after { display: none; }
.oc ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 26px; border-left: 2px solid #B9C6DD; }
.oc li:only-child > .oc-node, .oc li:only-child > .oc-team { margin-top: 0; }
.oc li.oc-closed > ul { display: none; }
/* الكارت */
.oc-node { --oc-tone: 220; direction: inherit; position: relative; width: 186px; background: #fff; border: 1px solid #DCE3EF; border-top: 4px solid hsl(var(--oc-tone) 55% 52%);
    border-radius: 14px; padding: 30px 12px 12px; margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
    box-shadow: 0 6px 18px rgba(19,37,74,.07); transition: box-shadow .15s, transform .15s; }
.oc-node:hover { box-shadow: 0 10px 26px rgba(19,37,74,.13); transform: translateY(-1px); }
[dir="rtl"] .oc-node, [dir="rtl"] .oc-team { direction: rtl; }
.oc-node .oc-av { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); width: 48px; height: 48px; font-size: 16px; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(19,37,74,.15); }
.oc-name { font-weight: 700; font-size: 14px; color: var(--ink-900); line-height: 1.35; text-decoration: none; }
.oc-name:hover { color: var(--cobalt-600); }
.oc-job { font-size: 12px; color: var(--ink-500); line-height: 1.3; }
.oc-dept { font-size: 11px; font-weight: 600; color: hsl(var(--oc-tone) 45% 38%); background: hsl(var(--oc-tone) 60% 95%); border-radius: 6px; padding: 1px 8px; margin-top: 4px; }
.oc-role { position: absolute; top: -12px; inset-inline-end: 8px; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: #F6E3B8; color: #7A5410; }
.oc-ceo { width: 220px; border: 2px solid #C9932E; border-top-width: 5px; background: linear-gradient(180deg, #FFF8EA, #fff 60%); }
.oc-ceo .oc-av { width: 58px; height: 58px; top: -30px; font-size: 19px; }
.oc-ceo .oc-name { font-size: 16px; }
.oc-ceo .oc-dept { color: #7A5410; background: #F6E3B8; }
.oc-dep { border: 2px solid var(--cobalt-500); border-top-width: 5px; background: linear-gradient(180deg, var(--sky-50), #fff 60%); }
.oc-dep .oc-role { background: var(--sky-50); color: var(--cobalt-600); border: 1px solid #C9D6EE; }
.oc-dep .oc-dept { color: var(--cobalt-700); background: var(--sky-50); }
.oc-toggle { position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 3px; background: var(--cobalt-600); color: #fff; border: 2px solid #fff;
    border-radius: 14px; padding: 1px 10px; font: inherit; font-size: 12px; font-weight: 700; line-height: 20px; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(19,37,74,.2); z-index: 1; }
.oc-toggle small { opacity: .75; font-weight: 500; }
.oc-chev svg { transform: rotate(90deg); transition: transform .15s; display: block; }
.oc-closed > .oc-node .oc-chev svg { transform: rotate(-90deg); }
.oc-closed > .oc-node .oc-toggle { background: #fff; color: var(--cobalt-600); border-color: var(--cobalt-500); }
.oc-node + ul { margin-top: 12px; }
/* فريق المدير (الأفراد) */
.oc-team { width: 210px; margin-top: 0; background: #fff; border: 1px solid #DCE3EF; border-radius: 12px; box-shadow: 0 4px 14px rgba(19,37,74,.06); overflow: hidden; }
.oc-team-h { display: flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--ink-500); background: #F5F8FD; border-bottom: 1px solid #E6EBF4; }
.oc-team-h b { margin-inline-start: auto; background: var(--sky-100); color: var(--cobalt-700); border-radius: 10px; padding: 0 8px; }
.oc-team-list { list-style: none; margin: 0; padding: 4px; max-height: 236px; overflow: auto; display: block !important; direction: inherit; }
.oc-team-list li { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; }
.oc-team-list li::before, .oc-team-list li::after { display: none !important; }
.oc-team-list li:hover { background: #F5F8FD; }
.oc-team-list span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; text-align: start; }
.oc-team-list a { font-size: 12.5px; font-weight: 600; color: var(--ink-900); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-team-list small { font-size: 11px; color: var(--ink-500); }
.oc-av-s { width: 26px; height: 26px; font-size: 10px; }
.oc .oc-hit, .oc-team-list li.oc-hit { outline: 3px solid #E9A25B; outline-offset: 2px; }
.oc-team-list li.oc-hit { background: #FFF3DC; outline-width: 2px; }
@media print { .oc-viewport { max-height: none; overflow: visible; border: 0; background: none; } .oc-zoom, .oc-switch { display: none !important; } .oc li.oc-closed > ul { display: flex; } .oc-node { box-shadow: none; } }
@media (max-width: 640px) { .oc-viewport { min-height: 340px; max-height: 70vh; } .oc-canvas { padding: 24px 16px 32px; } }
.oc .oc-team-list { padding: 4px; }
.oc .oc-team-list::before { display: none; }
/* 3.23: تليجرام */
.tg-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.7; }
.tg-code { display: block; margin: 6px 0; padding: 8px 10px; background: var(--sky-50); border: 1px solid var(--line-soft); border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: nowrap; }
.tg-card { max-width: 520px; }
.tg-linked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #EAF7EF; color: #17603A; margin-bottom: 12px; }
.tg-link-box { border: 1px dashed var(--cobalt-500); border-radius: 12px; padding: 14px; background: var(--sky-50); margin: 10px 0; text-align: center; }
.tg-link-box .tg-code-big { font-family: ui-monospace, monospace; font-size: 22px; letter-spacing: 3px; font-weight: 700; color: var(--cobalt-700); }
.tg-opts label.check { margin: 6px 0; }

/* 3.24: ألوان الفروع في كروت الموظفين */
.emp-card.has-br { border-top: 4px solid var(--bc); padding-top: 15px; }
.emp-card.has-br:hover { border-color: var(--bc); border-top-color: var(--bc); }
.br-tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-weight: 600; color: var(--bc); background: color-mix(in srgb, var(--bc) 12%, transparent); }
.br-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--bc); margin-inline-end: 5px; vertical-align: middle; flex: none; }
.br-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.br-key { display: inline-flex; align-items: center; color: inherit; text-decoration: none; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.br-key:hover { border-color: var(--bc); color: var(--bc); }
@media print { .emp-card.has-br { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* 3.25: موديول التقارير — تحليلات الموارد البشرية */
.rp-filters { gap: 8px 10px; }
.rp-presets { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.rp-presets a { font-size: 12.5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-500); background: var(--surface); }
.rp-presets a:hover { border-color: var(--cobalt-500); color: var(--cobalt-700); }
.rp-presets a.on { background: var(--sky-100); border-color: var(--sky-200); color: var(--cobalt-700); font-weight: 600; }
.pill-tabs .rp-ext { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; }
.rp-kpis .kpi { padding: 14px 16px; }
.rp-kpis .kpi-sub { line-height: 1.45; margin-top: 4px; }
.kpi.k-blue::after { content: ''; position: absolute; top: 16px; inset-inline-end: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt-600); }
.rp-note { display: flex; gap: 8px; align-items: flex-start; }
.rp-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.rp-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-grid > .card + .card { margin-top: 0; }
.rp-card { padding: 18px 20px 16px; min-width: 0; }
.rp-card + .rp-card, .rp-grid + .rp-card { margin-top: 0; }
.rp-card.rp-wide { margin-bottom: 16px; }
.rp-card-h { margin-bottom: 12px; }
.rp-card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.rp-card-h small { display: block; font-size: 12px; color: var(--ink-400); margin-top: 2px; }
.rp-card-h .rp-warn { color: var(--amber-700); }
.rp-chart { position: relative; width: 100%; }
.rp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-400); font-size: 13px; background: var(--paper); border-radius: var(--r-sm); border: 1px dashed var(--line); }
@media (max-width: 960px) { .rp-grid, .rp-grid.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .rp-presets { margin-inline-start: 0; width: 100%; }
    .rp-kpis .kpi-value { font-size: 24px; }
    .rp-card { padding: 14px 12px 12px; }
    .pill-tabs .rp-ext { margin-inline-start: 0; }
}
@media print {
    .rp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    .rp-kpis .kpi { border-top: 1px solid var(--line-soft); }
    .rp-grid, .rp-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
    .rp-card { break-inside: avoid; padding: 10px 12px; }
    .rp-chart { height: 230px !important; }
    .rp-chart canvas { max-width: 100% !important; }
    .rp, .rp * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------------------------------------------------------- 3.26: تطبيق البوابة (PWA) */
.app-card .app-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.app-card .app-ic img { width: 52px; height: 52px; border-radius: 13px; display: block; box-shadow: 0 2px 8px rgba(18, 41, 90, .18); }
.app-card .app-txt { flex: 1 1 260px; min-width: 0; }
.app-card .app-txt b { display: block; font-size: 15.5px; margin-bottom: 2px; }
.app-card .app-h { font-size: 14.5px; margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.pwa-ios { background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: var(--r); padding: 12px 16px; margin-top: 14px; }
.pwa-ios ol { margin: 6px 0 0; padding-inline-start: 22px; line-height: 2; }
.ios-share { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--cobalt-600); color: var(--cobalt-600); border-radius: 5px; font-size: 12px; vertical-align: middle; }
.login-card .remember-me { margin: 12px 0 2px; font-size: 14px; }
.pwa-ios-mini { line-height: 1.8; }
.nav-tools .app-back[hidden] { display: none; }
[dir="rtl"] .app-back svg { transform: scaleX(-1); }
.app-icons-preview { display: flex; align-items: center; gap: 14px; }
.app-icons-preview img { border-radius: 14px; box-shadow: 0 2px 8px rgba(18, 41, 90, .18); }
.app-icons-preview img.round { border-radius: 50%; }
