@font-face{font-family:FmdCairo;src:url('/assets/fonts/cairo-arabic-400-normal.woff2')}#live-root{--bg:#f4f7fb;--card:#fff;--ink:#17263a;--muted:#516078;--line:#dce4ef;--brand:#176b67;position:fixed;inset:0;z-index:99999;overflow:auto;background:var(--bg);color:var(--ink);font:15px FmdCairo,Arial,sans-serif;direction:rtl}#live-root[data-theme=dark]{--bg:#101b29;--card:#1b293b;--ink:#edf3fc;--muted:#b2c1d6;--line:#35465c;--brand:#23817b}#live-root *{box-sizing:border-box}#live-root header{position:sticky;top:0;background:var(--card);border-bottom:1px solid var(--line);padding:12px max(16px,calc((100% - 1120px)/2));display:flex;align-items:center;gap:12px;z-index:2}#live-root header img{width:42px;height:42px;border-radius:12px}#live-root h1{font-size:19px;margin:0}#live-root .live-shell{max-width:1120px;margin:auto;display:grid;grid-template-columns:210px 1fr;gap:24px;padding:24px 16px}#live-root nav{display:flex;flex-direction:column;gap:8px}#live-root button,#live-root input,#live-root select,#live-root textarea{font:inherit}#live-root button{cursor:pointer;border:1px solid var(--line);background:var(--card);color:var(--ink);padding:10px 14px;border-radius:10px}#live-root button.primary{background:var(--brand);color:white;border-color:var(--brand)}#live-root button:disabled{opacity:.55;cursor:wait}#live-root button:focus-visible,#live-root input:focus-visible,#live-root textarea:focus-visible,#live-root select:focus-visible{outline:3px solid #eead31;outline-offset:2px}#live-root input,#live-root textarea,#live-root select{width:100%;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:9px;padding:11px}#live-root textarea{min-height:100px;resize:vertical}#live-root label{display:block;margin:12px 0 5px}#live-root .card{background:var(--card);border:1px solid var(--line);padding:20px;border-radius:16px;margin-bottom:14px;box-shadow:none}#live-root .grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}#live-root .muted{color:var(--muted);font-size:13px}#live-root .row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#live-root .badge{display:inline-block;background:var(--bg);border:1px solid var(--line);border-radius:20px;padding:3px 10px;font-size:12px}#live-root .note{padding:12px 16px;background:#fff3d7;color:#634411;border-radius:10px;margin-bottom:15px;font-size:13px}#live-root .error{background:#ffe4e4;color:#8e1526;padding:10px;border-radius:9px;white-space:pre-wrap}#live-root .success{background:#dff5ed;color:#155c43;padding:10px;border-radius:9px}#live-root .files a{display:block;margin:8px 0;color:var(--ink);overflow-wrap:anywhere}#live-root progress{width:100%}#live-root small{overflow-wrap:anywhere}#live-root h2{font-size:23px;margin-top:0}#live-root h3{font-size:17px}#live-root pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit}#live-root .timeline{border-right:3px solid var(--brand);padding:0 15px;margin:15px 0}#live-root .right{margin-inline-start:auto}#live-root .auth{max-width:480px;margin:35px auto}#live-root .sticky-message{max-width:1120px;margin:10px auto}#live-preview-return{position:fixed;bottom:75px;left:12px;z-index:99998;background:#176b67;color:white;border:0;border-radius:12px;padding:12px;font:14px Arial}#live-root[hidden],#live-preview-return[hidden]{display:none!important}@media(max-width:650px){#live-root .live-shell{grid-template-columns:1fr;gap:12px;padding:12px}#live-root nav{flex-direction:row;overflow:auto;flex-wrap:wrap}#live-root nav button{font-size:12px;padding:8px}#live-root .grid{grid-template-columns:1fr}#live-root .card{padding:15px}#live-root header{padding:10px 12px}#live-root h1{font-size:16px}}
#live-root header select{width:auto;max-width:135px}#live-root nav button[aria-current=page]{border-color:var(--brand);background:var(--brand);color:#fff}#live-root .verified{background:#dff5ed;color:#155c43;border-color:#9fd1b8}#live-root .pager{margin:14px 0}#live-root .profile-cover{height:90px;margin:-20px -20px 20px;border-radius:15px 15px 0 0;background:linear-gradient(120deg,#176b67,#254c72)}#live-root details summary{cursor:pointer;font-weight:bold}#live-root form.row>label{flex:1;min-width:140px}#live-root .professional-profile{overflow:hidden}#live-root .requirements:empty{display:none}#live-root [hidden]{display:none!important}#live-root a{color:var(--brand)}#live-root button{max-width:100%}#live-root textarea{line-height:1.8}#live-root .sticky-message{position:sticky;top:75px;z-index:4;white-space:pre-wrap}

