
/* Tokens — names mirror Figma variables (color/bg/base -> --color-bg-base) */
:root{
  --color-bg-layout:#fff3e6;--color-bg-base:#fff7ef;--color-bg-container:#f5eddc;--color-bg-tint:#f0e5cf;--color-bg-elevated:#fff7ef;--color-bg-disabled:#f0e5cf;--color-bg-sidebar:#005642;
  --color-text-primary:#2e2a1b;--color-text-secondary:#6b6558;--color-text-disabled:#8f887b;--color-text-on-action:#fff7ef;--color-text-on-brand:#fff7ef;--color-text-gold:#e6ba65;
  --color-action-default:#c39e57;--color-action-hover:#b28f4d;--color-brand-default:#005642;--color-brand-hover:#054b39;--color-brand-subtle-bg:#e8d5b3;
  --color-border-default:#8f887b;--color-border-subtle:#f0e5cf;--color-border-focus:#005642;
  --color-error-base:#da0001;--color-error-bg:#ffeae6;--color-error-border:#ff887a;--color-error-text:#8e0a07;
  --color-success-base:#39ac00;--color-success-text:#2d7106;--color-success-bg:#dfebd3;--color-success-border:#93d164;
  --color-warning-base:#bc8000;--color-warning-bg:#fcf9e3;--color-warning-border:#e3c96d;
  --color-orange-base:#f08a1c;--color-orange-bg:#fff0dc;--color-orange-border:#f5a04a;--color-orange-text:#8a4500;
  --color-chart-1:#005642;--color-chart-2:#c39e57;--color-chart-3:#e6ba65;--color-chart-4:#8f887b;
  --space-xs:4px;--space-sm:12px;--space-md:16px;--space-lg:24px;--space-xs2:8px;
  --radius-sm:4px;--radius-md:8px;
  --shadow-popover:0 8px 24px rgba(46,42,27,.2);
  --shadow-card:0 0 6px 0 rgba(0,0,0,.25); /* the owner 12 Nov: every section lifted off the background — X 0 · Y 0 · blur 6 · spread 0 · #000 25% */
  --font:'Cairo',system-ui,-apple-system,'Segoe UI',Tahoma,sans-serif;
}
*{box-sizing:border-box}
html{color-scheme:light}
body{margin:0;background:var(--color-bg-layout);color:var(--color-text-primary);font-family:var(--font);font-size:14px;line-height:24px;direction:rtl;
  padding-left:0;padding-right:0}
button,input{font-family:inherit;font-size:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:2px}
.num{direction:ltr;unicode-bidi:isolate;display:inline-block}

/* Type classes (Figma text styles) */
.t-h3{font-size:24px;line-height:36px;font-weight:600}
.t-h4{font-size:20px;line-height:32px;font-weight:600}
.t-h5{font-size:16px;line-height:28px;font-weight:600}
.t-body{font-size:14px;line-height:24px;font-weight:400}
.t-small{font-size:12px;line-height:20px;font-weight:400}
.t-label{font-size:14px;line-height:24px;font-weight:500}
.t-label-s{font-size:12px;line-height:20px;font-weight:500}
.t-th{font-size:14px;line-height:24px;font-weight:600}

/* App shell */
.app{display:grid;grid-template-columns:208px 1fr;min-height:100vh}
.sidebar{background:var(--color-bg-sidebar);color:var(--color-text-on-brand);padding:16px 12px;display:flex;flex-direction:column;gap:4px;position:sticky;top:0;height:100vh;overflow:auto}
.brand{display:flex;align-items:center;gap:8px;padding:8px;margin-bottom:12px;color:var(--color-text-gold);font-weight:700;letter-spacing:.04em}
.brand small{font-weight:500;font-size:11px;color:var(--color-text-on-brand);opacity:.8}
.nav-item{height:36px;display:flex;align-items:center;gap:10px;padding:0 12px;border:0;background:transparent;color:var(--color-text-on-brand);border-radius:var(--radius-sm);text-align:start;font-weight:500;width:100%}
.nav-item:hover{background:rgba(255,247,239,.12)}
.nav-item[aria-current=page]{background:var(--color-action-default);color:var(--color-text-on-action);font-weight:600}
.main{min-width:0;display:flex;flex-direction:column}
.topbar{height:48px;background:var(--color-bg-base);border-bottom:1px solid var(--color-border-subtle);display:flex;align-items:center;gap:12px;padding:0 24px;position:sticky;top:0;z-index:5}
.topbar .search{width:360px;max-width:50vw;height:32px;display:flex;align-items:center;gap:8px;padding:0 12px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-sm);background:var(--color-bg-container);color:var(--color-text-secondary);margin-inline-end:auto}
.topbar .search input{border:0;background:transparent;flex:1;min-width:0;outline:0;font-size:12px;color:var(--color-text-primary)}
.topbar .search:focus-within{border-color:var(--color-border-focus)}
.nav-item[aria-disabled=true]{opacity:.55;cursor:default}.nav-item[aria-disabled=true]:hover{background:transparent}
.topbar .user{display:flex;align-items:center;gap:8px;order:3;color:var(--color-text-primary)}
.avatar{width:28px;height:28px;border-radius:50%;background:var(--color-brand-default);color:var(--color-text-on-brand);display:grid;place-items:center;font-size:12px;font-weight:600}
.content{padding:24px max(24px,env(safe-area-inset-right,0px)) 24px max(24px,env(safe-area-inset-left,0px));display:flex;flex-direction:column;gap:24px;min-width:0}
.page-head h1{margin:0;color:var(--color-brand-default)}
.page-head p{margin:0;color:var(--color-text-secondary)}

/* Icons / buttons */
.ic{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ic.sm{width:16px;height:16px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:36px;padding:0 16px;border-radius:var(--radius-sm);border:1px solid transparent;font-weight:500;font-size:14px;line-height:20px;white-space:nowrap}
.btn.sm{height:24px;padding:0 8px;font-size:12px}
a.btn{text-decoration:none}
.btn.lg{height:40px}
.btn-primary{background:var(--color-action-default);color:var(--color-text-on-action)}
.btn-primary:hover{background:var(--color-action-hover)}
.btn-brand{background:var(--color-brand-default);color:var(--color-text-on-brand)}
.btn-brand:hover{background:var(--color-brand-hover)}
.btn-default{background:var(--color-bg-container);border-color:var(--color-border-default);color:var(--color-text-primary)}
.btn-default:hover{border-color:var(--color-brand-default);color:var(--color-brand-default)}
.btn-text{background:transparent;color:var(--color-brand-default)}
.btn-text:hover{background:var(--color-bg-hover)}
.btn-danger{background:var(--color-error-base);color:#fff}
.btn:disabled{background:var(--color-bg-disabled);color:var(--color-text-disabled);border-color:transparent;cursor:not-allowed}
.icon-btn{width:32px;height:32px;display:inline-grid;place-items:center;border:0;background:transparent;border-radius:var(--radius-sm);color:var(--color-text-secondary)}
.icon-btn:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}

/* Tabs */
.tabs{display:flex;gap:0;border-bottom:1px solid var(--color-border-subtle);overflow-x:auto}
.tab{padding:12px 16px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--color-text-secondary);font-weight:400;white-space:nowrap}
.tab:hover{color:var(--color-text-primary)}
.tab[aria-selected=true]{color:var(--color-brand-default);font-weight:600;border-bottom-color:var(--color-action-default)}

/* Toolbar + fields */
.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.toolbar .grow{flex:1}
.pop-anchor{position:relative;display:inline-block}
.date-field,.sort-btn{height:36px;display:inline-flex;align-items:center;gap:8px;padding:0 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-container);font-weight:500}
.date-field:hover,.sort-btn:hover{border-color:var(--color-brand-default)}
.range-label{color:var(--color-text-secondary)}
.menu{position:absolute;top:calc(100% + 4px);inset-inline-start:0;min-width:100%;width:max-content;max-width:90vw;max-height:300px;overflow:auto;padding:4px;background:var(--color-bg-elevated);border:1px solid var(--color-border-subtle);border-radius:var(--radius-sm);box-shadow:var(--shadow-popover);z-index:30}
.menu.end{inset-inline-start:auto;inset-inline-end:0}
.opt{height:40px;display:flex;align-items:center;padding:0 12px;border-radius:var(--radius-sm);width:100%;border:0;background:transparent;text-align:start;font-size:14px;line-height:24px;gap:8px}
.opt:hover,.opt:focus-visible{background:var(--color-bg-hover)}
.opt[aria-selected=true],.opt[aria-checked=true]{background:var(--color-brand-subtle-bg);color:var(--color-brand-default);font-weight:600}
.opt.danger{color:var(--color-error-text)}

.field{display:flex;flex-direction:column;gap:4px;min-width:0}
.field>label,.flabel{font-size:14px;line-height:24px;font-weight:500}
.req{color:var(--color-error-base)}
.input,.select{height:36px;width:100%;padding:0 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-base);font-size:14px;display:flex;align-items:center;gap:8px;text-align:start}
.select{justify-content:space-between;flex-direction:row-reverse}
.select .val{flex:1;text-align:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.select .ph{color:var(--color-text-disabled)}
.input:hover,.select:hover{border-color:var(--color-brand-default)}
.input:focus-within,.select:focus-visible{border-color:var(--color-border-focus);outline:2px solid var(--color-border-focus);outline-offset:0}
.input input{border:0;background:transparent;flex:1;min-width:0;height:100%;outline:0;direction:rtl;unicode-bidi:plaintext;text-align:right;font-size:14px;line-height:20px}
.input input::placeholder{color:var(--color-text-disabled)}
.input.err,.select.err{border-color:var(--color-error-base);background:var(--color-error-bg)}
.err-msg{font-size:12px;line-height:20px;color:var(--color-error-text)}
.help{font-size:12px;line-height:20px;color:var(--color-text-secondary)}
.input .icb{border:0;background:transparent;padding:0;display:grid;place-items:center;color:var(--color-text-secondary)}

/* Cards */
.card{background:var(--color-bg-base);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);box-shadow:var(--shadow-card)}
.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.cards.five{grid-template-columns:repeat(5,minmax(0,1fr))}
.cat-card{padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.cat-top{display:flex;align-items:center;gap:8px}
.dot{width:12px;height:12px;border-radius:50%;flex:none}
.tone-brand{--tone:var(--color-chart-1)}.tone-gold{--tone:var(--color-chart-2)}.tone-goldlight{--tone:var(--color-chart-3)}.tone-neutral{--tone:var(--color-chart-4)}
.dot{background:var(--tone)}
.cat-val{display:flex;align-items:baseline;gap:6px;color:var(--color-text-primary)}
.cat-val .unit{font-size:14px;color:var(--color-text-secondary);font-weight:500}
.bar{height:8px;border-radius:4px;background:var(--color-bg-tint);overflow:hidden}
.bar>i{display:block;height:100%;background:var(--tone);border-radius:4px}
.bar-meta{display:flex;gap:6px;align-items:center}
.bar-meta b{color:var(--color-brand-default);font-weight:600}
.bar-meta span{color:var(--color-text-secondary)}
.sum-card{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.sum-card .lab{color:var(--color-text-secondary)}

/* Tables */
.table-card{padding:0;overflow:hidden}
.table-title{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.table-title h2{margin:0}
.table-title .count{color:var(--color-text-secondary)}
.scroll-x{overflow-x:auto;min-width:0;max-width:100%}.card,.table-card,.chart-card,.charts>*,.content>*{min-width:0}
table{width:100%;border-collapse:collapse;min-width:640px}
th,td{text-align:center;padding:12px;vertical-align:middle;white-space:nowrap}
th{background:var(--color-bg-tint);color:var(--color-text-primary);border-bottom:1px solid var(--color-border-subtle);font-weight:600;line-height:24px;height:56px;white-space:normal;min-width:84px}
td{height:48px;border-top:1px solid var(--color-border-subtle)}
tbody tr:nth-child(even) td{background:var(--color-bg-container)}
tr.total td{background:var(--color-bg-tint)!important;font-weight:600}
.vendors-table th{min-width:96px}
.vendors-table td:first-child,.vendors-table th:first-child{white-space:nowrap}
.pos{color:var(--color-success-text)}.neg{color:var(--color-error-text)}
.note{padding:12px 16px;border-radius:var(--radius-sm);display:flex;gap:12px;align-items:center;justify-content:space-between;border:1px solid var(--color-border-subtle);background:var(--color-bg-container);color:var(--color-text-secondary)}
.note.success{background:var(--color-success-bg);border-color:var(--color-success-border);color:var(--color-success-text)}
.note.error{background:var(--color-error-bg);border-color:var(--color-error-border);color:var(--color-error-text)}
.note.warning{background:var(--color-warning-bg);border-color:var(--color-warning-border);color:var(--color-text-primary)}
.source{color:var(--color-text-secondary);font-size:12px;line-height:20px}
.empty{padding:40px 24px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px;border-top:1px solid var(--color-border-subtle)}
.empty .t{font-weight:600}
.empty .s{color:var(--color-text-secondary)}

/* Modal */
.scrim{position:fixed;inset:0;background:rgba(46,42,27,.45);display:grid;place-items:center;z-index:50;padding:16px}
.modal{width:520px;max-width:100%;max-height:calc(100vh - 32px);display:flex;flex-direction:column;background:var(--color-bg-base);border-radius:var(--radius-md);box-shadow:var(--shadow-popover);overflow:hidden}
.modal-h{height:64px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--color-border-subtle);flex:none}
.modal-h h2{margin:0}
.modal-b{padding:24px;display:flex;flex-direction:column;gap:16px;overflow:auto}
.modal-f{height:72px;padding:0 24px;display:flex;align-items:center;gap:12px;border-top:1px solid var(--color-border-subtle);flex:none}
.kv{display:grid;grid-template-columns:140px 1fr;gap:8px 16px}
.kv dt{color:var(--color-text-secondary)}.kv dd{margin:0;font-weight:500}

/* Date picker */
.dp{position:absolute;z-index:40;top:calc(100% + 4px);inset-inline-start:0;background:var(--color-bg-elevated);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);box-shadow:var(--shadow-popover)}
.dp.single{width:288px;padding:12px}
.dp.range{width:782px;max-width:calc(100vw - 32px);display:flex;flex-direction:column}
.dp-body{display:flex;min-height:0}
.presets{width:220px;flex:none;padding:12px;border-inline-end:1px solid var(--color-border-subtle);display:flex;flex-direction:column;gap:0}
.radio{display:flex;align-items:center;gap:8px;height:28px;border:0;background:transparent;width:100%;text-align:start;padding:0 4px;border-radius:var(--radius-sm)}
.radio:hover{background:var(--color-bg-hover)}
.radio i{width:16px;height:16px;border-radius:50%;border:1px solid var(--color-border-default);flex:none;display:grid;place-items:center;background:var(--color-bg-base)}
.radio[aria-checked=true] i{border-color:var(--color-brand-default)}
.radio[aria-checked=true] i::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--color-brand-default)}
.cals{display:flex;gap:12px;padding:12px;flex:1;justify-content:center;flex-wrap:wrap}
/* chat ش10 (16 Nov): the calendars pick the period or its comparison — the toggle above them; the comparison fields light while picked */
.cals-wrap{flex:1;display:flex;flex-direction:column;min-width:0}.rp-mode{display:flex;gap:8px;justify-content:center;padding:12px 12px 0}.pcmp-fields .input.rp-on{border-color:var(--color-brand-default);box-shadow:0 0 0 2px rgba(0,86,66,.15)}
.cal{width:252px}
.cal-h{display:flex;align-items:center;justify-content:space-between;height:32px;margin-bottom:4px;font-weight:600}
.cal-grid{display:grid;grid-template-columns:repeat(7,32px);justify-content:space-between;row-gap:2px}
.dow{height:28px;display:grid;place-items:center;font-size:12px;color:var(--color-text-secondary)}
.day{width:32px;height:32px;border:0;background:transparent;border-radius:var(--radius-sm);display:grid;place-items:center;font-size:14px;position:relative}
.day:hover{background:var(--color-bg-hover)}
.day.outside{color:var(--color-text-disabled)}
.day.today{box-shadow:inset 0 0 0 1px var(--color-action-default)}
.day.inrange{background:var(--color-brand-subtle-bg);border-radius:0}
.day.sel{background:var(--color-brand-default);color:var(--color-text-on-brand);border-radius:var(--radius-sm)}
.day:disabled{color:var(--color-text-disabled);text-decoration:line-through;cursor:not-allowed}
.range-row{display:flex;gap:12px;padding:12px 16px;border-top:1px solid var(--color-border-subtle);align-items:center;flex-wrap:wrap}
.range-row .select{width:180px}.range-row .input{width:128px}
.dp-foot{display:flex;align-items:center;gap:12px;padding:12px 16px;border-top:1px solid var(--color-border-subtle)}
.dp-foot .tz{flex:1;color:var(--color-text-secondary);font-size:12px}
.check{display:inline-flex;align-items:center;gap:8px;opacity:.6}
.check i{width:16px;height:16px;border:1px solid var(--color-border-default);border-radius:3px;background:var(--color-bg-base)}
.check.on{opacity:1;cursor:pointer}.check.on input{width:16px;height:16px;margin:0;accent-color:var(--color-brand-default);cursor:pointer} /* the owner 13 Nov: the calendar's «مقارنة بفترة سابقة» works */

@media (max-width:1023px){.cards,.cards.five,#reports .cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:767px){
  .presets,.cal+.cal{display:none}.dp.range{position:fixed;inset-inline:16px;top:112px;width:auto;max-width:none;max-height:calc(100vh - 128px);overflow:auto}
  .range-row .select,.range-row .input{width:100%!important}.dp.single{max-width:calc(100vw - 32px)}
  .content{padding:16px}.topbar{padding:0 16px;gap:8px}.topbar .search{width:auto;flex:1;min-width:0;max-width:none;margin-inline-end:0}
  .cards,.cards.five,#reports .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (prefers-reduced-motion:no-preference){.menu,.dp{animation:pop .15s ease-out}@keyframes pop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}}

/* Notifications dropdown */
.notif-btn{position:relative}
.notif-badge{position:absolute;top:0;inset-inline-start:0;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--color-action-default);color:var(--color-text-on-action);font-size:10px;font-weight:700;line-height:16px;text-align:center}
/* Notifications panel: nav on the left, content on the right (Figma: Notifications panel 242:390) */
.menu.notif{left:0;inset-inline-start:auto;width:760px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - 72px);padding:0;min-width:0;display:flex;flex-direction:row;overflow:hidden}
.ntf-nav{width:176px;flex:none;display:flex;flex-direction:column;gap:4px;padding:8px;background:var(--color-bg-container);border-inline-start:1px solid var(--color-border-subtle)}
.ntf-nav .t-h5{color:var(--color-brand-default);padding:4px 8px 8px;margin:0}
.ntf-nav-item{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;border:0;border-radius:4px;background:transparent;color:var(--color-text-primary);font:inherit;text-align:start;width:100%;cursor:pointer}
.ntf-nav-item .lbl{flex:1}.ntf-nav-item:hover{background:var(--color-bg-hover)}
.ntf-nav-item[aria-current=true]{background:var(--color-bg-tint);color:var(--color-brand-default);font-weight:600}
.ntf-nav-item .cnt{min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--color-brand-default);color:var(--color-bg-base);font-size:11px;line-height:16px;text-align:center}
.ntf-nav-item .cnt.zero{background:var(--color-bg-tint);color:var(--color-text-secondary)}
.ntf-nav .foot{margin-top:auto;padding:8px;color:var(--color-text-secondary);font-size:12px;line-height:18px}
.ntf-main{flex:1;min-width:0;display:flex;flex-direction:column}
.ntf-head{display:flex;align-items:center;gap:8px;padding:12px 16px 8px}
.ntf-head .t-h5{margin:0}.ntf-head .cnt{color:var(--color-text-secondary);font-size:12px}.ntf-head .sp{flex:1}
.ntf-main .tabs{padding:0 16px}.ntf-main .tab{padding:8px 12px}
.ntf-list{flex:1;min-height:0;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:2px}
.ntf-item{display:flex;align-items:center;gap:12px;padding:8px 12px;border:0;border-radius:4px;background:transparent;font:inherit;text-align:start;width:100%;cursor:pointer;color:var(--color-text-primary)}
.ntf-item:hover,.ntf-item:focus-visible{background:var(--color-bg-hover);outline:0}
.ntf-item .av{width:32px;height:32px;border-radius:16px;flex:none;display:grid;place-items:center;background:var(--color-bg-container);color:var(--color-text-secondary)}
.ntf-item .av.warning{background:var(--color-warning-bg);color:var(--color-warning-text)}.ntf-item .av.error{background:var(--color-error-bg);color:var(--color-error-text)}.ntf-item .av.orange{background:var(--color-orange-bg);color:var(--color-orange-text)}
.ntf-item .txt{flex:1;min-width:0;display:flex;flex-direction:column}.ntf-item .txt b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ntf-item .txt small{color:var(--color-text-secondary);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ntf-item .meta{color:var(--color-text-secondary);font-size:12px;white-space:nowrap}.ntf-item .ext{color:var(--color-text-secondary)}
.ntf-foot{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-top:1px solid var(--color-border-subtle);color:var(--color-text-secondary);font-size:12px}
.ntf-empty{padding:24px 16px}
@media (max-width:1100px){.menu.notif{position:fixed;left:16px;right:16px;top:56px;width:auto;max-width:none}}
/* Vendor late orders modal */
.modal.wide{width:min(1040px, calc(100vw - 32px))}
.vlo-table{width:100%;border:1px solid var(--color-border-subtle);border-radius:4px;border-collapse:separate;border-spacing:0;overflow:hidden}
.vlo-table th{background:var(--color-bg-tint);border-bottom:1px solid var(--color-border-subtle);text-align:start;padding:0 12px;height:48px;font-size:12px;font-weight:600;color:var(--color-text-primary);white-space:nowrap}
.vlo-table td{padding:6px 12px;height:56px;border-top:1px solid var(--color-border-subtle);vertical-align:middle;white-space:nowrap}
.vlo-prod{display:flex;align-items:center;gap:8px}.vlo-prod .th{width:40px;height:40px;border-radius:4px;background:var(--color-bg-tint);display:grid;place-items:center;overflow:hidden;flex:none}.vlo-prod img{width:100%;height:100%;object-fit:cover}
.vlo-prod .tx{display:flex;flex-direction:column;min-width:0}.vlo-prod small{color:var(--color-text-secondary);font-size:12px;direction:ltr;text-align:end;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vlo-prod{min-width:0}
.vlo-link{display:inline-flex;align-items:center;gap:4px;border:0;background:none;font:inherit;font-weight:600;color:var(--color-brand-default);text-decoration:underline;cursor:pointer;padding:0}
.share-img{max-width:100%;border:1px solid var(--color-border-subtle);border-radius:4px}
@media (max-width:767px){.menu.notif{position:fixed;left:8px;right:8px;top:56px;width:auto;max-width:none;height:calc(100vh - 64px);max-height:calc(100vh - 64px);flex-direction:column}.ntf-nav{order:-1;width:auto;flex-direction:row;overflow-x:auto;border-inline-start:0;border-bottom:1px solid var(--color-border-subtle);padding:6px}.ntf-nav-item{width:auto;flex:1 0 auto;justify-content:center;padding:0 8px;gap:6px}.ntf-nav .t-h5,.ntf-nav .foot{display:none}.ntf-main .tabs{padding:0 8px}.ntf-item .meta{display:none}.ntf-head .btn{display:none}.modal.wide{width:100%}.vlo-table th,.vlo-table td{padding:6px 8px}}
.notif-title{margin:0;padding:12px 16px;border-bottom:1px solid var(--color-border-subtle);color:var(--color-brand-default)}
.notif-group{padding:8px 8px 4px;border-bottom:1px solid var(--color-border-subtle)}.notif-group:last-child{border-bottom:0}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:4px 8px}
.notif-head h3{margin:0;color:var(--color-text-primary)}
.notif-count{min-width:24px;padding:0 8px;border-radius:12px;background:var(--color-bg-container);font-size:12px;line-height:20px;text-align:center}
.notif-item{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;height:auto;padding:6px 8px;width:100%}
.notif-item small{color:var(--color-text-secondary);font-size:12px}
.notif-empty{margin:0;padding:4px 8px 8px;color:var(--color-text-secondary)}
@media (max-width:767px){.menu.notif{position:fixed;left:16px;right:16px;top:56px;width:auto;max-width:none}}

/* AI assistant */
.ai-btn{height:36px;display:inline-flex;align-items:center;gap:6px;padding:0 12px;border:0;border-radius:var(--radius-sm);background:var(--color-brand-default);color:var(--color-text-gold);font-weight:600;font-size:14px}
.ai-btn:hover{background:var(--color-brand-hover)}
.ai-btn[aria-expanded=true]{box-shadow:0 0 0 2px var(--color-action-default)}
.ai-panel{position:fixed;top:56px;left:24px;z-index:30;width:400px;max-width:calc(100vw - 32px);height:min(560px,calc(100vh - 72px));display:flex;flex-direction:column;background:var(--color-bg-base);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);box-shadow:var(--shadow-popover);overflow:hidden}
.ai-head{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--color-border-subtle);color:var(--color-brand-default)}
.ai-head h2{margin:0}.grow{flex:1}
.ai-list{flex:1;overflow:auto;padding:12px 16px;display:flex;flex-direction:column;gap:8px}
.ai-msg{max-width:92%;padding:8px 12px;border-radius:var(--radius-md);font-size:14px;line-height:22px}
.ai-msg.ai{background:var(--color-bg-container);align-self:flex-start}
.ai-msg.user{background:var(--color-brand-default);color:var(--color-text-on-brand);align-self:flex-end} /* owner 10 Nov (decision 43): my words green with beige text */
.ai-text{margin:0}
.ai-msg .kv{margin:8px 0;grid-template-columns:96px 1fr}
.ai-actions{display:flex;gap:8px}
.ai-forms{flex-wrap:wrap}.ai-form-link{display:inline-flex;align-items:center;gap:4px;color:var(--color-brand-default);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.ai-chips{display:flex;flex-wrap:wrap;gap:8px;padding:8px 16px;border-top:1px solid var(--color-border-subtle)}
.ai-form{display:flex;align-items:center;gap:8px;padding:8px 16px;border-top:1px solid var(--color-border-subtle)}
.ai-input{flex:1;min-width:0;height:36px;padding:0 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-base);font-size:14px;color:var(--color-text-primary)}
.ai-input:focus{border-color:var(--color-border-focus);outline:0}
.ai-send{width:36px;height:36px;color:var(--color-brand-default)}
.ai-note{margin:0;padding:0 16px 12px;color:var(--color-text-secondary)}
@media (max-width:767px){.ai-panel{left:16px;right:16px;width:auto;max-width:none;top:56px}.ai-btn span{display:none}.ai-btn{padding:0 10px}}

[hidden]{display:none!important}

