/* Paseer Enterprise — التطبيقات المؤسسية + لوحة المؤشرات المؤسسية */

/* ========================================================== apps launcher */
.apps-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.apps-bar .input-affix { flex: 1 1 280px; max-width: 420px; }
.apps-bar .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.apps-sum { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.apps-sum .s { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.apps-sum .s .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.apps-sum .s b { font-size: 20px; display: block; line-height: 1.1; }
.apps-sum .s span { font-size: 12px; color: var(--text-3); }

.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); grid-auto-rows: 1fr; gap: 16px; }
.acard { --c: #0B6BC0; --c2: #3D9BEA; position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-xs);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; isolation: isolate; }
.acard:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -22px color-mix(in srgb, var(--c) 70%, transparent); border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.acard:hover, .acard:focus { text-decoration: none; }
.acard:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent); }
.acard .top { position: relative; padding: 18px 18px 16px; color: #fff; background: linear-gradient(135deg, var(--c2), var(--c)); overflow: hidden; }
.acard .top::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; inset-inline-end: -60px; top: -90px; background: rgba(255,255,255,.12); }
.acard .top::before { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; inset-inline-end: 40px; bottom: -70px; background: rgba(255,255,255,.08); }
.acard .hd { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.acard .logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); flex: none; }
.acard .logo .i { width: 24px; height: 24px; }
.acard .nm { min-width: 0; flex: 1; }
.acard .nm b { display: block; font-size: 17px; font-weight: 800; }
.acard .nm span { font-size: 12px; opacity: .85; font-family: var(--font); letter-spacing: .3px; }
.acard .pin { position: relative; z-index: 2; width: 32px; height: 32px; border-radius: 10px; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.acard .pin:hover { background: rgba(255,255,255,.28); }
.acard .pin.on { background: #fff; color: var(--c); }
.acard .pin.on svg { fill: currentColor; }
.acard .desc { position: relative; z-index: 1; font-size: 12.5px; opacity: .9; margin-top: 10px; }
.acard .body { padding: 14px 18px 4px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.acard .mx { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acard .mx div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; min-width: 0; }
.acard .mx span { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard .mx b { font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.acard .mx b .tr { font-size: 11px; font-weight: 700; }
.tr.up { color: var(--success); } .tr.down { color: var(--danger); } .tr.good { color: var(--success); } .tr.bad { color: var(--danger); }
.acard .sp { display: flex; align-items: center; gap: 10px; }
.acard .sp svg { flex: 1; height: 38px; min-width: 0; }
.acard .sp small { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.acard .ft { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; margin-top: auto; }
.acard .al { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard .al .i { flex: none; }
.acard .al .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard .al.sv-d { background: var(--danger-bg); color: var(--danger); } .acard .al.sv-w { background: var(--warning-bg); color: var(--warning); }
.acard .al.sv-i { background: var(--info-bg); color: var(--info); } .acard .al.sv-g { background: var(--success-bg); color: var(--success); }
.acard .go { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--c); white-space: nowrap; transition: gap .2s; }
.acard:hover .go { gap: 10px; }
:root[data-theme="dark"] .acard .go { color: color-mix(in srgb, var(--c2) 80%, #fff); }
.acard .hl { position: absolute; top: 12px; inset-inline-start: 50%; z-index: 2; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.health i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.health.warn i { background: #E8A13A; box-shadow: 0 0 0 3px var(--warning-bg); }
.apps-empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--text-3); }
@media (max-width: 1100px) { .apps-sum { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .app-cards { grid-template-columns: minmax(0,1fr); } .apps-sum { grid-template-columns: minmax(0,1fr); } }

/* ========================================================== dashboard */
.dash-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow-xs); position: sticky; top: calc(var(--top-h) + 8px); z-index: 30; }
.dash-tools .sep { width: 1px; height: 26px; background: var(--border); }
.dash-tools .live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.dash-tools .live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dash-tools .live.on .dot { background: var(--success); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(19,121,91,.5); } 70% { box-shadow: 0 0 0 8px rgba(19,121,91,0); } 100% { box-shadow: 0 0 0 0 rgba(19,121,91,0); } }
.dash-tools .btn.on { background: var(--primary-50); color: var(--primary); border-color: var(--primary-200); }

.dash { --cols: 12; --row: 70px; --gap: 14px; position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0,1fr)); grid-auto-rows: var(--row); gap: var(--gap); min-height: 300px; padding-bottom: 40px; }
.dash.editing::before { content: ""; position: absolute; inset: 0 0 40px; pointer-events: none; border-radius: 16px; z-index: 0;
  background-image: linear-gradient(to left, color-mix(in srgb, var(--primary) 7%, transparent) 1px, transparent 1px);
  background-size: calc((100% + var(--gap)) / var(--cols)) 100%; }
.wdg { position: relative; z-index: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-xs); overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.wdg:hover { box-shadow: var(--shadow-sm); }
.wdg .wh { display: flex; align-items: center; gap: 8px; padding: 11px 14px 6px; min-height: 42px; user-select: none; }
.dash:not(.locked) .wdg .wh { cursor: grab; }
.wdg .wh .grip { color: var(--text-3); opacity: 0; transition: opacity .15s; display: grid; place-items: center; width: 16px; flex: none; }
.dash:not(.locked) .wdg:hover .wh .grip { opacity: .8; }
.wdg .wh .ai { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; }
.wdg .wh .ai .i { width: 15px; height: 15px; }
.wdg .wh h2, .wdg .wh h3 { font-size: 13.5px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wdg .wh .wa { display: none; gap: 2px; }
.wdg:hover .wh .wa, .wdg:focus-within .wh .wa { display: flex; animation: fade .15s var(--ease); }

.wdg .wh .wa button, .wdg .wh .wa a { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); display: grid; place-items: center; cursor: pointer; }
.wdg .wh .wa button:hover, .wdg .wh .wa a:hover { background: var(--surface-3); color: var(--text); }
.wdg .wh .wa .i { width: 15px; height: 15px; }
.wdg .wb { flex: 1; min-height: 0; padding: 4px 14px 12px; position: relative; }
.wdg .rz { position: absolute; bottom: 0; inset-inline-end: 0; width: 22px; height: 22px; cursor: nwse-resize; opacity: 0; transition: opacity .15s; z-index: 3; touch-action: none; }
[dir="rtl"] .wdg .rz { cursor: nesw-resize; }
.wdg .rz::after { content: ""; position: absolute; bottom: 5px; inset-inline-end: 5px; width: 9px; height: 9px; border-bottom: 2px solid var(--text-3); border-inline-end: 2px solid var(--text-3); border-end-end-radius: 3px; }
.dash:not(.locked) .wdg:hover .rz { opacity: 1; }
.dash.locked .wdg .rz { display: none; }
.wdg.dragging { z-index: 50; box-shadow: 0 30px 60px -20px rgba(15,40,80,.45); border-color: var(--primary-200); cursor: grabbing; opacity: .96; transition: none; }
.wdg.dragging .wh { cursor: grabbing; }
.wdg.resizing { z-index: 40; border-color: var(--primary-200); box-shadow: var(--shadow-md); }
.dash-ph { z-index: 0; border-radius: 20px; border: 2px dashed var(--primary-200); background: color-mix(in srgb, var(--primary) 7%, transparent); pointer-events: none; transition: grid-row .1s, grid-column .1s; }
.wdg.flash { animation: flash .9s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--primary-200); } 100% { box-shadow: var(--shadow-xs); } }

/* KPI widget */
.wk { display: flex; flex-direction: column; height: 100%; justify-content: space-between; gap: 4px; }
.wk .v { color: var(--text); font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.wk .v small { font-size: 14px; color: var(--text-3); font-weight: 600; margin-inline-start: 2px; }
.wk .row2 { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.wk .dl { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.wk .dl.good { background: var(--success-bg); color: var(--success); } .wk .dl.bad { background: var(--danger-bg); color: var(--danger); }
.wk .tg { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.wk .tg span { display: block; height: 100%; border-radius: 99px; transition: width .8s var(--ease); }
.wk svg.sk { width: 100%; height: 34px; }
.wk.compact .sk { display: none; }

/* charts */
.ch { width: 100%; height: 100%; display: block; overflow: visible; }
.ch text { font-family: var(--font); fill: var(--text-3); font-size: 11px; }
.ch .grid line { stroke: var(--border); }
.ch .hov { transition: opacity .15s; }
.ch [data-tip] { cursor: pointer; }
.ch .bar { transition: opacity .15s; } .ch .bar:hover { opacity: .8; }
.lgd { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); margin-top: 4px; }
.lgd span { display: inline-flex; align-items: center; gap: 5px; }
.lgd i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.wflex { display: flex; flex-direction: column; height: 100%; gap: 6px; min-height: 0; }
.wflex > .grow { flex: 1; min-height: 0; }
.wsplit { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 12px; height: 100%; align-items: center; }
.wlist { display: flex; flex-direction: column; gap: 8px; overflow: auto; height: 100%; padding-inline-end: 2px; }
.wlist .it { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 4px 10px; align-items: center; font-size: 12.5px; }
.wlist .it .progress { grid-column: 1 / -1; height: 6px; }
.wlist .it b { text-align: end; font-variant-numeric: tabular-nums; }
.feed { display: flex; flex-direction: column; gap: 2px; overflow: auto; height: 100%; }
.feed a { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; padding: 8px; border-radius: 12px; text-decoration: none; color: inherit; }
.feed a:hover { background: var(--surface-2); }
.feed .fi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.feed .fi .i { width: 15px; height: 15px; }
.feed b { font-size: 12.5px; display: block; }
.feed small { font-size: 11.5px; color: var(--text-3); }
.feed .sev { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.sev.sv-d { background: var(--danger); } .sev.sv-w { background: #E8A13A; } .sev.sv-i { background: var(--info); }
.mst { display: flex; flex-direction: column; gap: 0; overflow: auto; height: 100%; }
.mst .m { display: grid; grid-template-columns: 54px 14px minmax(0,1fr); gap: 10px; align-items: start; font-size: 12.5px; position: relative; padding-bottom: 12px; }
.mst .m .dt { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-2); }
.mst .m .dotc { width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px currentColor; position: relative; z-index: 1; }
.mst .m::before { content: ""; position: absolute; inset-inline-start: 69px; top: 12px; bottom: 0; width: 2px; background: var(--border); }
.mst .m:last-child::before { display: none; }
.mst small { color: var(--text-3); display: block; font-size: 11.5px; }
.rmap { display: grid; grid-template-columns: 16px repeat(5, minmax(0,1fr)); grid-template-rows: repeat(5, minmax(0,1fr)) 16px; gap: 4px; height: 100%; }
.rmap .c { border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; cursor: pointer; transition: transform .15s; min-height: 0; }
.rmap .c:hover { transform: scale(1.06); }
.rmap .c.z { color: rgba(0,0,0,.25); }
.rmap .ax { font-size: 10px; color: var(--text-3); display: grid; place-items: center; }
.rmap .axl { writing-mode: vertical-rl; transform: rotate(180deg); }
.brief { display: flex; flex-direction: column; gap: 9px; overflow: auto; height: 100%; font-size: 12.5px; line-height: 1.65; }
.brief .b { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 8px; }
.brief .b .bi { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; }
.brief .b .bi .i { width: 13px; height: 13px; }
.brief .b.bu .bi { background: var(--success-bg); color: var(--success); } .brief .b.bd .bi { background: var(--warning-bg); color: var(--warning); } .brief .b.ba .bi { background: var(--danger-bg); color: var(--danger); }
.brief .src { font-size: 11px; color: var(--primary); text-decoration: none; font-weight: 700; margin-inline-start: 4px; }
.hm { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, minmax(0,1fr)); gap: 3px; height: 100%; }
.hm i { border-radius: 3px; background: var(--surface-3); min-height: 0; }
.hm i.l1 { background: color-mix(in srgb, var(--primary) 25%, var(--surface-3)); } .hm i.l2 { background: color-mix(in srgb, var(--primary) 48%, var(--surface-3)); }
.hm i.l3 { background: color-mix(in srgb, var(--primary) 72%, var(--surface-3)); } .hm i.l4 { background: var(--primary); }

.ttip { position: fixed; z-index: 400; pointer-events: none; background: #0F1B2A; color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 9px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.4); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; white-space: nowrap; }
.ttip.on { opacity: 1; transform: none; }
.ttip b { font-variant-numeric: tabular-nums; }

/* widget library drawer */
.wlib { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wlib button { text-align: start; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; color: var(--text); }
.wlib button:hover { border-color: var(--primary-200); transform: translateY(-2px); }
.wlib button .ai { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.wlib button b { font-size: 13px; }
.wlib button small { font-size: 11.5px; color: var(--text-3); }
.wlib button.used { opacity: .55; }
.wlib-h { font-size: 12px; font-weight: 700; color: var(--text-3); margin: 16px 0 8px; }

/* widget menu */
.wmenu { position: fixed; z-index: 300; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.wmenu.on { display: block; animation: fade .12s var(--ease); }
.wmenu button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: var(--text); text-align: start; }
.wmenu button:hover { background: var(--surface-2); }
.wmenu button.on { color: var(--primary); font-weight: 700; }
.wmenu .h { font-size: 11px; color: var(--text-3); padding: 6px 10px 2px; font-weight: 700; }
.wmenu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* focus (maximize) */
.wfocus { position: fixed; inset: 5vh 5vw; z-index: 210; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden; }
.wfocus.on { display: flex; animation: fade .18s var(--ease); }
.wfocus .wh { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.wfocus .wh h2, .wfocus .wh h3 { flex: 1; font-size: 16px; }
.wfocus .wb { flex: 1; padding: 20px 24px; min-height: 0; }

/* presentation mode */
body.present .sidebar, body.present .topbar, body.present .page-head { display: none !important; }
body.present .app { grid-template-columns: minmax(0,1fr); }
body.present .content { padding-top: 16px; }
body.present .dash-tools { top: 8px; }

@media (max-width: 900px) {
  .dash-tools { position: static; }
  .dash-tools #edit, .dash-tools #lock, .dash-tools #reset, .dash-tools #undo, .dash-tools .sep, .dash-tools #upd { display: none; }
  .dash { display: flex; flex-direction: column; }
  .dash .wdg { height: calc(var(--h) * 64px); flex: none; }
  .dash .dash-ph, .dash.editing::before { display: none; }
  .wdg .rz { display: none; }
  .wlib { grid-template-columns: 1fr; }
}

.dash-tools .btn-sm.ico-only { width: 32px; padding: 0; justify-content: center; }

/* ========================================================== enterprise documents */
.docs-layout { display: block; }
.cat-list { display: flex; flex-wrap: wrap; gap: 4px; }
.cat-list button { display: flex; align-items: center; gap: 7px; white-space: nowrap; border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--text-2); padding: 7px 9px; border-radius: 11px; cursor: pointer; text-align: start; }
.cat-list button:hover { background: var(--surface-3); color: var(--text); }
.cat-list button.on { background: var(--primary-50); color: var(--primary); font-weight: 700; }
.cat-list button .n { margin-inline-start: 2px; font-size: 11.5px; background: var(--surface-3); border-radius: 99px; padding: 0 8px; line-height: 20px; color: var(--text-2); font-weight: 600; }
.cat-list button.on .n { background: #fff; color: var(--primary-fill); }
.store { font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 6px; }
.ext { width: 36px; height: 42px; border-radius: 8px; display: grid; place-items: end center; padding-bottom: 5px; font-size: 9.5px; font-weight: 800; color: #fff; letter-spacing: .5px; flex: none; position: relative; font-family: var(--mono); text-transform: uppercase; }
.ext::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 11px; height: 11px; background: rgba(255,255,255,.35); border-end-end-radius: 6px; }
.ext.pdf { background: linear-gradient(160deg, #E0584B, #B42318); } .ext.docx { background: linear-gradient(160deg, #4C8BEA, #1F5FBF); }
.ext.xlsx { background: linear-gradient(160deg, #3FA982, #13795B); } .ext.pptx { background: linear-gradient(160deg, #F0A060, #C2410C); }
.dcell { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.dcell b { display: block; font-size: 13.5px; }
.dcell small { font-size: 11.5px; color: var(--text-3); }
.vis { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); max-width: 160px; }
.vis span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aist { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.aist.ok { background: var(--violet-bg); color: var(--violet); } .aist.wait { background: var(--warning-bg); color: var(--warning); } .aist.off { background: var(--surface-3); color: var(--text-3); }
.aist.wait .i { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.persona-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; background: var(--info-bg); color: var(--info); font-size: 13px; border-bottom: 1px solid var(--info-bd); }
.persona-bar b { color: var(--text); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; border: 2px dashed var(--border-strong); border-radius: 18px; padding: 34px 20px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-50); }
.drop .big { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.drop .big .i { width: 28px; height: 28px; }
.fcard { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.proc { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; font-size: 13px; }
.proc div { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.proc div.ok { color: var(--success); } .proc div.run { color: var(--primary); }
.proc div.run .i { animation: spin 1s linear infinite; }
.sugg { margin-top: 14px; border: 1px solid var(--violet-bd); background: var(--violet-bg); border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick .chip { border-style: solid; }
.vtype { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
.vtype label { border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: center; }
.vtype label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.vtype input { position: absolute; opacity: 0; pointer-events: none; }
.aud { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.aud b { font-size: 18px; }
.rule { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); padding: 6px 0; }
.rule .i { color: var(--violet); flex: none; margin-top: 2px; }
.page-mock { position: relative; overflow: hidden; background: #fff; color: #1b2733; border-radius: 6px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); padding: 36px 40px; min-height: 520px; font-size: 13px; line-height: 2; }
.page-mock h3 { text-align: center; font-size: 16px; margin-bottom: 4px; }
.page-mock .ln { height: 8px; border-radius: 4px; background: #E7ECF2; margin: 10px 0; }
.page-mock .wm { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.page-mock .wm span { transform: rotate(-28deg); font-size: 22px; font-weight: 800; color: rgba(180,35,24,.14); white-space: nowrap; line-height: 3.2; text-align: center; }
.ans { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; background: var(--surface); }
.ans .q { font-weight: 700; margin-bottom: 8px; }
.ans .cite { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--violet); background: var(--violet-bg); padding: 4px 10px; border-radius: 99px; cursor: pointer; border: 0; font-family: inherit; }
.ans .meta { font-size: 11.5px; color: var(--text-3); margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.vrow { display: grid; grid-template-columns: 60px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.vrow:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .docs-layout { grid-template-columns: minmax(0,1fr); } .cat-list { flex-direction: row; flex-wrap: wrap; } .vtype { grid-template-columns: repeat(3, minmax(0,1fr)); } }

/* ========================================================== compliance conformity (ISO) */
.cmp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cmp-tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 5px; flex: 1 1 auto; min-width: 0; }
.cmp-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 11px; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.cmp-tabs a:hover { background: var(--surface-3); color: var(--text); }
.cmp-tabs a.on { background: var(--primary-fill); color: #fff; box-shadow: 0 6px 14px -8px rgba(11,107,192,.6); }
.cmp-role { display: flex; align-items: center; gap: 8px; }
.cmp-role .select { width: auto; height: 36px; font-size: 12.5px; }
.cmp-disc { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-2); background: var(--info-bg); border: 1px solid var(--info-bd); border-radius: 12px; padding: 9px 12px; margin-bottom: 16px; }
.cmp-disc .i { color: var(--info); flex: none; margin-top: 1px; }
.cmp-stds { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cmp-std { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cmp-std .hd { display: flex; align-items: center; gap: 10px; }
.cmp-std .lg { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.cmp-std .hd b { display: block; font-size: 15px; }
.cmp-std .hd small { color: var(--text-3); font-size: 12px; }
.cmp-rings { display: flex; gap: 14px; }
.cmp-ring { --v: 0; --c: var(--primary); width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-3) 0); position: relative; flex: none; }
.cmp-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.cmp-ring span { position: relative; font-weight: 800; font-size: 16px; text-align: center; line-height: 1.1; }
.cmp-ring span small { display: block; font-size: 10px; font-weight: 600; color: var(--text-3); }
.cmp-block { font-size: 12px; color: var(--danger); display: flex; gap: 6px; align-items: flex-start; }
.cmp-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px solid transparent; white-space: nowrap; }
.cmp-cl { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.cmp-cl + .cmp-cl { margin-top: 10px; }
.cmp-cl > .h { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface-2); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.cmp-cl > .h .bar { flex: 1; max-width: 220px; margin-inline-start: auto; }
.cmp-req { display: grid; grid-template-columns: 64px minmax(0,1.3fr) minmax(0,1.4fr) auto auto; gap: 10px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 13px; }
.cmp-req .ref { font-family: var(--mono); font-weight: 700; color: var(--text-2); font-size: 12px; direction: ltr; text-align: start; }
.cmp-req .ev { font-size: 12px; color: var(--text-2); min-width: 0; }
.cmp-req .ev a { font-weight: 700; }
.cmp-req .src { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; color: #fff; margin-inline-end: 6px; }
.cmp-share { font-size: 10.5px; font-weight: 700; color: var(--violet); background: var(--violet-bg); border-radius: 6px; padding: 1px 6px; margin-inline-start: 6px; }
.cmp-cov { display: grid; gap: 4px; font-size: 11.5px; }
.cmp-cov .r { display: grid; grid-template-columns: 200px repeat(8, minmax(0,1fr)); gap: 4px; align-items: center; }
.cmp-cov .c { height: 26px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; color: #fff; }
.cmp-cov .hd { color: var(--text-3); font-weight: 700; text-align: center; }
.cmp-src { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cmp-src:last-child { border-bottom: 0; }
.cmp-src .lg { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.cmp-src .lg .i { width: 16px; height: 16px; }
.cmp-src.run { background: linear-gradient(to left, var(--primary-50), transparent); }
.cmp-hash { font-family: var(--mono); font-size: 12px; direction: ltr; unicode-bidi: isolate; }
.cmp-cal { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cmp-cal:last-child { border-bottom: 0; }
.cmp-cal .dt { font-weight: 800; color: var(--primary); }
.cmp-soa { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.cmp-soa div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; font-size: 12px; color: var(--text-3); }
.cmp-soa b { display: block; font-size: 20px; color: var(--text); }
@media (max-width: 1100px) { .cmp-req { grid-template-columns: 56px minmax(0,1fr) auto; } .cmp-req .ev, .cmp-req .own { display: none; } .cmp-cov .r { grid-template-columns: 120px repeat(8, minmax(0,1fr)); } }
.sp-crit { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sp-crit:last-child { border-bottom: 0; }
.sp-crit .st { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 11px; }
.sp-crit .st.ok { background: var(--success-bg); color: var(--success); } .sp-crit .st.wa { background: var(--warning-bg); color: var(--warning); } .sp-crit .st.no { background: var(--danger-bg); color: var(--danger); }
.sp-crit small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.cmp-hash { white-space: nowrap; }
.cmp-tabs a[hidden], .page-actions[hidden] { display: none !important; }

/* ================= السلاسل العابرة للمنتجات ================= */

.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ch-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.ch-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 10px 24px -14px rgba(15,40,70,.35)); }
.ch-card .code { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); direction: ltr; }
.ch-card h2, .ch-card h3 { font-size: 15.5px; line-height: 1.5; }
.ch-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.ch-flow .pd { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.ch-flow .pd .i { width: 14px; height: 14px; }
.ch-flow .ar { color: var(--text-3); font-size: 11px; }
.ch-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.ch-stats b { color: var(--text); font-size: 15px; margin-inline-end: 3px; }
.ch-stats .bad b { color: var(--danger); }
.ch-pchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px 2px 6px; border-radius: 99px; color: #fff; white-space: nowrap; }
.ch-pchip .i { width: 12px; height: 12px; }
.ch-prog { display: flex; gap: 3px; }
.ch-prog i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-3); display: block; }
.ch-prog i.d { background: var(--success); } .ch-prog i.c { background: var(--primary); } .ch-prog i.s { background: var(--danger); }
.ch-switch { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ch-switch a { flex: none; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); text-decoration: none; white-space: nowrap; }
.ch-switch a.on { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
.ch-lanes { display: grid; gap: 0; min-width: max-content; }
.ch-lane-h { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 700; border-bottom: 1px dashed var(--border); border-inline-end: 1px solid var(--border); }
.ch-lane-h .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ch-cell { border-bottom: 1px dashed var(--border); padding: 8px 6px; min-height: 64px; display: flex; align-items: center; position: relative; }
.ch-colh { font-size: 11px; color: var(--text-3); padding: 6px; text-align: center; border-bottom: 1px solid var(--border); font-family: var(--mono); }
.ch-step { width: 100%; text-align: start; border: 1.5px solid var(--border); border-radius: 11px; background: var(--surface); padding: 8px 10px; font: inherit; font-size: 12px; line-height: 1.45; cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 3px; min-width: 150px; max-width: 190px; }
.ch-step b { font-size: 12.5px; }
.ch-step small { color: var(--text-3); font-family: var(--mono); font-size: 10.5px; direction: ltr; text-align: start; }
.ch-step.d { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }
.ch-step.c { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.ch-step.s { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.ch-step.p { opacity: .62; }
.ch-step.sel { outline: 2px dashed var(--text-3); outline-offset: 3px; }
.ch-step .st { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; }
.ch-step.d .st { color: var(--success); } .ch-step.c .st { color: var(--primary); } .ch-step.s .st { color: var(--danger); } .ch-step.p .st { color: var(--text-3); }
.ch-step .st .i { width: 12px; height: 12px; }
.ch-inst { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); text-align: start; font: inherit; color: inherit; width: 100%; }
.ch-inst.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.ch-ev { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.ch-ev:last-child { border-bottom: 0; }
.ch-ev .k { font-family: var(--mono); font-size: 11.5px; direction: ltr; unicode-bidi: isolate; }
.ch-ev .dup { color: var(--warning); }
.ch-ref { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, var(--surface-3)); font-size: 12.5px; }
.ch-ref .mono { font-size: 12px; }
.ch-gate { border: 1.5px solid var(--border); border-radius: 14px; padding: 14px; background: var(--surface); }
.ch-gate h3, .ch-gate h4 { font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ch-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer; }
.ch-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.ch-opt input { margin-top: 3px; }
.ch-meas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ch-meas > div { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center; }
.ch-meas b { display: block; font-size: 18px; }
.ch-meas span { font-size: 11.5px; color: var(--text-3); }
.ch-sep { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-sep > div { border: 1px dashed var(--border-strong); border-radius: 11px; padding: 10px 12px; font-size: 12.5px; }
.ch-slider { display: grid; grid-template-columns: 120px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; }
@media (max-width: 720px) { .ch-sep, .ch-meas { grid-template-columns: 1fr; } }
.ch-card, .card-head > .row { min-width: 0; } .card-head > .row { max-width: 100%; }

/* ================= الترحيل والاستيعاب ================= */
.mg-phases { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.mg-ph { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--border); text-decoration: none; color: var(--text-2); background: var(--surface); position: relative; }
.mg-ph .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--text-3); }
.mg-ph b { font-size: 12px; line-height: 1.4; }
.mg-ph small { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); direction: ltr; }
.mg-ph.d .n { background: var(--success); color: #fff; }
.mg-ph.c { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); color: var(--text); }
.mg-ph.c .n { background: var(--primary-fill); color: #fff; }
.mg-split { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr); gap: 12px; align-items: center; }
.mg-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.mg-steps span { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--text-3); font-weight: 600; }
.mg-steps span.d { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.mg-steps span.c { background: var(--primary-fill); color: #fff; }
@media (max-width: 1100px) { .mg-phases { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mg-phases { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mg-split { grid-template-columns: 1fr; } }
.card-head .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .card-head .seg button { flex: none; }

/* ================= الوصول والحوكمة والتشغيل ================= */
.side-links .side-link:nth-child(7):last-child { grid-column: 1 / -1; }
.op-svc { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.op-s { border: 1px solid var(--border); border-inline-start: 4px solid var(--success); border-radius: 12px; padding: 10px 12px; }
.op-s.warn, .op-s.degraded { border-inline-start-color: var(--warning); }
.op-s.down { border-inline-start-color: var(--danger); }
.op-sod { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.op-sod > div { border: 1px dashed var(--border-strong); border-radius: 11px; padding: 10px 6px; display: flex; flex-direction: column; gap: 4px; }
.op-sod b { font-size: 13px; } .op-sod span { font-size: 11.5px; color: var(--text-3); }
.op-envs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.op-env { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.op-env .mono { direction: ltr; text-align: start; color: var(--text-3); }
.op-gates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.op-tl { border-inline-start: 2px solid var(--border); padding-inline-start: 10px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.op-tl .mono { color: var(--text-3); margin-inline-end: 6px; }
@media (max-width: 900px) { .op-envs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .op-gates { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .op-sod { grid-template-columns: 1fr; } .op-envs { grid-template-columns: 1fr; } }
#opsBody .kpi, #migBody .kpi { min-width: 0; } #opsBody .kpi .val, #migBody .kpi .val { font-size: clamp(17px, 4.6vw, 26px); overflow-wrap: anywhere; }

/* زر ذكاء اصطناعي معطّل: رمادي باهت بسبب مقروء بدل أن يبدو متاحاً ثم يفشل */
.ai-off, .icon-btn.ai-btn.ai-off, .btn.ai-off { background: var(--surface-2, #EEF1F5) !important; color: var(--text-3, #6B7280) !important;
  border-color: var(--border, #D8E0E8) !important; box-shadow: none !important; cursor: not-allowed; opacity: .75; filter: grayscale(1); }
.ai-off svg { opacity: .8; }
