/* Original route buttons stay intact; compact disclosures replace the pill wall. */
.accounting-tabs { flex-wrap: wrap; overflow: visible; }
.rn-accounting-navigation { min-width: 0; position: relative; margin-bottom: 20px; }
.rn-accounting-toggle { display: none; }
.rn-accounting-navigation > .accounting-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0;
  margin: 0;
  border-bottom: 1px solid #cedae4;
}
.rn-accounting-navigation .accounting-tabs button {
  min-height: 44px;
  padding: 10px 11px;
  border: 0;
  border-radius: 6px 6px 0 0;
  color: #4a6074;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.rn-accounting-navigation .accounting-tabs > button.active,
.rn-accounting-navigation .rn-group-current > .rn-group-toggle {
  color: #163b5d;
  background: #e7eff5;
  box-shadow: inset 0 -3px #f29a38;
}
.rn-accounting-navigation .accounting-tabs button:hover { color: #153b60; background: #e7eff5; }
.rn-accounting-navigation .rn-group-toggle { display: flex; align-items: center; gap: 7px; }
.rn-chevron { width: 15px; height: 15px; flex: 0 0 15px; transition: transform .15s; }
.rn-group-open > .rn-group-toggle .rn-chevron { transform: rotate(180deg); }
.rn-nav-group { position: relative; }
.rn-group-label { display: none; }
.rn-group-list {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  max-height: min(440px, var(--rn-menu-space, 440px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid #cedae4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px #102f4926;
}
.rn-nav-group:last-child .rn-group-list { left: auto; right: 0; }
.rn-group-open > .rn-group-list { display: grid; gap: 3px; }
.rn-group-up > .rn-group-list { top: auto; bottom: calc(100% + 6px); }
.rn-accounting-navigation .rn-group-list button { width: 100%; text-align: left; border-radius: 6px; }
.rn-accounting-navigation .rn-group-list button.active { color: #153b60; background: #e7eff5; box-shadow: inset 3px 0 #f29a38; }
.rn-accounting-page-head { gap: 12px; margin-bottom: 12px; }
.rn-accounting-page-head h2 { font-size: 24px; }
.rn-accounting-page-head p { margin: 5px 0 0; font-size: 13px; }
.rn-accounting-page-head .toolbar { min-width: 0; align-items: center; }
.rn-accounting-page-head .toolbar button { min-height: 40px; padding: 9px 12px; font-size: 13px; }
.rn-accounting-navigation button:focus-visible,
.sidebar button:focus-visible { outline: 3px solid #f3a33b; outline-offset: 3px; }

@media (min-width: 1021px) {
  .sidebar #mainNavigation { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .sidebar .brand, .sidebar .logout { flex-shrink: 0; }
}

@media (max-width: 1020px) {
  .sidebar {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 8px 14px;
    align-items: center;
    z-index: 25;
  }
  .sidebar .brand { min-width: 0; padding: 0; gap: 0; }
  .sidebar .brand-logo { width: 70px; height: 42px; object-fit: contain; flex: 0 0 42px; }
  .sidebar .brand > div { display: none; }
  .sidebar .mobile-nav-toggle {
    display: flex;
    min-height: 46px;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 10px;
  }
  .mobile-nav-toggle > svg { width: 20px; height: 20px; flex: 0 0 20px; }
  .rn-main-label { overflow-wrap: anywhere; text-align: left; }
  .rn-toggle-caption { margin-left: auto; font-size: 12px; font-weight: 600; opacity: .8; white-space: nowrap; }
  .sidebar #mainNavigation {
    grid-column: 1 / -1;
    width: 100%;
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px;
    scrollbar-gutter: stable;
  }
  .sidebar #mainNavigation .nav-item,
  .sidebar .logout { min-height: 48px; padding: 12px; white-space: normal; }
  .sidebar .logout { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.18); border-radius: 0; }
  .sidebar .nav-section { margin: 8px 10px 2px; padding-top: 10px; }
  .rn-portal-actions {
    grid-column: 1 / -1;
    display: grid;
    gap: 6px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.18);
  }
  .rn-portal-actions-title { padding: 0 12px 4px; color: #adc0cf; font-size: 11px; font-weight: 700; }
  .rn-portal-actions .secondary { justify-content: flex-start; min-height: 48px; padding: 12px; color: #adc0cf; background: transparent; border-color: rgba(255,255,255,.18); }
  .rn-portal-actions .user-pill { white-space: normal; padding: 8px 12px; font-size: 12px; color: #adc0cf; background: transparent; border: 0; }
  .topbar.rn-topbar-empty { display: none; }
  .topbar { position: static; height: auto; padding: 9px 14px; }
  .topbar .searchbox { width: 100%; max-width: none; }
  .rn-accounting-page-head { flex-direction: row; align-items: center; gap: 10px; }
  .rn-accounting-page-head h2 { font-size: 22px; }
  .rn-accounting-page-head .toolbar { flex-shrink: 0; width: auto; }
  .rn-accounting-page-head .toolbar button { max-width: 128px; white-space: normal; font-size: 12px; line-height: 1.3; }
  .sidebar:not(.menu-open) #mainNavigation,
  .sidebar:not(.menu-open) .logout { display: none; }
  .sidebar #mainNavigation .active { box-shadow: inset 3px 0 0 #f3a33b; }
  .rn-accounting-navigation { margin-bottom: 16px; }
  .rn-accounting-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    min-width: 0;
    padding: 9px 12px;
    color: #153b60;
    background: #fff;
    border: 1px solid #cad7e2;
    border-radius: 12px;
    text-align: left;
  }
  .rn-accounting-label { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
  .rn-accounting-label small { display: none; }
  .rn-accounting-label strong { font-size: 14px; }
  .rn-chevron { width: 20px; height: 20px; flex: 0 0 20px; }
  .rn-open > .rn-accounting-toggle .rn-chevron { transform: rotate(180deg); }
  .rn-accounting-navigation > .accounting-tabs {
    display: none;
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: min(60vh, 520px, var(--rn-menu-space, 520px));
    max-height: min(60dvh, 520px, var(--rn-menu-space, 520px));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    margin: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid #cad7e2;
    border-radius: 12px;
    box-shadow: 0 12px 30px #102f4930;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .rn-accounting-navigation.rn-open > .accounting-tabs { display: grid; }
  .rn-accounting-navigation.rn-open-up > .accounting-tabs { top: auto; bottom: calc(100% + 6px); }
  .rn-nav-group { display: contents; }
  .rn-accounting-navigation .rn-group-toggle { display: none; }
  .rn-group-label { display: block; padding: 13px 12px 3px; color: #60758a; font-size: 11px; font-weight: 700; border-top: 1px solid #e4ebf0; margin-top: 3px; }
  .rn-group-list, .rn-group-open > .rn-group-list { display: contents; }
  .rn-accounting-navigation .accounting-tabs button {
    min-height: 48px;
    width: 100%;
    min-width: 0;
    padding: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    border-color: transparent;
    border-radius: 8px;
  }
  .rn-accounting-navigation .accounting-tabs button.active { color: #153b60; background: #e7eff5; box-shadow: inset 3px 0 0 #f3a33b; }
  .rn-accounting-navigation .accounting-tabs button:not(.active):hover { background: #edf5fb; }
}
@media (max-width: 640px) {
  .rn-accounting-navigation > .accounting-tabs { grid-template-columns: minmax(0, 1fr); }
  .rn-accounting-toggle { gap: 8px; }
}
@media (max-width: 360px) {
  .mobile-nav-toggle .rn-toggle-caption { display: none; }
}