/* Reports page */
.kpi{padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.kpi-label{color:var(--color-brand-default);font-weight:900}
.card.cat-card{border:2px solid var(--color-border-default)}.card.kpi{border:2px solid var(--color-brand-default)}.cat-top .t-h5{color:var(--color-brand-default);font-weight:900}
.kpi-val{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;color:var(--color-text-primary)}
.kpi-val .unit{color:var(--color-text-secondary)}
.kpi-delta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--color-text-secondary)}
.kpi-delta .pill{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;border:1px solid var(--color-border-subtle);background:var(--color-bg-container);color:var(--color-text-secondary);font-size:12px;line-height:18px;font-weight:600}
.kpi-positive .pill{background:var(--color-success-bg);border-color:var(--color-success-border);color:var(--color-success-text)}
.kpi-negative .pill{background:var(--color-error-bg);border-color:var(--color-error-border);color:var(--color-error-text)}
.kpi-note{color:var(--color-text-secondary)}
.chart-card{padding:16px;display:flex;flex-direction:column;gap:16px;min-width:0}
.chart-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.chart-head h2{margin:0;color:var(--color-brand-default)}
.chart-head .t-small,.chart-foot{color:var(--color-text-secondary)}
.chart-body{display:flex;flex-direction:column;gap:12px;min-width:0}
.bar-row{display:flex;align-items:center;gap:12px;min-width:0}
.bar-row .bar{flex:1;min-width:40px}
.bar-row-label{flex:0 1 160px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary)}
.bar-row-val{flex:0 1 auto;min-width:72px;text-align:left;color:var(--color-text-primary)}
.cols{display:flex;gap:16px;align-items:flex-end;justify-content:space-between;min-height:200px}
.cols .col{flex:1;display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0}
.cols .col i{display:block;width:64px;max-width:100%;border-radius:4px;background:var(--color-chart-3)}
.cols .col.hi i{background:var(--color-chart-1)}
.cols .col .t-small{color:var(--color-text-secondary);text-align:center}
.charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.fresh{display:flex;align-items:center;gap:8px;color:var(--color-text-secondary)}
.deliv-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.page-head .actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
@media (max-width:767px){.charts{grid-template-columns:1fr}.bar-row-label{flex:0 1 100px;min-width:0;overflow:hidden;text-overflow:ellipsis}.bar-row-val{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.cols .col i{width:40px}.cols{min-height:160px}}
.delay{display:inline-flex;align-items:center;gap:4px;padding:0 8px;height:22px;border-radius:4px;border:1px solid;font-size:12px;font-weight:600;line-height:20px;white-space:nowrap}
.delay-ok{background:var(--color-success-bg);border-color:var(--color-success-border);color:var(--color-success-text)}
.delay-risk{background:var(--color-orange-bg);border-color:var(--color-orange-border);color:var(--color-orange-text)}
.delay-late{background:var(--color-error-bg);border-color:var(--color-error-border);color:var(--color-error-text)}
.page-head.row{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.page-head .title-block{display:flex;flex-direction:column;gap:4px;min-width:0}
.bar-row-val{white-space:nowrap}
/* Record card (Figma 291:410 / 291:446): title row + label/value pairs, 2 per row on mobile, 4 on tablet */
.card-list,.kv-list{display:flex;flex-direction:column;gap:10px;padding:0 16px 16px}
.list-card{padding:10px 12px 12px;display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px 12px;border-color:var(--color-border-default);background:var(--color-bg-elevated);cursor:pointer}
.list-card .title{flex:1 1 100%;color:var(--color-brand-default);font-weight:600;padding-bottom:8px;border-bottom:1px solid var(--color-border-subtle);min-width:0}
.list-card .kv{display:flex;flex-direction:column;align-items:flex-start;gap:2px;flex:1 1 calc(25% - 9px);min-width:0}
.list-card .kv .t-small{color:var(--color-text-secondary)}.list-card .kv .t-body{min-width:0;overflow-wrap:anywhere}
@media (max-width:767px){.list-card .kv{flex:1 1 calc(50% - 6px)}}
@media (max-width:767px){#reports .cards{grid-template-columns:repeat(2,minmax(0,1fr))}.page-head .actions{width:100%}.page-head .actions .pop-anchor{width:100%}.page-head .actions .date-field{width:100%}.page-head .actions .btn{flex:1}.bar-row-val{flex-basis:auto;min-width:56px}}

/* Tickets (customer service) */
.textarea{width:100%;min-height:80px;padding:8px 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-base);font:inherit;color:var(--color-text-primary);resize:vertical;text-align:start}
.textarea:focus{outline:2px solid var(--color-border-focus);outline-offset:0;border-color:var(--color-border-focus)}
.textarea.err{border-color:var(--color-error-base)}
.textarea:disabled{background:var(--color-bg-container);color:var(--color-text-disabled)}
.avatar.sm{width:28px;height:28px;flex:none}
.tstatus{display:inline-flex;align-items:center;height:24px;padding:0 8px;border-radius:4px;border:1px solid;font-size:12px;font-weight:600;white-space:nowrap}
.ts-open{background:var(--color-brand-subtle-bg);border-color:var(--color-brand-default);color:var(--color-brand-default)}
.ts-in_progress{background:var(--color-bg-container);border-color:var(--color-action-default);color:var(--color-text-primary)}
.ts-waiting{background:var(--color-warning-bg);border-color:var(--color-warning-border);color:var(--color-warning-base)}
.ts-resolved{background:var(--color-success-bg);border-color:var(--color-success-border);color:var(--color-success-text)}
.ts-closed{background:var(--color-bg-container);border-color:var(--color-border-subtle);color:var(--color-text-secondary)}
.prio{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;white-space:nowrap}
.prio i{width:8px;height:8px;border-radius:50%;background:var(--color-chart-4)}
.prio-urgent{color:var(--color-error-text)}.prio-urgent i{background:var(--color-error-base)}
.prio-high{color:var(--color-orange-text)}.prio-high i{background:var(--color-orange-base)}
.prio-normal{color:var(--color-brand-default)}.prio-normal i{background:var(--color-brand-default)}
.prio-low{color:var(--color-text-secondary)}
.tl{display:flex;flex-direction:column;gap:12px}
.tl-msg{display:flex;gap:12px;align-items:flex-start}
.tl-msg .bubble{flex:1;min-width:0;background:var(--color-bg-base);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);padding:12px 16px;display:flex;flex-direction:column;gap:4px}
.tl-msg .head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.tl-msg .who{display:flex;align-items:center;gap:8px}
.tl-msg .role{padding:0 8px;border-radius:999px;background:var(--color-bg-container);color:var(--color-text-secondary);font-size:12px;line-height:20px}
.tl-msg .time,.tl-ev .time{color:var(--color-text-secondary)}
.tl-msg .txt{white-space:pre-wrap;overflow-wrap:anywhere}
.tl-ev{display:flex;gap:8px;align-items:center;justify-content:center;color:var(--color-text-secondary);text-align:center;flex-wrap:wrap}
.reply{border-top:1px solid var(--color-border-subtle);background:var(--color-bg-base);padding:12px 16px;display:flex;flex-direction:column;gap:8px;flex:none}
.reply .row{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.reply .hint{display:flex;align-items:center;gap:8px;color:var(--color-text-secondary)}
.drawer-scrim{place-items:stretch start;padding:0}
.drawer{width:720px;max-width:100%;height:100%;background:var(--color-bg-elevated);border-inline-start:1px solid var(--color-border-subtle);box-shadow:var(--shadow-popover);display:flex;flex-direction:column;overflow:hidden}
.drawer-h{padding:16px 24px;border-bottom:1px solid var(--color-border-subtle);background:var(--color-bg-base);display:flex;flex-direction:column;gap:8px;flex:none}
.drawer-h .row1{display:flex;justify-content:space-between;align-items:center;gap:8px}
.drawer-h .ids{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.drawer-h .chip{padding:0 8px;border-radius:999px;background:var(--color-bg-container);color:var(--color-text-secondary);font-size:12px;line-height:20px}
.drawer-h h2{margin:0;color:var(--color-brand-default)}
.drawer-h .meta{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;color:var(--color-text-secondary)}
.drawer-h .actions{display:flex;gap:8px;align-items:center}
.drawer-b{padding:16px 24px;display:flex;flex-direction:column;gap:16px;overflow:auto;flex:1;min-height:0}
.ctx-card{background:var(--color-bg-container);border-radius:var(--radius-md);padding:12px 16px;display:flex;flex-direction:column;gap:4px}
.ctx-card .head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.ctx-card .links{display:flex;gap:4px;flex-wrap:wrap}
.ctx-card .facts{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;color:var(--color-text-secondary)}
.row.cols2{display:flex;gap:16px}.row.cols2>*{flex:1;min-width:0}
.tickets-table tr[data-id]{cursor:pointer}
.tickets-table td.ttl{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pager{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-top:1px solid var(--color-border-subtle);color:var(--color-text-secondary)}
.pager .pages{display:flex;gap:4px}
@media (max-width:767px){.drawer{width:100%}.row.cols2{flex-direction:column}.reply .hint span{display:none}}

/* Vendors (المبتكرين) */
.vlogo{display:inline-grid;place-items:center;background:var(--color-bg-container);border:1px solid var(--color-border-subtle);border-radius:var(--radius-sm);color:var(--color-brand-default);font-weight:600;flex:none}
.vlogo-sm{width:32px;height:32px;font-size:14px}.vlogo-md{width:48px;height:48px;font-size:18px}.vlogo-lg{width:96px;height:96px;font-size:32px}
.vstatus{display:inline-flex;align-items:center;height:24px;padding:0 8px;border-radius:4px;border:1px solid;font-size:12px;font-weight:600;white-space:nowrap}
.vs-active{background:var(--color-success-bg);border-color:var(--color-success-border);color:var(--color-success-text)}
.vs-inactive{background:var(--color-bg-container);border-color:var(--color-border-subtle);color:var(--color-text-secondary)}
.vsection{background:var(--color-bg-base);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);padding:12px 16px;display:flex;flex-direction:column;gap:4px}
.vsection .head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.vsection .head h3{margin:0;color:var(--color-brand-default)}
.info-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:4px 0;border-bottom:1px solid var(--color-border-subtle);min-height:36px}
.info-row:last-child{border-bottom:0}
.info-row .lab{color:var(--color-text-secondary);flex:none}
.info-row .val{display:flex;align-items:center;gap:4px;min-width:0;text-align:start;overflow-wrap:anywhere}
.secure{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:4px 12px;background:var(--color-bg-container);border-radius:var(--radius-sm);min-height:44px;margin:4px 0}
.secure .lab{color:var(--color-text-secondary)}
.secure .val{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.contract{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);background:var(--color-bg-base)}
.contract .txt{flex:1;min-width:0}.contract .txt .t-small{color:var(--color-text-secondary)}
.contract .acts{display:flex;gap:4px;flex-wrap:wrap}
.contract-missing{background:var(--color-warning-bg);border-color:var(--color-warning-border)}
.contract-expiring,.contract-expired{background:var(--color-orange-bg);border-color:var(--color-orange-border)}
.contract-expired{background:var(--color-error-bg);border-color:var(--color-error-border)}
.vendor-cell{display:flex;align-items:center;gap:8px}
.vendor-cell .vnames{display:flex;flex-direction:column;gap:2px;min-width:0}.brand-line{color:var(--color-text-secondary)}
/* brands (phase 3.2) — the prototype's rules; RTL as the rest of the page */
.brand-cell{display:flex;flex-direction:column;gap:2px}.brand-cell b{font-weight:600}
.brands-table{width:100%;min-width:0;table-layout:auto}.brands-table td,.brands-table th{vertical-align:middle;white-space:normal;padding:8px}.brands-table th:nth-child(2),.brands-table td:nth-child(2){white-space:nowrap}.brands-table td:last-child{width:40px}
.vdrawer-id{display:flex;align-items:center;gap:12px}
.vdrawer-id .names{display:flex;flex-direction:column;gap:2px}
.vdrawer-id .name-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.vdrawer-id .name-row h2{margin:0;color:var(--color-brand-default)}
.vdrawer-id .t-small{color:var(--color-text-secondary)}
.drawer .tabs{margin-top:4px}
.mini-table td,.mini-table th{padding:8px 12px}
@media (max-width:767px){.info-row{flex-direction:column;align-items:flex-end;gap:2px}.secure{flex-direction:column;align-items:flex-end}.contract{flex-wrap:wrap}}

/* touch-first (<=760): targets >= 44px, sticky modal footer */
@media (max-width:767px){
  .btn,.icon-btn,.select,.input,.tab,.nav-item,.opt,.ntf-nav-item,.ntf-item,.chip{min-height:44px}.icon-btn{width:44px;height:44px}
  .modal{width:100%;max-height:100vh;border-radius:0}.scrim{padding:0;align-items:stretch}.modal-f{position:sticky;bottom:0;background:var(--color-bg-base)}.modal-f .btn{flex:1}
  .drawer .drawer-f{position:sticky;bottom:0;background:var(--color-bg-base)}
}

/* ===== Responsive scale (owner rule): shrink fonts, controls and spacing per breakpoint instead of hiding ===== */
@media (max-width:1300px){
  body{font-size:13px;line-height:20px}
  .t-h3{font-size:20px;line-height:30px}.t-h4{font-size:17px;line-height:26px}.t-h5{font-size:14px;line-height:22px}.t-body{font-size:13px;line-height:20px}.t-small{font-size:11px;line-height:16px}
  .btn{height:32px;padding:0 12px;font-size:13px;gap:6px}.icon-btn{width:30px;height:30px}.select,.input,.textarea{min-height:32px;font-size:13px}.tab{padding:8px 12px}
  .content{padding:16px;gap:16px}.card{padding:12px}.cards{gap:12px}.charts{gap:16px}.page-head{margin-bottom:12px}.modal-b{padding:16px}.modal-h,.modal-f{padding:12px 16px}
  .ntf-item{padding:6px 10px;gap:8px}.ntf-nav-item{height:36px}
}
@media (max-width:1023px){
  .content{padding:12px;gap:12px}.cards{gap:8px}.card{padding:10px}.t-h3{font-size:18px;line-height:28px}.t-h4{font-size:16px;line-height:24px}
}
@media (max-width:767px){
  body{font-size:13px}.btn{font-size:13px;padding:0 12px}.content{padding:12px;gap:12px}
}

/* ===== Shell: nav rail (768–1023) and bottom nav (<=767) — Figma: Nav rail 266:671, Bottom nav 266:478 ===== */
.brand .mark{display:none;width:32px;height:32px;border-radius:8px;background:var(--color-action-default);color:var(--color-text-on-action);font-weight:700;place-items:center}
.bottom-nav{display:none}
@media (max-width:1023px){
  .app{grid-template-columns:80px 1fr}
  .sidebar{padding:12px 4px;align-items:center;gap:4px}
  .brand{justify-content:center;padding:4px;margin-bottom:8px}.brand .mark{display:grid}.brand .brand-txt{display:none}
  .nav-item{flex-direction:column;justify-content:center;gap:4px;height:56px;padding:6px 2px;font-size:11px;line-height:16px;font-weight:500;text-align:center;border-radius:var(--radius-md);white-space:nowrap}
  .nav-item .ic{width:20px;height:20px}
  .topbar{padding:0 16px;gap:8px}.topbar .search{max-width:none;flex:1}
  .tabs{flex-wrap:wrap;overflow:visible}
  .page-head.row .actions{width:100%}
  .charts{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
}
@media (max-width:767px){
  .app{grid-template-columns:1fr}.sidebar{display:none}
  .main{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}
  .bottom-nav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:6;height:calc(64px + env(safe-area-inset-bottom,0px));padding:4px 4px env(safe-area-inset-bottom,0px);background:var(--color-bg-base);border-top:1px solid var(--color-border-subtle);box-shadow:0 -4px 16px rgba(46,42,27,.08)}
  .bn-item{flex:1 1 0;min-width:0;height:56px;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--color-text-secondary);padding:0;border-radius:var(--radius-md)}
  .bn-item .pill{width:48px;height:28px;border-radius:14px;display:grid;place-items:center}
  .bn-item .bn-lbl{font-size:12px;line-height:18px;font-weight:500;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .bn-item[aria-current=page]{color:var(--color-brand-default)}.bn-item[aria-current=page] .pill{background:var(--color-brand-subtle-bg)}.bn-item[aria-current=page] .bn-lbl{font-weight:600}
  .bn-more{display:flex;flex:1 1 0;min-width:0}.bn-more .bn-item{width:100%}
  .menu.bn-sheet{position:fixed;left:0;right:0;bottom:calc(64px + env(safe-area-inset-bottom,0px));top:auto;width:auto;max-width:none;border-radius:12px 12px 0 0;padding:8px;max-height:70vh;overflow:auto;display:flex;flex-direction:column;gap:2px}
  .bn-sheet-h{padding:8px 12px;color:var(--color-text-secondary)}
  .bn-opt{display:flex;align-items:center;gap:12px;min-height:48px;padding:0 12px;border:0;background:transparent;border-radius:var(--radius-sm);width:100%;text-align:start}
  .bn-opt[aria-current=page]{background:var(--color-brand-subtle-bg);color:var(--color-brand-default);font-weight:600}.bn-opt[aria-disabled=true]{opacity:.55}.bn-opt small{margin-inline-start:auto;color:var(--color-text-secondary);font-size:12px}
  .topbar .user .t-label{max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .page-head.row{flex-direction:column;align-items:stretch}
}
/* ===== Tables -> Record cards (<=1023) — Figma: Record card / Mobile 291:410 (2 pairs per row), Record card / Tablet 291:446 (4 per row) ===== */
@media (max-width:1023px){
  .scroll-x table,.vlo-table{min-width:0;display:block;border:0;width:100%}
  .scroll-x thead,.vlo-table thead{display:none}
  .scroll-x tbody,.scroll-x tfoot,.vlo-table tbody{display:block}
  .scroll-x tr,.vlo-table tr{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-md);padding:10px 12px 12px;margin:0 0 10px;background:var(--color-bg-elevated)}
  .scroll-x tbody tr:nth-child(even),.vlo-table tr:nth-child(even){background:var(--color-bg-elevated)}.scroll-x tbody tr:nth-child(even) td,.vlo-table tr:nth-child(even) td{background:transparent}
  .scroll-x td,.vlo-table td{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:0;height:auto;border:0;white-space:normal;text-align:start;flex:1 1 calc(25% - 9px);min-width:0;line-height:20px}
  .scroll-x td[data-l]:not([data-l=""])::before,.vlo-table td[data-l]:not([data-l=""])::before{content:attr(data-l);font-size:12px;line-height:18px;color:var(--color-text-secondary);font-weight:400}
  .scroll-x td:first-child,.vlo-table td:first-child{order:-2;flex:1 1 0;font-weight:600;color:var(--color-brand-default)}
  .scroll-x td:first-child::before,.vlo-table td:first-child::before{display:none}
  .scroll-x td[data-l=""]:not(:first-child),.vlo-table td[data-l=""]:not(:first-child){order:-1;flex:0 0 auto}
  .scroll-x tr.total td,.scroll-x tfoot tr{background:var(--color-bg-tint)}.scroll-x tfoot tr td{font-weight:600}
  .scroll-x tr.total td:first-child,.scroll-x tfoot tr td:first-child{color:var(--color-text-primary)}
  .tickets-table td.ttl{max-width:none;white-space:normal}
  .pager{flex-wrap:wrap;gap:8px}
}
@media (max-width:767px){
  .scroll-x td,.vlo-table td{flex:1 1 calc(50% - 6px)}
  .scroll-x td:first-child,.vlo-table td:first-child{flex:1 1 0}.scroll-x td[data-l=""]:not(:first-child),.vlo-table td[data-l=""]:not(:first-child){flex:0 0 auto}
}

/* Chart card bars on tablet/mobile (Figma Bar row 291:394): label + value on one line, bar underneath */
@media (max-width:1023px){
  .bar-row{flex-wrap:wrap;gap:4px 8px}.bar-row-label{flex:1 1 0;order:0;white-space:normal}.bar-row-val{order:1;flex:0 1 auto;min-width:0;max-width:60%;text-align:left;white-space:normal;overflow-wrap:anywhere}.bar-row .bar{order:2;flex:1 1 100%;min-width:0}
}

.dep-neg{color:var(--color-error-text)}.bal-neg{color:var(--color-error-text);font-weight:600}
/* vendor drawer — clickable KPI tiles open a popup with their orders (21 Oct) */
.kpi-click{cursor:pointer;transition:border-color .15s}
.kpi-click:hover{border-color:var(--color-brand-hover);box-shadow:0 0 0 1px var(--color-brand-hover)}
.kpi-click:focus-visible{outline:2px solid var(--color-brand-default);outline-offset:2px}
.kpi-more{display:inline-flex;align-items:center;gap:4px;color:var(--color-link-default, var(--color-brand-default));font-weight:600;margin-top:auto}
.delay-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
.delay-cards .kpi-note,.delay-cards .t-small{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
@media (max-width:599px){.delay-cards{grid-template-columns:minmax(0,1fr)}}
@media (prefers-reduced-motion:reduce){.kpi-click{transition:none}}
.modal[data-vorders] .vlo-table th,.modal[data-vorders] .vlo-table td{padding-inline:8px}
.modal[data-vorders] .vlo-table td[data-l="العميل"]{white-space:normal;min-width:110px}
/* KPI «التفاصيل» + details popup + share (22 Oct) */
.modal-h-actions{display:flex;align-items:center;gap:4px}
.kpi-details{background:none;border:0;padding:0;cursor:pointer;font:inherit;align-self:flex-start;min-height:24px}
.kpi-details:hover{text-decoration:underline}
.kpi-details:focus-visible{outline:2px solid var(--color-brand-default);outline-offset:2px;border-radius:2px}
.dt-sum{display:flex;flex-wrap:wrap;gap:8px}
.dt-chip{display:flex;flex-direction:column;gap:2px;padding:8px 12px;background:var(--color-bg-container);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);min-width:120px}
.dt-chip .t-small{color:var(--color-text-secondary)}
.dt-chip b{font-weight:700;color:var(--color-text-primary)}
.dt-click{cursor:pointer}
.dt-click:hover td{background:var(--color-bg-hover)}
.dt-click:focus-visible{outline:2px solid var(--color-brand-default);outline-offset:-2px}
.dt-table td{white-space:normal}.dt-table td.nw{white-space:nowrap}
.share-menu{min-width:220px}
.modal.mid{width:min(720px, calc(100vw - 32px))}
.dt-table th{white-space:normal}
/* Table → card on tablet/mobile (fix 22 Oct): grid card — first column is the card title on its own line,
   the other columns are label/value pairs in even columns; a row-actions cell sits beside the title. */
@media (max-width:1023px){
  .scroll-x tbody tr,.scroll-x tfoot tr,.vlo-table tbody tr{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr));gap:10px 16px;align-items:start}
  .scroll-x td,.vlo-table td{flex:none;width:auto}
  .scroll-x td:first-child,.vlo-table td:first-child{grid-column:1/-1;flex:none;font-size:14px;line-height:22px;padding-bottom:8px;border-bottom:1px solid var(--color-border-subtle)}
  .scroll-x tr:has(> td[data-l=""]:not(:first-child)) > td:first-child,.vlo-table tr:has(> td[data-l=""]:not(:first-child)) > td:first-child{grid-column:1/-2;grid-row:1}
  .scroll-x td[data-l=""]:not(:first-child),.vlo-table td[data-l=""]:not(:first-child){grid-column:-2/-1;grid-row:1;justify-self:end;align-self:start;flex:none}
  .scroll-x td > *,.vlo-table td > *{max-width:100%}
  .scroll-x td[data-l]::before,.vlo-table td[data-l]::before{white-space:normal}
}
@media (max-width:767px){
  .scroll-x tbody tr,.scroll-x tfoot tr,.vlo-table tbody tr{grid-template-columns:repeat(2,minmax(0,1fr))}
  .scroll-x td,.vlo-table td{flex:none}
}
.dt-table tr.dt-total td{background:var(--color-bg-tint);font-weight:700;color:var(--color-text-primary)}
@media (max-width:1023px){.vlo-table tbody tr.dt-total{background:var(--color-bg-tint)}.vlo-table tbody tr.dt-total td:first-child{color:var(--color-text-primary)}}
@media (max-width:1023px){.vlo-table td.dt-empty{display:none}}
@media (min-width:1024px){.dt-table th,.dt-table td{text-align:center}}
@media (max-width:1023px){.dt-table td,.dt-table td.nw{white-space:normal;min-width:0;overflow-wrap:anywhere}.vlo-table td{overflow-wrap:anywhere}}
/* mixed Arabic + numbers: RTL order, numbers isolated LTR (22 Oct) */
.num-ar{unicode-bidi:isolate}
.num-ar .n,.n{direction:ltr;unicode-bidi:isolate;display:inline-block}
/* owner rule (22 Oct): typed text is always right-aligned — Arabic, English, numbers, SKU, phone, email */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),textarea,select,.textarea,.ai-input{text-align:right;unicode-bidi:plaintext}
input::placeholder,textarea::placeholder{text-align:right}
/* vendors page «فلتر» panel + chips (22 Oct) */
.vfilter-pop{width:min(420px,calc(100vw - 32px));padding:0;display:flex;flex-direction:column;max-height:min(640px,calc(100vh - 120px));inset-inline-end:0;inset-inline-start:auto}
.vfilter-pop .vf-h{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--color-border-subtle)}
.vfilter-pop .vf-b{padding:16px;display:flex;flex-direction:column;gap:16px;overflow:auto}
.vfilter-pop .vf-f{display:flex;gap:8px;padding:12px 16px;border-top:1px solid var(--color-border-subtle)}
.vfilter-pop .chips{display:flex;flex-wrap:wrap;gap:8px}
.vfilter-pop .vf-b .radios{display:flex;flex-direction:row;flex-wrap:wrap;gap:4px 20px}
.fcount{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--color-brand-default);color:var(--color-text-on-brand);font-size:12px;line-height:20px;text-align:center}
.fchips{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.fchip{background:var(--color-bg-tint)}
@media (max-width:767px){.vfilter-pop{position:fixed;inset:auto 0 0 0;width:100%;max-height:85vh;border-radius:12px 12px 0 0}.vtoolbar .input{width:100%!important}}
.vfilter-pop .vf-b .radios .radio{width:auto;flex:0 0 auto}
/* odd tile count in a 2-column card grid: the last tile spans the row (v50) */
@media (max-width:1023px){.cards.five>:last-child:nth-child(odd){grid-column:1/-1}}

/* vendor report popup (v53) */
.vr-prod{display:inline-flex;align-items:center;gap:8px;min-width:0}.vr-prod .thumb{width:36px;height:36px;border-radius:var(--radius-sm);background:var(--color-bg-tint);display:grid;place-items:center;overflow:hidden;flex:none;color:var(--color-brand-default)}.vr-prod .thumb img{width:100%;height:100%;object-fit:cover;display:block}
.vr-oid small{color:var(--color-text-secondary)}
.vname-cell{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-width:0}.vname-cell>span{min-width:0;overflow-wrap:anywhere}.vname-cell .btn{flex:none}
.unconf{color:var(--color-error-base);font-weight:600}
/* v60 (owner 22 Oct): the page tab bar is always pinned right under the top bar, at every breakpoint.
   ::before paints the page background across the content gutter so scrolled content never shows beside the bar. */
.content{--gut:24px}
@media (max-width:1300px){.content{--gut:16px}}
@media (max-width:1023px){.content{--gut:12px}}
.content > .tabs{position:sticky;top:48px;z-index:4;background:var(--color-bg-layout)}
.content > .tabs::before{content:'';position:absolute;inset:calc(-1 * var(--gut)) calc(-1 * var(--gut)) 0;background:var(--color-bg-layout);z-index:-1;pointer-events:none}
.select:disabled{background:var(--color-bg-container);color:var(--color-text-disabled);cursor:not-allowed}
.cb-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;padding:12px;border:1px solid var(--color-border-default);border-radius:var(--radius-md)}
@media (max-width:767px){.cb-group{grid-template-columns:minmax(0,1fr)}.cb-group .cb{min-height:44px}}
.field.has-err .cb-group{border-color:var(--color-status-error-base)}
/* owner 22 Oct: the ⋮ (more) menu button is always brand green, in every state, everywhere */
.ic.ic-more,button .ic.ic-more,button:hover .ic.ic-more,button:disabled .ic.ic-more{color:var(--color-brand-default);stroke:var(--color-brand-default)}
/* owner 22 Oct: custom task report — alert sources grouped by section */
.dg-src{display:flex;flex-direction:column;gap:12px}
.dg-sec{display:flex;flex-direction:column;gap:6px}
.dg-sec > b{color:var(--color-brand-default)}
.cb-group.days{grid-template-columns:repeat(7,minmax(0,1fr))}
.cb-group.days .cb:last-child{grid-column:1 / -1}
@media (max-width:767px){.cb-group.days{grid-template-columns:repeat(4,minmax(0,1fr))}.cb-group.days .cb{min-height:44px}}
/* owner 22 Oct: alerts by role */
.ntf-viewer{padding:0 0 8px;border-bottom:1px solid var(--color-border-subtle);margin-bottom:4px}
.ntf-viewer .field label{font-size:12px;color:var(--color-text-secondary)}
.ntf-item.muted{opacity:.72}
.ntf-fyi{display:inline-block;margin-inline-start:8px;padding:0 6px;border-radius:4px;background:var(--color-bg-container);color:var(--color-text-secondary);font-size:11px;font-weight:500;vertical-align:middle}
.fyi-c{color:var(--color-text-secondary)}
.ma-list{display:flex;flex-direction:column;gap:4px;max-height:60vh;overflow:auto}
.ma-row{display:grid;grid-template-columns:minmax(0,1fr) 220px;align-items:center;gap:12px;padding:6px 0;border-bottom:1px solid var(--color-border-subtle)}
.ma-row .field{margin:0}
@media (max-width:767px){.ma-row{grid-template-columns:1fr}}
.rd-block{display:flex;flex-direction:column;gap:8px;margin-top:16px}
.ntf-main > .ntf-viewer{display:flex;align-items:center;gap:8px;padding:8px 16px;margin:0;border-bottom:1px solid var(--color-border-subtle)}
.ntf-main > .ntf-viewer .field{flex:1;display:flex;align-items:center;gap:8px;margin:0}
.ntf-main > .ntf-viewer .field label{white-space:nowrap;margin:0}
.ntf-main > .ntf-viewer .pop-anchor{flex:1}
.menu.notif .ntf-main > .ntf-viewer .field{flex-direction:row;align-items:center;justify-content:flex-start;text-align:start;width:100%}
.menu.notif .ntf-main > .ntf-viewer .select{width:100%}
/* owner 22 Oct: export / import */
.dx-grid{display:flex;flex-direction:column;gap:12px}
.cb-group.dx-cols{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:767px){.cb-group.dx-cols{grid-template-columns:minmax(0,1fr)}}
.dx-prev{display:flex;flex-direction:column;gap:8px}
.dx-table td,.dx-table th{white-space:nowrap}
.dx-text{width:100%;font-family:ui-monospace,Menlo,monospace;font-size:12px;resize:vertical}
.dx-out{display:flex;flex-direction:column;gap:6px}
.dx-acts{align-self:end}
.dx-map .field{margin:0;min-width:200px}
.dx-rev tr.dx-err td{background:var(--color-error-bg)}
.dx-errs{display:flex;flex-direction:column;gap:2px;color:var(--color-error-text);font-size:12px}
/* owner 22 Oct: role popup */
.list-chip.role-chip{font:inherit;color:var(--color-text-primary);cursor:pointer;min-height:36px;padding:4px 12px;gap:4px}
.list-chip.role-chip:hover{border-color:var(--color-action-default);background:var(--color-bg-hover)}
.list-chip.role-chip:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:2px}
.rp-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rp-list{display:flex;flex-direction:column;gap:16px}
.rp-group{display:flex;flex-direction:column}
.rp-group>.t-label{color:var(--color-brand-default);padding-bottom:4px;border-bottom:1px solid var(--color-border-default)}
.ma-row.sens>span:first-child{display:inline-flex;align-items:center;gap:4px;color:var(--color-error-text)}
.rp-members{display:flex;flex-wrap:wrap;gap:12px}
.rp-del{order:3;margin-inline-start:auto}
@media (max-width:767px){.list-chip.role-chip{min-height:44px}.rp-del{order:0;margin:0;flex-basis:100%}.rp-del .btn{width:100%}.modal-f:has(.rp-del){flex-wrap:wrap;height:auto;padding-block:12px}}
.input.is-disabled{background:var(--color-bg-container);color:var(--color-text-disabled)}
.input.is-disabled input{cursor:not-allowed;color:var(--color-text-secondary)}
.input.is-disabled{background:var(--color-bg-container)}
.input.is-disabled input{cursor:not-allowed;color:var(--color-text-secondary)}
.rp-move{display:flex;flex-direction:column;gap:12px}
/* owner 22 Oct: one slim brand scrollbar everywhere; tab rows scroll with no bar */
::-webkit-scrollbar{width:8px;height:8px;background:transparent}
::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background:transparent}
::-webkit-scrollbar-thumb{background:var(--color-border-default,#C9BFAE);border-radius:999px;border:2px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-thumb:hover{background-color:var(--color-action-default,#C39E57)}
::-webkit-scrollbar-button{display:none;width:0;height:0}
@supports not selector(::-webkit-scrollbar){*{scrollbar-width:thin;scrollbar-color:var(--color-border-default,#C9BFAE) transparent}}
.tabs,.subtabs,.ntf-nav,.set-nav,.chips,[role=tablist]{scrollbar-width:none}
.tabs::-webkit-scrollbar,.subtabs::-webkit-scrollbar,.ntf-nav::-webkit-scrollbar,.set-nav::-webkit-scrollbar,.chips::-webkit-scrollbar,[role=tablist]::-webkit-scrollbar{display:none}
/* owner 22 Oct: dashboard (Figma 526:35690) */
.dash-head{align-items:flex-start;gap:16px;flex-wrap:wrap}
.dash-head .actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dash-hi{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin:4px 0 0;color:var(--color-text-secondary)}
.dash-period{display:flex;align-items:center;gap:6px}
.dash-viewas{min-width:220px}
.dash-viewing{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-md,8px);background:var(--color-bg-tint);margin-bottom:16px}
.dash-viewing span{flex:1}
.dash-kpis{display:grid;grid-template-columns:repeat(var(--n,5),minmax(0,1fr));gap:16px;margin-bottom:16px}
.dash-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}
.dash-card{grid-column:span var(--span,6);display:flex;flex-direction:column;gap:12px;min-width:0}
.dash-h{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap}
.dash-h h2{margin:0;color:var(--color-brand-default)}
.dash-h .t-small{color:var(--color-text-secondary)}
.dash-b{flex:1;min-width:0}
.dash-f{color:var(--color-text-secondary)}
.dash-link{display:inline-flex;align-items:center;gap:4px;border:0;background:none;padding:2px 0;font:inherit;font-size:12px;color:var(--color-brand-default);cursor:pointer;min-height:24px}
.dash-link:hover{text-decoration:underline}
.dash-link:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:2px;border-radius:4px}
.dash-shift{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:var(--radius-md,8px);background:var(--color-bg-tint);margin-bottom:12px}
.dash-shift>span{flex:1}
.dash-tasks{display:flex;flex-direction:column;gap:8px}
.dash-need{display:flex;flex-direction:column}
.dn-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 4px;border:0;border-bottom:1px solid var(--color-border-subtle);background:none;font:inherit;color:inherit;text-align:right;cursor:pointer;min-height:44px}
.dn-item:last-child{border-bottom:0}
.dn-item:hover{background:var(--color-bg-hover)}
.dn-item:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:-2px}
.dn-ic{display:inline-flex;width:28px;height:28px;border-radius:999px;align-items:center;justify-content:center;background:var(--color-bg-tint);color:var(--color-text-secondary)}
.dn-item.tone-error .dn-ic{background:var(--color-error-bg);color:var(--color-error-text)}
.dn-item.tone-orange .dn-ic,.dn-item.tone-warning .dn-ic{background:var(--color-warning-bg);color:var(--color-orange-text,var(--color-warning-text))}
.dn-txt{display:flex;flex-direction:column;min-width:0}
.dn-txt b{font-weight:600;overflow:hidden;text-overflow:ellipsis}
.dn-txt small,.dn-sec{color:var(--color-text-secondary)}
.dash-bars{display:flex;flex-direction:column;gap:4px}
.dash-barbtn{display:block;width:100%;border:0;background:none;padding:2px 0;font:inherit;color:inherit;text-align:right;cursor:pointer;border-radius:4px}
.dash-barbtn:hover{background:var(--color-bg-hover)}
.dash-barbtn:focus-visible{outline:2px solid var(--color-border-focus)}
.dash-team{display:flex;flex-direction:column;gap:8px}
.dt-row{display:flex;align-items:center;gap:8px}
.dt-name{flex:1;display:flex;flex-direction:column;min-width:0}
.dt-name small{color:var(--color-text-secondary)}
.dash-act{display:flex;flex-direction:column;gap:10px}
.da-row{display:flex;flex-direction:column}
.da-row small{color:var(--color-text-secondary)}
.dash-src{color:var(--color-text-secondary);margin:16px 0 0}
.dash-cust{display:flex;flex-direction:column}
.dc-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:6px 0;border-bottom:1px solid var(--color-border-subtle)}
.dc-row .sw-row{gap:0}.dc-row .sw-txt{display:none}
.dc-l{display:flex;flex-direction:column}
.dc-ord{display:flex;gap:2px}
.sk{background:linear-gradient(90deg,var(--color-bg-container),var(--color-bg-tint),var(--color-bg-container));background-size:200% 100%;animation:sk 1.2s linear infinite}
.sk-kpi{height:150px}.sk-card{height:280px;grid-column:span 6}
@keyframes sk{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.sk{animation:none}}
@media (max-width:1279px){.dash-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:1023px){.dash-grid{grid-template-columns:1fr}.dash-card,.sk-card{grid-column:1/-1}.dash-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
.dash-kv{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 24px;margin:0}
.dkv{display:flex;flex-direction:column;gap:2px;min-width:0}
.dkv dt{color:var(--color-text-secondary)}
.dkv dd{margin:0;font-weight:600;color:var(--color-text-primary)}
.dkv.neg dd{color:var(--color-error-text)}
.dkv.warn dd{color:var(--color-orange-text,var(--color-warning-text))}
.dash-name{border:0;background:none;padding:0;font:inherit;font-weight:600;color:var(--color-brand-default);cursor:pointer;text-align:right;min-height:24px}
.dash-name:hover{text-decoration:underline}
.dash-name:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:2px;border-radius:4px}
.dn-item.tone-ok .dn-ic{background:var(--color-success-bg);color:var(--color-success-text)}
.dash-vend{display:flex;flex-direction:column;gap:12px}
/* owner 22 Oct: import modes + sheet templates */
.dx-imp{align-items:start}
.dx-mode{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dx-tplline{display:flex;align-items:center;gap:4px;color:var(--color-text-secondary)}
.dx-sheetpick{display:flex;align-items:flex-end;gap:8px}
.dx-chg{display:flex;flex-direction:column;gap:2px}
/* owner 22 Oct: «الإجراءات» menu opened from the orders page (shadow root) */
.menu.float-menu{position:fixed;z-index:1200;min-width:240px;right:auto}

/* New modules (HR, inventory, settings, profile, login, shell) — tokens only, same names as Figma variables */
/* Logo (Figma Logo set 407:55180) */
.logo{display:block;max-width:100%;height:auto}
.logo-reversed .m{fill:var(--color-bg-layout)}.logo-reversed .g{fill:var(--color-text-gold)}
.logo-color .m{fill:var(--color-brand-default)}.logo-color .g{fill:var(--color-action-default)}
.sidebar .brand{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:8px 8px 4px;text-decoration:none}
.sidebar .brand .logo{width:150px}
.sidebar .brand .tagline{color:var(--color-text-gold);font-size:12px;line-height:18px;font-weight:600;letter-spacing:0;opacity:1}

/* Tag/Tone (Figma 360:2518) */
.tg{display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 8px;border-radius:var(--radius-sm);border:1px solid var(--color-border-subtle);background:var(--color-bg-container);color:var(--color-text-secondary);font-size:12px;line-height:20px;font-weight:600;white-space:nowrap;vertical-align:middle}
.tg .ic{width:14px;height:14px}
.tg-success{background:var(--color-success-bg);border-color:var(--color-success-border);color:var(--color-success-text)}
.tg-brand{background:var(--color-brand-subtle-bg);border-color:var(--color-brand-default);color:var(--color-brand-default)}
.tg-info{background:var(--color-brand-subtle-bg);border-color:var(--color-border-subtle);color:var(--color-brand-default)}
.tg-gold{background:var(--color-bg-tint);border-color:var(--color-chart-2);color:var(--color-text-primary)}
.tg-orange{background:var(--color-orange-bg);border-color:var(--color-orange-border);color:var(--color-orange-text)}
.tg-error{background:var(--color-error-bg);border-color:var(--color-error-border);color:var(--color-error-text)}
.tg-neutral{background:var(--color-bg-container);border-color:var(--color-border-subtle);color:var(--color-text-secondary)}

.content.mod{display:flex;flex-direction:column;gap:16px}
.panel{display:flex;flex-direction:column;gap:16px;min-width:0}
.sec{padding:0;overflow:hidden}
.sec-h{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--color-border-subtle)}
.sec-h h2{margin:0;color:var(--color-brand-default)}.sec-h .sub{color:var(--color-text-secondary)}
.sec-h .acts{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.sec-h .acts .field{min-width:160px}
.sec-b{padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.sec-b>.scroll-x{margin:-16px;width:calc(100% + 32px);max-width:none}
.sec-b>.toolbar+.scroll-x{margin-top:0}
.help{color:var(--color-text-secondary)}
.wrap{white-space:normal;display:inline-block;max-width:280px;text-align:start}
.acts-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:center}
.grow{flex:1}
.neg{color:var(--color-error-text)}
.b{font-weight:700}

/* Sub tabs (segmented) */
.subtabs{display:inline-flex;gap:4px;padding:4px;background:var(--color-bg-container);border-radius:var(--radius-md);flex-wrap:wrap;align-self:flex-start;max-width:100%}
.subtab{height:32px;padding:0 12px;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-secondary);font-weight:500;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.subtab:hover{background:var(--color-bg-hover)}
.subtab[aria-selected=true]{background:var(--color-bg-base);color:var(--color-brand-default);font-weight:700;box-shadow:0 1px 2px rgba(46,42,27,.12)}
.subtab .cnt,.chip .cnt{min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--color-bg-tint);color:var(--color-text-primary);font-size:12px;line-height:20px;text-align:center}
/* a main tab's count (ملفي › طلباتي: the open requests of each tab — 2026-11-15-comments.md decision 3) */
.tab .cnt{display:inline-block;min-width:20px;height:20px;margin-inline-start:8px;padding:0 6px;border-radius:999px;background:var(--color-bg-tint);color:var(--color-text-primary);font-size:12px;font-weight:600;line-height:20px;text-align:center;vertical-align:middle}
.tab[aria-selected=true] .cnt{background:var(--color-brand-default);color:var(--color-text-on-brand)}
.subtab[aria-selected=true] .cnt{background:var(--color-action-default);color:var(--color-text-on-action)}

