/* Shell: sidebar, topbar, content, page grids, guest split — ADM-03, design system 1.3.3. Desktop only (1280px+). */
.l-shell { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; }
.l-shell__main { display: flex; flex-direction: column; min-width: 0; }

/* Sidebar */
.l-sidebar { background: var(--bg-sidebar); color: var(--color-ink-secondary); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.l-sidebar__brand { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-5) var(--space-4h); border-bottom: 1px solid var(--color-divider-card); color: var(--color-ink); font-size: var(--text-md); font-weight: var(--weight-extrabold); letter-spacing: var(--tracking-title); }
.l-sidebar__brand:hover { color: var(--color-ink); text-decoration: none; }
.l-brand-logo { display: block; flex: none; width: 32px; height: 32px; border-radius: var(--radius-tile); }
.l-guest__brand .l-brand-logo, .l-sidebar__brand .l-brand-logo { width: 40px; height: 40px; border-radius: 12px; }
.l-guest__note { margin: 0; text-align: center; font-size: var(--text-sm); color: var(--color-ink-muted); }
.l-brand-tile { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--radius-tile); background: var(--brand-gradient); color: var(--color-surface); box-shadow: var(--brand-glow); }
.l-brand-tile .c-icon { width: 18px; height: 18px; stroke-width: 2; }
.l-nav { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-1h) var(--space-3) var(--space-6); }
.l-nav__section { margin-top: var(--space-4); }
.l-nav__heading { padding: 0 var(--space-3) var(--space-1h); font-size: var(--text-caps); font-weight: var(--weight-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-ink-muted); }
.l-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-half); }
.l-nav__link { display: flex; align-items: center; gap: var(--space-3); min-height: 38px; padding: 0 var(--space-3); border-radius: var(--radius-nav); color: var(--color-ink-secondary); font-size: var(--text-base); font-weight: var(--weight-semibold); transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.l-nav__link .c-icon { color: var(--color-ink-muted); transition: color var(--duration-fast) var(--ease-out); }
.l-nav__link:hover { background: var(--color-canvas); color: var(--color-ink); text-decoration: none; }
.l-nav__link:hover .c-icon { color: var(--color-ink-secondary); }
.l-nav__link.is-active { background: var(--color-accent-tint); color: var(--color-ink); }
.l-nav__link.is-active .c-icon { color: var(--color-accent); }
.l-nav__link .c-count-pill { margin-left: auto; }
.l-nav__list .l-nav__list { margin: var(--space-half) 0 var(--space-half) var(--space-5); border-left: 1.5px solid var(--border); }
.l-nav__list .l-nav__list .l-nav__link { min-height: 32px; margin-left: -1.5px; padding-left: var(--space-3h); border-left: 1.5px solid transparent; border-radius: 0 var(--radius-item) var(--radius-item) 0; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.l-nav__list .l-nav__list .l-nav__link.is-active { background: transparent; border-left-color: var(--color-accent); font-weight: var(--weight-bold); }
.l-sidebar__org { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) var(--space-3) 0; padding: var(--space-3) var(--space-3h); border: 1px solid var(--border); border-radius: var(--radius-menu); background: var(--color-surface); }
.l-sidebar__org-tile { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-item); background: var(--color-accent-tint-strong); color: var(--color-accent); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.l-sidebar__org-text { min-width: 0; }
.l-sidebar__org-name, .l-sidebar__org-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: var(--leading-tight); }
.l-sidebar__org-name { font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--color-ink); }
.l-sidebar__org-label { margin-top: 2px; font-size: var(--text-xs); color: var(--color-ink-muted); }
.l-sidebar__user { padding: var(--space-3h); border-top: 1px solid var(--color-divider-card); }

