/* The desktop shell (the owner, 2026-11-08: the Dashboard on a 1900 px screen left a third of it empty, and the side list "looks old and basic and takes
   unnecessary space"). From 901 px: (1) the page uses the whole window, with a readable column kept only where a screen is rows of text; (2) the side
   menu is a slim rail of icons that opens to icons and labels under the pointer or the keyboard focus (over the page: nothing moves), pinned open with
   one button, hidden with another (the menu button at the start of the app bar brings it back). The choice is kept on this device (shell.js railMode).
   The phone (up to 900 px, the tab bar) and the iPhone app are untouched: app-layer.css hides .rail on the phone, wide.css inside the app. Colours, type
   and motion are the app's own; the rail keeps the company colour (company.css). Reference: the sidebars of Linear and Notion fold to an icon rail and
   open under the pointer; Apple's iPad sidebar folds to a tab rail; neither moves the content while it opens. */

/* ---------- the rail: a slot in the page, and the painted menu inside it that can open wider than the slot ---------- */
@media(min-width:901px){
  :root{ --railw:68px; --railw-open:244px }
  body[data-rail="open"]{ --railw:var(--railw-open) }
  .rail{ width:var(--railw); flex:0 0 var(--railw); position:sticky; top:0; height:100vh; z-index:40; overflow:visible; color:#E8ECEF }
  body[data-rail="hidden"] .rail{ display:none }
  .railin{ position:absolute; inset-block:0; inset-inline-start:0; width:var(--railw); display:flex; flex-direction:column; background:inherit; overflow:hidden;
    transition:width .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease }
  body[data-rail="rail"] .rail:hover .railin, body[data-rail="rail"] .rail:focus-within .railin{ width:var(--railw-open); box-shadow:0 12px 40px rgba(10,37,64,.35) }
  /* everything inside is laid out at the open width and clipped by the slot while it is slim: the icons never move when it opens */
  .rail .brand, .rail .nav button, .rail .railfoot button, .rail .who{ width:calc(var(--railw-open) - 16px) }
  .rail :focus-visible{ outline:2px solid #fff; outline-offset:-2px }

  /* the company: its mark, its name and Switch company as one link; the pin beside it */
  .rail .brand{ display:flex; align-items:center; gap:4px; margin:8px; padding:0 0 8px; border-bottom:1px solid rgba(255,255,255,.12) }
  .rail .brandlink{ display:flex; align-items:center; gap:12px; flex:1 1 auto; min-width:0; min-height:44px; padding:4px 6px; border-radius:12px; color:inherit; text-decoration:none }
  .rail .brandlink:hover{ background:rgba(255,255,255,.07) }
  .rail .railmark{ --cm-h:40px; --cm-w:40px; --cm-r:10px; --cm-plate:3px; flex:none }
  .rail .cmark-initial{ background:rgba(255,255,255,.16); color:#fff }
  .rail .brandtxt{ display:flex; flex-direction:column; min-width:0 }
  .rail .bname{ font-size:calc(14px * var(--dt,1)); font-weight:700; line-height:1.25; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
  .rail .bsub{ font-size:calc(12px * var(--dt,1)); color:#9FB0C0; white-space:nowrap }
  .rail .railpin{ flex:none; width:36px; height:36px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; color:#C3CEDA }
  .rail .railpin:hover{ background:rgba(255,255,255,.1); color:#fff }
  .rail .railpin svg{ width:20px; height:20px; transition:transform .22s cubic-bezier(.2,.8,.2,1) }
  body[data-rail="open"] .railpin svg, html[dir="rtl"] .railpin svg{ transform:scaleX(-1) }   /* the chevrons point the way the menu will go */
  html[dir="rtl"] body[data-rail="open"] .railpin svg{ transform:none }

  /* the sections: an icon and its label on one 44 px row; the current one carries a gold mark at its start edge, never colour alone */
  .rail .nav{ flex:1 1 auto; padding:8px; overflow-y:auto; overflow-x:hidden; scrollbar-width:none }
  .rail .nav::-webkit-scrollbar{ display:none }
  .rail .nav button, .rail .railfoot button{ position:relative; display:flex; align-items:center; gap:12px; min-height:calc(44px * var(--dt,1)); margin:0 0 2px; padding:0 12px 0 14px;
    border-radius:12px; color:#C3CEDA; font-size:calc(14px * var(--dt,1)); font-weight:500; text-align:start; text-decoration:none }
  html[dir="rtl"] .rail .nav button, html[dir="rtl"] .rail .railfoot button{ padding:0 14px 0 12px }
  .rail .nav button:hover, .rail .railfoot button:hover{ background:rgba(255,255,255,.08); color:#fff }
  .rail .nav button svg, .rail .railfoot button svg{ width:24px; height:24px; flex:none; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round }
  .rail .nav button[aria-current="true"]{ background:rgba(255,255,255,.14); color:#fff; font-weight:700 }
  .rail .nav button[aria-current="true"]::before{ content:""; position:absolute; inset-inline-start:0; top:10px; bottom:10px; width:3px; border-radius:3px; background:var(--gold, #B08A4A) }
  .rail .nav .navsep{ display:block; height:1px; margin:8px 6px; background:rgba(255,255,255,.12) }
  .rail .nlbl{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; flex:1 1 auto }
  /* slim and at rest: the words fade out (they stay in the markup for a screen reader); a letter never peeks out beside an icon */
  .rail .nlbl, .rail .brandtxt, .rail .whotxt, .rail .railpin{ transition:opacity .16s ease }
  body[data-rail="rail"] .rail:not(:hover):not(:focus-within) :is(.nlbl, .brandtxt, .whotxt, .railpin){ opacity:0 }
  /* the badge: beside the label when open, a small count on the icon's corner while slim */
  .rail .navbadge{ margin-inline-start:auto; flex:none }
  body[data-rail="rail"] .rail:not(:hover):not(:focus-within) .navbadge{ position:absolute; top:4px; inset-inline-start:30px; margin:0; min-width:18px; height:18px; line-height:18px; padding:0 5px; font-size:calc(12px * var(--dt,1)) }

  /* the person at the foot: an initial, the name and role, Log out, Hide the menu */
  .rail .railfoot{ margin-top:auto; padding:8px; border-top:1px solid rgba(255,255,255,.12); font-size:calc(14px * var(--dt,1)); color:#C3CEDA }
  .rail .who{ display:flex; align-items:center; gap:12px; min-height:44px; padding:4px 10px; margin-bottom:2px }
  .rail .avatar{ flex:none; width:32px; height:32px; border-radius:50%; background:rgba(255,255,255,.18); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:calc(13px * var(--dt,1)) }
  .rail .whotxt{ display:flex; flex-direction:column; min-width:0; line-height:1.25 }
  .rail .whotxt b{ color:#fff; font-size:calc(13px * var(--dt,1)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
  .rail .whotxt small{ color:#9FB0C0; font-size:calc(12px * var(--dt,1)); white-space:nowrap }
  .rail .railfoot button{ margin-top:0 }
  html[dir="rtl"] .rail #btnSignOut svg{ transform:scaleX(-1) }

  /* while the menu is hidden: the menu button at the start of the app bar brings it back */
  .railshow:not([hidden]){ display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; margin-inline-end:10px; border-radius:100px; vertical-align:middle;
    background:var(--card); color:var(--ink); border:1px solid var(--line-soft); box-shadow:var(--sh-1) }
  .railshow svg{ width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round }
  .railshow:hover{ background:var(--surface-3) }

  /* ---------- the page uses the whole window; a screen that is rows of text keeps a readable column, centred in the room ---------- */
  .content{ max-width:none; padding:24px 28px 40px }
  .appbar{ padding-inline:28px }   /* the bar's title starts where the content starts */
  body[data-view="settings"] .content, body[data-view="team"] .content, body[data-view="unit"] .content, body[data-view="import"] .content, body[data-view="tutorial"] .content,
  body[data-view="more"] .content, body[data-view="tenant"] .content, body[data-view="rrequest"] .content, body[data-view="platform"] .content{ max-width:980px; margin-inline:auto }
  body[data-view="feed"] .content, body[data-view="tasks"] .content, body[data-view="rrequests"] .content, body[data-view="messages"] .content, body[data-view="followup"] .content,
  body[data-view="tenants"] .content, body[data-view="licensing"] .content, body[data-view="papers"] .content, body[data-view="pstatus"] .content, body[data-view="leads"] .content,
  body[data-view="inbox"] .content, body[data-view="rulebook"] .content, body[data-view="dues"] .content, body[data-view="charges"] .content, body[data-view="cheques"] .content,
  body[data-view="contracts"] .content, body[data-view="dsoon"] .content, body[data-view="dpay"] .content, body[data-view="dunits"] .content{ max-width:1240px; margin-inline:auto }
}
/* the Dashboard's cards: three columns once there is room (column-count until the page has placed them), then each card in the shortest column so the
   columns end level (dash-bento.js dashMasonry); a card keeps its own height and takes as many 8 px rows as it needs */
@media(min-width:1500px){ .dgrid{ column-count:3 } body[data-view="overview"] .content{ column-gap:20px; row-gap:20px } }
@media(min-width:901px){
  .dgrid.masonry{ display:grid; grid-template-columns:repeat(var(--dcols, 2), minmax(0, 1fr)); grid-auto-rows:8px; grid-auto-flow:row dense; column-gap:16px; row-gap:0; column-count:auto }
  .dgrid.masonry .panel{ margin:0 0 16px; align-self:start; break-inside:auto }
  .dgrid.masonry .panel.dlast{ align-self:stretch }   /* the last card of a shorter column takes the rows that are left, so the columns end level */
}
/* the iPhone app draws its own menu: nothing of this there */
html.native-ios .railshow{ display:none !important }
@media(prefers-reduced-motion:reduce){ .railin, .rail .railpin svg{ transition:none } }
