/* ==========================================================================
   VendorConnect — design system
   Extracted verbatim from vendor-portal-prototype_1.html (<style>, lines 7-456).
   Loaded AFTER Bootstrap 5 so every shared selector resolves to these rules.
   Do not restyle: the prototype is the visual source of truth.
   ========================================================================== */

:root{
  --surface-1:#ffffff; --surface-2:#f4f4f2; --page:#f4f5f7; --text-primary:#0b0b0b; --text-secondary:#52514e;
  --muted:#898781; --grid:#e7e7e3; --baseline:#c3c2b7; --border:rgba(11,11,11,0.09);
  --series-1:#2a78d6; --series-2:#1baf7a; --series-3:#eda100; --series-4:#008300;
  --series-5:#4a3aa7; --series-6:#e34948; --series-7:#e87ba4; --series-8:#eb6834;
  --good:#0ca30c; --warning:#fab219; --serious:#ec835a; --critical:#d03b3b;
  --seq-100:#cde2fb; --seq-250:#86b6ef; --seq-450:#2a78d6; --seq-600:#184f95;
  --radius:12px; --radius-sm:8px;
  --brand:#2a56d6; --brand-2:#1baf9e; --brand-grad:linear-gradient(135deg,#2a56d6 0%,#2a78d6 55%,#1baf9e 120%);
  --sidebar-bg:#12172b; --sidebar-bg-2:#161c33; --sidebar-text:#c7cbe0; --sidebar-text-dim:#7d84a6; --sidebar-active:#1f2745; --sidebar-border:rgba(255,255,255,0.07);
  --shadow-1:0 1px 2px rgba(16,24,40,0.06), 0 1px 3px rgba(16,24,40,0.04);
  --shadow-2:0 4px 12px rgba(16,24,40,0.08), 0 2px 4px rgba(16,24,40,0.05);
  --shadow-3:0 12px 32px rgba(16,24,40,0.14), 0 4px 10px rgba(16,24,40,0.06);
  --ease:cubic-bezier(.4,0,.2,1);
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;height:100%;}
body{
  font-family: system-ui,-apple-system,"Segoe UI",sans-serif;
  background:var(--page); color:var(--text-primary);
  display:flex; flex-direction:column; min-height:100vh;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none;}
button{font-family:inherit; cursor:pointer;}
svg{display:block;}
::-webkit-scrollbar{width:8px;height:8px;}
::-webkit-scrollbar-thumb{background:var(--baseline);border-radius:4px;}
.icon{width:16px;height:16px;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}

@keyframes fadeIn{ from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:translateY(0);} }
@keyframes popIn{ from{opacity:0; transform:scale(.97);} to{opacity:1; transform:scale(1);} }

/* ---------- Top bar ---------- */
#topbar{
  height:60px; background:var(--surface-1); border-bottom:1px solid var(--border);
  display:flex; align-items:center; padding:0 20px; gap:14px; flex-shrink:0; z-index:30;
  box-shadow:var(--shadow-1); position:relative;
}
#topbar .brand{display:flex; align-items:center; gap:10px; font-weight:800; font-size:15.5px; white-space:nowrap; letter-spacing:-.01em;}
#topbar .brand .mark{width:30px;height:30px;border-radius:9px;background:var(--brand-grad); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:14px; box-shadow:var(--shadow-2);}
#sidebar-collapse-btn{
  border:none; background:transparent; color:var(--text-secondary); width:32px; height:32px; border-radius:8px;
  display:flex; align-items:center; justify-content:center; transition:background .15s var(--ease);
}
#sidebar-collapse-btn:hover{background:var(--page);}
#topbar .spacer{flex:1;}

.search-shell{position:relative; width:320px; max-width:32vw;}
.search-shell .icon{position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--muted); z-index:1;}
.search-shell input{
  width:100%; padding:8px 12px 8px 34px; border-radius:20px; border:1px solid var(--border); background:var(--surface-2);
  font-size:13px; color:var(--text-primary); transition:box-shadow .15s var(--ease), background .15s var(--ease);
}
.search-shell input:focus{outline:none; background:var(--surface-1); box-shadow:0 0 0 3px rgba(42,86,214,0.14); border-color:var(--brand);}

#sap-status{
  display:flex; align-items:center; gap:7px; font-size:12px; color:var(--text-secondary); font-weight:600;
  background:rgba(12,163,12,0.08); border:1px solid rgba(12,163,12,0.18); border-radius:20px; padding:6px 12px 6px 10px; white-space:nowrap;
}
#sap-status .led{width:7px;height:7px;border-radius:50%;background:var(--good); box-shadow:0 0 0 3px rgba(12,163,12,0.18); animation:pulse 2.2s infinite;}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(12,163,12,0.35);} 70%{box-shadow:0 0 0 6px rgba(12,163,12,0);} 100%{box-shadow:0 0 0 0 rgba(12,163,12,0);}}

