/* =====================================================================
   V117 · Digital Hub deployment-final suite styling
   Visual-only refinement of the Hub shell. Navigation geometry, route
   behavior and manager/member capabilities remain owned by existing code.
   ===================================================================== */
:root{
  --hub-suite-page:#eaf1fb;
  --hub-suite-shell:#f5f9fe;
  --hub-suite-panel:#ffffff;
  --hub-suite-ink:#101a33;
  --hub-suite-ink-2:#3d4a66;
  --hub-suite-muted:#55617a;
  --hub-suite-line:#dfe7f2;
  --hub-suite-line-strong:#cbd6e5;
  --hub-suite-brand:#4e6ee2;
  --hub-suite-brand-strong:#3d5bd0;
  --hub-suite-brand-soft:#e3ecfd;
  --hub-suite-teal:#159b88;
  --hub-suite-violet:#6a55dd;
  --bg:var(--hub-suite-page);
  --surface:var(--hub-suite-panel);
  --surface-soft:#f7fafd;
  --surface-sunken:#eef3fa;
  --surface-raised:rgba(255,255,255,.96);
  --surface-tint:linear-gradient(180deg,rgba(255,255,255,.99),rgba(247,250,253,.97));
  --glass:rgba(250,252,255,.82);
  --glass-strong:rgba(255,255,255,.94);
  --glass-quiet:rgba(255,255,255,.62);
  --glass-line:rgba(35,55,90,.10);
  --ink:var(--hub-suite-ink);
  --ink-secondary:var(--hub-suite-ink-2);
  --muted:var(--hub-suite-muted);
  --line:var(--hub-suite-line);
  --line-strong:var(--hub-suite-line-strong);
  --accent:var(--hub-suite-brand);
  --accent-hover:var(--hub-suite-brand-strong);
  --accent-soft:var(--hub-suite-brand-soft);
  --info:var(--hub-suite-brand);
  --info-soft:var(--hub-suite-brand-soft);
  --info-line:#c7d5fa;
  --focus:0 0 0 3px rgba(78,110,226,.22);
  --elev-1:0 1px 2px rgba(16,26,51,.04),0 5px 16px rgba(16,26,51,.04);
  --elev-2:0 2px 6px rgba(16,26,51,.05),0 10px 26px rgba(16,26,51,.06);
  --elev-3:0 4px 12px rgba(16,26,51,.05),0 16px 40px rgba(16,26,51,.08);
  --elev-4:0 10px 24px rgba(16,26,51,.10),0 26px 72px rgba(16,26,51,.14);
}
[data-theme="dark"]{
  --hub-suite-page:#0c1220;
  --hub-suite-shell:#121a2b;
  --hub-suite-panel:#161f33;
  --hub-suite-ink:#eaf0fb;
  --hub-suite-ink-2:#b3c0d6;
  --hub-suite-muted:#9aa8bd;
  --hub-suite-line:#26324a;
  --hub-suite-line-strong:#34425e;
  --hub-suite-brand:#7b95ef;
  --hub-suite-brand-strong:#93a9f4;
  --hub-suite-brand-soft:#22304f;
  --hub-suite-teal:#58cbb5;
  --hub-suite-violet:#aa95f2;
  --bg:var(--hub-suite-page);
  --surface:var(--hub-suite-panel);
  --surface-soft:#1b2439;
  --surface-sunken:#121a2b;
  --surface-raised:rgba(22,31,51,.97);
  --surface-tint:linear-gradient(180deg,rgba(25,35,56,.98),rgba(18,27,45,.98));
  --glass:rgba(18,26,43,.84);
  --glass-strong:rgba(22,31,51,.95);
  --glass-quiet:rgba(22,31,51,.68);
  --glass-line:rgba(142,160,199,.15);
  --ink:var(--hub-suite-ink);
  --ink-secondary:var(--hub-suite-ink-2);
  --muted:var(--hub-suite-muted);
  --line:var(--hub-suite-line);
  --line-strong:var(--hub-suite-line-strong);
  --accent:var(--hub-suite-brand);
  --accent-hover:var(--hub-suite-brand-strong);
  --accent-soft:var(--hub-suite-brand-soft);
  --info:var(--hub-suite-brand);
  --info-soft:var(--hub-suite-brand-soft);
  --info-line:#344a79;
  --focus:0 0 0 3px rgba(123,149,239,.28);
  --elev-1:0 1px 2px rgba(0,0,0,.32),0 5px 16px rgba(0,0,0,.18);
  --elev-2:0 2px 8px rgba(0,0,0,.34),0 12px 28px rgba(0,0,0,.22);
  --elev-3:0 6px 18px rgba(0,0,0,.34),0 18px 44px rgba(0,0,0,.30);
  --elev-4:0 12px 30px rgba(0,0,0,.42),0 28px 80px rgba(0,0,0,.42);
}

