:root {
  --ink: #050505; --paper: #F2F2EE; --white: #FFFFFF; --brand: #FF5A1F; --brand-text: #B8400F; --brand-soft: #FFE7DC;
  --g1: #6E6E69; --g2: #55554F; --g3: #8A8A85; --g4: #B8B8B2; --line: #E2E2DC; --soft: #EDEDE8; --soft2: #F7F7F4;
  --good: #1E6B3F; --good-bg: #E6F2EA; --good-solid: #1E7A46;
  --warn: #8A4A00; --warn-bg: #FCEFD9; --warn-solid: #D97706;
  --bad: #A82416; --bad-bg: #FBE6E3; --bad-solid: #C42B1C;
  --head: 'Unbounded', 'Noto Kufi Arabic', sans-serif;
  --body: 'Geist', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── شعار ── */
.logo, .logo-lg { display: inline-flex; align-items: center; font-family: 'Unbounded', sans-serif; font-weight: 700; line-height: 1; }
.logo { font-size: 22px; color: var(--paper); }
.logo svg { width: 40px; height: 20px; margin: 0 1px; }
.logo-lg { font-size: 40px; }
.logo-lg svg { width: 72px; height: 36px; margin: 0 2px; }
.logo path, .logo-lg path { fill: none; stroke: var(--brand); stroke-width: 17; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* ── أزرار وحقول ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-brand { background: var(--brand); color: var(--ink); }
.btn-ghost { background: var(--white); color: var(--ink); border: 1px solid #D6D6D0; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; min-height: 54px; }
.btn[disabled] { background: var(--line); color: var(--g2); cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.field input, .field select { min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid #D6D6D0; background: var(--white); font-size: 15px; font-weight: 400; }
.field input[dir=ltr] { text-align: left; font-family: var(--mono); }
.field small { font-weight: 400; color: var(--g1); font-size: 12px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.err:empty { display: none; }

/* ── شاشة الدخول ── */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--ink); }
.auth-brand { flex: 1 1 420px; min-height: 280px; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; color: var(--paper); position: relative; overflow: hidden; }
.auth-brand .logo { font-size: 30px; }
.auth-brand .logo svg { width: 56px; height: 28px; }
.auth-brand h1 { margin: 0; font-family: var(--head); font-size: 32px; font-weight: 600; line-height: 1.4; max-width: 460px; }
.auth-brand p { margin: 0; color: var(--g4); line-height: 1.8; max-width: 460px; }
.auth-brand .tag { font-family: var(--mono); font-size: 12px; color: var(--g3); letter-spacing: .06em; }
.auth-form { flex: 1 1 420px; background: var(--paper); padding: 48px 32px; display: flex; align-items: center; justify-content: center; }
.auth-form form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.auth-form h2 { margin: 0; font-family: var(--head); font-size: 24px; font-weight: 600; }
.auth-form .lead { margin: 0; color: var(--g2); font-size: 14px; line-height: 1.7; }
.note { display: flex; gap: 10px; padding: 14px; border-radius: 16px; background: var(--white); font-size: 12px; color: var(--g2); line-height: 1.7; }

/* ── الهيكل ── */
.shell { min-height: 100vh; display: flex; }
.side { flex: 0 0 240px; background: var(--ink); color: var(--g4); padding: 26px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 0 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: #1A1A1A; }
.me b { color: var(--paper); font-size: 14px; display: block; }
.me span { font-size: 11px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; flex: none; background: var(--g2); }
.avatar.lg { width: 46px; height: 46px; font-size: 17px; }
.nav-sec { font-family: var(--mono); font-size: 11px; color: var(--g3); padding: 6px 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 999px; border: none; background: transparent; color: #D6D6D0; font-size: 14px; cursor: pointer; text-align: right; }
.nav button svg { width: 19px; height: 19px; flex: none; }
.nav button.on { background: var(--brand); color: var(--ink); font-weight: 600; }
.nav button .soon { margin-right: auto; font-size: 10px; padding: 1px 7px; border-radius: 999px; border: 1px solid #3A3A3A; color: var(--g3); }
.side .bottom { margin-top: auto; }
.main { flex: 1 1 auto; min-width: 0; padding: 32px 36px 56px; display: flex; flex-direction: column; gap: 22px; }
.eyebrow { font-family: var(--mono); font-size: 12px; color: var(--g1); }
.h1 { margin: 0; font-family: var(--head); font-size: 28px; font-weight: 600; line-height: 1.4; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head > div { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.empty { text-align: center; color: var(--g2); padding: 40px 20px; line-height: 1.8; }

/* ── الفريق ── */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.person { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.person.off { opacity: .55; }
.person.fresh { border: 2px solid var(--brand); }
.person .top { display: flex; align-items: center; gap: 12px; }
.person .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.person .who b { font-size: 16px; }
.person .who code { font-family: var(--mono); font-size: 12px; color: var(--g1); direction: ltr; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--paper); }
.chip.role-admin { background: var(--ink); color: #fff; }
.chip.role-manager { background: #DFF3F0; color: #0E6E63; }
.chip.role-editor { background: #ECE9FF; color: #4C3FD6; }
.chip.role-photo { background: var(--brand-soft); color: #C2410C; }
.chip.role-trainee { background: #FFF4E0; color: var(--warn); }
.chip.role-designer { background: #FBE6F7; color: #A3168D; }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.off { background: var(--bad-bg); color: var(--bad); }
.person .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--soft); font-size: 12px; color: var(--g2); }
.pill-new { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--brand); }

/* ── اللوحة الجانبية ── */
.drawer-wrap { position: fixed; inset: 0; z-index: 20; display: flex; }
.drawer-wrap .scrim { flex: 1; border: none; background: rgba(5,5,5,.4); cursor: pointer; }
.drawer { width: 540px; max-width: 100%; height: 100%; overflow-y: auto; background: var(--paper); padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.drawer .bar { display: flex; align-items: center; justify-content: space-between; }
.drawer h2 { margin: 0; font-family: var(--head); font-size: 20px; font-weight: 600; }
.x { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--white); cursor: pointer; font-size: 18px; }
.opt { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); cursor: pointer; }
.opt b { font-size: 13px; }
.opt small { font-size: 11px; color: var(--g1); }
.opt.on { border: 2px solid var(--ink); }
.opt.wide { align-items: flex-start; text-align: right; padding: 14px; }
.toggle { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #D6D6D0; background: var(--white); font-size: 13px; font-weight: 600; cursor: pointer; }
.toggle.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.preview { background: var(--ink); color: var(--paper); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 8px; line-height: 1.8; }
.preview small { color: var(--g4); font-size: 12px; }
.preview code { font-family: var(--mono); color: #FF8A5C; font-size: 12px; }
.label { font-size: 14px; font-weight: 600; }
.label small { font-weight: 400; color: var(--g1); }
.secret { display: flex; flex-direction: column; gap: 6px; background: var(--white); border: 1.5px dashed var(--brand); border-radius: 16px; padding: 14px; }
.secret code { font-family: var(--mono); font-size: 16px; direction: ltr; text-align: right; }

/* ── تنبيه ── */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
#toast.show { opacity: 1; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; flex: none; }
  .main { padding: 22px 16px 48px; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-brand { padding: 32px 24px; }
}
.field-in { min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1.5px solid #D6D6D0; background: var(--white); font-family: var(--mono); font-size: 14px; }
.card .eyebrow { margin: 6px 0 10px; }
.nav button .soon { white-space: nowrap; flex: none; }
.nav button { line-height: 1.3; }
.auth-brand .tag[dir=ltr] { text-align: right; }

/* ── المرحلة 2 ── */
.nav button .badge { margin-right: auto; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--brand); color: var(--ink); }
.nav button.on .badge { background: var(--ink); color: var(--paper); }
.btn-good { background: var(--good-solid); color: #fff; }
.mono { font-family: var(--mono); }
.label.mt { margin-top: 14px; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.bad, .chip.off { background: var(--bad-bg); color: var(--bad); }
.chip.grey { background: var(--soft); color: var(--g2); }
.linkbtn { border: none; background: none; color: var(--brand-text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 4px; }
.row-between { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.seg { display: flex; gap: 4px; background: var(--soft); border-radius: 999px; padding: 4px; }
.seg button { flex: 1; min-height: 38px; padding: 0 14px; border-radius: 999px; border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--g2); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg.small button { min-height: 32px; flex: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.day-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.day-main { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.day-side { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.status { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 20px; background: var(--soft2); border: 1px solid var(--line); }
.status b { font-family: var(--head); font-size: 22px; font-weight: 600; line-height: 1.4; }
.status span { font-size: 14px; opacity: .85; }
.status.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.status.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.status.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.status.dark { background: var(--ink); color: var(--paper); border-color: transparent; }
.status.grey { background: var(--soft); color: var(--g2); }
.lines { display: flex; flex-direction: column; gap: 6px; background: var(--soft2); border-radius: 14px; padding: 12px 14px; }
.lines div { display: flex; justify-content: space-between; font-size: 13px; }
.lines span { color: var(--g2); }
.lines b { font-family: var(--mono); }
.lines small { color: var(--warn); font-size: 12px; }
.acts { display: flex; flex-direction: column; gap: 10px; }
.week { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.wk { height: 56px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--soft2); color: var(--g3); font-family: var(--mono); font-size: 12px; }
.wk span { font-size: 11px; opacity: .8; font-family: var(--body); }
.wk.good { background: var(--good-bg); color: var(--good); }
.wk.warn { background: var(--warn-bg); color: var(--warn); }
.wk.bad { background: var(--bad-bg); color: var(--bad); }
.wk.grey { background: var(--soft); color: var(--g3); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--g2); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 5px; vertical-align: -1px; }
.legend .good::before { background: var(--good-solid); } .legend .warn::before { background: var(--warn-solid); } .legend .bad::before { background: var(--bad-solid); }
.bal { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.bal div { display: flex; justify-content: space-between; align-items: baseline; }
.bal span { font-size: 13px; color: var(--g2); }
.bal b { font-family: var(--head); font-size: 22px; font-weight: 600; }
.bal small { font-size: 12px; color: var(--g1); }
.req { display: flex; flex-direction: column; gap: 12px; }
.req .field input { min-height: 46px; }
.verdict { font-size: 13px; line-height: 1.6; border-radius: 12px; padding: 10px 12px; }
.verdict:empty { display: none; }
.verdict.good { background: var(--good-bg); color: var(--good); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.rq { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--soft); font-size: 13px; }

.rq-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px solid #FF8A5C; }
.rq-body { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rq-body b { font-size: 15px; }
.rq-body span { font-size: 13px; color: var(--g2); }
.acts-row { display: flex; flex-wrap: wrap; gap: 8px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 10px; }
.bd { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--soft2); }
.bd div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd b { font-size: 14px; } .bd small { font-size: 12px; color: var(--g2); }
.bd.good { background: var(--good-bg); } .bd.warn { background: var(--warn-bg); } .bd.bad { background: var(--bad-bg); }
.table { overflow-x: auto; }
.tr { display: grid; grid-template-columns: 1.4fr 1.2fr .6fr 1fr 1fr .9fr 1.1fr; gap: 10px; align-items: center; padding: 12px 6px; border-top: 1px solid var(--soft); font-size: 13px; min-width: 760px; }
.tr.th { border-top: none; color: var(--g1); font-size: 12px; font-weight: 600; background: var(--soft2); border-radius: 10px; }
.tr > span { display: flex; flex-direction: column; gap: 2px; }
.tr small { font-size: 11px; color: var(--g1); font-family: var(--body); }
.tr.flag { background: #FFF6F4; }
.dots { flex-direction: row !important; gap: 10px !important; }
.dots i { font-style: normal; font-family: var(--mono); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.dots i::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.dots .good { color: var(--good); } .dots .good::before { background: var(--good-solid); }
.dots .warn { color: var(--warn); } .dots .warn::before { background: var(--warn-solid); }
.dots .bad { color: var(--bad); } .dots .bad::before { background: var(--bad-solid); }
.good-t { color: var(--good); font-weight: 700; } .warn-t { color: var(--warn); font-weight: 700; } .bad-t { color: var(--bad); font-weight: 700; }
.cal { display: grid; grid-template-columns: 120px repeat(12, minmax(36px, 1fr)); gap: 4px; margin-top: 12px; overflow-x: auto; }
.cal-h { font-size: 11px; text-align: center; color: var(--g1); padding: 4px 0; border-radius: 6px; }
.cal-h.now { background: var(--ink); color: var(--paper); font-weight: 600; }
.cal-n { font-size: 13px; font-weight: 600; display: flex; align-items: center; }
.cal-c { height: 30px; border-radius: 8px; background: var(--soft2); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.cal-c.on { background: var(--good-solid); color: #fff; }
.cal-c.pend { background: var(--warn-bg); color: var(--warn); border: 1.5px dashed var(--warn-solid); }
.two { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.two > .card { flex: 1 1 380px; min-width: 0; }
.two .row { margin-top: 8px; align-items: center; }
.rules { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--soft2); font-size: 12px; color: var(--g2); line-height: 1.6; }
.rules b { color: var(--ink); font-size: 13px; }
.field code { font-family: var(--mono); }
/* شاشة الدخول: لا قطع للنص */
.auth { overflow-x: hidden; }
.auth-brand > div { max-width: 100%; }

/* ── المرحلة 3 ── */
.me { position: relative; }
.bell { margin-right: auto; width: 36px; height: 36px; border-radius: 50%; border: none; background: #262626; color: var(--paper); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; flex: none; }
.bell svg { width: 18px; height: 18px; }
.bell i { position: absolute; top: -4px; left: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--brand); color: var(--ink); font-style: normal; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.search { min-width: 260px; flex: 1 1 260px; max-width: 380px; min-height: 44px; font-family: var(--body); }
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.ccard { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--white); text-align: right; cursor: pointer; font: inherit; color: inherit; }
.ccard:hover { border-color: var(--g4); }
.ccard.dim { opacity: .6; }
.ctop { display: flex; align-items: center; gap: 12px; }
.ctop div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ctop b { font-size: 15px; } .ctop small { font-size: 12px; color: var(--g1); }
.cicon { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex: none; }
.cfoot { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--soft); font-size: 12px; color: var(--g2); }
.steps { display: flex; gap: 6px; } .steps i { flex: 1; height: 5px; border-radius: 999px; background: var(--line); } .steps i.on { background: var(--brand); }
.field textarea, select.field-in { padding: 10px 14px; border-radius: 14px; border: 1.5px solid #D6D6D0; background: var(--white); font: inherit; font-size: 14px; font-weight: 400; resize: vertical; }
select.field-in { min-height: 44px; }
.back { align-self: flex-start; font-size: 14px; padding: 0; }
.rgroup { display: flex; flex-direction: column; margin-top: 8px; } .rgroup small { font-size: 12px; color: var(--g1); font-weight: 600; }
.idea { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--soft); }
.idea .chip { align-self: flex-start; } .idea p { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; } .idea small { font-size: 11px; color: var(--g1); }
.note-txt { white-space: pre-wrap; font-size: 13px; color: var(--g2); line-height: 1.7; margin: 12px 0 0; }
.notif { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); cursor: default; }
.notif[data-client] { cursor: pointer; }
.notif.new { border-color: var(--brand); }
.notif p { margin: 0; font-size: 13px; color: var(--g2); white-space: pre-wrap; line-height: 1.6; } .notif small { font-size: 11px; color: var(--g1); }
.preview b { font-size: 15px; } .preview span { font-size: 13px; color: var(--g4); }
.row.mt { margin-top: 12px; align-items: center; }
