@font-face { font-family: "Readex Pro"; src: url("/fonts/readex-pro-arabic-wght-normal.woff2") format("woff2");
  font-weight: 160 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Readex Pro"; src: url("/fonts/readex-pro-latin-wght-normal.woff2") format("woff2");
  font-weight: 160 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800; font-display: swap; }

:root {
  --ink: #0B0D0C; --panel: #131715; --raise: #1A1F1C; --line: #262D29; --line-2: #343D38;
  --bone: #ECE8DF; --mute: #8D968F; --dim: #5E6761;
  --hot: #FF5A36; --hot-ink: #1B0A05; --ok: #3DDC97; --warn: #F2B84B; --sky: #7AA2FF;
  --r: 14px; --r-s: 9px;
  --sans: "Readex Pro", system-ui, "Segoe UI", Tahoma, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--bone); font-family: var(--sans); font-weight: 340;
  font-size: 15px; line-height: 1.6; min-height: 100dvh; overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 560; line-height: 1.25; letter-spacing: -0.01em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-family: var(--mono); font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }
.eyebrow { font-family: "JetBrains Mono", "Readex Pro", ui-monospace, monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }

[lang="ar"] .eyebrow { letter-spacing: 0; font-size: 12px; }

/* ——— العلامة ——— */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--mono);
  font-weight: 700; letter-spacing: .22em; font-size: 14px; direction: ltr; }
.brand svg { width: 26px; height: 26px; flex: none; }

/* ——— أزرار وحقول ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 999px; background: transparent; text-decoration: none;
  font-weight: 460; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--bone); }
.btn:active { transform: scale(.97); }
.btn.hot { background: var(--hot); border-color: var(--hot); color: var(--hot-ink); font-weight: 600; }
.btn.hot:hover { background: #ff6f4f; }
.btn.ghost { border-color: transparent; color: var(--mute); }
.btn.ghost:hover { color: var(--bone); background: var(--raise); }
.btn.danger { color: var(--hot); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--mute); }
.field input, .field select, .field textarea, .quick input {
  width: 100%; min-height: 44px; padding: 10px 13px; background: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r-s); font-size: 16px; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus, .quick input:focus { outline: none; border-color: var(--hot); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ——— هيكل التطبيق ——— */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; padding: 22px 14px; border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; background: var(--ink); z-index: 5; }
.side .brand { padding: 4px 10px 18px; }
.nav-a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); color: var(--mute);
  text-decoration: none; border: 0; background: none; width: 100%; text-align: start; font-size: 14.5px; }
.nav-a svg { width: 19px; height: 19px; flex: none; }
.nav-a:hover { color: var(--bone); background: var(--panel); }
.nav-a.on { color: var(--bone); background: var(--raise); }
.nav-a.on svg { color: var(--hot); }
.nav-a .count { margin-inline-start: auto; background: var(--hot); color: var(--hot-ink); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 1px 7px; }
.side .grow { flex: 1; }
.main { padding: 26px clamp(16px, 3.4vw, 40px) 60px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { font-size: clamp(24px, 3vw, 32px); }
.head .sub { color: var(--mute); font-size: 14px; margin-top: 4px; }
.tabbar { display: none; }

/* ——— المدار ——— */
.orbit { position: relative; height: clamp(300px, 46vh, 520px); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; background: radial-gradient(120% 90% at 50% 110%, #1a120e 0%, var(--ink) 62%); }
.orbit canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.orbit .tag { position: absolute; top: 14px; inset-inline-start: 16px; pointer-events: none; }
.orbit .tip { position: absolute; pointer-events: none; padding: 6px 11px; border-radius: 8px; background: rgba(11,13,12,.9);
  border: 1px solid var(--line-2); font-size: 13px; transform: translate(-50%, -150%); white-space: nowrap; }
.orbit .legend { position: absolute; bottom: 12px; inset-inline: 16px; display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--mute); pointer-events: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; vertical-align: 1px; }

/* ——— بطاقات وأرقام ——— */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 26px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  text-align: start; display: block; width: 100%; }
.stat b { display: block; font-family: var(--mono); font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--mute); }
.stat.alert b { color: var(--hot); }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.sec-h h2 { font-size: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.empty { padding: 22px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--mute); font-size: 14px; }
.note { padding: 12px 14px; border-radius: var(--r-s); background: #1d1a12; border: 1px solid #3a3320; color: #e7d6a6;
  font-size: 13.5px; margin-bottom: 16px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  border: 1px solid var(--line-2); color: var(--mute); white-space: nowrap; }
