/* Stable layout and recoverable errors across direct and in-app navigation. */
html { scrollbar-gutter: stable; scroll-behavior: auto; }
#app-error { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); z-index:3000; max-width:min(90vw,640px); padding:14px 18px; border:1px solid #b45309; border-radius:8px; background:#fffbeb; color:#78350f; box-shadow:0 4px 16px #0002; }
#app-error button { margin-left:8px; padding:6px 12px; cursor:pointer; }
.dv2-clock-strip { min-height:40px; }
.dv2-kpi-value { min-height:40px; font-variant-numeric:tabular-nums; }
.dv2-card { min-height:120px; }
#ll-sidebar-brand-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

main { scroll-margin-top:90px; }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:0.01ms!important; transition-duration:0.01ms!important; } }
/* The header has no welcome text: centre the search between the edges and keep the buttons on the right. */
@media(min-width:1101px){#ll-header>.dash__brand{flex:1 1 0;min-width:0}#ll-header>.admin__header-actions{flex:1 1 0;justify-content:flex-end}#ll-header>.global-search{flex:0 1 500px}}

/* Slim top bar (Option B): one height drives the bar and every offset below it. */
:root{--ll-header-h:50px}
@media(max-width:1099px){:root{--ll-header-h:54px}}
#ll-header,body.ll-has-sidebar #ll-header{height:var(--ll-header-h)!important;min-height:var(--ll-header-h)!important}
.dash{padding-top:var(--ll-header-h)!important}
@media(max-width:760px){.dash{padding-top:calc(var(--ll-header-h) + 16px)!important}}
#dashboard-home,.dv2-main{margin-top:var(--ll-header-h)!important}
#ll-header .global-search{height:34px!important;max-width:500px!important}
#ll-header .global-search input.global-search__input{height:30px!important;min-height:0!important;padding-top:0!important;padding-bottom:0!important;font-size:13px!important}
#ll-header .global-search-dropdown{top:calc(100% + 10px)!important}
#ll-header .admin__header-actions{gap:8px!important}
#ll-header .icon-btn{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important}
#ll-header .icon-btn svg{width:15px!important;height:15px!important}
#ll-header-avatar{font-size:11px!important}
@media(min-width:1100px){.ll-sidebar{padding-top:0!important}.ll-sidebar__brand{padding-top:10px!important;padding-bottom:10px!important;min-height:var(--ll-header-h);box-sizing:border-box}}
@media(max-width:1099px){
  #ll-header .icon-btn{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important}
  #ll-header .icon-btn svg{width:17px!important;height:17px!important}
  .ll-sidebar-toggle{top:calc((var(--ll-header-h) - 42px) / 2)!important}
}
@media(max-width:760px){#ll-header .dropdown-menu,.dropdown-menu{top:calc(var(--ll-header-h) + 6px)}}
/* Sidebar: the brand stays fixed at the top and only the menu below it scrolls, so the scrollbar starts right under the
   brand bar. The scrollbar is thin and only shows while the mouse is over the menu. */
#ll-sidebar.ll-sidebar{display:flex!important;flex-direction:column;overflow:hidden!important;padding-bottom:0!important}
#ll-sidebar .ll-sidebar__brand{flex:none}
#ll-sidebar .ll-sidebar__scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;margin:0 -12px;padding:4px 12px 24px;overscroll-behavior:contain}
@supports not selector(::-webkit-scrollbar){#ll-sidebar .ll-sidebar__scroll{scrollbar-width:thin;scrollbar-color:transparent transparent}#ll-sidebar:hover .ll-sidebar__scroll,#ll-sidebar .ll-sidebar__scroll:focus-within{scrollbar-color:rgba(255,255,255,.22) transparent}}
#ll-sidebar .ll-sidebar__scroll::-webkit-scrollbar{width:6px}
#ll-sidebar .ll-sidebar__scroll::-webkit-scrollbar-track{background:transparent}
#ll-sidebar .ll-sidebar__scroll::-webkit-scrollbar-thumb{background:transparent;border-radius:6px}
#ll-sidebar:hover .ll-sidebar__scroll::-webkit-scrollbar-thumb,#ll-sidebar .ll-sidebar__scroll:focus-within::-webkit-scrollbar-thumb{background:rgba(255,255,255,.28)}
#ll-sidebar .ll-sidebar__scroll::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.38)}
/* AI assistant button in the top bar (placeholder until the assistant is built). */
#ll-header .ll-ai-btn svg{color:#e3b866}
#ll-header .ll-ai-menu{width:280px;padding:14px 16px;right:0;left:auto}
#ll-header .ll-ai-menu__title{margin:0 0 6px;font-weight:600;font-size:14px!important;color:var(--theme-text,#12181F)}
#ll-header .ll-ai-menu__text{margin:0;font-size:13px!important;line-height:1.5;color:var(--theme-muted,#5b6d64)}
/* Account menu: "My profile" link above Log out. */
#account-menu .account-menu__link{display:flex;align-items:center;gap:10px;margin:8px 8px 0;padding:10px 12px;border-radius:10px;color:var(--text-light,#12181F);text-decoration:none;font-size:14px;font-weight:500}
#account-menu .account-menu__link:hover{background:var(--theme-soft,#f3f5f4)}
#account-menu .account-menu__link svg{color:var(--text-light-muted,#5b6d64)}
/* Workspace colours: the side menu and top bar use the sign-in page greens (dark #122c26, lighter #25594a). */
:root{--shell-bg:#122c26;--shell-accent:#25594a}
#ll-sidebar.ll-sidebar,#ll-header,.ll-sidebar-toggle{background:var(--shell-bg)!important}
#ll-header{border-bottom:1px solid rgba(255,255,255,.06)}
#ll-sidebar .ll-nav-item:hover{background:rgba(255,255,255,.07)}
#ll-sidebar .ll-nav-item.is-active{background:var(--shell-accent)!important;color:#fff!important}
#ll-sidebar .ll-nav-item.is-active svg{color:#e3b866}
#ll-header .global-search__input{background:rgba(255,255,255,.08)!important;border-color:rgba(255,255,255,.14)!important}
#ll-header .global-search__input:focus{background:rgba(255,255,255,.12)!important;border-color:rgba(255,255,255,.28)!important}
#ll-header .global-search__input::placeholder{color:#a9bdb5}
#ll-header .icon-btn{background:rgba(255,255,255,.07)!important}
#ll-header .icon-btn:hover{background:rgba(255,255,255,.14)!important}
/* ---------- Icon strip + panel menu ---------- */
#ll-sidebar.ll-sidebar--rail{padding-left:80px!important}
#ll-sidebar .ll-rail{position:absolute;left:0;top:0;bottom:0;width:68px;background:#0e231e;display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 0;z-index:3}
#ll-sidebar .ll-rail__btn{position:relative;width:52px;height:52px;padding:0!important;min-height:0!important;border:0!important;border-radius:12px!important;background:transparent!important;color:#8fb0a4!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer}
#ll-sidebar .ll-rail__btn svg{width:20px;height:20px}
#ll-sidebar .ll-rail__btn span{font-size:9.5px;font-weight:600;letter-spacing:.01em;line-height:1;max-width:60px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ll-sidebar .ll-rail__btn:hover{background:rgba(255,255,255,.07)!important;color:#fff!important}
#ll-sidebar .ll-rail__btn.is-on{background:#25594a!important;color:#fff!important}
#ll-sidebar .ll-rail__dot{position:absolute;top:8px;right:10px;width:8px;height:8px;border-radius:50%;background:#d6a24c;box-shadow:0 0 0 2px #0e231e}
#ll-sidebar .ll-rail__dot[hidden]{display:none}
#ll-sidebar .ll-rail__gap{flex:1}
#ll-sidebar .ll-off{display:none!important}
#ll-sidebar .ll-nav-section-label.ll-sec-title{margin:6px 0 14px!important;padding:0 10px!important;font-family:"Space Grotesk",Inter,sans-serif!important;font-size:18px!important;font-weight:600!important;letter-spacing:0!important;text-transform:none!important;color:#fff!important;opacity:1!important}
#ll-sidebar .ll-nav-section-label.ll-sec-title::after{content:attr(data-desc);display:block;margin-top:2px;font-family:Inter,sans-serif;font-size:12px;font-weight:400;color:#8fb0a4}
#ll-sidebar .ll-pin::before{content:"★"}
#ll-sidebar .ll-pin{margin-left:auto;padding:0 2px;color:#8fb0a4;font-size:13px;line-height:1;opacity:0;transition:opacity .12s;cursor:pointer}
#ll-sidebar .ll-nav-item__badge:not([hidden]) + .ll-pin{margin-left:6px}
#ll-sidebar .ll-nav-item:hover .ll-pin,#ll-sidebar .ll-pin:focus{opacity:1}
#ll-sidebar .ll-pin.is-pinned{opacity:1;color:#d6a24c}
#ll-sidebar .ll-pin:hover{color:#f0d199}
#ll-sidebar .ll-pinned{margin-top:18px;padding-top:12px;border-top:1px solid rgba(255,255,255,.08)}
#ll-sidebar .ll-pinned__label{margin:0 10px 6px;font-size:10.5px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:#7fa294}
#ll-sidebar .ll-pinned .ll-nav-item{font-size:13px}
@media (min-width:1100px){
  body.ll-has-sidebar{margin-left:288px}
  body.ll-has-sidebar .dash__header,body.ll-has-sidebar #ll-header{left:288px}
  #ll-sidebar.ll-sidebar{width:288px}
  body.ll-panel-collapsed.ll-has-sidebar{margin-left:68px}
  body.ll-panel-collapsed.ll-has-sidebar .dash__header,body.ll-panel-collapsed.ll-has-sidebar #ll-header{left:68px}
  body.ll-panel-collapsed #ll-sidebar.ll-sidebar{width:68px;padding-left:68px!important;padding-right:0!important}
  body.ll-panel-collapsed #ll-sidebar .ll-sidebar__brand,body.ll-panel-collapsed #ll-sidebar .ll-sidebar__scroll{display:none!important}
}
@media (max-width:1099px){
  #ll-sidebar.ll-sidebar{width:300px!important;max-width:92vw}
  #ll-sidebar .ll-rail__collapse{display:none}
  #ll-sidebar .ll-pin{opacity:.55}
}
/* Signed-in person at the bottom of the menu panel. */
#ll-sidebar .ll-me{flex:none;display:flex;align-items:center;gap:10px;margin:8px 0 12px;padding:10px;border-radius:12px;background:rgba(255,255,255,.06);text-decoration:none;color:#fff}
#ll-sidebar .ll-me[hidden]{display:none}
#ll-sidebar .ll-me:hover{background:rgba(255,255,255,.1)}
#ll-sidebar .ll-me__av{width:36px;height:36px;border-radius:50%;background:#e3b866;color:#122c26;display:inline-flex;align-items:center;justify-content:center;font:700 12.5px Inter,sans-serif;flex:none}
#ll-sidebar .ll-me__txt{min-width:0}
#ll-sidebar .ll-me__txt b{display:block;font-size:13.5px;font-weight:600;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ll-sidebar .ll-me__txt small{display:block;font-size:11.5px;color:#8fb0a4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (min-width:1100px){body.ll-panel-collapsed #ll-sidebar .ll-me{display:none!important}}
