.has-shell { --shell-width: 232px; background: #edf0f3; }
.shell-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  gap: .75rem; min-height: 60px; padding: .5rem 1rem; background: #fff;
  color: #151e2d; border-bottom: 1px solid #dce1e7;
}
.shell-brand { font-weight: 700; letter-spacing: -.02em; }
.shell-account { display: flex; align-items: center; gap: .75rem; margin-left: auto; min-width: 0; }
.shell-company { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }
.shell-user { position: relative; flex: none; }
.shell-user summary, .shell-toggle { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.shell-user summary span { display: grid; place-items: center; background: #151e2d; color: white; border-radius: 50%; width: 34px; height: 34px; font-size: .75rem; }
.shell-user > div { position: absolute; right: 0; top: 100%; background: white; border: 1px solid #dce1e7; padding: .75rem; border-radius: 8px; width: max-content; max-width: 80vw; overflow-wrap: anywhere; }
.shell-user button { min-height: 44px; }
.shell-sidebar { background: #151e2d; color: #edf2f7; padding: .75rem; }
.shell-sidebar-brand { display: block; padding: .5rem .625rem 1.25rem; }
.shell-sidebar-brand small { display: block; color: #b7c3d3; font-weight: 400; overflow-wrap: anywhere; }
.shell-group summary, .shell-home, .shell-links a { display: flex; align-items: center; gap: .625rem; min-height: 44px; padding: .4rem .625rem; border-radius: 6px; font-size: .875rem; }
.shell-group summary { cursor: pointer; font-weight: 600; }
.shell-group summary::after { content: '⌄'; margin-left: auto; }
.shell-group[open] summary::after { transform: rotate(180deg); }
.shell-icon { width: 1.25rem; flex: none; text-align: center; font-size: 1.125rem; }
.shell-links { padding: 5px 10px 0 1.875rem; }
.shell-sidebar :is(a, summary):hover { background: #263246; }
.shell-sidebar a[aria-current="page"], .shell-group:has(a[aria-current="page"]) > summary { color: #53efd0; background: #12453f; }
.shell-bottom { display: none; }
.shell-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:is(.shell-top, .shell-sidebar, .shell-bottom) :focus-visible { outline: 2px solid #008879; outline-offset: -2px; }
.has-shell .app-content { max-width: 1440px; }

@media (min-width: 768px) {
  .has-shell { padding-left: var(--shell-width); }
  .shell-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--shell-width); z-index: 25; overflow-y: auto; }
}
@media (min-width: 1200px) {
  .shell-toggle, .has-shell .shell-top > .shell-brand { display: none; }
}
@media (768px <= width < 1200px) {
  .has-shell { --shell-width: 64px; }
  .shell-sidebar { padding-inline: 8px; }
  .shell-ready .shell-sidebar:not(.is-open) :is(.shell-sidebar-brand, .shell-links) { display: none; }
  .shell-ready .shell-sidebar:not(.is-open) .shell-label { position: absolute; clip-path: inset(50%); }
  .shell-ready .shell-sidebar:not(.is-open) summary::after { display: none; }
  .shell-ready .shell-sidebar:not(.is-open) :is(summary, .shell-home) { justify-content: center; }
  .shell-sidebar.is-open, body:not(.shell-ready) .shell-sidebar:has(details[open]) { width: 232px; }
}
@media (max-width: 767px) {
  .shell-ready .shell-sidebar { display: none; }
  .shell-ready .shell-sidebar.is-open { display: block; position: fixed; inset: 60px 0 58px; z-index: 19; overflow-y: auto; }
  .shell-sidebar-brand { display: none; }
  .shell-ready .shell-bottom {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed;
    inset: auto 0 0; z-index: 20; background: white; color: #151e2d; border-top: 1px solid #dce1e7;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .shell-bottom :is(a, button) { min-height: 57px; display: grid; place-content: center; text-align: center; font-size: .75rem; }
  .shell-bottom span { font-size: 1.125rem; }
  .shell-bottom a[aria-current="page"] { color: #006b5e; font-weight: 700; }
  .has-shell .app-content { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* Shared typography and surfaces for the home and pilot references. */
.has-shell { background: #f5f7f9; color: #101828; }
.shell-top { min-height: 70px; }
.shell-sidebar { background: #0e2d27; color: #d7e2e6; }
.shell-sidebar-brand { display: flex; align-items: center; gap: 12px; color: #fff; padding-bottom: 28px; }
.shell-sidebar-brand small { color: #62d9bf; }
.shell-monogram { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border: 1px solid #247769; border-radius: 10px; color: #69e5cb; background: #10423a; }
.shell-group summary, .shell-home { min-height: 52px; }
.shell-sidebar :is(a, summary):hover { background: #153d35; }
.shell-sidebar a[aria-current="page"], .shell-group:has(a[aria-current="page"]) > summary { background: #17473f; color: #70ebd1; }
.shell-sidebar .shell-links a[aria-current="page"] { background: #20564b; box-shadow: inset 3px 0 #45d5ae; }

.report-page { --line: #dbe3ec; --muted: #50627b; font-family: Inter, system-ui, sans-serif; }
.report-title { margin: 0 0 24px; font-size: clamp(25px, 2vw, 32px); font-weight: 700; letter-spacing: -.035em; line-height: 1.2; }
.report-panel { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 3px #10182814; overflow: hidden; }
.report-note { color: var(--muted); line-height: 1.65; margin: 22px 0 30px; }
.report-page .pilot-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 20px; padding: 20px; }
.report-page .pilot-filters label { display: block; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.report-page .pilot-filters :is(input,select) { width: clamp(150px, 14vw, 240px); min-height: 40px; padding: 6px 12px; border: 1px solid #c8d4e2; border-radius: 7px; background: #fff; }
.report-page .pilot-filters button { min-height: 40px; padding-inline: 26px; background: #00865f; color: white; font-weight: 600; }
.report-treasury, .report-table { margin-bottom: 30px; }
.report-treasury { padding: clamp(20px, 2vw, 32px); }
.report-treasury h2, .report-table h2 { font-size: clamp(17px, 1.3vw, 22px); font-weight: 700; }
.report-total { margin: 3px 0 6px; color: #08654f; font-size: clamp(24px, 2vw, 34px); font-weight: 750; }
.report-treasury a, .home-footer a { color: #08745c; }
.report-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(235px, 100%), 1fr)); gap: 14px; margin-top: 24px; }
.report-accounts p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 14px 16px; background: #f5f7f9; color: var(--muted); border-radius: 10px; }
.report-accounts strong { color: #101828; }
.report-table h2 { padding: 20px clamp(16px, 2vw, 32px); }
.report-table th { background: #f5f7f9; color: #37475e; font-weight: 600; }
.report-table :is(th,td) { padding: 14px clamp(10px, 1.25vw, 22px); border-top: 1px solid #e8edf3; font-size: .94rem; overflow-wrap: normal; }
.report-table td:first-child { font-weight: 600; }
.report-table .report-empty { padding: 27px 16px; color: var(--muted); text-align: center; font-style: italic; font-weight: 400; }
.home-heading { margin-bottom: 30px; }
.home-heading .report-title { margin-bottom: 8px; }
.home-context { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); }
.home-context strong { padding: 2px 10px; border: 1px solid var(--line); background: #eef2f7; border-radius: 5px; color: #13233c; font-size: .85rem; }
.home-panel-heading { padding: 24px clamp(16px, 2vw, 30px); }
.home-panel-title { font-size: 22px; font-weight: 650; }
.home-updated { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: .875rem; color: var(--muted); }
.home-updated > span { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #0bb58d; box-shadow: 0 0 0 2px #ccf5e9; }
.home-row { display: flex; align-items: center; gap: 16px; padding: 2px clamp(14px, 2vw, 30px); min-height: 46px; border-top: 1px solid #e8edf3; }
.home-row:hover { background: #f5f9f8; }
.home-mark { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 10px; border: 1px solid #b7f1e4; color: #08745c; background: #effbf8; font-size: 20px; }
.home-label { min-width: 0; flex: 1; }
.home-value { flex: 0 1 auto; text-align: right; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 15px clamp(16px, 2vw, 30px); border-top: 1px solid #e8edf3; background: #f7f9fb; color: var(--muted); font-size: .875rem; }
@media (min-width: 1200px) {
  .has-shell { --shell-width: 20vw; }
  .shell-top { min-height: 80px; padding-inline: 40px; }
  .shell-sidebar { padding: 20px 15px; }
  .has-shell .app-content:has(.report-page) { max-width: none; padding: 40px; }
}
@media (max-width: 767px) {
  .shell-top { min-height: 60px; }
  .home-row { gap: 10px; padding-block: 8px; }
  .home-mark { flex-basis: 32px; height: 32px; }
  .home-value { font-size: 1rem; }
}
@media (max-width: 639px) {
  .report-page .pilot-filters :is(input,select) { width: 100%; }
  .report-table .responsive-table td { padding: 8px 0; border: 0; overflow-wrap: anywhere; }
  .report-table .responsive-table td[colspan] { padding: 16px; }
}

.shell-icon, .home-chevron { display: grid; place-items: center; }
.shell-icon { color: #a1b8c2; }
.shell-sidebar a[aria-current="page"] .shell-icon,
.shell-group:has(a[aria-current="page"]) > summary .shell-icon { color: inherit; }
.shell-group summary::after {
  content: ""; width: 8px; height: 8px; margin-right: 4px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.shell-group[open] summary::after { transform: translateY(2px) rotate(225deg); }
.shell-home[aria-current="page"] { box-shadow: inset 0 0 0 1px #27766a; }
@media (min-width: 1200px) {
  .shell-sidebar-brand {
    min-height: 96px; margin: -20px -15px 20px; padding: 16px 25px;
    background: #0b2520; border-bottom: 1px solid #24443b;
  }
}

.home-panel-heading { padding-block: 25px 27px; }
.home-mark[data-icon="alert"] { color: #a14600; background: #fff9ea; border-color: #f9db84; }
.home-mark[data-icon="clipboard"] { color: #4639a8; background: #f0efff; border-color: #dbd9fd; }
.home-mark[data-icon="trend"] { color: #086995; background: #edf8ff; border-color: #cbe9fa; }
.home-value small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.home-chevron { color: #8598b0; flex: 0 0 20px; }
.home-alert-dot { display: inline-block; width: 9px; height: 9px; margin-inline-start: 9px; border-radius: 50%; background: #e38803; vertical-align: middle; }
.home-alert-count { display: grid; min-width: 34px; min-height: 34px; padding: 0 7px; place-items: center; border: 1px solid #ecc159; border-radius: 999px; background: #fff1c8; color: #783900; font-size: .875rem; }

.dashboard-page { --dashboard-gap: clamp(16px, 2vw, 30px); }
.dashboard-pilot-link { display: inline-flex; align-items: center; gap: .4rem; color: #08745c; font-size: .875rem; font-weight: 600; }
.dashboard-pilot-link:hover { text-decoration: underline; }
.dashboard-treasury { margin: 20px 0 38px; }
.dashboard-treasury-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.dashboard-treasury-heading h2 { font-weight: 650; }
.dashboard-treasury-heading span, .dashboard-balance small { font-size: .875rem; color: var(--muted); }
.dashboard-balance { margin: 3px 0 5px; font-size: clamp(24px, 2vw, 32px); font-weight: 750; font-variant-numeric: tabular-nums; }
.dashboard-treasury a { color: var(--muted); font-size: .875rem; }
.dashboard-page .report-title { font-size: clamp(22px, 1.7vw, 28px); margin-bottom: 20px; }
.dashboard-filters, .dashboard-filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.dashboard-filters { padding: 16px; }
.dashboard-filter-form { flex: 1 1 350px; }
.dashboard-filter-form label { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 4px; }
.dashboard-filter-form :is(input, select) { min-height: 38px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; color: #182439; }
.dashboard-filter-form button { background: #00865f; color: #fff; min-height: 38px; padding-inline: 24px; }
.dashboard-site { min-width: 155px; }
.dashboard-presets { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 9px; }
.dashboard-presets a { padding: 7px 9px; font-size: .85rem; border-radius: 6px; color: #37475e; }
.dashboard-presets a:hover { background: #e9eef4; }
.dashboard-presets a[aria-current] { background: #111a2c; color: #fff; }
.dashboard-profile { margin-top: 22px; font-size: .9rem; font-weight: 600; }
.dashboard-scope { margin: 4px 0 26px; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.dashboard-tiles, .dashboard-charts { display: grid; gap: var(--dashboard-gap); }
.dashboard-tiles { margin-bottom: var(--dashboard-gap); }
.dashboard-tiles > div, .dashboard-charts > section { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.dashboard-tiles > div { display: flex; flex-direction: column; }
.dashboard-tiles .dashboard-tile-foot { margin-top: auto; padding-top: 14px; }
.dashboard-tiles .dashboard-tile-foot:not(.dashboard-tile-foot ~ .dashboard-tile-foot) { border-top: 1px solid #e9eff5; }
.dashboard-charts summary { color: var(--muted); }
.dashboard-period { margin: 18px 0; }
.dashboard-period h3 { padding: 14px 20px; background: #f7f9fb; font-size: .9rem; font-weight: 650; }
.dashboard-period table { background: white; }
.dashboard-period th:not(:first-child) { text-align: right; padding-inline: 12px; }
.dashboard-period :is(th, td) { border-top: 1px solid #e8edf3; }
.dashboard-analysis { margin-bottom: 18px; padding: clamp(16px, 2vw, 29px); }
.dashboard-empty { padding: 14px; border-radius: 8px; border: 1px dashed var(--line); background: #f7f9fb; color: var(--muted); font-style: italic; }
.dashboard-updated { padding-top: 20px; margin-top: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
@media (min-width: 640px) {
  .dashboard-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 640px) and (max-width: 1099px) {
  .dashboard-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .dashboard-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.has-shell .app-content:has(.pos-layout) { max-width: 1500px; }
.pos-layout { display: grid; gap: 20px; align-items: start; }
.pos-catalog, .pos-cart { min-width: 0; background: white; border: 1px solid #dbe3ec; border-radius: 12px; padding: 16px; }
.pos-held { min-width: 0; }
.pos-catalog h2, .pos-cart > h2 { font-size: 1.125rem; font-weight: 650; }
.pos-catalog label { display: block; margin-top: 12px; font-size: .875rem; }
.pos-catalog :is(input, select), #pos-options select { width: 100%; padding: 8px; border: 1px solid #c8d4e2; border-radius: 6px; }
.pos-products h3 { margin: 18px 0 8px; font-weight: 650; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(128px, 100%), 1fr)); gap: 10px; }
.pos-product { min-width: 0; display: grid; align-content: start; gap: 4px; text-align: left; border: 1px solid #dbe3ec; border-radius: 9px; padding: 8px; }
.pos-product:hover:not(:disabled) { border-color: #08745c; background: #f0faf7; }
.pos-product:disabled { opacity: .65; cursor: default; }
.pos-placeholder { display: grid; place-items: center; aspect-ratio: 2 / 1; border-radius: 5px; color: #08745c; background: #e6f3ee; font-size: 1.5rem; font-weight: 650; }
.pos-product :is(small, span:not(.pos-placeholder)) { color: #47596f; font-size: .8125rem; }
.pos-total { padding-block: 8px; margin-bottom: 12px; border-bottom: 1px solid #dbe3ec; font-weight: 650; }
.pos-cart fieldset :is(select, input:not([type=checkbox])) { max-width: 100%; }
.pos-cart fieldset, .pos-cart #counter-form > p { overflow-wrap: anywhere; }
.pos-price-notice, #pos-feedback { margin-top: 8px; font-size: .875rem; }
#pos-options { margin: auto; padding: 20px; width: min(420px, 90vw); border-radius: 12px; }
#pos-options::backdrop { background: #10182875; }
#pos-options h2 { font-weight: 700; }
#pos-options label:not([hidden]) { display: block; margin-block: 10px; }
.pos-option-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.pos-option-actions button { border: 1px solid #c8d4e2; border-radius: 6px; padding: 6px 10px; }
.pos-option-actions button:disabled { opacity: .55; }
@media (min-width: 960px) {
  .pos-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr); }
  .pos-catalog { grid-column: 1; grid-row: 1 / span 2; }
  .pos-cart { grid-column: 2; grid-row: 1; }
  .pos-held { grid-column: 2; grid-row: 2; }
}

.pos-cart { scroll-margin-top: 88px; }
.pos-cart-link { display: none; }
@media (max-width: 959px) {
  .pos-cart-link:not([hidden]) { display: block; position: sticky; top: 70px; width: fit-content; z-index: 2; margin-bottom: 12px; padding: 8px 12px; border-radius: 8px; background: #0e2d27; color: white; }
}
@media (max-width: 767px) {
  .pos-cart-link:not([hidden]) { top: 60px; }
}
