/* ===== توظّف — نظام التصميم ===== */
:root {
  --primary: #0F6B53; --primary-d: #0A4D3C; --primary-t: #E4F1EC;
  --accent: #E89B2E; --accent-t: #FBEBD3; --accent-ink: #6B4300;
  --ink: #0B1F1A; --ink-2: #16302A; --ink-3: #2C4A41;
  --ground: #F4F6F5; --surface: #FFFFFF; --line: #DCE3E0; --line-2: #EEF2F0;
  --muted: #51605B; --danger: #B42318; --danger-t: #FDECEA; --info: #1D4ED8; --info-t: #E8EEFD;
  --radius: 16px; --radius-lg: 22px;
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif; --display: 'Alexandria', 'IBM Plex Sans Arabic', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--ground); line-height: 1.7; font-size: 15px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.4; margin: 0 0 .5em; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== تخطيط ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .main { flex: 2 1 520px; min-width: 0; }
.split > .side { flex: 1 1 300px; min-width: 0; }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; } .mb0 { margin-bottom: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.bold { font-weight: 700; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.num { font-family: var(--display); font-weight: 800; }

/* ===== بطاقات ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; min-width: 0; }
.card.tight { padding: 16px; }
.card.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.green { background: var(--primary); color: #fff; border-color: var(--primary); }
.card.sand { background: var(--accent-t); border-color: var(--accent-t); }
.card.soft { background: var(--ground); border-color: var(--line-2); }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-family: var(--display); font-weight: 800; font-size: 28px; margin: 4px 0 0; }
.stat .delta { font-size: 12px; font-weight: 600; color: var(--primary); }

/* ===== أزرار ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; font-size: 15px; font-weight: 700; border: 1px solid transparent; border-radius: 12px; padding: 11px 18px; min-height: 44px; cursor: pointer; text-decoration: none; transition: filter .15s, background .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.95); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { color: #fff; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-soft { background: var(--ground); color: var(--ink); }
.btn-danger { background: var(--danger-t); color: var(--danger); }
.btn-link { background: none; border: 0; color: var(--primary); padding: 0; min-height: 0; font-weight: 700; }
.btn-sm { font-size: 13px; padding: 8px 12px; min-height: 36px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-linkedin { background: #0A66C2; color: #fff; }
.btn-linkedin:hover { color: #fff; }

/* ===== شارات ===== */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--ground); color: var(--ink); white-space: nowrap; }
.badge.green { background: var(--primary-t); color: var(--primary-d); }
.badge.sand { background: var(--accent-t); color: var(--accent-ink); }
.badge.dark { background: var(--ink); color: #fff; }
.badge.red { background: var(--danger-t); color: var(--danger); }
.badge.blue { background: var(--info-t); color: var(--info); }
.chip { display: inline-flex; font-size: 13px; padding: 6px 11px; border-radius: 999px; background: var(--primary-t); color: var(--ink); }
.chip.sand { background: var(--accent-t); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ===== نماذج ===== */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], input[type=date], input[type=datetime-local], input[type=time], input[type=search], select, textarea {
  font-family: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; width: 100%; min-height: 44px; }
textarea { resize: vertical; min-height: 96px; line-height: 1.8; }
input[type=file] { font-family: inherit; font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.hint { font-size: 12px; color: var(--muted); }
.error { font-size: 13px; color: var(--danger); font-weight: 600; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ===== جداول ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; padding: 12px; border-bottom: 1px solid var(--line); background: var(--ground); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* ===== مقاييس ===== */
.bar { height: 8px; background: var(--primary-t); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar.sand > span { background: var(--accent); }
.bar.lg { height: 12px; }
.meter-row { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 14px; }
.ring { position: relative; flex: none; }
.ring svg { display: block; }
.ring .ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; }

/* ===== رأس الموقع العام ===== */
.site-header { background: var(--ink); color: #fff; }
.site-header .inner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 16px 20px; max-width: 1280px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-family: var(--display); font-weight: 800; font-size: 24px; }
.brand:hover { color: #fff; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 20px; font-size: 15px; }
.site-nav a { color: #D5E2DD; padding: 8px 0; }
.site-nav a:hover, .site-nav a.active { color: var(--accent); }
.hero { background: var(--ink); color: #fff; padding: 48px 0 96px; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.25; margin: 18px 0; }
.hero p.lead { font-size: 18px; color: #C9D8D2; max-width: 600px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--ink-2); border: 1px solid var(--ink-3); color: #F3C27A; padding: 7px 14px; border-radius: 999px; font-size: 14px; }
.section { padding: 72px 0 0; }
.section-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.section-title h2 { font-size: clamp(24px, 3vw, 34px); margin: 0; max-width: 680px; }
.site-footer { margin-top: 80px; background: var(--ink); color: #C9D8D2; font-size: 14px; }
.site-footer a { color: #fff; }

/* ===== لوحات الحسابات ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: none; background: var(--ink); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { margin: 0 8px 18px; font-size: 22px; }
.sidebar a.nav { display: flex; align-items: center; gap: 10px; color: #D5E2DD; padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.sidebar a.nav:hover { background: var(--ink-2); color: #fff; }
.sidebar a.nav.active { background: var(--accent); color: var(--ink); }
.sidebar .nav-group { font-size: 12px; color: #8FA79F; padding: 14px 12px 4px; font-weight: 700; }
.sidebar svg { flex: none; }
.sidebar .count { margin-inline-start: auto; background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .menu-btn { display: none; }
.page { padding: 26px 28px 60px; max-width: 1360px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.icon-btn .count { position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-t); color: var(--primary-d); display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; flex: none; }

/* ===== عناصر متكررة ===== */
.flash { padding: 13px 16px; border-radius: 12px; font-weight: 600; margin-bottom: 16px; }
.flash.ok { background: var(--primary-t); color: var(--primary-d); }
.flash.err { background: var(--danger-t); color: var(--danger); }
.flash.info { background: var(--accent-t); color: var(--accent-ink); }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff; }
.item.soft { background: var(--ground); border-color: var(--line-2); }
.item.hl { background: var(--primary-t); border-color: var(--primary); }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; border: 1px dashed var(--line); border-radius: 16px; background: #fff; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; background: var(--ground); padding: 5px; border-radius: 13px; }
.tabs a, .tabs button { font-family: inherit; font-size: 14px; font-weight: 700; padding: 9px 14px; border-radius: 10px; color: var(--ink); background: transparent; border: 0; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; }
.tabs a.active, .tabs button.active { background: var(--ink); color: #fff; }
.timeline { display: flex; flex-direction: column; }
.timeline .t { display: flex; gap: 12px; padding-bottom: 14px; }
.timeline .t .dot { margin-top: 7px; width: 12px; height: 12px; }
.kanban { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kanban .col { background: var(--ground); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.kanban .col h4 { font-size: 13px; margin: 0; color: var(--muted); display: flex; justify-content: space-between; }
.kanban .card-k { background: #fff; border-radius: 10px; padding: 10px; font-size: 13px; font-weight: 600; }
.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 12px 15px; border-radius: 16px; white-space: pre-line; line-height: 1.8; font-size: 15px; }
.msg.me { align-self: flex-start; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.other { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .meta { display: block; font-size: 11px; opacity: .75; margin-top: 4px; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pagination a, .pagination span { padding: 8px 13px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.pagination .active { background: var(--ink); color: #fff; border-color: var(--ink); }
.likert { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.likert label { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 58px; border: 2px solid var(--line); border-radius: 14px; padding: 8px; cursor: pointer; font-weight: 600; font-size: 14px; background: #fff; }
.likert input { position: absolute; opacity: 0; pointer-events: none; }
.likert input:checked + label { background: var(--primary); border-color: var(--primary); color: #fff; }
.likert input:focus-visible + label { outline: 3px solid var(--accent); }
.diff-old { background: var(--ground); color: var(--muted); text-decoration: line-through; padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.diff-new { background: var(--primary-t); padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.waves { display: flex; gap: 4px; align-items: center; height: 36px; }
.waves span { flex: 1; background: #F3C27A; border-radius: 99px; animation: wave 1s ease-in-out infinite; }
@keyframes wave { 0%,100% { height: 25%; } 50% { height: 100%; } }
.video-frame { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 16px; background: var(--ink); }
details.more summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.prose { line-height: 1.95; font-size: 16px; }
.prose h2 { font-size: 20px; margin-top: 1.4em; }
.prose ul, .prose ol { padding-inline-start: 22px; }

/* ===== الجوال ===== */
@media (max-width: 960px) {
  .sidebar { position: fixed; inset: 0 0 0 auto; z-index: 50; transform: translateX(100%); transition: transform .2s; height: 100vh; box-shadow: -8px 0 30px rgba(0,0,0,.25); }
  .sidebar.open { transform: none; }
  .topbar .menu-btn { display: inline-flex; }
  .page { padding: 18px 16px 48px; }
  .topbar { padding: 10px 16px; }
  .msg { max-width: 92%; }
  .meter-row { grid-template-columns: 110px minmax(0, 1fr) 36px; }
}
@media print {
  .no-print, .sidebar, .topbar, .site-header, .site-footer { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
}
