:root {
  --bg: #f5f3ef; --panel: #ffffff; --ink: #1d212a; --ink2: #3b3f48; --mute: #7d7b77; --line: #e9e4db; --line2: #f1ede6; --soft: #f7f4ee;
  --acc: #e8833a; --acc-d: #c96a24; --acc-l: #fdf0e4; --ok: #2f9e6b; --ok-l: #e3f4ec; --warn: #d9962a; --warn-l: #fdf3dd; --bad: #d4553f; --bad-l: #fbe6e2; --blue: #3a76d1; --blue-l: #e6efff; --violet: #7a4fb0;
  --r: 14px; --r-s: 10px; --sh: 0 1px 2px rgba(30, 25, 15, .05), 0 6px 24px rgba(30, 25, 15, .07); --sh-l: 0 18px 60px rgba(30, 25, 15, .18);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; --side: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--acc-d); text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--acc-l); }
.num { font-variant-numeric: tabular-nums; }

/* ───── تحميل */
#boot { position: fixed; inset: 0; z-index: 999; display: grid; place-content: center; text-align: center; background: var(--bg); transition: opacity .5s; gap: 12px; }
#boot.out { opacity: 0; pointer-events: none; }
.mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(140deg, #f3a866, var(--acc) 55%, var(--acc-d)); color: #fff; display: grid; place-items: center; font-size: 19px; box-shadow: 0 8px 22px rgba(232, 131, 58, .35); flex: none; }
.mark.xl { width: 64px; height: 64px; font-size: 30px; border-radius: 18px; margin: auto; }

/* ───── هيكل التطبيق */
.app { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; }
.side { background: #fff; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 20; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.side .brand b { display: block; font-size: 15px; letter-spacing: -.2px; }
.side .brand small { display: block; color: var(--mute); font-size: 11.5px; line-height: 1.3; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orgsw { margin: 0 12px 8px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); cursor: pointer; }
.orgsw .av { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.orgsw b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orgsw small { font-size: 11px; color: var(--mute); }
nav.menu { flex: 1; overflow-y: auto; padding: 4px 10px; }
.menu .grp { font-size: 11px; color: var(--mute); padding: 12px 10px 4px; font-weight: 600; letter-spacing: .2px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink2); font-size: 13.5px; position: relative; }
.menu a:hover { background: var(--soft); }
.menu a.on { background: var(--ink); color: #fff; }
.menu a .ic { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.menu a em { margin-inline-start: auto; font-style: normal; font-size: 11px; background: var(--bad); color: #fff; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.menu a.on em { background: var(--acc); }
.side .foot { padding: 10px 12px 14px; border-top: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; }
.userbox { display: flex; align-items: center; gap: 9px; }
.userbox .av { width: 32px; height: 32px; border-radius: 50%; background: var(--acc-l); color: var(--acc-d); display: grid; place-items: center; font-weight: 700; }
.userbox b { font-size: 13px; display: block; } .userbox small { font-size: 11px; color: var(--mute); }
.trialbar { font-size: 12px; background: var(--acc-l); color: var(--acc-d); border-radius: 10px; padding: 8px 10px; }
.main { min-width: 0; min-height: 0; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.page { flex: 1; overflow-y: auto; padding: 22px 26px 40px; }
.ph { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ph h1 { font-size: 22px; margin: 0; letter-spacing: -.3px; }
.ph .sub { color: var(--mute); font-size: 13px; }
.ph .acts { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.mobbar { display: none; }

/* ───── عناصر */
.btn { border: 0; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.98); }
.btn.acc { background: var(--acc); } .btn.acc:hover { background: var(--acc-d); }
.btn.ok { background: var(--ok); } .btn.bad { background: var(--bad); } .btn.ghost { background: var(--soft); color: var(--ink); border: 1px solid var(--line); } .btn.ghost:hover { background: #fff; }
.btn.link { background: none; color: var(--acc-d); padding: 4px 6px; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; } .btn.lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card > header { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line2); }
.card > header h3 { margin: 0; font-size: 14.5px; }
.card > header .acts { margin-inline-start: auto; display: flex; gap: 6px; }
.card .cb { padding: 14px 16px; }
.grid { display: grid; gap: 14px; }
.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)); }
.kpi { padding: 14px 16px; }
.kpi small { color: var(--mute); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi b { font-size: 24px; display: block; letter-spacing: -.5px; margin-top: 2px; }
.kpi .d { font-size: 12px; color: var(--mute); }
.kpi .d.up { color: var(--ok); } .kpi .d.dn { color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 9px; border-radius: 99px; background: var(--line2); color: var(--ink2); white-space: nowrap; font-weight: 500; }
.chip.ok { background: var(--ok-l); color: #1d6b48; } .chip.warn { background: var(--warn-l); color: #8a5e10; } .chip.bad { background: var(--bad-l); color: #9c3524; } .chip.blue { background: var(--blue-l); color: #24539c; } .chip.acc { background: var(--acc-l); color: var(--acc-d); } .chip.dark { background: var(--ink); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #a0a4aa; flex: none; }
.dot.working { background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 158, 107, .2); animation: pulse 1.3s infinite; } .dot.waiting { background: var(--warn); } .dot.meeting { background: var(--blue); } .dot.paused { background: #555; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(47, 158, 107, 0); } }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: var(--mute); font-weight: 500; }
.in, .field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; outline: 0; width: 100%; transition: border .15s, box-shadow .15s; }
.in:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-l); }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.field .hint { font-size: 11.5px; color: var(--mute); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.f1 { flex: 1; min-width: 0; }
.mute { color: var(--mute); } .small { font-size: 12px; }
.empty { text-align: center; color: var(--mute); padding: 40px 16px; }
.empty .big { font-size: 34px; margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.toggle { appearance: none; width: 38px; height: 22px; background: #d7d1c6; border-radius: 99px; position: relative; cursor: pointer; flex: none; transition: .2s; margin: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.toggle:checked { background: var(--ok); } .toggle:checked::after { inset-inline-start: 19px; }
kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; background: var(--soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; direction: ltr; display: inline-block; }
.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font-size: 12.5px; color: var(--ink2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); font-weight: 600; }
.search { position: relative; }
.search input { padding-inline-start: 32px; }
.search::before { content: "⌕"; position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-52%); color: var(--mute); font-size: 16px; }

/* جدول */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: start; font-weight: 600; color: var(--mute); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--soft); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #fcfbf8; }
.tbl .r { text-align: end; }
.tblwrap { overflow-x: auto; }

/* كانبان */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #efebe4; border-radius: 14px; padding: 10px; min-height: 160px; }
.col > header { display: flex; align-items: center; gap: 6px; padding: 2px 4px 10px; font-weight: 600; font-size: 13px; }
.col > header .sum { margin-inline-start: auto; color: var(--mute); font-weight: 500; font-size: 12px; }
.col.drop { outline: 2px dashed var(--acc); outline-offset: -4px; }
.kc { background: #fff; border-radius: 11px; padding: 10px 11px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); border: 1px solid var(--line2); cursor: grab; font-size: 13px; }
.kc:hover { border-color: var(--line); box-shadow: 0 3px 10px rgba(0, 0, 0, .07); }
.kc b { display: block; font-size: 13px; margin-bottom: 4px; line-height: 1.45; }
.kc .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--mute); font-size: 11.5px; }
.kc.dragging { opacity: .5; }
.pri-urgent { border-inline-start: 3px solid var(--bad); } .pri-high { border-inline-start: 3px solid var(--warn); }

/* أفاتار الموظف */
.ea { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; position: relative; }
.ea .dot { position: absolute; bottom: -2px; inset-inline-start: -2px; border: 2px solid #fff; width: 11px; height: 11px; }
.ea.sm { width: 24px; height: 24px; font-size: 11px; border-radius: 7px; }
.ea.lg { width: 48px; height: 48px; font-size: 19px; border-radius: 14px; }
.human { background: #e9e5de; color: var(--ink2); }

/* المكتب ثلاثي الأبعاد */
.office { position: absolute; inset: 0; isolation: isolate; z-index: 0; }
.office canvas { display: block; touch-action: none; }
.office.designing canvas { cursor: grab; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.label { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; transform-origin: 50% 100%; will-change: transform; }
.lb { display: flex; align-items: center; gap: 6px; background: rgba(22, 24, 30, .84); backdrop-filter: blur(6px); color: #fff; padding: 4px 10px; border-radius: 99px; font-size: 12px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.lb i { font-style: normal; opacity: .62; font-size: 11px; }
.label.sel .lb { background: var(--acc); }
.bubble { max-width: 240px; background: #fff; color: var(--ink); font-size: 11.5px; line-height: 1.5; padding: 5px 10px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .13); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble.wait { background: var(--warn); color: #fff; font-weight: 600; animation: bob 1s infinite; }
.label.far .bubble, .label.far .lb i { display: none; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.otop { position: absolute; top: 14px; inset-inline: 14px; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; z-index: 5; }
.otop > * { pointer-events: auto; }
.glass { background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .8); box-shadow: var(--sh); border-radius: 14px; }
.rooms { display: flex; gap: 2px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.rooms::-webkit-scrollbar { display: none; }
.rooms button { border: 0; background: none; padding: 6px 11px; border-radius: 10px; font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.rooms button:hover { background: rgba(255, 255, 255, .9); } .rooms button.on { background: var(--ink); color: #fff; }
.ostats { display: flex; gap: 6px; margin-inline-start: auto; }
.ostats .glass { padding: 7px 12px; font-size: 12.5px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.ticker { position: absolute; bottom: 92px; inset-inline-end: 16px; z-index: 5; width: 360px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.tick { padding: 7px 12px; font-size: 12.5px; animation: inUp .35s ease; border-radius: 12px; }
.tick b { color: var(--acc-d); }
@keyframes inUp { from { opacity: 0; transform: translateY(8px); } }
.cmd { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 32px)); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 7px; background: #fff; border-radius: 18px; box-shadow: var(--sh-l); border: 1px solid var(--line); }
.cmd .ico { color: var(--acc); font-size: 18px; padding-inline-start: 8px; }
.cmd input { flex: 1; border: 0; outline: 0; font-size: 15px; padding: 8px 4px; min-width: 0; background: none; }
.mic { border: 0; background: var(--soft); width: 40px; height: 40px; border-radius: 12px; font-size: 16px; flex: none; }
.mic.rec { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
.panel-open .cmd { left: calc((100% - 470px) / 2); width: min(700px, calc(100% - 500px)); }
.panel-open .ticker { display: none; }

/* لوحة الموظف */
.panel { position: absolute; top: 12px; bottom: 12px; inset-inline-start: 12px; width: min(450px, calc(100% - 24px)); z-index: 8; background: #fffdfa; border-radius: 18px; box-shadow: var(--sh-l); border: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(115%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
[dir=ltr] .panel { transform: translateX(-115%); }
.panel.open { transform: none !important; }
.p-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.p-top { display: flex; align-items: center; gap: 12px; }
.p-name { flex: 1; min-width: 0; } .p-name b { font-size: 16.5px; display: block; } .p-name small { color: var(--mute); font-size: 12.5px; }
.iconbtn { border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 10px; font-size: 14px; flex: none; display: grid; place-items: center; }
.iconbtn:hover { background: var(--line2); }
.activity { margin-top: 10px; font-size: 12.5px; color: var(--ink2); background: var(--soft); border-radius: 10px; padding: 7px 10px; display: flex; gap: 8px; align-items: center; min-height: 32px; }
.spin { width: 12px; height: 12px; border: 2px solid var(--acc-l); border-top-color: var(--acc); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { display: flex; gap: 2px; padding: 6px 10px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 8px 11px; font-size: 13px; color: var(--mute); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--acc); font-weight: 600; }
.p-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.p-foot { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; background: #fff; }
.p-foot textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 44px; max-height: 140px; outline: 0; background: #fffdfa; }
.p-foot textarea:focus { border-color: var(--acc); }
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.75; word-wrap: break-word; }
.msg.user { align-self: flex-start; background: var(--ink); color: #fff; border-start-start-radius: 4px; }
.msg.assistant { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-start-end-radius: 4px; }
.msg.system { align-self: center; background: var(--line2); color: var(--ink2); font-size: 12.5px; padding: 6px 12px; }
.msg .from { font-size: 11px; opacity: .6; display: block; }
.msg pre { background: var(--soft); padding: 8px 10px; border-radius: 10px; overflow-x: auto; font-size: 12px; direction: ltr; text-align: left; }
.msg code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.msg-acts { display: flex; gap: 4px; margin-top: 6px; align-items: center; }
.msg-acts button { border: 0; background: var(--soft); font-size: 11.5px; padding: 3px 9px; border-radius: 8px; color: var(--ink2); }
.msg-acts button:hover { background: var(--acc-l); color: var(--acc-d); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.suggest button { border: 1px solid var(--line); background: #fff; padding: 6px 11px; border-radius: 99px; font-size: 12.5px; }

/* موافقات */
.appr { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--warn); border-radius: 14px; padding: 12px 14px; }
.appr pre { background: var(--soft); border-radius: 10px; padding: 8px 10px; font-size: 12px; max-height: 200px; overflow: auto; direction: ltr; text-align: left; white-space: pre-wrap; margin: 8px 0; }
.appr.kind-plan pre, .appr.kind-send pre { direction: inherit; text-align: start; font-family: var(--font); font-size: 13px; }

/* موجز */
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.feed-item:last-child { border: 0; }
.feed-item .ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 13px; background: var(--soft); }
.feed-item .t { color: var(--mute); font-size: 11px; white-space: nowrap; margin-inline-start: auto; }
.feed-item .pv { color: var(--ink2); font-size: 12.5px; margin-top: 3px; white-space: pre-wrap; }

/* رسوم */
.chart { width: 100%; height: 190px; display: block; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 80px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar .track { height: 9px; background: var(--line2); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, #f3a866, var(--acc)); border-radius: 99px; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel .st { display: grid; grid-template-columns: 110px 1fr 90px; align-items: center; gap: 10px; font-size: 12.5px; }
.funnel .st .b { height: 26px; border-radius: 8px; background: var(--acc-l); position: relative; overflow: hidden; }
.funnel .st .b i { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, #f3a866, var(--acc)); border-radius: 8px; }
.funnel .st .b span { position: relative; z-index: 1; padding-inline-start: 8px; line-height: 26px; font-size: 12px; font-weight: 600; color: #fff; }

/* فريق */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.emp { padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.emp:hover { transform: translateY(-2px); box-shadow: var(--sh-l); }
.emp .top { display: flex; gap: 10px; align-items: center; }
.emp .top b { display: block; font-size: 14.5px; } .emp .top small { color: var(--mute); font-size: 12px; }
.emp .act { font-size: 12px; color: var(--ink2); background: var(--soft); border-radius: 9px; padding: 6px 9px; min-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp .stats { display: flex; gap: 12px; font-size: 11.5px; color: var(--mute); }
.role-card { padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; border: 1.5px dashed #e8cfb4; background: #fffaf4; border-radius: 14px; }
.role-card b { font-size: 13.5px; display: block; } .role-card p { margin: 2px 0 8px; font-size: 12px; color: var(--ink2); }

/* مودال */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(28, 24, 18, .36); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(640px, 100%); max-height: calc(100vh - 32px); background: #fffdfa; border-radius: 20px; box-shadow: var(--sh-l); display: flex; flex-direction: column; overflow: hidden; animation: inUp .22s ease; }
.sheet.wide { width: min(980px, 100%); } .sheet.xwide { width: min(1180px, 100%); }
.sheet > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet h3 { margin: 0; font-size: 16.5px; flex: 1; }
.sheet .body { overflow-y: auto; padding: 16px 18px; }
.sheet .foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: #fff; }
.x { border: 0; background: var(--soft); width: 32px; height: 32px; border-radius: 10px; }

/* فاتورة */
.inv { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.inv h2 { margin: 0 0 4px; font-size: 20px; }
.inv .tbl td, .inv .tbl th { padding: 8px 10px; }
.inv .tot { margin-inline-start: auto; width: min(280px, 100%); margin-top: 12px; }
.inv .tot div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.inv .tot div.g { border-top: 2px solid var(--ink); font-weight: 700; font-size: 15px; padding-top: 8px; }
.qr svg, .qr img { width: 110px; height: 110px; }
@media print { body * { visibility: hidden; } .inv, .inv * { visibility: visible; } .inv { position: absolute; inset: 0; border: 0; } }

/* تذاكر */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 14px; min-height: 0; }
.tlist .ti { padding: 11px 14px; border-bottom: 1px solid var(--line2); cursor: pointer; display: flex; gap: 10px; }
.tlist .ti:hover { background: #fcfbf8; } .tlist .ti.on { background: var(--acc-l); }
.tlist .ti b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlist .ti p { margin: 2px 0 0; font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.draft { background: var(--warn-l); border: 1px solid #f1d9a6; border-radius: 14px; padding: 12px 14px; }
.ch-whatsapp { color: #1f9d55; } .ch-email { color: var(--blue); } .ch-web { color: var(--violet); }

/* إشعارات */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(540px, 92vw); pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; box-shadow: var(--sh-l); animation: inUp .3s ease; display: flex; gap: 10px; align-items: center; }
.toast.warn { background: #b97a17; } .toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
.toast button { background: rgba(255, 255, 255, .2); border: 0; color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; }

/* صفحة التعريف والدخول */
.land { height: 100vh; overflow-y: auto; background: var(--bg); }
.lnav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 14px max(20px, calc((100% - 1160px) / 2)); background: rgba(245, 243, 239, .85); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(0, 0, 0, .04); }
.lnav b { font-size: 16px; } .lnav .sp { flex: 1; }
.lnav a { color: var(--ink2); font-size: 14px; }
.hero { max-width: 1160px; margin: 0 auto; padding: 64px 20px 30px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.18; margin: 0 0 16px; letter-spacing: -1px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--acc-d), var(--acc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--ink2); margin: 0 0 24px; max-width: 560px; }
.hero .pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.heroimg { aspect-ratio: 4/3; border-radius: 22px; overflow: hidden; box-shadow: var(--sh-l); position: relative; background: #e9e4dc; }
.heroimg .office { position: absolute; inset: 0; isolation: isolate; z-index: 0; }
.sec { max-width: 1160px; margin: 0 auto; padding: 50px 20px; }
.sec h2 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.5px; text-align: center; }
.sec > p.c { text-align: center; color: var(--ink2); margin: 0 auto 30px; max-width: 640px; font-size: 16px; }
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feat .card { padding: 20px; }
.feat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--acc-l); margin-bottom: 10px; }
.feat h4 { margin: 0 0 6px; font-size: 16px; } .feat p { margin: 0; color: var(--ink2); font-size: 13.5px; }
.depts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.depts span { padding: 8px 14px; border-radius: 99px; color: #fff; font-size: 13.5px; font-weight: 600; }
.prices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.price { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.price.hot { border: 2px solid var(--acc); position: relative; }
.price.hot::before { content: attr(data-tag); position: absolute; top: -12px; inset-inline-start: 18px; background: var(--acc); color: #fff; font-size: 11.5px; padding: 2px 10px; border-radius: 99px; }
.price .amt { font-size: 34px; font-weight: 700; letter-spacing: -1px; } .price .amt small { font-size: 14px; color: var(--mute); font-weight: 500; }
.price ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink2); flex: 1; }
.price li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.lfoot { text-align: center; color: var(--mute); padding: 30px 20px 50px; font-size: 13px; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #fde8d5, transparent 40%), var(--bg); }
.authcard { width: min(520px, 100%); padding: 28px; }
.authcard h2 { margin: 10px 0 4px; text-align: center; } .authcard > p { text-align: center; color: var(--mute); margin: 0 0 20px; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.steps i { width: 28px; height: 5px; border-radius: 3px; background: var(--line); } .steps i.on { background: var(--acc); }
.pickgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pickgrid label { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13px; background: #fff; }
.pickgrid input { accent-color: var(--acc); }
.pickgrid label:has(input:checked) { border-color: var(--acc); background: var(--acc-l); }
.err { color: var(--bad); font-size: 12.5px; min-height: 18px; text-align: center; }
.banner { padding: 10px 14px; border-radius: 12px; font-size: 13px; display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.banner.warn { background: var(--warn-l); color: #7a5410; border: 1px solid #f0d9a8; } .banner.info { background: var(--blue-l); color: #24539c; } .banner.acc { background: var(--acc-l); color: var(--acc-d); border: 1px solid #f5d5b5; }
.design-hint { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 7; background: var(--acc); color: #fff; padding: 9px 16px; border-radius: 14px; font-size: 13.5px; box-shadow: var(--sh); }
.design-hint button { border: 0; background: #fff; color: var(--acc); border-radius: 9px; padding: 3px 12px; margin-inline-start: 8px; font-weight: 700; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .prices { grid-template-columns: repeat(2, 1fr); } .feat { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; transform: translateX(110%); transition: transform .3s; box-shadow: var(--sh-l); }
  [dir=ltr] .side { transform: translateX(-110%); }
  .side.open { transform: none !important; }
  .mobbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
  .page { padding: 16px 14px 40px; }
  .g2, .g3, .grid[style] { grid-template-columns: 1fr !important; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page { overflow-x: hidden; } .kpi b { font-size: 18px; } .kpi { padding: 12px; } .ph h1 { font-size: 19px; }
  .otop { flex-direction: column; } .ostats { margin: 0; }
  .lnav a:not(.btn) { display: none; } .lnav { gap: 8px; padding: 10px 14px; } .lnav b { font-size: 14px; }
  .hero { grid-template-columns: 1fr; padding-top: 30px; } .feat, .prices { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .panel { inset: 0; width: 100%; border-radius: 0; }
  .ticker, .ostats .hide-m { display: none; }
  .panel-open .cmd { left: 50%; width: calc(100% - 24px); }
  .bar { grid-template-columns: 80px 1fr 64px; }
}

/* ═══ الأتمتة / المواعيد / المحادثات / المطورون ═══ */
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d6d1c7; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 17px; height: 17px; inset-inline-start: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(-17px); }
[dir=ltr] .switch input:checked + span::before { transform: translateX(17px); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.flow .node { font-size: 12.5px; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); }
.flow .node.trig { background: var(--acc-l); border-color: #f5d2b2; color: var(--acc-d); font-weight: 600; }
.flow .node.cond { background: var(--blue-l); border-color: #cfdcf7; color: #24539c; }
.flow .node.act { background: var(--ok-l); border-color: #c8e8d8; color: #1d6b48; }
.flow .arrow { color: var(--mute); font-size: 12px; }
[dir=ltr] .flow .arrow { transform: scaleX(-1); }
.card.auto.off { opacity: .6; }
.card.recipe { transition: transform .15s, box-shadow .15s; } .card.recipe:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.07); }
.bstep { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--soft); }
.bstep .bh { font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.bstep .bn { width: 24px; height: 24px; border-radius: 50%; background: var(--acc); color: #fff; display: grid; place-items: center; font-size: 12px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; overflow-x: auto; }
.wd { background: #fff; border: 1px solid var(--line); border-radius: 14px; min-height: 260px; padding: 6px; }
.wd.today { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-l); }
.wd.off { background: repeating-linear-gradient(45deg, var(--soft), var(--soft) 8px, #fff 8px, #fff 16px); }
.wd .wh { font-size: 12.5px; font-weight: 700; padding: 6px 6px 8px; border-bottom: 1px solid var(--line2); margin-bottom: 6px; }
.bk { background: var(--blue-l); border-inline-start: 3px solid var(--blue); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 12.5px; cursor: pointer; }
.bk small { display: block; color: var(--mute); font-size: 11px; }
.bk.done { background: var(--ok-l); border-color: var(--ok); } .bk.cancelled { background: var(--bad-l); border-color: var(--bad); text-decoration: line-through; opacity: .7; } .bk.noshow { background: var(--warn-l); border-color: var(--warn); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin-bottom: 12px; font-size: 13.5px; } .kv span { color: var(--mute); }
.wmsg { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: 13.5px; margin-bottom: 8px; line-height: 1.6; }
.wmsg.v { background: var(--acc); color: #fff; margin-inline-start: auto; }
.wmsg.b { background: #fff; border: 1px solid var(--line); }
.li.on { background: var(--acc-l); }
pre.code { background: #1d212a; color: #e9e4db; padding: 12px; border-radius: 12px; font-size: 12px; direction: ltr; text-align: left; overflow: auto; white-space: pre; margin: 0; }
.bookp { min-height: 100vh; display: grid; place-items: start center; padding: 40px 16px; background: linear-gradient(160deg, #fdf0e4, #f5f3ef 50%); }
.bookcard { width: 100%; max-width: 620px; padding: 26px; }
.bookcard h4 { margin: 18px 0 8px; }
.svcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.svcbtn, .daybtn, .slotbtn { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: start; font: inherit; color: var(--ink); transition: .15s; }
.svcbtn small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.svcbtn.on, .daybtn.on, .slotbtn.on { border-color: var(--acc); background: var(--acc-l); color: var(--acc-d); box-shadow: 0 0 0 2px var(--acc-l); }
.daystrip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; } .daybtn { white-space: nowrap; font-size: 13px; }
.slotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; } .slotbtn { text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .week { grid-template-columns: repeat(7, 140px); } }
.lvls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lvl { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; text-align: start; cursor: pointer; font: inherit; color: var(--ink); transition: .15s; }
.lvl b { display: block; font-size: 13.5px; } .lvl small { display: block; color: var(--mute); font-size: 11.5px; line-height: 1.5; margin-top: 3px; }
.lvl:hover { border-color: var(--acc); } .lvl.on { border-color: var(--acc); background: var(--acc-l); box-shadow: 0 0 0 2px var(--acc-l); }
.lvl:disabled { cursor: default; opacity: .8; }
.pstats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.pstats div { background: var(--soft); border-radius: 10px; padding: 8px; text-align: center; } .pstats b { display: block; font-size: 17px; } .pstats small { color: var(--mute); font-size: 10.5px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; } .pgrid h5 { margin: 8px 0 4px; font-size: 12.5px; } .pgrid ul { margin: 0; padding-inline-start: 18px; font-size: 12.5px; line-height: 1.7; color: var(--ink2); }
@media (max-width: 700px) { .lvls, .pgrid { grid-template-columns: 1fr; } .pstats { grid-template-columns: repeat(3, 1fr); } }
.bookp { grid-template-columns: minmax(0, 620px); justify-content: center; }
.bookcard { min-width: 0; }
@media (max-width: 520px) { .bookp { padding: 16px 10px; } .bookcard { padding: 18px 14px; } .svcgrid { grid-template-columns: 1fr 1fr; } }
