:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e3e8ec;
  --line-strong: #cfd7de;
  --ink: #1f2d31;
  --ink-2: #4a5864;
  --ink-3: #5f6d77;
  --brand: #147687;      /* تركواز الحتمية (أغمق قليلًا للنصوص والأزرار) */
  --brand-2: #219bad;    /* تركواز الشعار */
  --brand-soft: #e8f4f6;
  --brand-hover: #0f5f6d;
  --font-display: "Alexandria", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --charcoal: #253337;   /* رمادي الشعار */
  --accent: #219bad;
  --ok: #1f7a4d;   --ok-bg: #e5f4ec;
  --warn: #9a6200; --warn-bg: #fdf1dc;
  --bad: #b3261e;  --bad-bg: #fbe7e5;
  --info: #1d5fa8; --info-bg: #e6eef9;
  --muted-bg: #eef1f4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 44, .06), 0 1px 1px rgba(16, 32, 44, .03);
  --sidebar: #ffffff;
  --sidebar-ink: #4a4f54;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.ic { vertical-align: -4px; flex: none; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; direction: ltr; text-align: left; unicode-bidi: plaintext; white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: plaintext; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ——— الهيكل ——— */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-ink);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar { border-inline-start: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; margin: 0 6px 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { color: var(--charcoal); font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.brand-text span { display: none; }
.brand b { display: block; font-size: 15px; }
.brand span { font-size: 11.5px; opacity: .7; }
.nav-group { padding: 8px 10px 4px; }
.nav-group h6 { margin: 8px 10px 6px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.nav-group a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--sidebar-ink); font-size: 13.5px;
}
.nav-group a:hover { background: var(--muted-bg); text-decoration: none; color: var(--charcoal); }
.nav-group a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset -3px 0 0 var(--brand-2); }
.sidebar-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12.5px; background: var(--surface-2); }
.sidebar-foot b { color: var(--charcoal); display: block; }
.sidebar-foot a, .sidebar-foot .btn-link { color: var(--brand); }

.main { min-width: 0; }
.topbar {
  height: 58px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 5;
}
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; padding: 8px 36px 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font: inherit; }
.search .ic { position: absolute; right: 10px; top: 9px; color: var(--ink-3); }
.topbar .date { margin-inline-start: auto; color: var(--ink-3); font-size: 13px; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }

.content { padding: 24px 28px 48px; max-width: 1440px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.3; }
.page-head .sub { color: var(--ink-3); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ——— الأزرار ——— */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font: inherit; font-size: 13.5px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { color: var(--bad); border-color: #ecc3bf; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-link { border: 0; background: none; color: var(--brand-2); padding: 0; cursor: pointer; font: inherit; }

/* ——— البطاقات ——— */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .hint { color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.card-body { padding: 16px 18px; }
.card-empty { padding: 28px 18px; text-align: center; color: var(--ink-3); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 16px; }

/* ——— المؤشرات ——— */
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--ink-3); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.kpi .value { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-inline-start: 4px; }
.kpi .foot { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; overflow-wrap: anywhere; }
.kpi.accent { border-top: 3px solid var(--brand-2); }
.kpi.warn { border-top: 3px solid var(--warn); }
.kpi.bad { border-top: 3px solid var(--bad); }
.kpi.ok { border-top: 3px solid var(--ok); }

/* ——— الجداول ——— */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: start; font-weight: 600; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-strong); }
.t .title-cell b { display: block; font-weight: 600; }
.t .title-cell span { font-size: 12.5px; color: var(--ink-3); }
.t tr.is-late td:first-child { box-shadow: inset -3px 0 0 var(--bad); }
td.actions-cell { text-align: end; white-space: nowrap; }

/* ——— الشارات ——— */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--ink-2); }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.health i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.health-ok i { background: var(--ok); } .health-warn i { background: #d99a1e; } .health-bad i { background: var(--bad); }
.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--bad); } .tone-muted { color: var(--ink-3); }