/* Top bar: breadcrumbs, search, help, notifications, account */
.l-topbar { height: var(--topbar-height); background: var(--bg-surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-7); position: sticky; top: 0; z-index: var(--z-sticky); }
.l-topbar__spacer { flex: 1; }
.l-crumbs { min-width: 0; flex: 0 1 auto; }
.l-crumbs ol { display: flex; align-items: center; flex-wrap: nowrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-md); color: var(--color-ink-muted); }
.l-crumbs li { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-crumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--color-ink-weak); }
.l-crumbs a { color: var(--color-ink-muted); }
.l-crumbs a:hover { color: var(--color-ink); text-decoration: none; }
.l-crumbs li:last-child { flex-shrink: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; font-weight: var(--weight-semibold); color: var(--color-ink); }
.l-crumbs li.l-crumbs__org { flex-shrink: 12; }
.l-topbar__search { flex: 0 1 360px; min-width: 200px; display: flex; align-items: center; gap: var(--space-3); height: 44px; padding: 0 var(--space-3h) 0 var(--space-4); border: 1px solid transparent; border-radius: 16px; background: var(--color-canvas); color: var(--color-ink-muted); font: inherit; font-size: var(--text-body); text-align: left; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out); }
.l-topbar__search:hover { border-color: var(--border-strong); background: var(--color-surface); }
.l-topbar__search span { flex: 1; }
.l-topbar__search kbd, .c-palette kbd { display: inline-block; min-width: 22px; padding: 2px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--color-surface); font-family: var(--font-sans); font-size: 11px; font-weight: var(--weight-semibold); color: var(--color-ink-muted); text-align: center; }
.l-topbar__btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--color-surface); color: var(--color-ink-secondary); cursor: pointer; list-style: none; transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.l-topbar__btn::-webkit-details-marker { display: none; }
.l-topbar__btn:hover, details[open] > .l-topbar__btn { background: var(--color-canvas); border-color: var(--border-strong); color: var(--color-ink); }
.l-topbar__avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--color-surface-alt); color: var(--color-ink-body); font-size: var(--text-base); font-weight: var(--weight-bold); cursor: pointer; list-style: none; transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
.l-topbar__avatar::-webkit-details-marker { display: none; }
.l-topbar__avatar:hover, details[open] > .l-topbar__avatar { background: var(--color-accent-tint-strong); color: var(--color-accent); }
.l-topbar :is(.l-topbar__btn, .l-topbar__avatar, .l-topbar__search):focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.l-notify { width: 300px; padding: var(--space-4); }
.l-notify__title { font-size: var(--text-body); font-weight: var(--weight-bold); color: var(--color-ink); }
.l-notify__empty { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--color-ink-muted); line-height: 1.5; }

/* Account block (sidebar footer; <summary> of a <details> menu) */
.l-account { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-1h) var(--space-2); border-radius: var(--radius-md); cursor: pointer; list-style: none; transition: background-color var(--duration-fast) var(--ease-out); }
.l-account::-webkit-details-marker { display: none; }
.l-account:hover { background: var(--color-canvas); }
.l-account__avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--color-accent-tint-strong); color: var(--color-accent); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.l-account__text { min-width: 0; flex: 1; }
.l-account__name, .l-account__role { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: var(--leading-tight); }
.l-account__name { font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--color-ink); }
.l-account__role { font-size: var(--text-xs); color: var(--color-ink-muted); }
.l-account > .c-icon { color: var(--color-ink-muted); }
.l-sidebar__user .c-menu__panel { top: auto; bottom: calc(100% + var(--space-1h)); left: 0; right: 0; }