/* Switch / checkbox / radios */
.sw{width:40px;height:22px;border-radius:999px;border:0;background:var(--color-border-default);position:relative;flex:none;padding:0}
.sw i{position:absolute;top:3px;inset-inline-start:3px;width:16px;height:16px;border-radius:50%;background:var(--color-bg-base);transition:inset-inline-start .15s}
.sw[aria-checked=true]{background:var(--color-brand-default)}.sw[aria-checked=true] i{inset-inline-start:21px}
.sw:disabled{opacity:.5}
.sw-row,.set-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--color-border-subtle)}
.sec-b>.set-row:last-child,.sec-b>.sw-row:last-child{border-bottom:0}
.sw-txt{display:flex;flex-direction:column}
.cb{display:inline-flex;align-items:center;gap:8px;border:0;background:transparent;padding:4px;border-radius:var(--radius-sm);min-height:28px}
.cb i{width:18px;height:18px;border:1px solid var(--color-border-default);border-radius:4px;background:var(--color-bg-base);display:grid;place-items:center;flex:none}
.cb[aria-checked=true] i{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
.cb i .ic{width:14px;height:14px;stroke:currentColor}
.radios{display:flex;flex-direction:column;gap:4px}
.radios .radio{height:auto;min-height:32px;flex-wrap:wrap}.radios .radio small{flex-basis:100%;padding-inline-start:24px}
.flabel{font-weight:500}

/* Accordion */
.acc{border:1px solid var(--color-border-subtle);border-radius:var(--radius-sm);overflow:hidden}
.acc+.acc{margin-top:8px}
.acc-h{width:100%;display:flex;align-items:center;gap:12px;padding:10px 12px;background:var(--color-bg-container)}
.acc.open .acc-h{border-bottom:1px solid var(--color-border-subtle)}
.acc-h .meta{margin-inline-start:auto;color:var(--color-text-secondary)}
.acc-b .scroll-x{margin:0}

/* Toast */
.toast{position:fixed;bottom:max(24px,env(safe-area-inset-bottom,0px));left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:var(--color-text-primary);color:var(--color-bg-base);padding:10px 16px;border-radius:var(--radius-md);box-shadow:var(--shadow-popover);z-index:200;max-width:calc(100vw - 32px);transition:opacity .2s,transform .2s;font-weight:500}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.success{background:var(--color-brand-default);color:var(--color-text-on-brand)}
.toast.error{background:var(--color-error-text);color:var(--color-bg-base)}
@media (max-width:767px){.toast{bottom:84px}}

/* Upload field */
.sr-file{position:absolute;width:1px;height:1px;opacity:0}
.upload{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;border:1px dashed var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-base);cursor:pointer;color:var(--color-text-secondary);position:relative}
.upload:hover,.upload:focus-within{border-color:var(--color-brand-default)}
.upload.err{border-color:var(--color-error-base);background:var(--color-error-bg)}
.row.cols3{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px}
@media (max-width:767px){.row.cols3{grid-template-columns:1fr}}

/* Search field in toolbars */
.search-field{height:36px;display:flex;align-items:center;gap:8px;padding:0 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-base);min-width:240px;flex:0 1 320px}
.search-field input{border:0;background:transparent;outline:0;flex:1;min-width:0}
.search-field:focus-within{outline:2px solid var(--color-border-focus)}
.toolbar .field{min-width:180px}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{height:32px;padding:0 12px;border:1px solid var(--color-border-subtle);border-radius:999px;background:var(--color-bg-base);display:inline-flex;align-items:center;gap:6px;font-weight:500}
.chip[aria-pressed=true]{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
.chip[aria-pressed=true] .cnt{background:var(--color-action-default);color:var(--color-text-on-action)}
.list-chip{display:inline-flex;align-items:center;gap:2px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-sm);padding:2px 2px 2px 4px;background:var(--color-bg-base)}

/* Member link / product cell */
.mlink{display:inline-flex;align-items:center;gap:8px;text-decoration:none;color:inherit;text-align:start}
.mlink span{display:flex;flex-direction:column;line-height:20px}.mlink small{color:var(--color-text-secondary);font-size:12px}
a.mlink:hover b{color:var(--color-brand-default);text-decoration:underline}
.avatar.sm{width:28px;height:28px}
.avatar.xl{width:64px;height:64px;font-size:26px;flex:none}
.prod{display:flex;align-items:center;gap:8px;text-align:start}.prod>span:last-child{display:flex;flex-direction:column;line-height:20px}.prod small{color:var(--color-text-secondary);font-size:12px}
.thumb{width:36px;height:36px;border-radius:var(--radius-sm);background:var(--color-bg-tint);display:grid;place-items:center;color:var(--color-brand-default);flex:none}
.prod.lg .thumb{width:56px;height:56px}
.thumb{overflow:hidden}.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.late{color:var(--color-error-text);font-weight:600;display:inline-flex;align-items:center;gap:4px}
.oid{font-weight:700;color:var(--color-brand-default);text-decoration:none}

/* Team calendar */
.legend{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.sw-off{padding:0 8px;border-radius:var(--radius-sm);background:var(--color-bg-tint)}
.tcal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;min-width:640px}
.cal-hd{padding:6px;text-align:center;color:var(--color-text-primary);background:var(--color-bg-tint);border-radius:var(--radius-sm)}
.cal-cell{min-height:84px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-sm);padding:6px;display:flex;flex-direction:column;gap:4px;background:var(--color-bg-base);align-items:flex-start}
.cal-cell.out{background:transparent;border-style:dashed}
.cal-cell.off{background:var(--color-bg-tint)}
.cal-cell.today{outline:2px solid var(--color-action-default)}
.cal-cell .d{font-weight:700}
.sec-b:has(.tcal){overflow-x:auto}

/* Payslip */
.slip{display:flex;flex-direction:column;gap:4px}
.slip-h{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:12px;margin-bottom:8px;border-bottom:1px solid var(--color-border-subtle)}
.slip-row{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px dashed var(--color-border-subtle)}
.slip-row.total{border-bottom:0;border-top:2px solid var(--color-brand-default);margin-top:8px;padding-top:10px;font-size:16px;color:var(--color-brand-default)}
.score-box{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px;border-radius:var(--radius-sm);background:var(--color-bg-container)}
.countdown{display:flex;align-items:center;gap:8px;justify-content:center;font-size:28px;line-height:40px;color:var(--color-brand-default);padding:8px 0}
.codes{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.codes code{padding:6px 8px;background:var(--color-bg-container);border-radius:var(--radius-sm);text-align:center;font-size:14px}

/* Consolidation card */
.cons{padding:16px;display:flex;flex-direction:column;gap:12px}
.cons.is-late{border:2px solid var(--color-error-border)}
.cons-h{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.cons-subs{display:flex;flex-direction:column;gap:6px}
.cons-sub{display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--color-bg-container);border-radius:var(--radius-sm);flex-wrap:wrap}
.cnt-in{width:72px;height:32px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);text-align:center;background:var(--color-bg-base)}

/* Settings */
.set-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:24px;align-items:start}
.set-nav{padding:8px;display:flex;flex-direction:column;gap:2px;position:sticky;top:64px}
.set-nav-item{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:0;background:transparent;border-radius:var(--radius-sm);text-align:start;color:var(--color-text-primary)}
.set-nav-item .ic{margin-top:4px;color:var(--color-text-secondary)}
.set-nav-item span{display:flex;flex-direction:column;line-height:20px}.set-nav-item small{color:var(--color-text-secondary);font-size:12px}
.set-nav-item:hover{background:var(--color-bg-hover)}
.set-nav-item[aria-current=page]{background:var(--color-brand-subtle-bg);box-shadow:inset -3px 0 0 var(--color-action-default)}
.set-nav-item[aria-current=page] b,.set-nav-item[aria-current=page] .ic{color:var(--color-brand-default)}
.set-body{display:flex;flex-direction:column;gap:16px;min-width:0;max-width:920px}
.save-bar{position:sticky;bottom:16px;z-index:6;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;background:var(--color-text-primary);color:var(--color-bg-base);border-radius:var(--radius-md);box-shadow:var(--shadow-popover);flex-wrap:wrap}
.save-bar>span{display:inline-flex;align-items:center;gap:8px}
.danger-zone{padding:16px;border:2px solid var(--color-error-border);display:flex;flex-direction:column;gap:8px}.danger-zone h2{margin:0;color:var(--color-error-text)}
.integ{padding:16px;display:flex;flex-direction:column;gap:12px}.integ-h{display:flex;align-items:center;gap:12px}.integ-h>div{flex:1}
.steps{display:flex;gap:8px;list-style:none;margin:0;padding:0;counter-reset:s}
.steps li{flex:1;padding:6px;border-bottom:3px solid var(--color-border-subtle);color:var(--color-text-secondary);font-size:12px;counter-increment:s}
.steps li::before{content:counter(s) '. '}
.steps li.on{border-color:var(--color-action-default);color:var(--color-text-primary);font-weight:700}.steps li.done{border-color:var(--color-brand-default)}
.inline-sel .field{min-width:150px}.inline-sel .select{height:32px}
.pm{display:inline-grid;place-items:center;min-width:28px;height:28px;border-radius:var(--radius-sm);border:1px solid var(--color-border-subtle);background:var(--color-bg-base);font-weight:700}
.legend .pm{min-width:auto;padding:0 8px;gap:4px;display:inline-flex}
.pm-full{color:var(--color-success-text);background:var(--color-success-bg);border-color:var(--color-success-border)}
.pm-part{color:var(--color-text-primary);background:var(--color-bg-tint);border-color:var(--color-chart-2)}
.pm-none{color:var(--color-text-disabled)}
.pm.sens{color:var(--color-error-text);border-color:var(--color-error-border);background:var(--color-error-bg)}
button.pm:disabled{opacity:.7;cursor:not-allowed}
.matrix{min-width:860px;display:flex;flex-direction:column}
.mx-row{display:grid;grid-template-columns:220px repeat(var(--cols),minmax(64px,1fr));align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--color-border-subtle);text-align:center}
.mx-row>span:first-child{text-align:start;display:flex;align-items:center;gap:6px}
.mx-row.sens>span:first-child{color:var(--color-error-text)}
.mx-head{background:var(--color-bg-tint);color:var(--color-text-primary);border-bottom:1px solid var(--color-border-subtle);border-radius:var(--radius-sm) var(--radius-sm) 0 0;position:sticky;top:0}
.mx-gh{width:100%;display:flex;align-items:center;gap:12px;padding:10px 8px;border-bottom:1px solid var(--color-border-subtle);background:var(--color-bg-container)}
@media (max-width:1023px){.set-layout{grid-template-columns:1fr}.set-nav{position:static;flex-direction:row;overflow-x:auto}.set-nav-item small{display:none}.set-nav-item{white-space:nowrap}}

/* Profile */
.prof-head{display:flex;align-items:center;gap:16px;padding:16px;flex-wrap:wrap}
.prof-head h1{margin:0;color:var(--color-brand-default)}
.prof-head .acts-inline{justify-content:flex-start;margin-top:6px}
.sum-tile{display:flex;flex-direction:column;gap:6px;align-items:flex-start;padding:16px;text-align:start;border:2px solid var(--color-brand-default);cursor:pointer;color:var(--color-text-primary)}
.sum-tile:hover{border-color:var(--color-brand-default)}
.sum-tile .kpi-label{color:var(--color-brand-default);font-weight:900}
.sum-tile .more{margin-top:auto;color:var(--color-brand-default);display:inline-flex;align-items:center;gap:2px;font-weight:600}
.admin-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.card.admin{background:var(--color-bg-container);border:1px solid var(--color-chart-2);padding:16px;display:flex;flex-direction:column;gap:12px}
.card.admin h2{margin:0;color:var(--color-brand-default)}.card.admin .sec-h{padding:0;border:0}
.quick{display:flex;gap:8px;flex-wrap:wrap}
@media (max-width:1023px){.admin-cards{grid-template-columns:1fr}}
.task{display:flex;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid var(--color-border-subtle);flex-wrap:wrap}
.task:last-child{border-bottom:0}
.task.done .grow{text-decoration:line-through;color:var(--color-text-secondary)}
.task.auto{color:var(--color-brand-default)}.task.auto a{color:inherit;font-weight:600}
.task .carried{margin-inline-start:8px}
.tstat-btn{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:2px;border-radius:var(--radius-sm)}
.task-add-wrap{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;border:1px dashed var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-base)}
.task-add{border:0;background:transparent;outline:0;flex:1;min-width:0;height:100%}
.task-add-wrap:focus-within{border-style:solid;border-color:var(--color-border-focus)}

/* Header: clock widget + account menu (Figma Clock widget 360:2538) */
.clock-widget{order:2;display:flex}
/* phase 13 decision 24: after «إنهاء الدوام» the day's hours beside «ابدأ الدوام» again */
.clock-widget{align-items:center;gap:8px}.clock-done{display:inline-flex;align-items:center;gap:4px;color:var(--color-text-secondary,inherit);white-space:nowrap}
.clock{display:inline-flex;align-items:center;gap:8px;height:32px;padding:0 12px;border-radius:999px;border:1px solid var(--color-success-border);background:var(--color-success-bg);color:var(--color-success-text);font-weight:600}
.clock .dot{width:8px;height:8px;border-radius:50%;background:var(--color-success-base)}
.clock-overtime{border-color:var(--color-orange-border);background:var(--color-orange-bg);color:var(--color-orange-text)}.clock-overtime .dot{background:var(--color-orange-base)}
@media (prefers-reduced-motion:no-preference){.clock .dot{animation:blink 2s infinite}@keyframes blink{50%{opacity:.35}}}
.clock-pop{width:280px;padding:12px;display:flex;flex-direction:column;gap:12px}
.clock-pop .kv{grid-template-columns:90px 1fr}
.clock-pop .demo{display:flex;align-items:center;gap:4px;flex-wrap:wrap;border-top:1px dashed var(--color-border-subtle);padding-top:8px}
.user-btn{display:flex;align-items:center;gap:8px;border:0;background:transparent;padding:4px 6px;border-radius:var(--radius-sm);color:var(--color-text-primary)}
.user-btn:hover{background:var(--color-bg-hover)}
.menu.acct{width:240px}.acct-h{padding:8px 12px 10px;border-bottom:1px solid var(--color-border-subtle);margin-bottom:4px;display:flex;flex-direction:column}.acct-h small{color:var(--color-text-secondary)}
/* decision 30: the name and the e-mail sit on the right (the e-mail is ltr text in an rtl menu) */
.acct-h{align-items:stretch;text-align:right}.acct-h small{text-align:right}
@media (max-width:767px){.user-btn .nm,.user-btn>.ic{display:none}.clock .lbl{display:none}}

