/* Dashboard v2 shell (stage 1). Spacing scale 4/8/12/16/24/32; type 14/16/20/28. */
.app-root { max-width: none; padding: 0; margin: 0; }
.app-shell { --gap: 24px; display: block; min-height: calc(100vh - 140px); }
.app-shell .card { margin: 0 0 var(--gap); padding: 20px 24px; border-radius: 12px; text-align: left; }
.app-shell .card h2 { font-size: 1.2rem; margin: 0 0 4px; text-align: left; }
.app-shell .card h3 { font-size: 1rem; margin: 16px 0 8px; }
.app-shell .note { text-align: left; }
.section-sub { color: var(--muted); margin: 0 0 16px; font-size: .95rem; text-align: left; }
.section-head { margin: 0 0 var(--gap); }
.section-head h2 { font-size: 1.75rem; margin: 0 0 4px; text-align: left; outline: none; }
.app-main { padding: 24px 16px 96px; max-width: 1040px; margin: 0 auto; box-sizing: border-box; min-width: 0; }
.app-sidebar { display: none; }
.side-firm h1 { font-size: 1.1rem; margin: 0; text-align: left; overflow-wrap: anywhere; }
.side-firm .note { margin: 2px 0 0; font-size: .85rem; overflow-wrap: anywhere; }
.side-links { display: flex; flex-direction: column; gap: 2px; margin: 24px 0; }
.side-link, .bnav-link { display: flex; align-items: center; gap: 10px; color: var(--text, #1a202c); text-decoration: none; border-radius: 8px; font-weight: 500; }
.side-link { padding: 10px 12px; font-size: .95rem; }
.side-link svg, .bnav-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-link:hover { background: var(--accent-light); }
.side-link[aria-current="page"] { background: var(--accent-light); color: var(--accent); }
.side-foot { margin-top: auto; display: flex; gap: 12px; flex-wrap: wrap; }
.side-small { font-size: .85rem; color: var(--muted); padding: 0; background: none; border: 0; }
.app-bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--bg); border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
.bnav-link { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: .68rem; color: var(--muted); text-align: center; min-height: 44px; justify-content: center; }
.bnav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bnav-link[aria-current="page"] { color: var(--accent); }
.app-shell .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 var(--gap); }
.app-shell .stats > div { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--bg); min-width: 0; }
.app-shell .stats dt { font-size: .8rem; color: var(--muted); }
.app-shell .stats dd { margin: 4px 0 0; font-size: 1.75rem; font-weight: 700; }
.ov-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 var(--gap); }
.ov-actions .btn { margin: 0; }
.more-options summary { cursor: pointer; color: var(--muted); font-weight: 500; margin-top: 8px; }
.empty-state { display: flex; flex-direction: column; gap: 4px; padding: 24px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; color: var(--muted); margin: 0 0 16px; }
.empty-state strong { color: var(--text, inherit); }
.skeleton { height: 44px; border-radius: 8px; margin: 8px 0; background: linear-gradient(90deg, var(--border) 25%, var(--accent-light) 50%, var(--border) 75%); background-size: 200% 100%; animation: skel 1.2s infinite linear; opacity: .6; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-disclaimer { font-size: .8rem; margin: 8px 0 0; }
.app-shell select, .app-shell input:not([type=checkbox]):not([type=radio]) { max-width: 100%; box-sizing: border-box; }
.app-shell #planPick { width: 100%; }
[data-theme="dark"] .app-bottomnav, [data-theme="dark"] .app-sidebar { background: #171c26; }
[data-theme="dark"] .app-shell .stats > div { background: #2d3748; }
[data-theme="dark"] .side-link { color: #e2e8f0; }
@media (max-width: 420px) { .app-shell .stats dd { font-size: 1.4rem; } .app-shell .card { padding: 16px; } .section-head h2 { font-size: 1.5rem; } }
@media (min-width: 1024px) {
  .app-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .app-sidebar { display: flex; flex-direction: column; position: sticky; top: 0; align-self: start; height: calc(100vh - 0px); max-height: 100vh; overflow-y: auto; box-sizing: border-box; padding: 24px 16px; border-right: 1px solid var(--border); background: var(--bg); }
  .app-bottomnav { display: none; }
  .app-main { padding: 32px 40px 48px; margin: 0; max-width: 1040px; }
}
/* Keep the Ask Ordexly button clear of the bottom nav on small screens */
@media (max-width: 1023px) { body:has(.app-shell:not([hidden])) #askFab { bottom: 84px !important; } body:has(.app-shell:not([hidden])) #askPanel { bottom: 140px !important; } }
.app-shell [hidden] { display: none !important; }
.app-shell .due-list { max-height: 560px; overflow-y: auto; }
/* Stage 2: form */
.biz-form label { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.biz-form .lbl { font-weight: 600; }
.hint-line { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
.biz-form .switch-row { flex-direction: row; align-items: flex-start; gap: 10px; }
.biz-form .switch-row > input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.biz-form.no-payroll [data-payroll] { display: none !important; }
.tip { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; min-width: 20px; padding: 0; margin-left: 4px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: .75rem; font-weight: 700; line-height: 1; position: relative; vertical-align: middle; cursor: help; }
.tip[aria-expanded="true"]::after, .tip:hover::after { content: attr(data-tip); position: absolute; left: 50%; top: 26px; transform: translateX(-50%); width: min(260px, 70vw); padding: 8px 10px; border-radius: 8px; background: #1a202c; color: #fff; font-size: .8rem; font-weight: 400; text-align: left; z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.more-options { border-top: 1px solid var(--border); padding-top: 8px; }
.more-options[open] > summary { margin-bottom: 12px; }
.more-options > .stack, .more-options > label { margin-bottom: 12px; }
.client-rem-list { display: flex; flex-direction: column; }
.client-rem-row { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.5fr) auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.client-rem-row .switch-row { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.client-rem-row .crr-msg { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.client-rem-row .crr-msg:empty { display: none; }
.client-rem-row input[type=email] { margin: 0; }
@media (max-width: 640px) { .client-rem-row { grid-template-columns: 1fr auto; } .client-rem-row .crr-name { grid-column: 1 / -1; } }
.app-shell form.stack label:has(> input[type=checkbox]:first-child) { display: flex; flex-direction: row; align-items: center; gap: 8px; text-align: left; }
.app-shell form.stack label:has(> input[type=checkbox]:first-child) > input { width: auto; margin: 0; flex: none; }
/* Stage 3: businesses */
.biz-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.biz-toolbar input[type=search] { flex: 1 1 220px; margin: 0; }
.biz-toolbar select { width: auto; margin: 0; }
.biz-toolbar .btn, .bz-view .btn { margin: 0; }
.bz-view { display: inline-flex; }
.bz-view .btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.bz-filter-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 12px; align-items: end; padding: 8px 0; }
.bz-filter-row label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; text-align: left; }
.bz-filter-row .bz-arch { flex-direction: row; align-items: center; gap: 6px; }
.bz-filter-row select { margin: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--accent-light); color: var(--accent); }
.pill-bad { background: #fde8e8; color: #9b1c1c; } .pill-warn { background: #fef3c7; color: #92400e; } .pill-ok { background: var(--accent-light); color: var(--accent); } .pill-muted { background: var(--border); color: var(--muted); }
[data-theme="dark"] .pill-bad { background: #4a1d1d; color: #feb2b2; } [data-theme="dark"] .pill-warn { background: #44370f; color: #fcd34d; }
.bz-bulk { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin: 8px 0; border: 1px solid var(--accent); border-radius: 10px; background: var(--bg); }
.bz-bulk .btn { margin: 0; }
.bz-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .92rem; }
.bz-table th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border); }
.bz-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.bz-table th:first-child, .bz-table td:first-child { width: 32px; }
.bz-table th:nth-child(3), .bz-table td:nth-child(3) { width: 14%; }
.bz-table th:nth-child(5), .bz-table td:nth-child(5) { width: 150px; }
.bz-name { font-weight: 600; color: var(--text, inherit); text-decoration: none; display: block; }
.bz-name:hover { text-decoration: underline; }
.bz-ent { display: block; font-size: .8rem; color: var(--muted); }
.bz-next time { display: block; font-weight: 600; white-space: nowrap; }
.bz-sum { display: block; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bz-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: .72rem; padding: 1px 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.is-archived { opacity: .65; }
.bz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.bz-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; background: var(--bg); }
.bz-card-head { display: flex; gap: 8px; align-items: flex-start; }
.bz-card-head input { margin-top: 4px; }
.bz-card-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }
.bz-card .bz-ent { margin: 0; }
.bz-group { margin: 0 0 12px; border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 8px; }
.bz-group > summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; padding: 8px 0; font-weight: 700; }
.bz-gcount { font-size: .8rem; color: var(--muted); font-weight: 400; }
.bz-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; font-size: .9rem; color: var(--muted); }
.bz-pager .btn { margin: 0; }
.bd-dl { list-style: none; padding: 0; margin: 0; }
.bd-dl li { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bd-dl li.is-overdue .due-date { color: #c53030; }
.bd-dl li.is-filed { opacity: .7; }
.bd-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.bd-act .btn { margin: 0; }
.bd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-actions .btn { margin: 0; }
.linklike.danger { color: #c53030; }
@media (max-width: 640px) {
  .bz-table thead { display: none; }
  .bz-table, .bz-table tbody, .bz-table tr, .bz-table td { display: block; width: auto !important; }
  .bz-table tr { position: relative; padding: 10px 0 10px 36px; border-bottom: 1px solid var(--border); }
  .bz-table td { border: 0; padding: 2px 0; }
  .bz-table td:first-child { position: absolute; left: 4px; top: 12px; }
  .bd-dl li { grid-template-columns: 1fr; }
  .bd-act { justify-content: flex-start; }
}
.app-shell[hidden] { display: none !important; }
.bz-list input[type=checkbox], .bz-filter-row input[type=checkbox] { width: auto; height: auto; margin: 0; flex: none; }
.bz-card-head .bz-name { flex: 1; min-width: 0; text-align: left; }
.bz-card-head input { margin-top: 4px !important; }
/* Stage 4 */
.app-shell #ovStats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .app-shell #ovStats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-shell #ovStats .has-overdue { border-color: #e53e3e; } .app-shell #ovStats .has-overdue dd { color: #c53030; }
[data-theme="dark"] .app-shell #ovStats .has-overdue dd { color: #fc8181; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; }
.cal-nav .btn { margin: 0; min-width: 44px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: .75rem; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell { min-height: 84px; border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; background: var(--bg); color: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; font: inherit; cursor: pointer; min-width: 0; overflow: hidden; }
.cal-cell:hover { background: var(--accent-light); }
.cal-cell.is-empty { border: 0; background: none; cursor: default; }
.cal-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-num { font-size: .8rem; font-weight: 600; }
.cal-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-item { font-size: .7rem; background: var(--accent-light); color: var(--accent); border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: .7rem; color: var(--muted); }
.cal-dot { display: none; }
.cal-day { margin-top: 16px; }
.gf-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.gf-row > div { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .cal-cell { min-height: 48px; align-items: center; padding: 4px 2px; }
  .cal-items { display: none; }
  .cal-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; }
}
#groupFeeds code, #groupFeeds .feed-url { display: none; }
/* Stage 5 */
.chips { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.chip-opt { display: inline-flex !important; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; flex-direction: row !important; }
.chip-opt input { width: auto !important; margin: 0 !important; accent-color: var(--accent); }
.chip-opt.on { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.chip-opt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; }
.acct-nav a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; text-decoration: none; color: inherit; }
.acct-nav a:hover { border-color: var(--accent); color: var(--accent); }
.acct-group { scroll-margin-top: 16px; }
.acct-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 8px; }
.plan-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; text-align: left; }
.plan-list li { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .92rem; }
.sess-list { list-style: none; padding: 0; margin: 1rem 0; text-align: left; }
.sess-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.sess-list li > span { display: flex; flex-direction: column; min-width: 0; }
.sess-list .note { margin: 0; font-size: .85rem; }
[data-theme="dark"] .cal-dot { color: #0b1a12; }

/* State questions stay hidden until state-forms.js has attached to the form (site audit 2026-10-18 B2). */
form:not([data-sf-ready]) [data-sf], form:not([data-sf-ready]) [data-pack-block] { display: none !important; }