.icon-btn{
  position:relative; width:36px;height:36px;border-radius:10px; border:1px solid var(--border); background:var(--surface-1); color:var(--text-secondary);
  display:flex; align-items:center; justify-content:center; transition:all .15s var(--ease); flex-shrink:0;
}
.icon-btn:hover{background:var(--page); color:var(--text-primary); box-shadow:var(--shadow-1);}
.icon-btn .dot-badge{position:absolute; top:-3px; right:-3px; background:var(--critical); color:#fff; font-size:10px; font-weight:700; min-width:16px; height:16px; border-radius:8px; display:flex; align-items:center; justify-content:center; padding:0 3px; border:2px solid var(--surface-1);}

.role-select{
  border:1px solid var(--border); border-radius:20px; padding:7px 14px; font-size:12.5px; font-weight:600; background:var(--surface-2); color:var(--text-primary);
  transition:box-shadow .15s var(--ease);
}
.role-select:focus{outline:none; box-shadow:0 0 0 3px rgba(42,86,214,0.14);}

.avatar-chip{display:flex; align-items:center; gap:8px; padding:4px 10px 4px 4px; border-radius:20px; border:1px solid var(--border); background:var(--surface-1); transition:box-shadow .15s var(--ease);}
.avatar-chip:hover{box-shadow:var(--shadow-1);}
.avatar-chip .av{width:28px;height:28px;border-radius:50%;background:var(--brand-grad); color:#fff; font-weight:700; font-size:12px; display:flex; align-items:center; justify-content:center;}

.dropdown-panel{
  position:absolute; top:52px; right:0; width:320px; background:var(--surface-1); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-3); z-index:50; animation:popIn .15s var(--ease); overflow:hidden;
}
.dropdown-panel .dp-head{padding:14px 16px; border-bottom:1px solid var(--grid); font-size:13px; font-weight:700; display:flex; align-items:center; justify-content:space-between;}
.dropdown-panel .dp-body{max-height:340px; overflow-y:auto;}
.dropdown-item{padding:12px 16px; border-bottom:1px solid var(--grid); font-size:12.5px; display:flex; gap:10px; align-items:flex-start;}
.dropdown-item:last-child{border-bottom:none;}
.dropdown-item .dp-ic{width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}

#console-toggle{
  border:1px solid var(--border); background:var(--surface-1); border-radius:20px; padding:7px 14px 7px 12px; font-size:12.5px; font-weight:600; color:var(--text-secondary);
  display:flex; align-items:center; gap:7px; transition:all .15s var(--ease);
}
#console-toggle:hover{background:var(--page); box-shadow:var(--shadow-1);}
#console-toggle .badge{
  background:var(--brand-grad); color:white; border-radius:10px; font-size:11px; padding:1px 7px; font-weight:700;
}

/* ---------- Layout ---------- */
#shell{display:flex; flex:1; min-height:0;}
#sidebar{
  width:252px; background:var(--sidebar-bg); border-right:1px solid var(--sidebar-border); overflow-y:auto; flex-shrink:0; padding:14px 0 20px;
  transition:width .18s var(--ease); display:flex; flex-direction:column;
}
#sidebar.collapsed{width:68px;}
#sidebar-search-wrap{padding:0 14px 12px;}
#sidebar.collapsed #sidebar-search-wrap{display:none;}
#sidebar-search-wrap input{
  width:100%; padding:7px 10px 7px 30px; border-radius:8px; border:1px solid var(--sidebar-border); background:rgba(255,255,255,0.05);
  color:var(--sidebar-text); font-size:12.5px;
}
#sidebar-search-wrap input::placeholder{color:var(--sidebar-text-dim);}
#sidebar-search-wrap input:focus{outline:none; background:rgba(255,255,255,0.09);}
#sidebar-search-wrap{position:relative;}
#sidebar-search-wrap .icon{position:absolute; left:24px; top:8px; color:var(--sidebar-text-dim);}

.nav-group{margin-bottom:2px;}
.nav-group-head{
  display:flex; align-items:center; gap:6px; padding:9px 14px; font-size:10.5px; letter-spacing:.06em; text-transform:uppercase;
  color:var(--sidebar-text-dim); font-weight:700; cursor:pointer; user-select:none; transition:color .15s var(--ease);
}
.nav-group-head:hover{color:var(--sidebar-text);}
.nav-group-head .chev{width:12px;height:12px;transition:transform .18s var(--ease); flex-shrink:0;}
.nav-group-head.closed .chev{transform:rotate(-90deg);}
#sidebar.collapsed .nav-group-head{justify-content:center; padding:9px 0;}
#sidebar.collapsed .nav-group-head span.gtext, #sidebar.collapsed .nav-group-head .chev{display:none;}

.nav-group-body{overflow:hidden; max-height:600px; transition:max-height .2s var(--ease);}
.nav-group-body.closed{max-height:0;}

