/* ═══════════════════════════════════════════════════════════════════════════
   os-shell-polish.css  [osnavpolish 2026-11-16]
   Loaded LAST on every signed-in app page (helpers/mobile_shell.js puts it just
   before </head>), so it refines the shell without touching os-global.css.
   Rollback = remove the <link> from mobile_shell.js (or empty this file).
   Rules: layout of the nav tree, routes, gating and folding are untouched;
   this file only changes how rows LOOK.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── PASS 1 · NAV: calm rest state ──────────────────────────────────────────
   Every row used to be its own bordered, tinted, shadowed card, so a 14-row
   nav read as a stack of 14 boxes. Rows now rest flat; the pill appears on
   hover and stays on the page you are on. Same pill language, less noise. */
.sidebar .sidebar-nav .nav-item:not(.active):not(:hover):not(:focus-visible) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.sidebar .sidebar-nav .nav-item:not(.active):hover {
  background: color-mix(in srgb, var(--pill-accent, #1a7a5a) 7%, transparent) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.sidebar .sidebar-nav .nav-item.active {
  transform: none !important;
}

/* Row rhythm + icon scale (desktop rail only; the collapsed rail and the
   phone drawer keep their own metrics). 36px glyphs in a 46px row were the
   loudest thing on screen; 26px in a 42px row matches the department rows. */
@media (min-width: 1024px) {
  html:not(.os-rail-collapsed) .sidebar .sidebar-nav { gap: 2px !important; }
  html:not(.os-rail-collapsed) .sidebar .sidebar-nav > .nav-item {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 10px 0 12px !important;
    gap: 12px !important;
    border-radius: 11px !important;
  }
  html:not(.os-rail-collapsed) .sidebar .nav-branch__link {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 2px 0 12px !important;
    gap: 12px !important;
    border-radius: 11px !important;
  }
  html:not(.os-rail-collapsed) .sidebar .sidebar-nav > .nav-item .nav-icon--mask,
  html:not(.os-rail-collapsed) .sidebar .sidebar-nav > .nav-item svg.nav-icon,
  html:not(.os-rail-collapsed) .sidebar .sidebar-nav > .nav-item img.nav-icon,
  html:not(.os-rail-collapsed) .sidebar .nav-branch__link .nav-icon--mask,
  html:not(.os-rail-collapsed) .sidebar .nav-branch__link svg.nav-icon,
  html:not(.os-rail-collapsed) .sidebar .nav-branch__link img.nav-icon {
    width: 26px !important;
    height: 26px !important;
  }
  html:not(.os-rail-collapsed) .sidebar .nav-branch__items .nav-item {
    height: 36px !important;
    min-height: 36px !important;
    border-radius: 10px !important;
  }
  html:not(.os-rail-collapsed) .sidebar .nav-branch__items .nav-item .nav-icon--mask,
  html:not(.os-rail-collapsed) .sidebar .nav-branch__items .nav-item svg.nav-icon,
  html:not(.os-rail-collapsed) .sidebar .nav-branch__items .nav-item img.nav-icon {
    width: 22px !important;
    height: 22px !important;
  }
}

/* Department rows: same hover wash as items, so the two row types feel like
   one list instead of two different components. */
.sidebar .nav-branch__link:hover {
  background: color-mix(in srgb, var(--pill-accent, #1a7a5a) 7%, transparent) !important;
}

/* ── PASS 1 · Theme switch ──────────────────────────────────────────────────
   The switch showed ON (green, knob right) in LIGHT mode under a "Dark Mode"
   label, and its hover turned the label near-white on a white sidebar.
   Now: label always reads "Dark mode", the switch is ON only when dark is on. */
body:not(.dark-theme) .os-theme-toggle .theme-track { background: rgba(120,120,128,0.22) !important; }
body:not(.dark-theme) .os-theme-toggle .theme-knob {
  transform: translateX(0) !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25) !important;
}
body.dark-theme .os-theme-toggle .theme-track { background: rgba(33,161,121,0.55) !important; }
body.dark-theme .os-theme-toggle .theme-knob {
  transform: translateX(16px) !important;
  background: #ffffff !important;
}
body:not(.dark-theme) .os-theme-toggle:hover {
  background: rgba(0,0,0,0.06) !important;
  color: var(--os-text, #1d1d1f) !important;
  border-color: rgba(0,0,0,0.10) !important;
}
.os-theme-toggle .theme-icon { transform: none !important; }

/* ── PASS 3 · PHONE HEADER ──────────────────────────────────────────────────
   On a phone the shared page header stacked every action button full-size,
   one or two per row (Clients: 237px of header before the first client).
   Compact buttons, primary action first, quieter decoration. Wrapping is kept
   on purpose: a sideways-scrolling row would clip the bell dropdown. */
@media (max-width: 768px) {
  .os-page-header { padding: 14px 16px 12px !important; gap: 10px !important; }
  .os-page-header::before {
    background: linear-gradient(180deg, var(--area-wash, rgba(26,122,90,0.09)), transparent 75%) !important;
  }
  .os-page-header__actions { gap: 6px !important; }
  .os-page-header__actions .os-btn {
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    border-radius: 11px !important;
    gap: 6px !important;
  }
  .os-page-header__actions .os-btn svg { width: 16px !important; height: 16px !important; }
  .os-page-header__actions .os-btn--primary { order: -1 !important; }
  .os-page-header__actions .os-topbar-pill { min-height: 38px !important; height: 38px !important; }
  .os-page-header__actions .os-topbar-pill.icon-only { width: 38px !important; min-width: 38px !important; padding: 0 !important; }
}

/* Phone/tablet drawer: rows keep their 46px tap height, glyphs drop from 36px
   to 28px so the drawer matches the desktop rail. */
@media (max-width: 1023px) {
  .sidebar .sidebar-nav > .nav-item .nav-icon--mask,
  .sidebar .sidebar-nav > .nav-item svg.nav-icon,
  .sidebar .sidebar-nav > .nav-item img.nav-icon,
  .sidebar .nav-branch__link .nav-icon--mask,
  .sidebar .nav-branch__link svg.nav-icon,
  .sidebar .nav-branch__link img.nav-icon { width: 28px !important; height: 28px !important; }
  .sidebar .nav-branch__items .nav-item .nav-icon--mask,
  .sidebar .nav-branch__items .nav-item svg.nav-icon,
  .sidebar .nav-branch__items .nav-item img.nav-icon { width: 24px !important; height: 24px !important; }
}

/* ── PASS 4 · Claire vs the open phone drawer ───────────────────────────────
   The Ask Claire launcher is pinned bottom-left at a huge z-index, which is
   exactly where the open drawer puts its Dark mode row. While the drawer is
   open the launcher steps aside; it comes back the moment the drawer closes. */
@media (max-width: 1023px) {
  html:has(.sidebar.open) #osclx-launcher {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 150ms ease, visibility 0s linear 150ms !important;
  }
}

/* [navspeed 2026-11-16] Page switches felt slow: every page started invisible
   (body pageLoad 0.4s fade) and the sidebar logo faded in over 0.8s on every
   click. Pages now paint at once. Browsers that support cross-document view
   transitions swap pages with a short crossfade instead of a white flash, and
   the sidebar is kept as its own layer so it does not blink. */
body { animation: none !important; }
.sidebar-header img { animation: none !important; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }
@media (min-width: 1024px) {
  .sidebar { view-transition-name: os-sidebar; }
}
::view-transition-old(os-sidebar) { animation: none; display: none; }
::view-transition-new(os-sidebar) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ── [Round 2B 2026-11-16] Dashboard money prompts ("Get paid faster") ──────────
   One-time, dismissible suggestions for money settings that are off. Lives in the
   polish sheet so it wins ties with the page styles. */
.money-prompts { background: var(--os-card, #fff); border: 1px solid var(--os-border, rgba(0,0,0,.08)); border-radius: 14px; padding: 6px 0; margin-bottom: 20px; box-shadow: var(--os-shadow-card, none); overflow: hidden; }
.money-prompts .mp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 20px 8px; }
.money-prompts .mp-head h3 { font-size: 15px; font-weight: 700; color: var(--os-text, #1d1d1f); margin: 0; }
.money-prompts .mp-sub { font-size: 12px; color: var(--os-text-secondary, #6b7280); }
.money-prompts .mp-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--os-border, rgba(0,0,0,.07)); }
.money-prompts .mp-txt { min-width: 0; flex: 1 1 auto; }
.money-prompts .mp-t { font-size: 14px; font-weight: 600; color: var(--os-text, #1d1d1f); }
.money-prompts .mp-why { font-size: 12.5px; line-height: 1.5; color: var(--os-text-secondary, #6b7280); margin-top: 2px; max-width: 70ch; }
.money-prompts .mp-act { display: flex; gap: 8px; align-items: center; flex: none; }
.money-prompts .mp-act .btn { text-decoration: none; white-space: nowrap; }
.money-prompts .mp-no { background: transparent !important; color: var(--os-text-secondary, #6b7280) !important; border: 1px solid transparent !important; box-shadow: none !important; }
.money-prompts .mp-no:hover { border-color: var(--os-border, rgba(0,0,0,.12)) !important; }
.money-prompts .mp-more { display: block; width: 100%; background: transparent; border: 0; border-top: 1px solid var(--os-border, rgba(0,0,0,.07)); padding: 10px 20px; text-align: left; font-size: 13px; font-weight: 600; color: var(--os-accent-text, #1a7a5a); cursor: pointer; font-family: inherit; }
@media (max-width: 640px) {
  .money-prompts .mp-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px; }
  .money-prompts .mp-head { padding: 12px 16px 8px; }
  .money-prompts .mp-act { justify-content: flex-start; }
  .money-prompts .mp-act .btn { min-height: 38px; }
  .money-prompts .mp-more { padding: 10px 16px; }
}

/* [Round 2B] Dashboard banners (money owed, unsent invoices, refunds owed) stack on phones: text first, button underneath. */
@media (max-width: 640px) {
  #money-owed .welcome-banner-content, #unsent-invoices .welcome-banner-content, #overcollections .welcome-banner-content { flex-wrap: wrap !important; gap: 10px !important; }
  #money-owed .welcome-banner-left, #unsent-invoices .welcome-banner-left, #overcollections .welcome-banner-left { flex: 1 1 100% !important; }
  #money-owed .welcome-banner-content > div:last-child, #unsent-invoices .welcome-banner-content > div:last-child, #overcollections .welcome-banner-content > div:last-child { flex: 1 1 100% !important; justify-content: space-between !important; position: static !important; top: auto !important; right: auto !important; }
}