.badge.pub { color: var(--ok); border-color: #1f5a41; }
.badge.hot { color: var(--hot); border-color: #6b2a1a; }

/* ——— المهام ——— */
.quick { display: flex; gap: 8px; margin-bottom: 14px; }
.quick input { flex: 1; background: var(--panel); border-radius: 999px; padding-inline: 18px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.chip { flex: none; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: none;
  font-size: 13px; color: var(--mute); }
.chip.on { background: var(--bone); color: var(--ink); border-color: var(--bone); font-weight: 500; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.lane > header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px;
  border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.lane > header h2 { font-size: 13.5px; font-weight: 500; color: var(--mute); }
.tasks { display: grid; gap: 6px; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--panel); }
.task:hover { border-color: var(--line-2); }
.task .tick { width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--dim); background: none;
  padding: 0; display: grid; place-items: center; color: transparent; }
.task .tick:hover { border-color: var(--ok); color: var(--ok); }
.task.p1 .tick { border-color: var(--hot); }
.task.done .tick { background: var(--ok); border-color: var(--ok); color: var(--ink); }
.task.done .t-title { color: var(--dim); text-decoration: line-through; }
.task .body { border: 0; background: none; padding: 0; text-align: start; min-width: 0; }
.t-title { display: block; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.t-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: var(--mute); }
.t-meta .late { color: var(--hot); }

/* ——— المشاريع والوكلاء ——— */
.proj h3, .agent h3 { font-size: 16px; }
.proj p, .agent p { color: var(--mute); font-size: 13.5px; margin-top: 4px; }
.bar { height: 5px; border-radius: 3px; background: var(--line); margin: 14px 0 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--hot); border-radius: 3px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.agent .pulse { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 0 currentColor; animation: pulse 2.4s infinite; }
.agent.off .pulse { animation: none; opacity: .3; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.agent .last { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--ink); font-size: 13px; color: var(--bone); }
.agent .actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

/* ——— الموافقات والسجل ——— */
.prop { display: grid; gap: 8px; }
.prop .what { font-size: 15px; }
.prop .why { color: var(--mute); font-size: 13px; }
.feed { display: grid; gap: 0; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed time { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; padding-top: 3px; direction: ltr; }
.feed .who { color: var(--mute); }
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--panel); }
.item .t { min-width: 0; }
.item .t b { display: block; font-weight: 480; overflow-wrap: anywhere; }
.item .t small { color: var(--mute); font-size: 12.5px; overflow-wrap: anywhere; }
code.secret { display: block; padding: 10px 12px; background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-s);
  font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; direction: ltr; text-align: left; user-select: all; }

/* ——— النافذة السفلية ——— */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: grid; place-items: center; padding: 16px;
  animation: fade .15s; }
.sheet { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; display: grid; gap: 14px; animation: rise .2s; }
.sheet h2 { font-size: 19px; }
.sheet .foot { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 4px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.toast { position: fixed; bottom: calc(86px + var(--safe-b)); inset-inline: 0; margin-inline: auto; width: fit-content; max-width: 90vw;
  z-index: 60; padding: 10px 18px; border-radius: 999px; background: var(--bone); color: var(--ink); font-size: 14px; font-weight: 500;
  animation: rise .2s; }
.toast.bad { background: var(--hot); color: var(--hot-ink); }

/* ——— الدخول ——— */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate form { width: min(400px, 100%); display: grid; gap: 16px; }
.gate h1 { font-size: 26px; }
.gate p { color: var(--mute); font-size: 14px; }

/* ——— الجوال ——— */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 18px 16px calc(96px + var(--safe-b)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 30;
    background: rgba(11,13,12,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + var(--safe-b)); }
  .tabbar .nav-a { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 10.5px; justify-content: center; text-align: center;
    position: relative; }
  .tabbar .nav-a.on { background: none; }
  .tabbar .nav-a .count { position: absolute; top: 2px; inset-inline-start: 54%; margin: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .board { grid-template-columns: minmax(0, 1fr); }
  .board { gap: 22px; }
  .scrim { place-items: end center; padding: 0; }
  .sheet { border-radius: 20px 20px 0 0; max-height: 92dvh; padding-bottom: calc(22px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