.bar { display: inline-block; width: 100%; min-width: 70px; height: 7px; background: var(--muted-bg); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.bar > span { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.bar.ok > span { background: var(--ok); } .bar.warn > span { background: #d99a1e; } .bar.bad > span { background: var(--bad); }
.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.progress-cell .num { font-size: 12.5px; color: var(--ink-2); min-width: 38px; }

/* ——— التبويبات ——— */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs .count { background: var(--muted-bg); color: var(--ink-2); border-radius: 99px; padding: 0 7px; font-size: 11.5px; }
.tabs .count.bad { background: var(--bad-bg); color: var(--bad); }

/* ——— القوائم الوصفية ——— */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; font-weight: 500; }
.stat-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-row.total { font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: 0; margin-top: 4px; padding-top: 10px; }

/* ——— النماذج ——— */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--ink-2); }
.field .req { color: var(--bad); }
.field input[type=text], .field input[type=number], .field input[type=date], .field input[type=email], .field input[type=password], .field input[type=file],
.field select, .field textarea, .inline-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink);
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
.field .help { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.field .err { font-size: 12.5px; color: var(--bad); margin-top: 4px; }
.field.check label { display: flex; gap: 8px; align-items: center; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; }
.errorlist { color: var(--bad); margin: 0 0 12px; padding: 0 18px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; background: var(--surface); }
.chip { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 13px; }
.chip:hover { text-decoration: none; background: var(--surface-2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.messages { margin-bottom: 16px; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; background: var(--info-bg); color: var(--info); }
.msg.success { background: var(--ok-bg); color: var(--ok); }
.msg.error { background: var(--bad-bg); color: var(--bad); }
.msg.warning { background: var(--warn-bg); color: var(--warn); }

.callout { border: 1px solid var(--line); border-inline-start: 4px solid var(--brand-2); background: var(--brand-soft); padding: 12px 14px; border-radius: 8px; }
.callout.warn { border-inline-start-color: var(--warn); background: var(--warn-bg); }

/* ——— خط المراحل (Pipeline) ——— */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.lane-head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.lane-head b { font-size: 13.5px; }
.lane-head div { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; margin-top: 2px; }
.lane-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.opp { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; display: block; color: var(--ink); }
.opp:hover { border-color: var(--brand-2); text-decoration: none; }
.opp .t1 { font-weight: 600; font-size: 13px; line-height: 1.45; }
.opp .t2 { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.opp .t3 { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12.5px; }
.opp .due.bad { color: var(--bad); font-weight: 600; }

/* ——— الرسوم ——— */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--ink-3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar-row .track { height: 10px; background: var(--muted-bg); border-radius: 99px; overflow: hidden; display: flex; }
.hbar-row .track span { display: block; height: 100%; }

/* ——— الجدول الزمني ——— */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--ink-3); font-size: 12px; min-width: 92px; }

/* ——— الدخول ——— */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: linear-gradient(160deg, #1b272a 0%, #253337 55%, #147687 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h2 { font-size: 30px; margin: 0 0 12px; line-height: 1.35; }
.login-art p { opacity: .8; max-width: 440px; }
.login-art ul { padding: 0; list-style: none; opacity: .9; }
.login-art li { padding: 6px 0; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: 100%; max-width: 360px; }

/* ——— ورقة الساعات ——— */
.ts-grid input { width: 64px; text-align: center; padding: 6px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; }
.ts-grid th.day { text-align: center; }
.ts-grid td.day { text-align: center; }
.ts-grid td.wkend { background: var(--surface-2); }

/* ——— الإشعارات ——— */
.bell { position: relative; }
.bell summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 2px; color: var(--ink-2); padding: 6px; border-radius: 8px; }
.bell summary::-webkit-details-marker { display: none; }
.bell summary b { background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; margin-inline-start: -6px; }
.bell-panel { position: absolute; left: 0; top: 40px; width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 30; }
.bell-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink); border-inline-start: 3px solid var(--info); }
.bell-item.warn { border-inline-start-color: #d99a1e; } .bell-item.bad { border-inline-start-color: var(--bad); }
.bell-item:hover { background: var(--surface-2); text-decoration: none; }
.bell-item small { display: block; color: var(--ink-3); }
.bell-foot { display: flex; justify-content: space-between; padding: 8px 12px; font-size: 12.5px; }
.state-expired { color: var(--bad); font-weight: 600; } .state-soon { color: var(--bad); } .state-watch { color: var(--warn); } .state-valid { color: var(--ok); }
.req { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.req.done span { text-decoration: line-through; color: var(--ink-3); }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 0 0 auto; width: 260px; transform: translateX(100%); transition: transform .2s; z-index: 20; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; }
  .g2, .g4, .form-grid { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .hbar-row { grid-template-columns: 100px 1fr 80px; }
}

@media print {
  .sidebar, .topbar, .actions, .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; }
  body { background: #fff; }
}

.login-logo img { height: 74px; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,.18)); }
.login-art { position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; inset-inline-start: -90px; bottom: -110px; width: 420px; height: 420px; background: url("../img/hatmia-mark-white.svg") no-repeat center / contain; opacity: .07; filter: brightness(0) invert(1); pointer-events: none; }
/* شعارات العملاء: مربع موحد بحجم وإطار واحد مهما كان شكل الشعار */
.logo-chip, .logo-ph { box-sizing: border-box; width: 30px; height: 30px; flex: none; border-radius: 8px; vertical-align: middle; margin-inline-end: 8px; }
.logo-chip { background: #fff; border: 1px solid #e6eaed; object-fit: contain; padding: 1px; box-shadow: 0 1px 1px rgba(16,32,44,.04); }
.logo-ph { display: inline-grid; place-items: center; background: var(--muted-bg); border: 1px solid var(--line); color: var(--ink-3); font-weight: 600; font-size: 13px; }
.logo-chip.lg, .logo-ph.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 19px; padding: 2px; }

