/*
 * School ERP Enterprise Product Design System v1 (Upgraded to v320 Architecture)
 * Shared visual foundation for the authenticated ERP workspace.
 */

:root{
  --ui-navy:#091929;
  --ui-navy-2:#0d253c;
  --ui-blue:#1d4ed8;
  --ui-blue-hover:#1e40af;
  --ui-blue-soft:#eff6ff;
  --ui-page:#f3f6fb;
  --ui-surface:#ffffff;
  --ui-surface-soft:#f8fafc;
  --ui-border:#e2e8f0;
  --ui-border-strong:#cbd5e1;
  --ui-text:#0f172a;
  --ui-heading:#0f172a;
  --ui-muted:#64748b;
  --ui-subtle:#94a3b8;
  --ui-success:#059669;
  --ui-success-soft:#ecfdf5;
  --ui-warning:#d97706;
  --ui-warning-soft:#fffbeb;
  --ui-danger:#dc2626;
  --ui-danger-soft:#fef2f2;
  --ui-purple:#6d28d9;
  --ui-radius:14px;
  --ui-radius-sm:9px;
  --ui-shadow:0 2px 10px -1px rgba(15,23,42,.05),0 1px 3px rgba(15,23,42,.03);
  --ui-shadow-lg:0 20px 44px -8px rgba(15,23,42,.14),0 4px 12px -2px rgba(15,23,42,.06);
  --ui-focus:0 0 0 3px rgba(29,78,216,.16);
  --ui-sidebar-width:268px;
  --ui-sidebar-collapsed:76px;
  --ui-topbar-height:64px;
  --ws-text:var(--ui-text);
  --ws-heading:var(--ui-heading);
  --ws-muted:var(--ui-muted);
  --ws-accent:var(--ui-blue);
  --ws-accent-soft:var(--ui-blue-soft);
  --ws-primary-ink:#fff;
  --ws-surface:var(--ui-surface);
  --ws-border:var(--ui-border);
  --ws-border-soft:#edf2f7;
  --ws-hover:#f1f6fd;
  /* CRITICAL FIX: --ws-subtle is a surface token, never a dark slate #8796a5 text color */
  --ws-subtle:#f1f5f9;
  --ws-success:var(--ui-success);
  --ws-danger:var(--ui-danger);
  --ws-card-shadow:var(--ui-shadow);
  --ws-overlay-shadow:var(--ui-shadow-lg);
  --ws-sidebar:var(--ui-navy);
  --ws-sidebar-ink:#e2ecf5;
  --ws-nav-active:var(--ui-blue);
  --ws-nav-active-ink:#fff;
  --ws-header-bg:#fff;
  --ws-header-ink:var(--ui-text);
  --ws-banner-bg:#fff;
  --ws-banner-ink:var(--ui-text);
  --line:var(--ui-border);
  --text:var(--ui-text);
  --muted:var(--ui-muted);
  --blue:var(--ui-blue);
  --navy:var(--ui-navy);
  --erp-border:var(--ui-border);
  --erp-surface:var(--ui-surface);
  --erp-surface-soft:var(--ui-surface-soft);
  --erp-text:var(--ui-text);
  color-scheme:light;
}

html[data-erp-theme="dark"]{
  --ui-page:#0b1120;
  --ui-surface:#111c2d;
  --ui-surface-soft:#152236;
  --ui-border:#22344d;
  --ui-border-strong:#314866;
  --ui-text:#f1f5f9;
  --ui-heading:#f8fafc;
  --ui-muted:#94a3b8;
  --ui-subtle:#64748b;
  --ws-subtle:#1e293b;
  --ws-border-soft:#1a2940;
  --ws-hover:#1b2c44;
  --ui-blue-soft:rgba(59,130,246,.16);
  --ui-success-soft:rgba(16,185,129,.16);
  --ui-warning-soft:rgba(245,158,11,.16);
  --ui-danger-soft:rgba(239,68,68,.16);
  --ui-shadow:0 8px 24px rgba(0,0,0,.32);
  --ws-header-bg:#111c2d;
  color-scheme:dark;
}

html,body{max-width:100%;min-height:100%;overflow-x:hidden}
body.erp-workspace{margin:0;background:var(--ui-page)!important;color:var(--ui-text)!important;font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif!important;font-size:13.5px;line-height:1.55;text-rendering:optimizeLegibility}
body.erp-workspace *,body.erp-workspace *::before,body.erp-workspace *::after{box-sizing:border-box}
body.erp-workspace a{color:var(--ui-blue);text-decoration:none}
body.erp-workspace img{max-width:100%}
body.erp-workspace button,body.erp-workspace input,body.erp-workspace select,body.erp-workspace textarea{font:inherit}
body.erp-workspace :focus-visible{outline:2px solid var(--ui-blue)!important;outline-offset:2px}
body.erp-workspace [hidden]{display:none!important}

