/* Flat Rent Management – application shell (shared, mockup): dark green sidebar with the product name on top and a green active item,
   light top bar with search / language / theme / bell / user, expandable parents (Rent Payments, Utility Statement, Settings),
   collapsible on desktop (icons only), off-canvas on tablets/phones, bottom navigation on phones (Home, Payments, Contracts, Tenants, More),
   "More" sheet. 44 px touch targets. Overrides the generic shell rules of app.css. */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.shell > .body { flex: 1; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 0; }
.env-banner { position: static; padding: 5px 16px; background: var(--accent-600); }

/* top bar – the brand cell continues the dark green sidebar */
.topbar { position: sticky; top: 0; z-index: 35; height: var(--topbar-h); background: var(--topbar-bg); color: var(--topbar-text); border-bottom: 1px solid var(--border); backdrop-filter: none; padding: 0 12px 0 0; gap: 10px; }
.topbar .btn-ghost { color: var(--topbar-text); } .topbar .btn-ghost:hover { background: var(--topbar-hover); }
.topbar .btn-ghost .icon { stroke: currentColor; }
.topbar-brand { display: inline-flex; align-items: center; gap: 10px; align-self: stretch; width: var(--sidebar-w); padding: 0 16px; background: var(--side-bg); color: #fff; font-weight: 700; font-size: 15px;
  letter-spacing: -.01em; text-decoration: none !important; min-width: 0; flex: none; }
.topbar-brand .logo { width: 28px; height: 28px; flex: none; } .topbar-brand .tb-short { display: none; } .topbar-brand .tb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .menu-btn { margin-left: 6px; }
.topbar .search { flex: 1; max-width: 460px; margin-left: 8px; height: 38px; background: var(--surface-2); border: 1px solid var(--border); color: var(--topbar-muted); }
.topbar .search:hover { border-color: var(--border-strong); } .topbar .search .kbd { background: transparent; border-color: var(--border); color: var(--topbar-muted); }
.topbar .avatar { background: var(--primary-soft); color: var(--primary); }
.topbar .bell-dot { background: var(--danger); box-shadow: 0 0 0 2px var(--topbar-bg); }
.topbar .lang-btn .flag { width: 22px; height: 16px; border-radius: 3px; }
body.nav-collapsed .topbar-brand { width: var(--sidebar-w-collapsed); justify-content: center; padding: 0; } body.nav-collapsed .topbar-brand .tb-name { display: none; }

