/* Scoped QuickBooks-inspired accounting window; no copied Intuit assets.
   Matches QBO's visual language (typography scale, white content, green primary action)
   without pixel-copying any proprietary asset. Stays light regardless of NEXA dark mode. */
.accounting-window {
  background: #f4f6f8; color: #1a1a1a; border: 1px solid #dfe3e8; border-radius: 8px;
  overflow: hidden; min-height: 76vh; display: flex; flex-direction: column;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; font-size: 14px;
}
#accounting-banner { padding: 9px 20px; background: #fff3cd; color: #5c4400; font-weight: 600; font-size: 12.5px; border-bottom: 1px solid #e6d28a; }
#accounting-topbar { display: flex; align-items: center; justify-content: space-between; padding: 9px 20px; background: #fff; border-bottom: 1px solid #e3e7eb; }
.qb-brand { font-weight: 700; font-size: 15px; color: #0b2447; }
.accounting-body { display: flex; flex: 1; min-height: 0; }

#accounting-nav { width: 220px; flex: 0 0 220px; background: #0b2447; overflow-y: visible; position: relative; }
.qb-rail { display: flex; flex-direction: column; padding: 6px 0; }
.qb-rail-group { position: relative; }
.qb-rail-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: transparent; border: 0; border-left: 3px solid transparent; cursor: pointer;
  font: inherit; text-align: left; padding: 0 16px; min-height: 56px; color: #fff; font-size: 14px;
}
.qb-rail-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-rail-item:hover { background: rgba(255,255,255,.08); }
.qb-rail-item[aria-current="page"] { background: rgba(255,255,255,.14); border-left-color: #2ca01c; font-weight: 600; }
.qb-rail-item[aria-expanded="true"] { background: rgba(255,255,255,.14); }
.qb-chevron { color: #9fb3d1; font-size: 16px; }

.qb-flyout {
  position: absolute; top: 0; left: 100%; min-width: 220px; background: #fff; border: 1px solid #e3e7eb;
  border-radius: 0 6px 6px 0; box-shadow: 2px 4px 14px rgba(0,0,0,.18); z-index: 20; padding: 6px 0;
}
.qb-flyout[hidden] { display: none; }
.qb-flyout-item {
  display: block; width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
  font: inherit; font-size: 13.5px; padding: 10px 16px; color: #273142;
}
.qb-flyout-item:hover { background: #eef3f0; }
.qb-flyout-item[aria-current="page"] { background: #e6f3e8; color: #0b2447; font-weight: 600; }

#accounting-content { flex: 1; min-width: 0; background: #f4f6f8; padding: 22px 26px; overflow-y: auto; }
#accounting-main { background: #fff; border: 1px solid #e3e7eb; border-radius: 8px; padding: 22px 24px; min-height: 100%; }

.qb-dash-cards section { min-height: 92px; }
.qb-dash-list { list-style: none; margin: 0; padding: 0; max-height: 120px; overflow-y: auto; }
.qb-dash-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.qb-dash-list li span:last-child { font-variant-numeric: tabular-nums; }


.qb-page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 16px; }
.qb-page-head h1 { font-size: 22px; margin: 0 0 4px; color: #1a1a1a; font-weight: 700; }
.qb-subtitle { margin: 0; color: #6b7280; font-size: 12.5px; }
.qb-page-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.qb-btn { font: inherit; border-radius: 5px; padding: 7px 16px; cursor: pointer; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; }
.qb-btn-primary { background: #2ca01c; color: #fff; }
.qb-btn-primary:hover { background: #24871a; }
.qb-btn-ghost { background: #fff; border-color: #c6ccd3; color: #2a3340; }
.qb-btn-ghost:hover { background: #f1f3f5; }
.qb-btn-sm { padding: 4px 11px; font-size: 12.5px; }

.qb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.qb-cards section { background: #fff; padding: 14px 16px; border: 1px solid #e3e7eb; border-radius: 7px; }
.qb-cards h3 { margin: 0 0 6px; font-size: 12px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.qb-card-value { margin: 0; font-size: 15px; font-weight: 600; }
.qb-muted { color: #8a919b; font-weight: 400; }

.qb-tabs { display: flex; gap: 22px; border-bottom: 1px solid #e3e7eb; margin-bottom: 0; }
.qb-tab { padding: 10px 2px; color: #6b7280; font-size: 13.5px; cursor: default; border-bottom: 2px solid transparent; }
.qb-tab.active { color: #0b2447; font-weight: 600; border-bottom-color: #2ca01c; }

.qb-toolbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; flex-wrap: wrap; }
.qb-toolbar input[type="search"], .qb-toolbar input[type="date"], .qb-toolbar select {
  font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid #c6ccd3; border-radius: 5px; background: #fff; color: #1a1a1a;
}
.qb-toolbar input[type="search"] { min-width: 220px; }
.qb-toolbar-sep { color: #8a919b; font-size: 12.5px; }

.qb-table-wrap { overflow-x: auto; border: 1px solid #e3e7eb; border-radius: 6px; }
.qb-table { width: 100%; border-collapse: collapse; background: #fff; }
.qb-table thead th {
  position: sticky; top: 0; background: #f7f8fa; color: #4b5563; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em; text-align: left; padding: 10px 12px; border-bottom: 1px solid #e3e7eb; z-index: 1;
}
.qb-table td { padding: 9px 12px; border-bottom: 1px solid #eef1f4; font-size: 13.5px; }
.qb-table tbody tr:nth-child(even) { background: #fafbfc; }
.qb-table tbody tr:hover { background: #eef3f0; }
.qb-table .qb-num { text-align: right; font-variant-numeric: tabular-nums; }
.qb-table-empty { text-align: center; color: #8a919b; padding: 22px 0 !important; }
.qb-link { background: none; border: 0; color: #126d92; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

.qb-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 2px; color: #6b7280; font-size: 12.5px; }

.qb-status { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11.5px; font-weight: 700; }
.qb-status-paid { background: #e6f3e8; color: #1b6e13; }
.qb-status-open { background: #e8f0fb; color: #1b4f91; }
.qb-status-overdue { background: #fbe8e8; color: #a32020; }

.qb-empty { text-align: center; padding: 48px 24px; color: #6b7280; }
.qb-empty-icon { font-size: 30px; margin-bottom: 10px; color: #c6ccd3; }

.qb-report-head { text-align: center; margin-bottom: 18px; }
.qb-report-head h2 { margin: 0; font-size: 16px; color: #0b2447; }
.qb-report-head h3 { margin: 4px 0 0; font-size: 19px; }
.qb-report-head p { margin: 2px 0 0; font-size: 12.5px; color: #6b7280; }
.qb-report-total td { font-weight: 700; border-top: 2px solid #c6ccd3; background: #fafbfc; }

.qb-invoice-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.qb-invoice-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
.qb-invoice-number { font-size: 20px; font-weight: 700; }
.qb-invoice-badge { padding: 4px 12px; border-radius: 12px; font-weight: 700; font-size: 12px; }
.qb-badge-paid { background: #e6f3e8; color: #1b6e13; }
.qb-badge-open { background: #e8f0fb; color: #1b4f91; }
.qb-badge-overdue { background: #fbe8e8; color: #a32020; }
.qb-invoice-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 16px; }
.qb-invoice-meta label { display: block; font-size: 11px; color: #8a919b; text-transform: uppercase; margin-bottom: 2px; }
.qb-invoice-totals { max-width: 320px; margin-left: auto; margin-top: 14px; }
.qb-invoice-totals > div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.qb-total-line { border-top: 1px solid #e3e7eb; font-weight: 600; }
.qb-balance-line { font-weight: 700; color: #0b2447; }
#accounting-detail { margin-top: 18px; }

.qb-evidence-note { margin-top: 12px; color: #8a919b; font-size: 12px; }

.qb-modal { position: fixed; inset: 0; background: rgba(15,23,32,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.qb-modal[hidden] { display: none; }
.qb-modal-card { background: #fff; border-radius: 8px; padding: 22px 24px; width: 360px; max-width: calc(100vw - 32px); box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.qb-modal-card h2 { margin: 0 0 6px; font-size: 17px; }
.qb-modal-card label { display: block; font-size: 12.5px; color: #4b5563; margin: 12px 0 4px; font-weight: 600; }
.qb-modal-card input, .qb-modal-card textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 7px 9px; border: 1px solid #c6ccd3; border-radius: 5px; }
.qb-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.qb-error { color: #a32020; font-size: 12.5px; margin: 8px 0 0; }

@media (max-width: 760px) {
  .accounting-body { flex-direction: column; }
  #accounting-nav { width: 100%; flex: 0 0 auto; }
  .qb-flyout { position: static; left: auto; box-shadow: none; border-radius: 0; }
}
