/* v0.44 · Applied LAST, after the legacy administrative styles.
   Only visual user settings; access checks remain server-side. */

/* Reset legacy .nav-link span cascade that split labels and painted them orange. */
.sidebar .nav-link>span{
 display:block;min-width:0;width:auto;max-width:100%;flex:1 1 auto;
 text-align:left;font-size:11.5px;line-height:1.35;letter-spacing:0;
 font-weight:600;color:inherit;white-space:normal;overflow-wrap:normal;
 word-break:normal;
}
.sidebar .nav-link>.ui-icon{color:#a0becc;flex:0 0 16px}
.sidebar .nav-link.current>span,.sidebar .nav-link:hover>span{color:inherit}
.sidebar .nav-link.current>.ui-icon{color:#ffac85}
.sidebar .nav-link{min-height:40px;gap:10px}
.sidebar nav{gap:2px}
.sidebar .nav-label{font-size:9px;font-weight:800}
.brand>span{font-size:11px}
#desktop-nav-toggle{display:inline-flex;width:34px;height:34px}
#desktop-nav-toggle .ui-icon{width:18px;height:18px}
#desktop-nav-toggle[aria-pressed="true"]{background:#fff1e7;color:#b75e34;border-color:#f1ccb9}
.user-welcome{margin:0 0 9px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#welcome-greeting{color:#193d4c;font-size:14px;letter-spacing:-.01em;font-weight:800}
.welcome-role{font-size:10px;background:#edf6f3;color:#36785d;border:1px solid #d4e9df;padding:4px 9px;border-radius:20px;font-weight:700}
.profile-shortcut{font:inherit;min-height:38px;gap:9px;cursor:pointer;background:#fff}
.profile-initials{width:28px;height:28px;display:grid;place-items:center;border-radius:9px;background:#fbe6d8;color:#af5f36;font-size:10px;font-weight:900;flex-shrink:0}
#profile-top-name{font-size:11px;color:#475d6a;max-width:160px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#workspace-preferences{animation:ws-enter .2s ease}
.preferences-screen>.panel{margin:0 0 18px}
.preferences-intro{background:linear-gradient(135deg,#fff,#fffcf8)}
.profile-summary{display:flex;align-items:center;gap:15px;border-radius:13px;border:1px solid #e4ecf0;background:#fff;padding:18px}
.profile-avatar{display:grid;place-items:center;width:54px;height:54px;border-radius:14px;background:#ffe8d9;color:#b85e31;font-size:19px;font-weight:850;flex-shrink:0}
.profile-summary>div{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}
.profile-summary strong{font-size:15px;color:#2b4150;overflow-wrap:anywhere}
.profile-summary div span{font-size:12px;color:#7a8d99;overflow-wrap:anywhere}
.profile-summary a{font-size:11px;white-space:nowrap;text-decoration:none;color:#b45d39;font-weight:800;padding:9px}
.preferences-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.preference-card{margin:0!important;padding:25px;display:flex;align-items:stretch;flex-direction:column;gap:12px}
.preference-card h3{font-size:17px;letter-spacing:-.02em}
.preference-card>p{font-size:12px;line-height:1.7;color:#7f8d9a;margin:0 0 8px}
.preference-card>label:not(.pref-check){font-size:12px;color:#364e5e;font-weight:800}
.preference-card select{padding:12px;border-radius:10px;border:1px solid #d8e3e9;background:#fff;color:#304758;font-size:13px;width:100%}
.preference-card .pref-check{display:flex;align-items:flex-start;gap:10px;font-size:12px;color:#3f5565;line-height:1.6;border:1px solid #e8edf0;background:#fbfcfd;border-radius:10px;padding:13px;cursor:pointer}
.preference-card .pref-check input{accent-color:#d97340;width:17px;height:17px;flex-shrink:0;margin-top:2px}
.preference-card small{font-size:11px;line-height:1.6;color:#8796a2}
.preferences-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:22px 0}
.preferences-actions span{color:#718493;font-size:12px;line-height:1.55}
html[data-density="compact"] .panel{padding:20px}
html[data-density="compact"] .mini-card{min-height:94px;padding:15px}
html[data-density="compact"] .field{gap:6px}
html[data-density="compact"] .welcome-hero{min-height:233px}
html[data-density="compact"] .directory-card{padding:13px}
html[data-density="compact"] .sidebar .nav-link{min-height:36px;padding:8px 9px}

/* Desktop only: true compact rail; mobile drawer always opens full width. */
@media (min-width:661px){
 body.sidebar-collapsed .sidebar{
  width:74px;flex:0 0 74px;padding:19px 9px;transition:width .18s ease,flex-basis .18s ease
 }
 body.sidebar-collapsed .sidebar .brand{display:flex;align-items:center;justify-content:center;
  padding:0 0 20px;margin:0;min-height:66px;position:relative}
 body.sidebar-collapsed .sidebar .brand img,body.sidebar-collapsed .sidebar .brand>span{display:none}
 body.sidebar-collapsed .sidebar .brand:after{
  content:"T3";background:#fff;color:#ce663b;font-weight:900;font-size:15px;
  display:grid;place-items:center;width:40px;height:40px;border-radius:11px
 }
 body.sidebar-collapsed .sidebar .nav-label,
 body.sidebar-collapsed .sidebar .environment-label,
 body.sidebar-collapsed .sidebar .sidebar-note,
 body.sidebar-collapsed .sidebar .sidebar-footer,
 body.sidebar-collapsed .sidebar .nav-link>span{display:none}
 body.sidebar-collapsed .sidebar nav{gap:6px}
 body.sidebar-collapsed .sidebar .nav-link{
  display:flex;align-items:center;justify-content:center;padding:12px 0;min-height:47px;
  border-radius:10px;width:100%;gap:0
 }
 body.sidebar-collapsed .sidebar .nav-link>.ui-icon{width:19px;height:19px;flex-basis:19px}
 body.sidebar-collapsed .sidebar .nav-link.current{box-shadow:inset 3px 0 #e67c48}
 body.sidebar-collapsed .main{min-width:0;flex:1}
}
@media (max-width:1100px){
 #profile-top-name{max-width:95px}
}
@media (max-width:850px){
 .preferences-grid{grid-template-columns:1fr}
 .profile-summary{flex-wrap:wrap}
 .profile-summary a{margin-left:60px}
}
@media (max-width:660px){
 #desktop-nav-toggle{display:none}
 .sidebar .nav-link>span{font-size:12px;line-height:1.4;white-space:normal;word-break:normal}
 .sidebar .nav-link{gap:11px;padding:11px 12px;min-height:44px}
 .sidebar .nav-link>.ui-icon{flex-basis:17px;width:17px;height:17px}
 #profile-top-name{display:none}
 #welcome-greeting{font-size:13px}
 .profile-summary a{margin-left:0;width:100%}
 .preferences-grid{grid-template-columns:1fr}
 .preferences-actions{align-items:flex-start}
}

/* Dark palette: meaningful contrast in content and inputs, not just an inverted sidebar. */
html[data-theme="dark"]{color-scheme:dark;background:#0d1824}
html[data-theme="dark"] body,
html[data-theme="dark"] .main{background:#101d29;color:#deebf3}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .directory-card,
html[data-theme="dark"] .guest-card,
html[data-theme="dark"] .selected-company,
html[data-theme="dark"] .profile-summary,
html[data-theme="dark"] .preference-card .pref-check{
 background:#172837;color:#e2edf5;border-color:#304352;box-shadow:none
}
html[data-theme="dark"] .panel.subdued,html[data-theme="dark"] .preferences-intro{
 background:#172837
}
html[data-theme="dark"] :is(.page-heading h1,.section-title,.section-heading h2,.mini-card strong,.module-preview strong,
.directory-card-main strong,.solution-card h3,.profile-summary strong,#welcome-greeting,.breadcrumbs strong,
.preference-card h3,.preference-card>label:not(.pref-check),.field>label){color:#edf5fa}
html[data-theme="dark"] :is(.lead,.section-hint,.helper,.section-heading p,.preference-card>p,
.profile-summary div span,.guest-card>p,.directory-heading span,.mini-card>span:last-child,
.preference-card small,.module-preview small){color:#a9becd}
html[data-theme="dark"] :is(.field select,.field textarea,.guest-card textarea,
.preference-card select,.directory-search,.directory-search input,#accept-link-value){
 background:#122330;color:#edf5fa;border-color:#3c5262
}
html[data-theme="dark"] .directory-search input{background:transparent}
html[data-theme="dark"] .topbar .light,html[data-theme="dark"] .breadcrumbs,
html[data-theme="dark"] .account-link,html[data-theme="dark"] .account-link span{
 color:#b9cbd8!important
}
html[data-theme="dark"] .account-link{background:#1a3041;border-color:#3d5567}
html[data-theme="dark"] .module-banner,html[data-theme="dark"] .solution-card{
 background:#172837;border-color:#354e5e;color:#e9f3f8
}
html[data-theme="dark"] .module-banner h2,
html[data-theme="dark"] .solution-card h3{color:#edf5fa}
html[data-theme="dark"] .module-banner p,
html[data-theme="dark"] .solution-card p{color:#b6c7d5}
html[data-theme="dark"] .module-preview,
html[data-theme="dark"] .directory-heading{border-color:#355064}
html[data-theme="dark"] .directory-tag{background:#234536;color:#bde6ce}
html[data-theme="dark"] .directory-tag.paused{background:#2b3c4e;color:#b8cad8}
html[data-theme="dark"] .directory-empty{background:#172837;border-color:#3b5363;color:#c4d3dd}
html[data-theme="dark"] .connection-badge,html[data-theme="dark"] .welcome-role,
html[data-theme="dark"] .status.ready{background:#1a4037;color:#bee8d7;border-color:#2d6655}
html[data-theme="dark"] .status:not(.ready){background:#172837;color:#b8cbd7;border-color:#395465}
html[data-theme="dark"] .module-state{background:#253c4d;color:#b7c7d3}
html[data-theme="dark"] .profile-summary a,
html[data-theme="dark"] .directory-card-footer button:not(:disabled){color:#ffb88e}
@media(prefers-reduced-motion:reduce){
 body.sidebar-collapsed .sidebar{transition:none!important}
}