/* ——— مراحل الفرصة ——— */
.stage-track { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.stage-track form { margin: 0; }
.stage-step { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; list-style: none; }
.stage-step::-webkit-details-marker { display: none; }
.stage-step i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--muted-bg); font-size: 11.5px; font-weight: 600; }
.stage-step.past { border-color: #b8dfe7; color: var(--brand); } .stage-step.past i { background: var(--brand-soft); color: var(--brand); }
.stage-step.on { background: var(--brand); border-color: var(--brand); color: #fff; } .stage-step.on i { background: rgba(255,255,255,.22); color: #fff; }
.stage-award { position: relative; }
.award-form { position: absolute; z-index: 10; inset-inline-start: 0; top: 44px; width: min(520px, 90vw); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.award-choice { display: flex; gap: 18px; padding: 6px 0; } .award-choice label { display: flex; gap: 6px; align-items: center; font-weight: 500; }
.reason-missing { color: var(--bad); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.reason-missing::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); display: inline-block; }
.opp-wrap { display: grid; gap: 4px; }
.opp-move select { width: 100%; font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-2); }

/* ——— الصفحة الرئيسية (البوابة) ——— */
.portal { min-height: 100vh; background: var(--bg); }
.portal-top { margin: 16px 24px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 10px rgba(16,32,44,.04); display: flex; align-items: center; gap: 18px; padding: 12px 22px; }
.portal-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.portal-brand:hover { text-decoration: none; }
.portal-brand img { height: 38px; }
.portal-brand b { display: block; font-size: 19px; color: var(--charcoal); }
.portal-brand small { display: block; font-size: 12px; color: var(--ink-3); }
.portal-date { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-2); padding-inline-end: 18px; border-inline-end: 1px solid var(--line); }
.portal-actions { display: flex; align-items: center; gap: 10px; }
.portal-actions .bell-panel { left: 0; }
.user-menu summary { gap: 6px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.chev { color: var(--ink-3); font-size: 12px; }
.portal-main { max-width: 1280px; margin: 0 auto; padding: 18px 24px 40px; }
.portal-hero { text-align: center; margin: 22px 0 26px; }
.portal-hero h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--ink); }
.portal-hero h1::after { content: ""; display: block; width: 52px; height: 4px; border-radius: 4px; background: var(--brand-2); margin: 10px auto 0; }
.portal-hero p { margin: 14px 0 0; font-size: 18px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 16px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--charcoal); text-decoration: none; box-shadow: 0 1px 2px rgba(16,32,44,.04); transition: transform .12s, box-shadow .12s, border-color .12s; }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,32,44,.08); border-color: #cfe6ec; }
.tile-icon { width: 70px; height: 62px; border-radius: 14px; display: grid; place-items: center; }
.tile-icon.c-teal { background: #e3f4f2; color: #147687; }
.tile-icon.c-blue { background: #e4eefb; color: #2563b8; }
.tile-icon.c-slate { background: var(--muted-bg); color: var(--ink-2); }
.tile-title { font-size: 17px; font-weight: 700; text-align: center; }
.tasks-card { margin-top: 26px; }
.tasks-title { display: flex; align-items: center; gap: 8px; font-size: 18px !important; }
.tasks-title::after { content: ""; }
table.tasks td { padding: 13px 14px; }
table.tasks th { background: var(--muted-bg); padding: 12px 14px; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 14px; border-radius: 99px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-progress { background: #fdf0dc; color: #b26b00; }
.pill-pending { background: #e4eefb; color: #1d5fa8; }
.pill-urgent { background: #fde7d6; color: #c2410c; }
.pill-late { background: var(--bad-bg); color: var(--bad); }
.dots { color: var(--ink-3); letter-spacing: 2px; text-decoration: none; }
.portal-foot { text-align: center; margin-top: 18px; font-size: 13px; }
@media (max-width: 820px) {
  .portal-top { margin: 10px; padding: 10px 14px; flex-wrap: wrap; }
  .portal-date { display: none; }
  .portal-actions { margin-inline-start: auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ——— لوحة حالة المشروع ——— */
.status-panel { position: relative; }
.status-panel > summary { list-style: none; } .status-panel > summary::-webkit-details-marker { display: none; }
.status-form { position: absolute; inset-inline-end: 0; top: 44px; z-index: 20; width: min(460px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.seg-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-choice label { cursor: pointer; } .seg-choice input { display: none; }
.seg-choice span { display: inline-block; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; }
.seg-choice input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }


/* ——— مربعات الشرح المؤقتة ——— */
.tip-box { border: 1px dashed #8fcfdb; background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; margin: 10px 0 14px; font-size: 13px; color: var(--ink-2); transition: opacity .25s, transform .25s; }
.tip-box.tip-gone { opacity: 0; transform: translateY(-4px); }
.tip-head { display: flex; align-items: center; gap: 8px; }
.tip-head b { color: var(--brand); font-size: 13.5px; }
.tip-ic { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-2); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.tip-hide { margin-inline-start: auto; font: inherit; font-size: 12px; background: none; border: 1px solid #b9dfe6; color: var(--brand); border-radius: 6px; padding: 2px 10px; cursor: pointer; }
.tip-hide:hover { background: var(--surface); }
.tip-body { margin-top: 6px; line-height: 1.8; }
.tip-body ol, .tip-body ul { margin: 4px 0; padding-inline-start: 20px; }
@media print { .tip-box { display: none; } }

/* ——— سجل المراسلات ——— */
.reg-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.reg-next .card { padding: 12px 14px; display: grid; gap: 6px; }
.reg-next .k { font-size: 12px; color: var(--ink-3); }
.reg-next .v { font-size: 20px; font-weight: 700; color: var(--brand); direction: ltr; text-align: start; }
.reg-num { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; font-weight: 600; white-space: nowrap; }
.st-pending { background: var(--warn-bg); color: var(--warn); }
.st-returned { background: var(--bad-bg); color: var(--bad); }
.st-approved { background: var(--ok-bg); color: var(--ok); }
.st-cancelled, .st-legacy { background: var(--muted-bg); color: var(--ink-3); }
.st { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 99px; white-space: nowrap; }
.preview-num { display: inline-block; margin-top: 6px; padding: 6px 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.report-card { display: grid; gap: 10px; padding: 16px; border-top: 4px solid var(--c, var(--brand)); }
.report-card h3 { margin: 0; font-size: 16px; }
.report-card .btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ——— صفحة الدخول: رسالة للفريق وشعار أوضح ——— */
.login-logo { display: inline-block; }
.login-logo img { height: 96px; display: block; }
.login-kicker { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .3px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 3px 12px; border-radius: 99px; margin-bottom: 14px; }
.login-msg h2 { font-size: 32px; }
.login-msg p { opacity: .88; max-width: 470px; line-height: 1.9; }
.login-sign { font-weight: 600; opacity: .95 !important; }
.login-form-logo { display: none; height: 64px; margin: 0 auto 18px; }
@media (max-width: 820px) { .login-form-logo { display: block; } }

/* ——— دليل الاستخدام ——— */
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; margin-bottom: 14px; font-size: 13px; position: sticky; top: 8px; z-index: 3; }
.guide-toc b { width: 100%; }
.guide-toc { counter-reset: guide-toc; }
.guide-toc a::before { counter-increment: guide-toc; content: counter(guide-toc) ". "; }
.guide-sec h2::before { counter-increment: guide-sec; content: counter(guide-sec) ". "; }
.guide-sec { padding: 16px 20px; margin-bottom: 14px; scroll-margin-top: 110px; }
.guide-sec h2 { margin: 0 0 10px; font-size: 18px; color: var(--brand); }
.guide-sec h3 { margin: 14px 0 4px; font-size: 15px; }
.guide-sec ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; line-height: 1.85; }
.guide-note { background: var(--brand-soft); border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; font-size: 13px; }


/* ——— لوحة مدير النظام ——— */
.ctl-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.ctl-act { display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: var(--ink); text-decoration: none !important; transition: border-color .2s, box-shadow .2s, transform .2s; }
.ctl-act .ic { color: var(--brand); margin-bottom: 4px; }
.ctl-act b { font-size: 15px; }
.ctl-act span { font-size: 12.5px; color: var(--ink-3); }
.ctl-act:hover { border-color: var(--brand-2); box-shadow: 0 8px 20px rgba(19,128,154,.12); transform: translateY(-2px); }
.ctl-act.danger .ic { color: var(--bad); }
.ctl-act.danger:hover { border-color: var(--bad); }
.ctl-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ctl-row:last-child { border: 0; }
.ctl-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ctl-secret { border: 2px solid var(--ok); background: var(--ok-bg); padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 8px; }
.ctl-cred { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 15px; }
.ctl-cred b { font-family: var(--font-mono); font-size: 16px; color: #15212b; background: #fff; padding: 2px 10px; border-radius: 6px; }
.cr { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 99px; white-space: nowrap; vertical-align: middle; }
.cr-pending { background: var(--warn-bg); color: var(--warn); } .cr-done { background: var(--ok-bg); color: var(--ok); }
.cr-rejected, .cr-failed { background: var(--bad-bg); color: var(--bad); } .cr-cancelled { background: var(--muted-bg); color: var(--ink-3); }
.ctl-matrix th { font-size: 11.5px; white-space: normal; min-width: 70px; }
.ctl-cell { text-align: center; }
a.kpi { color: inherit; text-decoration: none !important; }

/* نموذج تقييم الموقع */
.sv-card { margin-bottom: 14px; }
.sv-card h3 { margin: 0 0 12px; font-size: 16px; }
.sv-q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sv-q:last-child { border: 0; }
.sv-label { font-weight: 600; }
.sv-stars { display: flex; gap: 6px; direction: ltr; }
.sv-star input, .sv-chip input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.sv-star span { display: grid; place-items: center; width: 42px; height: 42px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; cursor: pointer; transition: .15s; }
.sv-star:hover span { border-color: var(--brand); }
.sv-star input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.sv-star input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.sv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; position: relative; }
.sv-chip:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); font-weight: 600; }
.sv .err { color: var(--bad, #c0392b); font-size: 13px; width: 100%; }
@media (max-width: 600px) { .sv-star span { width: 38px; height: 38px; } .sv-q { flex-direction: column; align-items: flex-start; } }

/* سير المهام والطلبات */
.flow-steps { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flow-pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--muted-bg); color: var(--ink-2); white-space: nowrap; }
.flow-in_progress, .hr-manager { background: var(--info-bg); color: var(--info); }
.flow-review, .hr-hr { background: var(--warn-bg); color: var(--warn); }
.flow-returned, .hr-rejected { background: var(--bad-bg); color: var(--bad); }
.flow-approved, .hr-approved { background: var(--ok-bg); color: var(--ok); }
.mb { margin-bottom: 8px; }

/* التحقق بخطوتين */
.twofa { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.twofa .card { max-width: 440px; width: 100%; display: grid; gap: 12px; }
.twofa h1 { margin: 0; font-size: 22px; }
.twofa-qr { justify-self: center; background: #fff; padding: 8px; border-radius: 8px; line-height: 0; }
.twofa-qr svg { max-width: 100%; height: auto; }
.twofa-secret { font-family: var(--font-mono); word-break: break-all; }
.twofa-codes { font-family: var(--font-mono); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; list-style: none; padding: 0; margin: 0; }

/* أزرار الدخول في زاوية الصفحة، وعرض الموبايل بلا فيض */
.login-form { position: relative; }
.login-tools { position: absolute; top: 16px; inset-inline-end: 16px; display: flex; gap: 8px; }
.page-head { flex-wrap: wrap; }
.page-head > div { min-width: 0; }
.health-muted i { background: var(--ink-3); }
@media (max-width: 820px) {
  .content, .main, .card { min-width: 0; }
  .content { overflow-wrap: anywhere; }
  .grid, .g2, .g4, .g-main { grid-template-columns: minmax(0, 1fr); }
  .filters { flex-wrap: wrap; }
  .filters select, .filters input { max-width: 100%; }
  .topbar { flex-wrap: wrap; height: auto; gap: 8px; padding: 8px 12px; }
  .topbar .date { display: none; }
  .topbar .search { order: 9; flex: 1 1 100%; min-width: 0; max-width: none; }
  .topbar .search input { width: 100%; min-width: 0; }
}

/* نسخة الشعار حسب الثيم */
.on-dark { display: none !important; }
:root[data-theme="dark"] .on-dark { display: revert !important; }
:root[data-theme="dark"] .on-light { display: none !important; }
@media print { .on-dark { display: none !important; } .on-light { display: revert !important; } }
.login-art h2 { font-family: var(--font-display); font-weight: 700; }

/* شريط المعاينة */
.preview-bar { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 20px; background: var(--warn-bg); color: var(--warn); border-bottom: 2px solid var(--warn); font-size: 14px; }
.preview-bar svg { vertical-align: -4px; }

/* زر الثيم */
.theme-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.theme-btn:hover { border-color: var(--brand); color: var(--brand); }
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: inline; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }

/* الثيم الداكن: الطباعة تبقى فاتحة */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #11181d;
    --surface: #1a2329;
    --surface-2: #202b32;
    --line: #2d3a42;
    --line-strong: #5f717b;
    --ink: #e7edf0;
    --ink-2: #b4c0c7;
    --ink-3: #8a98a1;
    --brand: #38b2cb;
    --brand-2: #4cc3da;
    --brand-soft: #17333b;
    --charcoal: #d8e0e4;
    --accent: #4cc3da;
    --ok: #5ccb93;   --ok-bg: #16322a;
    --warn: #e6b45c; --warn-bg: #3a2d14;
    --bad: #f28b82;  --bad-bg: #3d1f1d;
    --info: #7db4f0; --info-bg: #1a2c42;
    --muted-bg: #27323a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --sidebar: #161e24;
    --sidebar-ink: #c2ccd2;
  }
  :root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-ok, :root[data-theme="dark"] .chip.on, :root[data-theme="dark"] .stage-step.on { color: #0d1418; }
  :root[data-theme="dark"] .nav-group a:hover { color: var(--ink); }
  :root[data-theme="dark"] .tile-icon.c-teal, :root[data-theme="dark"] .tile-icon.c-blue, :root[data-theme="dark"] .tile-icon.c-slate { background: var(--brand-soft); color: var(--brand-2); }
  :root[data-theme="dark"] .pill-progress { background: var(--warn-bg); color: var(--warn); }
  :root[data-theme="dark"] .pill-pending { background: var(--info-bg); color: var(--info); }
  :root[data-theme="dark"] .pill-urgent { background: var(--bad-bg); color: var(--bad); }
  :root[data-theme="dark"] .tip-box { border-color: #2f6673; }
  
}

/* الدفعة 4 */
/* شارة حالة واحدة */
.badge, .pill, .st, .cr, .flow-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap; vertical-align: middle; }
.pill i { display: none; }
.ref { display: inline-block; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.clamp-2, .t .title-cell b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.t .title-cell { min-width: 280px; }
.task-cell { min-width: 260px; }

/* الرئيسية: المهام أولًا */
.portal-hero { text-align: start; margin: 8px 0 18px; }
.portal-hero h1 { font-size: 26px; }
.portal-hero h1::after { display: none; }
.portal-hero p { margin-top: 4px; font-size: 15px; }
.tasks-card { margin-top: 0; }
.tasks-card .table-wrap { max-height: 430px; overflow: auto; }
.tasks-card thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.tiles-head { margin: 26px 0 12px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tile { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px; }
.tile:hover { transform: none; box-shadow: none; border-color: var(--brand-2); }
.tile-icon { width: 40px; height: 40px; border-radius: 8px; flex: none; }
.tile-title { font-size: 14.5px; font-weight: 600; text-align: start; }

/* لوحة المهام: المؤشرات والفلاتر معًا، وكل مؤشر رابط يصفّي القائمة */
.board-bar .filters { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }
.board-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.board-stat { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; padding: 12px 16px; color: var(--ink); border-inline-start: 1px solid var(--line); }
.board-stat:first-child { border-inline-start: 0; }
.board-stat:hover { text-decoration: none; background: var(--surface-2); }
.board-stat b { grid-row: span 2; font-family: var(--font-display); font-size: 24px; font-variant-numeric: tabular-nums; }
.board-stat span { font-size: 13px; font-weight: 600; }
.board-stat small { font-size: 12px; color: var(--ink-3); }
.board-stat.bad b { color: var(--bad); } .board-stat.ok b { color: var(--ok); } .board-stat.warn b { color: var(--warn); } .board-stat.accent b { color: var(--brand); }
@media (max-width: 760px) { .board-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .board-stat:nth-child(odd) { border-inline-start: 0; } }

/* صفحة المشروع: التبويبات ثابتة أثناء التمرير */
.proj-stick { position: sticky; top: 58px; z-index: 4; display: flex; align-items: center; gap: 16px; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.proj-stick .tabs { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; border: 0; margin: 0; }
.proj-stick-name { display: none; flex: 0 1 260px; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-stick.is-stuck .proj-stick-name { display: block; }
@media (max-width: 900px) { .proj-stick { position: static; } .proj-stick.is-stuck .proj-stick-name { display: none; } }
@media print { .proj-stick { position: static; } }

/* السجل */
details.tip-box > summary { list-style: none; cursor: pointer; }
details.tip-box > summary::-webkit-details-marker { display: none; }
.reg-next { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); }
.reg-next .card { min-width: 0; }
.reg-next .v { font-family: var(--font-mono); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-next { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.reg-next .card + .card { margin-top: 0; }
.reg-next .btn { white-space: normal; justify-content: center; text-align: center; height: auto; align-self: end; }
.reg-next .v { font-size: 18px; }

/* الرقم ووحدته لا يتصلان في الخط العربي */
.kpi .value small { display: inline-block; }
.client-cell { display: flex; align-items: center; gap: 8px; min-width: 170px; }
.client-cell span { min-width: 0; }
/* على الشاشات المتوسطة يأخذ الجدول العرض كاملًا بدل أن تُقص أزراره */
@media (max-width: 1400px) { .g-main { grid-template-columns: minmax(0, 1fr); } }

/* الدفعة 5: المراحل كسلسلة أبعاد */
.stage-track, .flow-steps { gap: 0; align-items: stretch; }
.stage-step { position: relative; border: 0; border-bottom: 1px solid var(--ink-3); border-radius: 0; background: none; padding: 6px 16px 10px; color: var(--ink-3); }
.stage-step::before { content: ""; position: absolute; bottom: -6px; inset-inline-start: 0; width: 1px; height: 11px; background: var(--ink-3); transform: rotate(45deg); }
.stage-track > :last-child .stage-step::after, .stage-track > .stage-step:last-child::after, .flow-steps > .stage-step:last-child::after { content: ""; position: absolute; bottom: -6px; inset-inline-end: 0; width: 1px; height: 11px; background: var(--ink-3); transform: rotate(45deg); }
.stage-step i { border-radius: 3px; }
.stage-step.past { color: var(--brand); border-bottom-color: var(--brand); }
.stage-step.on, :root[data-theme="dark"] .stage-step.on { background: none; color: var(--brand); font-weight: 700; border-bottom: 3px solid var(--brand); padding-bottom: 8px; }
.stage-step.on i { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .stage-step.on i { color: #0d1418; }
button.stage-step:not([disabled]):hover, summary.stage-step:hover { color: var(--brand); background: var(--surface-2); }

/* الدفعة 6 */
.cell-sub { display: block; font-size: 12px; margin-top: 2px; }
.btn-icon { padding: 5px 8px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; }
.client-cell { min-width: 140px; }
.t .title-cell { min-width: 260px; }
.org-node small, .ctl-matrix th { font-size: 12px; }

/* الموبايل: الصف بطاقة من عمودين بدل التمرير الجانبي */
@media screen and (max-width: 640px) {
  table.has-cards, table.has-cards tbody { display: block; width: 100%; }
  table.has-cards thead { display: none; }
  table.has-cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.has-cards td { display: block; min-width: 0; padding: 0; border: 0; text-align: start; white-space: normal; }
  table.has-cards td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-bottom: 2px; }
  table.has-cards td[data-label=""]::before { display: none; }
  table.has-cards td:first-child, table.has-cards td[colspan], table.has-cards td.actions-cell, table.has-cards td.title-cell { grid-column: 1 / -1; }
  table.has-cards td:first-child::before { display: none; }
  table.has-cards td.actions-cell::before { display: none; }
  table.has-cards .title-cell, table.has-cards .task-cell, table.has-cards .client-cell { min-width: 0; }
  table.has-cards .nowrap { white-space: normal; }
  table.has-cards .reg-num, table.has-cards .ref { white-space: nowrap; }
}

/* اللمس: أهداف لا تقل عن 40 بكسل، وحقول لا تسبب تكبير الصفحة في iOS */
@media screen and (max-width: 820px) {
  .btn, .btn-sm, .chip, .filters select, .filters input { min-height: 40px; }
  .btn-sm, .chip { display: inline-flex; align-items: center; }
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { font-size: 16px; min-height: 40px; }
  .dots { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
}
.t-projects .title-cell { min-width: 220px; }
@media screen and (max-width: 820px) { .topbar button, .topbar .btn, .topbar a, .menu-btn { min-height: 40px; min-width: 40px; } }
