/* WR SYSTEMS B2B v0.17 — premium production UI system */
:root{
  --wr-sidebar-gradient:linear-gradient(180deg,#071c3f 0%,#0a2754 55%,#0b2d61 100%);
  --bg:#f5f7fb;--surface:#fff;--surface-soft:#f8fafc;--surface-tint:#f2f6fc;
  --line:#e2e8f0;--line-strong:#cfd8e6;--border:var(--line);--border-strong:var(--line-strong);
  --text:#10203c;--muted:#66758a;--blue:#1463ef;--blue-dark:#0e4fc5;
  --sidebar:#081d40;--sidebar-soft:#154586;--success:#139b62;--danger:#e5484d;--warning:#dd8a18;
  --radius:14px;--radius-sm:10px;--radius-lg:18px;
  --shadow-xs:0 1px 2px rgba(15,23,42,.04);--shadow:0 8px 28px rgba(23,43,77,.08);--shadow-lg:0 22px 64px rgba(15,31,61,.16);
  --focus:0 0 0 3px rgba(20,99,239,.14);
}
html{background:var(--bg)}body{font-family:"Segoe UI Variable","Segoe UI",Inter,system-ui,-apple-system,sans-serif;background:var(--bg);font-size:14px;letter-spacing:-.005em}
button,input,select,textarea{font-family:inherit}::selection{background:rgba(20,99,239,.16)}

/* Shell */
.app-shell{grid-template-columns:246px minmax(0,1fr);background:var(--bg)}
.sidebar{padding:20px 12px 14px;background:var(--wr-sidebar-gradient);box-shadow:12px 0 38px rgba(7,28,63,.08);border-right:1px solid rgba(255,255,255,.04)}
.sidebar-head{padding:0 4px 10px}.sidebar-brand{padding:0 4px 20px}.sidebar-brand .brand-mark{width:42px;height:42px;border-radius:11px;background:linear-gradient(145deg,#2474ff,#0d56dd);box-shadow:0 10px 28px rgba(20,99,239,.34);font-size:15px}
.sidebar-brand strong{font-size:14px;color:#fff}.sidebar-brand small{font-size:9px;color:#a9b9d0;letter-spacing:.13em}.sidebar-collapse{width:30px;height:30px;border:1px solid rgba(255,255,255,.06);background:rgba(255,255,255,.06);color:#9fb1cb;border-radius:9px}.sidebar-collapse:hover{background:rgba(255,255,255,.1);color:#fff}
.main-nav{padding:0 2px 8px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.12) transparent}.nav-group{gap:3px;margin-bottom:15px}.nav-group-label{padding:0 9px 5px;color:#7488a5;font-size:9px;letter-spacing:.13em}
.nav-item{min-height:39px;padding:0 10px;border-radius:9px;color:#c4d0df;font-size:12px;font-weight:600;transition:.15s ease}.nav-item .nav-icon{width:20px;color:#95a8c3;font-size:15px}.nav-item:hover{background:rgba(255,255,255,.055);color:#fff;transform:none}.nav-item.active{background:linear-gradient(90deg,rgba(33,104,224,.48),rgba(24,85,176,.55));box-shadow:inset 0 0 0 1px rgba(91,149,255,.15);color:#fff}.nav-item.active .nav-icon{color:#7db0ff}.nav-item em{color:#8293ab;font-size:8px}
.sidebar-tools{margin-top:4px;padding:12px 2px 0;border-top:1px solid rgba(255,255,255,.065)}.sidebar-tool{min-height:38px;color:#b3c2d6;border-radius:9px;padding:0 10px}.sidebar-tool:hover{background:rgba(255,255,255,.055);color:#fff}.sidebar-tool kbd{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.08);color:#8fa2bd}
.sidebar-footer{padding:15px 9px 2px;border-top:1px solid rgba(255,255,255,.06);color:#8ea1bd}.system-state{color:#c0ccdc}.system-state i{box-shadow:0 0 0 3px rgba(54,201,141,.1)}
.workspace{background:var(--bg)}.topbar{min-height:66px;padding:10px 28px;background:rgba(255,255,255,.96);border-bottom:1px solid #e8edf4;box-shadow:0 1px 0 rgba(16,32,60,.02);backdrop-filter:blur(16px)}
.topbar h1{font-size:15px;font-weight:750;color:#162643}.workspace-breadcrumbs{font-size:10px;margin-bottom:2px;color:#8492a7}.workspace-breadcrumbs span:first-child{color:var(--blue);font-weight:800}.workspace-breadcrumbs strong{color:#34445f}.topbar-actions{gap:8px}.save-state{font-size:10px}.icon-button{width:38px;height:38px;border:1px solid #e1e7ef;border-radius:10px;background:#fff;color:#53647c;box-shadow:var(--shadow-xs)}.icon-button:hover{border-color:#ccd6e4;background:#f9fbfd;color:#19365f}.user-chip{min-height:40px;padding:4px 9px 4px 4px;border-color:#e1e7ef;border-radius:11px;box-shadow:var(--shadow-xs)}.user-chip>span:first-child{width:31px;height:31px;border-radius:50%;background:#13294b}.user-chip strong{font-size:11px;color:#142441}.user-chip small{font-size:9px}.menu-panel{border-radius:14px;border-color:#dfe6ef;box-shadow:var(--shadow-lg)}
.content{padding:24px 30px 36px;max-width:1680px}.welcome-row{align-items:center;margin-bottom:18px}.welcome-row h2,.module-heading h2{font-size:26px;font-weight:760;letter-spacing:-.035em;color:#11213d}.welcome-row p,.module-heading p{font-size:12px;color:#69788c}.eyebrow{font-size:8px;color:#607189;letter-spacing:.15em;margin-bottom:6px}

/* Buttons, inputs, control language */
.button{min-height:38px;padding:0 14px;border-radius:9px;font-size:12px;font-weight:700;box-shadow:none}.button-primary{background:linear-gradient(180deg,#1d6df4,#145fe5);box-shadow:0 5px 14px rgba(20,99,239,.18)}.button-primary:hover{background:linear-gradient(180deg,#1764e7,#0d52cf);transform:translateY(-1px)}.button-secondary{background:#fff;border:1px solid #dfe6ef;color:#263b59}.button-secondary:hover{background:#f8fafc;border-color:#cbd5e2}.button-ghost{color:#5f6f84}.button:focus-visible,.icon-button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:0;box-shadow:var(--focus)}
.module-tools input,.module-tools select,.field-label select,.form-grid input,.form-grid select,.form-grid textarea,.menu-section select{border-color:#dfe6ef!important;background:#fff!important;border-radius:9px!important;color:#1d2d48!important}.module-tools input,.module-tools select{height:38px}.module-tools input{min-width:230px}.module-tools input::placeholder{color:#9aa7b9}.module-tools select:hover,.module-tools input:hover{border-color:#cbd5e2!important}

/* Module page */
.module-view{gap:14px}.module-heading{align-items:center;gap:18px;margin-bottom:2px}.module-heading>div:first-child{min-width:260px}.module-tools{gap:8px;justify-content:flex-end}.module-kpi-strip{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.module-kpi-strip:empty{display:none!important}.module-kpi-strip>*{min-height:92px;padding:17px 18px!important;border:1px solid #e0e7f0!important;border-radius:13px!important;background:#fff!important;box-shadow:0 2px 8px rgba(16,39,74,.035)!important}.module-kpi-strip span,.module-kpi-strip small{color:#75849a!important;font-size:10px!important}.module-kpi-strip strong{font-size:21px!important;letter-spacing:-.03em!important;color:#11213e!important}.module-active-filters{min-height:32px;display:flex;align-items:center;gap:8px}.module-filter-chips{display:flex;gap:7px;flex-wrap:wrap}.module-filter-chips>*{border:1px solid #dbe4ef!important;background:#f8fbff!important;color:#47617f!important;border-radius:999px!important;font-size:10px!important}
.module-card{border:1px solid #dfe6ef;border-radius:14px;background:#fff;box-shadow:0 4px 18px rgba(19,42,76,.045);overflow:hidden}.table-scroll{border-radius:14px 14px 0 0}.data-table{min-width:840px;font-size:12px}.data-table th{background:#fbfcfe;border-bottom:1px solid #e4e9f0;color:#263953}.data-table th button{padding:12px 13px;font-size:11px}.data-table td{padding:12px 13px;border-bottom:1px solid #edf1f5;color:#33445e}.data-table tbody tr{transition:background .12s ease}.data-table tbody tr:hover{background:#f7faff}.data-table tbody tr:last-child td{border-bottom:0}.data-table .numeric{font-weight:650;color:#173968}.select-column input{accent-color:var(--blue)}.row-action-column .row-open{border:0;background:transparent;color:#4e6584;font-size:18px;box-shadow:none}.row-action-column .row-open:hover{background:#eef4ff;color:var(--blue)}
.module-pagination{min-height:50px;padding:8px 12px 8px 16px;border-top:1px solid #e8edf3;color:#607086;font-size:11px}.module-pagination .button,.module-pagination button{min-width:34px}.empty-state{padding:60px 30px;color:#7d8ba0;font-size:12px}.module-loading{padding:55px}
.status-badge{gap:5px;padding:5px 9px;border-radius:999px;font-size:10px;font-weight:700;background:#eef4ff;color:#1764d7}.status-badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.8}.status-badge.success{background:#eaf8f0;color:#138956}.status-badge.warning{background:#fff5df;color:#c47a0e}.status-badge.danger{background:#fff0f1;color:#d73d48}.muted-badge{background:#f1f4f8;color:#67768b}

/* Dashboard */
.wr-dashboard-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 14px}.wr-dashboard-kpis:empty{display:none}.wr-kpi-card{display:grid;grid-template-columns:44px 1fr;gap:13px;align-items:center;min-height:94px;padding:15px 17px;border:1px solid #dfe6ef;border-radius:13px;background:#fff;box-shadow:0 3px 12px rgba(19,42,76,.035)}.wr-kpi-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:#edf4ff;color:#1764e8;font-size:17px;font-weight:800}.wr-kpi-card:nth-child(2) .wr-kpi-icon{background:#eaf8f0;color:#139359}.wr-kpi-card:nth-child(3) .wr-kpi-icon{background:#fff4e5;color:#cf7810}.wr-kpi-card:nth-child(4) .wr-kpi-icon{background:#f3efff;color:#7455d8}.wr-kpi-label{display:block;color:#56677f;font-size:10px;font-weight:700}.wr-kpi-value{display:block;margin-top:3px;color:#10213e;font-size:20px;font-weight:780;letter-spacing:-.03em}.wr-kpi-note{display:block;margin-top:3px;color:#8190a3;font-size:9px}
.edit-toolbar{border-color:#dce5f0;border-radius:11px;box-shadow:var(--shadow-xs)}.dashboard-grid{gap:12px}.dashboard-widget{border-color:#dfe6ef;border-radius:14px;box-shadow:0 4px 16px rgba(21,44,79,.045);min-height:calc(var(--rows,3) * 68px)}.dashboard-widget:hover{border-color:#cfd9e6;box-shadow:0 12px 30px rgba(21,44,79,.09);transform:translateY(-1px)}.widget-header{min-height:53px;padding:0 15px;border-bottom:1px solid #edf1f5;background:#fff}.widget-icon{width:31px;height:31px;border-radius:9px;background:#edf4ff;color:#1764e8}.widget-title strong{font-size:12px;color:#1d2e49}.widget-title small{font-size:9px}.widget-content{padding:18px}.metric{font-size:27px;color:#10213e}.metric-sub{font-size:10px;line-height:1.55;color:#718097}.widget-footer{margin-top:16px;padding-top:11px;color:#8a97a9}.module-badge{background:#f5f8fc!important;border:1px solid #e7ecf2!important;color:#6e7d91!important}.dashboard-widget[data-widget-id="finance"],.dashboard-widget[data-widget-id="invoices"]{border-top:3px solid #f0a33a}.dashboard-widget[data-widget-id="stock"]{border-top:3px solid #35a66e}.dashboard-widget[data-widget-id="orders"]{border-top:3px solid #3477e8}.dashboard-widget[data-widget-id="pipeline"],.dashboard-widget[data-widget-id="tasks"]{border-top:3px solid #7d63d8}

/* Panels / reports */
.reports-overview-panel{gap:12px}.reports-overview-panel .module-card,.report-card,.enterprise-admin-card,.management-dashboard,.governance-collections,.governance-commissions,.governance-admin-tools{border-color:#dfe6ef!important;border-radius:14px!important;box-shadow:0 4px 16px rgba(21,44,79,.04)!important;background:#fff!important}.governance-row{border-color:#e1e7ef!important;border-radius:11px!important;background:#fff!important}.governance-aging span{background:#f7f9fc!important;border:1px solid #edf1f5}

/* Drawers / details */
.drawer{border-left:1px solid #dce4ee;box-shadow:-24px 0 70px rgba(11,30,59,.15);background:#fff}.drawer>header{padding:20px 22px;background:rgba(255,255,255,.98);border-bottom-color:#e7ecf2}.drawer h2{font-size:20px;color:#10213e}.drawer-content{padding:18px 22px}.drawer-actions{padding:13px 22px;border-top-color:#e5ebf2;box-shadow:0 -8px 24px rgba(15,31,61,.035)}.detail-hero,.customer-360-hero>div,.supplier-score-card,.credit-score-card,.margin-policy-card{border-color:#dfe6ef!important;border-radius:13px!important;box-shadow:var(--shadow-xs)}.detail-grid>div{border-bottom-color:#edf1f5}.detail-grid dt{color:#8190a2}.form-grid{gap:13px}.form-grid .field-label{color:#41536c;font-size:11px}.form-grid input,.form-grid select,.form-grid textarea{border-color:#dfe6ef;border-radius:9px;padding:10px 11px}.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus{border-color:#8cb4f4;box-shadow:var(--focus);outline:0}

/* Toasts: one clean notification, never a wall */
.toast-stack{right:20px!important;top:76px!important;gap:8px!important;max-width:min(360px,calc(100vw - 32px))!important}.toast-stack>*{border-radius:12px!important;border:1px solid #dfe6ef!important;box-shadow:0 14px 40px rgba(18,41,75,.13)!important;background:rgba(255,255,255,.98)!important}.toast-stack>*:nth-child(n+4){display:none!important}

/* Density tuned to retain hierarchy */
[data-density="compact"] .content{padding-top:19px}[data-density="compact"] .data-table td,[data-density="compact"] .data-table th button{padding-top:8px;padding-bottom:8px}[data-density="spacious"] .content{padding-top:30px}[data-density="spacious"] .data-table td,[data-density="spacious"] .data-table th button{padding-top:15px;padding-bottom:15px}

/* Responsive */
@media(max-width:1280px){.wr-dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.module-heading{align-items:flex-start;flex-direction:column}.module-tools{justify-content:flex-start;width:100%}.module-tools input{flex:1}}
@media(max-width:1000px){.app-shell{grid-template-columns:78px minmax(0,1fr)}.sidebar{padding-inline:10px}.brand-copy,.nav-label,.nav-item em,.sidebar-tool span:nth-child(2),.sidebar-tool kbd,.sidebar-footer,.nav-group-label{display:none}.sidebar-head{display:block}.sidebar-brand{justify-content:center;padding-inline:0}.sidebar-collapse{display:block;margin:0 auto 16px}.nav-item,.sidebar-tool{justify-content:center;padding-inline:0}.content{padding:22px 18px}.topbar{padding-inline:18px}}
@media(max-width:700px){.wr-dashboard-kpis{grid-template-columns:1fr}.content{padding:16px 12px 28px}.topbar{min-height:58px}.module-tools{display:grid;grid-template-columns:1fr 1fr}.module-tools>*{width:100%!important;min-width:0!important}.module-tools input{grid-column:1/-1}.module-kpi-strip{grid-template-columns:1fr 1fr}.data-table{min-width:760px}.drawer{width:100vw}.welcome-row{align-items:flex-start}.dashboard-actions{width:100%;justify-content:space-between}}
@media(max-width:480px){.module-tools{grid-template-columns:1fr}.module-tools input{grid-column:auto}.module-kpi-strip{grid-template-columns:1fr}.wr-kpi-card{min-height:84px}}