body.imb-institutional-aurora{
  background:
    radial-gradient(circle at 92% 8%,color-mix(in srgb,var(--hub-suite-teal) 8%,transparent),transparent 30%),
    radial-gradient(circle at 15% 0%,color-mix(in srgb,var(--hub-suite-brand) 9%,transparent),transparent 34%),
    radial-gradient(circle at 72% 100%,color-mix(in srgb,var(--hub-suite-violet) 7%,transparent),transparent 29%),
    var(--bg)!important;
  color:var(--ink);
}

/* ---------- Shared Hub chrome: same visual family as HiwiLog/EventScope ---------- */
body.imb-institutional-aurora #hubSidebar{
  background:linear-gradient(180deg,color-mix(in srgb,var(--surface-raised) 97%,transparent),color-mix(in srgb,var(--surface-soft) 98%,transparent))!important;
  border-color:var(--line)!important;
}
body.imb-institutional-aurora .topbar{
  background:color-mix(in srgb,var(--surface-raised) 88%,transparent)!important;
  border-color:var(--line)!important;
  box-shadow:0 1px 0 color-mix(in srgb,var(--line) 70%,transparent),0 10px 28px rgba(16,26,51,.035)!important;
}
[data-theme="dark"] body.imb-institutional-aurora .topbar{box-shadow:0 1px 0 var(--line),0 10px 28px rgba(0,0,0,.18)!important}
body.imb-institutional-aurora #hubSidebar .brand-copy strong{color:var(--ink)!important}
body.imb-institutional-aurora #hubSidebar .nav-link{color:var(--ink-secondary)!important}
body.imb-institutional-aurora #hubSidebar .nav-link:hover{background:color-mix(in srgb,var(--accent-soft) 62%,transparent)!important;color:var(--accent)!important}
body.imb-institutional-aurora #hubSidebar .nav-link.active{
  background:linear-gradient(135deg,color-mix(in srgb,var(--accent-soft) 96%,var(--surface)),color-mix(in srgb,var(--accent-soft) 56%,var(--surface)))!important;
  color:var(--accent)!important;
  border-color:color-mix(in srgb,var(--accent) 22%,var(--line))!important;
  box-shadow:inset 3px 0 0 var(--accent),var(--elev-1)!important;
}
body.imb-institutional-aurora #hubSidebar .nav-icon{background:color-mix(in srgb,var(--accent-soft) 78%,var(--surface))!important;color:var(--accent)!important}
body.imb-institutional-aurora #hubSidebar .sidebar-section-label{color:var(--muted)!important}
body.imb-institutional-aurora #hubSidebar .profile-card{
  background:linear-gradient(145deg,var(--surface-raised),color-mix(in srgb,var(--accent-soft) 18%,var(--surface-raised)))!important;
  border-color:var(--line)!important;
}
body.imb-institutional-aurora #hubSidebar .profile-card .avatar,
.hub-session-avatar{
  background:var(--accent-soft)!important;
  color:var(--accent)!important;
  border:1px solid color-mix(in srgb,var(--accent) 16%,var(--line))!important;
}

