/*
 * UI · css/nexus.css · the NEXUS shell: wide sidebar, top bar, Home as a page, Document Library header.
 * Pure layout over the existing ids (see js/workspace/nexus.js).
 */
:root { --rail-w: 232px; --top-h: 64px; }

/* ---------------------------------------------------------------- sidebar */
.appbar-actions { width: var(--rail-w) !important; padding: 14px 12px 14px !important; gap: 2px !important; background: var(--side-bg) !important; align-items: stretch; }
.appbar-actions::before { display: none !important; }
.side-logo { display: flex !important; align-items: center; gap: 10px; padding: 4px 8px 18px; order: 0; }
.side-logo .logo-mark { width: 36px; height: 36px; }
.side-logo .logo-text { color: #fff !important; font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.side-logo .logo-vendor { color: #8EA2CF !important; font-size: 11px; letter-spacing: .02em; text-transform: none; }
.appbar-actions .top-action { flex-direction: row !important; justify-content: flex-start; gap: 12px !important; min-height: 42px !important; height: 42px;
  padding: 0 12px !important; border-radius: 10px !important; font-size: 14px !important; color: #C8D3EE !important; }
.appbar-actions .top-action span { max-width: none !important; }
.appbar-actions .top-action .ic { width: 20px !important; height: 20px !important; color: #AFC0E8 !important; flex: none; }
.appbar-actions .top-action:hover { background: rgba(255,255,255,.07) !important; color: #fff !important; }
.appbar-actions .top-action::after { display: none !important; }
.appbar-actions .top-action.nav-on { background: var(--brand) !important; color: #fff !important; box-shadow: 0 6px 16px rgba(var(--brand-rgb), .35); }
.appbar-actions .top-action.nav-on .ic { color: #fff !important; }
.appbar-actions .badge { position: static !important; margin-left: auto; box-shadow: none !important; }
#top-dash { order: 1; } #top-ai { order: 2; } #top-docs { order: 3; } #top-tasks { order: 4; } #top-inbox { order: 5; } #top-analytics { order: 6; }
#top-bookmarks { order: 7; margin-top: 14px; } #top-history { order: 8; } #top-recycle { order: 9; }
#top-admin { order: 10; margin-top: 14px; } #top-settings { order: 11; }
#top-logout { order: 20; margin-top: auto !important; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0 0 10px 10px !important; }
#top-docs .ic { filter: grayscale(1) brightness(2.2); }

/* ---------------------------------------------------------------- top bar */
.appbar { height: var(--top-h) !important; gap: 16px !important; border-bottom: 1px solid #E8ECF4; }
.appbar .logo-moved { display: none !important; }
.appbar .quick-search { max-width: 720px !important; }
.appbar .quick-search input { height: 42px !important; border-radius: 12px !important; background: #F4F6FB !important; padding-right: 64px !important; }
.appbar .quick-search::after { content: "Ctrl K"; position: absolute; right: 44px; top: 50%; transform: translateY(-50%); font: 600 11px/1 Roboto, sans-serif;
  color: #8A96AD; border: 1px solid #DDE3EE; border-radius: 6px; padding: 4px 6px; pointer-events: none; }
.appbar .quick-search { position: relative; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top-upload { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--brand); color: #fff;
  font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: 0 6px 14px rgba(var(--brand-rgb), .3); }
.top-upload:hover { background: var(--brand-dark); }
.top-upload .ic { width: 18px; height: 18px; color: #fff; }
.topbar-right .top-action { flex-direction: row !important; align-items: center; gap: 8px; height: 40px; min-height: 40px; padding: 0 10px; border-radius: 10px;
  background: transparent; border: 0; color: #344054; font-size: 13.5px; position: relative; }
.topbar-right .top-action:hover { background: #F2F5FB; }
#top-alerts span:not(.badge) { display: none; }
#top-alerts .ic { width: 22px; height: 22px; }
#top-profile::before { content: attr(data-initials); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2456E6, #7C3AED); color: #fff; font-weight: 700; font-size: 13px; }
#top-profile .ic { display: none; }
#top-profile span { font-weight: 600; color: #1D2939; }

/* ---------------------------------------------------------------- Home as a page next to the sidebar */
#dash[open] { position: fixed !important; inset: var(--top-h) 0 0 var(--rail-w) !important; width: auto !important; height: auto !important;
  max-width: none !important; max-height: none !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important;
  z-index: 25; background: #F5F7FB !important; box-shadow: none !important; overflow: auto; }
.home-ask { margin: 4px 0 18px; padding: 14px 16px; background: #fff; border: 1px solid #E3E8F2; border-radius: 16px; box-shadow: 0 4px 18px rgba(16,24,40,.06); }
.home-ask-row { display: flex; align-items: center; gap: 10px; }
.home-ask-row .ic { width: 22px; height: 22px; color: #7C3AED; flex: none; }
.home-ask-row input { flex: 1; border: 0; outline: 0; font-size: 15px; background: transparent; height: 40px; }
.home-ask-row button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center; }
.home-ask-row button .ic { color: #fff; width: 18px; height: 18px; }
.home-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.home-chip { border: 1px solid #E3E8F2; background: #F8FAFF; color: #344054; border-radius: 9px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; }
.home-chip:hover { border-color: var(--brand); color: var(--brand); }

/* ---------------------------------------------------------------- Document Library header */
.center { grid-template-rows: auto auto auto minmax(0, 1fr) !important; }
.lib-head { padding: 16px 20px 0; background: #fff; }
.lib-crumb { font-size: 12.5px; color: #8A96AD; margin-bottom: 4px; }
.lib-titlebar { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lib-titlebar h1 { margin: 0; font-size: 24px; font-weight: 700; color: #0B1533; }
.lib-sub { font-size: 13px; color: #6B7A99; }
.lib-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.kpi { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #E8ECF4; border-radius: 14px; background: #fff; }
.kpi b { display: block; font-size: 20px; color: #0B1533; line-height: 1.1; }
.kpi span { display: block; font-size: 12.5px; color: #475467; }
.kpi small { display: block; font-size: 11px; color: #98A2B3; }
.kpi-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-ic .ic { width: 20px; height: 20px; }
.k-blue .kpi-ic { background: #E8EFFF; color: #2456E6; } .k-violet .kpi-ic { background: #F1EAFE; color: #7C3AED; }
.k-green .kpi-ic { background: #E6F7EE; color: #16A34A; } .k-amber .kpi-ic { background: #FEF3E2; color: #D97706; }
.lib-tabs { display: flex; gap: 4px; border-bottom: 1px solid #E8ECF4; margin-top: 8px; overflow-x: auto; }
.lib-tabs button { border: 0; background: transparent; padding: 10px 14px; font-size: 13.5px; color: #5B6782; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.lib-tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.toolbar [data-act="upload"] { display: none !important; }
.workspace.has-preview .lib-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* sidebar logo: name over subtitle; top bar buttons stay on one line */
.side-logo .logo-stack { display: flex !important; flex-direction: column !important; gap: 2px; line-height: 1.15; }
.topbar-right .top-action { display: inline-flex !important; flex-direction: row !important; white-space: nowrap; }
#top-alerts .ic { color: #475467 !important; }
.home-ask { margin: 16px 0 18px; }
#top-approvals { order: 4; }
/* window rails use the brand colour for the open section */
.rail-btn[aria-current="true"] { background: #E8EFFF !important; border-color: #C9D7FB !important; color: var(--brand) !important; }
