@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(/fonts/IBMPlexSansArabic-400-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url(/fonts/IBMPlexSansArabic-600-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --navy: #1f3a5f; --navy-2: #2c4f7c; --ink: #1d2433; --muted: #667085; --line: #e3e0d6;
  --bg: #f7f4ec; --card: #fff; --soft: #f1ede2;
  --green: #2f7d4f; --green-bg: #e3f3e8; --red: #b42318; --red-bg: #fde8e6;
  --amber: #a15c07; --amber-bg: #fef3d8; --gray-bg: #eef0f3; --blue: #1d5fb8; --blue-bg: #e4eefb;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: system-ui, -apple-system, "Segoe UI", "Plex Arabic", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; font-size: 15px; line-height: 1.5; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }

/* ---------- top bar ---------- */
.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; position: sticky; top: 0; z-index: 20; min-height: 52px; }
.top a, .top button.link { color: #fff; }
.top .brand { font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.top .grow { flex: 1; min-width: 0; }
.top .who { font-size: .85rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.top nav a { padding: .35rem .7rem; border-radius: 8px; text-decoration: none; white-space: nowrap; opacity: .85; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.14); opacity: 1; }

/* ---------- basics ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.card + .card { margin-top: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.grid { display: grid; gap: 1rem; }
.grid.kpi { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: .5rem .9rem; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 40px; touch-action: manipulation; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 32px; padding: .25rem .6rem; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; text-decoration: underline; }

input[type=text], input[type=password], input[type=search], input:not([type]), select, textarea {
  border: 1px solid #cfd4dc; border-radius: 10px; padding: .55rem .7rem; background: #fff; width: 100%; min-height: 42px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(29,95,184,.25); border-color: var(--blue); }
label.field { display: block; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }

.chip { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; font-weight: 600; background: var(--gray-bg); color: #475467; white-space: nowrap; }
.chip.passed, .chip.resolved { background: var(--green-bg); color: var(--green); }
.chip.needs_changes, .chip.blocker, .chip.high { background: var(--red-bg); color: var(--red); }
.chip.in_progress, .chip.open { background: var(--amber-bg); color: var(--amber); }
.chip.not_started, .chip.unassigned, .chip.wontfix, .chip.low { background: var(--gray-bg); color: #475467; }
.chip.blue { background: var(--blue-bg); color: var(--blue); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: .45rem .8rem; cursor: pointer; min-height: 40px; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--navy); color: #fff; }

table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: start; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; border-bottom: 1px solid var(--line); padding: .5rem; white-space: nowrap; }
table.t td { border-bottom: 1px solid #f0ede5; padding: .55rem .5rem; vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #faf8f2; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.bar { height: 8px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; display: flex; min-width: 80px; }
.bar > i { display: block; height: 100%; }
.bar .p { background: var(--green); } .bar .n { background: var(--red); } .bar .i { background: #f0b44c; }
.kpi .v { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: .82rem; }

.toast { position: fixed; inset-inline: 0; bottom: 1rem; margin: auto; width: max-content; max-width: 90vw; background: #1d2433; color: #fff; padding: .6rem 1rem; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

dialog { border: 0; border-radius: 16px; padding: 0; width: min(760px, 96vw); max-height: 92dvh; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(16,24,40,.45); }
dialog .dh { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
dialog .db { padding: 1rem; }
dialog .df { padding: .8rem 1rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
pre.box.rtl { font-family: inherit; }
pre.box { background: #f6f7f9; border: 1px solid var(--line); border-radius: 10px; padding: .75rem; white-space: pre-wrap; word-break: break-word; font-size: .85rem; margin: 0; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, var(--navy) 0 38%, var(--bg) 38%); }
.login .card { width: min(420px, 100%); padding: 1.5rem; }
.login .err { color: var(--red); min-height: 1.4em; }
