/* ==========================================================================
   Flow+ — design tokens and components, taken from the running system
   (PrimeNG Aura preset, primary #336EFF, slate surfaces, Figtree / Cairo).
   ========================================================================== */
@font-face { font-family: "Figtree"; src: url("../assets/fonts/Figtree-latin.woff2") format("woff2"); font-weight: 300 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; src: url("../assets/fonts/Figtree-latin-ext.woff2") format("woff2"); font-weight: 300 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cairo"; src: url("../assets/fonts/Cairo-Regular.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "Cairo"; src: url("../assets/fonts/Cairo-Medium.woff2") format("woff2"); font-weight: 500; }
@font-face { font-family: "Cairo"; src: url("../assets/fonts/Cairo-SemiBold.woff2") format("woff2"); font-weight: 600; }
@font-face { font-family: "Cairo"; src: url("../assets/fonts/Cairo-Bold.woff2") format("woff2"); font-weight: 700; }

:root {
  --header-height: 62px;
  --rail: 64px;
  --subnav: 248px;
  --primary: #336eff; --primary-600: #1a5cff; --primary-700: #0042e6; --primary-200: #d1ddfa; --primary-50: #eef3ff;
  --s0: #ffffff; --s50: #f8fafc; --s100: #f1f5f9; --s200: #e2e8f0; --s300: #cbd5e1; --s400: #94a3b8;
  --s500: #64748b; --s600: #475569; --s700: #334155; --s800: #1e293b; --s900: #0f172a;
  --page: #f7faff; --text: #171b26; --muted: #3b404f; --border: #e2e8f0; --field: #cbd5e1;
  --sky: #0ea5e9; --sky-50: #f0f9ff; --sky-100: #e0f2fe; --sky-600: #0284c7;
  --green: #22c55e; --green-50: #f0fdf4; --green-100: #dcfce7; --green-600: #16a34a; --green-700: #15803d;
  --amber: #f59e0b; --amber-50: #fffbeb; --amber-100: #fef3c7; --amber-700: #b45309;
  --red: #ef4444; --red-50: #fef2f2; --red-100: #fee2e2; --red-700: #b91c1c;
  --violet: #8b5cf6; --violet-50: #f5f3ff; --violet-100: #ede9fe;
  --orange: #f97316; --cyan: #06b6d4; --teal: #059669; --indigo: #6366f1;
  --r-sm: 4px; --r: 6px; --r-lg: 8px; --r-xl: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06);
  --font: "Figtree", "Segoe UI", system-ui, sans-serif;
  --faris: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
}
html[dir="rtl"] { --font: "Cairo", "Figtree", "Segoe UI", sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; color: var(--text); background: var(--page); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
svg { flex-shrink: 0; }
::selection { background: var(--primary-200); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd8e6; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- shell --------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--rail) 1fr; height: 100vh; overflow: hidden; }
.rail { grid-row: 1 / span 2; background: var(--page); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 6px; z-index: 30; }
.rail .ri { width: 44px; height: 44px; border-radius: var(--r-lg); display: grid; place-items: center; color: var(--s500); cursor: pointer; position: relative; border: 0; background: none; transition: background .15s, color .15s; }
.rail .ri svg { width: 22px; height: 22px; }
.rail .ri:hover { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.rail .ri.on { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.rail .ri.on::before { content: ""; position: absolute; inset-inline-start: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--primary); }
.rail .sep { width: 28px; height: 1px; background: var(--border); margin: 4px 0; }
.rail .tip { position: absolute; inset-inline-start: 54px; background: var(--s800); color: #fff; font-size: 12.5px; padding: 5px 10px; border-radius: var(--r); white-space: nowrap; pointer-events: none; opacity: 0; transform: translateX(-4px); transition: .12s; z-index: 50; }
html[dir="rtl"] .rail .tip { transform: translateX(4px); }
.rail .ri:hover .tip { opacity: 1; transform: none; }
.rail .grow { flex: 1; }

.main { display: grid; grid-template-rows: var(--header-height) 1fr; min-width: 0; height: 100vh; }
.header { background: #336eff; display: flex; align-items: center; gap: 14px; padding: 8px 16px; color: #fff; z-index: 20; }
.header .brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.header .brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); }
.header .brand b { font-size: 17px; font-weight: 600; letter-spacing: .1px; }
.header .crumb { color: rgba(255,255,255,.75); font-size: 14px; display: flex; align-items: center; gap: 8px; margin-inline-start: 6px; }
.header .crumb .sl { opacity: .5; }
.header .sp { flex: 1; }
.hsearch { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 0 12px; height: 36px; width: 300px; color: rgba(255,255,255,.85); cursor: pointer; font-size: 14px; }
.hsearch kbd { margin-inline-start: auto; font-size: 11px; background: rgba(255,255,255,.18); padding: 1px 6px; border-radius: 4px; font-family: inherit; }
.faris-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 4px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); color: #fff; cursor: pointer; font-weight: 500; }
.faris-pill .fx { width: 28px; height: 28px; border-radius: 50%; background: var(--faris); display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.hicon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff; position: relative; border: 0; background: none; }
.hicon:hover { background: rgba(255,255,255,.14); }
.hicon .dot { position: absolute; top: 7px; inset-inline-end: 8px; min-width: 16px; height: 16px; border-radius: 8px; background: #ef4444; font-size: 10px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #336eff; font-weight: 700; }
.huser { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: var(--r-lg); }
.huser:hover { background: rgba(255,255,255,.12); }
.huser .av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.huser .nm { line-height: 1.15; }
.huser .nm b { display: block; font-size: 14px; font-weight: 600; }
.huser .nm span { font-size: 12px; opacity: .8; }

.body { display: flex; min-height: 0; overflow: hidden; }
.subnav { width: var(--subnav); flex-shrink: 0; padding: 18px 12px; overflow: auto; border-inline-end: 1px solid var(--border); background: var(--page); }
.subnav.hidden { display: none; }
.subnav h6 { margin: 18px 12px 6px; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--s500); font-weight: 600; }
.subnav h6:first-child { margin-top: 2px; }
.subnav .mod { display: flex; align-items: center; gap: 10px; padding: 8px 12px 14px; font-weight: 600; font-size: 16px; }
.subnav .mod svg { color: var(--primary); }
.subnav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-lg); color: var(--text); font-size: 15px; margin-bottom: 2px; }
.subnav a svg { width: 18px; height: 18px; color: var(--s500); }
.subnav a:hover { background: #fff; }
.subnav a.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.subnav a.on svg { color: var(--primary); }
.subnav a .ct { margin-inline-start: auto; font-size: 12px; background: var(--amber-100); color: var(--amber-700); padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.subnav a .ct.b { background: var(--primary-50); color: var(--primary); }
.content { flex: 1; min-width: 0; overflow: auto; position: relative; }
.content.flush { overflow: hidden; }

/* ---- page header --------------------------------------------------------- */
.ph { display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--border); min-height: 72px; position: sticky; top: 0; z-index: 10; }
.ph .ttl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ph .ttl > svg { color: var(--primary); width: 22px; height: 22px; }
.ph h1 { margin: 0; font-size: 20px; font-weight: 700; white-space: nowrap; }
.ph .sub { font-size: 13.5px; color: var(--s500); margin-top: 2px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph .mid { flex: 1; display: flex; justify-content: center; }
.ph .act { display: flex; align-items: center; gap: 10px; }
.back { width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center; cursor: pointer; color: var(--s600); border: 0; background: none; }
.back:hover { background: var(--s100); }
html[dir="rtl"] .back svg, html[dir="rtl"] .flip { transform: scaleX(-1); }

.page { padding: 24px 28px 48px; }
.page.narrow { max-width: 1240px; }

/* ---- controls ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r); border: 1px solid transparent; cursor: pointer; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn svg { width: 17px; height: 17px; }
.btn.pri { background: var(--primary); color: #fff; }
.btn.pri:hover { background: var(--primary-600); }
.btn.sec { background: #fff; border-color: var(--field); color: var(--text); }
.btn.sec:hover { border-color: var(--s400); background: var(--s50); }
.btn.out { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn.out:hover { background: var(--primary-50); }
.btn.txt { background: transparent; color: var(--primary); padding: 0 10px; }
.btn.txt:hover { background: var(--primary-50); }
.btn.ghost { background: transparent; color: var(--s600); }
.btn.ghost:hover { background: var(--s100); }
.btn.ok { background: var(--green-600); color: #fff; }
.btn.ok:hover { background: var(--green-700); }
.btn.dng { background: #fff; border-color: #fecaca; color: var(--red-700); }
.btn.dng:hover { background: var(--red-50); }
.btn.faris { background: var(--faris); color: #fff; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13.5px; }
.btn.xs { height: 28px; padding: 0 9px; font-size: 13px; border-radius: var(--r-sm); }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.seg { display: inline-flex; background: var(--s100); border-radius: var(--r); padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0 16px; height: 37px; border-radius: 5px; cursor: pointer; color: var(--s600); font-size: 16px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.seg button.on { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.seg.sm button { height: 30px; font-size: 14px; padding: 0 12px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 14px; cursor: pointer; color: var(--s600); font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs button .n { font-size: 12px; background: var(--s100); color: var(--s600); padding: 0 7px; border-radius: 999px; }
.tabs button.on .n { background: var(--primary-50); color: var(--primary); }

.inp { height: 40px; border: 1px solid var(--field); border-radius: var(--r); padding: 0 12px; background: #fff; width: 100%; outline: none; font-size: 15px; transition: border-color .12s, box-shadow .12s; }
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51,110,255,.15); }
textarea.inp { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-inline-end: 34px; }
html[dir="rtl"] select.inp { background-position: left 12px center; }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--s400); width: 17px; height: 17px; }
.search .inp { padding-inline-start: 38px; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fld > label { font-size: 13.5px; font-weight: 600; color: var(--s700); }
.fld > label .req { color: var(--red); }
.fld .hint { font-size: 12.5px; color: var(--s500); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14.5px; }
.chk input { width: 17px; height: 17px; accent-color: var(--primary); }
.switch { position: relative; width: 40px; height: 22px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--s300); border-radius: 22px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; top: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }
html[dir="rtl"] .switch input:checked + span::before { transform: translateX(-18px); }

/* ---- surfaces ------------------------------------------------------------ */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card .ch { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card .ch h3 { margin: 0; font-size: 16px; font-weight: 600; }
.card .ch .sp { flex: 1; }
.card .cb { padding: 18px 20px; }
.card.hov { transition: box-shadow .15s, border-color .15s, transform .15s; cursor: pointer; }
.card.hov:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-200); transform: translateY(-1px); }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.gap8 { gap: 8px; } .gap16 { gap: 16px; } .gap20 { gap: 20px; } .gap24 { gap: 24px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; } .mb20 { margin-bottom: 20px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.g6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.g21 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.g12 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.muted { color: var(--s500); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.b { font-weight: 600; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
h2.sec { font-size: 17px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }

/* ---- chips ---------------------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r); font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--s100); color: var(--s700); }
.chip svg { width: 14px; height: 14px; }
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.sky { background: var(--sky-100); color: var(--sky-600); }
.chip.green { background: var(--green-100); color: var(--green-700); }
.chip.amber { background: var(--amber-100); color: var(--amber-700); }
.chip.red { background: var(--red-100); color: var(--red-700); }
.chip.violet { background: var(--violet-100); color: #6d28d9; }
.chip.blue { background: var(--primary-50); color: var(--primary); }
.chip.slate { background: var(--s100); color: var(--s600); }
.chip.out { background: #fff; border: 1px solid var(--border); color: var(--s600); }
.chip.lg { height: 30px; font-size: 14px; padding: 0 12px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; background: var(--s100); color: var(--s600); }

/* ---- table ---------------------------------------------------------------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.tbl th { text-align: start; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--s500); padding: 11px 14px; background: var(--s50); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--s100); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: #fafcff; }
.tbl tbody tr.sel { background: var(--primary-50); }
.tbl .num { text-align: end; font-variant-numeric: tabular-nums; }

/* ---- kpi tiles ------------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.kpi { padding: 16px 18px; border-inline-end: 1px solid var(--border); position: relative; }
.kpi:last-child { border-inline-end: 0; }
.kpi .l { font-size: 13.5px; color: var(--s600); }
.kpi .v { font-size: 28px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12.5px; color: var(--s500); }
.kpi .d.up { color: var(--green-600); } .kpi .d.dn { color: var(--red-700); }
.kpi.acc::before { content: ""; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--green); }
.kpi.acc.red::before { background: var(--red); } .kpi.acc.amber::before { background: var(--amber); } .kpi.acc.blue::before { background: var(--primary); }

/* ---- misc components -------------------------------------------------------- */
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.av.sm { width: 24px; height: 24px; font-size: 10.5px; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.avs { display: inline-flex; }
.avs .av { border: 2px solid #fff; margin-inline-start: -8px; }
.avs .av:first-child { margin-inline-start: 0; }
.prog { height: 8px; background: var(--s100); border-radius: 8px; overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 8px; background: var(--primary); transition: width .4s; }
.prog.sm { height: 6px; }
.empty { text-align: center; padding: 48px 20px; color: var(--s500); }
.empty svg { width: 40px; height: 40px; color: var(--s300); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: 14.5px; }
.kv dt { color: var(--s500); }
.kv dd { margin: 0; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--s100); }
.list .li:last-child { border-bottom: 0; }
.ico-tile { width: 38px; height: 38px; border-radius: var(--r-lg); display: grid; place-items: center; flex-shrink: 0; background: var(--primary-50); color: var(--primary); }
.ico-tile svg { width: 19px; height: 19px; }
.ico-tile.green { background: var(--green-100); color: var(--green-700); }
.ico-tile.amber { background: var(--amber-100); color: var(--amber-700); }
.ico-tile.red { background: var(--red-100); color: var(--red-700); }
.ico-tile.violet { background: var(--violet-100); color: #7c3aed; }
.ico-tile.sky { background: var(--sky-100); color: var(--sky-600); }
.ico-tile.slate { background: var(--s100); color: var(--s600); }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg); font-size: 14.5px; }
.banner.info { background: var(--sky-50); border: 1px solid #bae6fd; color: #075985; }
.banner.warn { background: var(--amber-50); border: 1px solid #fde68a; color: #92400e; }
.banner.ok { background: var(--green-50); border: 1px solid #bbf7d0; color: #166534; }
.banner.faris { background: linear-gradient(135deg, #f5f3ff, #eef3ff); border: 1px solid #ddd6fe; color: #4c1d95; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.dots { display: inline-flex; gap: 4px; }
.pill-n { min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; padding: 0 6px; }

/* ---- overlays --------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); z-index: 80; animation: fade .15s; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 560px; max-width: calc(100vw - 40px); max-height: calc(100vh - 60px); background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); z-index: 81; display: flex; flex-direction: column; animation: pop .18s; }
.modal.wide { width: 860px; }
.modal.xl { width: 1120px; }
.modal .mh { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal .mh h3 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.modal .mb { padding: 20px 22px; overflow: auto; }
.modal .mf { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--s50); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 520px; max-width: 100vw; background: #fff; z-index: 81; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .2s; }
html[dir="rtl"] .drawer { animation-name: slidein-r; }
.drawer.wide { width: 720px; }
.drawer .mh { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer .mh h3 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.drawer .mb { padding: 20px; overflow: auto; flex: 1; }
.drawer .mf { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
.x { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; cursor: pointer; color: var(--s500); border: 0; background: none; }
.x:hover { background: var(--s100); color: var(--text); }
.toasts { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 320px; max-width: 440px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; animation: toastin .22s; font-size: 14.5px; }
.toast .ti { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--green-100); color: var(--green-700); }
.toast.info .ti { background: var(--primary-50); color: var(--primary); }
.toast.warn .ti { background: var(--amber-100); color: var(--amber-700); }
.toast b { display: block; margin-bottom: 2px; }
.menu { position: fixed; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; z-index: 90; min-width: 220px; animation: pop .12s; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: var(--r); cursor: pointer; text-align: start; font-size: 14.5px; color: var(--text); }
.menu button:hover, .menu a:hover { background: var(--s100); }
.menu svg { width: 17px; height: 17px; color: var(--s500); }
.menu .sep { height: 1px; background: var(--border); margin: 5px 0; }
.menu .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--s500); padding: 8px 12px 4px; font-weight: 600; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.menu { animation-name: fade; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
@keyframes slidein-r { from { transform: translateX(-40px); opacity: 0; } }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.spin { animation: spin 1s linear infinite; }

/* ---- command palette -------------------------------------------------------- */
.cmdk { position: fixed; top: 12vh; left: 50%; transform: translateX(-50%); width: 680px; max-width: calc(100vw - 40px); background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); z-index: 91; overflow: hidden; animation: fade .12s; }
.cmdk .ci { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.cmdk .ci input { border: 0; outline: 0; height: 58px; flex: 1; font-size: 17px; background: none; }
.cmdk .cr { max-height: 420px; overflow: auto; padding: 8px; }
.cmdk .cg { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--s500); padding: 10px 12px 4px; font-weight: 600; }
.cmdk .it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-lg); cursor: pointer; }
.cmdk .it:hover, .cmdk .it.on { background: var(--primary-50); }
.cmdk .it .k { margin-inline-start: auto; font-size: 12px; color: var(--s500); }
mark { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---- Faris panel ------------------------------------------------------------ */
.faris { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 460px; background: #fff; border-inline-start: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 70; display: flex; flex-direction: column; animation: slidein .22s; }
html[dir="rtl"] .faris { animation-name: slidein-r; }
.faris .fh { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.faris .fh .lg { width: 38px; height: 38px; border-radius: 11px; background: var(--faris); display: grid; place-items: center; color: #fff; }
.faris .fh b { display: block; font-size: 16px; }
.faris .fh span { font-size: 12.5px; color: var(--s500); }
.faris .fb { flex: 1; overflow: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.faris .hero { text-align: center; padding: 20px 10px 6px; }
.faris .hero .orb { width: 64px; height: 64px; border-radius: 50%; background: var(--faris); display: grid; place-items: center; margin: 0 auto 14px; color: #fff; box-shadow: 0 10px 30px rgba(139, 92, 246, .35); }
.faris .hero h3 { margin: 0 0 6px; font-size: 21px; }
.faris .sugg { display: grid; gap: 8px; }
.faris .sugg button { text-align: start; border: 1px solid var(--border); background: #fff; border-radius: var(--r-lg); padding: 11px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.faris .sugg button:hover { border-color: #c4b5fd; background: #faf8ff; }
.faris .sugg button.hero-s { padding: 14px; }
.faris .sugg .fi { width: 32px; height: 32px; border-radius: 9px; background: var(--faris); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.msg { max-width: 92%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-end-end-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--s50); border: 1px solid var(--border); border-end-start-radius: 4px; }
.msg.ai .who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #7c3aed; margin-bottom: 6px; }
.msg ul { margin: 6px 0; padding-inline-start: 18px; }
.msg .card { margin-top: 10px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #a78bfa; animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.faris .ff { padding: 12px 14px 10px; border-top: 1px solid var(--border); }
.faris .ff .box { border: 2px solid var(--primary); border-radius: var(--r-lg); padding: 10px 12px; display: flex; align-items: flex-end; gap: 8px; }
.faris .ff textarea { border: 0; outline: 0; resize: none; flex: 1; min-height: 44px; max-height: 120px; font-size: 15px; background: none; }
.faris .ff .send { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; }
.faris .ff .note { text-align: center; font-size: 12px; color: var(--s500); margin-top: 8px; }

/* ---- repository tree ---------------------------------------------------------- */
.split { display: grid; grid-template-columns: 330px 1fr; height: calc(100vh - var(--header-height) - 72px); }
.tree { border-inline-end: 1px solid var(--border); background: #fff; overflow: auto; padding: 12px 8px; }
.tree .tn { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--r); cursor: pointer; font-size: 14.5px; user-select: none; }
.tree .tn:hover { background: var(--s50); }
.tree .tn.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.tree .tn .tw { width: 18px; height: 18px; display: grid; place-items: center; color: var(--s400); transition: transform .12s; }
.tree .tn .tw.open { transform: rotate(90deg); }
html[dir="rtl"] .tree .tn .tw { transform: scaleX(-1); }
html[dir="rtl"] .tree .tn .tw.open { transform: rotate(90deg); }
.tree .tn .lv { font-size: 10.5px; font-weight: 700; color: var(--s400); width: 22px; }
.tree .tn .ct { margin-inline-start: auto; font-size: 12px; color: var(--s500); }
.tree .tn svg.k { width: 16px; height: 16px; }
.tree .kids { padding-inline-start: 16px; }
.lvl-badge { display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; padding: 0 6px; height: 20px; border-radius: 4px; background: var(--s100); color: var(--s600); }

/* ---- process cards (as in Workflow Studio) ------------------------------------- */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.pcard { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.pcard:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-200); }
.pcard .pt { display: flex; gap: 12px; align-items: flex-start; }
.pcard .pt b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.pcard .meta { font-size: 13.5px; color: var(--s500); display: flex; align-items: center; gap: 6px; }
.pcard .meta svg { width: 14px; height: 14px; }
.pcard .ft { display: flex; align-items: flex-end; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }
.pcard .ft .vv { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ---- BPMN modeler ------------------------------------------------------------- */
.modeler { display: grid; grid-template-columns: 64px 1fr 340px; height: calc(100vh - var(--header-height) - 72px); }
.palette { background: #fff; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px; overflow: auto; }
.palette .pi { width: 46px; height: 46px; border-radius: var(--r-lg); display: grid; place-items: center; cursor: grab; color: var(--s600); position: relative; }
.palette .pi:hover { background: var(--primary-50); color: var(--primary); }
.palette .pi:active { cursor: grabbing; }
.palette .pi .tip { position: absolute; inset-inline-start: 52px; background: var(--s800); color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 5px; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 5; }
.palette .pi:hover .tip { opacity: 1; }
.palette .ps { width: 30px; height: 1px; background: var(--border); margin: 4px 0; }
.palette .pi.on { background: var(--primary); color: #fff; }
.canvas-wrap { position: relative; overflow: hidden; background: #fbfcff; background-image: radial-gradient(#d5dcea 1px, transparent 1px); background-size: 22px 22px; }
.canvas-wrap svg.cv { width: 100%; height: 100%; display: block; user-select: none; }
.canvas-tools { position: absolute; bottom: 16px; inset-inline-start: 16px; display: flex; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 5px; box-shadow: var(--shadow); }
.canvas-tools button { width: 34px; height: 34px; border: 0; background: none; border-radius: var(--r); display: grid; place-items: center; cursor: pointer; color: var(--s600); }
.canvas-tools button:hover { background: var(--s100); }
.canvas-tools .z { min-width: 54px; display: grid; place-items: center; font-size: 13.5px; font-weight: 600; }
.canvas-hint { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: var(--s800); color: #fff; font-size: 13px; padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow); pointer-events: none; }
.props { background: #fff; border-inline-start: 1px solid var(--border); overflow: auto; }
.props .pp { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.props .pp h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--s500); }
.raci { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.raci button { border: 1px solid var(--border); background: #fff; height: 34px; border-radius: var(--r); font-weight: 700; cursor: pointer; color: var(--s500); }
.raci button.on { color: #fff; border-color: transparent; }
.raci button.on.R { background: var(--primary); } .raci button.on.A { background: var(--violet); } .raci button.on.C { background: var(--amber); } .raci button.on.I { background: var(--s500); }
.rcell { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; font-weight: 700; font-size: 13px; color: #fff; }
.rcell.R { background: var(--primary); } .rcell.A { background: var(--violet); } .rcell.C { background: var(--amber); } .rcell.I { background: var(--s400); }

/* ---- kanban -------------------------------------------------------------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--s100); border-radius: var(--r-lg); padding: 10px; min-height: 420px; display: flex; flex-direction: column; gap: 10px; }
.kcol .kh { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-weight: 600; font-size: 14.5px; }
.kcol .kh .n { font-size: 12px; background: #fff; border-radius: 999px; padding: 0 8px; color: var(--s600); }
.kcol.drop { background: var(--primary-50); outline: 2px dashed var(--primary-200); }
.kcard { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px; cursor: grab; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; }
.kcard:hover { box-shadow: var(--shadow); border-color: var(--primary-200); }
.kcard.dragging { opacity: .5; }
.kcard .kt { font-weight: 600; font-size: 14.5px; line-height: 1.35; }

/* ---- heatmap / matrix ------------------------------------------------------------- */
.heat { display: grid; grid-template-columns: 34px repeat(5, 1fr); grid-template-rows: repeat(5, 1fr) 30px; gap: 5px; aspect-ratio: 1.15; }
.heat .hc { border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .12s, box-shadow .12s; color: #fff; position: relative; }
.heat .hc:hover { transform: scale(1.04); box-shadow: var(--shadow); z-index: 2; }
.heat .hc.sel { outline: 3px solid var(--s900); outline-offset: 1px; }
.heat .ax { display: grid; place-items: center; font-size: 12px; color: var(--s500); font-weight: 600; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--s100); border-inline-end: 1px solid var(--s100); padding: 0; }
.matrix th { background: var(--s50); font-weight: 600; font-size: 12.5px; color: var(--s600); padding: 10px; position: sticky; top: 0; z-index: 2; }
.matrix th.rot { height: 150px; vertical-align: bottom; padding: 8px 4px; width: 46px; }
.matrix th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.matrix td.rh { padding: 10px 12px; position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; min-width: 270px; }
.matrix td.cell { width: 46px; height: 42px; text-align: center; cursor: pointer; }
.matrix td.cell:hover { background: var(--primary-50); }
.mk { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }
.mk.full { background: var(--green-100); color: var(--green-700); }
.mk.part { background: var(--amber-100); color: var(--amber-700); }
.mk.gap { background: var(--red-100); color: var(--red-700); }

/* ---- diff / versions ----------------------------------------------------------------- */
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; font-size: 14.5px; }
.diff .dh { background: var(--s50); padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.diff .dc { padding: 14px; border-inline-end: 1px solid var(--border); line-height: 1.6; }
.diff .dc:last-child { border-inline-end: 0; }
del.d { background: var(--red-100); color: var(--red-700); text-decoration: line-through; padding: 0 3px; border-radius: 3px; }
ins.d { background: var(--green-100); color: var(--green-700); text-decoration: none; padding: 0 3px; border-radius: 3px; }
.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline .te { position: relative; padding-bottom: 18px; }
.timeline .te::before { content: ""; position: absolute; inset-inline-start: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.timeline .te.g::before { border-color: var(--green); background: var(--green); }
.timeline .te.a::before { border-color: var(--amber); }
.timeline .te.r::before { border-color: var(--red); }
.timeline .te .tt { font-weight: 600; font-size: 14.5px; }
.timeline .te .tm { font-size: 12.5px; color: var(--s500); margin-top: 2px; }

/* ---- comments --------------------------------------------------------------------- */
.thread { border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff; }
.thread .th { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--s50); border-radius: var(--r-lg) var(--r-lg) 0 0; font-size: 13.5px; }
.thread .cm { display: flex; gap: 10px; padding: 12px 14px; }
.thread .cm + .cm { border-top: 1px solid var(--s100); }
.thread .cm .ct { font-size: 14.5px; line-height: 1.5; }
.thread .cm .cw { font-size: 13px; color: var(--s500); margin-bottom: 3px; }

/* ---- workflow builder (as in the real canvas) ----------------------------------------- */
.wbuild { position: relative; height: calc(100vh - var(--header-height) - 72px); background: #fbfcff; background-image: radial-gradient(#cdd3df 1.1px, transparent 1.1px); background-size: 24px 24px; overflow: hidden; }
.wbuild svg.cv { width: 100%; height: 100%; display: block; }
.wnode { cursor: pointer; }
.wnode rect.card-r { fill: #fff; stroke: #c6cad5; stroke-width: 1.4; transition: stroke .2s; }
.wnode:hover rect.card-r { stroke: #336eff; }
.wnode.sel rect.card-r { stroke: #336eff; stroke-width: 2.4; }
.wnode.running rect.card-r { stroke: #0ea5e9; stroke-width: 2.6; }
.wnode.done rect.card-r { stroke: #059669; stroke-width: 2.4; }
.wnode.wait rect.card-r { stroke: #f59e0b; stroke-width: 2.6; }
.wlbl { font-size: 12px; fill: #1f2937; font-weight: 600; }
.wsub { font-size: 9.5px; fill: #8e94a3; font-weight: 500; }
.wedge { fill: none; stroke: #b8b9b9; stroke-width: 1.7; }
.wedge.done { stroke: #059669; stroke-width: 2.4; }
.wout { font-size: 9.5px; fill: #64748b; font-weight: 600; }
.wbuild .wfoot { position: absolute; bottom: 0; left: 0; right: 0; height: 48px; background: #fff; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 22px; padding: 0 20px; font-size: 14.5px; color: var(--s600); }
.wbuild .wfoot span.on { color: var(--primary); font-weight: 600; }
.wbuild .wzoom { position: absolute; bottom: 64px; inset-inline-end: 16px; display: flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 5px; box-shadow: var(--shadow); }
.wbuild .wzoom button { width: 34px; height: 34px; border: 0; background: none; border-radius: var(--r); cursor: pointer; display: grid; place-items: center; color: var(--s600); }
.wbuild .wzoom button:hover { background: var(--s100); }
.inspector { position: absolute; top: 0; bottom: 48px; inset-inline-end: 0; width: 380px; background: #fff; border-inline-start: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: auto; animation: slidein .18s; z-index: 4; }
.runlog { position: absolute; top: 0; bottom: 48px; inset-inline-end: 0; width: 380px; background: #fff; border-inline-start: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: auto; z-index: 4; }

/* ---- phone ---------------------------------------------------------------------------- */
.phone { width: 340px; height: 690px; border-radius: 46px; background: #0f172a; padding: 12px; box-shadow: var(--shadow-lg), inset 0 0 0 2px #334155; position: relative; flex-shrink: 0; }
.phone .scr { width: 100%; height: 100%; border-radius: 36px; background: var(--page); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone .notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 110px; height: 26px; background: #0f172a; border-radius: 0 0 16px 16px; z-index: 5; }
.phone .ptop { background: #336eff; color: #fff; padding: 40px 16px 14px; }
.phone .pbody { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.phone .pnav { display: flex; justify-content: space-around; padding: 10px 0 18px; background: #fff; border-top: 1px solid var(--border); }
.phone .pnav span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--s500); }
.phone .pnav span.on { color: var(--primary); }

/* ---- portal (reader view) ---------------------------------------------------------------- */
.portal-hero { background: linear-gradient(120deg, #1e3a8a 0%, #336eff 60%, #0ea5e9 100%); color: #fff; padding: 40px 48px; position: relative; overflow: hidden; }
.portal-hero::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); inset-inline-end: -120px; top: -220px; }
.portal-hero h1 { margin: 0 0 8px; font-size: 30px; }
.portal-hero .search { max-width: 640px; margin-top: 20px; }
.portal-hero .search .inp { height: 50px; font-size: 16px; border: 0; border-radius: var(--r-lg); }

/* ---- utilities for charts ---------------------------------------------------------------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--s600); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: 220px 1fr 60px; gap: 14px; align-items: center; padding: 7px 0; font-size: 14px; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--s100); }
.stack i { display: block; height: 100%; }
.ring-lbl { font-size: 26px; font-weight: 700; }
.steps { display: flex; gap: 0; margin-bottom: 24px; }
.steps .st { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--s500); }
.steps .st .sn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--s300); font-weight: 700; font-size: 13.5px; background: #fff; flex-shrink: 0; }
.steps .st.on { color: var(--text); font-weight: 600; }
.steps .st.on .sn { border-color: var(--primary); color: var(--primary); }
.steps .st.done .sn { background: var(--primary); border-color: var(--primary); color: #fff; }
.steps .st .ln { flex: 1; height: 2px; background: var(--s200); margin: 0 10px; }
.steps .st.done .ln { background: var(--primary); }
.drop-zone { border: 2px dashed var(--s300); border-radius: var(--r-xl); padding: 40px; text-align: center; background: #fff; cursor: pointer; transition: .15s; }
.drop-zone:hover, .drop-zone.over { border-color: var(--primary); background: var(--primary-50); }
.skel { background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 50%, #eef2f7 100%); background-size: 800px 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
.ocr-doc { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 30px 34px; position: relative; font-family: "Cairo", var(--font); line-height: 1.9; }
.ocr-hl { background: rgba(51,110,255,.12); outline: 1.5px solid rgba(51,110,255,.55); border-radius: 3px; padding: 0 2px; cursor: pointer; }
.ocr-hl.lo { background: rgba(245,158,11,.14); outline-color: rgba(245,158,11,.7); }
.sig { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 28px; color: #1e3a8a; }
.badge-new { font-size: 10px; font-weight: 700; background: var(--violet); color: #fff; padding: 1px 6px; border-radius: 4px; margin-inline-start: 6px; letter-spacing: .3px; }
@media (max-width: 1400px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g6 { grid-template-columns: repeat(3, 1fr); } }