/* Application shell & Sidebar (Fixes Blue Circle 1: Brand Truncation & Visible Grey Scrollbar) */
body.erp-workspace .admin-shell.enterprise-shell{display:grid!important;grid-template-columns:var(--ui-sidebar-width) minmax(0,1fr)!important;width:100%!important;min-height:100vh!important;background:var(--ui-page)!important;transition:grid-template-columns .18s ease}
body.erp-workspace .admin-shell.enterprise-shell.sidebar-collapsed{grid-template-columns:var(--ui-sidebar-collapsed) minmax(0,1fr)!important}
body.erp-workspace .enterprise-sidebar{position:fixed!important;inset:0 auto 0 0!important;z-index:4100!important;display:flex!important;flex-direction:column!important;width:var(--ui-sidebar-width)!important;height:100dvh!important;padding:14px 12px!important;overflow:hidden!important;background:linear-gradient(180deg,#091929 0%,#0d253c 55%,#0a1e32 100%)!important;color:#e2ecf5!important;border-right:1px solid rgba(255,255,255,.08)!important;box-shadow:4px 0 24px rgba(3,12,24,.12)!important;transition:width .18s ease,transform .2s ease!important;scrollbar-width:none!important;-ms-overflow-style:none!important}
body.erp-workspace .enterprise-sidebar::-webkit-scrollbar{width:0!important;height:0!important;display:none!important}
body.erp-workspace .sidebar-collapsed .enterprise-sidebar{width:var(--ui-sidebar-collapsed)!important}
body.erp-workspace .enterprise-brand-row{flex:0 0 auto;padding:2px 4px 14px!important;margin-bottom:4px!important;border-bottom:1px solid rgba(255,255,255,.1)}
body.erp-workspace .enterprise-brand{display:flex!important;align-items:center!important;gap:11px!important;min-height:48px!important;padding:6px!important;border-radius:12px!important;color:#fff!important;overflow:hidden}
body.erp-workspace .enterprise-brand>b{display:grid!important;place-items:center!important;flex:0 0 40px!important;width:40px!important;height:40px!important;padding:4px!important;overflow:hidden!important;border-radius:11px!important;background:linear-gradient(135deg,#fff 0%,#eff6ff 100%)!important;color:var(--ui-blue)!important;font-size:13px!important;font-weight:850!important;box-shadow:0 4px 12px rgba(0,0,0,.2)!important}
body.erp-workspace .enterprise-brand>b img{width:100%!important;height:100%!important;object-fit:contain!important}
body.erp-workspace .enterprise-brand>span{display:grid!important;min-width:0!important;flex:1 1 auto!important;gap:2px!important;opacity:1;transition:opacity .12s ease}
body.erp-workspace .enterprise-brand strong{display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;color:#fff!important;font-size:13px!important;font-weight:800!important;line-height:1.25!important;letter-spacing:-.01em!important;white-space:normal!important;word-break:break-word!important}
body.erp-workspace .enterprise-brand small{overflow:hidden;color:rgba(226,236,245,.72)!important;font-size:11px!important;font-weight:500!important;text-overflow:ellipsis;white-space:nowrap}
body.erp-workspace .nav-section-label{margin:10px 10px 6px!important;color:rgba(226,236,245,.48)!important;font-size:12.5px!important;font-weight:800!important;letter-spacing:.12em!important}
body.erp-workspace .enterprise-nav,body.erp-workspace #enterpriseNav{display:flex!important;flex:1 1 auto!important;min-height:0!important;flex-direction:column!important;gap:4px!important;padding:2px 2px 18px!important;overflow-x:hidden!important;overflow-y:auto!important;scrollbar-width:none!important;-ms-overflow-style:none!important}
body.erp-workspace .enterprise-nav::-webkit-scrollbar,body.erp-workspace #enterpriseNav::-webkit-scrollbar{width:0!important;height:0!important;display:none!important;background:transparent!important}
body.erp-workspace .enterprise-nav-item,body.erp-workspace .enterprise-group-toggle{display:grid!important;grid-template-columns:28px minmax(0,1fr) auto!important;align-items:center!important;width:100%!important;min-height:40px!important;gap:9px!important;padding:8px 11px!important;border:1px solid transparent!important;border-radius:10px!important;background:transparent!important;color:rgba(235,243,250,.86)!important;text-align:left!important;cursor:pointer!important;box-shadow:none!important;transition:background-color .15s ease,color .15s ease!important}
body.erp-workspace .enterprise-nav-item i,body.erp-workspace .enterprise-group-toggle i{display:grid!important;place-items:center!important;width:24px!important;height:24px!important;color:inherit!important;font-style:normal!important}
body.erp-workspace .enterprise-nav-item .erp-icon,body.erp-workspace .enterprise-group-toggle .erp-icon{width:18px!important;height:18px!important}
body.erp-workspace .enterprise-nav-item span,body.erp-workspace .enterprise-group-toggle span{overflow:hidden!important;font-size:13px!important;font-weight:600!important;text-overflow:ellipsis!important;white-space:nowrap!important}
body.erp-workspace .enterprise-nav-item:hover,body.erp-workspace .enterprise-group-toggle:hover{background:rgba(255,255,255,.08)!important;color:#fff!important}
body.erp-workspace .enterprise-nav-item.active,body.erp-workspace .enterprise-nav-group.active-group>.enterprise-group-toggle{background:linear-gradient(135deg,#2563eb 0%,#1d4ed8 100%)!important;color:#fff!important;border-color:rgba(255,255,255,.16)!important;box-shadow:0 4px 14px rgba(29,78,216,.35)!important}
body.erp-workspace .enterprise-group-toggle>b{font-size:17px!important;font-weight:500!important;line-height:1!important;transition:transform .15s ease}
body.erp-workspace .enterprise-nav-group.open>.enterprise-group-toggle>b{transform:rotate(90deg)}
body.erp-workspace .enterprise-flyout{display:none!important;margin:4px 0 6px 18px!important;padding:4px 0 4px 12px!important;border-left:1.5px solid rgba(255,255,255,.16)!important;background:transparent!important;box-shadow:none!important}
body.erp-workspace .enterprise-nav-group.open>.enterprise-flyout,body.erp-workspace .enterprise-nav-group.search-open>.enterprise-flyout{display:grid!important;gap:2px!important}
body.erp-workspace .enterprise-flyout .flyout-title{display:none!important}
body.erp-workspace .enterprise-flyout>a{display:flex!important;align-items:center!important;min-height:34px!important;padding:6px 11px!important;border-radius:8px!important;color:rgba(226,236,245,.76)!important;font-size:12.5px!important;font-weight:550!important}
body.erp-workspace .enterprise-flyout>a:hover{background:#f1f5f9!important;color:#0f172a!important}
body.erp-workspace .enterprise-flyout>a.active{background:#e0f2fe!important;color:#0284c7!important;font-weight:700!important}
body.erp-workspace .enterprise-nav-badge{display:grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--ui-danger);color:#fff;font-size:12.5px;font-style:normal;font-weight:800}
body.erp-workspace .sidebar-collapsed .enterprise-brand>span,body.erp-workspace .sidebar-collapsed .nav-section-label,body.erp-workspace .sidebar-collapsed .enterprise-nav-item>span,body.erp-workspace .sidebar-collapsed .enterprise-group-toggle>span,body.erp-workspace .sidebar-collapsed .enterprise-group-toggle>b,body.erp-workspace .sidebar-collapsed .enterprise-nav-badge{position:absolute!important;opacity:0!important;pointer-events:none!important}
body.erp-workspace .sidebar-collapsed .enterprise-nav-item,body.erp-workspace .sidebar-collapsed .enterprise-group-toggle{display:grid!important;grid-template-columns:1fr!important;justify-items:center!important;padding:8px!important}
body.erp-workspace .sidebar-collapsed .enterprise-flyout{display:none!important}

/* Topbar & Branch Scope Trigger (Fixes Blue Circle 2: Branch Name Truncation) */
body.erp-workspace .enterprise-main{grid-column:2!important;min-width:0!important;width:auto!important;margin:0!important;padding:calc(var(--ui-topbar-height) + 22px) clamp(20px,2.4vw,34px) 44px!important;background:var(--ui-page)!important;overflow:visible!important}
body.erp-workspace .enterprise-topbar{position:fixed!important;inset:0 0 auto var(--ui-sidebar-width)!important;z-index:4000!important;display:flex!important;align-items:center!important;gap:12px!important;height:var(--ui-topbar-height)!important;margin:0!important;padding:0 24px!important;border:0!important;border-bottom:1px solid var(--ui-border)!important;background:var(--ws-header-bg,#fff)!important;color:var(--ws-header-ink,var(--ui-text))!important;box-shadow:0 1px 3px rgba(15,23,42,.04)!important;transition:left .18s ease!important}
body.erp-workspace .sidebar-collapsed .enterprise-topbar{left:var(--ui-sidebar-collapsed)!important}
body.erp-workspace .topbar-menu{display:grid!important;place-content:center!important;gap:4px!important;flex:0 0 38px!important;width:38px!important;height:38px!important;padding:0!important;border:1px solid var(--ui-border)!important;border-radius:10px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;cursor:pointer!important}
body.erp-workspace .topbar-menu span{display:block!important;width:16px!important;height:1.8px!important;border-radius:2px!important;background:currentColor!important}
body.erp-workspace .topbar-search{position:relative!important;display:flex!important;align-items:center!important;flex:0 1 390px!important;min-width:220px!important;height:40px!important;border:1px solid var(--ui-border)!important;border-radius:10px!important;background:var(--ui-surface-soft)!important;overflow:hidden!important}
body.erp-workspace .topbar-search:focus-within{border-color:var(--ui-blue)!important;background:var(--ui-surface)!important;box-shadow:var(--ui-focus)!important}
body.erp-workspace .topbar-search>i{display:grid!important;place-items:center!important;flex:0 0 36px!important;color:var(--ui-muted)!important}
body.erp-workspace .topbar-search>i .erp-icon{width:15px!important;height:15px!important}
body.erp-workspace .topbar-search input{min-width:0!important;flex:1!important;height:38px!important;padding:0 10px!important;border:0!important;outline:0!important;background:transparent!important;color:var(--ui-text)!important;font-size:13px!important;box-shadow:none!important}
body.erp-workspace .topbar-search kbd{padding:2px 6px;border:1px solid var(--ui-border);border-radius:5px;background:var(--ui-surface);color:var(--ui-muted);font:11px/1.2 inherit}
body.erp-workspace .topbar-command-trigger{align-self:center;height:26px;padding:0 8px;margin-right:6px;border:1px solid var(--ui-border);border-radius:6px;background:var(--ui-surface);color:var(--ui-muted);font-size:11px;font-weight:700;cursor:pointer}
body.erp-workspace .topbar-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;min-width:0!important;margin-left:auto!important}
body.erp-workspace .topbar-icon-link,body.erp-workspace .topbar-theme-trigger{position:relative!important;display:grid!important;place-items:center!important;flex:0 0 38px!important;width:38px!important;height:38px!important;padding:0!important;border:1px solid var(--ui-border)!important;border-radius:10px!important;background:var(--ui-surface)!important;color:var(--ws-header-ink,var(--ui-text))!important;font-size:15px!important;cursor:pointer!important;box-shadow:none!important}
body.erp-workspace .topbar-icon-link:hover,body.erp-workspace .topbar-theme-trigger:hover{border-color:var(--ui-blue)!important;background:var(--ui-blue-soft)!important;color:var(--ui-blue)!important}
body.erp-workspace .topbar-theme-trigger .theme-icon{display:grid!important;place-items:center!important;position:absolute!important;inset:0!important}
body.erp-workspace .topbar-theme-trigger .theme-icon .erp-icon{width:17px!important;height:17px!important}
body.erp-workspace .theme-icon-moon{display:none!important}
html[data-erp-theme="dark"] body.erp-workspace .theme-icon-sun{display:none!important}
html[data-erp-theme="dark"] body.erp-workspace .theme-icon-moon{display:grid!important}
body.erp-workspace .topbar-badge{position:absolute;top:-3px;right:-3px;display:grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border:2px solid var(--ws-header-bg,#fff);border-radius:999px;background:var(--ui-danger);color:#fff;font-size:12.5px;font-weight:800}

/* Generous width for .branch-scope-trigger so full school names never truncate prematurely */
body.erp-workspace .branch-scope-trigger{display:flex!important;align-items:center!important;gap:9px!important;max-width:340px!important;width:auto!important;min-height:40px!important;margin:0 4px!important;padding:5px 14px!important;border:1px solid var(--ui-border)!important;border-radius:10px!important;background:var(--ui-surface-soft)!important;color:var(--ws-header-ink,var(--ui-text))!important;cursor:pointer!important;transition:border-color .15s ease,background .15s ease!important}
body.erp-workspace .branch-scope-trigger:hover{border-color:var(--ui-blue)!important;background:var(--ui-blue-soft)!important}
body.erp-workspace .branch-scope-trigger>span:last-child{display:grid;min-width:0;text-align:left}
body.erp-workspace .branch-scope-trigger small{color:var(--ui-muted)!important;font-size:12.5px!important;font-weight:700!important;letter-spacing:.04em!important;text-transform:uppercase}
body.erp-workspace .branch-scope-trigger b{max-width:280px!important;overflow:hidden;color:inherit!important;font-size:12.5px!important;font-weight:750!important;text-overflow:ellipsis;white-space:nowrap}
body.erp-workspace .branch-scope-icon{color:var(--ui-blue);font-size:15px;display:grid;place-items:center}

body.erp-workspace .account-menu{position:relative!important;margin-left:4px!important}
body.erp-workspace .account-trigger{display:flex!important;align-items:center!important;gap:9px!important;min-height:40px!important;padding:4px 10px 4px 5px!important;border:1px solid var(--ui-border)!important;border-radius:11px!important;background:var(--ui-surface)!important;color:var(--ws-header-ink,var(--ui-text))!important;cursor:pointer!important}
body.erp-workspace .account-trigger:hover{background:var(--ui-surface-soft)!important;border-color:var(--ui-border-strong)!important}
body.erp-workspace .account-avatar{display:grid!important;place-items:center!important;flex:0 0 32px!important;width:32px!important;height:32px!important;border-radius:9px!important;background:var(--ui-blue-soft)!important;color:var(--ui-blue)!important;font-size:12px!important;font-weight:800!important}
body.erp-workspace .account-copy{display:grid;min-width:0;text-align:left}
body.erp-workspace .account-copy b{max-width:165px;overflow:hidden;color:inherit!important;font-size:12.5px!important;font-weight:700!important;text-overflow:ellipsis;white-space:nowrap}
body.erp-workspace .account-copy small{color:var(--ui-muted)!important;font-size:11px!important}
body.erp-workspace .account-caret{display:grid;place-items:center;color:var(--ui-muted)}
body.erp-workspace .account-dropdown{position:absolute!important;top:calc(100% + 8px)!important;right:0!important;z-index:5200!important;width:280px!important;padding:8px!important;border:1px solid var(--ui-border)!important;border-radius:14px!important;background:var(--ui-surface)!important;box-shadow:var(--ui-shadow-lg)!important}
body.erp-workspace .account-dropdown-head{display:flex;align-items:center;gap:10px;padding:10px}
body.erp-workspace .account-dropdown-head strong,body.erp-workspace .account-dropdown-head small{display:block}
body.erp-workspace .account-dropdown-head strong{font-size:13px;color:var(--ui-heading)}
body.erp-workspace .account-dropdown-head small{margin-top:2px;color:var(--ui-muted);font-size:11.5px;overflow-wrap:anywhere}
body.erp-workspace .account-dropdown>a{display:flex;align-items:center;gap:10px;min-height:38px;padding:8px 10px;border-radius:8px;color:var(--ui-text);font-size:13px;font-weight:600}
body.erp-workspace .account-dropdown>a:hover{background:var(--ui-surface-soft)}
body.erp-workspace .account-dropdown>a.logout-link{color:var(--ui-danger)}
body.erp-workspace .account-dropdown i{width:18px;color:var(--ui-muted);font-style:normal;text-align:center}
body.erp-workspace .account-separator{height:1px;margin:6px;background:var(--ui-border)}

/* Page structure and typography */
body.erp-workspace .enterprise-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:0 0 18px;padding:0 2px}
body.erp-workspace.has-local-page-header .enterprise-page-head{display:none!important}
body.erp-workspace .enterprise-page-head h1{margin:0;color:var(--ui-heading)!important;font-size:25px!important;font-weight:800!important;letter-spacing:-.025em!important;line-height:1.2!important}
body.erp-workspace .enterprise-breadcrumb{display:none!important}
body.erp-workspace :is(h1,h2,h3,h4){color:var(--ui-heading);font-weight:750;letter-spacing:-.015em}
body.erp-workspace h1{font-size:25px}
body.erp-workspace h2{font-size:20px}
body.erp-workspace h3{font-size:16px}
body.erp-workspace .eyebrow{display:block!important;margin:0 0 5px!important;color:var(--ui-blue)!important;font-size:11px!important;font-weight:800!important;letter-spacing:.11em!important;line-height:1.35!important;text-transform:uppercase!important}
body.erp-workspace .muted{color:var(--ui-muted)!important}
body.erp-workspace :is(.module-hero,.workspace-hero,.config-hero,.erp-page-hero,.payroll-page-hero,.payroll-process-hero,.procurement-page-hero,.governance-page-hero,.settings-hero,.license-page-hero,.dashboard-hero){display:flex!important;align-items:center!important;justify-content:space-between!important;gap:18px!important;min-height:0!important;margin:0 0 18px!important;padding:18px 22px!important;border:1px solid var(--ui-border)!important;border-radius:var(--ui-radius)!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;box-shadow:var(--ui-shadow)!important}
body.erp-workspace :is(.module-hero,.workspace-hero,.config-hero,.erp-page-hero,.payroll-page-hero,.payroll-process-hero,.procurement-page-hero,.governance-page-hero,.settings-hero,.license-page-hero,.dashboard-hero)::before,body.erp-workspace :is(.module-hero,.workspace-hero,.config-hero,.erp-page-hero,.payroll-page-hero,.payroll-process-hero,.procurement-page-hero,.governance-page-hero,.settings-hero,.license-page-hero,.dashboard-hero)::after{display:none!important}
body.erp-workspace :is(.module-hero,.workspace-hero,.config-hero,.erp-page-hero,.payroll-page-hero,.payroll-process-hero,.procurement-page-hero,.governance-page-hero,.settings-hero,.license-page-hero,.dashboard-hero) :is(h1,h2,h3){margin:2px 0 5px!important;color:var(--ui-heading)!important;font-size:22px!important;line-height:1.25!important}
body.erp-workspace :is(.module-hero,.workspace-hero,.config-hero,.erp-page-hero,.payroll-page-hero,.payroll-process-hero,.procurement-page-hero,.governance-page-hero,.settings-hero,.license-page-hero,.dashboard-hero) p{max-width:820px!important;margin:0!important;color:var(--ui-muted)!important;font-size:13px!important;line-height:1.5!important}
body.erp-workspace :is(.module-hero,.workspace-hero,.config-hero,.erp-page-hero,.payroll-page-hero,.payroll-process-hero,.procurement-page-hero,.governance-page-hero,.settings-hero,.license-page-hero,.dashboard-hero) .eyebrow{color:var(--ui-blue)!important}

/* Surfaces and layout */
body.erp-workspace :is(.panel,.compact-card,.user-card,.role-card,.doc-admin-card,.workspace-panel,.enterprise-record-card,.record-card,.td-card,.pd-card){min-width:0;border:1px solid var(--ui-border)!important;border-radius:var(--ui-radius)!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;box-shadow:var(--ui-shadow)!important}
body.erp-workspace .panel{margin:0 0 18px!important;padding:20px 22px!important;overflow:visible!important}
body.erp-workspace :is(.compact-card,.role-card,.doc-admin-card,.enterprise-record-card,.record-card){padding:16px 18px!important}
body.erp-workspace .panel-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;min-width:0!important;margin:0 0 16px!important}
body.erp-workspace .panel-head>div{min-width:0}
body.erp-workspace .panel-head :is(h1,h2,h3){margin:2px 0 4px!important;line-height:1.3!important}
body.erp-workspace .panel-head h2{font-size:18px!important}
body.erp-workspace .panel-head h3{font-size:16px!important}
body.erp-workspace .panel-head p{margin:0!important;color:var(--ui-muted)!important;font-size:12.5px!important;line-height:1.5!important}
body.erp-workspace :is(.split,.dashboard-grid,.settings-grid,.users-layout,.config-workspace){display:grid;gap:16px;min-width:0}
body.erp-workspace .split{grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr)}
body.erp-workspace :is(.grid2,.grid3,.grid4){display:grid!important;gap:14px!important;min-width:0!important}
body.erp-workspace .grid2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.erp-workspace .grid3{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.erp-workspace .grid4{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.erp-workspace :is(.cards,.metric-grid,.stats-grid,.kpi-grid){display:grid!important;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;gap:14px!important;margin:0 0 18px!important}
body.erp-workspace :is(.stat,.metric-card,.payroll-stat,.hero-kpi){min-width:0!important;min-height:96px!important;padding:16px 18px!important;border:1px solid var(--ui-border)!important;border-radius:13px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;box-shadow:var(--ui-shadow)!important}
body.erp-workspace :is(.stat,.metric-card,.payroll-stat,.hero-kpi) strong{color:var(--ui-heading)!important;font-size:24px!important;font-weight:800!important;line-height:1.2!important}
body.erp-workspace :is(.stat,.metric-card,.payroll-stat,.hero-kpi) :is(small,span,em){color:var(--ui-muted)!important;font-size:12px!important;font-weight:600!important;font-style:normal!important}
body.erp-workspace :is(.metric-icon,.fee-kpi-symbol,.workflow-icon){display:grid!important;place-items:center!important;flex:0 0 40px!important;width:40px!important;height:40px!important;border-radius:11px!important;background:var(--ui-blue-soft)!important;color:var(--ui-blue)!important}
body.erp-workspace :is(.metric-icon,.fee-kpi-symbol,.workflow-icon) .erp-icon{width:19px!important;height:19px!important}

/* Forms and filter toolbars */
body.erp-workspace .editor,body.erp-workspace .editor form{min-width:0}
body.erp-workspace .editor label,body.erp-workspace form>label,body.erp-workspace .report-field{min-width:0}
body.erp-workspace :is(.editor label,.field,label.report-field,.workflow-field-grid label){color:var(--ui-text);font-size:12px;font-weight:650}
body.erp-workspace :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea){max-width:100%;min-height:40px;padding:8px 12px;border:1px solid var(--ui-border-strong);border-radius:var(--ui-radius-sm);background:var(--ui-surface);color:var(--ui-text);font-size:13px;line-height:1.4;box-shadow:none;transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}
body.erp-workspace textarea{min-height:86px;resize:vertical}
body.erp-workspace :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea):hover{border-color:#94a3b8}
body.erp-workspace :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea):focus{border-color:var(--ui-blue)!important;outline:0!important;box-shadow:var(--ui-focus)!important}
body.erp-workspace :is(input,textarea)::placeholder{color:#94a3b8;opacity:1}
body.erp-workspace input[type=checkbox],body.erp-workspace input[type=radio]{accent-color:var(--ui-blue)}
body.erp-workspace input[type=file]{max-width:100%;font-size:12px}
body.erp-workspace .ui-invalid,body.erp-workspace :is(input,select,textarea)[aria-invalid=true]{border-color:var(--ui-danger)!important;box-shadow:0 0 0 3px rgba(220,38,38,.12)!important}
body.erp-workspace :is(.filters,.toolbar,.toolbar-row,.filter-bar,.search-inline,.fee-toolbar-inline,.staff-list-toolbar,.enterprise-filter-toolbar,.ws-filter-toolbar,.payroll-filter-bar form){display:flex!important;align-items:flex-end!important;gap:10px!important;min-width:0!important;flex-wrap:wrap!important}
body.erp-workspace :is(.filters,.filter-bar,.enterprise-filter-toolbar,.ws-filter-toolbar){margin:0 0 16px!important;padding:14px!important;border:1px solid var(--ui-border)!important;border-radius:12px!important;background:var(--ui-surface)!important}
body.erp-workspace :is(.filters,.filter-bar,.enterprise-filter-toolbar,.ws-filter-toolbar)>label{display:grid!important;flex:1 1 160px!important;min-width:130px!important;gap:6px!important;margin:0!important;color:var(--ui-text)!important;font-size:12px!important;font-weight:650!important}
body.erp-workspace :is(.filters,.filter-bar,.enterprise-filter-toolbar,.ws-filter-toolbar)>label :is(input,select){width:100%!important}
body.erp-workspace .fee-search-field,body.erp-workspace .academic-search,body.erp-workspace .staff-search-wrap{position:relative}

/* Buttons and actions */
body.erp-workspace .btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;min-height:38px!important;padding:8px 14px!important;border:1px solid var(--ui-border-strong)!important;border-radius:9px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;font-size:12.5px!important;font-weight:650!important;line-height:1.25!important;text-decoration:none!important;white-space:nowrap!important;cursor:pointer!important;box-shadow:0 1px 2px rgba(15,23,42,.03)!important;transition:all .15s ease!important}
body.erp-workspace .btn:hover{border-color:var(--ui-blue)!important;background:var(--ui-surface-soft)!important;color:var(--ui-blue)!important}
body.erp-workspace .btn:active{transform:translateY(1px)}
body.erp-workspace .btn.primary{border-color:var(--ui-blue)!important;background:linear-gradient(180deg,#2563eb 0%,var(--ui-blue) 100%)!important;color:#fff!important;box-shadow:0 2px 8px rgba(29,78,216,.22)!important}
body.erp-workspace .btn.primary:hover{border-color:var(--ui-blue-hover)!important;background:var(--ui-blue-hover)!important;color:#fff!important}
body.erp-workspace .btn.danger,body.erp-workspace .btn.danger-outline{border-color:rgba(220,38,38,.3)!important;background:var(--ui-danger-soft)!important;color:var(--ui-danger)!important}
body.erp-workspace .btn.success{border-color:rgba(5,150,105,.3)!important;background:var(--ui-success-soft)!important;color:var(--ui-success)!important}
body.erp-workspace .btn.compact{min-height:32px!important;padding:5px 11px!important;font-size:11.5px!important}
body.erp-workspace .btn .erp-icon{width:15px!important;height:15px!important}
body.erp-workspace .btn:disabled,body.erp-workspace .btn[aria-disabled=true]{opacity:.5;cursor:not-allowed;transform:none}
body.erp-workspace :is(.row-actions,.form-actions,.record-actions,.table-actions,.workspace-actions){display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important}

/* Tables */
body.erp-workspace .table-wrap{width:100%!important;max-width:100%!important;overflow:auto!important;border:1px solid var(--ui-border)!important;border-radius:12px!important;background:var(--ui-surface)!important;scrollbar-width:thin}
body.erp-workspace .table-wrap>table{border:0!important}
body.erp-workspace table{width:100%;border-collapse:separate!important;border-spacing:0!important;background:var(--ui-surface)!important;color:var(--ui-text)!important}
body.erp-workspace table th{padding:12px 14px!important;border:0!important;border-bottom:1px solid var(--ui-border)!important;background:var(--ui-surface-soft)!important;color:var(--ui-muted)!important;font-size:11px!important;font-weight:750!important;letter-spacing:.055em!important;line-height:1.35!important;text-align:left!important;text-transform:uppercase!important;white-space:nowrap!important}
html[data-erp-theme="dark"] body.erp-workspace table th{background:#152236!important}
body.erp-workspace table td{padding:12px 14px!important;border:0!important;border-bottom:1px solid var(--ws-border-soft)!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;font-size:13px!important;line-height:1.45!important;vertical-align:middle!important}
html[data-erp-theme="dark"] body.erp-workspace table td{border-bottom-color:#1a2940!important;color:var(--ui-text)!important}
body.erp-workspace table tbody tr:last-child td{border-bottom:0!important}
body.erp-workspace table tbody tr:hover td{background:var(--ws-hover)!important}
html[data-erp-theme="dark"] body.erp-workspace table tbody tr:hover td{background:#1b2c44!important}
body.erp-workspace table td :is(b,strong){color:var(--ui-heading);font-weight:650}
body.erp-workspace table td small{display:block;margin-top:2px;color:var(--ui-muted);font-size:11.5px}
body.erp-workspace table tfoot :is(th,td){background:var(--ui-surface-soft)!important;font-weight:750!important}
body.erp-workspace .table-wrap thead th{position:sticky;top:0;z-index:3}
body.erp-workspace .fee-table-footer,body.erp-workspace .table-footer,body.erp-workspace .pagination-row{display:flex;align-items:center;gap:10px;justify-content:flex-start;padding:12px 2px 0;color:var(--ui-muted);font-size:12px}
body.erp-workspace .fee-pagination,body.erp-workspace .pagination{display:flex;align-items:center;gap:6px;margin-left:auto}

/* Status, alerts and feedback */
body.erp-workspace :is(.badge,.status-badge,.status-pill,.fee-status-pill,.scope-chip){display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;width:max-content!important;max-width:100%!important;min-height:24px!important;padding:4px 10px!important;border:1px solid var(--ui-border)!important;border-radius:999px!important;background:var(--ui-surface-soft)!important;color:var(--ui-text)!important;font-size:11px!important;font-weight:700!important;line-height:1.25!important;white-space:nowrap!important}
body.erp-workspace :is(.badge,.status-badge,.status-pill).success,body.erp-workspace :is(.badge,.status-badge,.status-pill).active,body.erp-workspace .fee-status-pill.paid,body.erp-workspace .badge.approved{border-color:rgba(5,150,105,.25)!important;background:var(--ui-success-soft)!important;color:var(--ui-success)!important}
body.erp-workspace :is(.badge,.status-badge,.status-pill).pending,body.erp-workspace :is(.badge,.status-badge,.status-pill).warning,body.erp-workspace .fee-status-pill.pending{border-color:rgba(217,119,6,.25)!important;background:var(--ui-warning-soft)!important;color:var(--ui-warning)!important}
body.erp-workspace :is(.badge,.status-badge,.status-pill).danger,body.erp-workspace :is(.badge,.status-badge,.status-pill).inactive,body.erp-workspace :is(.badge,.status-badge,.status-pill).disabled,body.erp-workspace .badge.rejected{border-color:rgba(220,38,38,.25)!important;background:var(--ui-danger-soft)!important;color:var(--ui-danger)!important}
body.erp-workspace .alert{display:flex;align-items:flex-start;gap:10px;margin:0 0 16px!important;padding:12px 15px!important;border:1px solid rgba(29,78,216,.2)!important;border-radius:11px!important;background:var(--ui-blue-soft)!important;color:var(--ui-text)!important;font-size:13px!important;line-height:1.5!important}
body.erp-workspace .alert.success{border-color:rgba(5,150,105,.25)!important;background:var(--ui-success-soft)!important;color:var(--ui-success)!important}
body.erp-workspace .alert.danger{border-color:rgba(220,38,38,.25)!important;background:var(--ui-danger-soft)!important;color:var(--ui-danger)!important}
body.erp-workspace :is(.attendance-note,.info-note,.warning-note,.branch-scope-note,.admin-scope-banner,.fees-scope-banner,.payroll-scope-banner){padding:12px 15px!important;border:1px solid var(--ui-border)!important;border-radius:11px!important;background:var(--ui-surface-soft)!important;color:var(--ui-muted)!important;font-size:12.5px!important;box-shadow:none!important}
body.erp-workspace :is(.empty-state,.fee-empty-state,.td-empty-state,.workflow-empty,.empty-admin){display:grid!important;place-items:center!important;align-content:center!important;min-height:150px!important;padding:28px!important;border:1px dashed var(--ui-border-strong)!important;border-radius:12px!important;background:var(--ui-surface-soft)!important;color:var(--ui-muted)!important;text-align:center!important}
body.erp-workspace :is(.empty-state,.fee-empty-state,.td-empty-state,.workflow-empty) :is(h2,h3,b,strong){margin:8px 0 4px!important;color:var(--ui-heading)!important;font-size:15px!important}
body.erp-workspace :is(.empty-state,.fee-empty-state,.td-empty-state,.workflow-empty) p{max-width:480px;margin:0;color:var(--ui-muted);font-size:12.5px}

/* Tabs, details and navigation inside workspaces */
body.erp-workspace :is(.workspace-tabs,.tabs,.tab-list){display:flex!important;align-items:center!important;gap:5px!important;max-width:100%!important;margin:0 0 16px!important;padding:5px!important;overflow-x:auto!important;border:1px solid var(--ui-border)!important;border-radius:11px!important;background:var(--ui-surface-soft)!important}
body.erp-workspace :is(.workspace-tabs,.tabs,.tab-list)>a,body.erp-workspace :is(.workspace-tabs,.tabs,.tab-list)>button{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:36px!important;padding:7px 13px!important;border:0!important;border-radius:8px!important;background:transparent!important;color:var(--ui-muted)!important;font-size:12.5px!important;font-weight:650!important;white-space:nowrap!important}
body.erp-workspace :is(.workspace-tabs,.tabs,.tab-list)>:is(.active,[aria-selected=true]){background:var(--ui-surface)!important;color:var(--ui-blue)!important;box-shadow:0 1px 4px rgba(15,23,42,.08)!important}
body.erp-workspace details.user-card{margin:0 0 12px!important;padding:0!important;overflow:hidden!important}
body.erp-workspace details.user-card>summary{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;min-height:56px!important;padding:13px 16px!important;cursor:pointer!important;list-style:none!important}
body.erp-workspace details.user-card>summary::-webkit-details-marker{display:none}
body.erp-workspace details.user-card[open]>summary{margin:0!important;border-bottom:1px solid var(--ui-border)!important;background:var(--ui-surface-soft)!important}
body.erp-workspace details.user-card>.profile-body{margin:0!important;padding:18px!important;border:0!important}
body.erp-workspace .config-sidebar{padding:8px!important;border:1px solid var(--ui-border)!important;border-radius:12px!important;background:var(--ui-surface)!important;box-shadow:var(--ui-shadow)!important}
body.erp-workspace .config-nav-item{display:grid!important;gap:3px!important;min-height:50px!important;padding:10px 12px!important;border:1px solid transparent!important;border-radius:9px!important;color:var(--ui-text)!important}
body.erp-workspace .config-nav-item:hover{background:var(--ui-surface-soft)!important}
body.erp-workspace .config-nav-item.active{border-color:rgba(29,78,216,.25)!important;background:var(--ui-blue-soft)!important;color:var(--ui-blue)!important}
body.erp-workspace .config-nav-item span{font-size:12.5px;font-weight:700}
body.erp-workspace .config-nav-item small{color:var(--ui-muted);font-size:11px}

/* Searchable module workspaces */
body.erp-workspace .ws-module-workspace{display:grid!important;grid-template-columns:minmax(220px,245px) minmax(0,1fr)!important;gap:18px!important;align-items:start!important;min-width:0!important;margin:0 0 20px!important}
body.erp-workspace .ws-module-aside{position:sticky!important;top:calc(var(--ui-topbar-height) + 18px)!important;min-width:0!important}
body.erp-workspace .ws-module-aside-head{display:grid!important;gap:3px!important;padding:4px 8px 12px!important;border-bottom:1px solid var(--ui-border)!important}
body.erp-workspace .ws-module-aside-head span{color:var(--ui-muted)!important;font-size:12.5px!important;font-weight:800!important;letter-spacing:.1em!important;text-transform:uppercase!important}
body.erp-workspace .ws-module-aside-head b{color:var(--ui-heading)!important;font-size:15px!important}
body.erp-workspace .ws-module-search{display:flex!important;align-items:center!important;gap:8px!important;height:38px!important;margin:10px 0 8px!important;padding:0 10px!important;overflow:hidden!important;border:1px solid var(--ui-border)!important;border-radius:9px!important;background:var(--ui-surface)!important;color:var(--ui-muted)!important}
body.erp-workspace .ws-module-search:focus-within{border-color:var(--ui-blue)!important;box-shadow:var(--ui-focus)!important}
body.erp-workspace .ws-module-search input{flex:1 1 auto!important;width:auto!important;min-width:0!important;height:36px!important;min-height:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;outline:0!important;font-size:12.5px!important}
body.erp-workspace .ws-module-nav{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:5px!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important}
body.erp-workspace .ws-module-nav>a{display:flex!important;align-items:center!important;gap:10px!important;min-height:44px!important;padding:8px 11px!important;border:1px solid transparent!important;border-radius:9px!important;color:var(--ui-text)!important;font-size:12.5px!important;font-weight:650!important}
body.erp-workspace .ws-module-nav>a:hover{border-color:var(--ui-border)!important;background:var(--ui-surface-soft)!important}
body.erp-workspace .ws-module-nav>a.active{border-color:rgba(29,78,216,.25)!important;background:var(--ui-blue-soft)!important;box-shadow:inset 3px 0 0 var(--ui-blue)!important;color:var(--ui-blue)!important}
body.erp-workspace .ws-module-nav-icon{display:grid!important;place-items:center!important;flex:0 0 32px!important;width:32px!important;height:32px!important;border:1px solid var(--ui-border)!important;border-radius:8px!important;background:var(--ui-surface)!important;color:var(--ui-blue)!important}
body.erp-workspace .ws-module-nav-icon svg{width:15px!important;height:15px!important}
body.erp-workspace .ws-module-nav-label{min-width:0!important;flex:1!important}
body.erp-workspace .ws-module-nav-label :is(b,small){display:block!important}
body.erp-workspace .ws-module-nav-label small{margin-top:2px;color:var(--ui-muted)!important;font-size:11px!important;font-weight:500!important}
body.erp-workspace .ws-module-nav>a :is(.soft-count,em){margin-left:auto;padding:2px 8px;border:1px solid rgba(5,150,105,.25);border-radius:999px;background:var(--ui-success-soft);color:var(--ui-success);font-size:11px;font-style:normal;font-weight:700}
body.erp-workspace .ws-module-content{min-width:0!important;width:100%!important}
body.erp-workspace .ws-module-content>:first-child{margin-top:0!important}
body.erp-workspace .ws-module-nav-empty{padding:12px;color:var(--ui-muted);font-size:12px}

/* Saved views */
body.erp-workspace .ws-views-trigger{margin-left:auto!important}
body.erp-workspace .ws-views-count{padding:2px 6px;border-radius:999px;background:var(--ui-blue-soft);color:var(--ui-blue);font-size:12.5px}
body.erp-workspace .ws-views-popup{position:fixed;z-index:6500;overflow:auto;padding:14px;border:1px solid var(--ui-border);border-radius:13px;background:var(--ui-surface);color:var(--ui-text);box-shadow:var(--ui-shadow-lg);font-size:12.5px}
body.erp-workspace .ws-views-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
body.erp-workspace .ws-views-close{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--ui-muted);font-size:19px;cursor:pointer}
body.erp-workspace .ws-views-list{max-height:230px;overflow:auto}
body.erp-workspace .ws-views-row{display:flex;align-items:center;border-radius:7px}
body.erp-workspace .ws-views-row:hover{background:var(--ui-surface-soft)}
body.erp-workspace .ws-views-load{flex:1;min-width:0;padding:9px 8px;border:0;background:transparent;color:var(--ui-text);font-size:12.5px;text-align:left;cursor:pointer}
body.erp-workspace .ws-views-remove{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:6px;background:transparent;color:var(--ui-muted);cursor:pointer}
body.erp-workspace .ws-views-remove:hover{background:var(--ui-danger-soft);color:var(--ui-danger)}
body.erp-workspace .ws-views-empty,body.erp-workspace .ws-views-status,body.erp-workspace .ws-views-note{color:var(--ui-muted);font-size:11.5px}
body.erp-workspace .ws-views-create{width:100%;margin-top:10px}
body.erp-workspace .ws-views-editor{margin-top:10px;padding-top:10px;border-top:1px solid var(--ui-border)}
body.erp-workspace .ws-views-editor label{display:grid;gap:5px;color:var(--ui-muted);font-size:11.5px}
body.erp-workspace .ws-views-editor input{width:100%}
body.erp-workspace .ws-views-editor-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
body.erp-workspace .ws-views-note{display:block;margin-top:10px;padding-top:8px;border-top:1px solid var(--ui-border)}
body.erp-workspace .ws-column-resize{position:absolute;inset:0 0 0 auto;width:7px;padding:0;border:0;border-right:2px solid transparent;background:transparent;cursor:col-resize;touch-action:none;z-index:4}
body.erp-workspace .ws-column-resize:hover,body.erp-workspace .ws-column-resize:focus-visible{border-right-color:var(--ui-blue)}
body.erp-workspace .ws-nav-close{display:none!important}

/* Avatars and uploads */
body.erp-workspace :is(.avatar,.fee-avatar,.account-avatar,.person-avatar,.student-directory-avatar,.student-hero-avatar,.student-photo-preview,.fee-profile-photo,.staff-avatar,.profile-avatar){overflow:hidden;background:var(--ui-blue-soft)!important;color:var(--ui-blue)!important;font-weight:800!important;text-align:center}
body.erp-workspace :is(.avatar,.fee-avatar,.account-avatar,.person-avatar,.student-directory-avatar,.student-hero-avatar,.student-photo-preview,.fee-profile-photo,.staff-avatar,.profile-avatar) img,body.erp-workspace img:is(.avatar,.fee-avatar,.person-avatar,.student-directory-avatar,.student-hero-avatar,.student-photo-preview,.fee-profile-photo,.staff-avatar,.profile-avatar){width:100%!important;height:100%!important;object-fit:cover!important}
body.erp-workspace .ui-avatar-fallback{display:grid!important;place-items:center!important;text-transform:uppercase!important}
body.erp-workspace :is(.enterprise-upload-field,.student-photo-editor){border:1px solid var(--ui-border)!important;border-radius:12px!important;background:var(--ui-surface-soft)!important}
body.erp-workspace .enterprise-file-picker{border-color:var(--ui-border-strong)!important;border-radius:10px!important;background:var(--ui-surface)!important}

/* Modals */
body.erp-workspace :is(.branch-scope-modal,.modal,.dialog-overlay){position:fixed!important;inset:0!important;z-index:6000!important}
body.erp-workspace .branch-scope-backdrop,body.erp-workspace .modal-backdrop{position:absolute;inset:0;background:rgba(4,20,32,.58);backdrop-filter:blur(3px)}
body.erp-workspace .branch-scope-dialog{position:relative;width:min(540px,calc(100vw - 30px));max-height:calc(100dvh - 40px);margin:24px auto;padding:22px;overflow:auto;border:1px solid var(--ui-border);border-radius:16px;background:var(--ui-surface);box-shadow:var(--ui-shadow-lg)}
body.erp-workspace .branch-scope-dialog>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--ui-border)}
body.erp-workspace .branch-scope-dialog>header h2{margin:2px 0 0;font-size:19px}
body.erp-workspace .branch-scope-dialog>header>button{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);color:var(--ui-muted);cursor:pointer}
body.erp-workspace .branch-choice{display:flex!important;align-items:center!important;gap:12px!important;margin:8px 0!important;padding:12px!important;border:1px solid var(--ui-border)!important;border-radius:10px!important;background:var(--ui-surface)!important}
body.erp-workspace .branch-choice.selected{border-color:var(--ui-blue)!important;background:var(--ui-blue-soft)!important}

/* Floating tools */
body.erp-workspace .staff-chat-fab{right:20px!important;bottom:20px!important;width:52px!important;height:52px!important;border-radius:15px!important;background:var(--ui-blue)!important;box-shadow:0 12px 28px rgba(29,78,216,.28)!important}
body.erp-workspace .staff-chat-fab svg{width:22px!important;height:22px!important}

/* Responsive layout */
@media(max-width:1200px){
  :root{--ui-topbar-height:62px}
  body.erp-workspace .admin-shell.enterprise-shell,body.erp-workspace .admin-shell.enterprise-shell.sidebar-collapsed{display:block!important}
  body.erp-workspace .enterprise-sidebar,body.erp-workspace .sidebar-collapsed .enterprise-sidebar{width:min(310px,88vw)!important;transform:translateX(-102%)!important;box-shadow:var(--ui-shadow-lg)!important}
  body.erp-workspace .enterprise-shell.mobile-nav-open .enterprise-sidebar{transform:translateX(0)!important}
  body.erp-workspace .mobile-nav-backdrop{display:none;position:fixed;inset:0;z-index:4050;border:0;background:rgba(3,18,29,.58)}
  body.erp-workspace .enterprise-shell.mobile-nav-open>.mobile-nav-backdrop{display:block!important}
  body.erp-workspace .enterprise-main,body.erp-workspace .sidebar-collapsed .enterprise-main{width:100%!important;padding:calc(var(--ui-topbar-height) + 18px) 18px 28px!important}
  body.erp-workspace .enterprise-topbar,body.erp-workspace .sidebar-collapsed .enterprise-topbar{left:0!important;padding:0 14px!important}
  body.erp-workspace .sidebar-collapsed .enterprise-brand>span,body.erp-workspace .sidebar-collapsed .nav-section-label,body.erp-workspace .sidebar-collapsed .enterprise-nav-item>span,body.erp-workspace .sidebar-collapsed .enterprise-group-toggle>span,body.erp-workspace .sidebar-collapsed .enterprise-group-toggle>b{position:static!important;opacity:1!important;pointer-events:auto!important}
  body.erp-workspace .sidebar-collapsed .enterprise-nav-item,body.erp-workspace .sidebar-collapsed .enterprise-group-toggle{grid-template-columns:28px minmax(0,1fr) auto!important;justify-items:stretch!important;padding:8px 11px!important}
  body.erp-workspace .ws-nav-close{display:grid!important;place-items:center!important;flex:0 0 32px!important;width:32px!important;height:32px!important;padding:5px!important;margin-left:auto!important;border:1px solid rgba(255,255,255,.2)!important;border-radius:8px!important;background:rgba(255,255,255,.08)!important;color:#fff!important}
  body.erp-workspace .topbar-search{flex:1 1 auto!important;max-width:380px!important}
  body.erp-workspace .account-copy,body.erp-workspace .account-caret{display:none!important}
  body.erp-workspace .account-trigger{padding:4px!important}
  body.erp-workspace :is(.grid4){grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media(max-width:900px){
  body.erp-workspace .split,body.erp-workspace :is(.settings-grid,.users-layout,.dashboard-grid,.config-workspace){grid-template-columns:minmax(0,1fr)!important}
  body.erp-workspace .grid3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.erp-workspace :is(.module-hero,.workspace-hero,.config-hero,.erp-page-hero,.payroll-page-hero,.payroll-process-hero,.procurement-page-hero,.governance-page-hero,.settings-hero,.license-page-hero,.dashboard-hero){align-items:flex-start!important;flex-direction:column!important}
  body.erp-workspace .config-sidebar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.erp-workspace .ws-module-workspace{grid-template-columns:minmax(190px,215px) minmax(0,1fr)!important;gap:14px!important}
  body.erp-workspace .branch-scope-trigger>span:last-child{display:none!important}
  body.erp-workspace .branch-scope-trigger{min-width:38px!important;padding:6px 10px!important}
}

@media(max-width:767px){
  :root{--ui-topbar-height:58px}
  body.erp-workspace .enterprise-main,body.erp-workspace .sidebar-collapsed .enterprise-main{padding:calc(var(--ui-topbar-height) + 14px) 12px 24px!important}
  body.erp-workspace .enterprise-topbar{gap:6px!important;padding:0 10px!important}
  body.erp-workspace .topbar-menu{flex-basis:36px!important;width:36px!important;height:36px!important}
  body.erp-workspace .topbar-search{min-width:0!important;height:36px!important}
  body.erp-workspace .topbar-search kbd,body.erp-workspace .topbar-command-trigger{display:none!important}
  body.erp-workspace .topbar-search input{height:34px!important;font-size:12px!important}
  body.erp-workspace .topbar-actions{gap:4px!important}
  body.erp-workspace .topbar-icon-link,body.erp-workspace .topbar-theme-trigger{flex-basis:34px!important;width:34px!important;height:34px!important}
  body.erp-workspace .topbar-help-link,body.erp-workspace .enquiry-topbar,body.erp-workspace .branch-scope-trigger{display:none!important}
  body.erp-workspace .account-avatar{width:30px!important;height:30px!important;flex-basis:30px!important}
  body.erp-workspace .panel{padding:16px!important;margin-bottom:14px!important}
  body.erp-workspace .panel-head{align-items:flex-start!important;flex-direction:column!important;margin-bottom:12px!important}
  body.erp-workspace .panel-head>.btn,body.erp-workspace .panel-head>.toolbar-row{max-width:100%}
  body.erp-workspace :is(.grid2,.grid3,.grid4){grid-template-columns:minmax(0,1fr)!important}
  body.erp-workspace :is(.filters,.filter-bar,.enterprise-filter-toolbar,.ws-filter-toolbar){display:grid!important;grid-template-columns:minmax(0,1fr)!important;padding:12px!important}
  body.erp-workspace :is(.filters,.filter-bar,.enterprise-filter-toolbar,.ws-filter-toolbar)>label{min-width:0!important;width:100%!important}
  body.erp-workspace :is(.filters,.filter-bar,.enterprise-filter-toolbar,.ws-filter-toolbar)>.btn{width:100%!important}
  body.erp-workspace .table-wrap{border-radius:10px!important}
  body.erp-workspace table{min-width:680px}
  body.erp-workspace .fee-table-footer,body.erp-workspace .table-footer,body.erp-workspace .pagination-row{flex-wrap:wrap}
  body.erp-workspace :is(.row-actions,.form-actions,.record-actions,.table-actions,.workspace-actions)>.btn{flex:1 1 auto}
  body.erp-workspace .config-sidebar{grid-template-columns:minmax(0,1fr)!important}
  body.erp-workspace .ws-module-workspace{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  body.erp-workspace .ws-module-aside{position:static!important}
  body.erp-workspace .ws-module-aside-head{display:none!important}
  body.erp-workspace .ws-module-search{margin-top:0!important}
  body.erp-workspace .ws-module-nav{display:flex!important;gap:6px!important;padding:0 0 8px!important;overflow-x:auto!important}
  body.erp-workspace .ws-module-nav>a{flex:0 0 auto!important;white-space:nowrap!important}
  body.erp-workspace .ws-module-nav-label small{display:none!important}
  body.erp-workspace .enterprise-page-head h1{font-size:22px!important}
  body.erp-workspace :is(.module-hero,.workspace-hero,.config-hero,.erp-page-hero,.payroll-page-hero,.payroll-process-hero,.procurement-page-hero,.governance-page-hero,.settings-hero,.license-page-hero,.dashboard-hero){padding:16px!important;margin-bottom:14px!important}
}

@media(max-width:480px){
  body.erp-workspace .enterprise-main,body.erp-workspace .sidebar-collapsed .enterprise-main{padding-left:10px!important;padding-right:10px!important}
  body.erp-workspace .notification-topbar{display:none!important}
  body.erp-workspace .topbar-search>i{flex-basis:32px!important}
  body.erp-workspace .btn{min-height:38px!important}
  body.erp-workspace :is(.cards,.metric-grid,.stats-grid,.kpi-grid){grid-template-columns:minmax(0,1fr)!important}
}

@media(prefers-reduced-motion:reduce){body.erp-workspace *,body.erp-workspace *::before,body.erp-workspace *::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Authentication uses the same tokens */
body.login-body{display:block!important;min-height:100dvh!important;margin:0!important;padding:0!important;background:#f8fafc!important;color:#0f172a!important;font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif!important}
body.login-body .login-card{width:min(440px,100%)!important;padding:34px!important;border:1px solid #dce3ea!important;border-radius:18px!important;background:#fff!important;box-shadow:0 24px 70px rgba(6,43,58,.16)!important}
body.login-body .login-brand{display:grid!important;place-items:center!important;width:54px!important;height:54px!important;margin:0 0 18px!important;overflow:hidden!important;border-radius:13px!important;background:#eff6ff!important;color:#1d4ed8!important;font-size:18px!important;font-weight:800!important}
body.login-body .login-brand img{width:100%!important;height:100%!important;padding:5px!important;object-fit:contain!important}
body.login-body .login-card h1{margin:0 0 6px!important;color:#0f172a!important;font-size:25px!important;letter-spacing:-.025em!important}
body.login-body .login-card>p{margin:0 0 20px!important;color:#64748b!important;font-size:13.5px!important}
body.login-body .login-card label{display:grid!important;gap:6px!important;margin:14px 0!important;color:#334155!important;font-size:12.5px!important;font-weight:650!important}
body.login-body .login-card input{width:100%!important;min-height:44px!important;padding:10px 12px!important;border:1px solid #cbd5e1!important;border-radius:10px!important;background:#fff!important;color:#0f172a!important;font:14px inherit!important}
body.login-body .login-card input:focus{border-color:#1d4ed8!important;outline:0!important;box-shadow:0 0 0 3px rgba(29,78,216,.16)!important}
body.login-body .login-card .btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-height:44px!important;padding:10px 14px!important;border:1px solid #1d4ed8!important;border-radius:10px!important;background:#1d4ed8!important;color:#fff!important;font-size:14px!important;font-weight:700!important;cursor:pointer!important}
body.login-body .login-card .alert{margin:14px 0!important;padding:11px 13px!important;border-radius:9px!important;font-size:12.5px!important}
body.login-body .login-card .alert.danger{border:1px solid #efbec1!important;background:#fff0f1!important;color:#a72b31!important}
body.login-body .login-card .alert.success{border:1px solid #b9e2cf!important;background:#eaf8f1!important;color:#106b46!important}
body.login-body .login-password-actions{display:flex;justify-content:flex-end;margin:-4px 0 14px;font-size:12px}
body.login-body .login-secondary{display:block;margin-top:15px;color:#1d4ed8;font-size:12.5px;font-weight:700;text-align:center}
body.login-body .login-card>small{display:block;margin-top:15px;color:#64748b;font-size:11.5px;text-align:center}
@media(max-width:700px){body.login-body{padding:0!important;background:#f8fafc!important}body.login-body::before{display:none}body.login-body .login-card{padding:24px 20px!important}}

@media print{
  body.erp-workspace{background:#fff!important;color:#000!important}
  body.erp-workspace :is(.enterprise-sidebar,.enterprise-topbar,.enterprise-page-head,.staff-chat-fab,.floating-staff-chat,.btn,.filters,.toolbar,.pagination,.fee-table-footer){display:none!important}
  body.erp-workspace .enterprise-main{display:block!important;width:100%!important;padding:0!important;margin:0!important}
  body.erp-workspace :is(.panel,.compact-card,.user-card){border-color:#d7d7d7!important;box-shadow:none!important;break-inside:avoid}
}