/* نظرة عامة للإدارة */
.ov-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px;margin:8px 0 16px}
.ov-tile{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:start;cursor:pointer;min-height:96px}
.ov-tile:not([data-view]){cursor:default}
.ov-n{font-size:28px;line-height:1.1}
.ov-tile small{opacity:.7}
.ov-todo{display:flex;flex-direction:column;gap:4px}
.ov-todo p{margin:0;opacity:.8}
.ov-pay{border-inline-start:4px solid #d97706}
.ov-mail{border:2px solid #dc2626;background:#fef2f2;color:#7f1d1d}
.ov-mail-d{font-family:monospace;font-size:13px;word-break:break-word;opacity:.85}

/* الموظف الآلي */
.ag-pre{white-space:pre-wrap;word-break:break-word;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:8px;font-family:inherit;margin:6px 0}
#live-root .pill{display:inline-block;padding:1px 10px;margin-inline-start:6px;border-radius:999px;background:#eef2f7;color:#334155;font-size:12px;font-weight:700;line-height:1.8;vertical-align:middle}
#live-root[data-theme=dark] .pill{background:#1e293b;color:#cbd5e1}
#live-root .pill.ok{background:#dff5ed;color:#155c43}
#live-root .pill.danger{background:#fde8e8;color:#8a1c1c}
#live-root .pill.info{background:#e3effd;color:#17407a}
#live-root button.danger{background:#b42318;border-color:#b42318;color:#fff}
.ag-img{display:flex;flex-direction:column;align-items:center;gap:2px}.ag-img img,.ag-msg img{object-fit:cover;border-radius:6px;border:1px solid var(--line)}.ag-user{background:#eef6f5}

/* الموظف الآلي: ألوان تتبع الثيم + شبكة مربعات أدق */
#live-root[data-theme=dark] .pill.ok{background:#12372b;color:#8fe0bd}
#live-root[data-theme=dark] .pill.danger{background:#47191b;color:#ffb4ad}
#live-root[data-theme=dark] .pill.info{background:#1c3350;color:#bcd7ff}
#live-root[data-theme=dark] .ag-user{background:#122a2c}
.ov-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
details>summary{cursor:pointer;margin:4px 0}

/* الموظف الآلي: المحادثة بشكل تطبيقات المحادثة */
.ag-chatwrap{display:flex;flex-direction:column;gap:8px;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:10px 12px}
.ag-chathead{display:flex;align-items:center;gap:8px}.ag-chathead b{font-size:16px}.ag-chathead button{margin-inline-start:auto}
.ag-thread{display:flex;flex-direction:column;gap:14px;overflow-y:auto;min-height:320px;max-height:calc(100vh - 330px);padding:6px 2px 10px;scroll-behavior:smooth}
.ag-row{display:flex;gap:10px;align-items:flex-start}
.ag-row-me{justify-content:flex-end}
.ag-bub{max-width:min(78%,640px);background:#eef1f5;border-radius:18px;padding:9px 14px;line-height:1.7}
.ag-text{white-space:pre-wrap;word-break:break-word;line-height:1.75}
.ag-thumbs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px}.ag-thumbs img{border-radius:10px;object-fit:cover;border:1px solid var(--line)}
.ag-av{flex:0 0 30px;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--brand);color:#fff;font-size:15px}
.ag-av-lg{width:52px;height:52px;flex-basis:52px;font-size:24px;margin:0 auto 8px}
.ag-botbody{flex:1;min-width:0}.ag-name{font-weight:700;font-size:13px;color:var(--muted);margin-bottom:2px}
.ag-botbody .card{margin-top:8px}
.ag-meta{font-size:12px;color:var(--muted);margin-top:6px}
.ag-typing{display:inline-flex;gap:4px;padding:8px 0}.ag-typing i{width:7px;height:7px;border-radius:50%;background:var(--muted);opacity:.4;animation:agdot 1.2s infinite}
.ag-typing i:nth-child(2){animation-delay:.2s}.ag-typing i:nth-child(3){animation-delay:.4s}
@keyframes agdot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:.9;transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){.ag-typing i{animation:none;opacity:.6}.ag-thread{scroll-behavior:auto}}
.ag-empty{margin:auto;text-align:center;max-width:520px;padding:24px 8px}.ag-empty h3{margin:4px 0 6px;font-size:20px}
.ag-sugg{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:12px}
.ag-sugg button{border-radius:999px;padding:7px 14px;background:var(--bg);border:1px solid var(--line)}
.ag-composer{border:1px solid var(--line);border-radius:20px;padding:8px 10px;background:var(--card);box-shadow:0 2px 10px rgba(16,24,40,.06);position:sticky;bottom:6px}
.ag-composer:focus-within{border-color:var(--brand)}
.ag-composer textarea{width:100%;border:0;outline:0;resize:none;background:transparent;color:inherit;font:inherit;line-height:1.7;min-height:28px;max-height:220px;padding:4px 2px;box-shadow:none}
.ag-tools{display:flex;align-items:center;gap:8px}.ag-hint{font-size:12px;margin-inline-end:auto}
.ag-ic{border:0;background:transparent;font-size:19px;padding:4px 6px;border-radius:8px;cursor:pointer;min-width:36px;min-height:36px}
.ag-ic:hover{background:var(--bg)}
.ag-send{width:38px;height:38px;border-radius:50%;border:0;background:var(--brand);color:#fff;font-size:19px;font-weight:700;cursor:pointer;padding:0}
.ag-send[disabled]{opacity:.45;cursor:default}
.ag-chips{display:flex;flex-wrap:wrap;gap:6px}.ag-chips:empty{display:none}
.ag-chip{position:relative;display:inline-block}.ag-chip img{border-radius:10px;object-fit:cover;border:1px solid var(--line);display:block}
.ag-chip button{position:absolute;top:-6px;inset-inline-end:-6px;width:20px;height:20px;border-radius:50%;padding:0;font-size:13px;line-height:18px;background:#111827;color:#fff;border:2px solid var(--card)}
.ag-set,.ag-cost{border:1px solid var(--line);border-radius:12px;padding:6px 10px;background:var(--bg)}.ag-cost summary,.ag-set summary{font-size:13px;color:var(--muted)}
.ag-cost .card{margin:6px 0 0}
#live-root[data-theme=dark] .ag-bub{background:#26303d}
#live-root[data-theme=dark] .ag-chip button{background:#e5e7eb;color:#111827}
@media (max-width:640px){.ag-bub{max-width:88%}.ag-hint{display:none}.ag-thread{max-height:calc(100vh - 300px)}}
/* خانة الكتابة والأزرار: أولوية أعلى من تنسيق النماذج العام في الداشبورد */
#live-root .ag-composer textarea{width:100%;border:0;outline:0;resize:none;background:transparent;color:inherit;font:inherit;line-height:1.7;min-height:28px;height:auto;max-height:220px;padding:4px 2px;margin:0;box-shadow:none;border-radius:0}
#live-root .ag-composer textarea:focus{outline:0;box-shadow:none}
#live-root .ag-send{width:38px;height:38px;min-height:38px;border-radius:50%;border:0;background:var(--brand);color:#fff;font-size:19px;font-weight:700;padding:0;margin:0;display:grid;place-items:center}
#live-root .ag-ic{border:0;background:transparent;font-size:19px;padding:4px 6px;margin:0;border-radius:8px;min-width:36px;min-height:36px;box-shadow:none}
#live-root .ag-ic:hover{background:var(--bg)}
#live-root .ag-chip button{position:absolute;top:-6px;inset-inline-end:-6px;width:20px;height:20px;min-height:20px;border-radius:50%;padding:0;margin:0;font-size:13px;line-height:16px;background:#111827;color:#fff;border:2px solid var(--card)}
#live-root .ag-sugg button{border-radius:999px;padding:7px 14px;background:var(--bg);border:1px solid var(--line);margin:0}
#live-root .ag-chathead button{margin-inline-start:auto;border-radius:999px}
#live-root[data-theme=dark] .ag-chip button{background:#e5e7eb;color:#111827}
.ag-caps{border:1px solid var(--line);border-radius:12px;padding:8px 12px}.ag-caps legend{padding:0 6px;font-weight:700}
.ag-capsec{margin-top:8px}.ag-capsec b{display:block;color:var(--muted);font-size:13px;margin-bottom:2px}
/* الجلسة ٢: محادثة الموظف — ملفات، تدفق، تاريخ، ونافذة جانبية */
.ag-chathead .ag-ctitle{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#live-root .ag-chathead .ag-hbtn{display:flex;gap:6px;margin-inline-start:auto}
#live-root .ag-chathead .ag-hbtn button{margin:0;padding:6px 12px;min-height:40px}
.ag-att{position:relative;display:flex;gap:8px;align-items:flex-start;max-width:100%;width:min(100%,340px);padding:6px 8px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.ag-att.is-bad{border-color:#f04438}
.ag-att img{border-radius:8px;object-fit:cover;flex:none}
.ag-fi{display:grid;place-items:center;width:40px;height:40px;border-radius:8px;background:var(--card);font-size:20px;flex:none}
.ag-att-b{display:flex;flex-direction:column;min-width:0;flex:1}
.ag-att-n{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ag-att small{color:var(--muted);font-size:13px}.ag-att progress{width:100%;height:6px}
.ag-bad{color:#b42318}#live-root[data-theme=dark] .ag-bad{color:#fda29b}
#live-root .ag-att>.ag-ic{min-width:32px;min-height:32px;font-size:16px;padding:0}
.ag-man{margin-top:4px;font-size:13px}.ag-man ul{margin:4px 0;padding-inline-start:18px;max-height:220px;overflow:auto}
.ag-fl{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px}.ag-fchip{display:inline-flex;gap:4px;align-items:center;border:1px solid var(--line);border-radius:999px;padding:2px 10px;font-size:13px;background:var(--card)}
.ag-md{white-space:normal}.ag-md p{margin:0 0 .5em}.ag-md ul,.ag-md ol{margin:.2em 0 .6em;padding-inline-start:22px}
.ag-md code{background:var(--bg);border-radius:6px;padding:1px 5px}.ag-code{background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:10px;overflow:auto;direction:ltr;text-align:left;font-family:ui-monospace,Consolas,monospace;font-size:13px;white-space:pre}
.ag-sent{font-size:13px;color:var(--muted);margin-top:6px;padding:4px 10px;border-inline-start:3px solid var(--line);background:var(--bg);border-radius:6px}
.ag-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.ag-acts{display:inline-flex;gap:6px;margin-inline-start:auto}
#live-root .ag-mini{padding:4px 10px;min-height:32px;font-size:13px;border-radius:999px;margin:0}
.ag-old>summary{font-size:13px;color:var(--muted)}
.ag-hist{display:flex;flex-direction:column;gap:6px;max-height:50vh;overflow:auto}
.ag-hist-f{display:flex;gap:6px}#live-root .ag-hist-f input{flex:1}
.ag-hist-i{display:flex;gap:6px;align-items:stretch}.ag-hist-i.is-cur .ag-hist-open{border-color:var(--brand)}
#live-root .ag-hist-open{flex:1;display:flex;flex-direction:column;align-items:flex-start;text-align:start;gap:2px;margin:0}
.ag-hist-open small{color:var(--muted);font-size:13px}.ag-snip{font-style:italic}
.ag-composer.is-drop{outline:3px dashed var(--brand);outline-offset:2px}
#live-root .ag-mic[aria-disabled=true]{opacity:.45}
#live-root .ag-stop{background:#b42318}
.ag-in-panel{border:0;border-radius:0;padding:8px 10px;height:100%}
.ag-in-panel .ag-thread{max-height:none;flex:1;min-height:0}
/* الزر العائم والنافذة الجانبية (هيكل الإدارة) */
#live-root.sh-admin .sh-fab{position:fixed;z-index:40;bottom:calc(18px + env(safe-area-inset-bottom,0px));inset-inline-end:18px;display:inline-flex;align-items:center;gap:8px;min-height:52px;padding:0 18px;border:0;border-radius:999px;background:var(--brand);color:#fff;font-weight:700;box-shadow:var(--sh-shadow)}
#live-root.sh-admin .sh-fab[hidden]{display:none}
#live-root.sh-admin .sh-chatpanel{position:fixed;z-index:55;top:var(--sh-top);bottom:0;inset-inline-end:0;width:min(440px,100vw);display:flex;flex-direction:column;background:var(--card);border-inline-start:1px solid var(--line);box-shadow:var(--sh-shadow)}
#live-root.sh-admin .sh-chatpanel[hidden]{display:none}
#live-root.sh-admin .sh-chatpanel.is-wide{width:min(980px,100vw)}
#live-root.sh-admin .sh-cph{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px 6px 12px;border-bottom:1px solid var(--line)}
#live-root.sh-admin .sh-cph b{display:inline-flex;align-items:center;gap:6px}
#live-root.sh-admin .sh-cpb{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column}
#live-root.sh-admin .sh-cpb>.ag-chatwrap{flex:1;min-height:0}
@media (max-width:700px){#live-root.sh-admin .sh-fab .sh-fab-t{display:none}#live-root.sh-admin .sh-fab{width:56px;height:56px;padding:0;justify-content:center}
 #live-root.sh-admin .sh-chatpanel,#live-root.sh-admin .sh-chatpanel.is-wide{top:0;width:100vw;padding-top:env(safe-area-inset-top,0px)}}
/* الجلسة ٣: العمليات الجماعية */
.ag-prog{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0}.ag-prog progress{flex:1;min-width:160px;height:14px}
.ag-jobacts{gap:8px;margin:10px 0}.ag-btnlink{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:10px;color:var(--ink);text-decoration:none}
.ag-chipsrow{gap:6px;margin:8px 0}#live-root .ag-mini.is-on{background:var(--brand);color:#fff;border-color:var(--brand)}
.ag-jobitems{width:100%;border-collapse:collapse;display:block;overflow-x:auto}.ag-jobitems th,.ag-jobitems td{padding:8px;border-bottom:1px solid var(--line);vertical-align:top;text-align:start}
.ag-jobitems tr.ag-is-excluded td{opacity:.55}.ag-steplist{margin:6px 0 10px;padding-inline-start:22px}.ag-steplist li{margin:6px 0}
.ag-mini-t td{padding:2px 8px;border-bottom:1px solid var(--line)}.ag-report{white-space:pre-wrap;background:var(--bg);border-radius:10px;padding:10px;font:inherit}
.ag-log{list-style:none;padding:0;margin:0;max-height:300px;overflow:auto}.ag-log li{padding:4px 0;border-bottom:1px dashed var(--line)}.ag-lv-error{color:#b42318}.ag-lv-ok{color:var(--sh-ok,#12805c)}
#live-root[data-theme=dark] .ag-lv-error{color:#fda29b}.ag-steps{border:1px solid var(--line);border-radius:10px;padding:6px 10px}
#ag-jobs-list{width:100%;border-collapse:collapse;display:block;overflow-x:auto}#ag-jobs-list td,#ag-jobs-list th{padding:8px;border-bottom:1px solid var(--line);text-align:start}
/* الجلسة ٤: مركز الإشعارات */
.nc-tools{justify-content:space-between;margin:6px 0 10px}.nc-filter{display:flex;gap:8px;align-items:center;margin:0}
.nc-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.nc-item{display:flex;gap:12px;align-items:flex-start;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px}
.nc-item.is-unread{border-inline-start:4px solid var(--brand);background:color-mix(in srgb,var(--card) 92%,var(--brand))}
.nc-item.is-urgent{border-inline-start-color:#d92d20}
.nc-ic{font-size:22px;line-height:1.2;flex:none}.nc-b{flex:1;min-width:0}.nc-b p{margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere}
.nc-h{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.nc-dot{width:9px;height:9px;border-radius:50%;background:var(--brand);display:inline-block}
.nc-a{display:flex;flex-direction:column;gap:6px;flex:none}.nc-empty{padding:24px;text-align:center;color:var(--muted);background:var(--card);border:1px dashed var(--line);border-radius:14px}
.nc-types,.nc-devs{width:100%;border-collapse:collapse}.nc-types td,.nc-devs td{padding:8px;border-bottom:1px solid var(--line);vertical-align:middle}
.nc-types select{min-width:180px}
#live-toast.is-urgent{background:#b42318;color:#fff}
@media (max-width:640px){.nc-item{flex-wrap:wrap}.nc-a{flex-direction:row;flex-wrap:wrap;width:100%}.nc-types select{min-width:0}}

/* شريط «مفيش اتصال» + بوابة التطبيق لغير الإدارة */
#fmd-offline{position:fixed;z-index:90;top:calc(8px + env(safe-area-inset-top,0px));inset-inline:12px;display:flex;flex-direction:column;gap:2px;padding:10px 14px;border-radius:12px;background:#7c2d12;color:#fff;font-size:14px;box-shadow:0 6px 20px rgba(0,0,0,.25)}
#fmd-offline[hidden]{display:none}
.live-app-gate{max-width:520px;margin:15vh auto 0;padding:16px}

.auth-why{margin:0 0 12px;padding:10px 12px;border-radius:10px;background:var(--brand-soft,#EAF1FF);color:var(--brand,#1363F3);font-weight:700}
:root[data-theme=dark] .auth-why{background:rgba(19,99,243,.18);color:#9CC0FF}

/* ===== شاشة الموظف الآلي: رأس بسيط + قايمة جانبية + شات بشكل Claude ===== */
#live-root .ag-page{position:relative}
#live-root .ag-top{display:flex;align-items:center;gap:6px;min-height:52px;position:sticky;top:0;z-index:30;background:var(--bg);margin-block:-4px 6px}
#live-root .ag-ibtn{width:44px;height:44px;min-width:0;min-height:0;padding:0;border:0;background:transparent;color:inherit;border-radius:12px;display:grid;place-items:center;box-shadow:none}
#live-root .ag-ibtn svg,#live-root .ag-dit svg,#live-root .ag-newc svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
#live-root .ag-ttl{flex:1;text-align:center;font-weight:700;font-size:17px;display:flex;align-items:center;justify-content:center;gap:8px}
#live-root .ag-ttl small{color:var(--muted);font-weight:600}
#live-root .ag-dot{width:9px;height:9px;border-radius:50%;background:var(--muted);display:inline-block}
#live-root .ag-dot.ok{background:#1E8E5A}#live-root .ag-dot.danger{background:#C0392B}
#live-root .ag-h2{font-size:22px;margin:4px 0 10px}
#live-root .ag-scrim{display:none;position:fixed;inset:0;z-index:119;background:rgba(20,20,19,.4);border:0;padding:0;margin:0;border-radius:0;min-width:0;min-height:0}
#live-root .ag-drawer{position:fixed;inset-block:0;inset-inline-start:0;width:min(84%,340px);z-index:120;background:var(--bg);color:var(--ink);box-shadow:0 0 30px rgba(0,0,0,.25);display:flex;flex-direction:column;overflow-y:auto;padding:10px 8px calc(12px + env(safe-area-inset-bottom,0px));transform:translateX(100%);visibility:hidden;transition:transform .2s ease,visibility .2s}
html[dir=ltr] #live-root .ag-drawer{transform:translateX(-100%)}
#live-root .ag-open .ag-drawer{transform:none;visibility:visible}#live-root .ag-open .ag-scrim{display:block}
#live-root .ag-dh{display:flex;align-items:center;gap:10px;padding:6px 8px 10px}
#live-root .ag-logo{width:34px;height:34px;border-radius:50%;background:var(--brand);color:#fff;display:grid;place-items:center;font-weight:800}
#live-root .ag-dx{margin-inline-start:auto;width:40px;height:40px;min-width:0;min-height:0;padding:0;border:0;background:transparent;color:inherit;border-radius:10px}
#live-root .ag-newc{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;margin:4px 6px 10px;border:0;border-radius:14px;background:var(--brand);color:#fff;font-weight:700}
#live-root .ag-dit{display:flex;align-items:center;gap:12px;min-height:48px;width:calc(100% - 12px);margin:0 6px;padding:0 12px;border:0;border-radius:12px;background:transparent;color:inherit;font-weight:600;text-align:start;box-shadow:none}
#live-root .ag-dit.on{background:var(--brand-soft,#E8EFFE);color:var(--brand)}
#live-root .ag-dit .ag-n{margin-inline-start:auto;background:#C0392B;color:#fff;border-radius:999px;min-width:22px;height:22px;display:grid;place-items:center;font-size:12px;padding:0 6px}
#live-root .ag-dsec{padding:10px 14px 2px;font-size:12.5px;color:var(--muted);font-weight:700}
#live-root .ag-dfoot{margin-top:auto;border-top:1px solid var(--line);padding:10px 14px 0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
/* الشات: صفحة كاملة من غير إطار، ورد الموظف نص من غير فقاعة، ورسالتك في فقاعة هادية */
#live-root .ag-t-chat .ag-chatwrap{border:0;background:transparent;padding:0;gap:6px}
#live-root .ag-t-chat .ag-chathead{display:none}
#live-root .ag-t-chat .ag-thread{max-height:none;height:calc(100dvh - 290px);min-height:200px;scroll-behavior:auto;padding-inline:2px}
#live-root .ag-t-chat .ag-row-bot .ag-av,#live-root .ag-t-chat .ag-row-bot .ag-name{display:none}
#live-root .ag-t-chat .ag-botbody{max-width:100%}
#live-root .ag-t-chat .ag-row-me .ag-bub{background:#EFEDE3;color:#1F1E1D;border-radius:18px}
#live-root[data-theme=dark] .ag-t-chat .ag-row-me .ag-bub{background:#3A3936;color:#F2F0E8}
#live-root .ag-t-chat .ag-composer{border-radius:24px;position:sticky;bottom:6px}
#live-root .ag-t-chat .ag-cost{font-size:12.5px;color:var(--muted)}

/* الشات صفحة كاملة: بنخفي الشريط العام ومسار الصفحة (القايمة ☰ فيها الرجوع للوحة)، وقايمة التنقل السفلية لما الكيبورد يفتح (الشاشة قصيرة) */
#live-root.sh-admin:has(.ag-t-chat)>header.sh-top,#live-root.sh-admin:has(.ag-t-chat) .sh-pagebar{display:none}
#live-root .ag-t-chat .ag-thread{height:calc(100dvh - 215px)}
@media (max-height:560px){#live-root.sh-admin:has(.ag-t-chat) .sh-bnav{display:none}#live-root .ag-t-chat .ag-thread{height:calc(100dvh - 150px)}#live-root.sh-admin main .ag-t-chat .ag-composer{bottom:6px}}

/* على الموبايل: القايمة الجانبية بدل صف التبويبات؛ على الكمبيوتر صف التبويبات زي الأول */
@media (max-width:900px){#live-root .ag-page .fmd-tabs,#live-root .ag-t-chat>.ag-h2,#live-root .ag-page>.ag-bar{display:none}#live-root .ag-t-summary>.ag-bar{display:block}}
@media (min-width:901px){#live-root .ag-top .ag-ibtn[data-ag-drawer]{display:none}#live-root .ag-t-chat .ag-thread{height:calc(100vh - 360px)}}

/* ===== صفحة الصلاحيات البسيطة ===== */
#live-root .ag-gt{font-size:13px;font-weight:800;color:var(--muted);margin:16px 0 6px;display:flex;align-items:center;gap:8px}
#live-root .ag-gt:before{content:"";width:4px;height:16px;border-radius:2px;background:var(--brand)}
#live-root .ag-cap{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:10px 12px;margin-bottom:8px}
#live-root .ag-cap.is-off{opacity:.75}
#live-root .ag-ct{font-weight:700;font-size:15px;line-height:1.5}#live-root .ag-ct small{color:var(--muted);font-weight:600}
#live-root .ag-cd{display:block;font-size:12.5px;color:var(--muted);line-height:1.5;margin-bottom:6px}
#live-root .ag-seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;background:var(--bg);border-radius:12px;padding:3px;gap:3px}
#live-root .ag-seg button{min-width:0;min-height:40px;border:0;border-radius:10px;background:transparent;color:var(--muted);font:inherit;font-weight:700;font-size:13.5px;box-shadow:none;padding:0 6px}
#live-root .ag-seg button:disabled{opacity:.4}
#live-root .ag-seg button.on.s-no{background:#FBE7E4;color:#C0392B}#live-root .ag-seg button.on.s-sug{background:#FDF1D8;color:#A86A00}#live-root .ag-seg button.on.s-auto{background:#E3F4EB;color:#1E8E5A}
#live-root[data-theme=dark] .ag-seg button.on.s-no{background:#47231F;color:#FF8A7D}#live-root[data-theme=dark] .ag-seg button.on.s-sug{background:#3F3317;color:#F0B64A}#live-root[data-theme=dark] .ag-seg button.on.s-auto{background:#1F3A2E;color:#5FD39B}
#live-root .ag-lock{font-size:12px;color:var(--muted);margin-top:6px}
#live-root .ag-when{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:13px;color:var(--muted)}#live-root .ag-when b{color:var(--ink)}
#live-root .ag-lnk{margin-inline-start:auto;min-width:0;min-height:0;border:0;background:transparent;color:var(--brand);font:inherit;font-weight:700;padding:4px 6px;box-shadow:none}
#live-root .ag-inl{margin-top:10px;padding-top:10px;border-top:1px dashed var(--line);display:flex;flex-direction:column;gap:8px}
#live-root .ag-two{display:grid;grid-template-columns:1fr 1fr;gap:8px}#live-root .ag-two input,#live-root .ag-inl input{width:100%;min-width:0}
#live-root .ag-qs{display:flex;flex-wrap:wrap;gap:8px}#live-root .ag-q{min-width:0;min-height:36px;border:1px solid var(--line);border-radius:999px;background:var(--card);color:inherit;padding:0 14px;font:inherit;font-weight:600}
#live-root .ag-pri{background:var(--brand);border-color:var(--brand);color:#fff}
#live-root .ag-shadow p{margin:0 0 8px}
#live-root .ag-adv{margin-top:18px}#live-root .ag-adv>summary{font-weight:700;padding:10px 0;cursor:pointer}
@media (max-width:480px){#live-root .ag-two{grid-template-columns:1fr}}
#live-root .ag-two label{min-width:0}

/* الشريط الجديد كان بيركب فوق الشريط العام (وفوق شريط حالة الموبايل) لما الصفحة تنزل: بقى يلزق تحت الشريط العام،
   وفي الشات (الشريط العام مخفي) يلزق تحت شريط حالة الموبايل بمسافة أمان */
#live-root .ag-top{top:calc(var(--sh-top,56px) + env(safe-area-inset-top,0px))}
#live-root.sh-admin:has(.ag-t-chat) .ag-top{top:0;padding-top:env(safe-area-inset-top,0px)}
#live-root .ag-na{width:100%}#live-root .ag-na>summary{color:var(--muted);font-size:13px;padding:6px 0;cursor:pointer}#live-root .ag-na .pill{display:block;margin:4px 0}

/* ===== الموظف الآلي: قرارات كبطاقات ===== */
.ag-lead{margin:0 0 14px;font-size:15px;line-height:1.7;color:var(--muted,#5b6472)}
.ag-sh{margin:18px 0 8px;font-size:15px}
.ag-empty{padding:28px 12px;text-align:center;color:var(--muted,#5b6472);border:1px dashed var(--line,#d9dee7);border-radius:14px}
.ag-dcs{display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}
.ag-dc{background:var(--card,#fff);border:1px solid var(--line,#e3e7ee);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:8px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.ag-dc.is-bad{border-color:#e5a4a4}
.ag-dc-h{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.ag-dc-cap{font-weight:700;font-size:13px;color:#1363F3;margin-inline-end:auto}
.ag-dc-t{margin:0;font-size:16px;line-height:1.5;overflow-wrap:anywhere}
.ag-dc-why{margin:0;font-size:14px;line-height:1.6;color:var(--muted,#5b6472)}
.ag-dc-m{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12px;color:var(--muted,#5b6472)}
.ag-dc-a{display:flex;gap:8px;margin-top:4px}
#live-root .ag-dc-a button{min-height:44px;flex:1;border-radius:12px}
#live-root .ag-dc-a button.primary{flex:2;background:#1363F3;color:#fff;border:0;font-weight:700}
@media (max-width:480px){.ag-dcs{grid-template-columns:1fr}}

/* الجداول العريضة جوه الموظف الآلي: تتحرك أفقيًا جوه نفسها بدل ما الصفحة كلها تتقص (موبايل) */
@media (max-width:900px){.ag-page table.card{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.ag-page table.card th,.ag-page table.card td{white-space:nowrap}.ag-page table.card td small{white-space:normal}}