.navlink{
  display:flex; align-items:center; gap:11px; padding:9px 14px; margin:1px 8px; border-radius:8px; font-size:13.5px; color:var(--sidebar-text);
  cursor:pointer; position:relative; transition:background .15s var(--ease), color .15s var(--ease);
}
.navlink .icon{color:var(--sidebar-text-dim); transition:color .15s var(--ease);}
.navlink:hover{background:rgba(255,255,255,0.06); color:#fff;}
.navlink:hover .icon{color:#fff;}
.navlink.active{background:var(--sidebar-active); color:#fff; font-weight:600;}
.navlink.active .icon{color:var(--brand-2);}
.navlink.active::before{content:'';position:absolute;left:-8px;top:8px;bottom:8px;width:3px;border-radius:3px;background:var(--brand-grad);}
.navlink .lbl{flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.navlink .nbadge{background:rgba(255,255,255,0.12); color:#fff; font-size:10.5px; font-weight:700; padding:1px 7px; border-radius:9px;}
.navlink.active .nbadge{background:rgba(255,255,255,0.22);}
.navlink .nbadge.alert{background:var(--critical);}
#sidebar.collapsed .navlink{justify-content:center; padding:10px 0; margin:2px 12px;}
#sidebar.collapsed .navlink .lbl, #sidebar.collapsed .navlink .nbadge{display:none;}

#sidebar-foot{margin-top:auto; padding:12px 14px 0;}
#sidebar.collapsed #sidebar-foot{display:none;}
.rail-toggle-row{display:flex; justify-content:flex-end; padding:0 8px;}

#main{flex:1; overflow-y:auto; padding:24px 28px 80px; min-width:0;}
#main-inner{animation:fadeIn .22s var(--ease);}
.page-title{font-size:21px; font-weight:800; margin:0 0 4px; letter-spacing:-.01em;}
.page-sub{font-size:13px; color:var(--text-secondary); margin:0 0 20px;}
.crumb{font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-weight:700; margin-bottom:6px;}

/* ---------- Components ---------- */
.card{background:var(--surface-1); border:1px solid var(--border); border-radius:var(--radius); padding:18px; box-shadow:var(--shadow-1); transition:box-shadow .18s var(--ease), transform .18s var(--ease);}
.card.hoverable:hover{box-shadow:var(--shadow-2); transform:translateY(-1px);}
.grid{display:grid; gap:16px;}
.grid-4{grid-template-columns:repeat(4,1fr);}
.grid-3{grid-template-columns:repeat(3,1fr);}
.grid-2{grid-template-columns:repeat(2,1fr);}
@media (max-width:1100px){.grid-4{grid-template-columns:repeat(2,1fr);} .grid-3{grid-template-columns:repeat(2,1fr);}}

.kpi{position:relative; overflow:hidden; padding-left:18px;}
.kpi::before{content:'';position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--kpi-accent, var(--brand-grad));}
.kpi-top{display:flex; align-items:flex-start; justify-content:space-between; gap:8px;}
.kpi .ic-chip{width:34px;height:34px;border-radius:9px; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.kpi .label{font-size:12px; color:var(--text-secondary); margin-bottom:8px; font-weight:600;}
.kpi .value{font-size:27px; font-weight:800; font-variant-numeric:tabular-nums; letter-spacing:-.01em;}
.kpi .delta{font-size:12px; margin-top:6px; display:flex; align-items:center; gap:4px;}
.kpi .delta.up{color:var(--good);}
.kpi .delta.down{color:var(--critical);}
.kpi .delta .icon{width:12px;height:12px;}

table{width:100%; border-collapse:collapse; font-size:13px;}
th{text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); font-weight:700; padding:10px 10px; border-bottom:1px solid var(--grid); white-space:nowrap;}
th.sortable{cursor:pointer; user-select:none; transition:color .15s var(--ease);}
th.sortable:hover{color:var(--text-primary);}
th.sortable .sort-ic{display:inline-block; margin-left:4px; opacity:.4; font-size:9px;}
th.sortable.sorted .sort-ic{opacity:1; color:var(--brand);}
td{padding:10px 10px; border-bottom:1px solid var(--grid); vertical-align:middle;}
tbody tr{transition:background .12s var(--ease);}
tr:last-child td{border-bottom:none;}
tr.rowlink{cursor:pointer;}
tr.rowlink:hover td{background:var(--surface-2);}

.list-toolbar{display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap;}
.list-search{position:relative; flex:1; min-width:200px; max-width:320px;}
.list-search .icon{position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--muted); width:14px;height:14px;}
.list-search input{width:100%; padding:8px 10px 8px 30px; border:1px solid var(--border); border-radius:8px; font-size:13px; background:var(--surface-1);}
.list-search input:focus{outline:none; box-shadow:0 0 0 3px rgba(42,86,214,0.12); border-color:var(--brand);}
.result-count{font-size:12px; color:var(--muted); white-space:nowrap;}

.badge{display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; padding:3px 9px; border-radius:12px; white-space:nowrap;}
.badge .ic{width:6px;height:6px;border-radius:50%;}
.badge.good{background:rgba(12,163,12,0.10); color:#0a7f0a;}
.badge.good .ic{background:var(--good);}
.badge.warning{background:rgba(250,178,25,0.16); color:#8a5a00;}
.badge.warning .ic{background:var(--warning);}
.badge.serious{background:rgba(236,131,90,0.16); color:#a13d15;}
.badge.serious .ic{background:var(--serious);}
.badge.critical{background:rgba(208,59,59,0.12); color:var(--critical);}
.badge.critical .ic{background:var(--critical);}
.badge.neutral{background:var(--grid); color:var(--text-secondary);}
.badge.neutral .ic{background:var(--muted);}
.badge.info{background:rgba(42,120,214,0.12); color:#184f95;}
.badge.info .ic{background:var(--series-1);}

.btn{border:1px solid var(--border); background:var(--surface-1); border-radius:9px; padding:8px 15px; font-size:13px; font-weight:600; color:var(--text-primary); display:inline-flex; align-items:center; gap:6px; transition:all .15s var(--ease);}
.btn:hover{background:var(--page); box-shadow:var(--shadow-1); transform:translateY(-1px);}
.btn:active{transform:translateY(0);}
.btn.primary{background:var(--brand-grad); color:white; border-color:transparent; box-shadow:0 2px 8px rgba(42,86,214,0.28);}
.btn.primary:hover{filter:brightness(1.06); box-shadow:0 4px 14px rgba(42,86,214,0.36);}
.btn.good{background:var(--good); color:white; border-color:var(--good);}
.btn.critical{background:var(--critical); color:white; border-color:var(--critical);}
.btn.sm{padding:5px 11px; font-size:12px;}
.btn:disabled{opacity:.45; cursor:not-allowed; transform:none!important; box-shadow:none!important;}
.btn-row{display:flex; gap:8px; flex-wrap:wrap;}

.tabs{display:flex; gap:4px; border-bottom:1px solid var(--grid); margin-bottom:16px;}
.tab{padding:9px 14px; font-size:13px; font-weight:600; color:var(--text-secondary); border-bottom:2px solid transparent; cursor:pointer; transition:color .15s var(--ease);}
.tab:hover{color:var(--text-primary);}
.tab.active{color:var(--brand); border-bottom-color:var(--brand);}

.drill-crumb{padding:3px 9px; border-radius:6px; cursor:pointer; color:var(--text-secondary); font-weight:600; background:var(--page);}
.drill-crumb:hover{color:var(--brand); background:var(--surface-2);}
.drill-crumb.active{color:var(--brand); background:rgba(42,120,214,0.12);}
.drill-sep{color:var(--text-secondary); opacity:.6; padding:0 1px;}
.drill-launch{border-radius:12px; transition:box-shadow .15s var(--ease), transform .15s var(--ease);}
.drill-launch:hover{transform:translateY(-2px); box-shadow:0 6px 22px rgba(0,0,0,0.10);}

.filter-bar{display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; background:var(--surface-2); border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin-bottom:14px;}
.filter-fields{display:flex; flex-wrap:wrap; gap:10px 12px; flex:1; min-width:0;}
.filter-field{display:flex; flex-direction:column; gap:4px; min-width:150px;}
.filter-field label{font-size:10.5px; font-weight:700; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.03em;}
.filter-field select,.filter-field input{padding:7px 9px; border:1px solid var(--border); border-radius:8px; background:var(--surface-1); font-size:13px; color:var(--text-primary); min-width:150px;}
.filter-field select:focus,.filter-field input:focus{outline:none; border-color:var(--brand); box-shadow:0 0 0 2px rgba(42,120,214,0.15);}
.filter-actions{display:flex; gap:10px; align-items:center; flex-shrink:0;}

.hero{
  border-radius:var(--radius); padding:24px 26px; background:var(--brand-grad); color:#fff; margin-bottom:20px;
  display:flex; align-items:center; justify-content:space-between; gap:24px; box-shadow:var(--shadow-3); position:relative; overflow:hidden;
}
.hero::after{content:'';position:absolute; right:-60px; top:-60px; width:220px; height:220px; border-radius:50%; background:rgba(255,255,255,0.08);}
.hero::before{content:'';position:absolute; right:80px; bottom:-90px; width:180px; height:180px; border-radius:50%; background:rgba(255,255,255,0.06);}
.hero h1{font-size:21px; margin:0 0 6px; font-weight:800; letter-spacing:-.01em; position:relative; z-index:1;}
.hero > div:first-child{position:relative; z-index:1;}
.hero .badge{background:rgba(255,255,255,0.2); color:#fff;}
.hero p{margin:0; font-size:13px; opacity:.9; max-width:520px;}
.hero .hero-actions{display:flex; gap:10px; flex-wrap:wrap; position:relative; z-index:1;}
.hero .btn{background:rgba(255,255,255,0.16); color:#fff; border-color:rgba(255,255,255,0.28); backdrop-filter:blur(4px);}
.hero .btn:hover{background:rgba(255,255,255,0.26);}
.hero .btn.solid{background:#fff; color:var(--brand);}
.hero .btn.solid:hover{background:#f2f4ff;}
.hero-icon{width:76px;height:76px;border-radius:20px;background:rgba(255,255,255,0.14); display:flex;align-items:center;justify-content:center; flex-shrink:0; position:relative; z-index:1;}
.hero-icon .icon{width:38px;height:38px;color:#fff;}
@media (max-width:900px){.hero{flex-direction:column; align-items:flex-start;} .hero-icon{display:none;}}

.field{margin-bottom:14px;}
.field label{display:block; font-size:12px; font-weight:600; color:var(--text-secondary); margin-bottom:5px;}
.field .hint{font-size:11px; color:var(--muted); margin-top:4px;}
.field .err{font-size:11px; color:var(--critical); margin-top:4px; display:none;}
.field.invalid .err{display:block;}
.field.invalid input, .field.invalid select{border-color:var(--critical);}
input[type=text], input[type=file], input[type=date], input[type=number], select, textarea{
  width:100%; padding:8px 10px; border:1px solid var(--border); border-radius:8px; font-size:13px; background:var(--surface-1); color:var(--text-primary); font-family:inherit;
}
textarea{resize:vertical;}
.check-row{display:flex; align-items:center; gap:8px; font-size:13px; padding:6px 0;}

.section-title{font-size:14px; font-weight:700; margin:22px 0 10px; padding-bottom:6px; border-bottom:1px solid var(--grid);}
.section-title:first-child{margin-top:0;}

.stepper{display:flex; align-items:flex-start; gap:0; margin:6px 0 22px; flex-wrap:wrap;}
.step{display:flex; flex-direction:column; align-items:center; flex:1; min-width:78px; position:relative;}
.step .circle{width:26px;height:26px;border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; background:var(--grid); color:var(--text-secondary); border:2px solid var(--grid);}
.step.done .circle{background:var(--good); border-color:var(--good); color:white;}
.step.current .circle{background:var(--brand-grad); border-color:var(--brand); color:white; box-shadow:0 0 0 4px rgba(42,86,214,0.14);}
.step.rejected .circle{background:var(--critical); border-color:var(--critical); color:white;}
.step .lbl{font-size:10.5px; margin-top:6px; text-align:center; color:var(--text-secondary); max-width:90px;}
.step .line{position:absolute; top:13px; left:calc(50% + 16px); right:calc(-50% + 16px); height:2px; background:var(--grid); z-index:0;}
.step.done .line, .step.current .line{background:var(--good);}
.step:last-child .line{display:none;}

.modal-bg{position:fixed; inset:0; background:rgba(11,11,11,0.5); backdrop-filter:blur(2px); display:none; align-items:center; justify-content:center; z-index:100;}
.modal-bg.open{display:flex;}
.modal{background:var(--surface-1); border-radius:var(--radius); padding:22px; width:520px; max-width:92vw; max-height:86vh; overflow-y:auto; box-shadow:0 24px 70px rgba(0,0,0,.3); animation:popIn .18s var(--ease);}
.modal.wide{width:900px;}
.modal h3{margin:0 0 12px; font-size:16px;}

/* Repeatable rows (bank / director / contact) */
.repeat-row{border:1.5px dashed var(--border); border-radius:12px; padding:14px 14px 2px; margin-bottom:14px; position:relative; background:var(--surface-2);}
.repeat-row .rr-title{font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin-bottom:8px;}
.repeat-row .rr-remove{position:absolute; top:10px; right:10px;}
.field-inline{display:flex; gap:8px; align-items:flex-end;}
.field-inline .field{flex:1; margin-bottom:0;}
.gst-status-row{display:flex; align-items:center; gap:8px; margin-top:6px; font-size:12px;}
.wizard-nav{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:18px; position:sticky; top:0; background:var(--surface-1); z-index:2; padding:2px 0 10px; border-bottom:1px solid var(--grid);}
.wizard-nav a{font-size:11.5px; font-weight:600; padding:6px 12px; border-radius:20px; background:var(--surface-2); color:var(--text-secondary); text-decoration:none; border:1px solid var(--border); transition:all .15s var(--ease);}
.wizard-nav a:hover{border-color:var(--brand); color:var(--brand);}
.classify-badge{display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:8px; background:var(--surface-2); font-size:12.5px; font-weight:600; margin-top:6px;}
.line-item-table input{padding:5px 7px; font-size:12px;}
.line-item-table td{vertical-align:middle;}

/* Gate pass ticket */
.gatepass{background:#fff; color:#0b0b0b; border:1px solid var(--border); border-radius:12px; padding:22px; max-width:340px; margin:0 auto; text-align:center; box-shadow:var(--shadow-2);}
.gatepass .gp-brand{font-size:11px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:var(--brand); border:2px solid var(--brand); display:inline-block; padding:3px 10px; border-radius:4px;}
.gatepass h2{font-size:20px; margin:10px 0 2px; letter-spacing:-.01em;}
.gatepass .gp-sub{font-size:13px; font-weight:700; margin-bottom:14px;}
.gatepass table{width:100%; font-size:12.5px; text-align:left; margin-bottom:12px;}
.gatepass table td{padding:3px 4px; border:none;}
.gatepass table td:first-child{color:#52514e; width:38%;}
.gatepass .gp-token{font-family:ui-monospace,Menlo,Consolas,monospace; font-size:14px; font-weight:700; letter-spacing:.06em; margin-top:8px;}
.gp-qr{display:inline-block; margin:6px auto;}

/* Gate entry stage pills */
.stage-pill{display:inline-flex; align-items:center; gap:5px; font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:20px; background:var(--surface-2); color:var(--text-secondary); border:1px solid var(--border);}
.stage-pill.done{background:#e7f5e7; color:#0a7f0a; border-color:#bfe3bf;}
.stage-pill.current{background:var(--brand-grad); color:#fff; border-color:transparent;}

/* OCR panel */
.ocr-wrap{display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start;}
@media (max-width:1100px){.ocr-wrap{grid-template-columns:1fr;}}
.ocr-doc{background:#f6f5f0; border:1px solid var(--border); border-radius:10px; padding:18px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:11.5px; line-height:1.7; color:#333; position:relative; min-height:240px;}
.ocr-doc::after{content:'SCANNED DOCUMENT'; position:absolute; top:8px; right:10px; font-size:9px; letter-spacing:.1em; color:#b3b1a8; font-weight:700;}
.ocr-doc .hl{background:#fff3bf; padding:0 2px; border-radius:2px;}
.conf{display:inline-flex; align-items:center; font-size:10px; font-weight:700; padding:1px 7px; border-radius:12px; margin-left:6px;}
.conf.hi{background:#e7f5e7; color:#0a7f0a;}
.conf.lo{background:#fdeaea; color:#c22f2f;}
.ocr-field-row{display:flex; align-items:center; gap:8px; margin-bottom:9px;}
.ocr-field-row label{width:130px; font-size:11.5px; font-weight:600; color:var(--text-secondary); flex-shrink:0;}
.ocr-field-row input{flex:1;}
.ocr-field-row.low input{border-color:#e0a4a4; background:#fff8f8;}

/* ---------- Form GUI polish ---------- */
input[type=text]:focus, input[type=number]:focus, input[type=date]:focus, input[type=search]:focus, select:focus, textarea:focus{
  outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(42,86,214,0.13);
}
.section-title{position:relative; padding-left:12px;}
.section-title::before{content:''; position:absolute; left:0; top:2px; bottom:8px; width:4px; border-radius:3px; background:var(--brand-grad);}
.field label{letter-spacing:.01em;}
tbody tr:nth-child(even){background:rgba(0,0,0,0.014);}
.modal h3{padding-bottom:10px; border-bottom:2px solid var(--grid);}

/* ---------- Workflow designer ---------- */
.wf-canvas{display:flex; flex-direction:column; gap:0; margin:14px 0;}
.wf-level{background:var(--surface-1); border:1.5px solid var(--border); border-radius:12px; padding:12px 14px; display:flex; align-items:center; gap:12px; cursor:grab; transition:box-shadow .15s var(--ease), border-color .15s var(--ease); position:relative;}
.wf-level:active{cursor:grabbing;}
.wf-level.dragging{opacity:.45; border-style:dashed;}
.wf-level.dragover{border-color:var(--brand); box-shadow:0 0 0 3px rgba(42,86,214,0.14);}
.wf-level .wf-grip{color:var(--muted); font-size:15px; letter-spacing:2px; user-select:none;}
.wf-level .wf-num{width:30px;height:30px;border-radius:50%; background:var(--brand-grad); color:#fff; display:flex;align-items:center;justify-content:center; font-weight:800; font-size:13px; flex-shrink:0;}
.wf-level .wf-body{flex:1; min-width:0;}
.wf-level .wf-role{font-weight:700; font-size:13.5px;}
.wf-level .wf-meta{font-size:11.5px; color:var(--text-secondary); display:flex; gap:10px; flex-wrap:wrap; margin-top:3px;}
.wf-level .wf-meta .tagx{background:var(--surface-2); border:1px solid var(--border); border-radius:12px; padding:1px 8px;}
.wf-connector{width:2px; height:16px; background:var(--border); margin-left:37px;}
.wf-cond{display:inline-flex; align-items:center; gap:6px; background:#eef3fd; border:1px solid #c9d8f6; color:#1c4a9e; font-size:11.5px; font-weight:600; padding:4px 10px; border-radius:16px; margin:2px 4px 2px 0;}

/* ---------- Toggle switch ---------- */
.tgl{position:relative; display:inline-block; width:38px; height:21px; vertical-align:middle;}
.tgl input{opacity:0; width:0; height:0;}
.tgl .sl{position:absolute; inset:0; background:#c9c8c0; border-radius:21px; transition:.18s; cursor:pointer;}
.tgl .sl::before{content:''; position:absolute; height:15px; width:15px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.18s; box-shadow:0 1px 3px rgba(0,0,0,.25);}
.tgl input:checked + .sl{background:var(--brand);}
.tgl input:checked + .sl::before{transform:translateX(17px);}

/* ---------- Permission matrix / audit ---------- */
.perm-y{color:#0a7f0a; font-weight:800;}
.perm-n{color:#c9c8c0; font-weight:700;}
.audit-chip.active{background:var(--brand-grad); color:#fff; border-color:transparent;}
.toast-wrap{position:fixed; bottom:16px; right:16px; z-index:200; display:flex; flex-direction:column; gap:8px;}
.toast{background:var(--text-primary); color:white; padding:11px 18px; border-radius:10px; font-size:13px; box-shadow:var(--shadow-3); max-width:360px; animation:popIn .18s var(--ease);}
.toast.good{background:#0a7f0a;} .toast.critical{background:var(--critical);}

/* Integration console */
#console-drawer{
  position:fixed; bottom:0; left:0; right:0; height:0; overflow:hidden; background:#111110; color:#e7e6e2; z-index:90;
  transition:height .18s ease; border-top:1px solid rgba(255,255,255,.1); font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
#console-drawer.open{height:280px;}
#console-drawer .chead{display:flex; align-items:center; justify-content:space-between; padding:8px 14px; border-bottom:1px solid rgba(255,255,255,.1); font-family:system-ui,sans-serif;}
#console-drawer .chead .title{font-size:12px; font-weight:700; color:#fff;}
#console-drawer .chead button{background:none;border:none;color:#c3c2b7;font-size:16px;}
#console-log{padding:8px 14px; overflow-y:auto; height:calc(280px - 40px); font-size:11.5px; line-height:1.6;}
.log-line{padding:3px 0; border-bottom:1px dashed rgba(255,255,255,.06); white-space:pre-wrap; word-break:break-word;}
.log-line .tag{padding:1px 6px; border-radius:4px; font-size:10px; font-weight:700; margin-right:6px;}
.log-line .tag.req{background:#184f95; color:#cde2fb;}
.log-line .tag.res{background:#0a7f0a; color:#cdf5cd;}
.log-line .tag.err{background:var(--critical); color:white;}
.log-line .ts{color:#898781; margin-right:6px;}

.roadmap-card{border:1.5px dashed var(--border); border-radius:var(--radius); padding:16px; background:var(--surface-1); transition:border-color .15s var(--ease), transform .15s var(--ease);}
.roadmap-card:hover{border-color:var(--brand); transform:translateY(-2px);}
.roadmap-card .rm-top{display:flex; align-items:center; gap:10px; margin-bottom:10px;}
.roadmap-card .rm-ic{width:34px;height:34px;border-radius:9px; background:var(--surface-2); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.roadmap-card h4{margin:0; font-size:14px;}
.roadmap-card .tag-soon{font-size:10px; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.04em; background:var(--surface-2); padding:2px 8px; border-radius:8px; display:inline-block; margin-bottom:8px;}
.roadmap-card ul{margin:8px 0 0; padding-left:18px; font-size:12.5px; color:var(--text-secondary);}
.roadmap-card ul li{margin-bottom:3px;}

.arch-box{border:1px solid var(--border); border-radius:8px; padding:10px 12px; background:var(--surface-1); font-size:12.5px;}
.arch-box b{display:block; font-size:13px; margin-bottom:4px;}
.arch-col{display:flex; flex-direction:column; gap:10px;}
.arch-arrow{text-align:center; color:var(--muted); font-size:20px; padding:2px 0;}

.empty{text-align:center; padding:40px 20px; color:var(--muted); font-size:13px;}
.small{font-size:12px; color:var(--text-secondary);}
.muted{color:var(--muted);}
.right{text-align:right;}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;}
.divider{height:1px; background:var(--grid); margin:14px 0;}
.doc-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px;}
.doc-item{border:1px solid var(--border); border-radius:8px; padding:10px 12px; font-size:12.5px;}
.doc-item .dname{font-weight:600; margin-bottom:4px;}
.progress{height:6px; background:var(--grid); border-radius:3px; overflow:hidden;}
.progress > div{height:100%; background:var(--series-1);}

/* AI Vendor Assistant (floating widget) */
#ai-fab{
  position:fixed; right:24px; bottom:24px; width:56px; height:56px; border-radius:50%; background:var(--brand-grad); color:#fff;
  border:none; box-shadow:var(--shadow-3); display:flex; align-items:center; justify-content:center; z-index:80; transition:transform .15s var(--ease);
}
#ai-fab:hover{transform:scale(1.06);}
#ai-fab .icon{width:24px;height:24px;}
#ai-panel{
  position:fixed; right:24px; bottom:92px; width:360px; max-width:88vw; height:480px; max-height:70vh; background:var(--surface-1);
  border-radius:var(--radius); box-shadow:var(--shadow-3); border:1px solid var(--border); display:none; flex-direction:column; z-index:81; overflow:hidden; animation:popIn .18s var(--ease);
}
#ai-panel.open{display:flex;}
#ai-panel .ai-head{background:var(--brand-grad); color:#fff; padding:14px 16px; display:flex; align-items:center; gap:10px;}
#ai-panel .ai-head .ic-wrap{width:30px;height:30px;border-radius:8px;background:rgba(255,255,255,0.18);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
#ai-panel .ai-head .t{font-size:13.5px; font-weight:700;}
#ai-panel .ai-head .s{font-size:11px; opacity:.85;}
#ai-panel .ai-head button{margin-left:auto; background:none; border:none; color:#fff; opacity:.85;}
#ai-messages{flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:10px;}
.ai-msg{max-width:85%; padding:9px 12px; border-radius:10px; font-size:12.5px; line-height:1.45;}
.ai-msg.bot{background:var(--surface-2); align-self:flex-start; border-bottom-left-radius:3px;}
.ai-msg.user{background:var(--brand); color:#fff; align-self:flex-end; border-bottom-right-radius:3px;}
.ai-suggest{display:flex; flex-wrap:wrap; gap:6px; padding:0 14px 10px;}
.ai-suggest button{border:1px solid var(--border); background:var(--surface-1); border-radius:14px; padding:5px 11px; font-size:11.5px; color:var(--text-secondary);}
.ai-suggest button:hover{background:var(--page);}
#ai-panel form{display:flex; gap:8px; padding:12px; border-top:1px solid var(--grid);}
#ai-panel form input{flex:1;}


/* ---------- Additions required by server-rendered pages only ----------
   (no visual change to any existing component; these cover markup that the
   client-side prototype produced imperatively) */
.pagination-bar{display:flex;align-items:center;gap:8px;justify-content:flex-end;margin-top:14px;font-size:12.5px;}
.pagination-bar a,.pagination-bar span{padding:5px 10px;border-radius:8px;border:1px solid var(--border);background:var(--surface-1);color:var(--text-secondary);}
.pagination-bar a:hover{background:var(--page);color:var(--text-primary);}
.pagination-bar .current{background:var(--brand-grad);color:#fff;border-color:transparent;font-weight:700;}
.pagination-bar .disabled{opacity:.4;pointer-events:none;}
.auth-shell{min-height:100vh;display:flex;align-items:center;justify-content:center;background:var(--page);padding:24px;}
.auth-card{width:420px;max-width:94vw;background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-3);padding:28px;animation:popIn .18s var(--ease);}
.auth-card .brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:16px;margin-bottom:6px;}
.auth-card .brand .mark{width:32px;height:32px;border-radius:9px;background:var(--brand-grad);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:14px;}
.auth-card .auth-sub{font-size:12.5px;color:var(--text-secondary);margin-bottom:18px;}
.auth-error{background:rgba(208,59,59,.10);color:var(--critical);border-radius:8px;padding:9px 12px;font-size:12.5px;margin-bottom:14px;}
.auth-note{background:rgba(250,178,25,.14);color:#8a5a00;border-radius:8px;padding:9px 12px;font-size:12.5px;margin-bottom:14px;}
.form-errors{color:var(--critical);font-size:12px;margin-top:4px;}
.messages-wrap{margin-bottom:14px;}
/* mobile: sidebar becomes an off-canvas drawer (gap #27 in the analysis) */
@media (max-width:900px){
  #sidebar{position:fixed;left:0;top:60px;bottom:0;z-index:60;transform:translateX(-100%);transition:transform .2s var(--ease);box-shadow:var(--shadow-3);}
  #sidebar.open{transform:translateX(0);}
  #main{padding:16px 14px 70px;}
  #topbar{padding:0 12px;gap:8px;}
  #topbar .search-shell{display:none;}
  #service-status{display:none;}
}

/* Service status pill — same visual treatment the prototype gave #sap-status */
#service-status{
  display:flex; align-items:center; gap:7px; font-size:12px; color:var(--text-secondary); font-weight:600;
  background:rgba(12,163,12,0.08); border:1px solid rgba(12,163,12,0.18); border-radius:20px; padding:6px 12px 6px 10px; white-space:nowrap;
}
#service-status .led{width:7px;height:7px;border-radius:50%;background:var(--good); box-shadow:0 0 0 3px rgba(12,163,12,0.18); animation:pulse 2.2s infinite;}
#service-status.degraded{background:rgba(250,178,25,.10); border-color:rgba(250,178,25,.28);}
#service-status.degraded .led{background:var(--warning);}
