/* Business Account redesign (Oct 2026): Overview grid, side panel, batch bar,
   Insurance and Permits. Both layouts. Colors use the new-layout tokens
   where they exist (body.hub-v12) and the same values as fallbacks in
   Classic. Status always has a word next to its color. */

/* Tabs: underline, blue for the selected one */
.oo-sheet-tabs.bz-tabs { gap: 0; border-bottom: 1px solid var(--hub-line, #E1E6EE); margin: .3rem 0 .8rem; }
.oo-sheet-tabs.bz-tabs button {
  border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent;
  padding: .55rem .8rem; font-size: .9rem; color: var(--hub-ink-muted, #45556C); min-height: 40px;
}
.oo-sheet-tabs.bz-tabs button.on {
  background: transparent; color: var(--hub-ink, #1B2A41); font-weight: 600;
  border-bottom-color: var(--hub-action, #2563EB);
}
.oo-sheet-tabs.bz-tabs button:focus-visible { outline: 2px solid var(--hub-action, #2563EB); outline-offset: -2px; }
.bz-head .oo-head-actions .bz-editbtn { min-height: 40px; }
.bz-notice { margin: .2rem 0 .4rem; }

/* Overview + panel side by side on wide screens */
.bz-split { display: flex; gap: 14px; align-items: flex-start; }
.bz-main { flex: 1 1 auto; min-width: 0; }
.bz-split div.muted, .bz-split span.muted, .bz-panel div.muted { margin: 0; font-size: .8rem; }
.bz-foot { margin: .6rem 0 0; font-size: .8rem; }
.bz-banner {
  background: var(--hub-wait-l, #FFF4D6); color: var(--hub-wait, #7A4D08);
  border-radius: 10px; padding: .6rem .8rem; margin: 0 0 .7rem; font-size: .88rem;
}

.bz-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }
.bz-toolbar input[type="search"] {
  flex: 1 1 260px; max-width: 420px; min-height: 38px; box-sizing: border-box;
  border: 1px solid var(--hub-line-strong, #CBD5E1); border-radius: 8px; padding: 7px 10px; font: inherit;
}
.bz-toolbar .muted { margin: 0; }
.bz-editnote { font-size: .8rem; color: var(--hub-action-d, #1D4ED8); }
.bz-check { display: inline-flex; gap: 8px; align-items: center; font-size: .85rem; cursor: pointer; }
.bz-check input { width: 18px; height: 18px; margin: 0; }

/* The fitted grid: fixed layout, no sideways scroll at 1366px */
.bz-ovcard { padding: 12px; }
.bz-gridwrap { overflow-x: auto; }
.bz-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bz-grid th {
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--hub-ink-muted, #56657A);
  font-weight: 600; text-align: left; padding: 8px 5px; border-bottom: 1px solid var(--hub-line, #E1E6EE);
  white-space: normal; line-height: 1.25; vertical-align: bottom;
}
.bz-grid td { padding: 7px 5px; border-bottom: 1px solid var(--hub-off-l, #EEF1F5); vertical-align: middle; font-size: 13px; }
.bz-grid .bz-chk { width: 30px; }
.bz-grid th.bz-bname { width: 21%; }
.bz-grid .bz-bname b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bz-grid .bz-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bz-grid tr.bz-manual td { opacity: .55; }
.bz-grid tbody tr:hover td { background: var(--hub-canvas, #F7F9FC); }
.bz-chk input { width: 17px; height: 17px; margin: 0; }

/* Status chips */
.bz-chip {
  display: inline-flex; align-items: center; max-width: 100%; box-sizing: border-box;
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1.35; border-radius: 999px; padding: 3px 9px;
  border: 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
span.bz-chip { cursor: default; }
.bz-chip:focus-visible { outline: 2px solid var(--hub-action, #2563EB); outline-offset: 2px; }
.bz-chip.bz-sel { outline: 2px solid var(--hub-action, #2563EB); outline-offset: 2px; }
.bz-chip .ba-dot { width: .5rem; height: .5rem; }
.bz-ok { background: var(--hub-done-l, #DCFCE7); color: var(--hub-done, #166534); }
.bz-due { background: var(--hub-wait-l, #FFE7A8); color: var(--hub-wait, #7A4D08); }
.bz-late { background: var(--hub-alert-l, #FDE2E1); color: var(--hub-alert, #B42318); }
.bz-own {
  background: repeating-linear-gradient(135deg, var(--hub-off-l, #EEF1F5) 0 6px, var(--hub-line, #E2E7EE) 6px 12px);
  color: var(--hub-ink-muted, #45556C);
}
.bz-na { background: var(--hub-off-l, #F3F5F8); color: var(--hub-off, #6B778A); font-weight: 500; }
.bz-detail { font-size: .78rem; margin-top: .15rem; }

/* With the panel open beside the grid, chips get a little tighter */
.bz-split.bz-has-panel .bz-grid .bz-chip { padding: 2px 6px; font-size: 11.5px; }
.bz-split.bz-has-panel .bz-grid th.bz-bname { width: 19%; }
.bz-split.bz-has-panel .bz-grid th { font-size: 10px; letter-spacing: .02em; }

/* Edit mode: compact dropdowns with the status color on the left edge */
.bz-split select.bz-quick, .bz-panel select.bz-quick {
  appearance: auto; -webkit-appearance: menulist;
  width: 100%; max-width: 150px; box-sizing: border-box; font: inherit; font-size: 12px;
  border: 1px solid var(--hub-line-strong, #CBD5E1); border-left-width: 4px; border-radius: 7px;
  padding: 3px 2px; background: var(--hub-surface, #FFFFFF); min-height: 30px; height: 30px;
}
select.bz-quick.bz-q-ok { border-left-color: var(--hub-done, #16794C); }
select.bz-quick.bz-q-due { border-left-color: var(--hub-wait, #C98A12); }
select.bz-quick.bz-q-late { border-left-color: var(--hub-alert, #C2362B); }
select.bz-quick.bz-q-own { border-left-color: var(--hub-off, #94A3B8); border-left-style: dashed; }
select.bz-quick.bz-q-na { border-left-color: var(--hub-line-strong, #D3D9E3); }

/* Bill tabs fitted */
.bz-billcard { padding: 12px; }
.bz-cardhead { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.bz-fitwrap { overflow-x: auto; }
.oo-table.bz-bill { width: 100%; }
.oo-table.bz-bill th { white-space: normal; font-size: .78rem; line-height: 1.25; }
.oo-table.bz-bill td { vertical-align: middle; }
.oo-table.bz-bill .bz-chk { width: 30px; }
.oo-table.bz-bill .bz-bname { min-width: 120px; }
.oo-table.bz-bill .bz-actions { white-space: normal; }
.oo-table.bz-bill .bz-actions .btn,
.oo-table.bz-bill .bz-actions button { margin: 2px 2px 2px 0; white-space: nowrap; font-size: 12px; padding: 3px 8px; min-height: 30px; }
.oo-table.bz-bill .bz-actions input[type="checkbox"] { width: auto; }
.oo-table.bz-bill .ba-row-pull { margin-right: 2px; }
.oo-table.bz-bill .ba-pull-err { font-size: .78rem; }
.oo-table.bz-bill .bz-actions .ba-switch { margin: .2rem 0; font-size: .8rem; }
.oo-table.bz-bill input[data-ba-vec] { width: 100%; min-width: 5rem; box-sizing: border-box; }
.bz-ownrow td {
  background: repeating-linear-gradient(135deg, var(--hub-canvas, #F6F7FA) 0 6px, var(--hub-off-l, #EEF1F5) 6px 12px);
  color: var(--hub-ink-muted, #56657A);
}
.bz-bd-ok, .bz-bd-ok a { color: var(--hub-done, #166534); font-weight: 600; font-size: .8rem; }
.bz-bd-err { color: var(--hub-alert, #B42318); font-size: .8rem; }
.bz-bd-skip { color: var(--hub-wait, #7A4D08); font-size: .8rem; }

/* Buttons on this page */
.bz-split .btn, .bz-panel .btn, .bz-head .oo-head-actions button, #baModal .btn {
  font: inherit; font-size: 13px; border: 1px solid var(--hub-line-strong, #CBD5E1); background: var(--hub-surface, #FFFFFF);
  color: var(--hub-ink, #1B2A41); border-radius: 9px; padding: 6px 11px; cursor: pointer; min-height: 34px;
}
.bz-split .btn:hover, .bz-panel .btn:hover, .bz-head .oo-head-actions button:hover { border-color: var(--hub-action-line, #9DB8EE); }
.bz-split .btn:disabled, .bz-panel .btn:disabled { opacity: .5; cursor: not-allowed; }
.bz-split .btn.primary, .bz-panel .btn.primary, .bz-head .oo-head-actions button.primary {
  background: var(--hub-action, #2563EB); border-color: var(--hub-action, #2563EB); color: var(--hub-on-navy, #FFFFFF); font-weight: 600;
}
.bn-bulk.bz-batch .btn { font: inherit; font-size: 13px; border-radius: 9px; padding: 6px 11px; cursor: pointer; }

/* Actions are blue on this page (owner rule: blue for actions) */
.bz-split .bn-ok, .bz-panel .bn-ok, .bn-bulk.bz-batch .btn.bn-ok, #baModal .bn-ok {
  font-weight: 600; background: var(--hub-action, #2563EB); border-color: var(--hub-action, #2563EB); color: var(--hub-on-navy, #FFFFFF);
}

/* Batch bar: floating at the bottom */
.bn-bulk.bz-batch {
  position: fixed; left: 50%; right: auto; bottom: 18px; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box;
  border-radius: 14px; padding: 10px 14px; gap: 8px; z-index: 105;
  background: var(--hub-navy, #1B2A41); box-shadow: 0 10px 30px rgba(15, 23, 42, .3);
}
.bn-bulk.bz-batch .n { margin-right: 6px; }
.bn-bulk.bz-batch .btn { min-height: 36px; }
.bn-bulk.bz-batch [data-ba-clear] { border: 1px solid var(--hub-ink-muted, #56657A); }

/* The side panel */
.bz-panel {
  flex: 0 0 360px; width: 360px; box-sizing: border-box; position: sticky; top: 12px;
  max-height: calc(100vh - 24px); overflow: auto;
  background: var(--hub-surface, #FFFFFF); border: 1px solid var(--hub-line, #E1E6EE); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.bz-panel[hidden] { display: none; }
.bz-ph { display: flex; align-items: flex-start; gap: 8px; }
.bz-ptitle { flex: 1; min-width: 0; }
.bz-ptitle b { font-size: 16px; }
.bz-x { border: 0; background: none; font-size: 1.4rem; line-height: 1; color: var(--hub-ink-muted, #56657A); cursor: pointer; min-width: 40px; min-height: 40px; }
.bz-back { display: none; border: 1px solid var(--hub-line-strong, #CBD5E1); background: var(--hub-surface, #FFFFFF); border-radius: 8px; padding: 6px 10px; min-height: 40px; cursor: pointer; font: inherit; color: var(--hub-action-d, #1D4ED8); }
.bz-who { display: flex; flex-direction: column; gap: 6px; }
.bz-seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bz-seg button {
  border: 1px solid var(--hub-line-strong, #CBD5E1); background: var(--hub-surface, #FFFFFF); border-radius: 8px;
  padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; min-height: 36px; color: var(--hub-ink, #1B2A41);
}
.bz-seg button.on {
  border-color: var(--hub-action, #2563EB); background: var(--hub-action-l, #EFF5FF);
  color: var(--hub-action-d, #1D4ED8); font-weight: 600;
}
.bz-lbl { font-size: 12px; color: var(--hub-ink-muted, #56657A); display: block; }
.bz-statusrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bz-statusrow select.bz-quick { max-width: 210px; min-height: 34px; }
.bz-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.bz-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bz-wide { grid-column: 1 / -1; }
.bz-field input[type="text"], .bz-field input[type="date"], .bz-field input[type="url"], .bz-field input:not([type]),
.bz-field select, .bz-field textarea, .bz-combo .hub-combo-input {
  font: inherit; font-size: 13px; border: 1px solid var(--hub-line-strong, #CBD5E1); border-radius: 8px;
  padding: 7px 9px; width: 100%; box-sizing: border-box; min-height: 36px; background: var(--hub-surface, #FFFFFF);
}
.bz-field input:disabled { background: var(--hub-off-l, #F3F5F8); }
.bz-field textarea { resize: vertical; }
.bz-ro { font-size: 13px; padding: 2px 0; }
.bz-hint { font-size: 12px; color: var(--hub-ink-muted, #56657A); }
.bz-hint.bz-bad, .bz-pnote.bz-bad { color: var(--hub-alert, #B42318); }
.bz-pnote { margin: 0; font-size: 12.5px; min-height: 1em; }
.bz-pnote:empty { display: none; }
.bz-pactions { display: flex; flex-wrap: wrap; gap: 8px; }
.bz-pactions .btn, .bz-pactions button { min-height: 40px; }
.bz-ownnote { background: var(--hub-off-l, #F3F5F8); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin: 0; }
.bz-sent { margin: 0; }
.bz-nalink { align-self: flex-start; font-size: .82rem; }
.bz-open { font-size: 12px; margin-left: 4px; }
.bz-combo { position: relative; }
.bz-panel .hub-combo-list {
  position: absolute; left: 0; right: 0; z-index: 6; max-height: 220px; overflow: auto;
  background: var(--hub-surface, #FFFFFF); border: 1px solid var(--hub-line-strong, #CBD5E1); border-radius: 8px;
}
.bz-modalgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bz-modalgrid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--hub-ink-muted, #56657A); }
.bz-modalgrid input { font: inherit; border: 1px solid var(--hub-line-strong, #CBD5E1); border-radius: 8px; padding: 7px 9px; min-height: 36px; }

/* When the page area is narrower than ~1000px (Classic with the to-do rail,
   tablets) the panel slides over the right side instead of taking a column.
   js/bizaccount-overview.js sets bz-narrow from the measured width. */
.bz-split.bz-narrow .bz-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 100vw; max-height: none;
  border-radius: 0; border-width: 0 0 0 1px; z-index: 110; box-shadow: -12px 0 40px rgba(18, 33, 59, .22);
}

/* Phone: grid rows become cards; the panel is a full-screen sheet with Back */
@media (max-width: 700px) {
  .bz-split .bz-panel, .bz-split.bz-narrow .bz-panel {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: auto; max-width: none; max-height: none;
    border-radius: 0; border: 0; box-shadow: none; z-index: 140;
    padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
  }
  .bz-back { display: inline-flex; align-items: center; }
  .bz-x { display: none; }
  body.bz-sheet-open { overflow: hidden; }
  .bz-fields, .bz-modalgrid { grid-template-columns: minmax(0, 1fr); }
  .bz-grid, .bz-grid tbody, .bz-grid tr, .bz-grid td { display: block; width: auto; }
  .bz-grid thead { display: none; }
  .bz-grid tr {
    position: relative; border: 1px solid var(--hub-line, #E1E6EE); border-radius: 12px; margin: 0 0 10px;
    padding: 10px 10px 8px 40px; background: var(--hub-surface, #FFFFFF);
  }
  .bz-grid td { border: 0; padding: 3px 0; }
  .bz-grid td.bz-chk { position: absolute; left: 10px; top: 12px; padding: 0; min-width: 0; background: transparent; }
  .bz-grid td, .oo-table.bz-bill td { white-space: normal; }
  .bz-grid td.bz-bname { padding-bottom: 6px; }
  .bz-grid .bz-sub, .bz-grid .bz-bname b { white-space: normal; }
  .bz-grid td.bz-cellc { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .bz-grid td.bz-cellc::before { content: attr(data-label); font-size: 12px; color: var(--hub-ink-muted, #56657A); }
  .bz-grid td.bz-cellc .bz-quick { max-width: 60%; }
  .bz-grid tbody tr:hover td { background: transparent; }
  .oo-table.bz-bill thead { display: none; }
  .oo-table.bz-bill, .oo-table.bz-bill tbody, .oo-table.bz-bill tr, .oo-table.bz-bill td { display: block; width: auto; }
  .oo-table.bz-bill tr { position: relative; border: 1px solid var(--hub-line, #E1E6EE); border-radius: 12px; margin: 0 0 10px; padding: 8px 10px 8px 40px; }
  .oo-table.bz-bill td { border: 0; padding: 3px 0; text-align: left; }
  .oo-table.bz-bill td.bz-chk { position: absolute; left: 10px; top: 10px; min-width: 0; background: transparent; }
  .oo-table.bz-bill td.num { text-align: left; }
  .bn-bulk.bz-batch {
    left: 8px; right: 8px; transform: none; width: auto; max-width: none;
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .bz-toolbar input[type="search"] { max-width: none; }
  #mainContent .bz-grid button.bz-chip,
  #mainContent .bz-bill button.bz-chip { min-height: 32px; padding: 4px 12px; }
  .oo-table.bz-bill .bz-actions .btn, .oo-table.bz-bill .bz-actions button { font-size: 13px; padding: 6px 12px; }
}
body.v12-phone .bn-bulk.bz-batch { bottom: calc(72px + env(safe-area-inset-bottom)); }
