/* v439 UI FIX: topbar buttons, Dawlance brand box, loading screen, polish (loads LAST) */

/* ---- 1. TOPBAR: labelled buttons were forced to 36px => text spilled out ---- */
html body .topbar-right{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-end;gap:6px!important}
html body .topbar-right>button{flex:0 0 auto}
html body .topbar-right .backup-btn,
html body .topbar-right .force-logout-btn,
html body .topbar-right .settings-btn,
html body .topbar-right .logout-btn,
html body .topbar-right #dbManagerBtn{
  width:auto!important;min-width:0!important;height:36px;padding:0 13px!important;
  white-space:nowrap;gap:7px;font-size:.74rem;font-weight:700;letter-spacing:.01em;
  border-radius:11px!important;line-height:1;overflow:visible}
html body .topbar-right #dbManagerBtn{background:linear-gradient(135deg,#4f46e5,#3b82f6)!important;margin-left:4px}
html body .topbar-right .backup-btn{background:linear-gradient(135deg,#0d9488,#14b8a6)!important}
html body .topbar-right .settings-btn:not(#dbManagerBtn){background:linear-gradient(135deg,#7c3aed,#a855f7)!important}
html body .topbar-right .force-logout-btn{background:linear-gradient(135deg,#d97706,#f59e0b)!important}
html body .topbar-right .logout-btn{background:linear-gradient(135deg,#dc2626,#ef4444)!important;color:#fff!important}
html body .topbar-right .logout-btn i,
html body .topbar-right .backup-btn i,
html body .topbar-right .settings-btn i,
html body .topbar-right .force-logout-btn i{font-size:.8rem}
html body .topbar-right .backup-btn:hover,
html body .topbar-right .settings-btn:hover,
html body .topbar-right .force-logout-btn:hover,
html body .topbar-right .logout-btn:hover{filter:brightness(1.08);transform:translateY(-1px);box-shadow:0 6px 16px rgba(15,23,42,.22)}
/* icon-only buttons: neat square, subtle divider after them */
html body .topbar-right .profile-btn,
html body .topbar-right .shortcuts-btn,
html body .topbar-right .dark-mode-btn,
html body .topbar-right .refresh-btn,
html body .topbar-right .message-btn{width:36px!important;min-width:36px;padding:0}
/* the little cut-off scrollbar/tooltips never clip the topbar */
html body .main .topbar{overflow:visible}

/* ---- 2. SIDEBAR BRAND: proper Dawlance logo box ---- */
.sidebar .logo.wms-brand{display:flex;align-items:center;gap:12px;margin:0 2px 14px;padding:10px 12px;text-align:left;
  background:linear-gradient(135deg,rgba(255,255,255,.10),rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.14);border-radius:16px;
  box-shadow:0 12px 28px rgba(2,10,30,.38),inset 0 1px 0 rgba(255,255,255,.10);letter-spacing:0;font-size:1rem}
.sidebar .logo.wms-brand:after{content:none!important;display:none!important}
.wb-plate{flex:0 0 auto;display:grid;place-items:center;width:104px;height:46px;padding:6px 10px;background:#fff;border-radius:12px;
  border-bottom:3px solid #e30a17;box-shadow:0 6px 16px rgba(0,0,0,.28)}
.wb-plate img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.wb-text{min-width:0;display:flex;flex-direction:column;gap:5px}
.wb-text b{display:block;font-size:1.3rem;font-weight:900;letter-spacing:.16em;color:#fff;line-height:1}
.wb-text small{display:block;font-size:.5rem;font-weight:700;letter-spacing:.13em;text-transform:uppercase;color:#9db8e8;line-height:1.2;white-space:normal}

/* ---- 3. LOADING SCREEN: always covers sidebar / left strip ---- */
.loading-screen{z-index:2147483000!important}
body:has(.loading-screen.show) .sidebar{visibility:hidden}
.loading-screen .ls-steps,.loading-screen .loading-text{max-width:92vw}

/* ---- 4. POLISH ---- */
html{scroll-behavior:smooth}
:focus-visible{outline:2px solid #4b8dff;outline-offset:2px}
.main .topbar .welcome{white-space:nowrap}
.cc-hero h1{text-wrap:balance}
.cc-kpi,.cc-lanes button,.cc-panel{transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.cc-lanes button:hover{transform:translateY(-1px);border-color:color-mix(in srgb,#1769ff 45%,var(--card-border));box-shadow:0 8px 20px rgba(9,38,83,.10)}
.sidebar .nav-btn{white-space:nowrap;text-overflow:ellipsis}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
@media (max-width:900px){
  .wb-plate{width:92px;height:40px}
  html body .topbar-right{justify-content:flex-start}
}