/* Login (option B) */
#login{min-height:100vh;background:var(--color-brand-default);display:flex}
.login-wrap{flex:1;min-width:0;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:32px max(16px,env(safe-area-inset-right,0px)) 32px max(16px,env(safe-area-inset-left,0px))}
.login-brand{display:flex;flex-direction:column;align-items:center;gap:8px}
.login-brand .tagline{color:var(--color-text-gold);font-weight:700;font-size:16px}
.login-card{width:440px;max-width:100%;background:var(--color-bg-base);border-radius:12px;padding:32px;display:flex;flex-direction:column;gap:16px;box-shadow:0 16px 48px rgba(0,0,0,.25)}
.login-card h1{margin:0;color:var(--color-brand-default)}.login-card>p{margin:-8px 0 0}
.login-card .btn.block{width:100%}
.login-card .input input[dir=ltr]{text-align:right}
.lg-row{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.demo-hint{margin:0;padding:8px;border-radius:var(--radius-sm);background:var(--color-bg-container);text-align:center}
.login-foot{color:var(--color-bg-layout);opacity:.85;margin:0}.login-foot a{color:var(--color-text-gold)}
@media (max-width:480px){.login-card{padding:24px 16px}}

/* Mobile tables for new pages: keep horizontal scroll inside cards */
@media (max-width:767px){.search-field{min-width:0;flex:1 1 100%}.sec-h .acts{width:100%}.sec-h .acts .btn{flex:1}.prof-head{align-items:flex-start}}

/* HR — payroll stepper, 2-week team calendar, month cells, plan goals */
.stepper{display:flex;gap:8px;list-style:none;margin:0;padding:0;flex-wrap:wrap}
.stepper li{flex:1 1 160px;display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);background:var(--color-bg-base);min-width:0}
.stepper li i{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;flex:none;font-style:normal;font-weight:700;background:var(--color-bg-tint);color:var(--color-text-secondary)}
.stepper li span{display:flex;flex-direction:column;line-height:20px;min-width:0}.stepper li small{color:var(--color-text-secondary);font-size:12px}
.stepper li.done i{background:var(--color-brand-default);color:var(--color-text-on-brand)}
.stepper li.on{border:2px solid var(--color-action-default)}.stepper li.on i{background:var(--color-action-default);color:var(--color-text-on-action)}
.tcal2{min-width:1080px;display:flex;flex-direction:column}
.tc-row{display:grid;grid-template-columns:200px repeat(14,minmax(56px,1fr));align-items:center;border-bottom:1px solid var(--color-border-subtle)}
.tc-row>span:first-child{padding:8px}
.tc-head{background:var(--color-bg-tint);color:var(--color-text-primary);border-bottom:1px solid var(--color-border-subtle);border-radius:var(--radius-sm) var(--radius-sm) 0 0}
.tc-head>span{display:flex;flex-direction:column;align-items:center;padding:6px 2px;font-size:12px;line-height:18px}
.tc-head>span:first-child{align-items:flex-start;font-size:14px;font-weight:600}
.tc-head>span.today{background:var(--color-action-default);color:var(--color-text-on-action)}
.tc-cell{min-height:52px;display:grid;place-items:center;border-inline-start:1px solid var(--color-border-subtle);padding:4px 2px}
.tc-cell.off{background:var(--color-bg-tint)}.tc-cell.today{background:var(--color-brand-subtle-bg);box-shadow:inset 0 0 0 2px var(--color-action-default)}
.tc-cell .tg{padding:0 4px;font-size:11px}
/* comments 15 Nov decision 76: the calendar's columns follow the picked period (the row's own grid-template-columns), the month's name under the first day shown and every 1st */
.tc-head .tc-mon{font-size:10px;line-height:14px;color:var(--color-text-secondary)}.tc-head>span.today .tc-mon{color:inherit}
/* decision 77: «الشهر» and «السنة» as two short lists, «مقارنة» and its own pair after them */
.hr-mpick .field{min-width:0}
.hr-mpick .pop-anchor>.select[id$="-m"],.hr-mpick .pop-anchor>.select[id$="-q"]{width:168px}
.hr-mpick .pop-anchor>.select[id$="-y"]{width:136px}
.check.hr-cmp{opacity:1;cursor:pointer;font-weight:500;gap:6px}
.hr-cmp-vs{margin-inline:-4px}
.mcell{display:flex;flex-direction:column;align-items:center;gap:2px}
.goal{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-sm)}
.integ-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (max-width:1023px){.integ-grid{grid-template-columns:1fr}}
.acts-inline.start{justify-content:flex-start}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
@media (max-width:767px){.grid3{grid-template-columns:1fr}}
.drag{color:var(--color-text-disabled);cursor:grab;letter-spacing:-2px}
.upload.drop{min-height:72px;justify-content:center}
.count-prog{display:flex;flex-direction:column;gap:6px}
b.pos{color:var(--color-success-text)}

/* owner 22 Oct — alert tables: arrow toggles like the orders cards, small titles + small description, readable fixed columns */
.acc-t{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:2px;border:0;background:transparent;padding:0;text-align:start;cursor:pointer;color:var(--color-text-primary)}
.acc-t .t-label{color:var(--color-brand-default)}
.acc-d{color:var(--color-text-secondary)}
.acc-h .meta,.mx-gh .meta{margin-inline-start:auto;color:var(--color-text-secondary);white-space:nowrap}
.icon-btn.acc-tog{width:32px;height:32px;flex:none;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-base);display:grid;place-items:center}
.icon-btn.acc-tog:hover{border-color:var(--color-brand-default)}
.acc-b>.scroll-x{margin:0}
.ntf-table{table-layout:fixed;width:100%;min-width:760px}
.ntf-table th,.ntf-table td{padding:10px 12px;vertical-align:middle;text-align:start;white-space:normal;overflow-wrap:anywhere}
.ntf-table th{white-space:nowrap}
.ntf-table th:nth-child(1){width:24%}.ntf-table th:nth-child(2){width:72px}.ntf-table th:nth-child(3){width:108px}.ntf-table th:nth-child(4){width:17%}.ntf-table th:nth-child(5){width:15%}.ntf-table th:nth-child(7){width:48px}
.ntf-name{display:block;line-height:1.5}
.ntf-rep,.ntf-ch{display:block;line-height:1.5;color:var(--color-text-primary)}
.ntf-chips{display:flex;flex-wrap:wrap;gap:4px}
.ntf-chip{display:inline-flex;align-items:center;height:24px;padding:0 8px;border-radius:999px;background:var(--color-bg-tint);color:var(--color-text-primary);font-size:12px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.ntf-chip.more{background:transparent;border:1px solid var(--color-border-subtle);color:var(--color-text-secondary)}
.ntf-hint{margin:0 0 4px}
.sec-b>*+.scroll-x{margin-top:0}

/* owner 22 Oct — delivery: waybill popup + WhatsApp-linked phones */
.wa-ph{display:inline-flex;align-items:center;gap:6px}
.wa-a{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:999px;color:var(--color-success-text);background:var(--color-success-bg);text-decoration:none}
.wa-a:hover,.wa-a:focus-visible{outline:2px solid var(--color-brand-default);outline-offset:1px}
.wb-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--color-text-secondary)}
.wb-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:700px){.wb-grid{grid-template-columns:1fr}}
.wb-party{border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);padding:12px;display:flex;flex-direction:column;gap:4px;background:var(--color-bg-container)}
.wb-party>.t-label{color:var(--color-brand-default);margin-bottom:4px}
.wb-miss{color:var(--color-error-text)}

/* ===== خدمة العملاء (Figma page 422:28384) — tokens only ===== */
.stars{display:inline-flex;gap:2px;vertical-align:middle}.stars i{display:inline-flex;color:var(--color-border-default)}.stars i.on{color:var(--color-chart-2)}.stars i.on .ic{fill:currentColor}.stars .ic{width:14px;height:14px}
.plat{display:inline-flex;align-items:center;color:var(--color-brand-default)}.plat-whatsapp{color:var(--color-success-text)}.plat-tiktok{color:var(--color-text-primary)}.plat .ic{width:16px;height:16px}
.row-f{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}.row-f.end{align-items:flex-end}.stack{display:flex;flex-direction:column;gap:12px;min-width:0}
.pad{padding:16px}.pad-s{padding:12px}.src-note{color:var(--color-text-secondary);margin:0}
.chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.chip{display:inline-flex;align-items:center;gap:4px}
.chip-b{height:28px;padding:0 10px;border-radius:999px;border:1px solid var(--color-border-subtle);background:var(--color-bg-base);color:var(--color-text-secondary);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.chip-b[aria-pressed=true]{background:var(--color-brand-subtle-bg);border-color:var(--color-brand-default);color:var(--color-brand-default)}
.select.sm{height:32px;font-size:12px}.select[aria-disabled=true]{background:var(--color-bg-disabled);color:var(--color-text-secondary);display:flex;align-items:center}
.badge{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--color-error-base);color:var(--color-on-status);font-size:11px;font-weight:700;display:inline-grid;place-items:center;flex:none}
.modal.xl{width:960px}

/* inbox — 3 columns, RTL: list (right) · chat · panel (left) */
.cs-inbox{display:grid;grid-template-columns:360px minmax(0,1fr) 300px;height:calc(100vh - 220px);min-height:560px;background:var(--color-bg-base);border:1px solid var(--color-border-default);border-radius:var(--radius-md);overflow:hidden;box-shadow:var(--shadow-card)}
.cs-list{display:flex;flex-direction:column;min-width:0;min-height:0;border-inline-end:1px solid var(--color-border-default)}
.cs-lh{display:flex;flex-direction:column;gap:8px;padding:12px;border-bottom:1px solid var(--color-border-subtle)}
.cs-lh .search{width:auto;max-width:none;margin:0;height:36px;background:var(--color-bg-base);border-color:var(--color-border-default)}
.cs-lh .pop-anchor.view{flex:1;min-width:0}.cs-lh .pop-anchor.sort{width:150px}.cs-lh .pop-anchor .select{width:100%}
.seg{display:flex;gap:4px;padding:4px;background:var(--color-bg-layout);border-radius:var(--radius-sm)}
.seg-b{flex:1;height:32px;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-secondary);font:inherit;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer}
.seg-b[aria-selected=true]{background:var(--color-bg-base);color:var(--color-brand-default);font-weight:700}
.seg-b .cnt,.ptab .cnt,.sn-i .cnt{font-size:12px;font-weight:600}
.ptabs{display:flex;padding:0 8px;border-bottom:1px solid var(--color-border-subtle);overflow-x:auto;scrollbar-width:none}
.ptab{position:relative;height:40px;padding:0 8px;border:0;background:transparent;border-bottom:2px solid transparent;color:var(--color-text-secondary);font:inherit;font-size:14px;display:inline-flex;align-items:center;gap:4px;white-space:nowrap;cursor:pointer;flex:none}
.ptab .ic{width:16px;height:16px}.ptab[aria-selected=true]{color:var(--color-brand-default);border-bottom-color:var(--color-brand-default);font-weight:600}
.dot-err{width:6px;height:6px;border-radius:50%;background:var(--color-error-base);display:inline-block}
.cs-disc{display:flex;align-items:center;gap:6px;padding:6px 12px;background:var(--color-error-bg);color:var(--color-error-text);border-bottom:1px solid var(--color-error-border)}
.cs-items{flex:1;overflow-y:auto;min-height:0}.cs-items .empty{border:0}
.cv{display:flex;gap:12px;align-items:flex-start;width:100%;padding:12px 16px;border:0;border-bottom:1px solid var(--color-border-subtle);background:var(--color-bg-base);text-align:start;font:inherit;color:inherit;cursor:pointer}
.cv:hover{background:var(--color-bg-hover)}.cv.sel{background:var(--color-brand-subtle-bg);box-shadow:inset -3px 0 0 var(--color-brand-default)}
.cv-b{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.cv-r1,.cv-r2,.cv-r3{display:flex;align-items:center;gap:6px;min-width:0}
.cv-r1 .nm{flex:1;min-width:0;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cv.unread .nm{font-weight:700}
.cv-r1 .tm{color:var(--color-text-secondary);flex:none}.cv.unread .tm{color:var(--color-brand-default)}
.cv-r2 .pv{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--color-text-secondary)}.cv.unread .pv{color:var(--color-text-primary);font-weight:500;font-size:14px}
.cv-r3 .t-small{color:var(--color-text-secondary)}

.cs-chat{display:flex;flex-direction:column;min-width:0;min-height:0}.cs-chat.empty-chat{justify-content:center}
.back-m{display:none;padding:4px 8px;border-bottom:1px solid var(--color-border-subtle)}
.cs-ch{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--color-border-subtle);min-width:0}
.cs-ch .who{flex:1;min-width:0}.cs-ch .who b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cs-ch .sub{display:flex;align-items:center;gap:4px;color:var(--color-text-secondary)}
.cs-ch .acts{display:flex;align-items:center;gap:8px;flex:none}.cs-ch .asg{width:136px}.cs-ch .asg .select{width:100%}
.cs-bar{display:flex;align-items:center;gap:8px;padding:8px 16px;font-size:12px;font-weight:600;border-bottom:1px solid}
.cs-bar.warn{background:var(--color-orange-bg);color:var(--color-orange-text);border-color:var(--color-orange-border)}
.cs-bar.err{background:var(--color-error-bg);color:var(--color-error-text);border-color:var(--color-error-border)}
.cs-bar.sm{border:1px solid var(--color-warning-border);background:var(--color-warning-bg);color:var(--color-warning-base);border-radius:var(--radius-sm);font-weight:500}
.cs-bar.big{border:1px solid var(--color-error-border);border-radius:var(--radius-md);padding:12px 16px;font-size:14px;font-weight:400}
.cs-msgs{flex:1;overflow-y:auto;min-height:0;padding:16px;display:flex;flex-direction:column;gap:12px;background:var(--color-bg-layout)}
.day{display:flex;justify-content:center}.day span{padding:2px 12px;border-radius:999px;border:1px solid var(--color-border-default);background:var(--color-bg-base);font-size:12px;font-weight:600;color:var(--color-text-secondary)}
.evt .tl-ev{justify-content:center;flex-wrap:wrap;text-align:center}
.brow{display:flex}.brow.in{justify-content:flex-start}.brow.out{justify-content:flex-end}
.bub{max-width:min(420px,85%);padding:8px 12px;border-radius:var(--radius-md);border:1px solid var(--color-border-default);background:var(--color-bg-base);display:flex;flex-direction:column;gap:4px;min-width:0}
.bub .tx{white-space:pre-wrap;overflow-wrap:anywhere}
.b-out{background:var(--color-brand-subtle-bg);border-color:var(--color-success-border)}
.b-note{background:var(--color-warning-bg);border-color:var(--color-warning-border)}.b-note .bh{color:var(--color-warning-base);font-weight:600}
.b-auto{background:var(--color-bg-container)}.b-auto .bh{color:var(--color-text-secondary);display:flex;align-items:center;gap:4px;font-weight:600}
.bub .meta{display:flex;gap:8px;flex-wrap:wrap;color:var(--color-text-secondary)}.bub .meta .ok{color:var(--color-success-text)}.bub .meta .err{color:var(--color-error-text);font-weight:600}
.voice{display:flex;flex-direction:column;gap:4px;align-items:flex-start}.voice .tr{color:var(--color-text-secondary)}
.img-ph{display:flex;align-items:center;gap:8px;padding:16px;border-radius:var(--radius-sm);background:var(--color-bg-tint);color:var(--color-text-secondary)}
.post{display:flex;gap:12px;padding:12px;border:1px solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-bg-base)}
.post-img{width:72px;height:72px;border-radius:var(--radius-sm);background:var(--color-bg-tint);display:grid;place-items:center;color:var(--color-text-secondary);flex:none}
.post-i{display:flex;flex-direction:column;gap:2px;align-items:flex-start;min-width:0}.post-i .t-small{color:var(--color-text-secondary)}
.c-acts{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-start}

.cmp{margin:12px;padding:12px;border:1px solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-bg-base);display:flex;flex-direction:column;gap:8px}
.cmp.is-note{background:var(--color-warning-bg);border-color:var(--color-warning-border)}
.cmp-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.cmp-top .from{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px;color:var(--color-text-secondary)}
.cmp-tabs{display:flex;gap:6px}.cmp-tab{height:28px;padding:0 12px;border-radius:999px;border:0;background:transparent;color:var(--color-text-secondary);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.cmp-tab[aria-selected=true]{background:var(--color-brand-subtle-bg);color:var(--color-brand-default)}.cmp-tab.note[aria-selected=true]{background:var(--color-warning-border);color:var(--color-warning-base)}
.cmp-in{position:relative}.cmp-in .textarea{min-height:72px;background:var(--color-bg-layout);border-color:var(--color-border-subtle)}.cmp.is-note .textarea{background:var(--color-bg-base)}
.qr-sugg{position:absolute;bottom:100%;inset-inline:0;margin-bottom:4px;background:var(--color-bg-elevated);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);box-shadow:var(--shadow-popover);padding:4px;max-height:220px;overflow:auto;z-index:5}
.cmp-bar{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.cmp-bar .hint{color:var(--color-text-secondary)}

.cs-panel{border-inline-start:1px solid var(--color-border-default);overflow-y:auto;min-width:0;min-height:0}
.pn-s{padding:16px;border-bottom:1px solid var(--color-border-subtle);display:flex;flex-direction:column;gap:8px}
.pn-h{display:flex;align-items:center;justify-content:space-between;gap:8px}.pn-h h3{margin:0}
.pn-who{display:flex;align-items:center;gap:12px}.pn-who b{display:block}.pn-who .t-small{color:var(--color-text-secondary)}
.tags{display:flex;flex-wrap:wrap;gap:4px;align-items:center}.tags.pad{padding:0 24px 12px}
.kvg{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.kvg.six{grid-template-columns:repeat(6,minmax(0,1fr))}.kvg.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.kvc{display:flex;flex-direction:column;gap:2px;min-width:0}.kvc .t-small{color:var(--color-text-secondary)}
.ord{display:flex;flex-direction:column;gap:4px;padding:8px 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm)}
.r{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.qa{display:flex;flex-wrap:wrap;gap:8px}

/* customers */
.bulk{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 16px;border-radius:var(--radius-sm);background:var(--color-brand-default);color:var(--color-text-on-brand)}
.bulk .icon-btn{color:var(--color-text-on-brand)}
.tbl-card{overflow:hidden}.tbl-foot{display:flex;align-items:center;gap:8px;padding:12px 16px;border-top:1px solid var(--color-border-subtle)}
.who-cell{display:flex;align-items:center;gap:8px;border:0;background:transparent;padding:0;font:inherit;color:inherit;text-align:start;cursor:pointer}
.who-cell>span{display:flex;flex-direction:column}.who-cell b{color:var(--color-text-link,var(--color-brand-default))}
.plats{display:inline-flex;gap:6px}
.merge-c{display:flex;flex-direction:column;gap:4px}.merge-c.keep{border-color:var(--color-brand-default);background:var(--color-brand-subtle-bg)}
.dr-h{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 24px;flex-wrap:wrap}.dr-h h2{margin:0}.dr-h .acts{display:flex;gap:8px;align-items:center}
.dr-b{padding:0 0 24px}.drawer{overflow-y:auto}

/* templates */
.tpl-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:24px;align-items:start}
.subnav{display:flex;flex-direction:column;gap:2px}.subnav>.t-small{color:var(--color-text-secondary);padding:0 12px 4px}
.sn-i{display:flex;align-items:center;gap:8px;height:36px;padding:0 12px;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-primary);font:inherit;cursor:pointer;text-align:start}
.sn-i>span:nth-child(2){flex:1}.sn-i .cnt{color:var(--color-text-secondary)}.sn-i[aria-current=page]{background:var(--color-brand-subtle-bg);color:var(--color-brand-default);font-weight:600}
.tpl-main{display:flex;flex-direction:column;gap:16px;min-width:0}
.tgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.tcard{display:flex;flex-direction:column;gap:8px;padding:16px;text-align:start;font:inherit;color:inherit;cursor:pointer;width:100%}
.tcard:hover{border-color:var(--color-border-default)}.tcard.sel{border:2px solid var(--color-brand-default)}
.tcard .body{color:var(--color-text-secondary);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.tcard .r .ic{width:14px;height:14px;color:var(--color-text-gold);vertical-align:middle}
.tp-cols{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start}.tp-list{display:flex;flex-direction:column;gap:8px;max-height:420px;overflow:auto}
.tp-prev{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:var(--radius-md);background:var(--color-bg-layout)}
.var-r{display:flex;align-items:center;justify-content:space-between;gap:8px}.inp-s{height:32px;width:150px;padding:0 8px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);font:inherit;background:var(--color-bg-base);color:var(--color-text-primary)}
.warn-t{color:var(--color-warning-base)}
.tp-edit{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start}
.blk{border:1px solid var(--color-border-default);border-radius:var(--radius-md);padding:12px 16px;display:flex;flex-direction:column;gap:12px;margin:0;background:var(--color-bg-layout);min-width:0}
.blk legend{font-weight:700;padding:0 4px;display:inline-flex;align-items:center;gap:4px}.blk legend .ic{color:var(--color-text-gold)}
.cond{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.row.cols3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.rule-groups{display:flex;flex-direction:column;gap:16px}
.rule{display:flex;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid var(--color-border-subtle)}.rule:last-child{border:0}
.rule .sw-row{flex:1;min-width:0}.rule .stats{color:var(--color-text-secondary);white-space:nowrap}

/* campaigns */
.stepper{list-style:none;margin:0;padding:16px;display:flex;gap:12px;align-items:center;background:var(--color-bg-base);border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);overflow-x:auto}
.stepper li{display:flex;align-items:center;gap:8px;white-space:nowrap;color:var(--color-text-secondary);flex:1}
.stepper li:not(:last-child)::after{content:"";flex:1;height:2px;background:var(--color-border-default);min-width:24px}
.stepper li.done:not(:last-child)::after{background:var(--color-brand-default)}
.stepper .dot{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--color-border-default);background:var(--color-bg-base);font-weight:700;font-size:12px;flex:none}
.stepper li.done .dot{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
.stepper li.cur{color:var(--color-text-primary);font-weight:600}.stepper li.cur .dot{background:var(--color-action-default);border-color:var(--color-action-default);color:var(--color-text-on-action)}
.wiz{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:24px;align-items:start}
.wiz-form{padding:24px;display:flex;flex-direction:column;gap:16px;min-width:0}.wiz-form h2{margin:0}
.wiz-side{padding:16px;display:flex;flex-direction:column;gap:12px}.wiz-side h3{margin:0}
.sum-r{display:flex;justify-content:space-between;gap:8px;padding:4px 0;border-bottom:1px solid var(--color-border-subtle)}
.wiz-nav{display:flex;align-items:center;gap:8px}
.two-col{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:16px;align-items:start}

/* channels + qr */
.integ-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.integ .vlogo .ic{width:18px;height:18px}
.set-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--color-border-subtle)}.set-row:last-child{border:0}
.qr-wrap{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:24px;align-items:start}
.qr-steps{margin:0;padding-inline-start:20px;display:flex;flex-direction:column;gap:8px}
.qr{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}.qr .t-small{color:var(--color-text-secondary)}
.qr-box{width:220px;height:220px;display:grid;place-items:center;border:1px solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-bg-tint);color:var(--color-text-primary)}.qr-box .ic{width:120px;height:120px;stroke-width:1.2}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}

@media (max-width:1279px){.cs-inbox{grid-template-columns:320px minmax(0,1fr)}.cs-panel{display:none}.tp-edit,.tp-cols,.qr-wrap{grid-template-columns:1fr}}
@media (max-width:1023px){
  .cs-inbox{grid-template-columns:1fr;height:auto;min-height:0}.cs-list{border:0;max-height:none}.cs-items{max-height:none}
  .cs-inbox .cs-chat{display:none}.cs-inbox.show-chat .cs-list{display:none}.cs-inbox.show-chat .cs-chat{display:flex;min-height:70vh}.back-m{display:block}
  .wiz,.two-col,.tpl-layout,.grid3,.integ-grid.three{grid-template-columns:1fr}.kvg.six,.kvg.four{grid-template-columns:repeat(2,minmax(0,1fr))}
  .subnav{flex-direction:row;overflow-x:auto}.subnav>.t-small{display:none}.sn-i{flex:none}
}
@media (max-width:767px){.cs-ch{flex-wrap:wrap}.cs-ch .acts{width:100%}.cs-ch .asg{flex:1}.row.cols3{grid-template-columns:1fr}.cmp-bar .hint{display:none}.modal.xl{width:100%}.bub{max-width:92%}.stepper li span:last-child{display:none}.stepper li.cur span:last-child{display:inline}}

.cs-lh .search input,.search-field input{border:0;height:auto;padding:0;background:transparent;box-shadow:none}
.drawer>.tabs,.drawer>.dr-h,.drawer>.tags,.drawer>.dr-b{flex:none}.drawer>.tabs{padding:0 16px}

