/* Accounting module. Reuses the app's tokens; adds only what the books need. */
.acct-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px;border:1px solid var(--line);border-radius:12px;background:white;padding:10px 14px}
.acct-bar label{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.acct-bar select{height:36px;border:1px solid #cbd5e1;border-radius:8px;background:white;color:var(--slate);padding:0 10px;font:inherit;font-weight:600;text-transform:none;letter-spacing:0}
.acct-bar-spacer{flex:1}.acct-perms .badge{text-transform:none}
.acct-two-col{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;margin-bottom:20px}.acct-two-col .panel{margin:0}
.acct-neg{color:var(--rose)}.acct-ok{color:var(--green)}
.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.acct-code{display:inline-block;min-width:38px;color:var(--muted);font-family:ui-monospace,Menlo,monospace;font-size:12px}
.acct-child td:nth-child(2){padding-left:28px}
.acct-total td{border-top:2px solid var(--slate);font-weight:700}.acct-synth td{font-style:italic}
.acct-statement td:first-child{min-width:280px}
.acct-modal{width:min(640px,calc(100% - 30px))}.acct-modal-wide{width:min(1040px,calc(100% - 30px))}
/* A table in a wide dialog (the Post flights preview has ten or eleven columns) keeps the page's
   cell padding from pushing its last column past the dialog's edge; where it still cannot fit, it
   scrolls inside the dialog with a scrollbar that shows. An overlay scrollbar hides until touched
   and the column simply read as cut off; a ::-webkit-scrollbar of its own is drawn whatever the
   platform's setting, whereas the standard scrollbar-color and scrollbar-width properties make
   Chromium draw an overlay one and ignore these rules (tests/ui/post-flights-adapter.test.mjs). */
.acct-modal-wide .table th,.acct-modal-wide .table td{padding:10px 12px}
.acct-modal .table-wrap{overflow-x:auto}
.acct-modal .table-wrap::-webkit-scrollbar{height:10px}.acct-modal .table-wrap::-webkit-scrollbar-track{background:#f1f5f9;border-radius:999px}.acct-modal .table-wrap::-webkit-scrollbar-thumb{background:#94a3b8;border-radius:999px}
.acct-form{display:grid;gap:0}.acct-form-body{display:grid;gap:12px;padding:0 24px 8px;max-height:70vh;overflow:auto}
.acct-field{display:grid;gap:6px;color:#475569;font-size:13px;font-weight:650}.acct-field input,.acct-field select,.acct-field textarea{height:40px;border:1px solid #cbd5e1;border-radius:8px;color:var(--slate);padding:0 10px;font:inherit;font-weight:500;background:white}
.acct-field textarea{height:auto;min-height:80px;padding:10px;resize:vertical}.acct-field small{color:var(--muted);font-weight:500;line-height:1.4}
.acct-form .field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.acct-form-error{margin:0 24px 8px;border:1px solid #fecaca;border-radius:8px;background:#fff1f2;color:#be123c;padding:10px 12px;font-size:13px;line-height:1.5}
.acct-form-note{margin:0 24px 8px;border:1px solid #bae6fd;border-radius:8px;background:#f0f9ff;color:#075985;padding:10px 12px;font-size:13px;line-height:1.5}
.acct-lines table input,.acct-lines table select{width:100%;height:34px;border:1px solid #cbd5e1;border-radius:6px;padding:0 8px;font:inherit;font-size:13px}.acct-num{text-align:right;font-variant-numeric:tabular-nums}
.acct-checks{display:flex;flex-wrap:wrap;gap:16px}
.acct-apply{display:grid;gap:8px;border:1px solid var(--line);border-radius:10px;background:#f8fafc;padding:12px}.acct-apply-row{display:grid;grid-template-columns:1fr 140px;align-items:center;gap:10px;font-size:13px}.acct-apply-row input{height:34px;border:1px solid #cbd5e1;border-radius:6px;padding:0 8px}
.acct-filter{margin-bottom:16px;flex-wrap:wrap}.acct-filter button{text-transform:capitalize}
.acct-inline-meta{border-top:1px solid #eef2f6;background:#f8fafc;color:var(--muted);padding:10px 20px;font-size:12px}
.acct-address-list{display:grid;gap:8px;padding:16px 20px}.acct-address{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.acct-address code{border:1px solid var(--line);border-radius:8px;background:#f8fafc;padding:8px 12px;font-size:14px}
.acct-review{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}
.acct-review-source iframe,.acct-review-source img{width:100%;min-height:520px;border:1px solid var(--line);border-radius:10px;background:#e2e8f0}
.acct-review-source img{min-height:0;max-height:70vh;object-fit:contain}
/* An invoice's PDF in its dialog: as tall as the dialog body (70vh) allows with the button row
   under it still in view, so the page is readable without scrolling the dialog itself. */
.acct-pdf-frame{display:block;width:100%;height:max(320px,calc(70vh - 64px));border:1px solid var(--line);border-radius:10px;background:#e2e8f0}
/* A bill's invoice or an expense's receipt: the file's name and its buttons above it, so they stay
   in view however tall the photo is. */
.acct-doc-image{display:block;width:100%;max-height:calc(70vh - 64px);object-fit:contain;border:1px solid var(--line);border-radius:10px;background:#e2e8f0}
.acct-doc-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;margin-bottom:10px}.acct-doc-bar p{margin:0}
.acct-doc-attach{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.acct-doc-tabs{margin-bottom:10px;flex-wrap:wrap}.acct-doc-tabs button{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acct-pre{max-height:220px;overflow:auto;border:1px solid var(--line);border-radius:8px;background:#f8fafc;padding:10px;font-size:12px;white-space:pre-wrap}
.acct-review-fields h3{margin:14px 0 8px;font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.acct-xfield{display:grid;grid-template-columns:130px minmax(0,1fr) auto;gap:8px;align-items:baseline;border-bottom:1px solid #eef2f6;padding:6px 0;font-size:13px}.acct-xfield span{color:var(--muted)}.acct-xfield small{grid-column:2/4;color:var(--muted);font-size:11px}
.acct-conf{border-radius:999px;padding:1px 8px;font-size:11px;font-weight:700}.acct-conf.hi{background:#dcfce7;color:#166534}.acct-conf.mid{background:#fef3c7;color:#92400e}.acct-conf.lo{background:#fee2e2;color:#991b1b}
.acct-events{margin:0;padding-left:18px;font-size:12px;color:#475569}.acct-events li{margin:3px 0}
.acct-proposal{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;border:1px solid var(--line);border-radius:10px;padding:12px;cursor:pointer}.acct-proposal:hover{background:#f8fafc}.acct-proposal code{font-size:11px;color:var(--muted)}
.acct-mapping{border:1px solid var(--line);border-radius:10px;padding:10px 12px}.acct-mapping summary{cursor:pointer;font-weight:650;color:#475569}
.acct-preview-table{max-height:320px;overflow:auto}
.acct-recon-summary{margin:0;border-bottom:1px solid #eef2f6}.acct-uncleared td{background:#fffbeb}
.acct-report-controls{padding:14px 20px;display:grid;gap:12px}.acct-report-params{display:flex;flex-wrap:wrap;align-items:end;gap:12px}.acct-report-params .acct-field input{height:36px}
.acct-report-header{margin-bottom:12px;color:#475569;font-size:13px;line-height:1.5}.acct-report{padding-bottom:6px}
.acct-settings-nav{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}.acct-settings-nav a{border:1px solid var(--line);border-radius:999px;background:white;color:#475569;padding:6px 12px;font-size:12px;font-weight:650;text-decoration:none}.acct-settings-nav a:hover{border-color:var(--sky);color:var(--sky)}
.acct-settings-section{margin-bottom:20px}.acct-settings-section h3{margin:16px 20px 8px;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.acct-kv{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;padding:16px 20px}.acct-kv div{display:grid;gap:3px}.acct-kv span{color:var(--muted);font-size:12px}.acct-kv b{font-size:14px}
.acct-coa{max-height:520px;overflow:auto}
.acct-migration-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
/* The migration wizard is wider than a phone: its preview table scrolls inside its .table-wrap and its
   file inputs give way, instead of widening the dialog body's one grid column (and with it the resume
   notice and its Discard button) past the screen. */
#acct-migration-preview,.acct-migration-grid,.acct-migration-grid>*{min-width:0}
@media(max-width:900px){.acct-migration-grid input[type=file]{width:100%;min-width:0}}
.nav-group{margin:12px 12px 4px;color:#64748b;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
@media(max-width:900px){.acct-two-col,.acct-review,.acct-migration-grid{grid-template-columns:1fr}.acct-form .field-row{grid-template-columns:1fr}}
@media print{.sidebar,.topbar,.acct-bar,.acct-report-controls,.button-row,.table-toolbar{display:none!important}.workspace{margin:0!important}.content{padding:0!important}.panel{box-shadow:none;border:0}}
/* What prints while a Books dialog is open (accounting.js, preparePrintSheet): the letterhead and a
   copy of the dialog, and nothing else — not the screen behind it, not the modal's frame. The logo
   sits in the same box as on an invoice PDF, 168 by 46 points, with the name beneath it. */
#acct-print-sheet{display:none}
@media print{body:has(> #acct-print-sheet.is-printing){background:white}body:has(> #acct-print-sheet.is-printing) > :not(#acct-print-sheet){display:none!important}
#acct-print-sheet.is-printing{display:block;color:#0f172a}
.acct-print-letterhead{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin-bottom:16px;border-bottom:1px solid #cbd5e1;padding-bottom:10px}
.acct-print-letterhead img{display:block;max-width:168pt;max-height:46pt;object-fit:contain}.acct-print-name{font-size:12pt;font-weight:700}
.acct-print-body h2{margin:0 0 4px;font-size:16pt}.acct-print-body > p{margin:0 0 12px;color:#475569;font-size:9pt}
.acct-print-body .acct-form-body{display:block;max-height:none;overflow:visible;padding:0}.acct-print-body .table-wrap{overflow:visible}.acct-print-body .table{min-width:0}
.acct-print-body tr{break-inside:avoid}.acct-print-body thead{display:table-header-group}.acct-print-body h3{break-after:avoid}
.acct-print-body *{box-shadow:none!important}}

/* Books: per-aircraft matrix and the tagging queue */
.acct-matrix th:first-child { min-width: 14rem; }
.acct-queue { margin-top: 1.25rem; }
.acct-queue h3 { margin: 0 0 .25rem; }
.acct-inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.acct-inline-form input { min-width: 10rem; }

/* Stripe Connect embedded components. Stripe renders each one into an iframe it sizes itself;
   the host only has to give it width and keep the loading text from collapsing the box. */
.acct-connect-host { min-height: 2rem; margin: 0.75rem 0; width: 100%; }
.acct-connect-host:empty { display: none; }

/* Button rows that grew. `.button-row` is `display:flex` with no wrap and `.compact-button` is a
   fixed 32px tall, so a row of six — which the Payments panel now has — squeezes each button
   until its label wraps to three lines inside a box only tall enough for one. Let the ROW wrap
   and forbid the LABEL from wrapping: the buttons then break onto a second line at full size
   rather than shredding their own text. */
.button-row { flex-wrap: wrap; row-gap: 0.5rem; }
.compact-button { white-space: nowrap; }

/* A checkbox and its words, side by side. Used nineteen times in Books and never styled, so it
   inherited `.modal label`'s grid and stacked the box above the text — or, outside a modal, ran
   the labels together as one blue line. */
.pair-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1.25rem;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}
.pair-checkbox input[type="checkbox"],
.pair-checkbox input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #0369a1;
}

/* The Card / Bank account choice at the top of the Add a payment method dialog. */
.acct-method-choice { border: 0; margin: 0 0 0.5rem; padding: 0; }
.acct-method-choice legend { padding: 0; margin-bottom: 0.4rem; color: #475569; font-size: 13px; font-weight: 650; }

/* The pay dialog's invoice list: one tick box per line, each its own row rather than the
   inline flow .pair-checkbox gives a lone checkbox beside a field. */
.pay-invoices { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }
.pay-invoices .pair-checkbox { margin-right: 0; }

/* A document's facts in the invoice View dialog: label over value, as many to a row as fit. */
.acct-doc-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 18px; margin: 0; }
.acct-doc-facts dt { color: var(--muted); font-size: 12px; font-weight: 650; }
.acct-doc-facts dd { margin: 3px 0 0; font-size: 13px; overflow-wrap: anywhere; }

/* What an invoice's lines come to, under the lines, while they are being typed. */
.acct-lines-total { margin: 0; color: #475569; font-size: 13px; text-align: right; }
.acct-lines-total b { color: var(--slate); font-variant-numeric: tabular-nums; }
