/* Core Lexes — modern chrome (sidebar + header).
   Explicit Workspace redesign authority: sans-serif SaaS chrome.
   Destinations/permissions unchanged. */

:root {
  --clx-chrome-font: "Times New Roman", Times, serif;
  --clx-chrome-navy: #0f172a;
  --clx-chrome-navy-2: #1e293b;
  --clx-chrome-gold: #c9a227;
  --clx-chrome-gold-soft: #f5e7b0;
  /* Content-fit sidebar: driven by --clx-sidebar-width (app.css + fitSidebarWidth). */
  --clx-chrome-sidebar-w: var(--clx-sidebar-width, 158px);
  /* Authoritative left-nav menu-item label size (~1px above prior 13.5px). */
  --clx-sidebar-nav-label-size: 14.5px;
  /* Section headings stay subordinate to menu labels. */
  --clx-sidebar-section-title-size: 10px;
}

.app-sidebar,
.app-sidebar *,
.app-header,
.app-header * {
  font-family: var(--clx-chrome-font) !important;
}

/*
 * Gold sidebar shares the content row with main (taller side wins).
 * Does NOT span the footer row — footer follows the content row.
 * min-height:max-content keeps nav fully visible when taller than main.
 * Navigation stays compact and top-grouped — never distribute links to fill height.
 */
.app-sidebar {
  width: var(--clx-sidebar-width, 158px) !important;
  background: var(--clx-chrome-navy) !important;
  padding: 6px 4px 10px !important;
  gap: 6px !important;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.35);
  grid-column: 1;
  grid-row: 1;
  position: relative;
  top: auto;
  align-self: stretch;
  height: auto;
  max-height: none;
  min-height: max-content;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}
.app-page-wrapper:has(> .clx-impersonation-banner) .app-sidebar {
  grid-row: 2;
}

.app-sidebar .sidebar-brand {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(88px, 12vh, 128px);
  padding: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
  gap: 2px;
}

/* Phase 2 wordmark */
.app-sidebar .clx-sb-word {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
  color: var(--clx-chrome-gold, #c9a227);
  font-size: 10.5pt;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.05;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.app-sidebar .brand-logo {
  max-width: 88px !important;
  width: auto;
  height: auto;
  margin: 0 auto;
  filter: brightness(0.94) saturate(0.9) contrast(1.05);
}

/* Nav stays content-sized under the brand; links stay 2px apart (no auto-spread). */
.app-sidebar .sidebar-nav-flat {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-content: flex-start;
  gap: 2px !important;
  min-height: 0;
}

.sidebar-section-title-office,
.sidebar-section-title-user,
.sidebar-section-title-draft,
.sidebar-section-title-email,
.sidebar-section-title-ai,
.sidebar-section-title-founder {
  font-family: var(--clx-chrome-font) !important;
  font-size: var(--clx-sidebar-section-title-size, 10px) !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  color: rgba(255, 255, 255, 0.45) !important;
  /* Compact section gaps (approved mockup 2026-10-15) — no margin-top:auto. */
  padding: 8px 10px 3px !important;
  margin: 6px 0 0 !important;
  border: 0 !important;
  pointer-events: none !important;
  cursor: default !important;
  flex: 0 0 auto !important;
}

.app-sidebar .sidebar-nav-flat > .sidebar-section-title-office {
  margin-top: 0 !important;
  padding-top: 4px !important;
}

.app-sidebar .sidebar-nav-flat .nav-link,
.app-sidebar .nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  border-radius: 6px !important;
  padding: 3px 6px !important;
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: var(--clx-sidebar-nav-label-size, 14.5px) !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.app-sidebar .sidebar-nav-flat .sidebar-doc-drafting-block__links .nav-link {
  padding-left: 6px !important;
}

.app-sidebar .nav-ico {
  flex: 0 0 14px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
}

.app-sidebar .nav-ico svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-sidebar .sidebar-nav-flat .nav-link:hover,
.app-sidebar .sidebar-nav-flat .nav-link:focus,
.app-sidebar .nav-link:hover,
.app-sidebar .nav-link:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.app-sidebar .sidebar-nav-flat .nav-link:hover .nav-ico,
.app-sidebar .nav-link:hover .nav-ico {
  color: var(--clx-chrome-gold);
}

.app-sidebar .sidebar-nav-flat .nav-link.active,
.app-sidebar .nav-link.active {
  background: var(--clx-chrome-gold) !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.app-sidebar .sidebar-nav-flat .nav-link.active .nav-ico,
.app-sidebar .nav-link.active .nav-ico {
  color: #0f172a !important;
}

.app-sidebar .sidebar-nav-flat .nav-link.active::before,
.app-sidebar .nav-link.active::before {
  display: none !important;
}

/* Header */
.app-header {
  background: var(--clx-chrome-navy) !important;
  border-bottom: 1px solid rgba(201, 162, 39, 0.28) !important;
  padding: 10px 18px !important;
  gap: 16px !important;
  min-height: 56px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.22) !important;
}

.app-header .header-label {
  font-family: "Times New Roman", Times, serif !important;
  font-size: 12pt !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: #fff !important;
  line-height: 1.2 !important;
  max-width: min(42vw, 34rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header .header-app-kicker {
  font-family: var(--clx-chrome-font) !important;
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.62) !important;
  font-weight: 400 !important;
}

.app-header .header-actions {
  gap: 14px !important;
}

.app-search {
  width: min(340px, 36vw) !important;
  position: relative;
}

.app-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.app-search-ico {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  z-index: 1;
}

.app-search-ico svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-search .form-control {
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  padding: 8px 14px 8px 36px !important;
  min-height: 36px !important;
  font-size: 13px !important;
  font-family: var(--clx-chrome-font) !important;
  box-shadow: none !important;
}

.app-search .form-control::placeholder {
  color: rgba(255, 255, 255, 0.48) !important;
}

.app-search .form-control:focus {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: var(--clx-chrome-gold) !important;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25) !important;
  color: #fff !important;
}

.app-header .header-actions .user-avatar {
  width: 32px !important;
  height: 32px !important;
  background: var(--clx-chrome-gold) !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 12px !important;
}

.app-header .header-actions .user-name {
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: var(--clx-chrome-font) !important;
}

@media (max-width: 991px) {
  .app-search {
    width: min(220px, 40vw) !important;
  }
}

/* Approved daily greeting — size/weight only; family from chrome font var */
.app-header #clx-daily-greeting {
  font-family: "Times New Roman", Times, serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.15 !important;
  letter-spacing: normal !important;
}
