:root {
  color-scheme: light;
  --erp-navy: #172554;
  --erp-primary: #2563eb;
  --erp-primary-hover: #1d4ed8;
  --erp-primary-soft: #eff6ff;
  --erp-ink: #111827;
  --erp-text: #334155;
  --erp-muted: #64748b;
  --erp-subtle: #94a3b8;
  --erp-line: #e2e8f0;
  --erp-line-soft: #edf2f7;
  --erp-canvas: #f3f4f6;
  --erp-surface: #fff;
  --erp-success: #059669;
  --erp-warning: #d97706;
  --erp-danger: #dc2626;
  --erp-sidebar: 176px;
  --erp-radius: 14px;
  --erp-shadow: 0 8px 30px rgba(15, 23, 42, .055);
  --crm-accent: #d89a00;
  --crm-accent-soft: #fff6cf;
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: clip; direction: rtl; background: var(--erp-canvas); }
body { min-height: 100vh; margin: 0; overflow-x: clip; direction: rtl; color: var(--erp-text); background: var(--erp-canvas); font-family: Vazirmatn, Tahoma, sans-serif; font-size: 14px; text-align: start; -webkit-font-smoothing: antialiased; }
a { color: var(--erp-primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; text-align: start; }
input:not([type="email"]):not([type="tel"]):not([type="password"]), select, textarea { direction: rtl; }
input[type="email"], input[type="tel"], input[type="password"] { direction: ltr; }
img, svg, video, canvas { max-width: 100%; }
button { cursor: pointer; }
bdi, .ltr { direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .2); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-to-content { position: fixed; z-index: 20000; inset-block-start: 8px; inset-inline-start: 50%; padding: 9px 14px; border-radius: 9px; color: #fff; background: #111827; transform: translate(-50%, -150%); }
.skip-to-content:focus { transform: translate(-50%, 0); }

/* ERP shell */
.erp-shell { display: flex; width: 100%; max-width: 100vw; min-height: 100vh; direction: rtl; }
.erp-sidebar { position: fixed; z-index: 1060; inset-block: 0; inset-inline-start: 0; display: flex; width: var(--erp-sidebar); flex-direction: column; border-inline-end: 1px solid #e3e6eb; color: #596172; background: #fff; box-shadow: -5px 0 22px rgba(34, 40, 52, .07); }
.erp-workspace { display: flex; width: auto; min-width: 0; min-height: 100vh; margin-inline-start: var(--erp-sidebar); flex: 1 1 auto; flex-direction: column; }
.module-rail__brand { display: flex; min-height: 60px; align-items: center; justify-content: center; gap: 9px; border-bottom: 1px solid #eceef2; color: #fff; background: #3f4554; }
.module-rail__brand > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: #343944; background: linear-gradient(135deg, #ffd43d, #f2a000); box-shadow: 0 7px 18px rgba(242, 160, 0, .24); font-size: 1rem; }
.module-rail__brand small { color: #e4e7ed; font-size: .6rem; font-weight: 900; letter-spacing: .12em; }
.module-rail__nav { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; gap: 4px; padding: 9px 7px; overflow-y: auto; }
.module-rail__item { position: relative; display: flex; min-height: 46px; align-items: center; gap: 9px; padding: 7px 11px; border: 1px solid transparent; border-radius: 11px; color: #727a89; font-size: .72rem; font-weight: 800; white-space: nowrap; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.module-rail__item span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.module-rail__item > i { width: 21px; flex: 0 0 21px; color: #9299a6; font-size: 1rem; text-align: center; }
.module-rail__item:hover { color: #353b46; border-color: #e8eaf0; background: #f7f8fa; }
.module-rail__item:hover > i { color: var(--crm-accent); }
.module-rail__item.is-current::after { position: absolute; inset-block: 8px; inset-inline-start: -7px; width: 3px; border-radius: 0 4px 4px 0; background: #f1ad00; content: ""; }
.module-rail__item.is-current { color: #644a00; border-color: #f4df8b; background: #fff8d9; }
.module-rail__item.is-current > i { color: #d58f00; }
.module-rail__footer { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 8px; border-top: 1px solid #eceef2; background: #fafbfc; }
.module-rail__avatar { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid #e0c451; border-radius: 12px; color: #343944; background: #ffd13a; font-size: .72rem; font-weight: 900; }
.module-rail__utility { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: #7e8694; background: #f0f2f5; }
.module-rail__utility:hover { color: #b77900; background: #fff3c6; }
.erp-sidebar-backdrop { position: fixed; z-index: 1050; inset: 0; visibility: hidden; background: rgba(30, 37, 50, .38); opacity: 0; backdrop-filter: blur(1.5px); transition: opacity .2s ease, visibility .2s ease; }

/* Header */
.erp-topbar { position: sticky; z-index: 3000; top: 0; display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 25px; color: #fff; background: #3f4554; box-shadow: 0 5px 20px rgba(47, 52, 64, .13); }
.erp-topbar__start, .erp-topbar__actions { display: flex; align-items: center; gap: 10px; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(255, 255, 255, .18); border-radius: 11px; color: #fff; background: rgba(255, 255, 255, .08); font-size: 1.05rem; }
.icon-button span { display: none; }
.sidebar-toggle { display: none; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.organization-switcher, .account-dropdown { position: relative; }
.workspace-context { display: flex; flex-direction: column; }
.workspace-context__trigger { min-width: 150px; padding: 5px 8px; border-radius: 9px; cursor: pointer; }
.workspace-context__trigger:hover, details[open] > .workspace-context__trigger { background: rgba(255, 255, 255, .08); }
.workspace-context span { color: #fff; font-size: .59rem; opacity: .62; }
.workspace-context strong { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: #fff; font-size: .75rem; font-weight: 850; }
.workspace-context strong i { font-size: .55rem; }
.organization-menu, .account-menu { position: absolute; z-index: 3100; inset-block-start: calc(100% + 10px); inset-inline-start: 0; min-width: 260px; padding: 7px; border: 1px solid var(--erp-line); border-radius: 13px; color: var(--erp-text); background: #fff; box-shadow: 0 18px 45px rgba(15, 23, 42, .18); }
.organization-menu__head, .account-menu__head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--erp-line-soft); }
.organization-menu__head small, .account-menu__head bdi { color: var(--erp-ink); font-size: .7rem; font-weight: 850; }
.organization-menu__head span, .account-menu__head small { color: var(--erp-subtle); font-size: .58rem; }
.organization-menu form, .account-menu form { margin: 0; }
.dropdown-item { display: flex; width: 100%; align-items: center; gap: 9px; margin-top: 3px; padding: 9px 10px; border: 0; border-radius: 8px; color: var(--erp-text); background: transparent; font-size: .69rem; text-align: right; }
.dropdown-item:hover, .dropdown-item.is-active { color: var(--erp-primary); background: var(--erp-primary-soft); }
.dropdown-item > span { flex: 1; }
.dropdown-item.is-danger { color: #b91c1c; }
.organization-menu__check { color: #16a34a; }
.dropdown-empty { display: block; padding: 12px 10px; color: var(--erp-subtle); font-size: .63rem; }
.product-space-switcher { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 11px; background: rgba(255, 255, 255, .06); }
.product-space-switcher a { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: #dfe3ea; font-size: .62rem; font-weight: 800; }
.product-space-switcher a:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.product-space-switcher a.is-active { color: #343944; background: #fff; }
.topbar-live { display: inline-flex; min-width: 73px; justify-content: center; direction: ltr; color: #cfd3dc; font-size: .62rem; font-variant-numeric: tabular-nums; }
.topbar-capability { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 9px; color: #fff3b8; background: rgba(255, 209, 58, .12); font-size: .6rem; }
.topbar-divider { width: 1px; height: 28px; background: rgba(255, 255, 255, .17); }
.account-trigger { display: flex; min-width: 180px; align-items: center; gap: 9px; padding: 4px 7px; border-radius: 11px; cursor: pointer; }
.account-trigger:hover, details[open] > .account-trigger { background: rgba(255, 255, 255, .08); }
.account-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; color: #343944; background: linear-gradient(135deg, #ffd22f, #f3a300); font-size: .8rem; font-weight: 900; }
.account-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.account-copy strong, .account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { color: #fff; font-size: .68rem; font-weight: 850; }
.account-copy small { margin-top: 2px; color: #c9cdd6; font-size: .56rem; }
.account-trigger > i { color: #c9cdd6; font-size: .65rem; }
.account-menu { inset-inline-start: auto; inset-inline-end: 0; min-width: 220px; }

/* Module context */
.module-context-bar { --module-accent: #d89a00; --module-soft: #fff6cf; position: sticky; z-index: 2000; top: 64px; display: flex; min-height: 58px; align-items: stretch; gap: 14px; padding: 0 24px; border-bottom: 1px solid #e1e4e9; color: #4b5360; background: #fff; box-shadow: 0 4px 14px rgba(37, 44, 57, .055); }
.module-context-bar__module { position: relative; display: flex; min-width: 205px; align-items: center; gap: 10px; padding-inline-end: 15px; border-inline-end: 1px solid #eceef2; }
.module-context-bar__module::before { position: absolute; inset-block: 0; inset-inline-end: -1px; width: 3px; background: var(--module-accent); content: ""; }
.module-context-bar__module > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--module-accent); background: var(--module-soft); }
.module-context-bar__module > div { display: flex; min-width: 0; flex-direction: column; }
.module-context-bar__module small { color: var(--module-accent); font-size: .49rem; font-weight: 850; }
.module-context-bar__module strong { margin-top: 3px; color: #39414e; font-size: .7rem; font-weight: 900; }
.module-context-bar__links { display: flex; min-width: 0; flex: 1; align-items: stretch; gap: 3px; overflow-x: auto; }
.module-context-bar__links a { position: relative; display: inline-flex; min-width: max-content; align-items: center; gap: 7px; padding: 0 10px; color: #687180; font-size: .59rem; font-weight: 750; }
.module-context-bar__links a:hover { color: #3f4652; background: #fafbfc; }
.module-context-bar__links a.is-current { color: var(--module-accent); background: var(--module-soft); font-weight: 900; }
.module-context-bar__links a.is-current::after { position: absolute; inset-inline: 10px; inset-block-end: -3px; height: 3px; border-radius: 3px 3px 0 0; background: var(--module-accent); content: ""; }
.module-context-bar__back { display: inline-flex; min-width: max-content; align-items: center; gap: 6px; align-self: center; margin-inline-start: auto; padding: 7px 11px; border: 1px solid #e3e6eb; border-radius: 8px; color: #596476; background: #fff; font-size: .58rem; font-weight: 850; }

/* ERP-style grouped navigation for CRM operations and settings */
.crm-context-menu { position:relative; display:flex; min-width:max-content; align-items:stretch; }
.crm-context-menu>summary { position:relative; display:flex; min-width:max-content; align-items:center; gap:7px; padding:0 11px; color:#687180; font-size:.59rem; font-weight:750; cursor:pointer; }
.crm-context-menu>summary>i:last-child { margin-inline-start:2px; font-size:.52rem; transition:transform .16s ease; }
.crm-context-menu[open]>summary>i:last-child { transform:rotate(180deg); }
.crm-context-menu>summary:hover,.crm-context-menu[open]>summary { color:#3f4652; background:#fafbfc; }
.crm-context-menu.is-current>summary { color:var(--module-accent); background:var(--module-soft); font-weight:900; }
.crm-context-menu.is-current>summary::after { position:absolute; inset-inline:10px; inset-block-end:-3px; height:3px; border-radius:3px 3px 0 0; background:var(--module-accent); content:""; }
.crm-context-menu__panel { position:fixed; z-index:3300; top:128px; right:max(205px,calc(var(--erp-sidebar) + 18px)); width:min(720px,calc(100vw - var(--erp-sidebar) - 45px)); overflow:hidden; border:1px solid #dfe5ec; border-radius:15px; background:#fff; box-shadow:0 22px 55px rgba(21,38,63,.18); }
.crm-context-menu__panel--compact { width:min(420px,calc(100vw - var(--erp-sidebar) - 45px)); }
.crm-context-menu__panel--compact .crm-context-menu__grid { grid-template-columns:1fr; }
.crm-context-menu__panel--wide { width:min(980px,calc(100vw - var(--erp-sidebar) - 45px)); }
.crm-context-menu__panel>header { display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid #e8edf2; background:#f8fafc; }
.crm-context-menu__panel>header>span { display:grid; width:38px; height:38px; flex:0 0 38px; place-items:center; border-radius:10px; color:#b77900; background:#fff1bd; font-size:1rem; }
.crm-context-menu__panel>header>div { display:grid; min-width:0; gap:2px; }
.crm-context-menu__panel>header strong { color:var(--erp-ink); font-size:.84rem; }
.crm-context-menu__panel>header small { color:var(--erp-muted); font-size:.7rem; }
.crm-context-menu__panel>header>a { display:flex; align-items:center; gap:5px; margin-inline-start:auto; color:#2563a6; font-size:.72rem; font-weight:850; }
.crm-context-menu__grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; padding:10px; }
.crm-context-menu__grid--three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.crm-context-menu__grid>section { min-width:0; padding:6px 9px 10px; }
.crm-context-menu__grid>section+section { border-inline-start:1px solid #edf1f5; }
.crm-context-menu__grid h3 { margin:0 3px 7px; color:#8b680e; font-size:.7rem; }
.crm-context-menu__grid a { display:grid; min-width:0; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:9px; padding:8px; border-radius:9px; color:inherit; }
.crm-context-menu__grid a:hover { color:#1f5f9c; background:#f3f7fb; }
.crm-context-menu__grid a>i { display:grid; width:34px; height:34px; place-items:center; border-radius:9px; color:#52789e; background:#edf3f8; font-size:.9rem; }
.crm-context-menu__grid a>span { display:grid; min-width:0; gap:2px; }
.crm-context-menu__grid b { overflow:hidden; color:#2e3947; font-size:.75rem; text-overflow:ellipsis; white-space:nowrap; }
.crm-context-menu__grid small { overflow:hidden; color:#7b8998; font-size:.66rem; text-overflow:ellipsis; white-space:nowrap; }
@media(max-width:1050px){.crm-context-menu__panel{right:14px;width:calc(100vw - 28px)}.crm-context-menu__grid--three{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.crm-context-menu__panel{top:120px;max-height:calc(100vh - 135px);overflow:auto}.crm-context-menu__grid,.crm-context-menu__grid--three{grid-template-columns:1fr}.crm-context-menu__grid>section+section{border-inline-start:0;border-top:1px solid #edf1f5}.crm-context-menu__panel>header small{display:none}}

/* Content */
.erp-main { flex: 1; padding: 24px 26px 32px; }
.content-wrap { width: 100%; max-width: 1500px; min-width: 0; margin-inline: auto; }
.content-wrap > * { max-width: 100%; }
.erp-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 28px; border-top: 1px solid #e5e7eb; color: var(--erp-subtle); background: #fff; font-size: .61rem; }
.erp-footer span { display: flex; align-items: center; gap: 6px; color: var(--erp-muted); font-weight: 750; }
.erp-footer i { color: var(--erp-success); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.page-head h1 { margin: 0; color: var(--erp-ink); font-size: clamp(1.18rem, 2vw, 1.5rem); font-weight: 950; letter-spacing: -.025em; }
.page-head p { margin: 5px 0 0; color: var(--erp-muted); font-size: .71rem; line-height: 1.8; }
.page-head small { display: block; margin-bottom: 3px; color: var(--crm-accent); font-size: .59rem; font-weight: 850; }
.page-actions { display: flex; gap: 8px; }
.page-actions a, .primary, .page-head > a { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border: 1px solid var(--erp-line); border-radius: 10px; color: var(--erp-text); background: #fff; font-size: .68rem; font-weight: 800; }
.primary, .page-head > a.primary { border-color: #f0a000; color: #302f2b; background: #ffc62e; box-shadow: 0 5px 14px rgba(240, 160, 0, .17); }
.primary:hover, .page-head > a.primary:hover { border-color: #e2a300; background: #f2b914; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metrics article { position: relative; display: grid; gap: 8px; min-height: 112px; padding: 17px; overflow: hidden; border: 1px solid var(--erp-line); border-radius: var(--erp-radius); background: #fff; box-shadow: var(--erp-shadow); }
.metrics article::before { position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; background: #f0b21f; content: ""; }
.metrics span { color: var(--erp-muted); font-size: .66rem; }
.metrics b { color: var(--erp-ink); font-size: 1.25rem; font-weight: 900; }
.metrics small { color: var(--erp-subtle); font-size: .58rem; }
.metrics .metric-alert::before { background: var(--erp-danger); }
.metric-alert b { color: var(--erp-danger); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { padding: 18px; border: 1px solid var(--erp-line); border-radius: var(--erp-radius); background: #fff; box-shadow: var(--erp-shadow); }
.panel-wide { grid-column: 1 / -1; }
.panel > header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--erp-line-soft); }
.panel h2 { margin: 0; color: var(--erp-ink); font-size: .82rem; font-weight: 900; }
.panel > header a { color: var(--erp-primary); font-size: .62rem; font-weight: 750; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 3px; border-bottom: 1px solid var(--erp-line-soft); }
.row:last-child { border: 0; }
.row div { display: grid; gap: 5px; }
.row b { color: var(--erp-ink); font-size: .7rem; }
.row small, .empty { color: var(--erp-muted); font-size: .64rem; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #08715f; background: #e4f5f0; font-size: .59rem; font-weight: 750; }
.search { display: flex; width: min(100%, 620px); gap: 8px; margin-bottom: 14px; }
.search input { flex: 1; }
.search input, .search button, .form-control, .form-panel input, .form-panel select, .form-panel textarea { min-height: 42px; padding: 8px 12px; border: 1px solid #cbd8e3; border-radius: 9px; color: var(--erp-text); background: #fff; font: inherit; }
.search input:focus, .form-panel input:focus, .form-panel select:focus, .form-panel textarea:focus { border-color: #93b4df; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); outline: 0; }
.search button { min-width: 92px; border: 1px solid #d79a00; color: #39352c; background: #ffc62e; font-weight: 800; }
.table-panel { overflow: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: right; border-bottom: 1px solid #e8eef4; }
th { color: #62778a; background: #f8fafc; font-size: .63rem; font-weight: 850; }
td { color: #3e4b5b; font-size: .68rem; }
tbody tr:hover { background: #fffdf5; }
.form-panel { width: min(100%, 960px); }
.form-panel form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-panel p { display: grid; gap: 6px; margin: 0; }
.form-panel p:has(textarea), .form-actions { grid-column: 1 / -1; }
.form-panel label { color: var(--erp-text); font-size: .64rem; font-weight: 850; }
.form-panel textarea { min-height: 110px; resize: vertical; }
.form-panel ul.errorlist { list-style: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--erp-line-soft); }
.form-actions a, .form-actions button { min-height: 40px; padding: 8px 18px; border: 1px solid var(--erp-line); border-radius: 10px; color: var(--erp-text); background: #fff; font-size: .68rem; font-weight: 800; }
.form-actions button.primary { border-color: #f0a000; background: #ffc62e; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.customer-card { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--erp-line); border-radius: var(--erp-radius); background: #fff; box-shadow: var(--erp-shadow); }
.customer-avatar { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 14px; color: #8a6100; background: #fff4c8; font-size: 1rem; font-weight: 900; }
.customer-card h2 { margin: 0 0 5px; color: var(--erp-ink); font-size: .75rem; }
.customer-card p, .customer-card small { margin: 0; color: var(--erp-muted); font-size: .62rem; }
.system-message-stack { position: fixed; z-index: 5000; inset-block-start: 76px; inset-inline-end: 24px; display: grid; width: min(390px, calc(100vw - 32px)); gap: 8px; }
.system-message { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid #9edaca; border-radius: 12px; color: #176b58; background: #e9f8f3; box-shadow: var(--erp-shadow); font-size: .68rem; }

/* Navigation feedback */
.erp-navigation-loader { position: fixed; z-index: 25000; inset: 0; pointer-events: none; }
.erp-navigation-loader__bar { position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; overflow: hidden; background: rgba(255, 255, 255, .25); }
.erp-navigation-loader__bar span { display: block; width: 72%; height: 100%; background: linear-gradient(90deg, #f0a000, #ffd84a); transform: translateX(140%); animation: navigation-progress 1s ease-in-out infinite; }
.erp-navigation-loader__status { position: absolute; inset-block-start: 78px; inset-inline-end: 22px; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid #e5e7eb; border-radius: 12px; color: #3f4554; background: rgba(255, 255, 255, .96); box-shadow: 0 14px 38px rgba(30, 37, 50, .16); }
.erp-navigation-loader__status > span:last-child { display: flex; flex-direction: column; }
.erp-navigation-loader__status strong { font-size: .65rem; }
.erp-navigation-loader__status small { color: var(--erp-subtle); font-size: .52rem; }
.erp-navigation-loader__spinner { display: flex; gap: 3px; }
.erp-navigation-loader__spinner i { width: 5px; height: 5px; border-radius: 50%; background: #e6a400; animation: loader-dot .8s ease-in-out infinite alternate; }
.erp-navigation-loader__spinner i:nth-child(2) { animation-delay: .14s; }
.erp-navigation-loader__spinner i:nth-child(3) { animation-delay: .28s; }
@keyframes navigation-progress { from { transform: translateX(140%); } to { transform: translateX(-140%); } }
@keyframes loader-dot { to { opacity: .25; transform: translateY(-3px); } }

/* Login */
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 28px; background: #f3f4f6; }
.auth-shell { display: grid; width: min(980px, 100%); min-height: 570px; grid-template-columns: 1.05fr .95fr; overflow: hidden; border: 1px solid #e0e3e8; border-radius: 22px; background: #fff; box-shadow: 0 24px 80px rgba(47, 52, 64, .14); }
.auth-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 42px; overflow: hidden; color: #fff; background: #3f4554; }
.auth-visual::before, .auth-visual::after { position: absolute; border-radius: 50%; background: rgba(255, 204, 37, .1); content: ""; }
.auth-visual::before { width: 360px; height: 360px; inset: -150px -130px auto auto; }
.auth-visual::after { width: 250px; height: 250px; inset: auto auto -120px -80px; }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; color: #343944; background: linear-gradient(135deg, #ffd43d, #f2a000); font-size: 1.15rem; }
.auth-brand strong { display: block; font-size: 1rem; }
.auth-brand small { color: #d4d7de; font-size: .62rem; }
.auth-visual__copy { position: relative; z-index: 1; }
.auth-visual__copy h2 { margin: 0; font-size: 1.65rem; font-weight: 950; }
.auth-visual__copy p { max-width: 430px; margin: 10px 0 0; color: #d5d8df; font-size: .75rem; line-height: 2; }
.auth-features { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-features span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 9px; color: #ebedf1; background: rgba(255, 255, 255, .06); font-size: .59rem; }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.auth-card__eyebrow { color: var(--crm-accent); font-size: .6rem; font-weight: 900; }
.auth-card h1 { margin: 5px 0 7px; color: var(--erp-ink); font-size: 1.45rem; }
.auth-card > p { margin: 0 0 22px; color: var(--erp-muted); font-size: .68rem; }
.auth-card form p { display: grid; gap: 7px; margin: 0 0 13px; }
.auth-card label { color: var(--erp-text); font-size: .63rem; font-weight: 850; }
.auth-card input { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #cbd8e3; border-radius: 10px; font: inherit; }
.auth-card button { width: 100%; min-height: 46px; border: 1px solid #f0a000; border-radius: 10px; color: #302f2b; background: #ffc62e; font-weight: 900; }
.auth-card .errorlist { list-style: none; }
.auth-form-error { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid #f1c8c8; border-radius: 9px; color: #803737; background: #fff7f7; }
.auth-form-error > i { margin-top: 2px; color: #ba5151; }
.auth-form-error > div { display: grid; gap: 2px; }
.auth-form-error strong { font-size: .67rem; }
.auth-form-error span { color: #945757; font-size: .57rem; }
.sso-separator { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--erp-subtle); font-size: .57rem; }
.sso-separator::before, .sso-separator::after { height: 1px; flex: 1; background: var(--erp-line); content: ""; }
.sso-link { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; border: 1px solid #d7dce4; border-radius: 10px; color: #485160; background: #fff; font-size: .67rem; font-weight: 850; }
.sso-link:hover { border-color: #efcc56; color: #765700; background: #fffaf0; }
.auth-register-link { display: block; margin-top: 14px; color: #315f9b; font-size: .65rem; font-weight: 800; text-align: center; }
.topbar-login { min-width: 72px; min-height: 34px; color: #fff; background: rgba(255,255,255,.08); }
.table-link { color: #235da8; font-weight: 850; }
.row-link { color: inherit; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.conversation { display: grid; gap: 12px; }
.message-bubble { width: min(86%, 760px); padding: 14px 16px; border: 1px solid #dbe4ee; border-radius: 14px; background: #f8fafc; }
.message-bubble header { display: flex; gap: 8px; align-items: center; padding: 0 0 8px; border: 0; }
.message-bubble header time { margin-inline-start: auto; color: var(--erp-subtle); font-size: .55rem; }
.message-bubble header span { color: #8a5a00; font-size: .55rem; }
.message-bubble p { margin: 0; color: var(--erp-text); font-size: .68rem; line-height: 2; }
.message-customer { margin-inline-start: auto; border-color: #badbea; background: #eef8fc; }
.message-public { margin-inline-end: auto; border-color: #bde4d7; background: #f0fbf7; }
.message-private { margin-inline-end: auto; border-color: #efd58c; background: #fff9e9; }
.attachment-link { display: inline-flex; gap: 5px; margin-top: 9px; color: #235da8; font-size: .6rem; font-weight: 800; }
.reply-box { display: grid; gap: 10px; margin-top: 8px; padding-top: 15px; border-top: 1px solid var(--erp-line); }
.reply-box p, .compact-form p, .policy-panel p { display: grid; gap: 6px; margin: 0 0 10px; }
.ticket-side { position: sticky; top: 140px; }
.ticket-side h2 { margin: 0 0 14px; }
.ticket-side dl { display: grid; grid-template-columns: 90px 1fr; gap: 9px; margin: 0 0 18px; font-size: .62rem; }
.ticket-side dt { color: var(--erp-muted); }
.ticket-side dd { margin: 0; color: var(--erp-ink); font-weight: 750; }
.compact-form { padding-top: 15px; border-top: 1px solid var(--erp-line-soft); }
.rating-form ul { display: flex; gap: 5px; padding: 0; list-style: none; }
.rating-form label { display: flex; gap: 4px; align-items: center; font-size: .58rem; }
.policy-panel { width: min(100%, 1080px); }
.policy-panel form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 22px; }
.policy-panel ul { margin: 4px 0 0; padding: 0; list-style: none; }
.policy-panel ul label { display: flex; gap: 7px; align-items: center; min-height: 34px; }
.secure-link { display: grid; gap: 7px; margin-bottom: 16px; padding: 15px; border: 1px solid #a9d9ca; border-radius: 12px; background: #effaf6; }
.secure-link code { padding: 8px; overflow-wrap: anywhere; direction: ltr; text-align: left; border-radius: 7px; background: #fff; }
.secure-link small { color: var(--erp-muted); }
.access-request { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--erp-line-soft); }
.access-request > div { display: grid; gap: 4px; }
.access-request small { color: var(--erp-muted); font-size: .58rem; }
.access-request form { display: flex; gap: 6px; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 16px; }

/* No-code forms and workflow */
.row-actions{display:flex!important;align-items:center;gap:8px}.row-actions form{margin:0}.row-actions a,.row-actions button{min-height:32px;padding:6px 10px;border:1px solid var(--erp-line);border-radius:8px;color:#235da8;background:#fff;font:inherit;font-size:.6rem;font-weight:800;cursor:pointer}
.workflow-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 18px;padding:0;border:1px solid var(--erp-line);border-radius:var(--erp-radius);overflow:hidden;background:#fff;box-shadow:var(--erp-shadow);list-style:none}.workflow-overview li{position:relative;display:flex;align-items:center;gap:12px;padding:18px 20px}.workflow-overview li+li{border-inline-start:1px solid var(--erp-line-soft)}.workflow-overview li+li::before{position:absolute;inset-inline-start:-11px;display:grid;width:21px;height:21px;place-items:center;border:1px solid var(--erp-line);border-radius:50%;color:#7890a9;background:#fff;content:"←";font-size:.62rem}.workflow-overview li>span{display:grid;width:34px;height:34px;flex:0 0 34px;place-items:center;border-radius:10px;color:#176b58;background:#e5f6f0;font-size:.72rem;font-weight:900}.workflow-overview li>div{display:grid;gap:4px}.workflow-overview b{color:var(--erp-ink);font-size:.7rem}.workflow-overview small{color:var(--erp-muted);font-size:.58rem;line-height:1.8}
.builder-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px;align-items:start}.builder-side{position:sticky;top:146px}.field-stack{display:grid;gap:9px;padding-top:14px}.field-preview{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:10px;padding:13px;border:1px solid #dce5ee;border-radius:11px;background:#fbfdff}.field-handle{color:#9aa8b8}.field-preview>div{display:grid;gap:3px}.field-preview b{color:var(--erp-ink);font-size:.68rem}.field-preview b em{margin-inline-start:4px;color:#dc2626;font-style:normal}.field-preview small,.field-preview p{margin:0;color:var(--erp-muted);font-size:.57rem}.builder-empty{display:grid;min-height:180px;place-items:center;align-content:center;gap:7px;padding:22px;color:var(--erp-muted);text-align:center}.builder-empty i{font-size:1.5rem;color:#7aa6dc}.builder-empty b{color:var(--erp-ink);font-size:.72rem}.builder-empty span{font-size:.6rem}
.process-map{display:flex;min-height:180px;align-items:stretch;gap:12px;margin-bottom:16px;padding:16px;overflow-x:auto;border:1px solid var(--erp-line);border-radius:var(--erp-radius);background:linear-gradient(90deg,#f8fafc 1px,transparent 1px),linear-gradient(#f8fafc 1px,transparent 1px),#fff;background-size:22px 22px;box-shadow:var(--erp-shadow)}.process-stage{position:relative;min-width:245px;padding:14px;border:1px solid #cddaea;border-radius:12px;background:#fff;box-shadow:0 6px 18px rgba(15,23,42,.06)}.process-stage:not(:last-child)::after{position:absolute;top:28px;inset-inline-start:-13px;color:#7d93ad;content:"←"}.process-stage.is-initial{border-color:#76c7b4}.process-stage.is-final{border-color:#d5aa43}.process-stage__head{display:flex;align-items:center;gap:9px}.process-stage__head>span{display:grid;width:29px;height:29px;place-items:center;border-radius:9px;color:#1b5c4f;background:#e4f5f0;font-size:.65rem;font-weight:900}.process-stage__head>div{display:grid;gap:3px}.process-stage__head b{color:var(--erp-ink);font-size:.68rem}.process-stage__head small,.process-stage p,.transition-list{color:var(--erp-muted);font-size:.56rem}.process-stage p{margin:10px 0 0}.transition-list{display:grid;gap:5px;margin-top:12px;padding-top:10px;border-top:1px solid var(--erp-line-soft)}.transition-list span{padding:6px;border-radius:7px;color:#315f9b;background:#f0f6ff}.designer-forms .form-panel{width:auto}.designer-forms .form-panel form{grid-template-columns:1fr}
.process-instance-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px;align-items:start}.action-card-list{display:grid;gap:12px;padding-top:14px}.action-card{display:grid;gap:12px;padding:15px;border:1px solid #d6e2ed;border-radius:12px;background:#fbfdff}.action-card>div:first-child{display:grid;gap:4px}.action-card b{color:var(--erp-ink);font-size:.72rem}.action-card small{color:var(--erp-muted);font-size:.58rem}.action-card label{display:grid;gap:6px}.dynamic-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;padding:13px;border-radius:10px;background:#fff}.dynamic-form p{display:grid;gap:5px;margin:0}.timeline-item{display:flex;gap:9px;padding:13px 0;border-bottom:1px solid var(--erp-line-soft)}.timeline-item>i{display:grid;width:25px;height:25px;flex:0 0 25px;place-items:center;border-radius:50%;color:#08715f;background:#e4f5f0}.timeline-item>div{display:grid;gap:4px}.timeline-item b{color:var(--erp-ink);font-size:.65rem}.timeline-item small,.timeline-item p{margin:0;color:var(--erp-muted);font-size:.56rem;line-height:1.8}
@media(max-width:900px){.workflow-overview{grid-template-columns:1fr}.workflow-overview li+li{border-inline-start:0;border-top:1px solid var(--erp-line-soft)}.workflow-overview li+li::before{inset-block-start:-11px;inset-inline-start:50%;transform:translateX(50%) rotate(-90deg)}.builder-layout,.process-instance-layout{grid-template-columns:1fr}.builder-side{position:static}.process-map{padding:12px}.designer-forms{grid-template-columns:1fr}.dynamic-form{grid-template-columns:1fr}}
.form-grid .form-actions { grid-column: 1 / -1; }

/* Operational settings, customer master data and governed reports */
.policy-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 13px 16px; border: 1px solid #b9dfd4; border-radius: 12px; color: #175a4d; background: #f1faf7; }
.policy-summary > i { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; background: #dff4ed; font-size: 1rem; }
.policy-summary > div { display: grid; flex: 1; gap: 3px; }
.policy-summary strong { font-size: .7rem; }
.policy-summary span, .policy-summary bdi { font-size: .59rem; }
.policy-summary bdi { padding: 7px 10px; border-radius: 8px; color: #24435b; background: #fff; font-weight: 850; }
.customer-form { display: grid; gap: 14px; }
.form-section { padding: 0; overflow: hidden; }
.form-section > header { padding: 15px 18px; background: #fbfcfe; }
.form-section > header > div { display: grid; gap: 4px; }
.form-section > header p { margin: 0; color: var(--erp-muted); font-size: .58rem; }
.form-section > .form-grid { padding: 18px; }
.field-group { display: grid; align-content: start; gap: 6px; }
.field-group > label { color: var(--erp-text); font-size: .63rem; font-weight: 850; }
.field-group > label em { color: var(--erp-danger); font-style: normal; }
.field-group > input:not([type="checkbox"]), .field-group > select, .field-group > textarea, .field-group > [data-customer-code-input] input { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #cbd8e3; border-radius: 9px; color: var(--erp-text); background: #fff; font: inherit; }
.field-group textarea { min-height: 92px; resize: vertical; }
.field-group > small { color: var(--erp-muted); font-size: .55rem; line-height: 1.75; }
.field-error { color: var(--erp-danger) !important; }
.field-group--toggle { align-content: center; padding-top: 19px; }
.toggle-field { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 11px; border: 1px solid var(--erp-line); border-radius: 9px; background: #fbfcfe; cursor: pointer; }
.toggle-field input { width: 18px; height: 18px; accent-color: var(--erp-primary); }
.toggle-field > span { display: grid; gap: 2px; }
.toggle-field strong { color: var(--erp-ink); font-size: .63rem; }
.toggle-field small { color: var(--erp-muted); font-size: .53rem; }
[data-customer-code-input].is-automatic input { color: #687b8f; background: #f1f5f9; cursor: not-allowed; }
.form-grid--single { grid-template-columns: 1fr; }
.sticky-actions { position: sticky; z-index: 20; bottom: 10px; margin-top: 2px; padding: 12px; border: 1px solid var(--erp-line); border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 10px 35px rgba(15,23,42,.13); backdrop-filter: blur(8px); }
.form-alert { grid-column: 1 / -1; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 9px; color: #991b1b; background: #fef2f2; font-size: .62rem; }

.settings-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 16px; align-items: start; }
.policy-panel { width: auto; }
.policy-panel > header { margin-bottom: 17px; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--erp-success); font-size: .58rem; font-weight: 800; }
.status-dot::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.settings-guide { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--erp-line); border-radius: var(--erp-radius); background: var(--erp-line); box-shadow: var(--erp-shadow); }
.settings-guide section { display: flex; gap: 11px; padding: 16px; background: #fff; }
.settings-guide i { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 9px; color: #1d5fae; background: #eff6ff; }
.settings-guide div { display: grid; gap: 4px; }
.settings-guide strong { color: var(--erp-ink); font-size: .66rem; }
.settings-guide span, .settings-guide bdi { color: var(--erp-text); font-size: .62rem; font-weight: 750; }
.settings-guide small { color: var(--erp-muted); font-size: .54rem; line-height: 1.75; }
.settings-directory, .report-directory { display: grid; gap: 9px; overflow: hidden; border: 1px solid var(--erp-line); border-radius: var(--erp-radius); background: #fff; box-shadow: var(--erp-shadow); }
.settings-directory > a, .report-directory > a { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 13px; min-height: 76px; padding: 13px 17px; border-bottom: 1px solid var(--erp-line-soft); color: var(--erp-text); }
.settings-directory > a:last-child, .report-directory > a:last-child { border-bottom: 0; }
.settings-directory > a:hover, .report-directory > a:hover { background: #f8fbff; }
.settings-directory i, .report-directory i { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; color: #2868b7; background: #eff6ff; font-size: 1rem; }
.settings-directory span, .report-directory span { display: grid; gap: 4px; }
.settings-directory strong, .report-directory strong { color: var(--erp-ink); font-size: .72rem; }
.settings-directory small, .report-directory small { color: var(--erp-muted); font-size: .58rem; line-height: 1.7; }
.settings-directory em, .report-directory em { color: var(--erp-primary); font-size: .6rem; font-style: normal; font-weight: 800; }

.filter-bar { display: grid; grid-template-columns: minmax(220px,2fr) repeat(3,minmax(150px,1fr)) auto; gap: 10px; align-items: end; margin-bottom: 14px; padding: 13px; border: 1px solid var(--erp-line); border-radius: 12px; background: #fff; box-shadow: var(--erp-shadow); }
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}.stats-grid article{display:grid;gap:8px;padding:16px;border:1px solid var(--erp-line);border-radius:12px;background:#fff;box-shadow:var(--erp-shadow)}.stats-grid span{color:var(--erp-muted);font-size:.62rem}.stats-grid strong{color:var(--erp-ink);font-size:1.25rem}.panel>.timeline-item{display:grid;grid-template-columns:1fr auto;gap:5px 12px}.panel>.timeline-item>span{color:var(--erp-muted);font-size:.58rem}.panel>.timeline-item>p{grid-column:1/-1}
@media(max-width:760px){.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.report-filter { grid-template-columns: repeat(3,minmax(170px,1fr)) auto; }
.filter-actions { display: flex; align-items: center; gap: 7px; }
.filter-actions a { min-height: 40px; padding: 9px 11px; color: var(--erp-muted); font-size: .59rem; font-weight: 800; }
.filter-actions button { white-space: nowrap; }
.metrics--compact article { min-height: 98px; }
.responsive-table a { color: #245eaa; }
.entity-cell { display: flex; align-items: center; gap: 10px; }
.entity-cell > span:last-child { display: grid; gap: 3px; }
.entity-cell small, .table-subline { display: block; margin-top: 4px; color: var(--erp-muted); font-size: .55rem; }
.customer-avatar { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 10px; color: #145c50; background: #e5f6f0; font-weight: 900; }
.count-cluster { color: var(--erp-muted); white-space: nowrap; }
.count-cluster b { color: var(--erp-ink); }
.table-empty { display: grid; min-height: 210px; place-items: center; align-content: center; gap: 8px; color: var(--erp-muted); text-align: center; }
.table-empty i { color: #7aa6dc; font-size: 1.6rem; }
.table-empty strong { color: var(--erp-ink); }
.table-empty p { margin: 0; font-size: .61rem; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 13px; padding: 11px 14px; border: 1px solid var(--erp-line); border-radius: 10px; color: var(--erp-muted); background: #fff; font-size: .59rem; }
.pagination-bar > div { display: flex; align-items: center; gap: 12px; }
.pagination-bar a { font-weight: 800; }

.report-breakdown { margin-bottom: 14px; }
.report-breakdown > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 1px; margin-top: 12px; overflow: hidden; border: 1px solid var(--erp-line-soft); border-radius: 10px; background: var(--erp-line-soft); }
.report-breakdown article { display: grid; gap: 5px; padding: 13px; background: #fbfcfe; }
.report-breakdown strong { color: var(--erp-ink); font-size: .65rem; }
.report-breakdown span { color: var(--erp-text); font-size: .61rem; }
.report-breakdown small { color: var(--erp-muted); font-size: .55rem; }

.sales-setup-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.compact-form p { display: grid; gap: 5px; margin: 0 0 10px; }
.compact-form label { color: var(--erp-text); font-size: .6rem; font-weight: 800; }
.compact-form input:not([type="checkbox"]), .compact-form select, .compact-form textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cbd8e3; border-radius: 8px; background: #fff; font: inherit; }
.compact-form button { margin-top: 4px; }
.config-list { display: grid; gap: 1px; margin-top: 15px; border-top: 1px solid var(--erp-line-soft); }
.config-list > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--erp-line-soft); }
.config-list span { display: grid; gap: 3px; }
.config-list strong { color: var(--erp-ink); font-size: .64rem; }
.config-list small, .config-list em { color: var(--erp-muted); font-size: .54rem; font-style: normal; }
.pipeline-list { display: grid; gap: 13px; margin-top: 18px; }
.pipeline-list > section { overflow: hidden; border: 1px solid var(--erp-line); border-radius: 11px; }
.pipeline-list > section > header { padding: 12px 14px; background: #f8fafc; }
.pipeline-list header > div { display: grid; gap: 3px; }
.pipeline-list header small { color: var(--erp-muted); font-size: .53rem; }
.pipeline-list ol { margin: 0; padding: 0; list-style: none; }
.pipeline-list li { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--erp-line-soft); }
.pipeline-list li > span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: #175a4d; background: #e5f6f0; font-size: .58rem; font-weight: 900; }
.pipeline-list li > div { display: grid; gap: 3px; }
.pipeline-list li strong { color: var(--erp-ink); font-size: .62rem; }
.pipeline-list li small, .pipeline-list li > a { color: var(--erp-muted); font-size: .54rem; }
.pipeline-list li.empty { display: block; color: var(--erp-muted); line-height: 1.8; }

@media (max-width: 1100px) {
  :root { --erp-sidebar: 0px; }
  .erp-sidebar { width: min(340px, calc(100vw - 48px)); transform: translateX(105%); transition: transform .2s ease; }
  .erp-shell.is-sidebar-open .erp-sidebar { transform: translateX(0); }
  .erp-shell.is-sidebar-open .erp-sidebar-backdrop { visibility: visible; opacity: 1; }
  .erp-workspace { width: 100%; margin-inline-start: 0; }
  .sidebar-toggle { display: grid; }
  .module-context-bar { top: 62px; }
}
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .card-grid { grid-template-columns: 1fr; }
  .form-panel form { grid-template-columns: 1fr; }
  .form-panel p, .form-actions { grid-column: auto; }
  .auth-shell { min-height: auto; grid-template-columns: 1fr; }
  .auth-visual { min-height: 240px; padding: 28px; }
  .auth-features { display: none; }
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-side { position: static; }
  .policy-panel form { grid-template-columns: 1fr; }
  .setup-grid, .form-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .filter-bar, .report-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .erp-topbar { min-height: 62px; padding: 0 13px; }
  .erp-topbar__actions .topbar-live, .topbar-capability, .topbar-divider, .account-copy, .account-trigger > i { display: none; }
  .account-trigger { min-width: 0; padding: 0; }
  .workspace-context__trigger { min-width: 0; }
  .workspace-context span { display: none; }
  .workspace-context strong { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .product-space-switcher span { display: none; }
  .product-space-switcher a { padding-inline: 9px; }
  .module-context-bar { min-height: 52px; gap: 8px; padding: 0 10px; }
  .module-context-bar__module { min-width: auto; padding-inline-end: 9px; }
  .module-context-bar__module > div { display: none; }
  .module-context-bar__links a { padding-inline: 8px; }
  .module-context-bar__back span { display: none; }
  .erp-main { padding: 18px 14px 26px; }
  .erp-footer { align-items: flex-start; flex-direction: column; padding: 15px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions a { flex: 1; }
  .metrics { grid-template-columns: 1fr; }
  .metrics article { min-height: 96px; }
  .policy-summary { align-items: flex-start; flex-wrap: wrap; }
  .policy-summary bdi { margin-inline-start: 46px; }
  .filter-bar, .report-filter, .sales-setup-grid { grid-template-columns: 1fr; }
  .filter-actions { grid-column: auto; }
  .settings-directory > a, .report-directory > a { grid-template-columns: 38px minmax(0,1fr); padding: 12px; }
  .settings-directory i, .report-directory i { width: 36px; height: 36px; }
  .settings-directory em, .report-directory em { grid-column: 2; }
  .responsive-table thead { display: none; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { padding: 10px 12px; border-bottom: 1px solid var(--erp-line); }
  .responsive-table td { display: grid; grid-template-columns: minmax(92px,34%) minmax(0,1fr); align-items: center; gap: 8px; padding: 8px 0; border: 0; }
  .responsive-table td::before { color: var(--erp-muted); content: attr(data-label); font-size: .56rem; font-weight: 800; }
  .responsive-table td[colspan] { display: block; }
  .responsive-table td[colspan]::before { display: none; }
  .pagination-bar { align-items: flex-start; flex-direction: column; }
  .sticky-actions { bottom: 4px; }
  .search { width: 100%; }
  .organization-menu { position: fixed; inset: 72px 12px auto; }
  .account-menu { position: fixed; inset: 72px auto auto 12px; }
  .auth-page { padding: 12px; }
  .auth-visual { min-height: 205px; padding: 22px; }
  .auth-visual__copy h2 { font-size: 1.25rem; }
  .auth-card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Customer workspace: action-first, grounded support and compact service status. */
.portal-hero { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:27px 30px; margin-bottom:14px; overflow:hidden; border:1px solid #dbe6f0; border-radius:16px; background:linear-gradient(120deg,#fff 45%,#eef7ff); box-shadow:0 12px 30px rgba(31,59,91,.06); }
.portal-hero div { display:grid; gap:6px; }
.portal-hero small,.portal-section header small { color:#a66d00; font-size:.56rem; font-weight:900; }
.portal-hero h1 { margin:0; color:var(--erp-ink); font-size:1.25rem; }
.portal-hero p { margin:0; color:var(--erp-muted); font-size:.65rem; }
.portal-quick-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.portal-quick-actions a { display:flex; align-items:center; gap:11px; min-height:72px; padding:13px 15px; border:1px solid var(--erp-line); border-radius:13px; color:var(--erp-text); background:#fff; }
.portal-quick-actions a:hover { border-color:#9fc2e8; box-shadow:0 7px 20px rgba(31,72,116,.07); transform:translateY(-1px); }
.portal-quick-actions > a > i { display:grid; width:39px; height:39px; flex:0 0 39px; place-items:center; border-radius:11px; color:#176c5d; background:#e9f8f3; font-size:1rem; }
.portal-quick-actions span { display:grid; gap:3px; }.portal-quick-actions b { font-size:.63rem; }.portal-quick-actions small { color:var(--erp-muted); font-size:.52rem; }
.portal-status-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; margin-bottom:14px; overflow:hidden; border:1px solid var(--erp-line); border-radius:13px; background:var(--erp-line); }
.portal-status-strip article { display:grid; gap:5px; min-height:92px; padding:16px 18px; background:#fff; }.portal-status-strip span,.portal-status-strip small { color:var(--erp-muted); font-size:.54rem; }.portal-status-strip b { color:var(--erp-ink); font-size:.82rem; }
.portal-assistant { margin-bottom:14px; overflow:hidden; border:1px solid #cbdbee; border-radius:16px; background:#fff; box-shadow:0 15px 34px rgba(32,69,112,.08); }
.portal-assistant > header { display:flex; align-items:center; gap:12px; padding:17px 20px; color:#fff; background:linear-gradient(115deg,#163f75,#2867af); }.portal-assistant > header > div { display:grid; gap:2px; min-width:0; }.portal-assistant h2,.portal-assistant p { margin:0; }.portal-assistant h2 { font-size:.8rem; }.portal-assistant p,.portal-assistant header small { color:#d7e8fb; font-size:.53rem; }
.portal-assistant__avatar { display:grid; width:43px; height:43px; flex:0 0 43px; place-items:center; border-radius:13px; color:#224e89; background:#fff; font-size:1.05rem; }.portal-assistant__online { display:flex; align-items:center; gap:6px; margin-inline-start:auto; font-size:.52rem; }.portal-assistant__online i { width:7px; height:7px; border-radius:50%; background:#62e2a6; box-shadow:0 0 0 4px rgba(98,226,166,.15); }
.portal-chat-stream { display:flex; max-height:390px; min-height:180px; flex-direction:column; gap:10px; overflow:auto; padding:18px 20px; background:#f7f9fc; }.portal-chat-empty { display:grid; margin:auto; place-items:center; gap:6px; color:var(--erp-muted); font-size:.58rem; }.portal-chat-empty i { color:#5d89bf; font-size:1.5rem; }.portal-chat-empty strong { color:var(--erp-ink); font-size:.7rem; }
.portal-chat-message { max-width:min(760px,86%); padding:11px 14px; border:1px solid #dce6ef; border-radius:14px 14px 4px; color:var(--erp-text); background:#fff; font-size:.62rem; line-height:2; white-space:pre-wrap; }.portal-chat-message--user { align-self:flex-start; border-color:#b8dbd2; border-radius:14px 14px 14px 4px; background:#eaf8f4; }.portal-chat-message footer { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; padding-top:8px; border-top:1px solid #e6edf4; }.portal-chat-message footer span { padding:3px 7px; border-radius:7px; color:#315f93; background:#edf5fd; font-size:.49rem; }
.portal-chat-composer { display:flex; align-items:flex-end; gap:9px; padding:12px 16px; border-top:1px solid var(--erp-line); }.portal-chat-composer textarea { width:100%; min-height:42px; max-height:130px; resize:vertical; padding:10px 12px; border:1px solid #c9d7e5; border-radius:11px; font:inherit; }.portal-chat-composer button { display:flex; min-height:42px; align-items:center; gap:6px; padding:0 17px; border:0; border-radius:10px; color:#fff; background:#1769ca; font:inherit; font-weight:900; }.portal-assistant__notice { display:block; padding:0 18px 12px; color:var(--erp-muted); font-size:.49rem; }
.portal-content-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }.portal-section--wide { grid-column:1/-1; }.portal-section > header { display:flex; align-items:center; justify-content:space-between; }.portal-section header div { display:grid; gap:3px; }.portal-section header h2 { margin:0; }.portal-list-row { display:grid; grid-template-columns:38px minmax(0,1fr) auto auto; align-items:center; gap:10px; padding:11px 0; border-top:1px solid var(--erp-line-soft); color:inherit; }.portal-list-row > span:nth-child(2) { display:grid; gap:3px; }.portal-list-row small { color:var(--erp-muted); font-size:.51rem; }.portal-list-row b,.portal-list-row strong { font-size:.61rem; }.portal-list-icon { display:grid; width:34px; height:34px; place-items:center; border-radius:10px; color:#316ba8; background:#edf5fd; }.portal-empty { display:grid; min-height:150px; place-items:center; align-content:center; gap:5px; color:var(--erp-muted); text-align:center; font-size:.54rem; }.portal-empty i { color:#91acc8; font-size:1.35rem; }.portal-empty b { color:var(--erp-ink); font-size:.64rem; }.portal-knowledge-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:13px; }.portal-knowledge-grid article { display:grid; gap:7px; min-height:130px; padding:15px; border:1px solid var(--erp-line); border-radius:11px; background:#fbfcfe; }.portal-knowledge-grid article i { color:#2e78bd; font-size:1.1rem; }.portal-knowledge-grid b { font-size:.62rem; }.portal-knowledge-grid p { margin:0; color:var(--erp-muted); font-size:.53rem; line-height:1.9; }
@media(max-width:900px){.portal-quick-actions{grid-template-columns:repeat(2,1fr)}.portal-content-grid{grid-template-columns:1fr}.portal-section--wide{grid-column:auto}.portal-knowledge-grid{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.portal-hero{align-items:flex-start;flex-direction:column;padding:20px}.portal-quick-actions,.portal-status-strip,.portal-knowledge-grid{grid-template-columns:1fr}.portal-assistant__online{display:none}.portal-chat-message{max-width:94%}.portal-chat-composer button span{display:none}.portal-content-grid{display:block}.portal-section{margin-bottom:12px}}

/* Dedicated customer chat workspace */
.customer-chat-workspace { display:grid; height:calc(100vh - 178px); min-height:610px; grid-template-columns:250px minmax(0,1fr); overflow:hidden; border:1px solid var(--erp-line); border-radius:16px; background:#fff; box-shadow:0 16px 38px rgba(25,55,92,.09); }
.customer-chat-sidebar { display:flex; min-width:0; flex-direction:column; border-inline-end:1px solid var(--erp-line); background:#f8fafc; }
.customer-chat-sidebar > header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:17px; border-bottom:1px solid var(--erp-line); }.customer-chat-sidebar > header div { display:grid; gap:2px; }.customer-chat-sidebar > header small { color:var(--erp-muted); font-size:.5rem; }.customer-chat-sidebar h1 { margin:0; color:var(--erp-ink); font-size:.68rem; }.customer-chat-sidebar > header a { display:grid; width:34px; height:34px; place-items:center; border-radius:9px; color:#fff; background:#236ec5; }
.customer-chat-sidebar nav { display:flex; min-height:0; flex:1; flex-direction:column; gap:5px; overflow:auto; padding:10px; }.customer-chat-sidebar nav > a { display:flex; align-items:center; gap:9px; padding:10px; border:1px solid transparent; border-radius:10px; color:var(--erp-text); }.customer-chat-sidebar nav > a:hover,.customer-chat-sidebar nav > a.is-current { border-color:#bed3eb; background:#fff; }.customer-chat-sidebar nav > a > i { color:#6484a9; }.customer-chat-sidebar nav span { display:grid; min-width:0; gap:3px; }.customer-chat-sidebar nav b { overflow:hidden; font-size:.57rem; text-overflow:ellipsis; white-space:nowrap; }.customer-chat-sidebar nav small { color:var(--erp-muted); font-size:.47rem; }.customer-chat-sidebar__empty { display:grid; min-height:180px; place-items:center; align-content:center; gap:7px; color:var(--erp-muted); font-size:.52rem; }.customer-chat-sidebar__empty i { font-size:1.3rem; }.customer-chat-sidebar > footer { padding:12px; border-top:1px solid var(--erp-line); }.customer-chat-sidebar > footer a { display:flex; align-items:center; gap:7px; color:var(--erp-muted); font-size:.54rem; font-weight:800; }
.customer-chat-main { display:flex; min-width:0; min-height:0; flex-direction:column; }.customer-chat-main > header { display:flex; min-height:72px; align-items:center; gap:11px; padding:13px 20px; border-bottom:1px solid var(--erp-line); background:#fff; }.customer-chat-main > header > div { display:grid; gap:3px; }.customer-chat-main > header h2 { margin:0; color:var(--erp-ink); font-size:.72rem; }.customer-chat-main > header small { color:var(--erp-muted); font-size:.5rem; }.customer-chat-main > header small i { display:inline-block; width:6px; height:6px; margin-inline-end:5px; border-radius:50%; background:#23aa75; }.customer-chat-security { display:flex; align-items:center; gap:5px; margin-inline-start:auto; padding:6px 9px; border-radius:8px; color:#26705e; background:#e8f7f2; font-size:.49rem; font-weight:800; }
.customer-chat-stream { max-height:none; min-height:0; flex:1; padding:24px clamp(18px,6vw,76px); }.customer-chat-welcome { display:grid; max-width:680px; margin:auto; place-items:center; gap:9px; text-align:center; }.customer-chat-welcome > span { display:grid; width:58px; height:58px; place-items:center; border-radius:18px; color:#fff; background:linear-gradient(135deg,#246bc0,#684ed3); box-shadow:0 13px 30px rgba(63,78,184,.22); font-size:1.35rem; }.customer-chat-welcome h2 { margin:4px 0 0; color:var(--erp-ink); font-size:.82rem; }.customer-chat-welcome p { max-width:520px; margin:0; color:var(--erp-muted); font-size:.56rem; line-height:2; }.customer-chat-welcome > div { display:flex; flex-wrap:wrap; justify-content:center; gap:7px; margin-top:7px; }.customer-chat-welcome button { padding:7px 10px; border:1px solid #d5e1ed; border-radius:9px; color:#426381; background:#fff; font:inherit; font-size:.5rem; cursor:pointer; }
.customer-chat-compose-wrap { padding:10px clamp(14px,4vw,54px) 13px; border-top:1px solid var(--erp-line); background:#fff; }.customer-chat-composer { padding:0; border:1px solid #bdcfe2; border-radius:13px; box-shadow:0 6px 18px rgba(30,66,105,.06); }.customer-chat-composer textarea { border:0; box-shadow:none!important; }.customer-chat-compose-wrap > small { display:block; margin-top:6px; color:var(--erp-muted); font-size:.46rem; text-align:center; }

/* Customer request form */
.portal-ticket-head small { color:#9a6800; font-size:.54rem; font-weight:900; }.portal-ticket-head > a { display:flex; align-items:center; gap:6px; color:#476887; font-size:.57rem; font-weight:800; }
.portal-ticket-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; align-items:start; gap:16px; }.portal-ticket-form-card { padding:0; overflow:hidden; }.portal-ticket-form-card > header { display:flex; align-items:center; gap:11px; padding:17px 20px; border-bottom:1px solid var(--erp-line); background:#f9fbfd; }.portal-ticket-form-card > header > span { display:grid; width:39px; height:39px; place-items:center; border-radius:11px; color:#2468ad; background:#e8f2fc; }.portal-ticket-form-card > header > div { display:grid; gap:3px; }.portal-ticket-form-card h2,.portal-ticket-form-card p { margin:0; }.portal-ticket-form-card h2 { color:var(--erp-ink); font-size:.7rem; }.portal-ticket-form-card p { color:var(--erp-muted); font-size:.52rem; }
.portal-ticket-form-card form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 18px; padding:22px; }.portal-form-field { display:grid; align-content:start; gap:6px; }.portal-form-field--wide,.portal-ticket-form-card form > footer,.form-summary-error { grid-column:1/-1; }.portal-form-field label { color:var(--erp-text); font-size:.61rem; font-weight:900; }.portal-form-field label em { color:#dc3f4b; font-style:normal; }.portal-form-field input,.portal-form-field select,.portal-form-field textarea { width:100%; min-height:44px; padding:9px 11px; border:1px solid #c8d6e4; border-radius:9px; color:var(--erp-text); background:#fff; font:inherit; }.portal-form-field textarea { min-height:155px; resize:vertical; }.portal-form-field input:focus,.portal-form-field select:focus,.portal-form-field textarea:focus { border-color:#6194ce; box-shadow:0 0 0 3px rgba(54,119,190,.11); outline:0; }.portal-form-field > small { color:var(--erp-muted); font-size:.49rem; }.portal-form-field .errorlist { margin:0; padding:7px 9px; border-radius:7px; color:#b32635; background:#fff0f1; font-size:.5rem; list-style:none; }.portal-field-hint { display:flex; align-items:center; gap:6px; color:#7b6226; font-size:.49rem; }.portal-ticket-form-card form > footer { display:flex; align-items:center; justify-content:flex-end; gap:9px; padding-top:15px; border-top:1px solid var(--erp-line-soft); }.portal-ticket-form-card form > footer > a { padding:9px 14px; color:var(--erp-muted); font-size:.56rem; font-weight:800; }.portal-ticket-form-card form > footer button { display:flex; align-items:center; gap:7px; }
.portal-ticket-guide { display:grid; gap:12px; }.portal-ticket-guide > section,.portal-ticket-guide > ol,.portal-ticket-guide > a { border:1px solid var(--erp-line); border-radius:13px; background:#fff; box-shadow:0 7px 19px rgba(35,63,94,.05); }.portal-ticket-guide > section { display:flex; gap:10px; padding:16px; }.portal-ticket-guide > section > span { display:grid; width:38px; height:38px; flex:0 0 38px; place-items:center; border-radius:10px; color:#2d6da9; background:#edf5fc; }.portal-ticket-guide h2,.portal-ticket-guide p { margin:0; }.portal-ticket-guide h2 { color:var(--erp-ink); font-size:.62rem; }.portal-ticket-guide p { margin-top:5px; color:var(--erp-muted); font-size:.51rem; line-height:1.9; }.portal-ticket-guide ol { display:grid; gap:0; margin:0; padding:8px 15px; list-style:none; }.portal-ticket-guide li { display:flex; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid var(--erp-line-soft); }.portal-ticket-guide li:last-child { border:0; }.portal-ticket-guide li > b { display:grid; width:26px; height:26px; flex:0 0 26px; place-items:center; border-radius:8px; color:#266657; background:#e7f6f1; font-size:.52rem; }.portal-ticket-guide li span { display:grid; gap:2px; }.portal-ticket-guide li strong { font-size:.56rem; }.portal-ticket-guide li small { color:var(--erp-muted); font-size:.47rem; }.portal-ticket-guide > a { display:grid; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; gap:9px; padding:13px; color:inherit; }.portal-ticket-guide > a > i:first-child { display:grid; width:32px; height:32px; place-items:center; border-radius:9px; color:#5643ba; background:#eeebff; }.portal-ticket-guide > a span { display:grid; gap:3px; }.portal-ticket-guide > a strong { font-size:.55rem; }.portal-ticket-guide > a small { color:var(--erp-muted); font-size:.46rem; }
@media(max-width:900px){.customer-chat-workspace{height:auto;min-height:680px;grid-template-columns:1fr}.customer-chat-sidebar{display:none}.portal-ticket-layout{grid-template-columns:1fr}.portal-ticket-guide{grid-template-columns:1fr 1fr}.portal-ticket-guide>ol{grid-row:span 2}}
@media(max-width:600px){.customer-chat-workspace{min-height:calc(100vh - 155px);border-radius:0}.customer-chat-main>header{padding:10px 13px}.customer-chat-security{display:none}.customer-chat-stream{padding:17px 12px}.customer-chat-compose-wrap{padding:8px}.portal-ticket-form-card form{grid-template-columns:1fr;padding:16px}.portal-form-field--wide,.portal-ticket-form-card form>footer{grid-column:auto}.portal-ticket-form-card form>footer{align-items:stretch;flex-direction:column-reverse}.portal-ticket-form-card form>footer button{justify-content:center}.portal-ticket-guide{grid-template-columns:1fr}.portal-ticket-guide>ol{grid-row:auto}}

.portal-filter-bar { display:grid; grid-template-columns:minmax(260px,1fr) 220px auto; gap:9px; margin-bottom:12px; padding:11px; border:1px solid var(--erp-line); border-radius:12px; background:#fff; }.portal-filter-bar label { position:relative; display:block; }.portal-filter-bar label i { position:absolute; z-index:1; top:50%; inset-inline-end:12px; color:#8ba0b6; transform:translateY(-50%); }.portal-filter-bar input,.portal-filter-bar select,.portal-filter-bar button { width:100%; min-height:41px; border:1px solid #cbd8e3; border-radius:8px; font:inherit; }.portal-filter-bar input { padding:8px 38px 8px 10px; }.portal-filter-bar select { padding:8px 10px; }.portal-filter-bar button { width:auto; padding:0 17px; border-color:#236dcc; color:#fff; background:#236dcc; font-weight:900; }
.portal-record-list { padding:7px 18px; }.portal-record-list > a,.portal-record-list > div:not(.portal-empty) { display:grid; grid-template-columns:38px minmax(0,1fr) auto auto; align-items:center; gap:11px; min-height:68px; padding:10px 0; border-bottom:1px solid var(--erp-line-soft); color:inherit; }.portal-record-list > :last-child { border-bottom:0; }.portal-record-list > a > span:nth-child(2),.portal-record-list > div > span:nth-child(2) { display:grid; gap:3px; }.portal-record-list b,.portal-record-list strong { font-size:.62rem; }.portal-record-list small { color:var(--erp-muted); font-size:.51rem; }
.portal-record-list + .portal-record-list{margin-top:14px}.portal-record-list>.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid var(--erp-line-soft)}.portal-record-list>.panel-heading div{display:grid;gap:3px}.portal-record-list>.panel-heading h2{margin:0;font-size:1rem}.portal-record-list>.panel-heading small{font-size:.75rem}.info-banner{display:flex;align-items:flex-start;gap:12px;margin:0 0 14px;padding:14px 16px;border:1px solid #bfe5db;border-radius:12px;background:#f2fbf8;color:#176354}.info-banner>i{font-size:1.15rem}.info-banner b{display:block;margin-bottom:3px}.info-banner p{margin:0;line-height:1.85;color:#3b6f64}
.portal-balance-card { display:flex; align-items:center; gap:13px; margin-bottom:12px; padding:17px 20px; border:1px solid #b8dccc; border-radius:13px; background:linear-gradient(110deg,#effaf6,#fff); }.portal-balance-card > span { display:grid; width:44px; height:44px; place-items:center; border-radius:12px; color:#176c59; background:#dff4ec; font-size:1.15rem; }.portal-balance-card > div { display:grid; gap:3px; }.portal-balance-card small,.portal-balance-card em { color:var(--erp-muted); font-size:.5rem; font-style:normal; }.portal-balance-card b { color:#144f44; font-size:.78rem; }
.portal-knowledge-search { display:flex; max-width:760px; align-items:center; gap:8px; margin:0 auto 18px; padding:7px 8px 7px 14px; border:1px solid #bfd0e2; border-radius:13px; background:#fff; box-shadow:0 8px 23px rgba(34,68,106,.06); }.portal-knowledge-search > i { margin-inline-start:7px; color:#7890a9; }.portal-knowledge-search input { min-width:0; min-height:40px; flex:1; border:0; outline:0; font:inherit; }.portal-knowledge-search button { min-height:38px; padding:0 17px; border:0; border-radius:9px; color:#fff; background:#256bc0; font:inherit; font-weight:900; }
.portal-knowledge-library { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }.portal-knowledge-library > article { display:flex; min-height:170px; gap:11px; padding:17px; border:1px solid var(--erp-line); border-radius:13px; background:#fff; box-shadow:0 7px 20px rgba(32,62,96,.045); }.portal-knowledge-library > article > span { display:grid; width:38px; height:38px; flex:0 0 38px; place-items:center; border-radius:10px; color:#2769a9; background:#edf5fc; }.portal-knowledge-library article > div { display:grid; align-content:start; gap:6px; }.portal-knowledge-library small { color:#8a6a22; font-size:.48rem; font-weight:900; }.portal-knowledge-library h2 { margin:0; color:var(--erp-ink); font-size:.65rem; }.portal-knowledge-library p { margin:0; color:var(--erp-muted); font-size:.53rem; line-height:2; }.portal-knowledge-library a { font-size:.5rem; font-weight:800; }
@media(max-width:900px){.portal-filter-bar{grid-template-columns:1fr 1fr}.portal-filter-bar button{grid-column:1/-1}.portal-knowledge-library{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.portal-filter-bar,.portal-knowledge-library{grid-template-columns:1fr}.portal-filter-bar button{grid-column:auto}.portal-record-list> a,.portal-record-list>div:not(.portal-empty){grid-template-columns:36px minmax(0,1fr) auto}.portal-record-list> a>i:last-child{display:none}}

/* Customer intelligence hub — aligned with DABA's AI workspace language. */
.module-rail__item--assistant { display:grid; grid-template-columns:21px minmax(0,1fr) auto; color:#315d91; background:#f2f7fd; }
.module-rail__item--assistant small { padding:2px 5px; border-radius:9px; color:#147a5d; background:#dcf5ec; font-size:.42rem; font-weight:900; }
.customer-hub { display:grid; gap:16px; }
.customer-hub__hero { position:relative; display:grid; min-height:238px; grid-template-columns:minmax(0,1fr) 270px; align-items:center; overflow:hidden; padding:34px clamp(25px,4vw,50px); border:1px solid #cbdcf0; border-radius:18px; color:#fff; background:linear-gradient(120deg,#173d70 0%,#2467b2 55%,#514dc1 100%); box-shadow:0 18px 42px rgba(31,66,119,.16); }
.customer-hub__hero::before { position:absolute; width:360px; height:360px; inset:-190px auto auto -80px; border:70px solid rgba(255,255,255,.05); border-radius:50%; content:""; }
.customer-hub__hero-copy { position:relative; z-index:1; display:grid; max-width:720px; gap:11px; }
.customer-hub__eyebrow { display:flex; align-items:center; gap:7px; color:#cfe5ff; font-size:.57rem; font-weight:900; }
.customer-hub__hero h1 { margin:0; font-size:1.45rem; line-height:1.7; }
.customer-hub__hero p { max-width:650px; margin:0; color:#dceafb; font-size:.66rem; line-height:2; }
.customer-hub__hero-actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:6px; }
.customer-hub__hero-actions a { display:flex; min-height:42px; align-items:center; gap:7px; padding:0 16px; border:1px solid rgba(255,255,255,.45); border-radius:10px; color:#fff; font-size:.58rem; font-weight:900; }
.customer-hub__hero-actions .primary { border-color:#fff; color:#17477e; background:#fff; }
.customer-hub__hero-actions .secondary { background:rgba(255,255,255,.1); backdrop-filter:blur(8px); }
.customer-hub__hero-visual { position:relative; display:grid; width:190px; height:190px; place-self:center; place-items:center; }
.customer-hub__hero-visual > span { display:grid; width:104px; height:104px; place-items:center; border:1px solid rgba(255,255,255,.35); border-radius:31px; color:#316bb0; background:#fff; box-shadow:0 25px 50px rgba(11,33,70,.24); font-size:2.2rem; transform:rotate(-5deg); }
.customer-hub__orbit { position:absolute; display:grid; width:38px; height:38px; place-items:center; border:1px solid rgba(255,255,255,.45); border-radius:12px; color:#fff; background:rgba(255,255,255,.16); backdrop-filter:blur(8px); }
.customer-hub__orbit--one { top:5px; right:7px; }.customer-hub__orbit--two { bottom:6px; left:5px; }.customer-hub__orbit--three { top:28px; left:0; }
.customer-hub__metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.customer-hub__metrics > a,.customer-hub__metrics > article { display:grid; min-height:102px; grid-template-columns:45px minmax(0,1fr) auto; align-items:center; gap:11px; padding:15px; border:1px solid var(--erp-line); border-radius:14px; color:inherit; background:#fff; box-shadow:0 7px 20px rgba(34,63,98,.045); }
.customer-hub__metrics > a:hover { border-color:#9dbfe3; box-shadow:0 11px 26px rgba(34,74,119,.09); transform:translateY(-2px); }
.customer-hub__metrics > * > span { display:grid; width:43px; height:43px; place-items:center; border-radius:12px; font-size:1.05rem; }.customer-hub__metrics .is-blue{color:#2769b1;background:#e9f3fd}.customer-hub__metrics .is-violet{color:#604fc0;background:#eeebff}.customer-hub__metrics .is-emerald{color:#19755f;background:#e5f7f1}.customer-hub__metrics .is-amber{color:#a36a00;background:#fff3d6}
.customer-hub__metrics div { display:grid; min-width:0; gap:3px; }.customer-hub__metrics small,.customer-hub__metrics em { overflow:hidden; color:var(--erp-muted); font-size:.49rem; font-style:normal; text-overflow:ellipsis; white-space:nowrap; }.customer-hub__metrics strong { color:var(--erp-ink); font-size:.78rem; }
.customer-hub__services,.customer-hub__panel { border:1px solid var(--erp-line); border-radius:16px; background:#fff; box-shadow:0 8px 23px rgba(32,61,96,.045); }
.customer-hub__services { padding:20px; }.customer-hub__services > header,.customer-hub__panel > header { display:flex; align-items:center; justify-content:space-between; gap:12px; }.customer-hub__services header div,.customer-hub__panel header div { display:grid; gap:3px; }.customer-hub__services header small,.customer-hub__panel header small { color:#7e6b98; font-size:.49rem; font-weight:900; }.customer-hub__services h2,.customer-hub__panel h2 { margin:0; color:var(--erp-ink); font-size:.72rem; }
.customer-hub__service-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:15px; }.customer-service-card { display:grid; min-height:142px; grid-template-columns:42px minmax(0,1fr); align-content:start; gap:12px; padding:16px; border:1px solid #dce5ee; border-radius:13px; color:inherit; background:#fbfcfe; }.customer-service-card > span { display:grid; width:40px; height:40px; place-items:center; border-radius:11px; color:#286aaa; background:#eaf3fc; font-size:1rem; }.customer-service-card > div { display:grid; align-content:start; gap:6px; }.customer-service-card b { font-size:.62rem; }.customer-service-card p { margin:0; color:var(--erp-muted); font-size:.51rem; line-height:1.9; }.customer-service-card > i { grid-column:1/-1; align-self:end; color:#6382a4; }.customer-service-card:hover { border-color:#9dbfe3; background:#fff; transform:translateY(-2px); }.customer-service-card--ai { border-color:#cfd1f5; background:linear-gradient(135deg,#f8f7ff,#eef5ff); }.customer-service-card--ai > span { color:#fff; background:linear-gradient(135deg,#286ec0,#654fd0); }
.customer-hub__columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }.customer-hub__panel { overflow:hidden; padding:18px; }.customer-hub__panel > header { padding-bottom:12px; }.customer-hub__panel header > a { color:#316ba7; font-size:.51rem; font-weight:900; }.customer-hub__list { display:grid; }.customer-hub__list > a,.customer-hub__document { display:grid; min-height:66px; grid-template-columns:38px minmax(0,1fr) auto auto; align-items:center; gap:10px; border-top:1px solid var(--erp-line-soft); color:inherit; }.customer-hub__list-icon { display:grid; width:35px; height:35px; place-items:center; border-radius:10px; color:#326fae; background:#edf5fc; }.customer-hub__list > a > div,.customer-hub__document > div { display:grid; gap:3px; min-width:0; }.customer-hub__list b,.customer-hub__document strong { font-size:.58rem; }.customer-hub__list small { overflow:hidden; color:var(--erp-muted); font-size:.48rem; text-overflow:ellipsis; white-space:nowrap; }.customer-hub__list em { padding:4px 7px; border-radius:8px; color:#526679; background:#edf2f6; font-size:.46rem; font-style:normal; font-weight:900; }.customer-hub__list em.status--open{color:#146c55;background:#e4f7ef}.customer-hub__list em.status--waiting_customer{color:#9a6800;background:#fff3d5}.customer-hub__list em.status--in_progress{color:#285f9a;background:#e8f2fc}
.customer-hub__empty { display:grid; min-height:180px; place-items:center; align-content:center; gap:6px; color:var(--erp-muted); text-align:center; font-size:.51rem; }.customer-hub__empty i { color:#8ba5c0; font-size:1.45rem; }.customer-hub__empty b { color:var(--erp-ink); font-size:.61rem; }
.customer-hub__attention { display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:11px; padding:14px 17px; border:1px solid #eed69b; border-radius:13px; color:#715310; background:#fff9e9; }.customer-hub__attention > i { font-size:1.1rem; }.customer-hub__attention div { display:grid; gap:3px; }.customer-hub__attention b { font-size:.58rem; }.customer-hub__attention span { color:#806d40; font-size:.49rem; }.customer-hub__attention a { padding:7px 10px; border:1px solid #d8b75e; border-radius:8px; color:#725000; font-size:.5rem; font-weight:900; background:#fff; }
@media(max-width:1100px){.customer-hub__metrics{grid-template-columns:repeat(2,1fr)}.customer-hub__service-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:800px){.customer-hub__hero{grid-template-columns:1fr}.customer-hub__hero-visual{display:none}.customer-hub__columns{grid-template-columns:1fr}}
@media(max-width:560px){.customer-hub{gap:11px}.customer-hub__hero{min-height:0;padding:24px 19px;border-radius:14px}.customer-hub__hero h1{font-size:1.12rem}.customer-hub__hero-actions{align-items:stretch;flex-direction:column}.customer-hub__hero-actions a{justify-content:center}.customer-hub__metrics,.customer-hub__service-grid{grid-template-columns:1fr}.customer-hub__metrics>a,.customer-hub__metrics>article{min-height:84px}.customer-hub__services,.customer-hub__panel{padding:14px}.customer-service-card{min-height:110px}.customer-hub__list>a,.customer-hub__document{grid-template-columns:35px minmax(0,1fr) auto}.customer-hub__list>a>i:last-child{display:none}.customer-hub__attention{grid-template-columns:32px minmax(0,1fr)}.customer-hub__attention>a{grid-column:2}}

/* Embedded customer assistant on the portal dashboard */
.customer-hub-layout { min-width:0; }
.customer-hub-layout--with-chat { display:grid; grid-template-columns:minmax(0,1fr) 340px; align-items:start; gap:16px; }
.customer-home-chat { position:sticky; top:92px; display:flex; height:calc(100vh - 126px); min-height:570px; max-height:790px; flex-direction:column; overflow:hidden; border:1px solid #cfe0da; border-radius:17px; background:#fff; box-shadow:0 12px 34px rgba(32,69,96,.09); }
.customer-home-chat>header { display:flex; align-items:center; gap:10px; padding:15px 14px 11px; }
.customer-home-chat__avatar { display:grid; width:42px; height:42px; flex:0 0 42px; place-items:center; border-radius:12px; color:#fff; background:#15946f; box-shadow:0 8px 18px rgba(21,148,111,.2); font-size:1.05rem; }
.customer-home-chat>header>div { display:grid; min-width:0; gap:2px; }
.customer-home-chat>header small { color:#188262; font-size:.72rem; font-weight:850; }
.customer-home-chat>header h2 { overflow:hidden; margin:0; color:var(--erp-ink); font-size:.96rem; text-overflow:ellipsis; white-space:nowrap; }
.customer-home-chat>header>a { display:grid; width:34px; height:34px; margin-inline-start:auto; place-items:center; border:1px solid #cfe0da; border-radius:10px; color:#147d60; background:#fff; }
.customer-home-chat__trust { display:flex; align-items:center; gap:8px; margin:0 12px 10px; padding:10px 11px; border:1px solid #cce7dd; border-radius:11px; color:#37675b; background:#eff9f5; font-size:.72rem; line-height:1.7; }
.customer-home-chat__trust i { color:#15946f; font-size:1rem; }
.customer-home-chat__stream { min-height:0; max-height:none; flex:1; gap:9px; padding:13px 12px; border-block:1px solid #e7edf2; background:#f8fafb; }
.customer-home-chat__stream .portal-chat-message { max-width:91%; padding:9px 11px; border-radius:12px 12px 4px; font-size:.78rem; line-height:1.9; }
.customer-home-chat__stream .portal-chat-message--user { border-radius:12px 12px 12px 4px; color:#fff; background:#166fd0; }
.customer-home-chat__welcome { display:grid; margin:auto; place-items:center; gap:7px; padding:16px; color:var(--erp-muted); text-align:center; }
.customer-home-chat__welcome>span { display:grid; width:44px; height:44px; place-items:center; border-radius:14px; color:#fff; background:#15946f; font-size:1.05rem; }
.customer-home-chat__welcome b { color:var(--erp-ink); font-size:.88rem; line-height:1.9; }
.customer-home-chat__welcome p { margin:0; font-size:.75rem; line-height:1.9; }
.customer-home-chat__suggestions { display:flex; flex-wrap:wrap; gap:6px; padding:9px 12px 0; }
.customer-home-chat__suggestions button { padding:6px 9px; border:1px solid #d4e0e9; border-radius:9px; color:#47657d; background:#fff; font:inherit; font-size:.7rem; cursor:pointer; }
.customer-home-chat__composer { align-items:center; margin:9px 12px 0; padding:5px 6px; border:1px solid #c9d9e4; border-radius:13px; background:#fff; box-shadow:0 5px 15px rgba(31,66,100,.06); }
.customer-home-chat__composer textarea { min-height:54px; max-height:110px; padding:8px; border:0; resize:none; font-size:.8rem; line-height:1.8; }
.customer-home-chat__composer button { width:36px; min-width:36px; min-height:36px; justify-content:center; padding:0; border-radius:10px; background:#15946f; }
.customer-home-chat>footer { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 13px 11px; color:var(--erp-muted); font-size:.68rem; }
.customer-home-chat>footer span { display:flex; align-items:center; gap:5px; }
.customer-home-chat>footer span i { width:7px; height:7px; border-radius:50%; background:#20a879; box-shadow:0 0 0 3px rgba(32,168,121,.12); }
.customer-home-chat>footer a { color:#27705d; font-weight:850; }
@media(max-width:1200px){.customer-hub-layout--with-chat{grid-template-columns:minmax(0,1fr) 310px}.customer-home-chat{top:82px}}
@media(max-width:950px){.customer-hub-layout--with-chat{grid-template-columns:1fr}.customer-home-chat{position:relative;top:auto;order:-1;height:540px;min-height:0;max-height:none}}
@media(max-width:560px){.customer-home-chat{height:500px;border-radius:13px}.customer-home-chat__trust{font-size:.68rem}.customer-home-chat__stream .portal-chat-message{font-size:.75rem}}