/* sidebar */
.sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); background: var(--side-bg); border-right: 0; padding: 10px 0; gap: 2px; color: var(--side-text); }
.sidebar .company-switch { background: rgba(255, 255, 255, .06); color: var(--side-text); border-color: transparent; margin: 0 10px 8px; }
.sidebar .company-switch .sub { color: var(--side-muted); } .sidebar .company-switch .icon { stroke: var(--side-muted); }
.sidebar .company-switch .avatar.sq { background: rgba(255, 255, 255, .12); color: #fff; }
.nav .sec { color: var(--side-muted); font-size: var(--fs-xs); font-weight: 600; padding: 14px 18px 4px; letter-spacing: .01em; }
.nav a, .nav-parent { color: var(--side-text); min-height: 40px; border-radius: 0; padding-left: 18px; }
.nav a .icon, .nav-parent .icon { stroke: var(--side-text); }
.nav a:hover, .nav-parent:hover { background: var(--side-hover); color: #fff; }
.nav a.active { background: var(--side-active-bg); color: var(--side-active-text); font-weight: 600; } .nav a.active .icon { stroke: var(--side-active-text); }
.nav a.child { padding-left: 34px; min-height: 36px; font-size: var(--fs-sm); }
.nav-group.has-active > .nav-parent { color: #fff; font-weight: 600; }
.nav a .count { background: var(--danger); color: #fff; } .nav a .count.info { background: rgba(255, 255, 255, .16); color: #fff; border: 0; }
.nav .dot-badge { background: var(--accent); }
.collapse-btn { margin-top: auto; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 18px; border: 0; border-radius: 0; background: none; color: var(--side-muted); cursor: pointer; font-size: var(--fs-sm); }
.collapse-btn .icon { stroke: var(--side-muted); }
.collapse-btn:hover { background: var(--side-hover); color: #fff; }
body.nav-collapsed .shell > .body { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
body.nav-collapsed .sidebar .lbl, body.nav-collapsed .sidebar .sec, body.nav-collapsed .sidebar .cs-text, body.nav-collapsed .sidebar .company-switch > .icon,
body.nav-collapsed .sidebar .count, body.nav-collapsed .sidebar .chev { display: none; }
body.nav-collapsed .nav a, body.nav-collapsed .nav-parent, body.nav-collapsed .collapse-btn { justify-content: center; padding: 8px; }
body.nav-collapsed .nav a.child { padding-left: 8px; } body.nav-collapsed .company-switch { justify-content: center; padding: 6px; margin: 0 6px 8px; }
body.nav-collapsed .collapse-btn .icon { transform: rotate(180deg); }

/* severity label (alerts) – text + colour, never colour only */
.sev { display: inline-block; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: var(--radius-pill); margin-right: 4px; }
.sev-critical { background: var(--danger-bg); color: var(--danger); } .sev-warning { background: var(--warning-bg); color: var(--warning); } .sev-info { background: var(--info-bg); color: var(--info); }
.ro-banner { display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-size: var(--fs-sm); background: var(--info-bg); color: var(--text); border-bottom: 1px solid var(--border); }

/* bottom navigation (phones) */
.bottom-nav { display: none; }
.more-sheet .more-sec + .more-sec { margin-top: 14px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 6px; }
.more-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--surface-2); text-decoration: none !important; }
.more-item:hover { border-color: var(--border-strong); }

@media (max-width: 960px) {
  .shell > .body, body.nav-collapsed .shell > .body { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; height: 100vh; width: min(300px, 86vw); z-index: 45; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); padding-top: 14px; }
  body.nav-open .sidebar { transform: none; } body.nav-open::after { z-index: 44; }
  body.nav-collapsed .sidebar .lbl, body.nav-collapsed .sidebar .sec, body.nav-collapsed .sidebar .cs-text { display: revert; }
  body.nav-collapsed .nav a, body.nav-collapsed .nav-parent { justify-content: flex-start; padding-left: 18px; }
  .collapse-btn { display: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding-left: 0; }
  .topbar-brand, body.nav-collapsed .topbar-brand { width: auto; padding: 0 12px; }
  .topbar .search { margin-left: auto; flex: 0 0 auto; width: 40px; padding: 0; justify-content: center; background: transparent; border-color: transparent; }
  .topbar .search .lbl, .topbar .search .kbd { display: none; }
  .topbar-brand .tb-name { display: none; } .topbar-brand .tb-short { display: inline; }
  .hide-sm { display: none !important; }
  body.staff-mode .bottom-nav { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 18px rgba(20, 40, 33, .06); }
  .bottom-nav.cols-2 { grid-template-columns: repeat(2, 1fr); } .bottom-nav.cols-3 { grid-template-columns: repeat(3, 1fr); } .bottom-nav.cols-4 { grid-template-columns: repeat(4, 1fr); } .bottom-nav.cols-5 { grid-template-columns: repeat(5, 1fr); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; min-width: 0; color: var(--text-3); font-size: 11px; font-weight: 600;
    text-decoration: none !important; background: none; border: 0; cursor: pointer; padding: 4px 2px; }
  .bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav .icon { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); } .bottom-nav a.active .icon { stroke: var(--primary); }
  body.staff-mode .content { padding-bottom: calc(var(--bottom-nav-h) + 28px); }
}
@media (max-width: 420px) { .topbar { gap: 4px; padding-right: 6px; } .topbar .tb-actions .btn-icon { width: 38px; } }
.sidebar .company-switch { min-width: 0; } .sidebar .cs-text { min-width: 0; flex: 1; text-align: left; } .sidebar .cs-text .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
