/* ============ نظام الرواتب — التصميم ============ */
/* الهوية: نفس خط وألوان نظام أكاديميات القادة (leadersacademy.ae) */
@font-face {
  font-family: "DIN Next LT Arabic";
  src: local("DIN Next LT Arabic"), local("DINNextLTArabic-Regular"), url("fonts/din-next-lt-arabic-regular.ttf") format("truetype");
  font-weight: 400 600; font-display: swap;
}
@font-face {
  font-family: "DIN Next LT Arabic";
  src: local("DIN Next LT Arabic Bold"), local("DINNextLTArabic-Bold"), url("fonts/din-next-lt-arabic-bold.ttf") format("truetype");
  font-weight: 700 900; font-display: swap;
}
:root {
  --ink: #2E2E33; --ink-2: #45474F; --ink-3: #26245D;
  --primary: #DB272D; --primary-2: #E5484E; --red-dk: #B01E24; --navy: #26245D;
  --gold: #D4AF2A; --gold-2: #F2CF55;
  --bg: #F5F5F7; --card: #fff; --line: #ECECEF; --line-2: #F1F1F4;
  --text: #2E2E33; --muted: #5B5E68;
  --green: #1D9446; --green-bg: #E8F6EE; --amber: #B7791F; --amber-bg: #FFF4DC;
  --red: #B01E24; --red-bg: #FDECEC; --blue-bg: #FFF6F6;
  --radius: 14px; --shadow: 0 1px 2px rgba(46,46,51,.05), 0 6px 20px rgba(46,46,51,.06);
  --font: "DIN Next LT Arabic", "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "DIN Next LT Arabic", "Tajawal", system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.3; }
h3 { font-size: 17px; }
input, select, textarea, button { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; flex: none; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 700; }
.pos { color: var(--green); } .neg { color: var(--red); }
.nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; margin: 0; }
.mt { margin-top: 18px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 268px; flex: none; background: linear-gradient(180deg, var(--ink) 0%, #0a1526 100%); color: #cdd6e6;
  display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; z-index: 40; }
.sidebar-brand { display: flex; justify-content: center; padding: 6px 4px 4px; }
.brand-logo { max-width: 100%; max-height: 120px; object-fit: contain; display: block; }
.brand-logo.lg { max-height: 150px; }
.brand-text { text-align: center; } .brand-text strong { display: block; font-family: var(--font-head); font-size: 22px; color: #fff; }
.brand-text span { font-size: 11px; letter-spacing: 1.2px; color: var(--gold-2); }
.sidebar-caption { text-align: center; font-size: 12px; color: #8696b3; margin: 8px 0 18px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; font-weight: 500; transition: .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(212,167,44,.0), rgba(212,167,44,.18)); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.nav a.active .ic { color: var(--gold-2); }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 14px 6px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user .who strong { display: block; color: #fff; font-size: 14px; } .sidebar-user .who span { font-size: 12px; color: #8696b3; }
.sidebar-actions { display: flex; gap: 6px; }
.sidebar-actions a, .sidebar-actions button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 8px;
  background: rgba(255,255,255,.05); border: 0; color: #cdd6e6; cursor: pointer; font-size: 13px; }
.sidebar-actions a:hover, .sidebar-actions button:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-actions form { flex: 1; display: flex; } .sidebar-actions form button { width: 100%; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 28px; background: rgba(243,245,249,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 22px; flex: 1; }
.topbar-date { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.topbar .menu-btn { display: none; }
.content { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.foot { padding: 16px 28px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.scrim { display: none; }

/* ---------- elements ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.p0 { padding: 0; overflow: hidden; } .card.narrow { max-width: 560px; }
.card > h3 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.btn { color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 700; font-size: 14px; transition: .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,27,46,.1); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--ink); border-color: transparent; }
.btn-success { background: var(--green); color: #fff; border-color: transparent; }
.btn-danger { background: var(--red); color: #fff; border-color: transparent; }
.btn-danger-ghost { color: var(--red); border-color: #f3c4c4; background: #fff; }
.btn-ghost { background: #fff; } .btn-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-sm { padding: 7px 12px; font-size: 13px; } .btn.lg { padding: 13px 26px; font-size: 15px; } .btn.block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--primary); border-color: #c9d6f5; } .icon-btn.danger:hover { color: var(--red); border-color: #f3c4c4; }
.link { color: var(--primary); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.badge-green { background: var(--green-bg); color: var(--green); } .badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); } .badge-gray { background: #eef1f5; color: #5e6a80; }
.badge-blue { background: var(--blue-bg); color: var(--primary); } .badge-gold { background: #fbf1d6; color: #8a6510; }
.pill { background: var(--blue-bg); color: var(--primary); padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.alert { padding: 13px 16px; border-radius: 12px; border: 1px solid; font-weight: 500; }
.alert-success { background: var(--green-bg); border-color: #b9e8cd; color: #0b6b36; }
.alert-error { background: var(--red-bg); border-color: #f3c4c4; color: #9d2323; }
.alert-info { background: var(--blue-bg); border-color: #cddcfb; color: #1c3f8f; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: linear-gradient(135deg, #dfe8ff, #f5e7bf); color: var(--ink-3); font-weight: 800; font-family: var(--font-head); object-fit: cover; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; } .avatar.xl { width: 96px; height: 96px; font-size: 32px; border: 4px solid #fff; box-shadow: var(--shadow); }
.sidebar .avatar { background: linear-gradient(135deg, var(--gold), #f6dd94); color: var(--ink); }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #3b4860; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #d5dce8; border-radius: 10px; background: #fff; font-size: 14px; font-weight: 500; transition: .15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(47,99,224,.15); }
input[readonly] { background: #f6f8fb; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid.one { grid-template-columns: 1fr; } .form-grid.three { grid-template-columns: repeat(3, 1fr); } .form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-grid h3 { margin-top: 6px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.label-btn { justify-content: flex-end; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.form-actions.sticky { position: sticky; bottom: 0; background: rgba(243,245,249,.92); backdrop-filter: blur(6px); padding: 14px 0; z-index: 5; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .inline-form input { width: auto; flex: 1; min-width: 160px; }

/* ---------- toolbar & tables ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .filters select { width: auto; min-width: 150px; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.search { position: relative; } .search .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-right: 38px; min-width: 300px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; padding: 13px 14px; background: #f7f9fc; color: #56637a; font-size: 12.5px; font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #fafbfe; }
.table .num { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; } .table .c { text-align: center; }
.table .empty { text-align: center; padding: 40px; color: var(--muted); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; } .table .actions form { display: inline; }
.table-foot { padding: 12px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; }
.person { display: inline-flex; align-items: center; gap: 10px; } .person strong { display: block; } .person small { display: block; color: var(--muted); font-size: 12px; }
.details { max-width: 420px; color: #4a566c; }

/* ---------- dashboard ---------- */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 26px 28px; border-radius: 18px; color: #fff;
  background: radial-gradient(circle at 10% 120%, rgba(212,167,44,.35), transparent 45%), linear-gradient(120deg, var(--ink) 0%, var(--ink-3) 70%, #2a4a8a 100%); box-shadow: var(--shadow); }
.hero h2 { font-size: 26px; } .hero-kicker { margin: 0 0 4px; color: var(--gold-2); font-weight: 700; } .hero-sub { margin: 6px 0 0; color: #c7d2e8; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat small { display: block; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.stat strong { display: block; font-family: var(--font-head); font-size: 24px; font-variant-numeric: tabular-nums; margin: 2px 0; }
.stat em { font-style: normal; color: var(--muted); font-size: 12px; }
.stat-ic { width: 46px; height: 46px; border-radius: 12px; background: #f1f4fa; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.stat.accent { background: linear-gradient(135deg, #fffaf0, #fff); border-color: #f0dca4; } .stat.accent strong { color: #8a6510; }
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; } .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; }
.bar-label { font-weight: 600; font-size: 14px; } .bar-val { font-weight: 700; font-variant-numeric: tabular-nums; } .bar-val small { color: var(--muted); font-weight: 500; }
.bar-track { height: 10px; background: #eef1f7; border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--primary-2)); border-radius: 99px; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; transition: .15s; }
.quick a:hover { border-color: #c9d6f5; background: #f7f9ff; color: var(--primary); }
.quick .ic { width: 22px; height: 22px; color: var(--primary); }
.list { margin: 8px 0 0; padding: 0; list-style: none; } .list li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 48px 20px; } .empty-icon { font-size: 44px; } .empty-state p { color: var(--muted); }

/* ---------- employee profile ---------- */
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff 60%, #fbf4e1); }
.profile-id { display: flex; gap: 18px; align-items: center; }
.profile-id h2 { font-size: 24px; } .ar-name { margin: 2px 0; font-size: 17px; font-weight: 700; color: var(--ink-3); } .profile-id p { margin: 2px 0 8px; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; } .profile-actions form { display: inline; }
.profile-mini { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; } .profile-mini p { margin: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv span { color: var(--muted); } .kv strong { text-align: left; }
.tabs { display: flex; flex-direction: column; gap: 16px; }
.tab-nav { display: flex; gap: 6px; background: #fff; padding: 6px; border-radius: 12px; border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.tab-nav button { border: 0; background: none; padding: 9px 16px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tab-nav button.active { background: var(--ink); color: #fff; }
.tab-pane { display: none; flex-direction: column; gap: 16px; } .tab-pane.active { display: flex; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { padding: 10px 14px; border-right: 3px solid var(--line); margin-bottom: 6px; }
.timeline li:hover { border-color: var(--gold); }

/* ---------- payroll ---------- */
.period-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.period-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.period-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--amber); }
.period-card.approved::before { background: var(--green); }
.period-top { display: flex; justify-content: space-between; align-items: flex-start; }
.period-year { color: var(--muted); font-weight: 700; font-size: 13px; } .period-top h3 { font-size: 24px; }
.period-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.period-stats div { background: #f7f9fc; border-radius: 10px; padding: 10px 12px; } .period-stats .wide { grid-column: span 2; background: #fffaf0; }
.period-stats small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; } .period-stats strong { font-family: var(--font-head); font-size: 20px; font-variant-numeric: tabular-nums; }
.period-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; } .period-actions form { margin-inline-start: auto; }
.run-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.run-head h2 { font-size: 24px; margin-top: 4px; display: flex; gap: 10px; align-items: center; } .run-head p { margin: 4px 0 0; }
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; } .run-actions form { display: inline; }
.run-table td, .run-table th { padding: 8px 8px; }
.run-table .sticky-col { position: sticky; right: 0; background: #fff; z-index: 2; min-width: 200px; box-shadow: -6px 0 10px -8px rgba(0,0,0,.15); }
.run-table thead .sticky-col { background: #f7f9fc; z-index: 3; }
.run-table tbody tr:hover .sticky-col { background: #fafbfe; }
.cell { width: 74px; padding: 6px 6px; text-align: center; border-radius: 8px; font-variant-numeric: tabular-nums; }
.cell.wide { width: 150px; text-align: right; }
.cell.hl { background: var(--red-bg); border-color: #f3c4c4; color: var(--red); font-weight: 700; }
.cell.changed { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,167,44,.2); }
.net-cell { color: var(--ink); font-size: 15px; background: #fffaf0; }
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.role-card fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 10px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.role-card legend { font-weight: 800; color: var(--ink-3); padding-left: 8px; font-size: 13px; }
.role-card .check { font-size: 13.5px; }
.role-card.super { background: linear-gradient(135deg, #fffaf0, #fff); border-color: #f0dca4; }
.role-card.new-role { border-style: dashed; }
.role-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; border-color: transparent; padding: 6px 8px; flex: 1; }
.role-name:hover { border-color: var(--line); }
.role-actions { display: flex; gap: 8px; margin-top: 10px; }
.dept-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-top: 14px; }
.dept-item { display: flex; gap: 8px; align-items: center; } .dept-item form:first-child { flex: 1; }
.logo-preview { display: flex; gap: 20px; align-items: center; margin-top: 16px; padding: 16px; background: #f7f9fc; border-radius: 12px; }
.logo-preview img { max-height: 90px; }
.danger-zone { border-color: #f3c4c4; }

/* ---------- auth ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 85% 10%, rgba(212,167,44,.28), transparent 35%), radial-gradient(circle at 10% 90%, rgba(47,99,224,.35), transparent 40%), var(--ink); }
.auth-wrap { width: 100%; max-width: 420px; } .auth-wrap.wide { max-width: 680px; }
.auth-card { background: #fff; border-radius: 22px; padding: 34px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .form-grid { display: grid; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 14px; }
.auth-brand .brand-text strong { color: var(--ink); } .auth-brand .brand-text span { color: var(--amber); }
.auth-head { text-align: center; margin-bottom: 20px; } .auth-head h1 { font-size: 22px; } .auth-head p { color: var(--muted); margin: 6px 0 0; }
.auth-foot { text-align: center; color: #8696b3; font-size: 12px; letter-spacing: 1px; margin-top: 18px; }

/* ============ الطباعة: الإيصالات والكشوف (A4 أفقي) ============ */
.print-body { background: #e9edf3; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; background: var(--ink); color: #fff; }
.print-toolbar .muted { color: #9fb0cc; } .tb-actions { display: flex; gap: 8px; }
.slip, .report { width: 297mm; min-height: 210mm; margin: 18px auto; background: #fff; padding: 8mm 12mm 6mm; box-shadow: 0 10px 40px rgba(13,27,46,.18);
  display: flex; flex-direction: column; gap: 2.8mm; position: relative; overflow: hidden; color: #14213a; font-size: 12.5px; }
.slip::before, .report::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3mm; background: linear-gradient(90deg, var(--gold), var(--ink) 35%, var(--primary)); }
.watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 80px; font-weight: 800; color: rgba(211,58,58,.07); white-space: nowrap; pointer-events: none; font-family: var(--font-head); }
.slip-head { display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: center; gap: 6mm; padding-bottom: 3mm; border-bottom: 1.5px solid #dfe5ee; }
.slip-brand img { max-height: 25mm; max-width: 72mm; object-fit: contain; display: block; }
.slip-brand-text strong { display: block; font-family: var(--font-head); font-size: 24px; color: var(--ink); } .slip-brand-text span { font-size: 11px; letter-spacing: 1px; color: var(--amber); font-weight: 700; }
.slip-title { text-align: center; }
.slip-title h1 { font-size: 26px; color: var(--ink); } .slip-title h2 { font-size: 13px; letter-spacing: 4px; color: var(--muted); font-family: var(--font); font-weight: 700; margin-top: 1mm; }
.slip-month { display: inline-flex; gap: 10px; margin-top: 2.5mm; padding: 1.6mm 5mm; border-radius: 99px; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; }
.slip-month span + span { color: var(--gold-2); border-right: 1px solid rgba(255,255,255,.3); padding-right: 10px; }
.slip-meta { display: flex; flex-direction: column; gap: 1.6mm; align-items: flex-end; text-align: left; }
.slip-meta div { display: flex; flex-direction: column; align-items: flex-end; } .slip-meta small { color: var(--muted); font-size: 10px; font-weight: 700; } .slip-meta strong { font-size: 13px; }
.slip-emp { display: grid; grid-template-columns: 1.7fr repeat(4, 1fr); gap: 4mm; background: #f5f7fb; border: 1px solid #e3e8f0; border-radius: 3mm; padding: 2.6mm 4.5mm; }
.slip-emp small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; } .slip-emp strong { display: block; font-size: 13px; }
.emp-name strong { font-size: 16px; font-family: var(--font-head); } .emp-name span { font-weight: 700; color: var(--ink-3); }
.slip-body { display: grid; grid-template-columns: 1fr 1fr 1.05fr; gap: 5mm; }
.slip-table { width: 100%; border-collapse: collapse; border: 1px solid #dfe5ee; border-radius: 3mm; overflow: hidden; }
.slip-table th { text-align: right; padding: 2mm 3.5mm; color: #fff; font-size: 13px; font-family: var(--font-head); }
.slip-table th span, .slip-table td span { font-size: 9.5px; color: #8b97ab; font-weight: 600; margin-right: 4px; letter-spacing: .3px; }
.slip-table.earn th { background: #0f7a43; } .slip-table.ded th { background: #b3322f; }
.slip-table th span { color: rgba(255,255,255,.75); }
.slip-table td { padding: 1.45mm 3.5mm; border-bottom: 1px solid #eef1f6; }
.slip-table td:last-child { text-align: left; font-variant-numeric: tabular-nums; font-weight: 700; width: 30mm; }
.slip-table tfoot td { background: #f5f7fb; font-weight: 800; font-size: 13.5px; border-bottom: 0; border-top: 1.5px solid #dfe5ee; }
.slip-table.earn tfoot td:last-child { color: #0f7a43; } .slip-table.ded tfoot td:last-child { color: #b3322f; }
.slip-table tr.blank td { color: transparent; }
.slip-side { display: flex; flex-direction: column; gap: 4mm; }
.att { border: 1px solid #dfe5ee; border-radius: 3mm; padding: 3mm 3.5mm; }
.att h3 { font-size: 13px; margin-bottom: 2mm; } .att h3 span { font-size: 9.5px; color: var(--muted); letter-spacing: 1px; }
.att-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm; text-align: center; }
.att-grid div { background: #f5f7fb; border-radius: 2mm; padding: 2mm 1mm; }
.att-grid strong { display: block; font-family: var(--font-head); font-size: 19px; line-height: 1.1; } .att-grid small { font-size: 9.5px; color: var(--muted); font-weight: 700; line-height: 1.25; display: block; }
.att-grid small span { font-weight: 500; font-size: 8.5px; }
.att-grid .warn { background: #fdecec; } .att-grid .warn strong { color: #b3322f; } .att-grid .ok { background: #e6f7ee; } .att-grid .ok strong { color: #0f7a43; }
.daily { margin: 2mm 0 0; font-size: 11px; color: var(--muted); }
.net { flex: 1; border-radius: 3mm; padding: 3.5mm 4.5mm; color: #fff; background: radial-gradient(circle at 0% 100%, rgba(212,167,44,.45), transparent 55%), linear-gradient(135deg, var(--ink), var(--ink-3));
  display: flex; flex-direction: column; justify-content: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.net small { color: var(--gold-2); font-weight: 700; font-size: 11px; letter-spacing: .5px; }
.net strong { font-family: var(--font-head); font-size: 32px; line-height: 1.2; font-variant-numeric: tabular-nums; text-align: right; }
.net em { font-style: normal; font-size: 15px; color: var(--gold-2); }
.net p { margin: 1mm 0 0; font-size: 11px; line-height: 1.45; } .net .words-en { color: #c7d2e8; font-size: 10px; text-align: left; }
.slip-notes { background: #fffaf0; border: 1px dashed #e8cf8d; border-radius: 2.5mm; padding: 2mm 4mm; font-size: 12px; }
.slip-ack { display: flex; justify-content: space-between; gap: 6mm; font-size: 11.5px; color: #36435b; border-top: 1px dashed #dfe5ee; padding-top: 2.5mm; }
.slip-ack p { margin: 0; } .slip-ack p[dir=ltr] { color: var(--muted); }
.slip-sign { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 9mm; margin-top: auto; padding-top: 3mm; }
.sig { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sig .line { width: 100%; border-bottom: 1.5px solid #14213a; height: 9mm; margin-bottom: 1.2mm; }
.sig.main .line { border-bottom: 2px solid var(--ink); background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(212,167,44,.06) 10px 20px); }
.sig strong { font-size: 12.5px; } .sig small { font-size: 10px; color: var(--muted); }
.slip-foot { display: flex; justify-content: space-between; font-size: 9.5px; color: #8b97ab; border-top: 1px solid #eef1f6; padding-top: 2mm; }
.report { font-size: 11px; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th { background: var(--ink); color: #fff; padding: 2.2mm 1.6mm; font-size: 10.5px; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-table td { padding: 1.3mm 1.6mm; border-bottom: 1px solid #e3e8f0; text-align: center; font-variant-numeric: tabular-nums; }
.report-table td.name { text-align: right; } .report-table td.name strong, .report-table td.name small { display: block; } .report-table td.name small { color: var(--muted); font-size: 9.5px; }
.report-table tbody tr:nth-child(even) { background: #f8fafc; }
.report-table tfoot td { background: #fbf1d6; font-weight: 800; border-top: 2px solid var(--gold); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-table .sigcol { width: 28mm; } .report-table td.strong { color: var(--ink); font-size: 11.5px; }
.report-summary { display: flex; gap: 4mm; justify-content: flex-start; }
.report-summary div { border: 1px solid #dfe5ee; border-radius: 2.5mm; padding: 2.5mm 4mm; } .report-summary small { display: block; color: var(--muted); font-weight: 700; }
.report-summary strong { font-family: var(--font-head); font-size: 15px; }
.report-summary .total { background: var(--ink); color: #fff; flex: 1; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .report-summary .total small { color: var(--gold-2); }
.report-summary .total p { margin: 1mm 0 0; font-size: 10.5px; color: #c7d2e8; }

@media print {
  @page { size: A4 landscape; margin: 0; }
  body.print-body { background: #fff; }
  .no-print { display: none !important; }
  .slip, .report { margin: 0; box-shadow: none; width: 297mm; height: 210mm; min-height: 0; page-break-after: always; break-after: page; }
  .report { height: auto; min-height: 210mm; overflow: visible; }
  .report-table thead { display: table-header-group; }
  .report-table tfoot { display: table-row-group; }
  .report-table tr { break-inside: avoid; }
  .slip:last-of-type { page-break-after: auto; break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; } .form-grid.four { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; right: 0; top: 0; transform: translateX(105%); transition: transform .25s; }
  body.nav-open .sidebar { transform: none; box-shadow: -10px 0 40px rgba(0,0,0,.3); }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 14px; } .stat-ic { display: none; } .stat strong { font-size: 19px; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5,12,25,.5); z-index: 35; }
  .topbar .menu-btn { display: inline-flex; } .topbar { padding: 14px 16px; } .topbar h1 { font-size: 18px; } .topbar-date { display: none; }
  .content { padding: 16px; } .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; } .span-2, .span-3 { grid-column: auto; }
  .search input { min-width: 0; } .bar-row { grid-template-columns: 110px 1fr auto; } .quick { grid-template-columns: 1fr 1fr; }
  .hero { padding: 20px; } .hero h2 { font-size: 21px; }
  .slip, .report { transform-origin: top right; }
}

.slip small bdi, .report small bdi { font-weight: 500; opacity: .75; margin-inline-start: 3px; letter-spacing: .2px; }
.slip strong bdi.en { font-size: 11px; color: var(--muted); font-weight: 600; }
.report-table td:nth-child(14), .report-table td:nth-child(3) { white-space: nowrap; }
.report .slip-sign { grid-template-columns: repeat(3, 1fr); }

/* ============ ثيم نظام الأكاديميات (أبيض + أحمر القادة) ============ */
.sidebar { background: #fff; color: var(--ink-2); border-left: 1px solid var(--line); box-shadow: none; }
.sidebar-brand { padding: 4px 0 0; }
.brand-logo { max-height: 110px; width: 100%; }
.brand-text strong { color: var(--ink); } .brand-text span { color: var(--primary); }
.sidebar-caption { color: var(--muted); border-bottom-color: var(--line); font-weight: 700; }
.nav a { color: var(--ink-2); font-weight: 700; }
.nav a:hover { background: var(--red-bg); color: var(--primary); }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(219,39,45,.28); }
.nav a.active .ic { color: #fff; }
.sidebar-user { border-top-color: var(--line); }
.sidebar-user .who strong { color: var(--ink); } .sidebar-user .who span { color: var(--muted); }
.sidebar .avatar { background: var(--red-bg); color: var(--primary); }
.sidebar-actions a, .sidebar-actions button { background: var(--bg); color: var(--ink-2); }
.sidebar-actions a:hover, .sidebar-actions button:hover { background: var(--red-bg); color: var(--primary); }
.topbar { background: rgba(245,245,247,.9); }
.topbar h1 { font-weight: 900; }
.btn { border-radius: 12px; }
.btn-primary { background: var(--primary); box-shadow: 0 6px 14px rgba(219,39,45,.22); }
.btn-primary:hover { background: var(--red-dk); }
.btn-gold { background: var(--ink); color: #fff; }
.btn-success { background: var(--green); }
.icon-btn:hover { border-color: #F6C9CB; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(219,39,45,.12); }
.badge-blue { background: #EEEDF8; color: var(--navy); }
.alert-info { background: #FFF6F6; border-color: #F6C9CB; color: #8E1A1F; }
.avatar { background: linear-gradient(135deg, #FDECEC, #F5F5F7); color: var(--primary); }
.hero { background: radial-gradient(circle at 8% 130%, rgba(255,255,255,.18), transparent 45%), linear-gradient(120deg, var(--red-dk) 0%, var(--primary) 55%, #E94A4F 100%); }
.hero-kicker { color: #FFE3A3; } .hero-sub { color: #FFE1E2; }
.hero .btn-light { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.35); color: #fff; }
.hero .btn-gold { background: #fff; color: var(--primary); }
.stat.accent { background: linear-gradient(135deg, #FFF6F6, #fff); border-color: #F6C9CB; } .stat.accent strong { color: var(--primary); }
.stat-ic { background: var(--bg); }
.bar-fill { background: linear-gradient(90deg, var(--red-dk), var(--primary)); }
.quick a:hover { border-color: #F6C9CB; background: #FFF6F6; }
.tab-nav button.active { background: var(--primary); }
.profile-head { background: linear-gradient(135deg, #fff 60%, #FFF6F6); }
.period-stats .wide, .net-cell { background: #FFF6F6; }
.cell.changed { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(219,39,45,.15); }
.role-card.super { background: linear-gradient(135deg, #FFF6F6, #fff); border-color: #F6C9CB; }
.auth-body { background: var(--primary); }
.auth-card { box-shadow: 0 30px 80px rgba(90,10,14,.35); }
.auth-foot { color: #FFE1E2; }
/* الطباعة */
.print-toolbar { background: #fff; color: var(--ink); border-bottom: 3px solid var(--primary); }
.print-toolbar .muted { color: var(--muted); }
.print-toolbar .btn-gold { background: var(--primary); color: #fff; }
.print-toolbar .btn-primary { background: var(--ink); box-shadow: none; }
.slip::before, .report::before { background: linear-gradient(90deg, var(--primary) 0 65%, var(--ink) 65% 85%, var(--gold) 85%); }
.slip-brand img { max-height: 26mm; max-width: 75mm; }
.slip-brand-text span { color: var(--primary); }
.slip-month { background: var(--primary); }
.slip-month span + span { color: #FFE3A3; }
.slip-table.ded th { background: var(--ink); }
.slip-table.earn th { background: var(--green); }
.slip-table.ded tfoot td:last-child { color: var(--primary); }
.net { background: radial-gradient(circle at 0% 100%, rgba(255,255,255,.16), transparent 55%), linear-gradient(135deg, var(--red-dk), var(--primary)); }
.net small, .net em { color: #FFE3A3; } .net .words-en { color: #FFE1E2; }
.sig.main .line { border-bottom-color: var(--primary); background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(219,39,45,.05) 10px 20px); }
.report-table th { background: var(--ink); }
.report-table tfoot td { background: #FFF6F6; border-top-color: var(--primary); }
.report-summary .total { background: var(--primary); } .report-summary .total small { color: #FFE3A3; } .report-summary .total p { color: #FFE1E2; }
.slip-notes { background: #FFF8E6; border-color: #EBD27A; }
@media (max-width: 860px) { .sidebar { border-left: 0; } }
[hidden]{display:none!important}
/* فلترة حسب الفئة */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; transition: .15s; white-space: nowrap; }
.chip b { background: var(--bg); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.chip small { color: var(--muted); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: #F6C9CB; color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 6px 14px rgba(219,39,45,.22); }
.chip.active b { background: rgba(255,255,255,.22); } .chip.active small { color: #FFE1E2; }
.filter-note { background: #FFF6F6; border: 1px dashed #F6C9CB; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.dept-tag { display: inline-block; margin-top: 1.5mm; padding: .8mm 4mm; border-radius: 99px; background: var(--red-bg); color: var(--primary); font-weight: 800; font-size: 12px; }
.report-table tr.subtotal td { background: #F5F5F7; font-weight: 800; text-align: right; color: var(--ink); border-bottom: 1.5px solid #DFE0E5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-table tr.subtotal td:nth-child(2) { text-align: center; color: var(--primary); }
/* الدخول الموحّد */
.back-launcher { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 8px; border-radius: 10px; background: var(--red-bg); color: var(--primary); font-weight: 800; font-size: 13.5px; }
.back-launcher:hover { background: var(--primary); color: #fff; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* =====================================================================
   تصميم v2 — «نظام HR» بلمسة فاخرة (هوية القادة: أحمر + أبيض + أسود)
   ===================================================================== */
:root{--ink:#17181C;--ink-2:#3A3C44;--muted:#6B7079;--line:#ECEDF1;--bg:#F4F5F8;--radius:20px;
  --shadow:0 1px 2px rgba(23,24,28,.04),0 18px 40px -30px rgba(23,24,28,.55);--glow:0 14px 28px -14px rgba(219,39,45,.75)}
body{background:radial-gradient(900px 500px at 100% -10%,rgba(219,39,45,.07),transparent 60%),radial-gradient(800px 500px at -10% 110%,rgba(75,73,184,.06),transparent 60%),var(--bg);background-attachment:fixed}
h1,h2,h3{letter-spacing:-.2px}
/* sidebar */
.sidebar{background:rgba(255,255,255,.88);backdrop-filter:blur(14px);border-left:1px solid var(--line);box-shadow:8px 0 40px -30px rgba(23,24,28,.4);padding:22px 14px}
.sidebar-brand{padding:6px 6px 2px}.brand-logo{max-height:96px;filter:drop-shadow(0 8px 14px rgba(23,24,28,.12))}
.sidebar-caption{font-size:11.5px;letter-spacing:.3px;text-transform:none;margin:10px 0 14px;padding:8px 10px 14px}
.nav{gap:5px}
.nav a{padding:10px 12px;border-radius:14px;font-weight:800;font-size:14px;color:var(--ink-2);transition:background .15s,color .15s,transform .15s}
.nav a .ic{width:34px;height:34px;padding:8px;border-radius:11px;background:#F3F4F7;color:var(--c,#6B7079);transition:.15s;box-sizing:border-box}
.nav a:nth-child(1){--c:#DB272D}.nav a:nth-child(2){--c:#2563EB}.nav a:nth-child(3){--c:#1D9446}.nav a:nth-child(4){--c:#4B49B8}.nav a:nth-child(5){--c:#D99A00}.nav a:nth-child(6){--c:#0E9488}
.nav a:hover{background:#FFF5F5;color:var(--ink);transform:translateX(-2px)}
.nav a:hover .ic{background:#fff;box-shadow:0 6px 14px -8px rgba(0,0,0,.3)}
.nav a.active{background:linear-gradient(135deg,#EF3B41,#B01E24);color:#fff;box-shadow:var(--glow)}
.nav a.active .ic{background:rgba(255,255,255,.2);color:#fff}
.back-launcher{border-radius:14px;padding:11px 14px;background:linear-gradient(135deg,#17181C,#2B2C3A);color:#fff;box-shadow:0 12px 24px -16px rgba(0,0,0,.7)}
.back-launcher .ic{color:#FFB3B6}.back-launcher:hover{background:linear-gradient(135deg,#DB272D,#B01E24);color:#fff}
.sidebar-user{background:#F7F8FA;border:1px solid var(--line);border-radius:16px;padding:10px 12px;margin:6px 0 8px}
.sidebar .avatar{background:linear-gradient(135deg,#EF3B41,#8E1418);color:#fff}
.sidebar-actions a,.sidebar-actions button{border-radius:12px;background:#fff;border:1px solid var(--line);font-weight:800}
/* topbar */
.topbar{background:rgba(244,245,248,.75);backdrop-filter:blur(14px);border-bottom:1px solid rgba(23,24,28,.06);padding:16px 30px}
.topbar h1{font-size:24px;font-weight:900;display:flex;align-items:center;gap:10px}
.topbar h1::before{content:"";width:8px;height:26px;border-radius:8px;background:linear-gradient(180deg,#EF3B41,#B01E24);box-shadow:var(--glow)}
.topbar-date{background:#fff;border:1px solid var(--line);padding:8px 14px;border-radius:999px;font-weight:800;color:var(--ink-2);box-shadow:var(--shadow)}
.content{padding:26px 30px 48px;gap:20px}
/* cards & stats */
.card{border-radius:var(--radius);border:1px solid var(--line);box-shadow:var(--shadow);padding:22px}
.card-head h3{font-size:17px;font-weight:900;display:flex;align-items:center;gap:8px}
.card-head h3::before{content:"";width:6px;height:18px;border-radius:6px;background:#DB272D}
.stats{gap:16px}
.stat{position:relative;overflow:hidden;border-radius:var(--radius);padding:20px;border:1px solid var(--line);box-shadow:var(--shadow);transition:transform .2s,box-shadow .2s}
.stat:hover{transform:translateY(-3px);box-shadow:0 26px 50px -34px rgba(23,24,28,.7)}
.stat::before{content:"";position:absolute;inset:0 0 auto 0;height:3px;background:linear-gradient(90deg,#DB272D,#4B49B8)}
.stat::after{content:"";position:absolute;inset-inline-end:-30px;bottom:-30px;width:110px;height:110px;border-radius:50%;background:radial-gradient(circle,rgba(219,39,45,.07),transparent 70%)}
.stat strong{font-size:28px;font-weight:900;letter-spacing:-.5px}
.stat small{font-size:12.5px;letter-spacing:.2px}
.stat-ic{width:52px;height:52px;border-radius:16px;background:linear-gradient(135deg,#FFF1F1,#FFF8F8);box-shadow:inset 0 0 0 1px #FAD7D9}
.stat.accent{background:linear-gradient(135deg,#17181C,#2B2C3A);border-color:transparent;color:#fff}
.stat.accent small,.stat.accent em{color:#C9CBD6}.stat.accent strong{color:#fff}.stat.accent::after{background:radial-gradient(circle,rgba(219,39,45,.45),transparent 70%)}
.stat.accent .stat-ic{background:rgba(255,255,255,.1);box-shadow:none}
/* hero */
.hero{border-radius:26px;padding:30px 32px;background:radial-gradient(520px 260px at 0% 130%,rgba(219,39,45,.6),transparent 70%),radial-gradient(420px 220px at 100% -30%,rgba(75,73,184,.5),transparent 70%),linear-gradient(135deg,#17181C 0%,#23243A 100%);box-shadow:0 30px 60px -40px rgba(23,24,28,.9);position:relative;overflow:hidden}
.hero::after{content:"";position:absolute;inset:auto -70px -90px auto;width:280px;height:280px;border-radius:50%;border:44px solid rgba(255,255,255,.04)}
.hero>*{position:relative;z-index:1}.hero h2{font-size:30px;font-weight:900}
.hero-kicker{display:inline-flex;gap:8px;align-items:center;background:rgba(219,39,45,.22);border:1px solid rgba(255,255,255,.14);color:#FFD3D5;padding:6px 12px;border-radius:999px;font-size:12px}
.hero .btn-gold{background:#fff;color:#B01E24}.hero .btn-light{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.2)}
/* buttons */
.btn{border-radius:13px;font-weight:900;padding:11px 18px;transition:transform .15s,box-shadow .15s,background .15s}
.btn-primary{background:linear-gradient(135deg,#EF3B41,#B01E24);box-shadow:var(--glow);border:0}
.btn-primary:hover{background:linear-gradient(135deg,#F04A50,#9E1A20)}
.btn-gold{background:linear-gradient(135deg,#17181C,#2B2C3A);color:#fff;border:0;box-shadow:0 12px 24px -14px rgba(0,0,0,.8)}
.btn-ghost{background:#fff;border:1px solid var(--line);box-shadow:0 6px 14px -12px rgba(0,0,0,.4)}
.btn-ghost:hover{border-color:#F6C9CB;color:#B01E24}
.btn-success{background:linear-gradient(135deg,#22A853,#16773A);box-shadow:0 12px 24px -14px rgba(29,148,70,.9)}
.icon-btn{border-radius:11px;width:36px;height:36px}
.icon-btn:hover{background:#FFF5F5;color:#DB272D;border-color:#F6C9CB}
/* badges */
.badge{padding:4px 11px;font-weight:900;font-size:11.5px;gap:6px}
.badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.8}
/* forms */
input,select,textarea{border-radius:13px;border:1px solid #DFE1E6;background:#FBFBFC;min-height:46px;font-weight:700}
textarea{min-height:auto}
input:focus,select:focus,textarea:focus{background:#fff;border-color:#DB272D;box-shadow:0 0 0 4px rgba(219,39,45,.1)}
label{font-weight:900;color:var(--ink-2)}
input[type=checkbox]{min-height:0}
/* tables */
.card.p0{border-radius:var(--radius);overflow:hidden}
.table th{background:var(--ink);color:#fff;font-size:12px;font-weight:900;letter-spacing:.2px;padding:14px 16px;border:0;position:sticky;top:0;z-index:1}
.table td{padding:13px 16px;border-bottom:1px solid #F2F3F5}
.table tbody tr:nth-child(even) td{background:#FBFBFC}
.table tbody tr:hover td{background:#FFF6F6}
.table .num{font-weight:800}
.run-table .sticky-col{background:#fff}.run-table thead .sticky-col{background:var(--ink)}
.run-table tbody tr:nth-child(even) .sticky-col{background:#FBFBFC}
.table-foot{background:#FAFAFB;font-weight:800}
.person strong{font-weight:900}
.avatar{background:linear-gradient(135deg,hsl(var(--h,355) 78% 56%),hsl(calc(var(--h,355) + 30) 70% 38%));color:#fff;box-shadow:0 8px 16px -10px rgba(0,0,0,.5)}
.avatar.xl{border-radius:26px;border:5px solid #fff}
/* toolbar & search */
.toolbar{background:#fff;border:1px solid var(--line);border-radius:20px;padding:12px;box-shadow:var(--shadow)}
.search input{background:#F7F8FA;min-width:320px}
.filters select{min-height:46px}
/* tabs */
.tab-nav{border-radius:16px;padding:5px;box-shadow:var(--shadow)}
.tab-nav button{border-radius:12px;padding:10px 18px}
.tab-nav button.active{background:linear-gradient(135deg,#EF3B41,#B01E24);box-shadow:var(--glow)}
/* profile */
.profile-head{position:relative;overflow:hidden;background:linear-gradient(135deg,#fff 55%,#FFF4F4);padding:26px}
.profile-head::before{content:"";position:absolute;inset:0 0 auto 0;height:96px;background:radial-gradient(300px 120px at 100% 0,rgba(75,73,184,.5),transparent 70%),linear-gradient(135deg,#17181C,#3A1418 70%,#DB272D)}
.profile-id,.profile-actions{position:relative;z-index:1}.profile-id{align-items:flex-end;margin-top:24px}
.profile-id h2{font-size:26px;font-weight:900}
.kv{padding:11px 0}.kv strong{font-weight:800}
/* payroll periods */
.period-card{border-radius:22px;padding:20px;transition:transform .2s,box-shadow .2s;box-shadow:var(--shadow)}
.period-card:hover{transform:translateY(-3px);box-shadow:0 30px 50px -36px rgba(23,24,28,.8)}
.period-card::before{height:5px;background:linear-gradient(90deg,#D99A00,#F2CF55)}.period-card.approved::before{background:linear-gradient(90deg,#1D9446,#5ED08B)}
.period-top h3{font-size:28px;font-weight:900}
.period-stats .wide{background:linear-gradient(135deg,#17181C,#2B2C3A);color:#fff}.period-stats .wide small{color:#C9CBD6}
.run-head{background:linear-gradient(135deg,#fff 60%,#FFF4F4)}
.cell{border-radius:10px;min-height:38px;background:#fff}
.net-cell{background:#FFF4F4!important;color:#B01E24;font-weight:900}
.chips .chip{border-radius:14px;padding:9px 15px;box-shadow:0 6px 14px -12px rgba(0,0,0,.4)}
.chip.active{background:linear-gradient(135deg,#EF3B41,#B01E24);border-color:transparent}
.form-actions.sticky{background:rgba(23,24,28,.92);backdrop-filter:blur(10px);border-radius:18px;padding:12px 16px;margin-top:6px;box-shadow:0 24px 40px -24px rgba(0,0,0,.8)}
.form-actions.sticky .muted{color:#C9CBD6}.form-actions.sticky .btn-ghost{background:transparent;color:#fff;border-color:rgba(255,255,255,.25)}
.alert{border-radius:16px;font-weight:800}
.quick a{border-radius:16px;padding:16px;background:#fff;box-shadow:0 8px 18px -16px rgba(0,0,0,.5)}
.quick a .ic{width:38px;height:38px;padding:9px;border-radius:12px;background:#FFF1F1;box-sizing:border-box;color:#DB272D}
.bar-track{height:12px;background:#F1F2F5}.bar-fill{background:linear-gradient(90deg,#B01E24,#EF3B41)}
.foot{border-top:0;text-align:center}
.auth-card{border-radius:28px}
/* page hero (lists) */
.page-hero{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;border-radius:24px;padding:22px 26px;color:#fff;background:radial-gradient(420px 200px at 0% 140%,rgba(219,39,45,.6),transparent 70%),linear-gradient(135deg,#17181C,#2A2B3B);box-shadow:0 26px 50px -36px rgba(23,24,28,.9)}
.page-hero h2{font-size:24px;font-weight:900;margin:0}.page-hero p{margin:4px 0 0;color:#C9CBD6}
.page-hero .btn-ghost{background:rgba(255,255,255,.1);color:#fff;border-color:rgba(255,255,255,.2);box-shadow:none}
.page-hero .btn-ghost:hover{background:rgba(255,255,255,.18);color:#fff}
.page-hero .ph-acts{display:flex;gap:8px;flex-wrap:wrap}
@media (max-width:860px){.topbar{padding:12px 16px}.content{padding:16px}.search input{min-width:0}.hero h2{font-size:23px}}
/* print pages (PDF) */
.pdf-sec{margin-top:5mm}.pdf-sec h3{font-size:14px;margin:0 0 2.5mm;display:flex;align-items:center;gap:2mm}.pdf-sec h3::before{content:"";width:2mm;height:5mm;border-radius:1mm;background:#DB272D}
.pdf-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4mm}
.pdf-kv{border:1px solid #ECEDF1;border-radius:3mm;padding:2.6mm 3.5mm}.pdf-kv small{display:block;color:#8A8F99;font-size:9.5px;font-weight:800}.pdf-kv b{font-size:12.5px}
.report-table tr.grp td{background:#17181C!important;color:#fff;font-weight:900;text-align:right;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.mono{white-space:nowrap}.table th{border-inline:0}
.report-table td{white-space:nowrap}.report-table td.name{white-space:normal}
.pdf-sec{margin-top:3.5mm}.pdf-grid{gap:2.5mm}.pdf-kv{padding:1.8mm 3mm}
.report .slip-emp{padding:2.4mm 4mm}
@media print{.report{min-height:0!important}}
@media print{.report:last-of-type,.slip:last-of-type{page-break-after:auto!important;break-after:auto!important}}
.report .slip-sign{margin-top:5mm;padding-top:1mm}.report .sig .line{height:8mm}.report .slip-head{padding-bottom:2.5mm}.report .slip-brand img{max-height:22mm}
/* ===== قائمة الموظفين v3 ===== */
.emp-hero{position:relative;overflow:hidden;align-items:flex-start;padding:26px 28px 22px;background:radial-gradient(520px 260px at 0% 120%,rgba(219,39,45,.55),transparent 70%),radial-gradient(360px 200px at 100% -20%,rgba(75,73,184,.45),transparent 70%),linear-gradient(135deg,#141519,#262738 60%,#2E1A22)}
.emp-hero::after{content:"";position:absolute;inset:auto -60px -90px auto;width:260px;height:260px;border-radius:50%;border:40px solid rgba(255,255,255,.04);pointer-events:none}
.eh-title{display:flex;gap:14px;align-items:center}
.eh-ic{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#EF3B41,#B01E24);box-shadow:0 14px 26px -12px rgba(219,39,45,.9)}
.eh-ic svg{width:26px;height:26px;color:#fff}
.eh-kpis{flex-basis:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:8px;position:relative;z-index:1}
.ek{background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.1);border-radius:18px;padding:14px 16px;backdrop-filter:blur(6px)}
.ek small{display:block;color:#AEB1C0;font-weight:700;font-size:12.5px}
.ek b{display:block;font-size:24px;font-weight:900;margin:4px 0 2px;font-variant-numeric:tabular-nums;letter-spacing:-.3px}
.ek b i{font-style:normal;font-size:12px;color:#C9CBD6;font-weight:700}
.ek span{font-size:12px;color:#9396A6}
.ek.hot{background:linear-gradient(135deg,rgba(239,59,65,.95),rgba(176,30,36,.95));border-color:transparent;box-shadow:0 18px 30px -18px rgba(219,39,45,.9)}
.ek.hot small,.ek.hot span,.ek.hot b i{color:#FFE1E2}
/* بلاطات الفئات */
.dep-tiles{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 8px;margin:18px 0 6px;scrollbar-width:thin}
.dtile{flex:0 0 auto;min-width:150px;display:grid;grid-template-columns:auto 1fr;column-gap:9px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:18px;padding:12px 16px;box-shadow:0 10px 20px -18px rgba(0,0,0,.5);transition:.18s;position:relative;overflow:hidden}
.dtile::before{content:"";position:absolute;inset:0 0 auto 0;height:3px;background:hsl(var(--h) 70% 52%);opacity:.85}
.dt-dot{grid-row:span 2;width:12px;height:12px;border-radius:50%;background:hsl(var(--h) 72% 52%);box-shadow:0 0 0 4px hsl(var(--h) 80% 94%)}
.dtile strong{font-weight:900;font-size:14px;white-space:nowrap}
.dtile em{font-style:normal;font-size:12px;color:var(--muted);font-weight:700;white-space:nowrap}
.dtile:hover{transform:translateY(-2px);border-color:hsl(var(--h) 60% 80%)}
.dtile.active{background:linear-gradient(135deg,#17181C,#2B2C3A);border-color:transparent;color:#fff;box-shadow:0 16px 28px -18px rgba(23,24,28,.9)}
.dtile.active em{color:#C9CBD6}.dtile.active .dt-dot{box-shadow:0 0 0 4px rgba(255,255,255,.14)}
/* شريط البحث والتبديل */
.emp-bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:20px;padding:10px;box-shadow:var(--shadow);margin-bottom:14px;position:sticky;top:72px;z-index:5}
.eb-search{flex:1 1 300px;display:flex;align-items:center;gap:8px;background:#F5F6F8;border-radius:14px;padding:0 14px;border:1px solid transparent;transition:.15s}
.eb-search:focus-within{background:#fff;border-color:#F3B7BA;box-shadow:0 0 0 4px rgba(219,39,45,.08)}
.eb-search svg{width:18px;height:18px;color:var(--muted);flex:none}
.eb-search input{flex:1;border:0;background:transparent;min-height:44px;font:inherit;outline:0;min-width:0}
.eb-clear{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:#E7E8EC;color:#555;font-size:16px;line-height:1}
.seg{display:inline-flex;background:#F2F3F6;border-radius:14px;padding:4px;gap:2px}
.seg a,.seg button{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;font:inherit;font-weight:800;font-size:13.5px;padding:9px 14px;border-radius:11px;color:#555;cursor:pointer;white-space:nowrap}
.seg b{font-size:11.5px;background:#fff;border-radius:99px;padding:1px 7px;color:#333}
.seg .on{background:#fff;color:var(--primary);box-shadow:0 6px 14px -10px rgba(0,0,0,.45)}
.seg .on b{background:#FFEDEE;color:var(--primary)}
.seg svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
/* الجدول */
.emp-table-card{border-radius:22px;overflow:hidden}
.emp-table th[data-sort]{cursor:pointer;user-select:none}
.emp-table th[data-sort]::after{content:"⇅";opacity:.35;margin-inline-start:6px;font-size:11px}
.emp-table th.asc::after{content:"▲";opacity:.9}.emp-table th.desc::after{content:"▼";opacity:.9}
.emp-table td{vertical-align:middle;padding-block:12px}
.emp-table tbody tr{transition:background .12s}
.emp-table tbody tr:hover{background:#FFF7F7!important}
.emp-table tbody tr:hover td:first-child{box-shadow:inset -4px 0 0 #DB272D}
.emp-table tr.is-off{opacity:.62}
.code-pill{display:inline-block;font-family:ui-monospace,Consolas,monospace;font-size:12.5px;font-weight:800;background:#F2F3F6;border:1px solid #E6E7EC;border-radius:8px;padding:3px 9px;color:#3A3D47;white-space:nowrap}
.jobcell{display:flex;flex-direction:column;gap:5px;align-items:flex-start}.jobcell span{font-weight:700}
.dtag{font-style:normal;display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:800;color:hsl(var(--h) 60% 32%);background:hsl(var(--h) 85% 95%);border:1px solid hsl(var(--h) 60% 86%);border-radius:99px;padding:2px 10px;white-space:nowrap}
.dtag::before{content:"";width:6px;height:6px;border-radius:50%;background:hsl(var(--h) 70% 48%)}
.contact,.tenure{display:flex;flex-direction:column;gap:2px}
.contact a{font-family:ui-monospace,Consolas,monospace;font-weight:700;font-size:13px;color:inherit;white-space:nowrap}.contact a:hover{color:var(--primary)}
.contact small,.tenure small{color:var(--muted);font-size:11.5px;white-space:nowrap}
.tenure b{font-weight:800;white-space:nowrap}
.paycell{display:flex;flex-direction:column;align-items:flex-end;gap:4px;min-width:150px}
.paycell b{font-size:15.5px;font-weight:900;font-variant-numeric:tabular-nums}
.paycell small{color:var(--muted);font-size:11px;white-space:nowrap}
.pbar{display:block;width:100%;height:6px;border-radius:99px;background:#F0F1F4;overflow:hidden}
.pbar i{display:block;height:100%;width:var(--w);border-radius:99px;background:linear-gradient(90deg,#B01E24 0 var(--b),#F59EA1 var(--b) 100%);margin-inline-start:auto}
.emp-table .actions{white-space:nowrap}
.table-foot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
/* البطاقات */
.emp-grid{display:none;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
.emp-view[data-mode=cards] .emp-grid{display:grid}.emp-view[data-mode=cards] .emp-table-card{display:none}
.ecard{background:#fff;border:1px solid var(--line);border-radius:22px;padding:16px;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;position:relative;overflow:hidden;box-shadow:0 14px 26px -24px rgba(0,0,0,.6);transition:transform .18s,box-shadow .18s}
.ecard::before{content:"";position:absolute;inset:0 0 auto 0;height:74px;background:linear-gradient(135deg,hsl(var(--h) 70% 96%),hsl(var(--h) 60% 90%))}
.ecard:hover{transform:translateY(-4px);box-shadow:0 26px 40px -28px rgba(23,24,28,.7)}
.ecard.is-off{opacity:.65}
.ec-top{position:relative;width:100%;display:flex;justify-content:space-between}
.ec-id{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;color:inherit}
.avatar.lg{width:72px;height:72px;border-radius:22px;font-size:24px;display:grid;place-items:center;font-weight:900;border:4px solid #fff;object-fit:cover}
.ec-id strong{font-weight:900;font-size:15px;line-height:1.35}.ec-id small{color:var(--muted);font-weight:700}
.ec-meta{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:2px 0 0}
.ec-meta div{background:#F7F8FA;border-radius:12px;padding:8px}.ec-meta .wide{grid-column:span 2;background:linear-gradient(135deg,#17181C,#2B2C3A);color:#fff}
.ec-meta dt{font-size:11px;color:var(--muted);font-weight:700}.ec-meta .wide dt{color:#C9CBD6}
.ec-meta dd{margin:2px 0 0;font-weight:900;font-size:13.5px;font-variant-numeric:tabular-nums}.ec-meta dd i{font-style:normal;font-size:11px;opacity:.7}
.ec-acts{display:flex;gap:6px;width:100%;justify-content:center;margin-top:auto}
.ec-acts .btn{flex:1;justify-content:center}
@media (max-width:1100px){.eh-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:860px){.emp-bar{position:static}.eh-kpis{grid-template-columns:1fr 1fr}.ek b{font-size:19px}.seg{width:100%;overflow-x:auto}}
.dep-tiles{flex-wrap:wrap;overflow:visible}
.dtile{min-width:0}
.emp-table td,.emp-table th{padding-inline:12px}
.emp-table .person{min-width:230px}
.emp-table .person strong{line-height:1.35}
.emp-table .actions{display:flex;gap:4px;justify-content:flex-end}
.emp-table td.actions{display:table-cell}
.emp-table .actions .icon-btn{width:34px;height:34px}
.jobcell span{line-height:1.35}
@media (max-width:860px){.ek{padding:12px}.ek b{font-size:17px}.ek b i{display:block;font-size:11px}.ek small{font-size:11.5px}
.dep-tiles{flex-wrap:nowrap;overflow-x:auto}.emp-hero{padding:20px 18px}}
/* ===== ضبط العرض v4: لا شيء يختفي خارج الإطار ===== */
.main,.content{min-width:0}
.table-wrap{overflow-x:auto;max-width:100%;scrollbar-width:thin;scrollbar-color:#C9CBD6 transparent}
.table-wrap::-webkit-scrollbar{height:10px}.table-wrap::-webkit-scrollbar-thumb{background:#C9CBD6;border-radius:10px;border:2px solid #fff}
.stats{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
@media (min-width:1100px){.stats:has(> .stat:nth-child(5):last-child){grid-template-columns:repeat(5,minmax(0,1fr))}}
.stat strong{white-space:nowrap}
/* كشف الشهر: مضغوط ليظهر كاملًا */
.run-table{font-size:13px}
.run-table td,.run-table th{padding:7px 5px}
.run-table thead th{white-space:normal;line-height:1.3;font-size:12px;vertical-align:bottom}
.run-table .sticky-col{min-width:170px;max-width:210px}
.run-table .sticky-col small,.run-table .sticky-col .muted{font-size:11px}
.cell{width:62px;min-height:34px;padding:5px 4px;font-size:13px}
.cell.wide{width:110px}
.run-table td.num{white-space:nowrap}
@media (max-width:1500px){.content{padding:20px 22px}}
@media (max-width:1280px){.cell{width:56px}.run-table .sticky-col{min-width:150px}}
.dept-list{grid-template-columns:repeat(auto-fill,minmax(340px,1fr))}
.dept-item{min-width:0;background:#F7F8FA;border:1px solid var(--line);border-radius:16px;padding:8px}
.dept-item form:first-child{min-width:0;display:flex;gap:6px;flex:1}
.dept-item input[name=name]{min-width:0;flex:1;width:auto;background:#fff}
.dept-item .badge{white-space:nowrap;flex:none}.dept-item form:last-child{flex:none}
.emp-table .person{min-width:190px}.paycell{min-width:120px}
@media (max-width:1500px){.sidebar{width:250px}}
@media (max-width:1340px){.emp-table .col-ten{display:none}.emp-table .actions .icon-btn{width:30px;height:30px}}
.cell[data-f=work],.cell[data-f=absent]{width:52px}
.cell[data-f=overtime],.cell[data-f=bonus],.cell[data-f=otherded],.cell[data-f=advance]{width:74px}
@media (max-width:1280px){.cell[data-f=overtime],.cell[data-f=bonus],.cell[data-f=otherded],.cell[data-f=advance]{width:66px}}
.run-table td.actions{white-space:nowrap}
@media (max-width:1300px){.content{padding:18px 16px}.run-table td,.run-table th{padding:6px 4px}.cell.wide{width:96px}}
/* ===== رأس ملف الموظف v5: خلفية داكنة كاملة ونص واضح ===== */
.profile-head{background:radial-gradient(420px 220px at 0% 120%,rgba(219,39,45,.55),transparent 70%),radial-gradient(360px 180px at 100% -30%,rgba(75,73,184,.4),transparent 70%),linear-gradient(135deg,#141519,#262738 60%,#2E1A22);color:#fff;border:0;padding:26px 28px;align-items:center}
.profile-head::before{display:none}
.profile-id{margin-top:0;align-items:center;min-width:0;flex:1 1 420px}
.profile-id>div{min-width:0}
.profile-id h2{color:#fff;font-size:26px;line-height:1.3;margin:0;overflow-wrap:anywhere}
.profile-head .ar-name{color:#E4E5EC}
.profile-head p.muted{color:#B9BCC9;margin:4px 0 10px;line-height:1.6}
.profile-head .mono{color:#fff;background:rgba(255,255,255,.1);border-radius:6px;padding:1px 7px}
.profile-head .avatar.xl{border:4px solid rgba(255,255,255,.9);box-shadow:0 18px 30px -16px rgba(0,0,0,.8)}
.profile-head .badge-green{background:rgba(46,196,107,.16);color:#7FE3A6}
.profile-head .badge-blue{background:rgba(120,140,255,.16);color:#C5CEFF}
.profile-head .badge-gray{background:rgba(255,255,255,.12);color:#E4E5EC}
.profile-head .profile-actions .btn-ghost{background:rgba(255,255,255,.1);color:#fff;border-color:rgba(255,255,255,.22);box-shadow:none}
.profile-head .profile-actions .btn-ghost:hover{background:rgba(255,255,255,.18)}
.profile-head .btn-danger-ghost{background:rgba(219,39,45,.15);color:#FFB3B5;border-color:rgba(219,39,45,.4)}
/* معاينة صفحات الطباعة على الشاشات الصغيرة: تصغير تلقائي بدل التمرير الجانبي (لا يؤثر على الطباعة) */
@media screen{.print-body .slip,.print-body .report,.print-body .pr{zoom:var(--fit,1)}}
@media screen and (max-width:1150px){.print-body .slip,.print-body .report,.print-body .pr{margin-inline:auto;margin-block:10px}.print-toolbar{flex-wrap:wrap;gap:8px}}
@media (max-width:860px){.stat strong{font-size:clamp(16px,5vw,24px)!important;letter-spacing:-.3px}.stat{min-width:0}}
@media (max-width:600px){.profile-head{padding:20px}.profile-id{flex-direction:column;text-align:center;align-items:center}.profile-id h2{font-size:21px}.profile-head .profile-actions{width:100%;justify-content:center}}
