/* منصة المتابعة - RTL, responsive, no external assets (CSP: style-src 'self') */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #1b2230;
  --muted: #5b6577;
  --line: #e2e6ec;
  --brand: #0f5c4d;
  --brand-ink: #ffffff;
  --accent: #b8860b;
  --ok: #1e7b4f;
  --warn: #a35c00;
  --bad: #b3261e;
  --info: #1f5fa8;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #f2b300;
  outline-offset: 2px;
}

.pilot-banner {
  background: #fff4d6;
  color: #6b4b00;
  border-bottom: 1px solid #f0d58a;
  text-align: center;
  padding: 4px 12px;
  font-size: 13px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 10px 16px;
}
.topbar a { color: var(--brand-ink); }
.brand { font-weight: 700; font-size: 17px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 16px; flex: 1; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; }
.who .role { opacity: .85; }
.badge {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.container { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat { text-align: center; }
.stat .n { font-size: 30px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.bad .n { color: var(--bad); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--brand); }
details summary { cursor: pointer; }
code { font-size: 12px; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
th { background: #eef1f5; font-weight: 600; font-size: 13px; white-space: nowrap; }
tr.overdue td:first-child { border-right: 4px solid var(--bad); }

.chip {
  display: inline-block;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #f7f8fa;
  white-space: nowrap;
}
.chip.s-New { background: #eef4ff; border-color: #c9dafc; }
.chip.s-InProgress { background: #eaf6ef; border-color: #bfe3cd; }
.chip.s-AwaitingUpdate { background: #fff6e5; border-color: #f3d79b; }
.chip.s-ExtensionReview, .chip.s-ClosureReview { background: #f4eefc; border-color: #d8c6f3; }
.chip.s-Completed { background: #e7f5ec; border-color: #9fd3b3; color: var(--ok); }
.chip.s-Cancelled { background: #f3f3f3; color: #666; }
.chip.c-Secret, .chip.c-TopSecret { background: #fdecea; border-color: #f5c1bc; color: var(--bad); }
.flag { font-size: 12px; font-weight: 600; }
.flag.bad { color: var(--bad); }
.flag.warn { color: var(--warn); }

.progress { height: 8px; background: #e9edf2; border-radius: 4px; overflow: hidden; min-width: 80px; }
.progress span { display: block; height: 100%; background: var(--brand); }
.p0 { width: 0; } .p10 { width: 10%; } .p20 { width: 20%; } .p30 { width: 30%; } .p40 { width: 40%; }
.p50 { width: 50%; } .p60 { width: 60%; } .p70 { width: 70%; } .p80 { width: 80%; } .p90 { width: 90%; } .p100 { width: 100%; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: #e9f6ee; border-color: #a8d9bb; color: #14532d; }
.flash.err { background: #fdecea; border-color: #f2b8b5; color: #7a1a14; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

form.stack { display: grid; gap: 10px; }
form.inline { display: inline; }
label { font-weight: 600; font-size: 13px; display: block; margin-bottom: 4px; }
input[type=text], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c8cfd9;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.hint { color: var(--muted); font-size: 12px; }

button, .btn {
  display: inline-block;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 7px 16px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
button.secondary, .btn.secondary { background: #fff; color: var(--brand); }
button.danger { background: var(--bad); border-color: var(--bad); }
button.link { background: none; border: none; color: inherit; padding: 0; text-decoration: underline; }

.actions { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.actions .card h3 { color: var(--brand); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-right: 3px solid var(--line); padding: 4px 12px 12px; margin-right: 6px; }
.timeline .meta { color: var(--muted); font-size: 12px; }

.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }

.personas { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.persona { display: flex; flex-direction: column; gap: 6px; }
.persona button { margin-top: auto; }

.empty { color: var(--muted); padding: 16px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 640px) {
  .topbar { padding: 8px 12px; }
  .container { padding: 16px 12px 40px; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dt { margin-top: 6px; }
}
.mt { margin-top: 12px; }
