:root {
  --ink: #1a1530; --ink-2: #4b4766; --muted: #7c7896; --line: #ebe9f3; --line-2: #dcd8ee;
  --bg: #ffffff; --bg-soft: #f7f6fc; --bg-app: #fafafd;
  --brand: #7b68ee; --brand-d: #5b4bd6; --brand-soft: #efecff;
  --grad: linear-gradient(270deg, #7b68ee 0%, #c56cf0 45%, #fd71af 100%);
  --green: #22c38e; --amber: #ffb020; --red: #ff6b6b;
  --green-s: #e1f8ef; --amber-s: #fff4dc; --red-s: #ffe8e8;
  --shadow: 0 20px 50px -20px rgba(60, 40, 140, .28); --shadow-sm: 0 4px 14px -6px rgba(60, 40, 140, .18);
  --r: 14px; --sb-w: 252px;
  --f-body: "IBM Plex Sans Arabic", system-ui, sans-serif; --f-head: "Cairo", "IBM Plex Sans Arabic", sans-serif;
}
body[data-theme="ocean"] { --brand: #0e9fd3; --brand-d: #0a7fa9; --brand-soft: #e3f5fd; --grad: linear-gradient(270deg, #0e9fd3, #49ccf9 50%, #22c38e); }
body[data-theme="forest"] { --brand: #119b6c; --brand-d: #0d7a55; --brand-soft: #e1f8ef; --grad: linear-gradient(270deg, #119b6c, #22c38e 50%, #a3d65c); }
body[data-theme="sunset"] { --brand: #e2468e; --brand-d: #c12f72; --brand-soft: #ffe9f3; --grad: linear-gradient(270deg, #e2468e, #fd71af 50%, #ffb020); }
body[data-theme="midnight"] { --brand: #3d3566; --brand-d: #1a1530; --brand-soft: #ebe9f3; --grad: linear-gradient(270deg, #1a1530, #3d3566 50%, #7b68ee); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--f-body); color: var(--ink); background: var(--bg-app); line-height: 1.6; -webkit-font-smoothing: antialiased; font-size: 14.5px; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.35; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: 11px; background: #fff; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--ink-2); }
.ic { flex: none; }
.muted { color: var(--muted); }
.pad { padding: 16px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: plaintext; }

/* layout */
#app { display: flex; height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; overflow: auto; padding: 24px 28px 60px; }
.sb { width: var(--sb-w); flex: none; background: #fff; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; height: 100vh; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; }
.ws { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws small { color: var(--muted); font-size: 11.5px; }
.ws-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-family: var(--f-head); font-weight: 800; flex: none; }
.sb .sb-close, .top .burger { display: none; }
.sb-search { margin: 4px 12px 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; color: var(--muted); font-size: 13px; background: var(--bg-soft); }
.sb-search span { flex: 1; text-align: start; }
.sb-nav { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.sb-group { margin-top: 10px; }
.sb-gt { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 10px; }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.sb-item:hover { background: var(--bg-soft); color: var(--ink); }
.sb-item.on { background: var(--brand-soft); color: var(--brand-d); font-weight: 700; }
.sb-item span { flex: 1; }
.cnt { font-style: normal; font-size: 11px; font-weight: 700; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.sb-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.sb-me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px; border-radius: 10px; }
.sb-me:hover { background: var(--bg-soft); }
.sb-me b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-me small { color: var(--muted); font-size: 11.5px; }
.sb-scrim { display: none; }

.top { height: 60px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.top-title { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger { display: none; }
.period { display: flex; align-items: center; gap: 4px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px 8px; color: var(--ink-2); margin-inline-start: 8px; }
.period select { border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); padding: 3px 2px; cursor: pointer; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink-2); position: relative; flex: none; }
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }
.icon-btn.on { color: var(--brand); background: var(--brand-soft); }
.dot-badge { position: absolute; top: 3px; inset-inline-end: 3px; font-style: normal; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 9px; display: grid; place-items: center; border: 2px solid #fff; }
.me-btn { border-radius: 50%; }
.dd-wrap { position: relative; }

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; font-size: 13.5px; border-radius: 10px; padding: 8px 14px; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .1s; font-family: var(--f-head); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px var(--brand); }
.btn-primary:hover { background: var(--brand-d); }
.btn-ghost { background: #fff; border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--line-2); background: var(--bg-soft); }
.btn-ai, .btn-grad { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px rgba(197, 108, 240, .9); }
.btn-danger { background: var(--red-s); color: #c43c3c; }
.btn-ok { background: var(--green-s); color: #0f8a5f; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.link-btn { color: var(--brand); font-weight: 700; font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; }
.inp { width: 100%; font: inherit; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 11px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.inp.big { font-size: 16px; padding: 12px 14px; }
textarea.inp { resize: vertical; }
.fl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.fl .inp { margin-top: 5px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 6px 0; cursor: pointer; }
.chk input { accent-color: var(--brand); width: 16px; height: 16px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; align-items: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp { flex: 1; }
.toggle { position: relative; width: 40px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line-2); border-radius: 22px; transition: .2s; cursor: pointer; }
.toggle span::before { content: ""; position: absolute; width: 16px; height: 16px; top: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toggle input:checked + span { background: var(--brand); }
.toggle input:checked + span::before { transform: translateX(-18px); }
.range { width: 100%; accent-color: var(--brand); }

/* page pieces */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 2px; max-width: 720px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h small { color: var(--muted); font-weight: 500; font-size: 12.5px; font-family: var(--f-body); }
.card-in { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 14px; }
.card-in h4 { font-size: 14px; margin-bottom: 10px; }
.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-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack > * + * { margin-top: 16px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--brand); }
.note { background: var(--brand-soft); color: var(--brand-d); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; }
.note.warn { background: var(--amber-s); color: #92610a; }
.note.bad { background: var(--red-s); color: #b03636; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .ic { margin: 0 auto 10px; color: var(--line-2); }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: relative; overflow: hidden; }
.stat small { color: var(--muted); font-weight: 600; font-size: 12.5px; display: block; }
.stat b { font-family: var(--f-head); font-size: 28px; font-weight: 800; display: block; margin: 2px 0; }
.stat .spark { position: absolute; bottom: 12px; inset-inline-end: 14px; }
.stat .delta { font-size: 12px; font-weight: 700; }
.up { color: #0f8a5f; } .dn { color: #c43c3c; }

/* chips, rag, avatars */
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.rag-green { background: var(--green-s); color: #0f8a5f; }
.rag-amber { background: var(--amber-s); color: #a06a00; }
.rag-red { background: var(--red-s); color: #c43c3c; }
.rag-none { background: var(--bg-soft); color: var(--muted); }
.rag-bg-green { background: var(--green); } .rag-bg-amber { background: var(--amber); } .rag-bg-red { background: var(--red); } .rag-bg-none { background: var(--line-2); }
.sbar { height: 6px; border-radius: 9px; background: var(--bg-soft); overflow: hidden; min-width: 60px; }
.sbar i { display: block; height: 100%; border-radius: 9px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2); white-space: nowrap; }
.tag.brand { background: var(--brand-soft); color: var(--brand-d); }
.pdot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.av { width: var(--s); height: var(--s); border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: calc(var(--s) * .38); font-weight: 700; flex: none; font-family: var(--f-head); border: 2px solid #fff; }
.avs { display: inline-flex; }
.avs .av + .av { margin-inline-start: -8px; }
.who { display: inline-flex; align-items: center; gap: 8px; text-align: start; }
.who b { display: block; font-size: 13px; line-height: 1.3; }
.who small { color: var(--muted); font-size: 11.5px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fcfcff; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover td { background: #fbfaff; }
.tbl tr[data-kpi], .tbl tr.click, .task-row[data-kpi] { cursor: pointer; }
.tbl.mini th, .tbl.mini td { padding: 6px 7px; font-size: 12px; text-align: center; }
.tbl.mini td.cur { background: var(--brand-soft); font-weight: 700; }
.tbl-scroll { overflow-x: auto; }
.tbl .grp td { background: var(--bg-soft); font-weight: 700; font-family: var(--f-head); font-size: 13px; }
.tbl .num { font-variant-numeric: tabular-nums; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand-d); border-color: var(--brand); }
.seg { display: inline-flex; background: var(--bg-soft); border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg-b { padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg-b.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.seg-b.rag-red.on { background: var(--red); color: #fff; } .seg-b.rag-amber.on { background: var(--amber); color: #fff; } .seg-b.rag-green.on { background: var(--green); color: #fff; }
.seg-b.rag-red, .seg-b.rag-amber, .seg-b.rag-green { background: transparent; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }

/* charts */
.chart { width: 100%; display: block; direction: ltr; overflow: visible; }
.chart .grid, .radar .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax, .radar .ax { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.chart .tline { stroke: var(--ink-2); stroke-dasharray: 5 4; stroke-width: 1.5; }
.donut .dn-v { font-family: var(--f-head); font-weight: 800; font-size: 26px; fill: var(--ink); }
.donut .dn-l { font-size: 11px; fill: var(--muted); }
.spark { display: block; }

/* overlays */
.modal-wrap { position: fixed; inset: 0; background: rgba(26, 21, 48, .38); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fadein .15s; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s; }
.modal.wide { max-width: 920px; }
.modal.palette { max-width: 620px; align-self: start; margin-top: 8vh; }
.m-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.m-head h3 { font-size: 17px; }
.m-body { padding: 4px 18px 16px; overflow: auto; }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.drawer-wrap { position: fixed; inset: 0; background: rgba(26, 21, 48, .28); z-index: 90; animation: fadein .15s; }
.drawer { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(640px, 100%); background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slidein .2s; }
.drawer-wrap.out { opacity: 0; transition: opacity .18s; }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 6px; }
.dr-head h3 { font-size: 19px; }
.dr-actions { display: flex; gap: 2px; }
.drawer .tabs { padding: 0 16px; margin-bottom: 0; }
.dr-body { padding: 16px 20px 30px; overflow: auto; flex: 1; }
.kd-grid { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.kd-score { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.kd-meta { display: grid; grid-template-columns: 90px 1fr; gap: 7px 10px; font-size: 13.5px; }
.kd-meta dt { color: var(--muted); font-weight: 600; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 200; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow); font-size: 13.5px; animation: toastin .2s; max-width: calc(100% - 32px); }
.toast.out { opacity: 0; transition: opacity .3s; }
.popover { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; width: 320px; max-height: 70vh; overflow: auto; animation: pop .14s; }
.pop-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; text-align: start; }
.pop-i:hover { background: var(--bg-soft); }
.pop-i.on { background: var(--brand-soft); color: var(--brand-d); font-weight: 700; }
.pop-sep { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.pop-me { padding: 8px 10px; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; }
.pop-n { display: flex; gap: 10px; text-align: start; padding: 9px 10px; border-radius: 10px; width: 100%; font-size: 13px; }
.pop-n:hover { background: var(--bg-soft); }
.pop-n.unread { background: #faf9ff; }
.pop-n.unread .n-ic { box-shadow: 0 0 0 2px var(--brand); }
.pop-n small { display: block; color: var(--muted); font-size: 11.5px; }
.n-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; flex: none; }
.pal-list { margin-top: 10px; max-height: 50vh; overflow: auto; }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: start; }
.pal-item b { font-weight: 600; flex: 1; }
.pal-item small { color: var(--muted); font-size: 12px; }
.pal-item.on, .pal-item:hover { background: var(--brand-soft); }
.kbd-t td { padding: 8px; }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes slidein { from { transform: translateX(-40px); opacity: 0; } }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } }

/* thread / chat */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg-row { display: flex; gap: 10px; align-items: flex-start; }
.msg-row.mine { flex-direction: row-reverse; }
.bubble { background: var(--bg-soft); border-radius: 14px; padding: 9px 13px; max-width: 80%; }
.msg-row.mine .bubble { background: var(--brand-soft); }
.bubble b { font-size: 12.5px; }
.bubble p { font-size: 13.5px; }
.bubble small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.mention { color: var(--brand-d); font-weight: 700; }
.att { display: inline-flex; gap: 5px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 12px; margin-top: 5px; }
.composer { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.timeline { list-style: none; position: relative; }
.timeline li { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; top: 14px; bottom: 0; inset-inline-start: 5px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); flex: none; margin-top: 5px; box-shadow: 0 0 0 3px var(--brand-soft); }
.timeline small { display: block; color: var(--muted); font-size: 12px; }

/* tasks */
.task-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row.done .tr-main b { text-decoration: line-through; color: var(--muted); }
.tchk { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; cursor: pointer; flex: none; }
.tchk.on { background: var(--green); border-color: var(--green); color: #fff; }
.tr-main { flex: 1; min-width: 0; }
.tr-main b { font-weight: 600; display: block; }
.tr-main small { color: var(--muted); font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.prio { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.p-عاجلة { background: var(--red-s); color: #c43c3c; } .p-عالية { background: var(--amber-s); color: #a06a00; } .p-متوسطة { background: #e3f5fd; color: #0a7fa9; } .p-منخفضة { background: var(--bg-soft); color: var(--muted); }
.due { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.due.late { color: #c43c3c; font-weight: 700; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--bg-soft); border-radius: 14px; padding: 10px; min-height: 300px; }
.kcol.over { outline: 2px dashed var(--brand); background: var(--brand-soft); }
.kcol-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-family: var(--f-head); padding: 4px 6px 10px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 9px; cursor: grab; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.kcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.kcard.drag { opacity: .4; }
.kcard b { font-weight: 600; display: block; font-size: 13.5px; margin-bottom: 8px; }
.kcard .row { justify-content: space-between; }

/* AI panel */
.ai-panel { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(440px, 100%); background: #fff; border-inline-start: 1px solid var(--line); box-shadow: var(--shadow); z-index: 95; display: flex; flex-direction: column; transform: translateX(-105%); visibility: hidden; transition: transform .25s, visibility 0s .25s; }
.ai-panel.open { transform: none; visibility: visible; transition: transform .25s; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ai-head .ai-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; }
.ai-head b { flex: 1; font-family: var(--f-head); }
.ai-body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; }
.ai-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-end-end-radius: 5px; }
.ai-msg.bot { align-self: flex-start; background: var(--bg-soft); border-end-start-radius: 5px; }
.ai-msg.bot h5 { font-family: var(--f-head); font-size: 13px; margin: 8px 0 3px; color: var(--brand-d); }
.ai-msg.bot ul, .ai-msg.bot ol { padding-inline-start: 18px; margin: 4px 0; }
.ai-msg.bot li { margin: 2px 0; }
.ai-fb { display: flex; gap: 4px; margin-top: 6px; }
.ai-fb button { color: var(--muted); padding: 2px; border-radius: 6px; }
.ai-fb button.on, .ai-fb button:hover { color: var(--brand); }
.ai-typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: blink 1s infinite; }
.ai-typing span:nth-child(2) { animation-delay: .2s; } .ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.sugg { font-size: 12px; font-weight: 600; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 11px; background: #fff; color: var(--ink-2); text-align: start; }
.sugg:hover { border-color: var(--brand); color: var(--brand-d); }
.ai-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.ai-input textarea { flex: 1; resize: none; }
.ai-hist { padding: 6px 16px; border-bottom: 1px solid var(--line); background: #fcfcff; }

/* misc components */
.list-link { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 12px; }
.list-link:hover { background: var(--bg-soft); }
.list-link .ll-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.list-link b { display: block; font-weight: 600; }
.list-link small { color: var(--muted); font-size: 12px; }
.list-link .ll-n { margin-inline-start: auto; font-family: var(--f-head); font-weight: 800; font-size: 18px; }
.c1 { background: var(--brand-soft); color: var(--brand-d); } .c2 { background: #ffe9f3; color: #e2468e; } .c3 { background: #e3f7fe; color: #0e9fd3; } .c4 { background: var(--amber-s); color: #a06a00; } .c5 { background: var(--green-s); color: #0f8a5f; } .c6 { background: var(--red-s); color: #c43c3c; }
.ok-tick { color: var(--green); }
.hero-card { background: var(--grad); color: #fff; border-radius: 18px; padding: 22px; position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .1); top: -90px; left: -60px; }
.hero-card h2 { font-size: 22px; }
.hero-card p { opacity: .9; }
.hero-card .btn { background: #fff; color: var(--ink); }
.progress-steps { display: flex; gap: 6px; margin-top: 12px; }
.progress-steps i { flex: 1; height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .3); }
.progress-steps i.on { background: #fff; }

/* perspective blocks / strategy */
.persp-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; margin-bottom: 12px; align-items: stretch; }
.persp-lbl { border-radius: 12px; color: #fff; font-family: var(--f-head); font-weight: 800; display: flex; flex-direction: column; justify-content: center; padding: 12px 14px; }
.persp-lbl small { font-family: var(--f-body); font-weight: 600; opacity: .9; }
.obj-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.obj-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; flex: 1 1 220px; max-width: 360px; cursor: pointer; position: relative; transition: box-shadow .15s, border-color .15s; }
.obj-card:hover { box-shadow: var(--shadow-sm); border-color: var(--line-2); }
.obj-card.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.obj-card b { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.obj-card .row { justify-content: space-between; }
.smap-wrap { position: relative; }
.smap-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.smap-svg path { fill: none; stroke: var(--brand); stroke-width: 1.8; opacity: .55; }
.smap-svg path.hl { opacity: 1; stroke-width: 2.6; }
.vmv { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vmv .card p { color: var(--ink-2); margin-top: 6px; }
.values { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.values span { background: var(--brand-soft); color: var(--brand-d); font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 999px; }

/* org tree */
.org { overflow: auto; padding: 10px 0 24px; direction: ltr; }
.org ul { display: flex; justify-content: center; padding-top: 22px; position: relative; list-style: none; margin: 0 auto; width: max-content; min-width: 100%; }
.org ul ul { min-width: 0; }
.org > ul { padding-top: 0; }
.org li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 22px 8px 0; }
.org li::before, .org li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--line-2); }
.org li::after { right: auto; left: 50%; border-left: 2px solid var(--line-2); }
.org li:only-child::before { display: none; }
.org li:only-child::after { border-top: 0; }
.org li:first-child::before, .org li:last-child::after { border-top: 0; }
.org li:last-child::before { border-right: 2px solid var(--line-2); border-radius: 0 8px 0 0; }
.org li:first-child::after { border-radius: 8px 0 0 0; }
.org li:only-child::after { border-radius: 0; }
.org > ul > li { padding-top: 0; }
.org > ul > li::before, .org > ul > li::after { display: none; }
.org ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--line-2); }
.onode { direction: rtl; }
.onode { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; width: 190px; text-align: center; box-shadow: var(--shadow-sm); cursor: pointer; position: relative; }
.onode:hover { border-color: var(--brand); }
.onode .lvl { position: absolute; top: -10px; inset-inline-start: 10px; font-size: 10.5px; font-weight: 700; background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 8px; }
.onode b { display: block; font-family: var(--f-head); font-size: 14px; }
.onode .row { justify-content: center; margin-top: 6px; }
.onode .add { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: none; place-items: center; }
.onode:hover .add { display: grid; }
.onode.collapsed { border-style: dashed; }

/* 9-box */
.ninebox { display: grid; grid-template-columns: 30px repeat(3, 1fr); grid-template-rows: repeat(3, minmax(120px, auto)) 30px; gap: 8px; }
.nb-cell { border-radius: 12px; padding: 10px; position: relative; }
.nb-cell h5 { font-family: var(--f-head); font-size: 12.5px; margin-bottom: 6px; }
.nb-cell .avs { flex-wrap: wrap; gap: 4px; }
.nb-cell .avs .av + .av { margin: 0; }
.nb-y { writing-mode: vertical-rl; transform: rotate(180deg); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.nb-x { grid-column: 2 / 5; display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 10px; }

/* gantt */
.gantt { overflow-x: auto; }
.g-row { display: grid; grid-template-columns: 240px 1fr; align-items: center; min-height: 40px; border-bottom: 1px solid var(--line); }
.g-row.ms { min-height: 32px; font-size: 12.5px; }
.g-row.ms .g-name { padding-inline-start: 26px; color: var(--ink-2); }
.g-name { padding: 6px 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.g-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; height: 100%; min-height: 32px; min-width: 600px; direction: ltr; }
.g-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 16px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.g-bar i { display: block; height: 100%; }
.g-row.ms .g-bar { height: 10px; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 2; }
.g-head { display: grid; grid-template-columns: 240px 1fr; font-size: 11.5px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.g-months { display: flex; direction: ltr; min-width: 600px; }
.g-months span { flex: 1; text-align: center; padding: 6px 0; border-inline-start: 1px dashed var(--line); }

/* check-in */
.checkin { max-width: 560px; margin: 0 auto; }
.ci-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.ci-card h4 { font-size: 15px; margin-bottom: 2px; }
.ci-card .muted { font-size: 12.5px; }
.num-in { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.num-in .inp { max-width: 200px; font-size: 18px; font-weight: 700; }
.okr-in { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.okr-in output { font-family: var(--f-head); font-weight: 800; font-size: 18px; min-width: 52px; }
.ci-card .seg { margin: 10px 0; }
.ci-done { text-align: center; padding: 30px; }

/* exec report */
.exec-sec { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 14px; }
.exec-sec h3 { font-size: 14px; letter-spacing: 0; color: var(--brand-d); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.exec-sec ul, .exec-sec ol { padding-inline-start: 20px; }
.exec-sec li { margin-bottom: 8px; color: var(--ink-2); }
.exec-sec li b { color: var(--ink); }
.grade { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-family: "Plus Jakarta Sans", sans-serif; font-size: 32px; font-weight: 800; color: #fff; flex: none; }

/* coverage matrix / heat */
.heat td { text-align: center; font-weight: 700; font-size: 12.5px; }
.heat .h0 { background: var(--red-s); color: #c43c3c; } .heat .h1 { background: var(--amber-s); color: #a06a00; } .heat .h2 { background: var(--green-s); color: #0f8a5f; }

/* appraisal */
.comp { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.comp-h { display: flex; justify-content: space-between; gap: 10px; align-items: center; cursor: pointer; }
.comp-h b { font-weight: 700; }
.comp .desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: none; }
.comp.open .desc { display: block; }
.scale { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.scale button { border: 1.5px solid var(--line); border-radius: 9px; padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: #fff; }
.scale button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.scale button.self { box-shadow: inset 0 -3px 0 var(--amber); }
.calc-box { background: var(--bg-soft); border-radius: 12px; padding: 14px; }
.calc-box .big { font-family: var(--f-head); font-size: 34px; font-weight: 800; }

/* settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row b { display: block; font-weight: 600; }
.set-row small { color: var(--muted); font-size: 12.5px; }
.set-row .inp { width: auto; min-width: 90px; }
.themes { display: flex; gap: 8px; }
.themes button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line-2); }
.themes button.on { box-shadow: 0 0 0 2.5px var(--ink); }
.code-block { direction: ltr; text-align: left; background: #1a1530; color: #e8e5ff; border-radius: 12px; padding: 14px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.import-area { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; direction: ltr; text-align: left; }
.drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted); }

/* responsive */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .g3, .g-21, .g-12 { grid-template-columns: minmax(0, 1fr); }
  .period select:first-of-type { max-width: 86px; }
}
@media (max-width: 860px) {
  .sb { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 80; transform: translateX(105%); visibility: hidden; transition: transform .22s, visibility 0s .22s; box-shadow: var(--shadow); }
  #app.sb-open .sb { transform: none; visibility: visible; transition: transform .22s; }
  #app.sb-open .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(26, 21, 48, .3); z-index: 70; }
  .sb .sb-close, .top .burger { display: inline-grid; }
  .view { padding: 16px 16px 60px; }
  .top { padding: 0 10px; gap: 6px; }
  .top-title { font-size: 15px; }
  .top-actions [data-act=voice], .top-actions [data-act=shortcuts] { display: none; }
  .btn-ai { padding: 8px 10px; font-size: 0; gap: 0; }
  .btn-ai .ic { width: 18px; height: 18px; }
  .g2, .vmv, .f2, .f3 { grid-template-columns: minmax(0, 1fr); }
  .persp-row { grid-template-columns: 1fr; }
  .kd-grid { grid-template-columns: 1fr; }
  .g-row, .g-head { grid-template-columns: 150px 1fr; }
}
@media (max-width: 600px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period { margin-inline-start: auto; padding: 2px 4px; }
  .period .ic, .period .link-btn { display: none; }
  .top-title { display: none; }
  .page-head h2 { font-size: 20px; }
  .stat b { font-size: 22px; }
  .tbl.resp thead { display: none; }
  .tbl.resp tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tbl.resp td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 6px; }
  .tbl.resp td::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 600; }
  .tbl.resp .grp td::before { content: none; }
  .ninebox { grid-template-columns: 22px repeat(3, 1fr); grid-template-rows: repeat(3, minmax(90px, auto)) 26px; gap: 4px; }
  .nb-cell { padding: 6px; }
  .nb-cell h5 { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* language switch */
.lang-btn { font-weight: 700; font-size: 13px; color: var(--ink-2); border: 1.5px solid var(--line); border-radius: 10px; height: 34px; min-width: 38px; padding: 0 9px; display: inline-grid; place-items: center; font-family: "Plus Jakarta Sans", "IBM Plex Sans Arabic", sans-serif; }
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.lang-btn[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 15px; }

/* English (LTR) build: app/en/ */
html[lang="en"] {
  --f-body: "Inter", system-ui, sans-serif; --f-head: "Plus Jakarta Sans", "Inter", sans-serif;
  --grad: linear-gradient(90deg, #7b68ee 0%, #c56cf0 45%, #fd71af 100%);
}
html[lang="en"] body { line-height: 1.55; font-size: 14px; }
html[lang="en"] body[data-theme="ocean"] { --grad: linear-gradient(90deg, #0e9fd3, #49ccf9 50%, #22c38e); }
html[lang="en"] body[data-theme="forest"] { --grad: linear-gradient(90deg, #119b6c, #22c38e 50%, #a3d65c); }
html[lang="en"] body[data-theme="sunset"] { --grad: linear-gradient(90deg, #e2468e, #fd71af 50%, #ffb020); }
html[lang="en"] body[data-theme="midnight"] { --grad: linear-gradient(90deg, #1a1530, #3d3566 50%, #7b68ee); }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 { letter-spacing: -.01em; }
[dir="ltr"] .toggle input:checked + span::before { transform: translateX(18px); }
[dir="ltr"] .ai-panel { transform: translateX(105%); }
[dir="ltr"] .ai-panel.open { transform: none; }
[dir="ltr"] .drawer { animation-name: slidein-ltr; }
[dir="ltr"] .onode { direction: ltr; }
@keyframes slidein-ltr { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 860px) {
  [dir="ltr"] .sb { transform: translateX(-105%); }
  [dir="ltr"] #app.sb-open .sb { transform: none; }
}
.p-Urgent { background: var(--red-s); color: #c43c3c; } .p-High { background: var(--amber-s); color: #a06a00; } .p-Medium { background: #e3f5fd; color: #0a7fa9; } .p-Low { background: var(--bg-soft); color: var(--muted); }
@media (max-width: 1000px) { html[lang="en"] .period select:first-of-type { max-width: 112px; } }

/* ---------- sign-in (server mode, js/sync.js) ---------- */
#app[hidden] { display: none; }
.auth-wrap { position: fixed; inset: 0; z-index: 60; overflow: auto; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 85% -10%, #efe9ff 0%, transparent 60%), radial-gradient(700px 400px at 0% 110%, #ffe7f3 0%, transparent 55%), var(--bg-app); }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand .ws-logo { width: 38px; height: 38px; font-size: 18px; }
.auth-brand b { font-family: var(--f-head); font-size: 20px; display: block; }
.auth-brand small { color: var(--muted); font-size: 12.5px; }
.auth-card h1 { font-family: var(--f-head); font-size: 22px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); font-size: 14px; margin-bottom: 20px; line-height: 1.7; }
.auth-card .btn { width: 100%; padding: 11px 14px; margin-top: 6px; }
.auth-err { background: var(--red-s); color: #c03a3a; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.auth-err[hidden] { display: none; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; }
.auth-loading { display: grid; justify-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.auth-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: auth-spin .8s linear infinite; display: inline-block; }
.auth-spin.sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
.inp.err { border-color: var(--red); }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .auth-card { padding: 24px 20px; } }