/* Phase 3.1 (owner 26 Oct): floating dropdowns (10-ui-kit.js floatOver) — fixed above sections / drawers / modal content */
.floating{z-index:1100;margin:0}
.floating[data-dir=up]{animation:none}
/* Phase 3.1: «إضافة مبتكر» sections, the temporary-password field and the login section of the drawer */
.form-sec{display:flex;flex-direction:column;gap:2px;padding-top:var(--space-sm);border-top:1px solid var(--color-border-subtle,var(--color-border))}
.form-sec h3{margin:0;color:var(--color-brand-primary,var(--color-text-primary))}
.form-sec p{margin:0}
.pw-acts{display:inline-flex;gap:2px;align-items:center}
.pw-rules{display:flex;flex-wrap:wrap;gap:4px 12px;margin:-8px 0 0;padding:0;list-style:none;font-size:12px;color:var(--color-text-secondary)}
.pw-rules li::before{content:'○ ';}
.pw-rules li.ok{color:var(--color-status-success-text,var(--color-text-secondary))}
.pw-rules li.ok::before{content:'✓ ';}
.pw-cell{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}.pw-val{font-family:inherit;letter-spacing:.04em}
.vs-leave{background:var(--color-bg-tint);border-color:var(--color-chart-2);color:var(--color-text-primary)}
/* phase 3.3: the site's logo in the drawer header, the social links row, the category commission table */
.vlogo.vlogo-img{overflow:hidden;padding:0}.vlogo.vlogo-img img{width:100%;height:100%;object-fit:cover;display:block;border-radius:inherit}
.social-row{display:inline-flex;flex-wrap:wrap;gap:4px 10px}.social-a{color:var(--color-brand-default);text-decoration:none;overflow-wrap:anywhere}a.social-a:hover{text-decoration:underline}
.cat-rates-table{width:100%;table-layout:auto}.cat-rates-table td,.cat-rates-table th{vertical-align:middle;white-space:normal;padding:8px}
/* phase 3.4: the commission by category — the site's category tree in the terms popup (RTL; a level = an inline indent) */
.cat-head{display:grid;grid-template-columns:1fr 96px 96px;gap:8px;padding:0 8px 4px 8px;color:var(--color-text-secondary)}
.cat-tree{max-height:360px;overflow-y:auto;border:1px solid var(--color-border, #e5e5e5);border-radius:8px}
.cat-row{display:grid;grid-template-columns:28px 1fr 96px 96px;gap:8px;align-items:center;padding:4px 8px;padding-inline-start:calc(8px + var(--d, 0) * 20px);border-bottom:1px solid var(--color-border, #eee)}
.cat-row:last-child{border-bottom:0}
.cat-row .cat-name{min-width:0;overflow-wrap:anywhere}
.cat-row.is-own .cat-name{font-weight:600}
.cat-row .cat-in{min-width:0}
.cat-row .cat-in input{width:100%;min-width:0}
.cat-toggle{width:24px;height:24px;border:1px solid var(--color-border, #ccc);border-radius:4px;background:transparent;cursor:pointer;line-height:1;font-size:16px;color:var(--color-brand, #7c3aed)}
.cat-toggle-sp{width:24px}
@media (max-width:480px){.cat-head,.cat-row{grid-template-columns:24px 1fr 72px 72px}.cat-head{grid-template-columns:1fr 72px 72px}}

/* Phase 3.6: star picker of the customer rating popup (from the prototype of 27 Oct) */
.star-pick{display:inline-flex;gap:4px;direction:rtl}
.star-pick .sp{all:unset;cursor:pointer;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;color:var(--color-border-default)}
.star-pick .sp .ic{width:24px;height:24px}
.star-pick .sp.on{color:var(--color-chart-2)}
.star-pick .sp.on .ic{fill:currentColor}
.star-pick .sp:hover{background:var(--color-bg-hover)}
.star-pick .sp:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:1px}
.star-pick[aria-invalid=true] .sp{color:var(--color-status-error-border,var(--color-status-error-base))}
.sp-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.star-field .flabel{display:block;margin-bottom:4px}

/* Phase 3.6 (plan decision 5): pages not started yet are closed in the menus with a «soon» tag */
.nav-item[data-soon],.bn-item[data-soon],.bn-opt[data-soon]{opacity:.6;cursor:not-allowed}
.nav-item[data-soon]:hover{background:transparent}
.soon{margin-inline-start:auto;padding:0 6px;border-radius:999px;background:rgba(255,247,239,.18);color:var(--color-text-gold);font-size:10px;line-height:16px;font-weight:600;letter-spacing:.02em;direction:ltr}
.bn-item .soon{margin:0;background:var(--color-bg-tint);color:var(--color-text-secondary)}
@media (max-width:1023px){.nav-item .soon{margin:0}}

/* phase 4 — the accounts page (prototype 27 Oct): the moves log, the subscriptions table, the withdraw-request cell */
.cards.four{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
@media (max-width:1023px){.cards.four{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:599px){.cards.four{grid-template-columns:1fr}}
.wd-cell{border:1px solid transparent;cursor:pointer;font:inherit;white-space:nowrap} /* 0078: the status and its amount on one line */
.wd-cell:hover{filter:brightness(.97)}
.wd-cell:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:2px}
.subs-wrap .subs-tbl td,.mlog-table td{vertical-align:middle}
.mlog-table .tg{white-space:nowrap}

/* ===== phase 4.1: prototype 1793131460 (28 Oct) — alert chips, column popup, sticky first column, accounts on tablet / mobile ===== */
/* شيبس التنبيه في مصروف الاشتراك (owner 27 Oct) */
.alert-chips{gap:8px}
.alert-chip{height:auto;min-height:32px;padding:4px 12px;gap:6px}
.alert-chip .chip-date{opacity:.85;font-weight:400}
.alert-chip[aria-pressed=true] .chip-date{color:var(--color-text-on-brand)}
.alert-chip .chip-tick{display:inline-flex}
.alert-chip .chip-tick[hidden],.alert-chip .chip-date[hidden]{display:none}
/* صفوف التخصيص: السويتش على الشمال في سطر واحد (owner 27 Oct) */
.dash-cust .dc-row{display:flex;align-items:center;gap:12px}
.dash-cust .dc-row .dc-l{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.dash-cust .dc-row .dc-ord{flex:none;order:5;display:flex;gap:2px}
.dash-cust .dc-row .sw-row{flex:none;order:9;padding:0;border:0;margin-inline-start:8px}
.table-title [data-cols],.sec-h [data-cols]{margin-inline-start:4px}
.sec-h.cols-only{justify-content:flex-end;padding-bottom:0;border:0;min-height:0}
.sec-h.cols-only .acts{margin-inline-start:auto}

/* العمود الأول ثابت مع السكرول العرضي + ترويسة الكارت: التايتل يمين والعداد والأزرار شمال (owner 27 Oct) */
.table-title h2{margin-inline-end:auto}
.table-title .count{margin-inline-start:0}
@media (min-width:1024px){
  .sticky-col1 th:first-child,.sticky-col1 td:first-child{position:sticky;inset-inline-start:0;z-index:2;border-inline-end:1px solid var(--color-border-subtle)}
  .sticky-col1 thead th:first-child{z-index:3}
  .sticky-col1 tbody td:first-child{background:var(--color-bg-base)}
  .sticky-col1 tbody tr:nth-child(even) td:first-child{background:var(--color-bg-tint)}
  .sticky-col1 tr.total td:first-child,.sticky-col1 tfoot td:first-child{background:var(--color-bg-tint)}
}
.vname-link{cursor:pointer;color:var(--color-text-primary);text-decoration:underline;text-decoration-color:var(--color-border-default);text-underline-offset:3px}
.vname-link:hover{color:var(--color-brand-default);text-decoration-color:currentColor}
.vname-link:focus-visible{outline:2px solid var(--color-action-focus,var(--color-brand-default));outline-offset:2px;border-radius:2px}

/* ===== صفحة الحسابات على الموبايل والتابلت (owner 27 Oct) ===== */
@media (max-width:1023px){
  /* كروت الـ KPI: اتنين في السطر زي باقي الكروت (كانت واحد في السطر في سجل الحركات) */
  .cards.four{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cards.four>:last-child:nth-child(odd){grid-column:1/-1}
  /* ترويسة كارت الجدول: العنوان سطر لوحده، وتحته العداد يمين وزرار الأعمدة شمال */
  .table-title{row-gap:4px}
  .table-title h2{flex:1 1 100%;margin-inline-end:0}
  .table-title .count{flex:1 1 auto;margin-inline-end:auto}
  .table-title [data-cols],.sec-h [data-cols]{margin-inline-start:auto}
  /* كارت المبتكر في وضع الكروت: الاسم أول سطر كامل، وبعده الرصيد وطلب السحب */
  .vendors-table td[data-l="المبتكر"]{order:-5;flex:1 1 100%;padding-bottom:8px;border-bottom:1px solid var(--color-border-subtle)}
  .vendors-table td[data-l="الرصيد الحالي"]{order:-4}
  .vendors-table td[data-l="طلب سحب"]{order:-3}
  .vendors-table td[data-l="الصافي"]{order:-4} /* phase 4.1: our balance column is «الصافي» (Dokan − deductions) */
  .vendors-table .vname-cell{width:100%}
  .vendors-table .vname-link{display:flex;align-items:center;min-height:44px;width:100%;font-size:15px}
}
@media (max-width:767px){
  /* أزرار ترويسة الصفحة جنب بعض بدل سطر لكل واحد */
  #main .page-head .actions{flex-wrap:nowrap;gap:8px}
  #main .page-head .actions .pop-anchor{width:auto;flex:1 1 0;min-width:0}
  #main .page-head .actions .pop-anchor>.btn{width:100%}
}
@media (max-width:1023px){
  /* النوتة اللي فيها زرار: الزرار ينزل سطر لوحده بدل ما يزاحم النص */
  .note{flex-wrap:wrap;row-gap:8px}
  .note>span{flex:1 1 100%;min-width:0}
  .note>.btn,.note>.pop-anchor{flex:0 0 auto;margin-inline-start:auto}
  /* مساحات لمس مريحة على الموبايل والتابلت (الحد الأدنى 40، و44 لأزرار البوب أب والتابات) */
  #main .btn{min-height:40px}
  #main .icon-btn{width:40px;height:40px}
  #main .tab{min-height:44px}
  /* البوب أب: الجسم بياخد الفاضي فالفوتر يفضل تحت، والأزرار بتلف بدل ما النص يتقص */
  .modal .modal-b{flex:1 1 auto}
  .modal-f{flex-wrap:wrap;height:auto;min-height:64px;padding-block:12px}
  .modal-f>.btn,.modal-f>.pop-anchor{flex:1 1 140px;min-height:44px}
  .modal-f>.pop-anchor>.btn{width:100%;min-height:44px}
}

/* ===== المرحلة 5.5 — مكوّنات الـ v2 المشتركة (owner 31 Oct / 1 Nov): التحديد الجماعي · الفلتر المقفول · شيبس النتيجة ===== */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.bulk-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 12px;border-radius:var(--radius-md);background:var(--color-brand-subtle-bg);border:1px solid var(--color-border-subtle)}
.bulk-bar>b{white-space:nowrap}
.sel-col{width:44px;padding-inline:12px 4px}
.act-col{width:56px;text-align:center}
tr.is-sel td{background:var(--color-brand-subtle-bg)}
.menu .opt-group{padding:8px 12px 4px;color:var(--color-text-secondary);font-weight:600}
.view-menu{min-width:240px;max-height:min(70vh,520px);overflow-y:auto}
.view-menu .opt.multi{display:flex;align-items:center;gap:8px}
.view-menu .mchk{width:18px;height:18px;flex:none;border:1px solid var(--color-border-default);border-radius:4px;display:inline-flex;align-items:center;justify-content:center;background:var(--color-bg-base)}
.view-menu .opt[aria-checked=true] .mchk,.view-menu .opt[aria-selected=true] .mchk{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-bg-base)}
.view-menu .opt[aria-selected=true],.view-menu .opt[aria-checked=true]{background:transparent}
.view-foot{position:sticky;bottom:0;display:flex;justify-content:space-between;gap:8px;padding:8px;border-top:1px solid var(--color-border-subtle);background:var(--color-bg-base)}
.select.has-val{border-color:var(--color-brand-default);color:var(--color-brand-default)}
.select .val>svg,.select .val>.ic,.val>svg{vertical-align:middle;position:relative;top:-1px;margin-inline-end:4px}
.sm-v{color:var(--color-text-secondary);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* active filters row — same look as orders (owner 1 Nov) */
.af-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding-block:12px}
.af-chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding-inline:12px 10px;border:1px solid var(--color-border-default);border-radius:999px;background:var(--color-bg-base);color:var(--color-text-primary);font:inherit;font-size:13px;font-weight:600;max-width:100%;cursor:pointer}
.af-chip:hover{border-color:var(--color-brand-default)}.af-chip:hover .af-x{color:var(--color-error-base,#b42318)}
.af-chip:focus-visible,.af-clr:focus-visible{outline:2px solid var(--color-brand-default);outline-offset:2px}
.af-t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.af-c{min-width:20px;height:20px;padding-inline:6px;border-radius:999px;background:var(--color-brand-default);color:var(--color-bg-tint);font-size:11px;font-weight:700;line-height:20px;text-align:center;flex:none}
.af-x{display:inline-flex;width:16px;height:16px;align-items:center;justify-content:center;flex:none}.af-x svg{width:14px;height:14px}
.af-n{font-size:13px;color:var(--color-text-secondary);font-weight:600;white-space:nowrap}
.af-clr{display:inline-flex;align-items:center;white-space:nowrap;flex:none;height:32px;padding-inline:14px;border:0;border-radius:6px;background:var(--color-bg-container);color:var(--color-brand-default);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.af-clr:hover{background:var(--color-bg-hover)}
@media (max-width:1023px){.af-chip,.af-clr{height:44px}}
tr.af-hide{display:none!important}
.af-empty{margin:12px 0}
@media (max-width:599px){.table-title [data-auto-ctl] .sm-v,.sec-h [data-auto-ctl] .sm-v{display:none}}
/* ترويسة كارت الجدول (owner 1 Nov): المعلومات تحت التايتل ومحاذية يمين معاه، والأزرار على الشمال */
.table-title .tt-main{display:flex;flex-direction:column;gap:2px;min-width:0;margin-inline-end:auto}
.table-title .tt-main .count{margin:0}
.table-title .acts-inline{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
@media (max-width:1023px){.table-title .tt-main{flex:1 1 100%}}
/* موبايل (owner 1 Nov): قوايم الفلتر = bottom sheet بعرض الشاشة، زرار «اعرض N» ثابت تحت */
@media (max-width:767px){
  .table-title:has([data-auto-ctl]) [data-auto-ctl]{flex:1 1 0;min-width:0}
  .table-title:has([data-auto-ctl]) [data-auto-ctl] .select{width:100%}
  .table-title [data-cols]{flex:none}
  .menu.view-menu{position:fixed!important;inset:auto 0 0 0!important;top:auto!important;left:0!important;right:0!important;width:100%!important;max-width:100%!important;min-width:0!important;max-height:75vh!important;border-radius:16px 16px 0 0;box-shadow:0 -12px 32px rgba(46,42,27,.28);z-index:300;padding-bottom:env(safe-area-inset-bottom)}
  .menu.view-menu .view-foot{position:sticky;bottom:0;background:var(--color-bg-base);padding-block:12px;border-top:1px solid var(--color-border-subtle)}
  .menu.view-menu .view-foot .btn{min-height:44px;flex:1}
  .menu.view-menu .opt{min-height:44px}
  .sec-h:has(.acts .select){flex-wrap:wrap;row-gap:8px}
  .sec-h:has(.acts .select)>div:first-child{flex:1 1 100%}
  .sec-h .acts:has(.select){flex:1 1 100%;display:flex;flex-wrap:nowrap;gap:8px;align-items:center}
  .sec-h .acts:has(.select)>.pop-anchor{flex:1 1 0;min-width:0}
  .sec-h .acts:has(.select)>.pop-anchor .select{width:100%}
  .sec-h .acts:has(.select) .select .val{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
  .sec-h .acts:has(.select)>[data-cols]{flex:none}
}
/* ===== المبتكرين — تحديد وتعديل جماعي (owner 31 Oct) ===== */
#vendors .tickets-table th.sel-col,#vendors .tickets-table td.sel-col{width:44px;padding-inline:12px 4px}
#vendors .tickets-table th.act-col,#vendors .tickets-table td.act-col{width:56px;text-align:center}
#vendors .tickets-table tr.is-sel td{background:var(--color-brand-subtle-bg)}
#vendors .vcard-title{display:flex;align-items:center;gap:8px}
#vendors .table-card>.bulk-bar,#vendors .table-card>.af-row{margin-inline:24px}
/* درج المبتكر › المنتجات */
.vprod-list{display:flex;flex-direction:column}
.vprod-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--color-border-subtle)}
.vprod-row:last-child{border-bottom:0}
.vprod-row .thumb{width:48px;height:48px;border-radius:var(--radius-sm,4px);flex:0 0 48px;background:var(--color-bg-tint);overflow:hidden;display:inline-flex;align-items:center;justify-content:center}
.vprod-row .thumb img{width:100%;height:100%;object-fit:cover}
.vprod-row .vp-name{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;flex:1}
.vprod-row .vp-name b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.vprod-row .vp-name small{color:var(--color-text-secondary)}
.vprod-row .vp-price{display:flex;flex-direction:column;align-items:flex-end;gap:2px;white-space:nowrap}
.vprod-row .vp-price s,.vprod-row .vp-price s .num{color:var(--color-text-secondary);font-size:13px;text-decoration:line-through}
.vtab-go{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.vp-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:4px}
.vp-tools .search-field{flex:1 1 220px}
.vp-all{display:inline-flex;align-items:center;gap:6px}
.vprod-row.is-sel{background:var(--color-brand-subtle-bg);margin-inline:-8px;padding-inline:8px;border-radius:var(--radius-sm,4px)}
.drawer .bulk-bar{flex-wrap:wrap}
/* الحسابات — المرحلة 5.5 (owner 31 Oct / 1 Nov): آخر طلب سحب · رصيد إبتكر بعد المبتكرين · ملخص الاشتراكات · فترة سجل الحركات */
.last-wd{display:inline-flex;flex-direction:column;gap:2px;line-height:1.3}
.owed-card{padding:0 0 4px}
.owed-card .owed-cards{grid-template-columns:repeat(3,minmax(0,1fr));padding:0 16px 8px}
@media (max-width:767px){.owed-card .owed-cards{grid-template-columns:1fr}}
.subs-sum{padding:16px 20px;display:flex;flex-direction:column;gap:12px}
.subs-sum-h{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.subs-sum-h h2{margin:0;color:var(--color-brand-default)}
.subs-sum-b{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.subs-sum-b>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.subs-sum-b .neg{color:var(--color-error-text,#b42318)}
@media (max-width:767px){.subs-sum-b{grid-template-columns:repeat(2,minmax(0,1fr))}}
#main .table-card>.bulk-bar,#main .table-card>.af-row{margin-inline:24px}
@media (max-width:767px){.mlog-bar>input[type=search],.mlog-bar>.pop-anchor{flex:1 1 100%;width:100%!important}.mlog-bar>.pop-anchor .date-field{width:100%}}
/* ترتيب بالسحب في «تخصيص اللوحة» (owner 28 Oct) */
.dash-cust .dc-row .dc-grip{order:-1;flex:none;width:28px;height:28px;display:grid;place-items:center;border:0;background:transparent;border-radius:var(--radius-xs,4px);color:var(--color-text-secondary);cursor:grab;touch-action:none}
.dash-cust .dc-row .dc-grip:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}
.dash-cust .dc-row .dc-grip:active{cursor:grabbing}
.dash-cust .dc-row .dc-grip:focus-visible{outline:2px solid var(--color-action-default);outline-offset:1px}
.dash-cust .dc-row.dragging{background:var(--color-bg-tint);box-shadow:var(--shadow-popover);border-radius:var(--radius-sm);position:relative;z-index:2}
.dash-cust.sorting{cursor:grabbing}
.dash-cust.sorting .dc-row:not(.dragging){transition:transform .12s ease}
.dash-cust .dc-row{grid-template-columns:auto minmax(0,1fr) auto}

/* ===== المرحلة 5.5 قرار 7 — قواعد صاحب المشروع بتاريخ من الـ prototype v2 (زي ما هي) ===== */
/* الزرار الرئيسي في أي بوب أب بالأخضر زي أزرار الإضافة (owner 1 Nov 21:51) */
.modal .btn-primary,.drawer .btn-primary{background:var(--color-brand-default);color:var(--color-text-on-brand)}
.modal .btn-primary:hover,.drawer .btn-primary:hover{background:var(--color-brand-hover)}
.modal .btn-primary:disabled,.drawer .btn-primary:disabled{background:var(--color-bg-disabled);color:var(--color-text-disabled)}
/* كروت الرسوم مكانتش بتكبر على قد المحتوى: العمود الأب بيضغطها (flex-shrink) فالنص اللي تحت بيركب على الأشرطة (owner 31 Oct) */
.charts,[data-rgroup]{flex-shrink:0}
.chart-card>*{flex-shrink:0}
.chart-card .chart-foot{margin-top:auto;padding-top:4px}
/* أيقونة + نص في نفس السطر (owner 1 Nov): دايمًا في النص رأسيًا */
.select .val>svg,.select .val>.ic,.val>svg{vertical-align:middle;position:relative;top:-1px;margin-inline-end:4px}
/* اختيار الفترة (owner 1 Nov — مشكلة السكرول): التقويم والاختيارات بيعملوا سكرول جوه، وسطر التواريخ والأزرار ثابتين تحت ومش بيتغطّوا */
.dp.range{overflow:hidden}
.dp.range .dp-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
.dp.range .presets{overflow-y:auto;overscroll-behavior:contain}
.dp.range .range-row,.dp.range .dp-foot{flex:none;background:var(--color-bg-elevated);position:relative;z-index:1}
@media (max-width:767px){
  /* موبايل: bottom sheet بعرض الشاشة، الأزرار تحت في متناول الصباع */
  .dp.range{inset:auto 0 0 0!important;top:auto!important;width:100%!important;max-height:88vh!important;overflow:hidden;border-radius:16px 16px 0 0;box-shadow:0 -12px 32px rgba(46,42,27,.28);z-index:300}
  .dp.range .cal{width:100%}.dp.range .cal-grid{grid-template-columns:repeat(7,minmax(0,1fr))}.dp.range .day{width:100%;height:40px}
  .dp.range .dp-foot .btn{min-height:44px;flex:1}.dp.range .dp-foot .tz{flex-basis:100%}.dp.range .dp-foot{flex-wrap:wrap;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
}
@media (max-width:767px){
  .dp.range .range-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px 16px}
  .dp.range .range-row>:first-child,.dp.range .range-row>.check{grid-column:1/-1}
  .dp.range .range-row>span:not(.check){display:none}
  .dp.range .range-row .input{height:44px}
}
@media (max-width:767px){
  .dp.range .range-row>*{min-width:0;width:100%!important;box-sizing:border-box}
  /* الشهرين تحت بعض على الموبايل — عشان سهم «الشهر الجاي» يبقى موجود (كان مستخبي مع الشهر التاني) */
  .dp.range .cal+.cal{display:block}
  .dp.range .cals{flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:16px;flex:none}
}
@media (max-width:767px){.dp.range .cals>.cal{width:100%!important;max-width:none}.dp.range .cals>.cal .cal-grid{width:100%}}
@media (max-width:767px){.dp.range .cals{width:100%;box-sizing:border-box}}
/* البوباب (owner 1 Nov): أقصى عرض 800 على الديسكتوب (≥1024) في كل السيستم — الجداول جواه بتعمل سكرول أفقي بدل ما تكبّر البوباب */
@media (min-width:1024px){.modal,.modal.wide,.modal.mid,.modal.xl{max-width:min(800px, calc(100vw - 32px))}}
/* ===== Inner spacing (owner 31 Oct 18:16): مفيش محتوى لازق في حرف الكارت — 16px فوق/تحت و20px يمين/شمال، والجدول بس هو اللي فل-بليد ===== */
.dash-card{padding:var(--space-md) 20px}
.dash-card.tbl-v2>.scroll-x,.dash-card.tbl-v2>.xwrap{margin-inline:-20px;width:calc(100% + 40px);max-width:none}
.tbl-v2>.sec-b>:not(.scroll-x,.xwrap,.sticky-wrap,table,.empty,.sr-only){margin-inline:20px}
.tbl-v2>.sec-b>:not(.scroll-x,.xwrap,.sticky-wrap,table,.empty,.sr-only):first-child{margin-top:var(--space-md)}
.tbl-v2>.sec-b>:not(.scroll-x,.xwrap,.sticky-wrap,table,.empty,.sr-only):last-child{margin-bottom:var(--space-md)}
.tbl-v2>.sec-b>:is(.toolbar,.bulk-bar,p,.legend,.note,.help,.t-small){margin-block:var(--space-sm)!important;margin-inline:20px!important}
.tbl-v2>.sec-b>.toolbar:first-child{margin-top:var(--space-md)}
.tbl-v2>:is(p,.note,.toolbar,.legend,.help,.bulk-bar,.t-small){margin:var(--space-sm) 20px!important}
.tbl-v2>:is(p,.note,.toolbar,.legend,.help,.bulk-bar,.t-small):last-child{margin-bottom:var(--space-md)!important}
.tbl-v2>.sec-b>:is(.toolbar,.bulk-bar,p,.legend,.note,.help,.t-small):last-child{margin-bottom:var(--space-md)!important}
.owed-card{padding:var(--space-md) 20px}
@media (max-width:1023px){.dash-card{padding:var(--space-sm) var(--space-md)}.dash-card.tbl-v2>.scroll-x,.dash-card.tbl-v2>.xwrap{margin-inline:calc(-1*var(--space-md));width:calc(100% + 32px)}
  .tbl-v2>.sec-b>:not(.scroll-x,.xwrap,.sticky-wrap,table,.empty,.sr-only){margin-inline:0!important}}

/* كارت التجميع على الجدول القياسي: ترويسة بخلفية container والجدول فل-بليد */
.cons.tbl-v2{padding:0;gap:0}
.cons.tbl-v2>.cons-h{background:var(--color-bg-container);padding:14px 20px}
.cons.tbl-v2>:not(.cons-h,.scroll-x,.xwrap,.sticky-wrap,table){margin:var(--space-sm) 20px}
/* ===== Touch & small screens (owner 31 Oct 19:32): كل حاجة بتتداس ≥ 44 على الموبايل والتابلت، ومفيش صف بيتقص ===== */
@media (max-width:1023px){
  /* أزرار حقيقية بتكبر لـ 44 */
  .topbar .ai-btn,.topbar .user-btn,.subtab,.sn-i,.seg-b,.ptab,.icon-btn.acc-tog,.pages .btn,.sec-b>.btn-text,.set-nav-item{min-height:44px}
  .icon-btn.acc-tog{min-width:44px}
  /* عناصر صغيرة جوه سطر: مساحة ضغط 44 من غير ما شكلها يكبر */
  .cb,.sw,.kpi-details,.kpi-more,nav.crumbs a,button.tg,.link-btn,.dash-link,.dash-name,.dc-grip,a.num,.who-cell,.ptab .cnt{position:relative}
  :is(.cb,.sw,.kpi-details,.kpi-more,nav.crumbs a,button.tg,.link-btn,.dash-link,.dash-name,.dc-grip,a.num,.who-cell)::after{content:'';position:absolute;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
  .kpi-details,.kpi-more{min-height:32px}
  /* صفوف التابات/الأقسام: بتلتف بدل ما تتقص */
  .ptabs{flex-wrap:wrap;overflow:visible}
  .subnav{flex-wrap:wrap;overflow:visible}
  .set-nav{flex-wrap:wrap;overflow:visible}.set-nav-item{white-space:normal}
  .st-row{grid-template-columns:24px 32px minmax(0,1fr)}.st-row .st-val{grid-column:3;justify-self:start}
}
@media (max-width:1023px){
  .tab,.chip,.cnt-in{min-height:44px}
  .check input{position:relative}.check{min-height:44px}
}
/* الموبايل: البحث العام بيبقى أيقونة 44 — لما تدوس عليه بيفتح بعرض الهيدر كله */
@media (max-width:767px){
  .topbar{position:sticky}
  .topbar .search{flex:0 0 44px;width:44px;height:44px;padding:0;justify-content:center;border-color:transparent;background:transparent;cursor:pointer}
  .topbar .search input{width:0;flex:0 0 0;padding:0}
  .topbar .search:focus-within{position:absolute;inset:2px 12px;width:auto;height:44px;z-index:6;justify-content:flex-start;padding:0 12px;background:var(--color-bg-base);border-color:var(--color-border-focus);box-shadow:var(--shadow-popover)}
  .topbar .search:focus-within input{flex:1;width:auto}
}

@media (max-width:767px){
  .topbar{gap:4px;padding:0 8px}
  .topbar .clock-done{font-size:0;gap:2px}.topbar .clock-done b{font-size:12px}
  .topbar .clock-widget .btn{width:44px;padding:0;gap:0;font-size:0}.topbar .clock-widget .btn svg{width:20px;height:20px}
  .clock .lbl{display:none}
}
@media (max-width:1023px){.topbar .user .t-label{max-width:88px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media (max-width:1023px){
  .topbar .qa-lbl,.topbar .qa-anchor .btn svg:last-child{display:none}.topbar .qa-anchor .btn{width:44px;padding:0}
  .topbar .clock .lbl{display:none}
  .topbar .ai-btn{min-width:44px;justify-content:center}
  .pages .btn,.sec-b>.btn-text{min-width:44px}
  .st-row .st-val{white-space:normal;min-width:0}
}
@media (max-width:1023px){.topbar .user-btn .nm,.topbar .user-btn>svg{display:none}.topbar .user-btn{min-width:44px;justify-content:center}}
@media (max-width:1023px){.sec-b>.btn-text{min-height:44px!important;height:auto!important;white-space:normal;text-align:start}}
/* كروت الجداول على الموبايل/التابلت: لو أول عمود checkbox التحديد، الـ checkbox بيبقى في ركن الكارت والعمود التاني هو العنوان */
@media (max-width:1023px){
  .scroll-x tr:has(>td:first-child>[role=checkbox]:only-child){position:relative}
  .scroll-x tr:has(>td:first-child>[role=checkbox]:only-child)>td:first-child{position:absolute;top:10px;inset-inline-start:12px;border:0;padding:0;grid-column:auto}
  .scroll-x tr:has(>td:first-child>[role=checkbox]:only-child)>td:nth-child(2){grid-column:1/-1;grid-row:1;padding-inline-start:40px;padding-bottom:8px;border-bottom:1px solid var(--color-border-subtle);font-weight:600;color:var(--color-brand-default);font-size:14px}
  .scroll-x tr:has(>td:first-child>[role=checkbox]:only-child):has(>td[data-l=""]:not(:first-child))>td:nth-child(2){grid-column:1/-2}
  .scroll-x tr:has(>td:first-child>[role=checkbox]:only-child)>td:nth-child(2)::before{display:none}
}
/* كروت الجداول: زرار ⋮ في الركن التاني، والعنوان بياخد عرض الكارت كله */
@media (max-width:1023px){
  .scroll-x tbody tr:has(>td[data-l=""]:not(:first-child)){position:relative}
  .scroll-x tbody tr>td[data-l=""]:not(:first-child){position:absolute;top:6px;inset-inline-end:6px;grid-column:auto;grid-row:auto}
  .scroll-x tbody tr:has(>td[data-l=""]:not(:first-child))>td:first-child,
  .scroll-x tbody tr:has(>td:first-child>[role=checkbox]:only-child):has(>td[data-l=""]:not(:first-child))>td:nth-child(2){grid-column:1/-1;padding-inline-end:48px}
  .scroll-x tbody tr:has(>td:first-child>[role=checkbox]:only-child)>td:nth-child(2){height:auto;min-height:0;overflow:visible}
}

/* global search results (owner 1 Nov) */
.gq-wrap{position:relative;flex:1 1 auto;min-width:0;max-width:520px}.gq-wrap>.search{width:100%}
.gq-res{position:absolute;top:calc(100% + 4px);inset-inline:0;z-index:60;max-height:min(70vh,480px);overflow-y:auto;min-width:280px}
.gq-res[hidden]{display:none}
.gq-opt{display:flex!important;flex-direction:column;align-items:flex-start;gap:2px;text-align:start}
.gq-opt[aria-selected=true]{background:var(--color-bg-tint)}
.gq-empty{padding:12px;color:var(--color-text-secondary)}
@media (max-width:767px){.gq-res{position:fixed;top:56px;inset-inline:8px}}

/* «.wrap» (لف النص، max 280) كان بيقفل عرض أي «toolbar wrap» على 280px — owner 1 Nov */
.toolbar.wrap{display:flex;max-width:none;white-space:normal}

/* ===================== مقاسات الأزرار والكنترولز الموحدة (owner 31 Oct) =====================
   القاعدة: 3 مقاسات بس، وأي عناصر جنب بعض في نفس الصف بنفس المقاس.
   ┌──────┬────────┬───────────────────────────────────────────────────────────────┐
   │ Size │ Height │ بيتستخدم فين                                                    │
   ├──────┼────────┼───────────────────────────────────────────────────────────────┤
   │ sm   │ 32px   │ جوه صفوف الجداول والقوايم بس (إجراءات الصف)                       │
   │ md   │ 36px   │ الافتراضي في كل حتة تانية: هيدر الصفحة، هيدر السكشن، التولبار،   │
   │      │        │ الفلاتر، الفورمز، الكروت، فوتر البوب أب، شريط التحديد            │
   │ lg   │ 44px   │ الموبايل والتابلت (≤1023px) لكل الكنترولز — مساحة لمس            │
   └──────┴────────┴───────────────────────────────────────────────────────────────┘
   الأزرار، أزرار الأيقونات، القوايم المنسدلة، حقول البحث والتاريخ كلهم بيمشوا على نفس الجدول.
   الملف ده بيتحمّل آخر حاجة عشان يكون هو المرجع. */
:root{--ctl-sm:32px;--ctl-md:36px;--ctl-lg:44px}

/* md — الافتراضي (ديسكتوب بكل عروضه، من غير تصغير عند 1300) */
.btn,.btn.sm,.btn.lg{height:var(--ctl-md);min-height:var(--ctl-md);padding:0 14px;font-size:14px;gap:8px}
.btn.lg{height:var(--ctl-lg);min-height:var(--ctl-lg);padding:0 20px}
.icon-btn{width:var(--ctl-md);height:var(--ctl-md);min-height:var(--ctl-md)}
.select,.date-field,.sort-btn,.search-field,input.input,.input:not(textarea):not(.textarea){height:var(--ctl-md);min-height:var(--ctl-md)}
.pop-anchor>.btn,.pop-anchor>.select{height:var(--ctl-md)}

/* sm — صفوف الجداول والقوايم بس: كل اللي في الصف بنفس المقاس */
:is(td,.pick-row,.cv,.dn-item,.rule,.set-row,.chan-opt,.list-row) :is(.btn,.btn.sm){height:var(--ctl-sm);min-height:var(--ctl-sm);padding:0 10px;font-size:13px;gap:6px}
:is(td,.pick-row,.cv,.dn-item,.rule,.list-row) .icon-btn{width:var(--ctl-sm);height:var(--ctl-sm);min-height:var(--ctl-sm)}
td :is(.select,.date-field,.input:not(textarea)){height:var(--ctl-sm);min-height:var(--ctl-sm)}

/* زرار النص بياخد نفس الارتفاع عشان يتصف مع اللي جنبه */
.btn-text{height:var(--ctl-md)}
:is(td,.pick-row,.cv,.dn-item,.rule,.list-row) .btn-text{height:var(--ctl-sm)}

/* lg — اللمس (موبايل وتابلت): كل الكنترولز 44 */
@media (max-width:1023px){
  .btn,.btn.sm,.btn.lg,#main .btn,:is(td,.pick-row,.cv,.dn-item,.rule,.set-row,.chan-opt,.list-row) :is(.btn,.btn.sm,.btn-text){height:var(--ctl-lg);min-height:var(--ctl-lg)}
  .icon-btn,#main .icon-btn,:is(td,.pick-row,.cv,.dn-item,.rule,.list-row) .icon-btn{width:var(--ctl-lg);height:var(--ctl-lg);min-height:var(--ctl-lg)}
  .select,.date-field,.sort-btn,.search-field,input.input,.input:not(textarea):not(.textarea),td :is(.select,.date-field,.input:not(textarea)){height:var(--ctl-lg);min-height:var(--ctl-lg)}
}


/* phase 8 — team tickets: attachments (the picker, the chips, the thumbnails in the timeline) */
.tk-attach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tk-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tk-file { display: inline-flex; align-items: center; gap: 4px; max-width: 240px; }
.tk-file .linkish, .tk-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-file .linkish { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; text-decoration: underline; }
.tk-file .icon-btn { width: 24px; height: 24px; min-width: 24px; }
.tk-thumb-btn { padding: 0; border: 1px solid var(--color-border, #ddd); border-radius: 8px; background: var(--color-surface, #fff); cursor: pointer; overflow: hidden; width: 72px; height: 72px; }
.tk-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-msg { display: flex; flex-direction: column; }
.tk-msg .tk-files { margin-inline-start: 40px; }
.tk-own { display: flex; flex-direction: column; gap: 4px; }
.tk-reply { display: flex; flex-direction: column; gap: 8px; }
/* phase 8 decision 19: «رقم الأوردر» with the matching orders under it */
.tk-order { position: relative; }
.tk-order-opts { position: absolute; inset-inline: 0; top: 100%; z-index: 30; margin-top: 4px; max-height: 260px; overflow: auto; background: var(--color-surface, #fff); border: 1px solid var(--color-border, #ddd); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); display: flex; flex-direction: column; }
.tk-order-opts[hidden] { display: none; }
.tk-order-opt { text-align: start; background: none; border: 0; padding: 8px 12px; cursor: pointer; font: inherit; color: inherit; }
.tk-order-opt:hover, .tk-order-opt:focus { background: var(--color-bg-hover); outline: none; }
/* phase 9: «قريبًا» on a reports tab (staff / campaigns until their pages) */
.tabs .tab .soon { margin-inline-start: 6px; background: var(--color-bg-tint); color: var(--color-text-secondary); }
/* ===== phase 5.5 decision 12 (owner 5 Nov): الجدول القياسي tbl-v2 على كل الجداول — ترويسة كارت + صف عناوين أخضر + صفوف متبادلة
   (القواعد من الـ prototype بالحرف؛ الكلاس بيتحط لوحده من الكتلة 14 — stdTables / sweepColumns — على كارت أي جدول من 3 أعمدة
   فأكتر برّه البوب أب والدرج) ===== */
/* table zebra (owner 26 Oct): clear alternating rows — light beige / darker beige */
tbody tr:nth-child(odd) td{background:var(--color-bg-base)}
tbody tr:nth-child(even) td{background:var(--color-bg-tint)}
.tbl-v2{overflow:hidden}
.tbl-v2>.sec-h{background:var(--color-bg-container);border-bottom:0;padding:14px 20px;align-items:flex-start}
.tbl-v2>.sec-h>div:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}
.tbl-v2>.sec-h h2,.tbl-v2>.table-title h2{color:var(--color-brand-default)}
.tbl-v2>.sec-h .sub,.tbl-v2>.table-title .count{color:var(--color-text-secondary)}
.tbl-v2>.sec-b{padding:0;gap:0}
.tbl-v2>.sec-b>.scroll-x{margin:0;width:100%;max-width:100%}
.tbl-v2>.sec-b>.scroll-x>table{width:100%;table-layout:auto}
.tbl-v2 .dt td{white-space:normal}
.tbl-v2 thead th{background:var(--color-brand-default);color:var(--color-text-on-brand);border-bottom:0;height:52px;min-width:72px}
.tbl-v2 th,.tbl-v2 td{padding-inline:10px}
.tbl-v2 thead th:first-child{text-align:start}
.tbl-v2 tbody td:first-child{text-align:start;font-weight:600}
.tbl-v2 tbody td{height:48px}
.tbl-v2 tbody tr:last-child td{border-bottom:0}
.tbl-v2 .pct{display:flex;align-items:center;gap:8px;justify-content:center}
.tbl-v2 .pct .bar{flex:1 1 72px;min-width:56px;max-width:110px}
.tbl-v2 .empty{padding:24px}
@media (max-width:1023px){
  /* في وضع الكروت الترويسة الخضرا بتتخفي أصلاً — بنرجّع الحشو للكروت */
  .tbl-v2>.sec-b{padding:12px}
  .sec.tbl-v2 tbody td,.tbl-v2 tbody td:first-child{height:auto}
}
/* الجدول القياسي على كل الجداول (owner 28 Oct): كروت الجداول والسكاشن بنفس الشكل */
.tbl-v2>.table-title{background:var(--color-bg-container);padding:14px 20px}
.tbl-v2>.table-title+.scroll-x,.tbl-v2>.table-title+.xwrap{margin:0}
.tbl-v2 .sticky-wrap .st-table thead th:is(:first-child,:last-child){background:var(--color-brand-default)}
.tbl-v2 thead th .cb,.tbl-v2 thead th .sw{color:inherit}
.tbl-v2 thead th a,.tbl-v2 thead th button:not(.btn){color:inherit}
.tbl-v2 tfoot td,.tbl-v2 tr.total td{background:var(--color-bg-tint)!important}
/* كارت جدول من غير عنوان: الترويسة تبقى شريط صغير لزرار الأعمدة بس */
.tbl-v2>.sec-h.cols-only{background:var(--color-bg-container);padding:6px 12px;min-height:0;justify-content:flex-end}

/* phase 10 T8 — «تقارير الموظفين» (the prototype v5, style-1.css 755–760; scoped to .staff-top: the v5 reuses .st-row elsewhere) */
.staff-top{display:flex;flex-direction:column;gap:8px}
.staff-top .st-row{display:grid;grid-template-columns:24px 32px minmax(0,1fr) auto;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--color-border-subtle)}
.staff-top .st-row:last-child{border-bottom:0}
.staff-top .st-rank{width:24px;height:24px;border-radius:50%;background:var(--color-bg-tint);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:12px}
.staff-top .st-who{display:flex;flex-direction:column;min-width:0}.staff-top .st-who b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.staff-top .st-val{font-weight:700;white-space:nowrap}.staff-top .st-val.good{color:var(--color-success-text,var(--color-brand-default))}.staff-top .st-val.bad{color:var(--color-error-text,var(--color-error-base))}
@media (max-width:767px){.staff-top .st-row{grid-template-columns:24px 32px minmax(0,1fr)}.staff-top .st-row .st-val{grid-column:3;justify-self:start;white-space:normal;min-width:0}}

/* phase 12 T5: the online dot on «الفريق دلوقتي» */
.dt-av{position:relative;display:inline-flex}.dt-on{position:absolute;bottom:-1px;inset-inline-end:-1px;width:10px;height:10px;border-radius:50%;background:var(--color-border-subtle);border:2px solid var(--color-bg-base)}.dt-on.is-on{background:var(--color-success-default,#1f9d55)}

/* phase 13 decision 19 (owner 10 Nov — «اعملي للبوب أب maximum height يبقى 80% بحيث يسيب 10% و10% تحت»): every popup is at most 80% of the
   screen's height and sits in the middle (10% above, 10% below) on every screen size — the body scrolls inside, the header and footer stay. */
.scrim{place-items:center;align-items:center}
.modal,.modal.wide,.modal.mid,.modal.xl{max-height:80vh;max-height:80dvh}
.modal-b{min-height:0}
@media (max-width:767px){.scrim{padding:0 8px;align-items:center}.modal{max-height:80vh;max-height:80dvh;border-radius:var(--radius-md)}}
/* the owner 11 Nov («كل السايد بارز بقت ف النص خليها تيجي علي اليمين زي ما كانت في كل السيستم و البوب اب تبقي في النص»): the rule above
   centred every .scrim, the side sheets' too — a drawer comes in from the right again at full height (any size), the popups stay centred. */
.scrim.drawer-scrim{place-items:stretch start;align-items:stretch;padding:0}
@media (max-width:767px){.scrim.drawer-scrim{padding:0;align-items:stretch}}

/* phase 13 decision 20 (owner 10 Nov — «خلي البوب أب بتاع نتيجة البحث يبقى نفس عرض خانة البحث، وأقسام النتايج تاجز بخلفية خضرا مكتوب جواها بالبيج»):
   the results list takes the search field's width exactly (on every size), and each group heading is a green pill with beige text. */
.menu.gq-res{width:auto;min-width:0;max-width:none;inset-inline:0}
.menu.gq-res .opt-group{display:inline-block;width:fit-content;margin:8px 12px 4px;padding:2px 12px;border-radius:999px;background:var(--color-brand-default);color:var(--color-text-on-brand);font-weight:600;line-height:20px}
/* phone: the field opens across the whole top bar (12px from each side — «.topbar .search:focus-within»), so the wrapper stops being its
   frame and the list sits right under it at the same 12px */
@media (max-width:767px){.gq-wrap{position:static}.menu.gq-res{position:absolute;top:calc(100% + 2px);inset-inline:12px}}

/* phase 13 decision 23 (owner 10 Nov): the AI assistant moves by its header and resizes from its corner (the script puts it back to the
   medium size under the AI button on every open); the «تفاصيل» report popup. A phone keeps its full-width sheet. */
@media (min-width:768px){
  .ai-panel{resize:both;overflow:hidden;min-width:300px;min-height:320px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px)}
  .ai-panel .ai-head{cursor:move;user-select:none;touch-action:none}
  .ai-panel .ai-head button{cursor:pointer}
  .ai-panel.dragging{opacity:.96;box-shadow:0 16px 40px rgba(46,42,27,.28)}
  .ai-panel .ai-list{min-height:0}
}
.air-body{display:flex;flex-direction:column;gap:16px}
.air-answer{margin:0;padding:10px 12px;border-radius:var(--radius-md);background:var(--color-bg-container);line-height:24px;white-space:pre-wrap}
.air-sec{display:flex;flex-direction:column;gap:8px}.air-sec h3{margin:0;color:var(--color-brand-default)}
.air-sec .air-sec{padding-inline-start:12px;border-inline-start:2px solid var(--color-border-subtle)}
.air-tbl{display:flex;flex-direction:column;gap:4px}

/* phase 13 decision 26: «ملفي › تنبيهاتي» = the bell's list in the page */
.ntf-list.my-ntf{overflow:visible;padding:0;margin-top:8px}.my-ntf .ntf-item{border-bottom:1px solid var(--color-border-subtle,#e7e0d2);border-radius:0;padding:10px 4px}.my-ntf .ntf-item .chip{flex:none}
/* phase 13 decision 29 (the owner, 10 Nov — «خلي السيرش align right والباقي align left»): the search at the start (right), every other
   header item together at the end (left) — the wrapper of the search takes the free space after it (its .search's own auto margin sits
   inside the wrapper since 5.5 and pushed nothing) */
.topbar>.gq-wrap{margin-inline-end:auto}
/* owner 10 Nov (decision 46): the header of every section card is a green band with beige text, so the information splits clearly —
   the table cards (tbl-v2: their own green header row) and the settings admin cards keep their look; a header with the columns button only stays plain */
.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only){background:var(--color-brand-default);border-bottom-color:var(--color-brand-default)}
.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only) h2,.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only) .sub,
.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only) .btn-text{color:var(--color-text-on-brand)}
.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only) .sub{opacity:.85}
/* decision 46 (owner 10 Nov, «كل الأقسام اللي شكلها تايتل وتحتيه معلومات يبقى الهيدر أخضر»): the same green band with beige text on the
   other cards of that shape — the dashboard cards, the chart / report cards and the settings cards — full width, flush with the card's top */
.chart-card{--hd-t:16px;--hd-i:16px}.dash-card{--hd-t:var(--space-md);--hd-i:20px}.set-card{--hd-t:16px;--hd-i:20px}
@media (max-width:1300px){.chart-card{--hd-t:12px;--hd-i:12px}} /* the .card padding of that width (line ~421) */
@media (max-width:1023px){.dash-card{--hd-t:var(--space-sm);--hd-i:var(--space-md)}.chart-card{--hd-t:10px;--hd-i:10px}}
.chart-card>.chart-head,.dash-card:not(.tbl-v2)>.dash-h,.set-card>.set-card-h{background:var(--color-brand-default);margin:calc(-1*var(--hd-t)) calc(-1*var(--hd-i)) 0;padding:12px var(--hd-i);align-self:stretch;border-radius:var(--radius-md) var(--radius-md) 0 0}
.chart-card>.chart-head :is(h2,h3,.t-small,.sub,a,.btn-text,.link),.dash-card:not(.tbl-v2)>.dash-h :is(h2,h3,.t-small,.sub,a,.btn-text,.link),.set-card>.set-card-h :is(h2,h3,.t-small,.sub,a){color:var(--color-text-on-brand)}
.chart-card>.chart-head .t-small,.dash-card:not(.tbl-v2)>.dash-h .t-small{opacity:.85}
/* decision 46 (owner 10 Nov, «كل الزراير اللي على خلفية خضرا لونها بيج زي زرار رفع المستندات»): a button on a green header is the default
   beige button, whatever its type (primary / brand / the green «+»); the text buttons stay beige text */
:is(.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only),.chart-card>.chart-head,.dash-card:not(.tbl-v2)>.dash-h,.set-card>.set-card-h) .btn:not(.btn-text){background:var(--color-bg-container);border-color:var(--color-border-default);color:var(--color-text-primary)}
:is(.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only),.chart-card>.chart-head,.dash-card:not(.tbl-v2)>.dash-h,.set-card>.set-card-h) .btn:not(.btn-text):hover{border-color:var(--color-action-default);color:var(--color-text-primary)}
:is(.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only),.chart-card>.chart-head,.dash-card:not(.tbl-v2)>.dash-h,.set-card>.set-card-h) .btn-text{color:var(--color-text-on-brand)}
/* the open «بحث» on a green header: the dark brand beige (green on green would hide it) */
:is(.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only),.chart-card>.chart-head,.dash-card:not(.tbl-v2)>.dash-h,.set-card>.set-card-h) .tq-btn[aria-expanded=true]{background:var(--color-brand-subtle-bg);border-color:var(--color-brand-subtle-bg);color:var(--color-brand-default)}
/* phase 13 decision 49 (owner 10 Nov): the general actions of the quick-actions menu in green */
.menu .opt.opt-general{color:var(--color-brand-default);font-weight:600}.menu .opt.opt-general svg{color:var(--color-brand-default)}
/* phase 13 decision 50: the fixed first column keeps the grip's place in the columns popup */
.dash-cust .dc-row .dc-grip-sp{order:-1;flex:none;width:28px}
/* phase 13 decision 55: the settings reasons lists are ordered by the same six-dot grip as «تخصيص اللوحة» */
.reason-cell{display:flex;align-items:center;justify-content:flex-start;gap:var(--space-xs,6px)}
.reason-cell .dc-grip-sp{flex:none;width:28px}
table:has(.reason-cell) :is(th,td):first-child{text-align:start}
.reason-cell .dc-grip{flex:none;width:28px;height:28px;display:grid;place-items:center;border:0;background:transparent;border-radius:var(--radius-xs,4px);color:var(--color-text-secondary);cursor:grab;touch-action:none}
.reason-cell .dc-grip:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}
.reason-cell .dc-grip:active{cursor:grabbing}
.reason-cell .dc-grip:focus-visible{outline:2px solid var(--color-action-default);outline-offset:1px}
tr.dragging{background:var(--color-bg-tint)}
/* Phase 13 decision 59 (owner 11 Nov — «خلي زرار التعديل زرار فرعي بخلفية خضرا و كلام لونه بيج»): the action of a drawer section's
   header (تعديل / إضافة … / فتح في الأوردرات …) is a small secondary button, green with beige text. */
.vsection .head>.btn-text{background:var(--color-brand-default);color:var(--color-text-on-brand);height:var(--ctl-sm,32px);padding:0 12px;border-radius:var(--radius-sm,6px)}
.vsection .head>.btn-text:hover{background:var(--color-brand-hover);color:var(--color-text-on-brand)}
.vsection .head>.btn-text svg{color:inherit}
/* phase 13 decision 61: the accounts «نظرة عامة» tiles open their tab */
.acc-ov-tile{display:flex;flex-direction:column;gap:4px;min-width:0}
.acc-ov-tile>.kpi{flex:1}
.acc-ov-tile>.btn-text{align-self:flex-start}
/* «بيحصل إيه دلوقتي» (the owner, 11 Nov): the running actions at the bottom centre, just above the toast — a spinner and what is
   happening, then the result (✓ / !) for a moment; on the phone above the bottom bar */
.busy-stack{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(max(24px,env(safe-area-inset-bottom,0px)) + 52px);z-index:201;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;width:max-content;max-width:calc(100vw - 32px)}
.busy-pill{display:flex;align-items:center;gap:10px;max-width:100%;padding:10px 18px;border-radius:999px;background:var(--color-text-primary);color:var(--color-bg-base);box-shadow:var(--shadow-popover);font-weight:600;line-height:1.4;opacity:0;transform:translateY(8px);transition:opacity .2s,transform .2s}
.busy-pill.show{opacity:1;transform:none}
.busy-txt{overflow-wrap:anywhere}
.busy-ico{flex:none;width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-inline-end-color:transparent;animation:ib-spin .8s linear infinite}
@keyframes ib-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.busy-ico{animation-duration:2.4s}.busy-pill{transition:none}}
.busy-pill.ok{background:var(--color-brand-default);color:var(--color-text-on-brand)}
.busy-pill.err{background:var(--color-error-text);color:var(--color-bg-base)}
.busy-pill.warn{background:var(--color-warning-base);color:var(--color-bg-base)}
.busy-pill.ok .busy-ico,.busy-pill.err .busy-ico,.busy-pill.warn .busy-ico{animation:none;border:0;width:auto;height:auto;display:inline-flex;font-weight:700}
.busy-pill.ok .busy-ico::before{content:'✓'}
.busy-pill.err .busy-ico::before,.busy-pill.warn .busy-ico::before{content:'!'}
@media (max-width:767px){.busy-stack{bottom:136px}}
/* MultiPick (the owner, 11 Nov): a multi-select with search — «الفئة الأساسية» and the filter dropdowns; the sub-levels with «-» */
.mp-menu{min-width:260px;padding-top:0}
.mp-qw{position:sticky;top:0;z-index:1;background:var(--color-bg-base);padding:8px;border-bottom:1px solid var(--color-border-subtle)}
.mp-qw .mp-q{width:100%;height:36px;min-height:36px}
.mp-list{display:flex;flex-direction:column}
.mp-menu .opt.mp-sub .mp-l{color:var(--color-text-secondary)}
.mp-empty{margin:8px 12px;color:var(--color-text-secondary)}
.mp-field .select{width:100%}
/* B5 (the owner, 11 Nov): a table's filter is a row of dropdowns (search + ticks), one per column whose values repeat */
.fm-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.fm-row .mp .select{min-width:120px}
.af-picks{padding-block:12px 0}
#vendors .table-card>.af-picks{margin-inline:24px}
#main .table-card>.fm-row,#vendors .table-card>.fm-row{margin-inline:24px;padding-top:12px}
.tbl-v2>.fm-row{margin-inline:20px}

/* the owner 12 Nov: a long select (the makers) opens with a search box on top — the kit's Select (block 10) */
.menu.has-search{padding-top:0}
.menu.has-search .menu-search{position:sticky;top:0;z-index:1;display:block;width:100%;box-sizing:border-box;height:36px;margin:0 0 4px;padding:0 12px;border:0;border-bottom:1px solid var(--color-border-subtle);border-radius:0;background:var(--color-bg-elevated);color:var(--color-text-primary);font:inherit}
.menu.has-search .menu-search:focus{outline:none;border-bottom-color:var(--color-brand-default)}
.menu.has-search .menu-empty{padding:10px 12px;color:var(--color-text-secondary)}
.menu .opt[hidden]{display:none}

/* the owner 12 Nov: a table's «فلتر» is one button next to the sort again (B5's row of dropdowns moved inside it) — the panel holds
   each group with its ticks and a search box in a long group */
.menu.fm-menu{width:340px;max-width:calc(100vw - 32px);max-height:min(72vh,560px);padding:0 0 4px}
/* the owner 12 Nov: the groups as tabs in a strip that scrolls sideways; the tab picked shows its search and its ticks */
.fm-menu .fm-tabs{display:flex;gap:8px;overflow-x:auto;padding:12px 12px 10px;scroll-snap-type:x proximity;scrollbar-width:thin;position:sticky;top:0;z-index:1;background:var(--color-bg-elevated);border-bottom:1px solid var(--color-border-subtle)}
/* each tab = the kit's .chip (32px, round, subtle border) — the one open green with beige text and its count in the gold badge */
.fm-menu .fm-tab{flex:0 0 auto;white-space:nowrap;cursor:pointer;font:inherit;font-weight:500;color:var(--color-text-primary);scroll-snap-align:start}
.fm-menu .fm-tab:hover{border-color:var(--color-brand-default)}
.fm-menu .fm-tab[aria-selected=true]{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
.fm-menu .fm-tab[aria-selected=true] .cnt{background:var(--color-action-default);color:var(--color-text-on-action)}
.fm-menu .fm-sec{padding:0 0 4px}
.fm-menu .fm-sec[hidden]{display:none}
/* the tab's search = the kit's .input (36px) with the search icon */
.fm-menu .fm-q{width:auto;margin:10px 12px 6px;color:var(--color-text-secondary)}
.fm-menu .fm-list{max-height:260px;overflow:auto;padding:0 4px}
.fm-menu .fm-none{padding:8px 12px;margin:0}
.fm-menu .opt[hidden]{display:none}
.fm-menu .view-foot{position:sticky;bottom:0;background:var(--color-bg-elevated)}

/* the owner 12 Nov — the standard table header (his mockup): «بحث» next to «فلتر» / «ترتيب» / the columns icon, green while its row is
   open; the row under the header = the kit's input across the card + «إغلاق»; the buttons centred with the title and its line */
.tq-btn{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border:1px solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-bg-base);color:var(--color-text-primary);font:inherit;font-size:13px;font-weight:500;white-space:nowrap;cursor:pointer}
.tq-btn:hover{border-color:var(--color-brand-default)}
.tq-btn[aria-expanded=true]{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
.tq-row{display:flex;align-items:center;gap:8px;margin:12px 24px}
.tq-row[hidden]{display:none}
.tbl-v2>.tq-row{margin-inline:20px}
.tq-row .tq-field{flex:1;min-width:0;width:auto;color:var(--color-text-secondary)}
.tq-row .tq-field input{color:var(--color-text-primary)}
#main .tbl-v2>.af-row,#vendors .tbl-v2>.af-row,#main .tbl-v2>.bulk-bar,#vendors .tbl-v2>.bulk-bar{margin-inline:20px}
.tbl-v2>.sec-h,.tbl-v2>.table-title{align-items:center}
@media (max-width:767px){.tq-btn{min-height:44px}.tq-row{flex-wrap:nowrap}}
tr.tq-hide{display:none}
/* the owner 12 Nov — «شكل الـ fields واسع أوي… خليه يبقى width بتاعه موزون ومنطقي زي الاسكرينات التانية، وزر الحفظ أو المتابعة العرض بتاعه
   منطقي… ونفس الكلام في فلو المنتجات الجديدة وأي فلو فيه التالي التالي» (Meta's editor): a multi-step flow sits in one centered column
   (the campaign, the studio — its wide steps a little wider), and the footer's buttons keep their own width (full width on a phone) */
.wiz-col{width:100%;max-width:var(--wiz-w,880px);margin-inline:auto;display:flex;flex-direction:column;gap:16px;min-width:0}
.wiz-col.wiz-studio{--wiz-w:1040px}
.wiz-col>.page-head{margin-bottom:0}
.wiz-foot .btn{flex:0 0 auto;min-width:140px}
@media (max-width:599px){.wiz-foot .btn{flex:1;min-width:0}}
/* the count: + / the number in the middle / − (the owner 12 Nov) */
.cnt-ctl input.cnt-in:not([type=checkbox]):not([type=radio]){width:64px;height:36px;padding:0 4px;text-align:center;direction:ltr;unicode-bidi:normal;font-size:16px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--color-text-primary)}
.cnt-ctl input.cnt-in:focus{outline:2px solid var(--color-focus-ring, var(--color-brand-default));outline-offset:1px}
.cnt-ctl .btn{min-width:36px;height:36px;padding:0;justify-content:center;font-size:18px}

/* HR «نظرة عامة» (the owner 12 Nov): who is in now — a row per member, the state at the end */
.hr-in-list{display:flex;flex-direction:column}
.hr-in-list .hr-in{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--color-border-subtle);min-height:44px}
.hr-in-list .hr-in:last-child{border-bottom:0}
/* the HR rebuild (12 Nov): the totals under «تحويل المرتبات», the evaluator's view of the month's tasks */
.hr-transfer-sum{margin-top:12px;padding:12px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md,8px);background:var(--color-bg-subtle,transparent)}
/* comments 15 Nov decision 79: the evaluation popup — the member in a head box, the three parts as three boxes, the month's tasks, the score strip */
.modal.ev-modal{width:min(760px, calc(100vw - 32px))}
.ev-who{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);background:var(--color-bg-container);flex-wrap:wrap}
.ev-who-t{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 160px}.ev-who-t b{font-size:16px}
.ev-who-tags{display:inline-flex;gap:8px;flex-wrap:wrap}
.ev-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.ev-box{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);background:var(--color-bg-base);min-width:0}
.ev-box .field{gap:8px;min-width:0}.ev-box .sp-row{flex-wrap:wrap;row-gap:4px}
.ev-box .flabel{font-weight:600;color:var(--color-brand-default)}
.ev-att{background:var(--color-bg-container)}
.ev-num{font-size:28px;line-height:36px;font-weight:700}.ev-num small{font-size:13px;font-weight:500;color:var(--color-text-secondary)}
.ev-bar{display:block;height:6px;border-radius:999px;background:var(--color-bg-tint);overflow:hidden}.ev-bar i{display:block;height:100%;border-radius:999px;background:var(--color-brand-default)}
.ev-task-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.ev-tasks{display:flex;flex-direction:column;gap:6px;min-width:0}
.ev-tasks-h{display:flex;align-items:center;gap:8px}
.ev-tasks ul{margin:0;padding-inline-start:18px;display:flex;flex-direction:column;gap:2px}.ev-tasks li{overflow-wrap:anywhere}
.ev-total{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 14px;border-radius:var(--radius-md);border:1px dashed var(--color-border-default);background:var(--color-bg-container)}
.ev-total-l{font-weight:600}
.ev-total-n{font-size:24px;line-height:32px;font-weight:700}.ev-total-n small{font-size:13px;font-weight:500}
.ev-total.over{border-style:solid;border-color:var(--color-success-border);background:var(--color-success-bg);color:var(--color-success-text)}
.ev-total.under{border-style:solid;border-color:var(--color-error-border, #e8a4a4);background:var(--color-error-bg, #fbe9e7);color:var(--color-error-text, #a8281b)}
@media (max-width:719px){.ev-grid{grid-template-columns:minmax(0,1fr)}}
@media (max-width:600px){.ev-task-cols{grid-template-columns:1fr}}
.hr-in-list .hr-in>span:nth-of-type(2){flex:1;min-width:0}
/* the owner 12 Nov — the person / product cell in every table: the picture at the start (the right), the name right next to it aligned to the
   start; a name longer than the column is cut with «…» (the whole name on hover — personCols in the kit) */
td:has(> :is(.mlink,.prod,.who-cell)),th.c-person{text-align:start}
td > :is(.mlink,.prod,.who-cell){display:flex;justify-content:flex-start;max-width:min(260px,100%);min-width:0}
td > :is(.mlink,.prod,.who-cell) > :is(span,div):last-child{min-width:0;overflow:hidden}
td > :is(.mlink,.prod,.who-cell) :is(b,small){display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
td > :is(.mlink,.prod,.who-cell) .avatar{flex:none}

/* ===== the owner 13 Nov — mobile review ===== */
@media (max-width:767px){
  /* decision 1: the pinned page tabs are one row that scrolls sideways, edge to edge (they wrapped into 2–3 rows that stayed pinned over
     a third of the screen); block 14 keeps the selected tab in view */
  .content > .tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;margin-inline:calc(-1 * var(--gut));padding-inline:var(--gut);scroll-padding-inline:var(--gut)}
  .content > .tabs .tab{flex:none}
  .content > .tabs::before{display:none}
  /* decision 2: a table card's head wraps its controls instead of squeezing them — «فلتر» keeps its word, nothing is pushed out of the card */
  .sec-h .acts:has(.select){flex-wrap:wrap}
  .sec-h .acts:has(.select)>.pop-anchor{flex:1 1 120px;min-width:0;max-width:100%}
  .sec-h .acts:has(.select)>.pop-anchor:has([data-fm-btn]){flex:0 0 auto}
}
/* decision 3: a scroll strip holds its absolutely placed children — a screen-reader label (.sr-only) in a table scrolled sideways sat at its
   static spot past the strip, relative to the page, and pushed the whole page 121px wider (the makers' log at 1024px); the label is pinned
   to its box's corner too */
.scroll-x,.xwrap{position:relative}
.sr-only{top:0;inset-inline-start:0}
/* decision 4: a popup never runs past the screen's sides — the scrim is a grid, so a wide popup (.modal.xl 960px) grew its track and
   «max-width:100%» held nothing (the new template at 768px); the track is the scrim's width now */
.scrim{grid-template-columns:minmax(0,1fr)}
/* decision 5: a long name in a popup's pick-list wraps instead of scrolling the list sideways («استلام في المخزن») */
.rc-orders [role=option]{white-space:normal;overflow-wrap:anywhere;height:auto;min-height:32px;padding-block:6px;text-align:start;justify-content:flex-start}
/* the owner 13 Nov: a big table's head like «سجل المخزون» — the title with its count line
   under it, «كل الـ…» under the head on the card's inner edge, a description the page had under the title now under the table */
.th-t{display:flex;flex-direction:column;gap:2px;min-width:0}
/* the owner 15 Nov (artifact comment 4 — «يبقي alighn يمين مع الازرار اللي علي الشمال»): a head whose title the kit boxed (.th-t) lost the
   title's own auto margin, so a page button that sits straight in the head («تحديث من Dokan») floated in the middle of the card —
   the box pushes everything after it to the end: the page's button beside «بحث» · «فلتر» · «ترتيب» · the columns */
.table-title>.th-t,.cons-h>.th-t{margin-inline-end:auto}
.tbl-v2>.th-all,.tbl-v2>.scroll-x+.th-note,.tbl-v2>.xwrap+.th-note,.tbl-v2>table+.th-note,.tbl-v2>.th-note{margin-inline:20px}
.tbl-v2>.th-all{padding-block:12px}
.th-note{margin:12px 0 0}
/* the owner 14 Nov («جدول المبتكرين — الفترة المحددة»: الزراير بعضها والمسافات مظبوطة زي بقية الجداول): a TableCard's head
   (.table-title) gets its controls in one group 8px apart like .sec-h — «بحث» and «فلتر» touched and the columns icon stood off */
.table-title>.acts{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.table-title>.acts>[data-cols]{margin-inline-start:0}
/* the owner 14 Nov: the dark beige (--color-brand-subtle-bg) marks what is
   selected only; a hover anywhere is one shade (--color-bg-hover) — the owner 16 Nov: «لون الهوفر لاي background بيتعملها hover يبقي
   #F9F0E2» (every light hover background in the CSS files and the orders page's --bg-hover; filled buttons keep their darker shade) */
:root{--color-bg-hover:#F9F0E2}
:is(.btn-text,.icon-btn,.opt,.radio,.day,.ntf-nav-item,.ntf-item,.list-chip.role-chip,.dn-item,.dash-barbtn,.subtab,.set-nav-item,.user-btn,.cv,.af-clr,.star-pick .sp,.dc-grip,.th-sort):hover{background:var(--color-bg-hover)}
.dt-click:hover td{background:var(--color-bg-hover)}
:is(.opt,.ntf-item):focus-visible{background:var(--color-bg-hover)}
/* what is selected keeps the dark beige even under the pointer */
:is(.opt[aria-selected=true],.opt[aria-checked=true],.cv.sel,.set-nav-item[aria-current=page]):hover{background:var(--color-brand-subtle-bg)}
/* a text button on a green header: its hover is a light veil over the green, the beige text stays readable («افتح الميديا باير») */
:is(.card.sec:not(.tbl-v2):not(.admin)>.sec-h:not(.cols-only),.chart-card>.chart-head,.dash-card:not(.tbl-v2)>.dash-h,.set-card>.set-card-h,.cat-main-h) .btn-text:hover{background:rgba(255,247,239,.16);color:var(--color-text-on-brand)}
/* owner batch 14 Nov decision 6: the permissions / alerts matrices — the role row stays under the top bar until the matrix ends.
   Wide screens: the wrapper is no scroll box (sticky needs the page to be the scroller) and the matrix fits the card; narrow: it scrolls sideways. */
.mx-wrap{overflow-x:auto;min-width:0}
.mx-wrap .mx-head{position:sticky;top:48px;z-index:3;background:var(--color-bg-tint);box-shadow:0 1px 0 var(--color-border-subtle)}
.mx-wrap .mx-gh{gap:8px}
.mx-wrap .pm .ic,.legend .pm .ic{width:16px;height:16px}
@media (min-width:1100px){.mx-wrap{overflow:visible}.mx-wrap .matrix{min-width:0}}
.card.sec:has(.mx-wrap){overflow:visible} /* the card's overflow:hidden (rounded tables) would make it the sticky head's scroller */
/* owner batch 14 Nov decision 7: the member's time has started and no session yet — «ابدأ الدوام» glows until pressed */
.clock-widget.remind .btn{box-shadow:0 0 0 3px var(--color-brand-subtle-bg),0 0 0 5px var(--color-brand-default)}
/* owner batch 14 Nov decision 9: the category levels — «-» beige, «--» lighter, «---» lighter still (the tab and the «تغيير القسم» tree) */
:root{--lvl-1:#efe2c9;--lvl-2:#f5eddc;--lvl-3:#faf4ea}
/* owner batch 14 Nov decision 12: the «يومي» card lists the automatic tasks as links */
.dash-task-auto{display:flex;align-items:center;gap:8px;padding:6px 0;color:var(--color-text-primary);text-decoration:none;border-bottom:1px solid var(--color-border-subtle)}
.dash-task-auto:hover{color:var(--color-brand-default)}
.dash-task-auto .ic{color:var(--color-text-gold,#b8860b)}

/* owner batch 14 Nov decision 13: the evaluation row — «قيّم» and ⋮ side by side; the notes list in its popup */
.row-acts { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
[data-hr-notes] .note-row { padding: 10px 0; border-bottom: 1px solid var(--color-border, #e6dccb); }
[data-hr-notes] .note-row:last-child { border-bottom: 0; }
/* owner batch 2: what is selected — a light beige, a thick green border
   and green text, everywhere (the radio cards, the options of a list, the picked rows and nav items); the hover stays its own shade */
:root{--color-selected-bg:#f6ead6}
.opt-card.opt-card[aria-checked=true],.merge-c.merge-c.keep{background:var(--color-selected-bg);border:2px solid var(--color-brand-default);color:var(--color-brand-default)}
.opt-card[aria-checked=true] :is(b,strong,.t-label){color:var(--color-brand-default)}
:is(.opt[aria-selected=true],.opt[aria-checked=true]),:is(.opt[aria-selected=true],.opt[aria-checked=true]):hover{background:var(--color-selected-bg);color:var(--color-brand-default);box-shadow:inset 0 0 0 2px var(--color-brand-default)}
.view-menu :is(.opt[aria-selected=true],.opt[aria-checked=true]),.view-menu :is(.opt[aria-selected=true],.opt[aria-checked=true]):hover{background:transparent;box-shadow:none}
.cv.sel,.cv.sel:hover{background:var(--color-selected-bg);box-shadow:inset 0 0 0 2px var(--color-brand-default)}
:is(.set-nav-item,.sn-i)[aria-current=page],.set-nav-item[aria-current=page]:hover{background:var(--color-selected-bg);color:var(--color-brand-default);box-shadow:inset 0 0 0 2px var(--color-brand-default)}
tr.is-sel td,#vendors .tickets-table tr.is-sel td,.vprod-row.is-sel{background:var(--color-selected-bg)}
.cmp-tab[aria-selected=true]{background:var(--color-selected-bg);box-shadow:inset 0 0 0 2px var(--color-brand-default)}
.chip-b[aria-pressed=true]{background:var(--color-selected-bg);border:2px solid var(--color-brand-default);color:var(--color-brand-default)}
/* decision 6: a work day picked — green with beige text (the HR settings and the custom work time) */
:is([data-hs-days],[data-hs-s-days]) .chip[aria-checked=true]{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
/* decision 33: the filter chips line up with the search field — the same inline margins as the search row, in every table card */
:is(.card,.table-card,.dash-card,.chart-card)>.af-row{margin-inline:24px}
:is(.tbl-v2,.table-card.tbl-v2)>.af-row{margin-inline:20px}
/* owner batch 2 decision 17: the delay rules — the order and the sub-order side by side */
.dl-boxes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.dl-boxes>.card{margin:0}
@media (max-width:900px){.dl-boxes{grid-template-columns:minmax(0,1fr)}}
[data-delay-stop] .chip[aria-checked=true]{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
/* owner batch 2 decision 2: a role's levels under its chip; role + level side by side in the members table */
.role-levels{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px;padding:12px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);background:var(--color-bg-tint)}
.role-chip.on{background:var(--color-selected-bg);border-color:var(--color-brand-default);color:var(--color-brand-default)}
.role-lvl{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
/* owner batch 2 decision 4: the add-member popup's three parts */
.form-sec{margin-top:8px;padding-bottom:6px;border-bottom:1px solid var(--color-border-subtle);color:var(--color-brand-default)}
.form-sec:first-child{margin-top:0}

/* owner batch 2 decision 21: the maker drawer's «ناقص» — each missing item on its own, a click opens where it is filled */
.miss-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.miss-btn { cursor: pointer; border: 1px solid currentColor; font: inherit; }
.miss-btn:hover, .miss-btn:focus-visible { filter: brightness(.95); text-decoration: underline; }

/* ===== the page's scroll (the owner 15 Nov) =====
   The scroll bar on the left: a browser keeps the window's scroll bar on the right even in a right-to-left page, and puts it on the left
   only for a scrolling element inside the page — so on a desktop (wide screen + mouse) <html> stops scrolling and <body> scrolls
   (js/pages/page-scroll.js keeps window.scrollTo / scrollY meaning «the page»). A phone / tablet keeps the window's own scroll. */
@media (min-width:1024px) and (hover:hover) and (pointer:fine){
  html{height:100%;overflow:hidden}
  body{height:100%;overflow-y:auto}
}
/* «اطلع لأول الصفحة»: a round button fixed at the bottom left, clear of the left scroll bar; shown once the page is scrolled down */
.to-top{position:fixed;z-index:25;left:calc(20px + var(--page-sbw, 0px) + env(safe-area-inset-left, 0px));bottom:calc(20px + env(safe-area-inset-bottom, 0px));width:44px;height:44px;padding:0;border:0;border-radius:50%;
  display:flex;align-items:center;justify-content:center;background:var(--color-brand-default);color:var(--color-text-on-brand);box-shadow:0 2px 10px rgba(0,0,0,.28);cursor:pointer;
  opacity:0;visibility:hidden;transform:translateY(8px);transition:opacity .18s ease,transform .18s ease,visibility 0s linear .18s}
.to-top.show{opacity:1;visibility:visible;transform:none;transition:opacity .18s ease,transform .18s ease}
.to-top:hover{background:var(--color-brand-hover, #00483a)}
.to-top:focus-visible{outline:2px solid var(--color-action-default);outline-offset:2px}
@media (max-width:767px){.to-top{left:calc(12px + env(safe-area-inset-left, 0px));bottom:calc(64px + 12px + env(safe-area-inset-bottom, 0px))}}
@media (prefers-reduced-motion:reduce){.to-top,.to-top.show{transition:none}}
@media print{.to-top{display:none}}

/* «دودة اللوجو» — the preloader (the owner 15 Nov — js/pages/loader.js): the logo's own shapes as dashes of one stroke on its square
   track (round = 53), with square ends — an end that turns a corner fills the corner cell at once, so the worm is always whole
   cells, never a notch. A square end adds half the thickness (2.375) each side, so the dashes are the logo's lengths less 4.75:
   the head (the green square, 4.75) = a dash of ~0 at the corner (2.375 along) · the body 13.75 → 9 from 9.5, and 27.375 → 22.625
   from 25.625. One round forward, the green head first, then a moment at rest as the logo. */
.ib-worm{display:block;flex:none}
.ib-worm .w-tile{fill:var(--ldr-tile,#FFF3E6)}
.ib-worm .w-body,.ib-worm .w-head{fill:none;stroke-width:4.75;stroke-linejoin:miter;stroke-linecap:square;animation:var(--ldr-speed,1.7s) cubic-bezier(.62,.04,.38,.96) infinite}
.ib-worm .w-body{stroke:var(--ldr-body,#C9A259);stroke-dasharray:9 7.125 22.625 14.25;stroke-dashoffset:-9.5;animation-name:ib-worm-body}
.ib-worm .w-head{stroke:var(--ldr-head,#015642);stroke-dasharray:.02 52.98;stroke-dashoffset:-2.365;animation-name:ib-worm-head}
@keyframes ib-worm-body{0%{stroke-dashoffset:-9.5}84%,100%{stroke-dashoffset:-62.5}}
@keyframes ib-worm-head{0%{stroke-dashoffset:-2.365}84%,100%{stroke-dashoffset:-55.365}}
@media (prefers-reduced-motion:reduce){.ib-worm .w-body,.ib-worm .w-head{animation-duration:8s;animation-timing-function:linear}}
/* «الإعدادات › الهوية البصرية › شاشة التحميل»: a picture of the company's own in place of the worm (loader.js), turning if asked */
img.ib-worm.ib-ldr-img{object-fit:contain}
img.ib-worm.ib-ldr-img.spin{animation:ib-ldr-spin var(--ldr-speed,1.7s) linear infinite}
@keyframes ib-ldr-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){img.ib-worm.ib-ldr-img.spin{animation-duration:8s}}
.ldr-pv{display:flex;align-items:center;justify-content:center;gap:24px;padding:20px;border:1px solid var(--color-border-default,#e5dccb);border-radius:12px;background:var(--color-bg-layout,#FFF3E6)}
.ldr-pv .ib-worm{width:88px;height:88px;border-radius:17px}
.ldr-pv .ldr-sm .ib-worm{width:24px;height:24px;border-radius:5px}
.fav-pv{display:flex;align-items:center;gap:16px}
.fav-pv .fav-tab{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:8px 8px 0 0;background:#eee;font-size:13px;max-width:220px}
.fav-pv img{width:16px;height:16px}
.fav-pv .fav-big{width:48px;height:48px;border-radius:8px;border:1px solid var(--color-border-default,#e5dccb)}
/* the first-paint cover (#ib-boot, in index.html): up until the sign-in screen or the app shows */
.ib-boot{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:var(--color-bg-base,#FFF8EF);transition:opacity .28s ease}
.ib-boot .ib-worm{width:88px;height:88px;border-radius:17px;box-shadow:var(--shadow-card,0 0 6px rgba(0,0,0,.25))}
.ib-boot.out{opacity:0;pointer-events:none}
/* a page's own «بنحمّل…» line with the mark beside it (IBLoader.row, and the notes loader.js dresses) */
.ib-loading{display:inline-flex;align-items:center;gap:10px;color:var(--color-text-secondary)}
.note.is-loading{justify-content:flex-start}
.pt-loading.is-loading{display:flex;align-items:center;justify-content:center;gap:10px}
/* the running pill («بيحصل إيه دلوقتي»): the mark instead of the ring */
.busy-ico.worm{width:22px;height:22px;border:0;border-radius:5px;animation:none;overflow:hidden}
.busy-ico.worm .ib-worm{width:22px;height:22px}
.busy-pill.ok .busy-ico.worm .ib-worm,.busy-pill.err .busy-ico.worm .ib-worm,.busy-pill.warn .busy-ico.worm .ib-worm{display:none}
.busy-pill.ok .busy-ico.worm,.busy-pill.err .busy-ico.worm,.busy-pill.warn .busy-ico.worm{overflow:visible;border-radius:0}

/* the owner 15 Nov (artifact comment 8): the member's drawer on the HR page — boxes like the maker's drawer */
.md-boxes{padding:16px 24px 24px;display:flex;flex-direction:column;gap:16px}
.md-boxes .vsection .info-row:last-child{border-bottom:0}
@media (max-width:599px){.md-boxes{padding:12px 12px 20px;gap:12px}}
/* the owner 15 Nov (artifact comment 9): «إضافة مبتكر» in steps — the steps row inside the popup, a done step is a click back */
.mk-steps{list-style:none;margin:0;padding:0 0 12px;display:flex;align-items:center;gap:8px;flex:none;border-bottom:1px solid var(--color-border-subtle)}
.mk-steps li{display:flex;align-items:center;gap:8px;flex:1 1 0;min-width:0;color:var(--color-text-secondary)}
.mk-steps li:last-child{flex:0 1 auto}
.mk-steps li:not(:last-child)::after{content:"";flex:1;height:2px;background:var(--color-border-default);min-width:12px}
.mk-steps li.done:not(:last-child)::after{background:var(--color-brand-default)}
.mk-steps .dot{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--color-border-default);background:var(--color-bg-base);font-weight:700;font-size:12px;flex:none}
.mk-steps li.done .dot{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
.mk-steps li.cur{color:var(--color-text-primary);font-weight:600}
.mk-steps li.cur .dot{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-text-on-brand)}
.mk-step-b{display:flex;align-items:center;gap:8px;background:none;border:0;padding:0;margin:0;font:inherit;color:inherit;cursor:pointer;white-space:nowrap;min-width:0}
.mk-step-b:disabled{cursor:default}
.mk-step-b:focus-visible{outline:2px solid var(--color-action-default);outline-offset:4px;border-radius:var(--radius-sm,6px)}
.mk-step{display:flex;flex-direction:column;gap:16px}
.modal.mk-modal{width:min(760px, calc(100vw - 32px))}
.mk-steps li .mk-step-b>span:last-child{overflow:hidden;text-overflow:ellipsis}
@media (max-width:719px){.mk-steps li:not(.cur) .mk-step-b>span:last-child{display:none}.mk-steps li:not(:last-child)::after{min-width:8px}}

/* ---- IBShare (2026-11-15-comments.md decision 10): the share popup — the file's kind, then how it goes ---- */
.modal.sh-modal{width:min(560px, calc(100vw - 32px))}
.sh-sec{display:flex;flex-direction:column;gap:8px}
.sh-sec + .sh-sec{margin-top:16px}
.sh-h{font-weight:700;color:var(--color-text-primary);font-size:14px}
.sh-opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
.sh-opt{display:flex;align-items:center;gap:10px;min-height:56px;padding:10px 12px;border:1px solid var(--color-border, #d9cfbf);border-radius:10px;background:var(--color-surface, #fffaf3);color:var(--color-text-primary);font:inherit;text-align:start;cursor:pointer}
.sh-opt svg{flex:none;color:#005642}
.sh-opt-t{display:flex;flex-direction:column;gap:2px;min-width:0}
.sh-opt-t b{font-weight:700}
.sh-opt-t small{color:var(--color-text-secondary);font-size:12px;line-height:1.4}
.sh-opt:hover:not([disabled]){border-color:#005642}
.sh-opt.on{border-color:#005642;background:#f3e7d3;box-shadow:inset 0 0 0 1px #005642}
.sh-opt[disabled]{opacity:.6;cursor:default}
.sh-opt:focus-visible{outline:2px solid #005642;outline-offset:2px}
.sh-hint{margin:14px 0 0;color:var(--color-text-secondary)}
/* the owner 16 Nov: the number / the address it goes to — the maker's by default, editable */
.sh-to{margin-top:16px}.sh-to .input{width:100%;text-align:left}
.sh-step{margin:8px 0 0;color:#005642;font-weight:700}
/* the report as A4 pages (drawn off the screen, then photographed into the PDF) */
.sh-host{position:fixed;inset-inline-start:-12000px;top:0;width:794px;pointer-events:none;z-index:-1}
.sh-page{box-sizing:border-box;width:794px;height:1123px;padding:36px 44px 30px;background:#fff;color:#1d1d1b;display:flex;flex-direction:column;font-size:13px;line-height:1.6;overflow:hidden}
.sh-top{display:flex;align-items:center;justify-content:space-between;padding-bottom:12px;border-bottom:2px solid #005642;flex:none}
.sh-brand{display:inline-flex;align-items:center;gap:8px;color:#005642;font-size:18px}
.sh-brand svg{width:26px;height:26px}
.sh-date{color:#6b6257;font-size:12px}
.sh-body{flex:1 1 auto;min-height:0;overflow:hidden;padding-top:16px}
.sh-title{margin:0 0 4px;font-size:20px;font-weight:800;color:#005642}
.sh-sub{margin:0 0 12px;color:#6b6257;font-size:12.5px}
.sh-sum{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px;margin:0 0 16px}
.sh-tile{border:1px solid #e3d8c6;border-radius:8px;background:#fbf5ea;padding:8px 10px;display:flex;flex-direction:column;gap:2px}
.sh-tile span{color:#6b6257;font-size:11.5px}
.sh-tile b{font-size:15px;color:#1d1d1b}
.sh-table{width:100%;border-collapse:collapse;table-layout:auto}
.sh-table th{background:#005642;color:#f6ecd9;font-weight:700;font-size:12px;padding:8px 10px;text-align:start;white-space:nowrap}
.sh-table td{padding:6px 10px;border-bottom:1px solid #ece3d3;vertical-align:middle;font-size:12.5px}
.sh-table tbody tr:nth-child(even) td{background:#fbf7ef}
.sh-table td.sh-prod{display:flex;align-items:center;gap:8px;min-width:200px}
.sh-ph{flex:none;width:40px;height:40px;border-radius:6px;background:#efe6d6;overflow:hidden;display:inline-block}
.sh-ph img{width:100%;height:100%;object-fit:cover;display:block}
.sh-pt{min-width:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.sh-table tr.sh-total td{font-weight:800;background:#f3e7d3;border-bottom:0}
.sh-table td.sh-none{text-align:center;color:#6b6257;padding:24px}
.sh-note{margin:12px 0 0;color:#4a443c;font-size:12px}
.sh-foot{flex:none;display:flex;justify-content:space-between;gap:12px;padding-top:8px;border-top:1px solid #e3d8c6;color:#6b6257;font-size:11px}

/* ---- the maker's short report / «تقفيل الحساب» / the full report (comments decisions 10 and 11) ---- */
.modal.vb-modal .modal-b{display:flex;flex-direction:column;gap:14px}
.modal.vb-modal .modal-b > *{flex:none} /* the body scrolls: nothing in it is squeezed (the table was, on a phone) */
.vb-sub{margin:0;color:var(--color-text-secondary)}
.vb-tiles{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.vb-tile{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border:1px solid var(--color-border-subtle);border-radius:10px;background:var(--color-bg-tint, #fbf5ea);min-width:0}
.vb-tile span{color:var(--color-text-secondary)}
.vb-tile b{font-size:16px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vb-tile.net{background:#005642;border-color:#005642}
.vb-tile.net span{color:#e8d5b3}
.vb-tile.net b{color:#f6ecd9}
.vb-extra{margin:-6px 0 0;color:var(--color-text-secondary)}
.vb-req{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--color-border-subtle);border-inline-start:4px solid #a39a8c;border-radius:10px;background:var(--color-surface, #fffaf3)}
.vb-req.pending,.vb-req.settle{border-inline-start-color:#c7a35a}
.vb-req.ask{border-color:#005642;border-inline-start-color:#005642;background:#f3e7d3}
.vb-req.approved{border-inline-start-color:#005642}
.vb-req-i{flex:none;color:#005642;display:inline-flex;margin-top:2px}
.vb-req-b{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:6px}
.vb-req-t{margin:0;color:var(--color-text-secondary);font-size:13px;line-height:1.7}
.vb-req-t.strong{color:var(--color-text-primary);font-weight:700;font-size:14px}
.vb-req-a{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.vb-req-res{margin:4px 0 0;padding:8px 10px;border-radius:8px;font-size:13px;line-height:1.7;background:#eef5f1;color:#005642}
.vb-req-res.warning{background:#fbf1dc;color:#7a5a12}
.vb-req-res.error{background:#fbe9e7;color:#9c2b1e}
.vb-moves{border:1px solid var(--color-border-subtle);border-radius:10px;padding:0 12px}
.vb-moves summary{cursor:pointer;padding:10px 0;font-weight:700;font-size:13px;color:var(--color-text-primary)}
.vb-moves[open]{padding-bottom:12px}
.vb-h{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-top:2px}
.vb-h h3{margin:0}
.vb-h span{color:var(--color-text-secondary)}
.vb-table-wrap{overflow-x:auto}
.vb-table .vr-prod{display:inline-flex;align-items:center;gap:10px;min-width:0;white-space:normal}
/* chat ش6 (16 Nov): the product column — its title and cells — starts on the right: the photo, then the name */
.dt-table.vb-table th:first-child,.dt-table.vb-table td:first-child{text-align:right}.vb-table .vr-prod{display:flex;justify-content:flex-start;text-align:right}
.vb-table .vr-prod .thumb{flex:none;width:40px;height:40px;border-radius:8px;overflow:hidden;background:var(--color-bg-tint, #efe6d6);display:inline-flex;align-items:center;justify-content:center;color:var(--color-text-secondary)}
.vb-table .vr-prod .thumb img{width:100%;height:100%;object-fit:cover;display:block}
.vb-foot{margin:0;color:var(--color-text-secondary)}
.vb-scope{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border-radius:10px;background:#fbf1dc;color:#5c4a1a;font-size:13px;line-height:1.7}
.vb-scope.whole{background:#eef5f1;color:#005642;font-weight:700}
.vb-scope svg{flex:none;margin-top:3px}
@media (max-width:860px){.vb-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}.vb-tile.net{grid-column:1 / -1}}

/* ---------- «مقارنة بفترة سابقة» (comments decision 14, the owner 15 Nov): the comparison period's own fields in the calendar, and the two periods side by side on the page ---------- */
.dp.range .pcmp-fields{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:10px 16px 12px;border-top:1px dashed var(--color-border-subtle);background:var(--color-bg-container);flex:none;position:relative;z-index:1}
.pcmp-fields .pcmp-lab{display:inline-flex;align-items:center;gap:6px;font-weight:700;font-size:13px;color:var(--color-text-primary)}
.pcmp-fields .pcmp-lab i,.pcmp-per i{width:10px;height:10px;border-radius:3px;background:var(--color-action-default);flex:none}
.pcmp-fields label{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--color-text-secondary)}
.pcmp-fields .input{width:128px}
.pcmp-fields .help{margin:0}
.day.pcmp:not(.sel):not(.inrange){box-shadow:inset 0 -3px 0 var(--color-action-default)}
.day.pcmp.outside{box-shadow:none}
.pcmp-card{padding:0;overflow:hidden}
.pcmp-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;padding:14px 16px;border-bottom:1px solid var(--color-border-subtle)}
.pcmp-head h2{margin:0}
.pcmp-pers{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.pcmp-per{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:var(--color-bg-container);border:1px solid var(--color-border-subtle);font-size:13px;line-height:20px;white-space:nowrap}
.pcmp-per.cur i{background:var(--color-brand-default)}
.pcmp-per b{font-weight:700;font-variant-numeric:tabular-nums}
.pcmp-per small{color:var(--color-text-secondary);font-size:12px}
.pcmp-per .pcmp-per-n{color:var(--color-text-secondary)}
.pcmp-vs{color:var(--color-text-secondary);font-size:12px}
.pcmp-grid{display:grid;grid-template-columns:minmax(140px,1.4fr) minmax(96px,1fr) minmax(96px,1fr) minmax(120px,1.3fr) minmax(128px,auto);align-items:stretch}
.pcmp-grid>.pcmp-r{display:contents}
.pcmp-grid>.pcmp-r>*{display:flex;align-items:center;gap:4px;padding:10px 16px;border-bottom:1px solid var(--color-border-subtle);min-width:0}
.pcmp-grid>.pcmp-r:last-child>*{border-bottom:0}
.pcmp-grid>.pcmp-r.h>*{background:var(--color-bg-container);color:var(--color-text-secondary);font-size:12px;font-weight:700;padding-top:8px;padding-bottom:8px}
.pcmp-grid>.pcmp-r:not(.h):nth-child(odd)>*{background:var(--lvl-3,#faf4ea)}
.pcmp-l{font-weight:600}
.pcmp-v{font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}
.pcmp-v small{font-weight:500;color:var(--color-text-secondary);font-size:12px}
.pcmp-v.was{font-weight:500;color:var(--color-text-secondary)}
.pcmp-grid>.pcmp-r>.pcmp-bars{flex-direction:column;align-items:stretch;gap:4px;justify-content:center}
.pcmp-bars>span{display:block;height:6px;border-radius:999px;background:var(--color-bg-tint);overflow:hidden}
.pcmp-bars i{display:block;height:100%;border-radius:999px;background:var(--color-action-default)}
.pcmp-bars .cur i{background:var(--color-brand-default)}
.pcmp-grid>.pcmp-r>.pcmp-d{flex-direction:column;align-items:flex-start;justify-content:center;gap:2px}
.pcmp-d .pill{display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border-radius:999px;border:1px solid var(--color-border-subtle);background:var(--color-bg-container);color:var(--color-text-secondary);font-size:12px;line-height:18px;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.pcmp-d.positive .pill{background:var(--color-success-bg);border-color:var(--color-success-border);color:var(--color-success-text)}
.pcmp-d.negative .pill{background:var(--color-error-bg);border-color:var(--color-error-border);color:var(--color-error-text)}
.pcmp-d small{color:var(--color-text-secondary);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
.pcmp-card .inline-note{margin:12px 16px}
.pcmp-foot{padding:8px 16px 12px;margin:0;color:var(--color-text-secondary);font-size:12px}
@media (max-width:719px){
  .pcmp-grid{grid-template-columns:1fr 1fr}
  .pcmp-grid>.pcmp-r.h{display:none}
  .pcmp-grid>.pcmp-r{display:grid;grid-template-columns:1fr 1fr;grid-column:1/-1;gap:4px 12px;padding:10px 16px;border-bottom:1px solid var(--color-border-subtle)}
  .pcmp-grid>.pcmp-r>*{padding:0;border:0;background:none!important}
  .pcmp-grid>.pcmp-r:not(.h):nth-child(odd){background:var(--lvl-3,#faf4ea)}
  .pcmp-l{grid-column:1/-1}
  .pcmp-grid>.pcmp-r>.pcmp-v{flex-wrap:wrap}
  .pcmp-v::before{content:attr(data-h);flex:0 0 100%;font-size:11px;font-weight:500;color:var(--color-text-secondary)}
  .pcmp-grid>.pcmp-r>.pcmp-bars{display:none}
  .pcmp-grid>.pcmp-r>.pcmp-d{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px}
}
@media (max-width:767px){
  /* the phone's bottom sheet: the comparison period's two fields side by side, the hint under them */
  .dp.range .pcmp-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px 16px}
  .dp.range .pcmp-fields .pcmp-lab,.dp.range .pcmp-fields>.help,.dp.range .pcmp-fields>.btn{grid-column:1/-1}
  .dp.range .pcmp-fields label{display:flex;flex-direction:column;align-items:stretch;gap:2px}
  .dp.range .pcmp-fields .input{width:100%;height:44px}
}

/* «تخصيص اللوحة» بتاع كروت التقارير (comments decision 16, the owner 15 Nov — «خد التصميم بتاعها من الـ prototype»): the picker's own
   rules as the prototype has them — they were never brought over, so the popup drew as bare buttons */
.kpi-pick{display:flex;flex-direction:column;gap:16px}
.kpi-pick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.kpi-opt{display:flex;align-items:center;gap:10px;min-height:56px;padding:8px 12px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);background:var(--color-bg-base);text-align:start;font:inherit;color:inherit;cursor:pointer}
.kpi-opt:hover{border-color:var(--color-brand-default)}.kpi-opt.on{border-color:var(--color-brand-default);background:var(--color-bg-tint)}
.kpi-opt[disabled]{opacity:.45;cursor:not-allowed}
.kpi-opt .mchk{width:18px;height:18px;flex:none;border:1px solid var(--color-border-default);border-radius:4px;display:inline-flex;align-items:center;justify-content:center}
.kpi-opt.on .mchk{background:var(--color-brand-default);border-color:var(--color-brand-default);color:var(--color-bg-base)}
.kpi-opt-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.kpi-opt-v{flex:none;font-weight:700;color:var(--color-brand-default);max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kpi-ord{color:var(--color-text-secondary);font-weight:600}
@media (max-width:599px){.kpi-pick-grid{grid-template-columns:1fr}.kpi-opt{min-height:60px}}

/* المخزن › سجل المخزون (comments decision 19): the product's page on the site, under its name */
.inv-site{display:inline-flex;align-items:center;gap:4px;width:max-content;max-width:100%;font-size:12px;line-height:18px;font-weight:600;color:var(--color-brand-default);text-decoration:none}
.inv-site:hover,.inv-site:focus-visible{text-decoration:underline}
/* chat ش11 (16 Nov — «عايز ال sku يبقي alighn يمين»): the SKU under a product's name (written left to right) starts on the right like the name */
.prod small[dir="ltr"]{display:block;text-align:right}
.inv-site svg{width:12px;height:12px;flex:none}
/* comments decisions 22 and 25 (the owner 15 Nov): «تجميع في المخزن» — the order's products as a table (a box, the photo, the product, its
   maker and its status now), the head green as the system's tables */
.cons-pick{width:100%;border-collapse:collapse;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);overflow:hidden}
.cons-pick thead th{background:var(--color-brand-default);color:var(--color-text-on-brand);font-weight:600;text-align:center;white-space:nowrap}
.cons-pick td{text-align:center}.cons-prod{align-items:center}
.cons-pick tbody tr:nth-child(even){background:var(--color-bg-container)}
.cons-pick td{vertical-align:middle;border-top:1px solid var(--color-border-subtle)}
.cons-pick td:first-child,.cons-pick th:first-child{width:44px;text-align:center}
.cons-pick td:nth-child(2),.cons-pick th:nth-child(2){width:64px}
.cons-pick .thumb{width:44px;height:44px}
.cons-pick .cb{justify-content:center}.cons-cb{display:inline-flex}
.cons-prod{display:flex;flex-direction:column;gap:2px;min-width:0}.cons-prod b{font-weight:600;overflow-wrap:anywhere}.cons-prod small{color:var(--color-text-secondary)}
/* tablet and phone (the tables are record cards there): a product is one row — the box, the photo, the product over its maker, the status */
@media (max-width:1023px){
  .scroll-x table.cons-pick{border:0;border-radius:0;overflow:visible}
  .scroll-x table.cons-pick tr{display:grid;grid-template-columns:auto 44px minmax(0,1fr) auto;align-items:center;gap:2px 10px;padding:10px 12px;margin:0 0 8px}
  .scroll-x table.cons-pick td{flex:none;width:auto;min-width:0;border:0;text-align:start;align-items:flex-start;font-weight:400;color:inherit;order:0}
  .scroll-x table.cons-pick td::before{display:none}
  .scroll-x table.cons-pick td:nth-child(1){grid-column:1;grid-row:1 / span 2;width:auto}
  .scroll-x table.cons-pick td:nth-child(2){grid-column:2;grid-row:1 / span 2;width:44px}
  .scroll-x table.cons-pick td:nth-child(3){grid-column:3;grid-row:1}
  .scroll-x table.cons-pick td:nth-child(4){grid-column:3;grid-row:2;color:var(--color-text-secondary);font-size:13px}
  .scroll-x table.cons-pick td:nth-child(5){grid-column:4;grid-row:1 / span 2;align-items:flex-end}
  .cons-pick .cons-prod{align-items:flex-start}
  .scroll-x table.cons-pick td>.thumb{max-width:none;min-width:44px;width:44px}
}
/* comments decision 29 (the owner 15 Nov): the piece's popup «تفاصيل المنتج» in the hub — a head, the three quantities, a grid of
   labelled boxes, then its moves */
.pd-modal{width:min(720px,100%)}
.pd{display:flex;flex-direction:column;gap:16px;min-width:0}
.pd-head{display:flex;align-items:center;gap:16px;min-width:0}
.pd-head .thumb{width:72px;height:72px;border-radius:var(--radius-md);flex:none}
.pd-id{display:flex;flex-direction:column;gap:4px;min-width:0}
.pd-name{font-size:18px;line-height:26px;color:var(--color-brand-default);overflow-wrap:anywhere}
.pd-id small{color:var(--color-text-secondary)}
.pd-tags{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:2px}
.pd-qty{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.pd-q{display:flex;flex-direction:column;align-items:center;gap:2px;padding:12px 8px;border:1px solid var(--color-brand-default);border-radius:var(--radius-md);background:var(--color-bg-base)}
.pd-q b{font-size:22px;line-height:28px;color:var(--color-text-primary)}
.pd-q span{font-size:13px;color:var(--color-text-secondary)}
.pd-q.ok b{color:var(--color-brand-default)}.pd-q.hold b{color:var(--color-action-hover)}
.pd-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.pd-box{display:flex;flex-direction:column;gap:4px;padding:10px 14px;border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);background:var(--color-bg-container);min-width:0}
.pd-box.wide{grid-column:1 / -1}
.pd-l{font-size:12px;line-height:18px;color:var(--color-text-secondary)}
.pd-v{font-weight:600;overflow-wrap:anywhere}
.pd-sec{display:flex;flex-direction:column;gap:8px;min-width:0}
.pd-sec h3{margin:0;display:flex;align-items:center;gap:8px;color:var(--color-brand-default)}
.pd-n{min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--color-brand-default);color:var(--color-text-on-brand);font-size:12px;display:inline-grid;place-items:center}
.pd-moves{width:100%;border-collapse:collapse}
.pd-moves thead th{background:var(--color-brand-default);color:var(--color-text-on-brand);font-weight:600;white-space:nowrap}
.pd-moves tbody tr:nth-child(even){background:var(--color-bg-container)}
@media (max-width:599px){.pd-head .thumb{width:56px;height:56px}.pd-grid{grid-template-columns:1fr}.pd-qty{gap:8px}.pd-q b{font-size:18px}}

/* comments decision 34 (the owner 15 Nov — «الجرد يبقي في صفحة جديدة زي بوب اب كبير … الحتة اللي فوق تبقي sticky»): the count's popup
   takes the screen; its top (the progress, the search) and its table head stay while the lines scroll */
.scrim .modal.cnt-modal{width:min(1180px, calc(100vw - 32px));max-width:min(1180px, calc(100vw - 32px));height:92vh;height:92dvh;max-height:92vh;max-height:92dvh}
.modal.cnt-modal .modal-b{padding:0;gap:0;overflow:hidden;flex:1 1 auto;min-height:0}
.cnt-top{flex:none;display:flex;flex-direction:column;gap:12px;padding:16px 24px;background:var(--color-bg-container);border-bottom:1px solid var(--color-border-subtle)}
.cnt-tools{display:flex;gap:8px;align-items:center}
.cnt-tools .input{flex:1 1 auto;min-width:0}
.cnt-lines{flex:1 1 auto;min-height:0;overflow:auto;padding:0 24px 16px}
.cnt-lines .scroll-x{overflow:visible}
.cnt-lines table.cnt-table{width:100%}
.cnt-lines table.cnt-table thead th{position:sticky;top:0;z-index:2;background:var(--color-brand-default);color:var(--color-text-on-brand)}
.cnt-lines .empty{margin-top:24px}
.modal.cnt-modal .modal-f{flex-wrap:wrap}
.cnt-match{display:flex;flex-direction:column;gap:16px}
@media (max-width:1023px){
  .scrim .modal.cnt-modal{width:100%;max-width:100%;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;border-radius:0}
  .cnt-top{padding:12px 16px}.cnt-lines{padding:0 12px 12px}
  .cnt-tools{flex-wrap:wrap}
}

/* the owner 16 Nov («عايز امكانية تعديل اللوجو للبراند او المبتكر»): the maker drawer's picture is a button that changes it, and the
   picture popup (the maker's photo / the brand's picture on the site) */
.vlogo-edit{position:relative;display:inline-flex;padding:0;border:0;background:none;border-radius:var(--radius-md);cursor:pointer;flex:none}
.vlogo-edit:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:2px}
.vlogo-cam{position:absolute;inset-inline:0;bottom:0;padding:3px 0;font-size:12px;font-weight:600;text-align:center;color:#F4ECDD;background:rgba(0,86,66,.85);border-radius:0 0 var(--radius-md) var(--radius-md);opacity:0;transition:opacity .15s}
.vlogo-edit:hover .vlogo-cam,.vlogo-edit:focus-visible .vlogo-cam{opacity:1}
@media (hover:none){.vlogo-cam{opacity:1}}
.pic-edit{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.pic-now{flex:none;display:flex}
.pic-side{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:0;flex:1 1 200px}

/* the owner 16 Nov («اي فلتر في السيستم يبقي فلتر الشجرة»): a «فلتر» group of levels (the site's categories) is a tree */
.fm-menu .fm-tree{display:flex;flex-direction:column;gap:1px}
.fm-tr{display:flex;align-items:center;gap:6px;padding-inline-start:calc(var(--fm-d, 0) * 18px)}
.fm-tr[hidden]{display:none}
.fm-tr .opt{flex:1 1 auto;min-width:0}
.fm-tr[data-depth="0"] .opt .mp-l{font-weight:600}
.fm-tog{width:24px;height:24px;flex:none;display:grid;place-items:center;padding:0;border:1px solid var(--color-border-subtle);border-radius:6px;background:var(--color-bg-container);color:#005642;font-weight:700;font-size:15px;line-height:1;cursor:pointer}
.fm-tog:hover{background:var(--color-bg-hover);border-color:#005642}
.fm-tog:focus-visible{outline:2px solid var(--color-border-focus);outline-offset:1px}
.fm-tog.sp{border:0;background:none;cursor:default}

/* 0113 (the owner 16 Nov — طلبات الفريق زي أي شات): my messages on the right in beige, the others (a group too) on the left in green,
   the changes as small centered lines, a day line; the status dropdown; the people in the request (voice notes removed — the owner 17 Nov) */
.tk-chat{gap:8px}
.tk-day{display:flex;justify-content:center;margin:8px 0 2px}
.tk-day span{background:var(--color-bg-container);color:var(--color-text-secondary);font-size:12px;line-height:22px;padding:0 12px;border-radius:999px}
.tk-ev{align-self:center;max-width:90%;display:flex;gap:8px;align-items:baseline;justify-content:center;flex-wrap:wrap;text-align:center;font-size:12px;color:var(--color-text-secondary);background:var(--color-bg-base);border:1px solid var(--color-border-subtle);border-radius:999px;padding:2px 12px}
.tk-ev .time{opacity:.75}
.tk-bub{display:flex;gap:8px;align-items:flex-end;max-width:min(82%,520px)}
.tk-bub.is-mine{align-self:flex-start}
.tk-bub.is-other{align-self:flex-end}
.tk-bub-b{min-width:0;display:flex;flex-direction:column;gap:4px;padding:8px 12px 6px;border-radius:16px;box-shadow:0 1px 1px rgba(0,0,0,.06)}
.is-mine .tk-bub-b{background:var(--color-bg-container);color:var(--color-text-primary);border:1px solid var(--color-border-subtle);border-start-start-radius:4px}
.is-other .tk-bub-b{background:var(--color-brand-default);color:var(--color-text-on-brand);border-start-end-radius:4px}
.tk-bub-who{display:flex;gap:8px;align-items:baseline;font-size:12px}
.tk-bub-who span{opacity:.8}
.tk-bub-t{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}
.tk-bub-time{font-size:11px;opacity:.7;align-self:flex-end}
.tk-bub .tk-files{margin:2px 0 0}
.is-other .tk-bub-b .chip.tk-file{background:rgba(255,255,255,.14);color:inherit;border-color:transparent}
.tk-bub-av .avatar{flex:none}
.tk-compose{display:flex;align-items:flex-end;gap:6px}
.tk-compose .tk-ta{flex:1;min-height:40px;max-height:140px;resize:none;border-radius:20px;padding:9px 14px;line-height:1.5}
.tk-attach-b{display:contents}
.tk-st-btn{cursor:pointer;gap:4px;font-family:inherit}
.tk-st-btn:hover{filter:brightness(.97)}
.tk-st-menu{min-width:230px;padding:6px}
.tk-st-h{color:var(--color-text-secondary);padding:4px 10px 6px}
.tk-st-opt{display:flex;align-items:center;gap:10px;width:100%}
.tk-st-opt.is-cur{font-weight:700;cursor:default;opacity:1}
.tk-st-opt:hover:not([disabled]){background:var(--color-bg-hover)}
.tk-st-dot{width:10px;height:10px;border-radius:50%;border:2px solid;flex:none}
.tk-st-l{flex:1;text-align:start}
.tk-st-hint{font-size:11px;color:var(--color-text-secondary)}
.tk-people{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.tk-people-l{display:inline-flex;align-items:center;gap:4px;color:var(--color-text-secondary)}
.tk-person{display:inline-flex;align-items:center;gap:6px;background:var(--color-bg-container);border-radius:999px;padding:2px 4px 2px 10px;font-size:13px}
.tk-person .avatar{width:22px;height:22px;font-size:11px}
.tk-person .icon-btn{width:22px;height:22px}
.tk-group-pick{display:block}
@media (max-width:640px){.tk-bub{max-width:92%}}
/* the owner 16 Nov («الشاتات كلها اعكس خلي الرسل علي اليمين و المستقبل علي الشمال»): in every chat what I send sits on the right (RTL start)
   and what reaches me on the left — the AI assistant, customer service (ours out on the right), as «طلبات الفريق» already does */
.ai-msg.user{align-self:flex-start}
.ai-msg.ai{align-self:flex-end}
.brow.out{justify-content:flex-start}
.brow.in{justify-content:flex-end}
/* the owner 16 Nov (ش31 — «خلي البار اللي تحت يبقي اخضر و يبقي ضيق قد عرض الجداول اللي جوة»): the unsaved-changes bar in green with beige
   text, as wide as the settings' own column (1040 — data-set-wrap) and centred under it */
.save-bar{background:var(--color-brand-default);color:var(--color-text-on-brand);width:min(1040px,calc(100% - 32px));margin-inline:auto;box-sizing:border-box}
.save-bar svg{color:var(--color-text-on-brand)}
/* ش32 (the owner 16 Nov — «ظبطلي الجدول ده يبقي بشكل احترافي و منظم و الصفحة كلها»): the permissions matrix of one role — each group a
   rounded block, each permission a row with its name and three choices (مسموح · عرض بس · لا) under named columns, the current one filled */
.matrix.mx-one{border:1px solid var(--color-border-subtle);border-radius:var(--radius-md);background:var(--color-bg-base)} /* no overflow:hidden — it would trap the sticky head */
.matrix.mx-one .mx-head{border-radius:var(--radius-md) var(--radius-md) 0 0}
.matrix.mx-one .mx-row{grid-template-columns:minmax(200px,1fr) 312px;padding:8px 16px;gap:16px;border-bottom:1px solid var(--color-border-subtle)}
.matrix.mx-one .mx-row:not(.mx-head):hover{background:var(--color-bg-hover)}
.matrix.mx-one .mx-head{padding:10px 16px;align-items:end}
.mx-rolehead{display:flex;flex-direction:column;gap:2px;align-items:stretch;text-align:center}
.mx-rolehead .mx-opts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:6px;font-size:12px;color:var(--color-text-secondary);font-weight:600}
.pm-seg{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pm-seg .pm{width:100%;height:32px;cursor:pointer;transition:background .12s,border-color .12s}
.pm-seg .pm.off{background:transparent;border-color:var(--color-border-subtle);color:var(--color-text-disabled);opacity:.55}
.pm-seg .pm.off:hover{opacity:1;background:var(--color-bg-hover);border-color:var(--color-border-default)}
.pm-seg .pm.on{opacity:1;cursor:default;box-shadow:inset 0 0 0 1px currentColor}
.pm-seg .pm.on.pm-full{background:var(--color-success-bg);color:var(--color-success-text)}
.pm-seg .pm.on.pm-part{background:var(--color-brand-subtle-bg);color:var(--color-text-primary)}
.pm-seg .pm.on.pm-none{background:var(--color-bg-tint);color:var(--color-text-secondary)}
/* the owner 18 Nov (agents-brain decision 21): the cells are round radios — the chosen one filled with ✓, whatever its column */
.pm-seg .pm{display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;border-radius:8px;opacity:1;box-shadow:none}
.pm-seg .pm.off,.pm-seg .pm.on.pm-full,.pm-seg .pm.on.pm-part,.pm-seg .pm.on.pm-none{background:transparent;border-color:transparent;box-shadow:none;opacity:1;color:inherit}
.pm-seg .pm.off:hover{background:var(--color-bg-hover)}
.pm-seg .pm-dot{width:22px;height:22px;border-radius:50%;border:2px solid var(--color-border-default);display:inline-flex;align-items:center;justify-content:center;background:var(--color-bg-base,#fff)}
.pm-seg .pm.off:hover .pm-dot{border-color:var(--color-brand-default)}
.pm-seg .pm.on .pm-dot{background:var(--color-brand-default);border-color:var(--color-brand-default);color:#FFF7EF}
.pm-seg .pm:disabled{cursor:default}
.mx-rolehead .mx-opts > span{display:inline-flex;align-items:center;justify-content:center;gap:4px}
/* the owner 18 Nov: the role's name in the matrices' head bold on the right, its count beside it in regular weight */
.mx-rt{display:flex;align-items:baseline;justify-content:flex-start;flex-wrap:wrap;gap:4px 8px;text-align:start}
.mx-rt-name{font-weight:700;font-size:14px;color:var(--color-text-primary)}
.mx-rt-n{font-weight:400;font-size:12px;color:var(--color-text-secondary)}
.matrix.mx-one .mx-group{border-bottom:1px solid var(--color-border-subtle)}
.matrix.mx-one .mx-group:last-child{border-bottom:0}
.matrix.mx-one .mx-gh{padding:12px 16px;background:var(--color-bg-container)}
.matrix.mx-one .mx-row.sens>span:first-child{font-weight:600}
@media (max-width:720px){.matrix.mx-one .mx-row{grid-template-columns:1fr;gap:8px}.mx-rolehead .mx-opts{display:none}}
/* errors on the screen (the owner 17 Nov — «لو ده حصل يطلع زرار اعمل رفريش» / «لو حصل ايرور في اي حاجة يطلعلي بوباب بالغلط»): a card on <body>,
   outside the app — at the bottom for an error (it blocks nothing), in the middle when the page went blank */
.ib-crash{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:2147483000;width:min(520px,calc(100vw - 32px));display:flex;flex-direction:column;gap:10px;padding:16px 18px;border-radius:14px;background:var(--color-bg-container,#fff);border:1px solid var(--color-danger-border,#e8b4ae);border-inline-start:4px solid var(--color-danger,#b42318);box-shadow:var(--shadow-popover,0 8px 24px rgba(0,0,0,.18));font-family:inherit;direction:rtl;text-align:start}
.ib-crash.blank{bottom:auto;top:50%;transform:translate(-50%,-50%);align-items:stretch}
.ib-crash b{font-size:16px;color:var(--color-text-strong,#1f2a24)}
.ib-crash p{margin:0;font-size:13px;line-height:20px;color:var(--color-text-secondary,#5b6660)}
.ib-crash-err{margin:0;max-height:140px;overflow:auto;padding:8px 10px;border-radius:8px;background:var(--color-bg-sunken,#f6f1e7);font:12px/18px ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-word;text-align:left;user-select:text}
.ib-crash-acts{display:flex;gap:8px;flex-wrap:wrap}
/* ش38 (the owner 17 Nov — «شيل الاسهم بتاعة الزيادة و النقصان من الخانة»): no browser arrows on any number box in the system */
input[type=number]{-moz-appearance:textfield;appearance:textfield}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}

/* IBChatAsk (the owner 18 Nov — «لو عايزني اختار حاجة يجيبها جوه الشات … لو محتاجين بيانات يديني بوباب»): the assistant's options as
   buttons inside the chat and the «املا البيانات» link, under its answer — every assistant and the header's the same way */
.ib-ask { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ib-ask-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.ib-ask-opt { cursor: pointer; border: 1px solid var(--color-brand-default); color: var(--color-brand-default); background: var(--color-bg-container); font: inherit; }
.ib-ask-opt:hover:not(:disabled) { background: var(--color-brand-default); color: #FFF7EF; }
.ib-ask-opt:disabled { opacity: .55; cursor: default; }