/* Keep the accepted tablet / menu geometry; only repaint its cards. */
body.hub-manager-mode.imb-institutional-aurora #hubSidebar .sidebar-nav>.nav-link,
body.hub-manager-mode.imb-institutional-aurora #hubSidebar .sidebar-footer{
  background-color:color-mix(in srgb,var(--surface-raised) 94%,transparent);
  border-color:var(--line)!important;
}

/* ---------- Manager content ---------- */
body.imb-institutional-aurora .hub-content{color:var(--ink)}
body.imb-institutional-aurora .simple-intro{border-color:var(--line)}
body.imb-institutional-aurora .simple-intro .eyebrow,
body.imb-institutional-aurora .governance-head .eyebrow,
body.imb-institutional-aurora .ai-connection-head .eyebrow{color:var(--accent)!important}
body.imb-institutional-aurora .surface,
body.imb-institutional-aurora .person-row,
body.imb-institutional-aurora .registry-card,
body.imb-institutional-aurora .hub-app-launcher,
body.imb-institutional-aurora .search-box{
  background:var(--surface-tint)!important;
  border-color:var(--line)!important;
}
body.imb-institutional-aurora .person-row,
body.imb-institutional-aurora .registry-card,
body.imb-institutional-aurora .hub-app-launcher{box-shadow:var(--elev-2)!important}
body.imb-institutional-aurora .person-row:hover,
body.imb-institutional-aurora .hub-app-launcher:hover{border-color:color-mix(in srgb,var(--accent) 32%,var(--line))!important;box-shadow:var(--elev-3)!important}
body.imb-institutional-aurora .person-row.review-row{
  background:linear-gradient(90deg,var(--warning-soft),var(--surface-raised) 28%,var(--surface-raised))!important;
}
body.imb-institutional-aurora .governance-head{
  background:linear-gradient(135deg,color-mix(in srgb,var(--accent-soft) 40%,var(--surface-raised)),var(--surface-raised) 52%,color-mix(in srgb,var(--hub-suite-teal) 7%,var(--surface-raised)))!important;
}
body.imb-institutional-aurora .governance-action-icon{background:var(--accent-soft)!important;color:var(--accent)!important}
body.imb-institutional-aurora .workflow-number{background:var(--accent)!important;color:#fff!important;box-shadow:0 5px 14px color-mix(in srgb,var(--accent) 22%,transparent)}
body.imb-institutional-aurora .ai-connection-panel,
body.imb-institutional-aurora .workflow-panel,
body.imb-institutional-aurora .governance-panel{box-shadow:var(--elev-2)!important}

/* Home cards keep each app's own identity while the Hub supplies the neutral frame. */
body.imb-institutional-aurora .hub-app-launcher{background:linear-gradient(160deg,var(--surface-raised),color-mix(in srgb,var(--accent-soft) 13%,var(--surface-raised)))!important}
body.imb-institutional-aurora .hub-app-launcher .launcher-window-bar{background:color-mix(in srgb,var(--surface-soft) 80%,var(--surface-raised))!important;border-color:var(--line)!important}
body.imb-institutional-aurora .launcher-key-event_navigator .launcher-window-bar{box-shadow:inset 0 2px 0 #3677cf}
body.imb-institutional-aurora .launcher-key-hiwilog .launcher-window-bar{box-shadow:inset 0 2px 0 var(--hub-suite-violet)}
body.imb-institutional-aurora .launcher-key-event_navigator:before{background:radial-gradient(circle,rgba(54,119,207,.17),transparent 68%)!important}
body.imb-institutional-aurora .launcher-key-hiwilog:before{background:radial-gradient(circle,color-mix(in srgb,var(--hub-suite-violet) 17%,transparent),transparent 68%)!important}
body.imb-institutional-aurora .launcher-role{background:var(--accent-soft)!important;color:var(--accent)!important}
body.imb-institutional-aurora .launcher-open-pill,
body.imb-institutional-aurora .btn.btn-primary{background:linear-gradient(135deg,var(--accent),var(--accent-hover))!important;color:#fff!important;border-color:transparent!important;box-shadow:0 8px 20px color-mix(in srgb,var(--accent) 20%,transparent)!important}
body.imb-institutional-aurora .launcher-open-pill:hover,
body.imb-institutional-aurora .btn.btn-primary:hover{filter:brightness(.98);transform:translateY(-1px)}

/* ---------- One-step sign out for every authenticated Hub user ---------- */
.hub-session-identity{display:flex;align-items:center;gap:.48rem;min-width:0;padding:.22rem .34rem .22rem .26rem;border:1px solid var(--line);border-radius:999px;background:color-mix(in srgb,var(--surface-raised) 94%,transparent)}
.hub-session-avatar{width:1.9rem;height:1.9rem;border-radius:.7rem;display:grid;place-items:center;flex:none;font-size:.67rem;font-weight:800;letter-spacing:.02em}
.hub-session-copy{display:grid;gap:0;min-width:0;padding-right:.34rem;line-height:1.15}
.hub-session-copy strong{max-width:9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.71rem;color:var(--ink);font-weight:700}
.hub-session-copy small{font-size:.6rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-weight:650}
.hub-direct-signout{display:inline-flex;align-items:center;justify-content:center;gap:.42rem;min-height:2.35rem;padding:.46rem .7rem;border:1px solid var(--line);border-radius:999px;background:var(--surface-raised);color:var(--ink-secondary);font:inherit;font-size:.72rem;font-weight:700;cursor:pointer;transition:border-color .16s ease,background .16s ease,color .16s ease,transform .16s ease}
.hub-direct-signout svg{width:1rem;height:1rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hub-direct-signout:hover{border-color:var(--danger-line);background:var(--danger-soft);color:var(--danger);transform:translateY(-1px)}
.hub-direct-signout:focus-visible{outline:none;box-shadow:var(--focus)}
/* Managers keep the accepted desktop sidebar sign-out; compact manager layouts use the same direct topbar action. */
body.hub-manager-mode .hub-session-identity,
body.hub-manager-mode .hub-direct-signout{display:none}
@media(max-width:1050px){
  body.hub-manager-mode .hub-session-identity,
  body.hub-manager-mode .hub-direct-signout{display:flex}
}
@media(max-width:680px){
  .hub-session-copy{display:none}
  .hub-session-identity{padding:.2rem}
  .hub-direct-signout{width:2.35rem;min-width:2.35rem;padding:0}
  .hub-direct-signout span{display:none}
}
@media(max-width:420px){
  .hub-session-identity{display:none!important}
}

/* ---------- Deployment-ready authentication ---------- */
.login-page{
  background:
    radial-gradient(circle at 90% 12%,color-mix(in srgb,var(--hub-suite-teal) 9%,transparent),transparent 28%),
    radial-gradient(circle at 8% 8%,color-mix(in srgb,var(--accent) 10%,transparent),transparent 34%),
    radial-gradient(circle at 72% 100%,color-mix(in srgb,var(--hub-suite-violet) 8%,transparent),transparent 28%),
    var(--bg)!important;
}
.login-shell{border:1px solid color-mix(in srgb,var(--line) 86%,transparent)!important;background:var(--surface-raised)!important;box-shadow:var(--elev-4)!important}
.login-story{
  background:linear-gradient(145deg,#173d70 0%,#315fb1 47%,#5d60db 76%,#278fa1 118%)!important;
  box-shadow:none!important;
}
.login-story:before{content:"";position:absolute;inset:0;background:linear-gradient(160deg,rgba(255,255,255,.055),transparent 36%,rgba(255,255,255,.02));pointer-events:none}
.login-story:after{border-color:rgba(255,255,255,.14)!important;box-shadow:0 0 0 4rem rgba(255,255,255,.025),0 0 0 8rem rgba(255,255,255,.014)!important}
.login-form-panel{background:var(--surface-raised)!important;box-shadow:none!important}
.login-form-panel .field input{background:var(--surface)!important;border-color:var(--line)!important;color:var(--ink)!important}
.login-form-panel .field input:focus{border-color:var(--accent)!important;box-shadow:var(--focus)!important}
.login-inline-help{margin:-.28rem 0 .05rem;color:var(--muted);font-size:.74rem;line-height:1.45}
.new-account-fields{grid-template-columns:1fr 1fr}
.account-create-copy{grid-column:1/-1;display:grid;gap:.12rem;padding:.72rem .78rem;border:1px solid color-mix(in srgb,var(--accent) 20%,var(--line));border-radius:.85rem;background:color-mix(in srgb,var(--accent-soft) 54%,var(--surface));color:var(--ink-secondary)}
.account-create-copy strong{font-size:.78rem;color:var(--accent)}
.account-create-copy span{font-size:.72rem;line-height:1.4;color:var(--muted)}
.hub-auth-steps{display:grid;grid-template-columns:auto 1fr auto 1fr auto;align-items:center;gap:.45rem;margin:-.4rem 0 .1rem}
.hub-auth-steps>i{height:1px;background:var(--line)}
.hub-auth-steps>span{display:inline-flex;align-items:center;gap:.34rem;color:var(--muted);white-space:nowrap;font-size:.68rem;font-weight:650}
.hub-auth-steps b{width:1.42rem;height:1.42rem;display:grid;place-items:center;border-radius:.48rem;background:var(--surface-sunken);border:1px solid var(--line);font-size:.62rem;color:var(--muted)}
.hub-auth-steps em{font-style:normal}
.hub-auth-steps span.active{color:var(--accent)}
.hub-auth-steps span.active b{background:var(--accent-soft);border-color:color-mix(in srgb,var(--accent) 28%,var(--line));color:var(--accent)}
.hub-auth-steps span.complete{color:var(--success)}
.hub-auth-steps span.complete b{background:var(--success-soft);border-color:var(--success-line);color:var(--success)}
.hub-auth-notice{display:flex;align-items:flex-start;gap:.65rem;padding:.7rem .78rem;border:1px solid var(--success-line);border-radius:.9rem;background:var(--success-soft);color:var(--ink-secondary)}
.hub-auth-notice>span{width:1.5rem;height:1.5rem;display:grid;place-items:center;flex:none;border-radius:.48rem;background:color-mix(in srgb,var(--success) 12%,transparent);color:var(--success);font-weight:800}
.hub-auth-notice>div{display:grid;gap:.08rem}.hub-auth-notice strong{font-size:.76rem;color:var(--success)}.hub-auth-notice small{font-size:.7rem;line-height:1.35;color:var(--muted)}
.verification-recovery .btn{min-height:2.55rem}
.otp-input{font-variant-numeric:tabular-nums}

[data-theme="dark"] .login-story{background:linear-gradient(145deg,#122c50 0%,#264d8d 48%,#514aa9 78%,#176975 120%)!important}
[data-theme="dark"] .login-shell{border-color:var(--line)!important}
[data-theme="dark"] .hub-direct-signout:hover{background:color-mix(in srgb,var(--danger-soft) 86%,var(--surface))}

@media(max-width:700px){
  .login-page{background:radial-gradient(circle at 88% 4%,color-mix(in srgb,var(--hub-suite-teal) 8%,transparent),transparent 28%),var(--bg)!important}
  .login-story{background:linear-gradient(155deg,#173d70,#315fb1 58%,#5b5dd5 88%,#278fa1 125%)!important}
  .login-form-panel{background:var(--surface-raised)!important}
  .hub-auth-steps{margin:-.05rem 0 .1rem}
}
@media(max-width:520px){
  .new-account-fields{grid-template-columns:1fr}
  .account-create-copy{grid-column:auto}
  .hub-auth-steps{grid-template-columns:auto 1fr auto 1fr auto;gap:.28rem}
  .hub-auth-steps em{display:none}
}