/* Platform dashboard: main column (attention, organizations) beside a narrower side column (platform facts, activity) */
.l-dashboard { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.l-dashboard--single { grid-template-columns: minmax(0, 1fr); }
.l-dashboard__main, .l-dashboard__side { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.l-dashboard .c-table th, .l-dashboard .c-table td { padding-inline: var(--space-3); }
.l-dashboard .c-table th { white-space: normal; line-height: 1.25; }
.l-dashboard .c-table td:not(:first-child) { white-space: nowrap; }
.l-dashboard .c-table td:first-child { min-width: 140px; }
.l-dashboard .c-table td:nth-child(2) { white-space: normal; min-width: 128px; }
.l-dashboard .c-table td:nth-child(2) .c-table__sub { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-dashboard .c-table-wrap, .l-content > .c-card .c-table-wrap { max-height: none; }

/* Content */
.l-content { flex: 1; width: 100%; max-width: var(--content-max); padding: var(--space-6h) var(--space-7) var(--space-12); }
/* Top-level blocks stacked directly in the content area get one rhythm (16px) without a wrapper */
.l-content > :is(.c-card, section, form, .c-notice, .c-summary) + *, .l-content > :is(h2, h3) + * { margin-top: var(--space-4); }
.l-content > .c-page-header + *, .l-content > .c-flash-stack + * { margin-top: 0; }
.l-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.l-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.l-tree-detail { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: var(--space-4); align-items: start; }
.l-split { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }

/* Guest (sign in, password reset, invitation): form column + lilac panel */
.l-guest { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) var(--size-login-panel); background: var(--bg-surface); }
.l-guest__main { display: grid; place-items: center; padding: var(--space-8); }
.l-guest__card { width: 100%; max-width: var(--size-login-form); display: flex; flex-direction: column; gap: var(--space-6); animation: rf-rise var(--duration-slow) var(--ease-out) both; }
.l-guest__brand { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-lg); font-weight: var(--weight-extrabold); letter-spacing: var(--tracking-title); color: var(--color-ink); }
.l-guest__card h1 { font-size: var(--text-3xl); letter-spacing: var(--tracking-display); line-height: 1.15; margin-bottom: var(--space-3); }
.l-guest__lead { margin: 0; font-size: var(--text-md); color: var(--color-ink-secondary); line-height: 1.6; }
.l-guest__panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: var(--space-5); padding: 0 64px; background: var(--wash-guest); }
.l-guest__eyebrow { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--eyebrow-on-lilac); }
.l-guest__statement { margin: 0; max-width: 560px; font-size: 42px; font-weight: var(--weight-extrabold); letter-spacing: var(--tracking-display); line-height: 1.08; color: var(--color-ink); }
.l-guest__facts { display: flex; flex-direction: column; gap: var(--space-3h); margin: var(--space-3) 0 0; padding: 0; list-style: none; max-width: 520px; }
.l-guest__fact { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-5) var(--space-6); border-radius: var(--radius-lg); background: var(--frosted); border: 1px solid var(--frosted-strong); font-size: var(--text-body); color: var(--color-ink-secondary); }
.l-guest__fact strong { font-size: var(--text-md); font-weight: var(--weight-bold); letter-spacing: var(--tracking-card); color: var(--color-ink); }
.l-guest__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); font-size: var(--text-body); font-weight: var(--weight-medium); }
.l-guest__row .c-check { align-items: center; }
.l-guest__row a { color: var(--color-accent); }

/* Login CTA is the one 52px button (design 1.3.4) */
.l-guest__card .c-button { height: var(--size-btn-login); border-radius: 16px; font-size: var(--text-md); }

/* Top-bar-adjacent helpers kept for pages that still use them */
.l-topbar__user-name, .l-topbar__user-role { display: block; }

/* Workflow builder (ADM-18): outline | editor | properties */
.l-builder { display: grid; grid-template-columns: var(--builder-outline) minmax(0, 1fr) var(--builder-props); gap: var(--space-4); align-items: start; }
.l-builder__props { position: sticky; top: calc(var(--topbar-height) + var(--space-4)); max-height: calc(100vh - var(--topbar-height) - var(--space-8)); overflow-y: auto; padding-right: 2px; }
.l-builder__outline { position: sticky; top: calc(var(--topbar-height) + var(--space-4)); max-height: calc(100vh - var(--topbar-height) - var(--space-8)); overflow-y: auto; }
/* Two equal-weight cards side by side, e.g. Approve and Reject on the exception decision (ADM-26) */
.l-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
