/* Shared company workspace. One palette for setup and everyday accounting.
   Legacy green names are compatibility aliases for the shared accent. */

body { background: var(--paper); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
.page-shell, .company-shell, .page-footer { width: 100%; max-width: none; margin-inline: 0; padding-inline: clamp(16px, 3vw, 48px); }
.page-shell > *, .company-shell > * { min-width: 0; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); }
a { text-underline-offset: 3px; }
h1 { font-weight: 700; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -1.3px; }
h2 { font-weight: 650; }
.topbar { min-height: 58px; padding: 9px clamp(16px, 3vw, 48px); background: var(--white); border-color: var(--line); }
.brand { font-size: 19px; gap: 11px; }
.brand-mark { width: 35px; height: 35px; border-radius: 11px; background: var(--accent); box-shadow: inset 0 1px 0 #ffffff55, 0 4px 10px #173c3d20; }
.phase { border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; font-size: 10px; background: var(--surface-soft); }
.topbar nav { gap: 20px; }
.topbar nav > a, .topbar .text-button { color: var(--muted); }
.topbar nav > a[aria-current] { color: var(--accent); font-weight: 650; }
.environment-notice { background: var(--surface-soft); color: var(--muted); border-color: var(--line); font-size: 11px; padding: 5px 16px; }
.status-dot { background: var(--muted); width: 6px; height: 6px; }
.company-shell { padding-top: 14px; }
.company-context { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 12px; }
.company-identity { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.company-identity:hover { text-decoration: none; }
.company-identity > span:last-child { min-width: 0; }
.company-context-label { display: block; text-transform: uppercase; letter-spacing: 1.25px; font-size: 9px; color: var(--muted); font-weight: 700; line-height: 1.5; margin-bottom: 3px; }
.company-identity strong { display: block; font-size: 16px; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
.company-symbol { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(145deg, var(--white), var(--surface-soft)); color: var(--accent); font-size: 19px; font-weight: 650; box-shadow: 0 3px 6px #173c3d04; }
.company-context-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; font-size: 12px; }
.company-context-actions > a { color: var(--muted); }
.company-context-actions > a:hover { color: var(--accent); }
.company-context-actions .badge { font-size: 10px; background: var(--surface-soft); color: var(--muted); }
.company-menu { margin: 0; padding: 0; }
.company-menu > summary { display: none; }
.company-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); box-shadow: 0 3px 12px #173c3d05; }
.company-nav > a { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 13px; border-radius: 8px; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.4; transition: background .12s ease, color .12s ease; }
.company-nav > a:hover { color: var(--accent); background: var(--surface-soft); text-decoration: none; }
.company-nav > a[aria-current] { background: var(--accent); color: var(--ink); box-shadow: 0 2px 5px #173c3d22; }
.context-return { display: inline-flex; gap: 7px; font-size: 12px; margin-top: 17px; }
.company-shell + .page-shell { padding-top: 18px; }
.page-heading, .owner-heading { margin-top: 0; margin-bottom: 20px; gap: 18px; }
.card, .owner-metric, .pay-stat { box-shadow: var(--shadow); }
.company-card { background: linear-gradient(145deg, var(--white) 50%, var(--surface-soft)); }
.company-card:hover, .owner-metric:hover { border-color: var(--focus); box-shadow: 0 8px 25px #173c3d0a; }
.card-action { border-color: var(--line); }
.badge { background: var(--surface-soft); color: var(--muted); }
.badge.positive { color: var(--accent-strong); background: var(--accent-soft); }
.accounting-debit { color: var(--negative); font-weight: 650; }
.accounting-credit { color: var(--ink); }
.button { border-radius: 9px; min-height: 43px; padding: 10px 17px; }
.button.primary { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 1px 0 #ffffff20, 0 2px 3px #173c3d20; }
.button.secondary { color: var(--muted); background: var(--white); border-color: var(--line); box-shadow: 0 1px 2px #173c3d05; }
.button:hover { filter: brightness(.97); }
.button:disabled { cursor: default; opacity: .55; }
.field input, .field select, textarea, .worksheet-table input { border-color: var(--line); border-radius: 9px; box-shadow: inset 0 1px 2px #173c3d03; }
.field input::placeholder, textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, textarea:focus { border-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
form.action-row > input:not([type=hidden]), #stock-search {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  max-width: 100%;
  min-height: 44px;
}
.message { border-color: var(--line); background: var(--surface-soft); color: var(--muted); }
.message.error { border-color: var(--negative); background: var(--negative-soft); color: var(--negative); }
.notice { border-color: var(--amber); background: var(--amber-soft); }
th, td { border-color: var(--line); }
thead th { background: var(--surface-soft); color: var(--muted); }
tfoot { background: var(--surface-soft); }
.section-nav { flex-wrap: wrap; gap: 8px 23px; margin: 17px 0; }
.section-nav > a { padding: 4px 0; }
.section-nav > a[aria-current] { color: var(--accent-strong); font-weight: 700; }
.accountant-tabs, .banking-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.accountant-tabs a, .banking-tabs a { padding: 8px 13px; border-radius: 8px; font-size: 12px; color: var(--muted); background: var(--surface-soft); }
.accountant-tabs a[aria-current], .banking-tabs a[aria-current] { color: var(--accent-strong); background: var(--line); }
.accountant-workspace input:not([type=checkbox]):not([type=hidden]), .accountant-workspace select, .accountant-workspace textarea { border-color: var(--line); }
.owner-metric.bank, .pay-stat.featured { background: linear-gradient(130deg, var(--surface-soft), var(--surface-soft)); border-color: var(--line); }
.owner-explanation { background: var(--surface-soft); color: var(--muted); }
.owner-account-list > a { border-color: var(--line); }
.pay-step { background: var(--surface-soft); }
.pay-match-line, .pay-paging { background: var(--surface-soft); }
.pay-direction.receipt { color: var(--accent-strong); }
.page-footer { color: var(--muted); border-color: var(--line); font-size: 11px; }

/* Purchasing keeps its established layout while sharing the common palette. */
body .mo-shell { --mo-soft: var(--surface-soft); --mo-border: var(--line); --mo-quiet: var(--muted); }
.mo-shell .mo-hero .eyebrow { color: var(--muted); }
.mo-shell .mo-hero h1 { font-size: clamp(29px, 3.5vw, 41px); font-weight: 700; letter-spacing: -1.3px; }
.mo-shell .mo-card, .mo-shell .mo-kpi, .mo-shell .mo-document { box-shadow: var(--shadow); }
.mo-shell .mo-kpi:hover { border-color: var(--focus); box-shadow: 0 5px 15px #173c3d07; }
.mo-shell .mo-kpi-featured, .mo-shell .mo-start, .mo-shell .mo-guide { background: linear-gradient(135deg, var(--surface-soft), var(--surface-soft)); border-color: var(--line); }
.mo-shell .mo-guide p, .mo-shell .mo-guide-facts dd, .mo-shell .mo-guide-facts dt { color: var(--muted); }
.mo-shell .mo-guide-facts { border-color: var(--line); }
.mo-shell .mo-mini-icon, .mo-shell .mo-avatar, .mo-shell .mo-empty-icon { color: var(--accent); background: var(--surface-soft); border-color: var(--line); }
.mo-shell .mo-section-nav a:hover { border-color: var(--focus); }
.mo-shell .button.secondary, .mo-shell .mo-search { border-color: var(--line); }
.mo-shell .mo-search > span { color: var(--muted); }
.mo-shell .mo-search .button { background: var(--surface-soft); }
.mo-shell .mo-list-switch { border-color: var(--line); }
.mo-shell .mo-list-switch a[aria-current] { background: var(--surface-soft); }
.mo-shell .mo-table thead th { background: var(--surface-soft); border-color: var(--line); }
.mo-shell .mo-table td, .mo-shell .mo-table tbody th { border-color: var(--surface-soft); }
.mo-shell .mo-table tbody tr:hover { background: var(--surface-soft); }
.mo-shell .mo-status { background: var(--surface-soft); color: var(--muted); }
.mo-shell .mo-status.issued, .mo-shell .mo-status.posted, .mo-shell .mo-status.active, .mo-shell .mo-status.received { color: var(--accent); background: var(--surface-soft); }
.mo-shell .mo-status.partial, .mo-shell .mo-status.part_received, .mo-shell .mo-status.partially_received { color: var(--amber); background: var(--amber-soft); }
.mo-shell .mo-status.cancelled, .mo-shell .mo-status.overdue { color: var(--negative); background: var(--negative-soft); }
.mo-shell .mo-pagination { border-color: var(--line); }
.mo-shell .mo-disabled { color: var(--muted); border-color: var(--line); background: var(--surface-soft); }
.mo-shell fieldset.mo-form-section, .mo-shell .mo-line-row { background: var(--surface-soft); border-color: var(--line); }
.mo-shell fieldset.mo-form-section legend, .mo-shell .mo-line-row legend, .mo-shell .field label { color: var(--muted); }
.mo-shell .field label { font-size: 12px; }
.mo-shell .field input, .mo-shell .field select, .mo-shell .field textarea { border-color: var(--line); font-size: 13px; }
.mo-shell .field input:focus, .mo-shell .field select:focus, .mo-shell .field textarea:focus { border-color: var(--accent); }
.mo-shell .field input::placeholder, .mo-shell .field textarea::placeholder, .mo-shell .mo-search > input::placeholder { color: var(--muted); }
.mo-shell textarea:focus-visible { outline-color: var(--focus); }
.mo-shell .mo-field-error input, .mo-shell .mo-field-error select, .mo-shell .mo-field-error textarea { border-color: var(--negative); }
.mo-shell .mo-summary > div { background: var(--surface-soft); }
.mo-shell .mo-price-breaks, .mo-shell .mo-break-row, .mo-shell .mo-document-head, .mo-shell .mo-document-notes, .mo-shell .mo-document-total > div:last-child, .mo-shell details { border-color: var(--line); }
.mo-shell .mo-divider { background: var(--line); }
.mo-shell .mo-timeline li { border-color: var(--line); }
.mo-shell .mo-timeline li::before { background: var(--accent); }

@media (max-width: 1050px) {
  .company-nav > a { padding: 8px 10px; font-size: 11px; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; row-gap: 12px; }
  .topbar nav { gap: 18px; font-size: 12px; }
  .company-shell { padding: 14px 16px 0; }
  .company-context { gap: 12px; margin-bottom: 16px; align-items: flex-start; }
  .company-context-actions { flex-direction: column-reverse; gap: 6px; align-items: flex-end; font-size: 11px; padding-top: 1px; }
  .company-context-actions .badge { font-size: 9px; padding: 3px 8px; }
  .company-identity { gap: 9px; }
  .company-identity strong { font-size: 14px; }
  .company-symbol { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
  .company-menu { border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: 0 3px 12px #173c3d05; }
  .company-menu > summary { display: flex; gap: 12px; align-items: center; padding: 11px 13px; font-size: 12px; color: var(--muted); cursor: pointer; list-style: none; min-height: 44px; }
  .company-menu > summary::-webkit-details-marker { display: none; }
  .company-menu > summary strong { color: var(--accent); font-weight: 600; }
  .company-menu > summary .menu-chevron { margin-left: auto; font-size: 18px; }
  .company-menu[open] > summary .menu-chevron { transform: rotate(180deg); }
  .company-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 0; border-top: 1px solid var(--surface-soft); border-radius: 0 0 11px 11px; box-shadow: none; padding: 7px; gap: 4px; }
  .company-nav > a { min-height: 41px; padding: 8px 4px; text-align: center; white-space: normal; font-size: 11px; }
  .company-shell + .page-shell { padding-top: 18px; }
  .section-heading { flex-wrap: wrap; gap: 12px; }
  .page-heading { margin-top: 0; }
  .section-nav { flex-wrap: wrap; gap: 8px 17px; overflow: visible; }
  .field input, .field select, textarea, .mo-shell .field input, .mo-shell .field select, .mo-shell .field textarea { font-size: 16px; }
}
@media (max-width: 380px) {
  .brand { font-size: 17px; }
  .topbar nav { width: 100%; justify-content: flex-end; }
  .company-context-actions .badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .company-nav > a, .company-card { transition: none; }
}
@media print {
  body { background: white; }
  .company-shell { display: none !important; }
  .card, .owner-metric, .pay-stat, .mo-shell .mo-card, .mo-shell .mo-document { box-shadow: none; }
}

/* Compact navigation keeps everyday work visible on a laptop. Native details
   retains keyboard and no-script access to every specialist area. */
.company-more { position: relative; margin-left: auto; }
.company-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 36px; padding: 8px 14px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 600; list-style: none; cursor: pointer; }
.company-more > summary::-webkit-details-marker { display: none; }
.company-more > summary:hover, .company-more[open] > summary { background: var(--surface-soft); color: var(--ink); }
.company-more > summary.is-current { color: var(--accent-strong); background: var(--accent-soft); }
.company-more-links { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; padding: 7px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px #173c3d20; }
.company-more-links a { display: block; padding: 10px 12px; border-radius: 7px; font-size: 13px; color: var(--muted); }
.company-more-links a:hover, .company-more-links a[aria-current] { color: var(--accent-strong); background: var(--accent-soft); text-decoration: none; }
.page-heading .muted { font-size: 14px; margin-top: 9px; line-height: 1.5; }
.eyebrow { margin-bottom: 8px; }
.card { padding: 24px; }
.section-block { margin-top: 20px; }
.card > .section-heading { margin-bottom: 12px; }
.card > .section-heading h2 { margin-bottom: 0; }
.button.primary:hover { background: var(--accent-strong); }
.quiet-card, .owner-explanation { background: var(--surface-soft); }
.financial-number { color: var(--ink); }
.company-table th, .company-table td { padding: 14px 16px; }
.company-table .company-identity { align-items: flex-start; }
.company-toolbar { margin: 20px 0 16px; }
.company-monogram { color: var(--accent); background: var(--accent-soft); }
.company-actions-menu-items { background: var(--surface-soft); }
.company-actions-menu-items a:hover { background: var(--accent-soft); }
.company-actions-menu-items .danger-link { color: var(--negative); }
.feature-tags .badge { background: var(--surface-soft); color: var(--muted); }
.company-table tbody tr:hover { background: var(--surface-soft); }
.mo-shell .mo-hero { margin-bottom: 22px; }
.mo-shell .mo-table td, .mo-shell .mo-table tbody th { padding-top: 12px; padding-bottom: 12px; }
.predictive-options { color: var(--ink); border-color: var(--line); }
.predictive-options [role=option]:hover, .predictive-options [aria-selected=true] { background: var(--accent-soft); color: var(--accent-strong); }
.management-metrics strong { color: var(--accent-strong); }
.management-bar-track, .monthly-track { background: var(--accent-soft); }
.management-bar, .monthly-bar { background: var(--accent); }
.management-bar.negative, .monthly-bar.negative { background: var(--negative); }
.management-periods, .monthly-chart-row small { color: var(--muted); }
.chart-edit-table input[type=text] { border-color: var(--line); }
.chart-edit-table input:focus { outline-color: var(--focus); }
.chart-edit-table input:disabled { color: var(--muted); background: var(--surface-soft); }
.chart-edit-table input[type=checkbox] { accent-color: var(--accent); }
.worklist-tile:hover, .worklist-tile:focus-visible { background: var(--surface-soft); border-color: var(--focus); }
.worklist-jump a[aria-current] { background: var(--accent-soft); border-color: var(--focus); }
.worklist-row { padding: 14px 0; }
.worklist-disclosure { padding: 18px 22px; }
.worklist-group-heading { display: flex; align-items: center; gap: 18px; cursor: pointer; list-style: none; }
.worklist-group-heading::-webkit-details-marker { display: none; }
.worklist-group-heading > span:first-child { flex: 1; min-width: 0; }
.worklist-group-heading strong { display: block; font-size: 18px; font-weight: 650; margin-bottom: 3px; }
.worklist-group-heading .small { display: block; line-height: 1.5; }
.worklist-chevron { color: var(--muted); }
.worklist-disclosure[open] > summary { margin-bottom: 16px; }
.worklist-disclosure[open] .worklist-chevron { transform: rotate(180deg); }
.dimension-gaps li { background: var(--surface-soft); }
.banking-card { background: var(--white); border-radius: 14px; }
.saved-review, .mo-shell .saved-review { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 24px; align-items: center; padding: 18px 22px; margin: 0 0 20px; background: var(--surface-soft); border-color: var(--line); }
.saved-review h2, .mo-shell .saved-review h2 { grid-column: 1; font-size: 18px; margin: 0; }
.saved-review > p { grid-column: 1; margin: 0; font-size: 13px; color: var(--muted); }
.saved-review > form { grid-column: 2; grid-row: 1 / 3; margin: 0; }

/* Shared list tools do not change totals, source records or export coverage. */
.record-list-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 20px; padding: 12px 0 16px; }
.record-list-total-note { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; }
.record-list-search { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.record-list-search input { width: min(290px, 100%); border: 1px solid var(--line); padding: 9px 12px; min-height: 38px; font: inherit; font-weight: 400; }
.record-list-pages { display: flex; gap: 12px; align-items: center; }
.record-list-count { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.company-directory .record-list-tools { padding: 14px 20px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) {
  .company-more { grid-column: 1 / -1; margin-left: 0; }
  .company-more > summary { min-height: 42px; }
  .company-more-links { position: static; box-shadow: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; min-width: 0; }
  .record-list-tools { flex-wrap: wrap; gap: 12px; }
  .record-list-search, .record-list-search input { width: 100%; }
  .record-list-pages { width: 100%; justify-content: space-between; }
  .topbar nav { flex-wrap: wrap; gap: 10px 16px; }
  .worklist-group-heading { flex-wrap: wrap; gap: 10px; }
  .worklist-group-heading > span:first-child { flex-basis: calc(100% - 30px); }
  .saved-review, .mo-shell .saved-review { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .saved-review > form { grid-column: 1; grid-row: auto; }
}
@media print {
  .record-list-tools, .record-list-tools + .empty-state { display: none !important; }
}
