:root {
  font-family: var(--ofi-font-family, "Source Sans 3", "Geist", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: var(--ofi-font-size-md, 14px);
  line-height: var(--ofi-line-height-normal, 1.45);
  font-weight: var(--ofi-font-weight-regular, 400);
  color: #172033;
  background: #f5f7fb;
  font-synthesis: none;
  --navy: #183153;
  --indigo: #4f46e5;
  --line: #dfe5ef;
  --muted: #667085;
  --surface: #fff;
  --success: #166534;
  --warning: #92400e;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f5f7fb; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.boot-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.boot-card, .auth-card { width: min(540px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 14px 40px rgba(24,49,83,.08); }
.ofi-mark { display:inline-grid; place-items:center; min-width:52px; height:32px; padding:0 10px; border-radius:8px; background:var(--navy); color:#fff; font-weight:700; letter-spacing:.08em; }
h1,h2,h3,p { margin-top:0; }
h1 { margin:14px 0 6px; font-size:var(--ofi-font-size-display,28px); line-height:var(--ofi-line-height-tight,1.2); font-weight:var(--ofi-font-weight-bold,700); }
h2 { font-size:var(--ofi-font-size-title,22px); line-height:var(--ofi-line-height-tight,1.2); font-weight:var(--ofi-font-weight-semibold,600); }
.muted { color:var(--muted); }
.shell { min-height:100vh; display:grid; grid-template-rows:auto 1fr; }
.topbar { height:58px; background:#fff; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 22px; position:sticky; top:0; z-index:5; }
.brand { display:flex; align-items:center; gap:12px; font-weight:700; }
.brand small { display:block; color:var(--muted); font-weight:400; }
.top-actions { display:flex; align-items:center; gap:10px; }
.content { width:min(1180px,100%); margin:0 auto; padding:24px; }
.grid { display:grid; gap:16px; }
.grid-5 { grid-template-columns:repeat(5,minmax(0,1fr)); }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px; }
.kpi strong { display:block; font-size:26px; line-height:var(--ofi-line-height-tight,1.2); font-weight:var(--ofi-font-weight-bold,700); color:var(--navy); }
.kpi span { color:var(--muted); font-size:14px; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:26px 0 12px; }
.section-head h2 { margin:0; }
.badge { display:inline-flex; align-items:center; min-height:24px; padding:3px 8px; border-radius:999px; font-size:12px; font-weight:700; background:#e9eef7; color:var(--navy); }
.badge.ok { background:#dcfce7; color:var(--success); }
.badge.future { background:#fef3c7; color:var(--warning); }
.btn { min-height:36px; padding:7px 13px; border-radius:8px; border:1px solid var(--line); background:#fff; color:#172033; font-weight:600; }
.btn.primary { background:var(--navy); color:white; border-color:var(--navy); }
.btn.ghost { background:transparent; }
.btn.danger { color:var(--danger); }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.field { display:flex; flex-direction:column; gap:6px; }
.field.full { grid-column:1/-1; }
label { font-size:13px; font-weight:600; color:#344054; }
input,select { min-height:38px; border:1px solid #cfd7e6; border-radius:8px; padding:7px 10px; background:#fff; color:#172033; }
input:focus,select:focus { outline:2px solid rgba(79,70,229,.16); border-color:var(--indigo); }
.notice { border:1px solid #dbe5f4; background:#f8fbff; border-radius:10px; padding:12px 14px; color:#344054; }
.error { border-color:#fecaca; background:#fff1f2; color:#991b1b; }
.success { border-color:#bbf7d0; background:#f0fdf4; color:#166534; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:10px; background:#fff; }
table { width:100%; border-collapse:collapse; min-width:680px; }
th,td { padding:10px 12px; border-bottom:1px solid #edf0f5; text-align:left; font-size:14px; }
th { background:#f8fafc; color:#475467; font-size:12px; text-transform:uppercase; letter-spacing:.03em; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px; }
.stack { display:flex; flex-direction:column; gap:10px; }
.auth-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; }
.auth-card form { margin-top:18px; }
.footer-note { margin-top:20px; font-size:12px; color:var(--muted); }
@media (max-width: 900px) { .grid-5,.grid-4,.grid-2 { grid-template-columns:1fr 1fr; } }
@media (max-width: 620px) { .grid-5,.grid-4,.grid-2,.form-grid { grid-template-columns:1fr; } .topbar{padding:0 14px}.content{padding:16px}.field.full{grid-column:auto}.top-actions .user-label{display:none} }

/* F2 catalog workspace */
.shell { grid-template-rows:auto auto 1fr; }
.app-nav { min-height:44px; display:flex; gap:4px; align-items:center; padding:5px 22px; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:58px; z-index:4; overflow:auto; }
.nav-btn { min-height:32px; padding:6px 11px; border:0; border-radius:7px; background:transparent; color:#475467; font-weight:600; white-space:nowrap; }
.nav-btn:hover { background:#f3f6fb; color:var(--navy); }
.nav-btn.active { background:#eaf0f8; color:var(--navy); }
.page-title { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:18px; }
.page-title h1 { margin:0 0 4px; }
.page-title p { margin-bottom:0; }
.toolbar { display:flex; justify-content:space-between; gap:12px; margin:12px 0; }
.search { width:min(460px,100%); }
.row-actions { display:flex; gap:8px; justify-content:flex-end; white-space:nowrap; }
.link-btn { padding:0; border:0; background:transparent; color:#315b91; font-size:13px; font-weight:600; }
.link-btn:hover { text-decoration:underline; }
.block { display:block; }
.empty-state { padding:34px 18px; border:1px dashed #cfd7e6; border-radius:10px; text-align:center; color:var(--muted); background:#fff; }
.dashboard-gap { margin-top:18px; }
.catalog-chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display:inline-flex; min-height:30px; align-items:center; padding:5px 10px; border:1px solid #d6deea; background:#f8fafc; border-radius:999px; color:#344054; font-size:13px; }
.subnav { display:flex; gap:6px; flex-wrap:wrap; padding-bottom:12px; margin-bottom:12px; border-bottom:1px solid var(--line); }
.form-actions { display:flex; gap:9px; justify-content:flex-end; margin-top:16px; }
.field-hint { color:var(--muted); font-size:12px; }
.check-field { display:flex; align-items:center; gap:9px; min-height:38px; font-weight:600; color:#344054; }
.check-field input { min-height:auto; width:16px; height:16px; }
.subhead { margin:22px 0 10px; padding-top:14px; border-top:1px solid var(--line); }
.notice.compact { padding:9px 11px; margin-bottom:14px; font-size:13px; }
.loading { padding:28px; text-align:center; color:var(--muted); }
.modal-backdrop { position:fixed; inset:0; z-index:40; background:rgba(15,23,42,.36); display:flex; }
.editor-panel { background:#fff; display:flex; flex-direction:column; }
.editor-head { min-height:62px; display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--line); }
.editor-head h2 { margin:0; font-size:21px; }
.editor-body { padding:18px; overflow:auto; flex:1; }
.icon-btn { width:34px; height:34px; border:0; border-radius:8px; background:#f2f4f7; font-size:24px; line-height:1; color:#475467; }
.sticky-actions { position:sticky; bottom:-18px; padding:14px 0 2px; background:#fff; border-top:1px solid var(--line); }
.auth-card.wide { width:min(720px,100%); }
@media (max-width: 720px) {
  .app-nav { top:58px; padding:5px 12px; }
  .page-title,.toolbar { flex-direction:column; }
  .toolbar .btn { width:100%; }
  .search { width:100%; }
}

/* F3 purchases + valued inventory */
textarea { width:100%; border:1px solid #cfd7e6; border-radius:8px; padding:8px 10px; resize:vertical; font:inherit; color:#172033; }
textarea:focus { outline:2px solid rgba(79,70,229,.16); border-color:var(--indigo); }
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; border-bottom:1px solid var(--line); padding-bottom:8px; }
.tab { min-height:34px; padding:6px 11px; border:0; border-radius:7px; background:transparent; color:#475467; font-weight:600; }
.tab.active { background:#eaf0f8; color:var(--navy); }
.line-editor { margin-top:8px; }
.operation-line { display:grid; grid-template-columns:minmax(220px,2fr) minmax(110px,.7fr) minmax(130px,.8fr) auto; align-items:end; gap:10px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fbfcfe; }
.operation-line .field.full { grid-column:auto; }
.line-remove { margin-bottom:1px; }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width: 820px) { .operation-line { grid-template-columns:1fr 1fr; } .operation-line .field.full { grid-column:1/-1; } .grid-3 { grid-template-columns:1fr; } }

/* F8 RC5 F1 — centered reusable transaction/editor modal */
body.editor-modal-open { overscroll-behavior:contain; }
.modal-backdrop.transaction-modal-backdrop {
  position:fixed;
  inset:0;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(15,23,42,.40);
  backdrop-filter:blur(2px);
}
.editor-panel.transaction-modal {
  width:min(720px,calc(100vw - 48px));
  height:auto;
  max-height:calc(100vh - 48px);
  background:#fff;
  border:1px solid #dbe3ef;
  border-radius:16px;
  box-shadow:0 24px 70px rgba(15,23,42,.22);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.transaction-modal.transaction-modal--lg { width:min(900px,calc(100vw - 48px)); }
.transaction-modal.transaction-modal--xl { width:min(1120px,calc(100vw - 48px)); }
.transaction-modal__header {
  min-height:76px;
  flex:0 0 auto;
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  background:#fff;
}
.transaction-modal__intro { display:flex; align-items:center; gap:14px; min-width:0; }
.transaction-modal__copy { min-width:0; }
.transaction-modal__copy h2 { margin:0; color:#15233b; font-size:24px; font-weight:700; }
.transaction-modal__subtitle { margin:4px 0 0; color:var(--muted); font-size:13px; line-height:1.35; }
.transaction-modal__icon {
  flex:0 0 auto;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#edf4ff;
  color:#205fae;
}
.transaction-modal__icon svg { width:23px; height:23px; }
.transaction-modal__close { flex:0 0 auto; font-size:22px; }
.transaction-modal__body {
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:20px 24px 24px;
  overscroll-behavior:contain;
}
.transaction-modal .sticky-actions {
  position:sticky;
  bottom:-24px;
  z-index:3;
  margin:20px -24px -24px;
  padding:14px 24px;
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.98);
  box-shadow:0 -8px 20px rgba(15,23,42,.04);
}
.transaction-modal .sticky-actions .btn { min-width:96px; }
.transaction-modal .sticky-actions .btn.primary { min-width:150px; }
.transaction-modal input,
.transaction-modal select,
.transaction-modal textarea { min-height:40px; }

@media (max-width: 760px) {
  .modal-backdrop.transaction-modal-backdrop { padding:8px; align-items:stretch; }
  .editor-panel.transaction-modal,
  .transaction-modal.transaction-modal--lg,
  .transaction-modal.transaction-modal--xl {
    width:100%;
    max-height:calc(100vh - 16px);
    margin:auto 0;
    border-radius:12px;
  }
  .transaction-modal__header { padding:14px 16px; min-height:68px; }
  .transaction-modal__copy h2 { font-size:21px; }
  .transaction-modal__subtitle { display:none; }
  .transaction-modal__icon { width:38px; height:38px; }
  .transaction-modal__body { padding:16px; }
  .transaction-modal .sticky-actions { bottom:-16px; margin:18px -16px -16px; padding:12px 16px; }
}

/* F8 RC5 F2 — TransactionGrid + searchable product catalog */
.transaction-lines { margin-top:18px; }
.transaction-lines__heading { display:flex; align-items:flex-end; justify-content:space-between; gap:14px; margin-bottom:10px; }
.transaction-lines__heading h3 { margin:0 0 3px; font-size:18px; color:#172033; }
.transaction-lines__hint { margin:0; color:var(--muted); font-size:12px; }
.transaction-grid__quick-search {
  min-width:290px; min-height:38px; display:flex; align-items:center; gap:8px; padding:7px 11px;
  border:1px solid #cfd7e6; border-radius:9px; background:#fff; color:#667085; text-align:left;
}
.transaction-grid__quick-search:hover { border-color:#9fb4d0; color:#344054; background:#fbfdff; }
.transaction-grid__quick-search svg,.product-search-btn svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.transaction-grid { border:1px solid var(--line); border-radius:12px; background:#fff; overflow:visible; }
.transaction-grid__header,.transaction-grid__row { display:grid; align-items:center; }
.transaction-grid--purchase .transaction-grid__header,.transaction-grid--purchase .transaction-grid__row { grid-template-columns:58px minmax(280px,2fr) minmax(92px,.62fr) minmax(125px,.78fr) minmax(110px,.72fr) 112px; }
.transaction-grid--sale .transaction-grid__header,.transaction-grid--sale .transaction-grid__row { grid-template-columns:58px minmax(255px,1.8fr) minmax(86px,.52fr) minmax(105px,.66fr) minmax(100px,.62fr) minmax(96px,.58fr) minmax(110px,.68fr) 112px; }
.transaction-grid__header { min-height:40px; background:#f7f9fc; border-bottom:1px solid var(--line); border-radius:11px 11px 0 0; color:#475467; font-size:12px; font-weight:700; }
.transaction-grid__header > div { padding:8px 10px; }
.transaction-grid__row { min-height:72px; border-bottom:1px solid #edf0f5; transition:background .15s ease,box-shadow .15s ease; }
.transaction-grid__row:last-child { border-bottom:0; border-radius:0 0 11px 11px; }
.transaction-grid__row > * { min-width:0; margin:8px 8px; }
.transaction-grid__row--attention { background:#fff7ed; box-shadow:inset 3px 0 #f59e0b; }
.transaction-grid__line-no { display:flex; align-items:center; gap:6px; color:#667085; margin-left:12px!important; }
.transaction-grid__grab { width:24px; height:30px; display:grid; place-items:center; padding:0; border:0; border-radius:6px; background:transparent; color:#7b8aa0; font-size:18px; line-height:1; cursor:grab; }
.transaction-grid__grab:hover,.transaction-grid__grab:focus-visible { background:#eef3f9; color:#315f91; outline:none; }
.transaction-grid__grab:active { cursor:grabbing; }
.transaction-grid__index { font-size:12px; font-weight:600; }
.transaction-grid__number { width:100%; min-height:38px!important; }
.transaction-grid__actions { position:relative; justify-self:stretch; margin-left:4px!important; margin-right:10px!important; }
.transaction-grid__actions > summary { list-style:none; }
.transaction-grid__actions > summary::-webkit-details-marker { display:none; }
.transaction-grid__actions-toggle { min-height:36px; display:flex; align-items:center; justify-content:space-between; gap:7px; padding:7px 9px; border:1px solid #ccd6e4; border-radius:8px; background:#fff; color:#344054; font-size:12px; font-weight:600; cursor:pointer; user-select:none; }
.transaction-grid__actions-toggle:hover,.transaction-grid__actions[open] .transaction-grid__actions-toggle { border-color:#94acd0; background:#f7faff; color:#244f82; }
.transaction-grid__actions-chevron { color:#728096; transition:transform .15s ease; }
.transaction-grid__actions[open] .transaction-grid__actions-chevron { transform:rotate(180deg); }
.transaction-grid__actions-menu { position:absolute; z-index:18; top:41px; right:0; width:166px; padding:5px; border:1px solid #ccd6e4; border-radius:9px; background:#fff; box-shadow:0 14px 30px rgba(15,23,42,.17); }
.transaction-grid__action { width:100%; min-height:34px; padding:7px 9px; border:0; border-radius:6px; background:transparent; color:#344054; font:inherit; font-size:12px; text-align:left; cursor:pointer; }
.transaction-grid__action:hover:not(:disabled),.transaction-grid__action:focus-visible:not(:disabled) { background:#eef5ff; color:#174f8d; outline:none; }
.transaction-grid__action:disabled { color:#a4acb9; cursor:not-allowed; }
.transaction-grid__action--danger { color:#b42318; }
.transaction-grid__action--danger:hover:not(:disabled),.transaction-grid__action--danger:focus-visible:not(:disabled) { background:#fff1f0; color:#9b1c13; }
.transaction-grid__row--moved { background:#eef7ff; box-shadow:inset 3px 0 #3b82c4; }
.transaction-grid__row--dragging { opacity:.55; }
.transaction-grid__row--drop-target { background:#f0f7ff; box-shadow:inset 0 0 0 2px #8cb7e7; }
.transaction-grid__add { color:#244f82; border-color:#b9c9de; }
.transaction-grid__add:hover { background:#f7faff; }

.transaction-grid__subtotal { display:block; text-align:right; color:#172033; font-size:13px; white-space:nowrap; }
.transaction-grid__row--loading { background:#f8fbff; }
.transaction-lines__footer { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-top:12px; }
.transaction-summary { width:min(330px,100%); margin-left:auto; border:1px solid #d8e1ec; border-radius:10px; background:#fff; overflow:hidden; }
.transaction-summary__row { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:8px 12px; border-bottom:1px solid #eef1f5; color:#475467; font-size:12px; }
.transaction-summary__row:last-child { border-bottom:0; }
.transaction-summary__row strong { color:#172033; font-variant-numeric:tabular-nums; }
.transaction-summary__row--total { padding:11px 12px; background:#eef6ff; color:#1e4f82; font-size:14px; font-weight:700; }
.transaction-summary__row--total strong { color:#163f6c; font-size:17px; }

.transaction-grid__product { overflow:visible; }
.product-combobox { position:relative; width:100%; }
.product-combobox__controls { display:flex; gap:7px; align-items:center; }
.product-combobox__field { position:relative; flex:1; min-width:0; }
.product-combobox__input { width:100%; padding-right:34px!important; font-weight:600; }
.product-combobox__toggle { position:absolute; right:3px; top:3px; width:30px; height:32px; border:0; border-left:1px solid #eef1f5; background:transparent; color:#52657d; font-size:17px; }
.product-search-btn { flex:0 0 auto; width:38px; height:38px; display:grid; place-items:center; padding:0; border:1px solid #a9c6ec; border-radius:8px; background:#f7fbff; color:#205fae; }
.product-search-btn:hover { background:#edf5ff; border-color:#78a8e4; }
.product-combobox__meta { display:block; margin-top:4px; color:#728096; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.product-combobox__menu { position:absolute; left:0; right:45px; top:43px; z-index:12; max-height:270px; overflow:auto; border:1px solid #cfd9e7; border-radius:9px; background:#fff; box-shadow:0 14px 30px rgba(15,23,42,.16); padding:4px; }
.product-combobox__option { width:100%; display:grid; grid-template-columns:auto 1fr; gap:2px 8px; align-items:baseline; padding:8px 9px; border:0; border-radius:7px; background:transparent; text-align:left; color:#172033; }
.product-combobox__option strong { color:#244f82; font-size:12px; }
.product-combobox__option span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.product-combobox__option small { grid-column:1/-1; color:#7a8698; }
.product-combobox__option:hover,.product-combobox__option.active { background:#eef5ff; }
.product-combobox__empty { padding:13px; color:var(--muted); font-size:12px; text-align:center; }

.product-picker-overlay { position:fixed; inset:0; z-index:70; display:grid; place-items:center; padding:20px; background:rgba(15,23,42,.24); }
.product-picker { width:min(620px,calc(100vw - 32px)); max-height:min(620px,calc(100vh - 40px)); display:flex; flex-direction:column; overflow:hidden; border:1px solid #d7e0ec; border-radius:14px; background:#fff; box-shadow:0 24px 70px rgba(15,23,42,.26); }
.product-picker__head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:16px 18px 10px; }
.product-picker__head h3 { margin:0 0 3px; font-size:20px; }
.product-picker__head p { margin:0; font-size:12px; }
.product-picker__close { font-size:20px; }
.product-picker__search { margin:0 18px 12px; min-height:42px!important; }
.product-picker__results { flex:1; overflow:auto; border-top:1px solid #edf1f6; padding:6px; }
.product-picker__result { width:100%; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 12px; border:0; border-radius:8px; background:transparent; text-align:left; color:#172033; }
.product-picker__result:hover,.product-picker__result.active { background:#eaf3ff; }
.product-picker__result-main { min-width:0; display:flex; flex-direction:column; }
.product-picker__result-main strong { color:#205fae; font-size:12px; }
.product-picker__result-main span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.product-picker__result-meta { flex:0 0 auto; color:#728096; font-size:11px; text-align:right; }
.product-picker__empty { padding:28px; text-align:center; color:var(--muted); }

@media (max-width: 980px) {
  .transaction-lines__heading { align-items:stretch; flex-direction:column; }
  .transaction-grid__quick-search { width:100%; min-width:0; }
  .transaction-lines__footer { flex-direction:column; }
  .transaction-summary { width:100%; }
  .transaction-grid { overflow:visible; }
  .transaction-grid--purchase .transaction-grid__header,.transaction-grid--purchase .transaction-grid__row { min-width:850px; }
  .transaction-grid--sale .transaction-grid__header,.transaction-grid--sale .transaction-grid__row { min-width:1090px; }
}


/* F8 RC5 F5 — final responsive/accessibility hardening */
.sr-only {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.transaction-grid-scroll { overflow:visible; border-radius:12px; }
.transaction-grid__scroll-hint { display:none; margin:0 0 7px; color:#667085; font-size:11px; }
.transaction-grid-scroll:focus-visible { outline:2px solid rgba(32,95,174,.38); outline-offset:3px; }
.transaction-lines__empty { display:flex; flex-direction:column; gap:2px; margin:10px 0; padding:13px 14px; border:1px dashed #c9d5e5; border-radius:10px; background:#f8fafc; color:#475467; font-size:12px; }
.transaction-lines__empty strong { color:#344054; font-size:13px; }
.transaction-grid__quick-search:disabled,.transaction-grid__add:disabled { opacity:.58; cursor:not-allowed; }
.product-combobox__input[aria-expanded="true"],.product-combobox__toggle[aria-expanded="true"] { border-color:#8fb3df; }
.transaction-grid__actions-toggle:focus-visible,.product-search-btn:focus-visible,.transaction-grid__quick-search:focus-visible,.transaction-grid__add:focus-visible,.product-picker__result:focus-visible,.product-combobox__option:focus-visible { outline:2px solid rgba(32,95,174,.36); outline-offset:2px; }
.product-picker-overlay { overscroll-behavior:contain; }
.product-picker__results { scrollbar-gutter:stable; }

@media (max-width: 980px) {
  .transaction-grid__scroll-hint { display:block; }
  .transaction-grid-scroll { overflow-x:auto; overflow-y:hidden; padding-bottom:3px; scrollbar-gutter:stable; -webkit-overflow-scrolling:touch; }
  .transaction-grid { overflow:visible; }
  .transaction-grid--purchase .transaction-grid__header,.transaction-grid--purchase .transaction-grid__row { min-width:850px; }
  .transaction-grid--sale .transaction-grid__header,.transaction-grid--sale .transaction-grid__row { min-width:1090px; }
  .transaction-grid__actions-menu { position:static; width:100%; margin-top:4px; box-shadow:0 8px 20px rgba(15,23,42,.12); }
}

@media (max-width: 600px) {
  .modal-backdrop.transaction-modal-backdrop { padding:0; }
  .editor-panel.transaction-modal,.transaction-modal.transaction-modal--lg,.transaction-modal.transaction-modal--xl { max-height:100dvh; min-height:100dvh; border-radius:0; border-left:0; border-right:0; }
  .transaction-modal__header { padding-left:14px; padding-right:14px; }
  .transaction-modal__body { padding:14px; }
  .transaction-modal .sticky-actions { bottom:-14px; margin:16px -14px -14px; padding:10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .transaction-modal .sticky-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .transaction-modal .sticky-actions .btn,.transaction-modal .sticky-actions .btn.primary { width:100%; min-width:0; }
  .product-picker-overlay { padding:0; align-items:end; }
  .product-picker { width:100%; max-height:min(82dvh,720px); border-radius:16px 16px 0 0; border-bottom:0; }
  .product-picker__head { padding:14px 14px 9px; }
  .product-picker__search { margin:0 14px 10px; }
  .product-picker__result { min-height:48px; }
  .transaction-grid__quick-search,.product-search-btn,.transaction-grid__actions-toggle,.transaction-grid__add { min-height:42px; }
}

@media (prefers-reduced-motion: reduce) {
  .transaction-grid__row,.transaction-grid__actions-chevron { transition:none!important; }
  .transaction-modal-backdrop { backdrop-filter:none; }
}

/* F8 RC5 F6 — visual polish & transaction layout alignment */
.transaction-meta-grid {
  display:grid;
  gap:12px 14px;
  margin-bottom:4px;
  align-items:end;
}
.transaction-meta-grid--purchase {
  grid-template-columns:minmax(280px,1.6fr) minmax(150px,.78fr) minmax(220px,1fr);
}
.transaction-meta-grid--sale {
  grid-template-columns:minmax(260px,1.35fr) minmax(210px,1fr) minmax(150px,.78fr);
}
.transaction-meta__field { min-width:0; }
.transaction-meta__field input,
.transaction-meta__field select { width:100%; min-height:40px; }
.transaction-meta__field--secondary label { color:#667085; }
.transaction-meta__field--secondary input { color:#344054; background:#fbfcfe; }
.transaction-modal .notice.compact { margin-bottom:12px; padding:9px 12px; }

.transaction-grid--purchase .transaction-grid__header,
.transaction-grid--purchase .transaction-grid__row {
  grid-template-columns:56px minmax(320px,1fr) 110px 150px 130px 120px;
}
.transaction-grid--sale .transaction-grid__header,
.transaction-grid--sale .transaction-grid__row {
  grid-template-columns:56px minmax(280px,1fr) 96px 120px 110px 96px 125px 120px;
}
.transaction-grid__row { min-height:58px; }
.transaction-grid__row > * { margin-top:7px; margin-bottom:7px; }
.transaction-grid__product,
.product-combobox,
.product-combobox__controls,
.transaction-grid__number,
.transaction-grid__subtotal,
.transaction-grid__actions { align-self:center; }
.transaction-grid .product-combobox__meta { display:none; }
.product-combobox__controls { min-height:40px; }
.product-combobox__input,
.transaction-grid__number { min-height:40px!important; }
.product-combobox__toggle { top:3px; height:34px; }
.product-search-btn { width:40px; height:40px; }
.transaction-grid__actions-toggle { min-height:40px; }
.transaction-grid__subtotal { line-height:40px; font-variant-numeric:tabular-nums; }
.transaction-grid__line-no { min-height:40px; }
.transaction-lines__hint { max-width:700px; }

@media (max-width: 980px) {
  .transaction-meta-grid--purchase,
  .transaction-meta-grid--sale { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .transaction-grid--purchase .transaction-grid__header,
  .transaction-grid--purchase .transaction-grid__row { min-width:910px; }
  .transaction-grid--sale .transaction-grid__header,
  .transaction-grid--sale .transaction-grid__row { min-width:1050px; }
}

@media (max-width: 640px) {
  .transaction-meta-grid--purchase,
  .transaction-meta-grid--sale { grid-template-columns:1fr; gap:10px; }
}

/* F8 RC5 F7 — numeric grid alignment */
.transaction-grid__header > div { display:flex; align-items:center; min-height:40px; }

/* Purchase: Quantity centered; money columns right-aligned; actions centered. */
.transaction-grid--purchase .transaction-grid__header > div:nth-child(3),
.transaction-grid--purchase .transaction-grid__row > :nth-child(3) { justify-content:center; text-align:center; }
.transaction-grid--purchase .transaction-grid__header > div:nth-child(4),
.transaction-grid--purchase .transaction-grid__header > div:nth-child(5),
.transaction-grid--purchase .transaction-grid__row > :nth-child(4),
.transaction-grid--purchase .transaction-grid__row > :nth-child(5) { justify-content:flex-end; text-align:right; }
.transaction-grid--purchase .transaction-grid__header > div:nth-child(6),
.transaction-grid--purchase .transaction-grid__row > :nth-child(6) { justify-content:center; text-align:center; }
.transaction-grid--purchase .transaction-grid__row > input:nth-child(3) { text-align:center; font-variant-numeric:tabular-nums; }
.transaction-grid--purchase .transaction-grid__row > input:nth-child(4) { text-align:right; font-variant-numeric:tabular-nums; }

/* Sale: Quantity centered; Price/Subtotal right; percentage fields centered. */
.transaction-grid--sale .transaction-grid__header > div:nth-child(3),
.transaction-grid--sale .transaction-grid__row > :nth-child(3),
.transaction-grid--sale .transaction-grid__header > div:nth-child(5),
.transaction-grid--sale .transaction-grid__row > :nth-child(5),
.transaction-grid--sale .transaction-grid__header > div:nth-child(6),
.transaction-grid--sale .transaction-grid__row > :nth-child(6) { justify-content:center; text-align:center; }
.transaction-grid--sale .transaction-grid__header > div:nth-child(4),
.transaction-grid--sale .transaction-grid__row > :nth-child(4),
.transaction-grid--sale .transaction-grid__header > div:nth-child(7),
.transaction-grid--sale .transaction-grid__row > :nth-child(7) { justify-content:flex-end; text-align:right; }
.transaction-grid--sale .transaction-grid__header > div:nth-child(8),
.transaction-grid--sale .transaction-grid__row > :nth-child(8) { justify-content:center; text-align:center; }
.transaction-grid--sale .transaction-grid__row > input:nth-child(3),
.transaction-grid--sale .transaction-grid__row > input:nth-child(5),
.transaction-grid--sale .transaction-grid__row > input:nth-child(6) { text-align:center; font-variant-numeric:tabular-nums; }
.transaction-grid--sale .transaction-grid__row > input:nth-child(4) { text-align:right; font-variant-numeric:tabular-nums; }

/* Amount/Subtotal occupy the same 40px visual baseline as editable controls. */
.transaction-grid__subtotal {
  min-height:40px;
  line-height:normal;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:0 2px;
  font-variant-numeric:tabular-nums;
}
.transaction-grid__actions { align-self:center; }

/* F8 RC5 F7-HF2 — compact product row polish (purchase + sale) */
@media (min-width: 601px) {
  .transaction-grid__row { min-height:50px; }
  .transaction-grid__row > * { margin-top:5px; margin-bottom:5px; }
  .product-combobox__controls { min-height:36px; }
  .product-combobox__input,
  .transaction-grid__number { min-height:36px!important; height:36px; padding-top:5px; padding-bottom:5px; }
  .product-combobox__toggle { top:2px; height:32px; }
  .product-search-btn { width:36px; height:36px; }
  .transaction-grid__actions-toggle { min-height:36px; padding-top:5px; padding-bottom:5px; }
  .transaction-grid__subtotal { min-height:36px; }
  .transaction-grid__line-no { min-height:36px; }
  .transaction-grid__grab { height:28px; }
}


/* F8 RC6-F1 — auditable document actions */
.toolbar__actions { display:flex; align-items:center; justify-content:flex-end; gap:9px; flex-wrap:wrap; }
.document-actions-select { min-width:132px; min-height:34px; padding:6px 30px 6px 9px; border:1px solid #cfd7e6; border-radius:8px; background:#fff; color:#344054; font:inherit; font-size:12px; font-weight:600; }
.document-actions-select:focus { outline:2px solid rgba(35,91,145,.14); border-color:#8eafd1; }
.document-detail { display:flex; flex-direction:column; gap:16px; }
.document-detail__meta { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px 18px; }
.document-detail__meta > div { min-width:0; padding:10px 12px; border:1px solid #e0e7f0; border-radius:9px; background:#fbfcfe; }
.document-detail__meta span,.document-detail__notes span { display:block; margin-bottom:3px; color:#667085; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.document-detail__meta strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.document-detail__notes { padding:10px 12px; border:1px solid #e0e7f0; border-radius:9px; background:#fff; }
.document-detail__notes p { margin:0; white-space:pre-wrap; }
.document-detail__total { align-self:flex-end; min-width:260px; display:flex; justify-content:space-between; gap:18px; padding:12px 14px; border:1px solid #d7e1ee; border-radius:9px; background:#eef6ff; color:#1d4f82; font-size:16px; }
.document-history .table-wrap,.void-archive .table-wrap { margin-top:12px; }
.numeric-right { text-align:right!important; font-variant-numeric:tabular-nums; }
.numeric-center { text-align:center!important; font-variant-numeric:tabular-nums; }
@media (max-width:720px){
  .toolbar__actions { width:100%; }
  .toolbar__actions .btn { flex:1 1 auto; width:auto; }
  .document-detail__meta { grid-template-columns:1fr; }
  .document-detail__total { width:100%; min-width:0; }
}

/* RC6-F2 — role based access control */
.role-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.role-check,.permission-check { display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border:1px solid #d8e0eb; border-radius:10px; background:#fff; cursor:pointer; }
.role-check input,.permission-check input { margin-top:3px; }
.permission-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.permission-group { border:1px solid #d8e0eb; border-radius:12px; padding:12px; background:#fbfcfe; display:grid; gap:8px; }
.permission-group h4 { margin:0 0 2px; }
.permission-check { background:#fff; }
@media (max-width: 760px) { .role-grid,.permission-groups { grid-template-columns:1fr; } }

/* RC6-F4 HF1 — OFI-owned notifications and confirmations */
.ofi-toast-host {
  position:fixed;
  z-index:120;
  top:18px;
  right:18px;
  width:min(420px,calc(100vw - 32px));
  display:grid;
  gap:10px;
  pointer-events:none;
}
.ofi-toast {
  pointer-events:auto;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:11px;
  align-items:start;
  padding:12px 12px 12px 13px;
  border:1px solid #d8e1ed;
  border-radius:12px;
  background:#fff;
  box-shadow:0 16px 42px rgba(15,23,42,.18);
  opacity:0;
  transform:translateY(-8px) scale(.98);
  transition:opacity .16s ease,transform .16s ease;
}
.ofi-toast.is-visible { opacity:1; transform:none; }
.ofi-toast.is-leaving { opacity:0; transform:translateY(-6px) scale(.985); }
.ofi-toast__icon,.ofi-dialog__icon {
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:50%;
  font-weight:800;
  background:#edf4ff;
  color:#205fae;
}
.ofi-toast--success .ofi-toast__icon,.ofi-dialog--success .ofi-dialog__icon { background:#ecfdf3; color:#067647; }
.ofi-toast--warning .ofi-toast__icon,.ofi-dialog--warning .ofi-dialog__icon { background:#fffaeb; color:#b54708; }
.ofi-toast--error .ofi-toast__icon,.ofi-dialog--error .ofi-dialog__icon { background:#fef3f2; color:#b42318; }
.ofi-toast__copy { color:#344054; font-size:13px; line-height:1.4; }
.ofi-toast__copy strong { display:block; margin-bottom:2px; color:#172033; font-size:13px; }
.ofi-toast__close { border:0; background:transparent; color:#667085; font-size:20px; line-height:1; padding:1px 4px; cursor:pointer; }
.ofi-dialog-backdrop {
  position:fixed;
  inset:0;
  z-index:130;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(15,23,42,.44);
  backdrop-filter:blur(2px);
}
.ofi-dialog {
  width:min(500px,100%);
  border:1px solid #dbe3ef;
  border-radius:16px;
  background:#fff;
  box-shadow:0 24px 70px rgba(15,23,42,.24);
  padding:20px;
}
.ofi-dialog__intro { display:flex; align-items:flex-start; gap:13px; }
.ofi-dialog__icon { width:36px; height:36px; flex:0 0 auto; }
.ofi-dialog__copy h3 { margin:2px 0 6px; color:#172033; font-size:18px; }
.ofi-dialog__copy p { margin:0; color:#475467; line-height:1.5; white-space:pre-line; }
.ofi-dialog__actions { display:flex; justify-content:flex-end; gap:9px; margin-top:20px; }
.btn.danger { background:#b42318; border-color:#b42318; color:#fff; }
.btn.danger:hover { background:#912018; border-color:#912018; }

/* RC6-F4 HF1 — clearer accounts-receivable allocation form */
.receipt-form { display:grid; gap:18px; }
.receipt-section { border:1px solid #e1e7f0; border-radius:12px; background:#fff; overflow:hidden; }
.receipt-section__head { padding:13px 15px 11px; border-bottom:1px solid #e8edf4; background:#fbfcfe; }
.receipt-section__head h3 { margin:0 0 3px; color:#172033; font-size:16px; }
.receipt-section__head p { margin:0; color:#667085; font-size:12px; line-height:1.4; }
.receipt-section__body { padding:15px; }
.receipt-apply-modes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:14px; }
.receipt-apply-mode {
  display:flex;
  align-items:flex-start;
  gap:8px;
  min-height:60px;
  padding:10px 11px;
  border:1px solid #d8e1ed;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
}
.receipt-apply-mode:has(input:checked) { border-color:#7aa7df; background:#f5f9ff; box-shadow:0 0 0 2px rgba(32,95,174,.08); }
.receipt-apply-mode input { width:16px; min-height:16px; height:16px; margin-top:2px; }
.receipt-apply-mode strong { display:block; color:#25364f; font-size:13px; }
.receipt-apply-mode small { display:block; margin-top:2px; color:#667085; font-size:11px; line-height:1.3; }
.receipt-allocation-table { width:100%; border-collapse:separate; border-spacing:0; }
.receipt-allocation-table th { padding:8px 9px; background:#f8fafc; color:#667085; font-size:11px; text-transform:uppercase; letter-spacing:.02em; text-align:left; border-bottom:1px solid #e4eaf2; }
.receipt-allocation-table td { padding:9px; border-bottom:1px solid #edf1f6; vertical-align:middle; }
.receipt-allocation-table tr:last-child td { border-bottom:0; }
.receipt-allocation-table .numeric-right { text-align:right; }
.receipt-allocation-table input { min-width:110px; text-align:right; }
.receipt-allocation-table input[readonly],.receipt-allocation-table input:disabled { background:#f7f9fc; color:#475467; }
.receipt-allocation-empty { padding:16px; text-align:center; color:#667085; background:#fbfcfe; border-radius:9px; }
.receipt-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:13px; }
.receipt-summary__item { padding:10px 12px; border:1px solid #e2e8f0; border-radius:9px; background:#fbfcfe; }
.receipt-summary__item span { display:block; color:#667085; font-size:11px; }
.receipt-summary__item strong { display:block; margin-top:2px; color:#172033; font-size:16px; }
.receipt-summary__item.is-balance strong { color:#205fae; }
@media (max-width:760px) {
  .ofi-toast-host { top:10px; right:10px; width:calc(100vw - 20px); }
  .ofi-dialog-backdrop { padding:10px; }
  .ofi-dialog { padding:17px; }
  .receipt-apply-modes,.receipt-summary { grid-template-columns:1fr; }
  .receipt-allocation-table { min-width:620px; }
  .receipt-section__body .table-wrap { overflow:auto; }
}

/* F8 RC6-F4 HF2 — modern OFI navigation drawer */
.shell { grid-template-rows:auto 1fr; }
.topbar { padding:0 20px; }
.topbar-brand-group { min-width:0; display:flex; align-items:center; gap:12px; }
.main-menu-button { width:38px; height:38px; flex:0 0 38px; display:grid; place-items:center; border:0; border-radius:9px; background:transparent; color:var(--navy); }
.main-menu-button:hover { background:#f2f5fa; }
.main-menu-button:focus-visible,.side-nav-close:focus-visible,.side-nav-section-toggle:focus-visible,.side-nav-item:focus-visible { outline:2px solid rgba(79,70,229,.35); outline-offset:2px; }
.menu-glyph { width:18px; height:18px; display:grid; grid-template-columns:repeat(2,6px); grid-template-rows:repeat(2,6px); gap:4px; }
.menu-glyph span { border:2px solid currentColor; border-radius:2px; }
.side-nav-backdrop { position:fixed; inset:0; z-index:70; display:flex; background:rgba(15,23,42,.30); opacity:0; transition:opacity .16s ease; }
.side-nav-backdrop.open { opacity:1; }
.side-nav-drawer { width:min(340px,92vw); min-height:100%; background:#fff; border-right:1px solid var(--line); box-shadow:16px 0 36px rgba(15,23,42,.12); display:flex; flex-direction:column; transform:translateX(-14px); transition:transform .16s ease; overflow:hidden; }
.side-nav-backdrop.open .side-nav-drawer { transform:translateX(0); }
.side-nav-head { min-height:76px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 14px 14px 18px; border-bottom:1px solid var(--line); }
.side-nav-head strong { display:block; font-size:19px; color:#172033; }
.side-nav-head small { display:block; margin-top:2px; color:var(--muted); }
.side-nav-close { width:38px; height:38px; border:0; border-radius:10px; background:#f3f5f8; color:#475467; font-size:25px; line-height:1; }
.side-nav-close:hover { background:#e9edf3; color:#172033; }
.side-nav-search-wrap { padding:14px 12px 10px; }
.side-nav-search { width:100%; min-height:40px; border-radius:9px; }
.side-nav-sections { flex:1; overflow:auto; padding:6px 8px 18px; }
.side-nav-section { margin:2px 0 8px; }
.side-nav-section-toggle { width:100%; min-height:36px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 9px; border:0; border-radius:8px; background:transparent; color:#667085; font-size:12px; font-weight:700; letter-spacing:.035em; text-align:left; }
.side-nav-section-toggle:hover { background:#f7f9fc; color:#344054; }
.side-nav-chevron { font-size:17px; line-height:1; transition:transform .15s ease; }
.side-nav-section.expanded .side-nav-chevron { transform:rotate(180deg); }
.side-nav-section-items { padding:2px 0 2px; }
.side-nav-item { width:100%; min-height:42px; display:flex; align-items:center; padding:9px 12px; border:0; border-left:3px solid transparent; border-radius:8px; background:transparent; color:#344054; font-weight:600; text-align:left; }
.side-nav-item:hover { background:#f4f7fb; color:var(--navy); }
.side-nav-item.active { background:#eaf0fa; border-left-color:#244f86; color:#183153; }
.side-nav-item[hidden],.side-nav-section[hidden] { display:none !important; }
.side-nav-workspace { min-height:76px; display:flex; align-items:center; gap:10px; padding:14px 18px; border-top:1px solid var(--line); background:#fbfcfe; }
.side-nav-workspace .workspace-dot { width:9px; height:9px; flex:0 0 9px; border-radius:999px; background:#16a34a; }
.side-nav-workspace small,.side-nav-workspace strong { display:block; }
.side-nav-workspace small { color:var(--muted); font-size:12px; }
.side-nav-workspace strong { max-width:250px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
@media (max-width:720px) {
  .topbar { padding:0 12px; }
  .topbar-brand-group { gap:8px; }
  .brand { gap:8px; }
  .brand .ofi-mark { min-width:44px; padding:0 8px; }
  .side-nav-drawer { width:min(330px,94vw); }
}
@media (max-width:480px) {
  .brand > div:last-child { max-width:175px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .brand small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}

/* F8 RC6-F4 HF3 — CxC split views */
.module-tabs {
  display:flex;
  align-items:flex-end;
  gap:6px;
  margin:2px 0 20px;
  padding:0 2px;
  border-bottom:1px solid var(--line);
  overflow-x:auto;
  scrollbar-width:thin;
}
.module-tab {
  flex:0 0 auto;
  min-height:42px;
  padding:9px 14px 10px;
  border:0;
  border-bottom:3px solid transparent;
  background:transparent;
  color:#475467;
  font:inherit;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
}
.module-tab:hover { color:#183153; background:#f8fafc; }
.module-tab.active { color:#183153; border-bottom-color:#244f86; }
.module-tab:focus-visible { outline:2px solid rgba(79,70,229,.32); outline-offset:-2px; border-radius:7px 7px 0 0; }
.ar-view { gap:16px; }
.ar-section-heading,.ar-card-heading {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
}
.ar-section-heading { margin:0 0 2px; }
.ar-section-heading h2 { margin:0; color:#172033; font-size:21px; }
.ar-section-heading p,.ar-card-heading p { margin:4px 0 0; }
.ar-card-heading { align-items:center; }
.ar-card-heading h3 { margin:0; }
.ar-aging-summary .kpi { min-height:104px; }
.ar-quick-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.ar-quick-card {
  min-height:118px;
  padding:16px 17px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:7px;
  border:1px solid #dbe3ef;
  border-radius:12px;
  background:#fbfcfe;
  color:#344054;
  text-align:left;
  font:inherit;
  cursor:pointer;
  transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;
}
.ar-quick-card:hover { border-color:#9db5d4; background:#fff; box-shadow:0 7px 18px rgba(15,23,42,.06); }
.ar-quick-card strong { color:#183153; font-size:15px; }
.ar-quick-card span { color:#667085; line-height:1.4; }
.ar-quick-card small { margin-top:auto; color:#205fae; font-weight:700; }
.ar-statement-toolbar {
  display:grid;
  grid-template-columns:minmax(260px,520px) auto;
  align-items:end;
  gap:10px;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.ar-statement-toolbar .field { margin:0; }
.ar-empty-state { min-height:210px; display:grid; place-items:center; align-content:center; text-align:center; }
.ar-empty-state strong { font-size:18px; color:#25364f; }
.ar-empty-state p { max-width:560px; margin:7px auto 0; }
@media (max-width:760px) {
  .module-tabs { margin-bottom:16px; }
  .module-tab { min-height:40px; padding:8px 11px 9px; }
  .ar-section-heading,.ar-card-heading { align-items:flex-start; flex-direction:column; }
  .ar-quick-grid { grid-template-columns:1fr; }
  .ar-statement-toolbar { grid-template-columns:1fr; align-items:stretch; }
  .ar-statement-toolbar .btn { width:100%; }
}

/* F8 RC6-F4 HF4 — list productivity, exports and CxC visual polish */
.content { width:min(1440px,100%); }
.page-title { margin-bottom:16px; }
.page-title h1 { letter-spacing:-.015em; }
.page-actions { margin-top:0; flex-wrap:wrap; }
.card { box-shadow:0 1px 2px rgba(15,23,42,.025); }
.kpi { position:relative; overflow:hidden; }
.kpi::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:#dbe7f6; }

.list-tools { margin:0 0 16px; padding:16px; border-color:#d8e2ef; background:linear-gradient(180deg,#ffffff 0%,#fbfcff 100%); }
.list-tools__filters { display:grid; grid-template-columns:minmax(260px,1.7fr) repeat(4,minmax(145px,1fr)); gap:12px; align-items:end; }
.list-tools__filters .field { margin:0; }
.list-tools__filters .search { width:100%; }
.list-tools__footer { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:14px; padding-top:13px; border-top:1px solid #e6ebf2; }
.list-tools__meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.list-tools__count { display:inline-flex; align-items:center; min-height:28px; padding:4px 10px; border-radius:999px; background:#edf4ff; color:#244f86; font-weight:700; font-size:12px; }
.list-workspace { gap:16px; }
.list-card { padding:16px; gap:14px; }
.list-card__heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; }
.list-card__heading h3 { margin:0; color:#172033; }
.list-card__heading p { margin:4px 0 0; }
.list-card__total { color:#183153; font-size:20px; font-variant-numeric:tabular-nums; white-space:nowrap; }

.data-table-wrap { border-radius:12px; border-color:#dfe6ef; box-shadow:0 1px 2px rgba(15,23,42,.025); }
.data-table { min-width:760px; }
.data-table thead th { position:sticky; top:0; z-index:1; background:#f5f8fc; color:#40516a; }
.data-table tbody tr:nth-child(even) { background:#fbfcfe; }
.data-table tbody tr:hover { background:#f4f8fd; }
.data-table th.numeric-right,.data-table td.numeric-right { text-align:right!important; }
.data-table th.numeric-center,.data-table td.numeric-center { text-align:center!important; }
.data-table td { vertical-align:middle; }
.data-table td.numeric-right,.data-table td.numeric-center { font-variant-numeric:tabular-nums; }

.module-tabs { margin-top:0; background:#fff; border:1px solid #e0e6ef; border-radius:12px; padding:0 10px; box-shadow:0 1px 2px rgba(15,23,42,.02); }
.module-tab { min-height:46px; }
.ar-view { gap:18px; }
.ar-section-heading { padding:2px 2px 0; }
.ar-section-heading h2 { font-size:22px; letter-spacing:-.01em; }
.ar-insight-card { background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%); }
.ar-quick-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.ar-quick-card { min-height:126px; box-shadow:0 1px 2px rgba(15,23,42,.02); }
.ar-aging-summary .kpi { min-height:112px; }

@media (max-width:1200px){
  .list-tools__filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .product-list-tools .list-tools__filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .list-tools__filters .field:first-child { grid-column:span 2; }
  .ar-quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px){
  .list-tools__filters { grid-template-columns:1fr; }
  .product-list-tools .list-tools__filters { grid-template-columns:1fr; }
  .list-tools__filters .field:first-child { grid-column:auto; }
  .list-tools__footer,.list-card__heading { align-items:flex-start; flex-direction:column; }
  .list-tools__footer .toolbar__actions { width:100%; }
  .list-tools__footer .toolbar__actions .btn { flex:1 1 auto; }
  .ar-quick-grid { grid-template-columns:1fr; }
  .module-tabs { padding:0 4px; border-radius:10px; }
}

/* F8 RC6-F4 HF5 — OFI Visual Foundation / Design System */
:root {
  --navy: var(--ofi-primary, #243f86);
  --indigo: var(--ofi-primary-light, #3458b8);
  --line: var(--ofi-border, #dde2ec);
  --muted: var(--ofi-text-muted, #667085);
  --surface: var(--ofi-surface, #fff);
  --success: var(--ofi-success, #219a6f);
  --warning: var(--ofi-warning, #b36b00);
  --danger: var(--ofi-danger, #d44f6f);
  --screen-bg: #f4f6fa;
  --screen-surface-soft: #f8faff;
  --screen-border: #dbe3ee;
  --screen-border-strong: #c9d4e3;
  --screen-text: #213047;
  --screen-shadow: 0 1px 2px rgba(25,38,53,.04),0 8px 28px rgba(25,38,53,.035);
  --screen-shadow-hover: 0 10px 28px rgba(25,38,53,.08);
}

html { background:var(--screen-bg); }
body {
  background:
    radial-gradient(circle at 12% -12%, rgba(52,88,184,.05), transparent 30%),
    var(--screen-bg);
  color:var(--screen-text);
}

/* App chrome */
.topbar {
  height:64px;
  padding:0 24px;
  border-bottom:1px solid rgba(199,207,221,.86);
  background:rgba(255,255,255,.96);
  box-shadow:0 1px 8px rgba(25,38,53,.035);
  backdrop-filter:saturate(140%) blur(10px);
}
.brand { gap:13px; color:#17263c; }
.brand > div:last-child { font-size:15px; line-height:1.2; }
.brand small { margin-top:3px; color:#778398; font-size:12px; }
.ofi-mark {
  min-width:54px;
  height:36px;
  border-radius:10px;
  background:linear-gradient(145deg,#1d3d69,#243f86);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 4px 12px rgba(36,63,134,.14);
}
.main-menu-button { width:40px; height:40px; border-radius:10px; }
.main-menu-button:hover { background:#eef3f9; }
.top-actions { gap:12px; }
.content {
  width:min(1480px,100%);
  padding:30px 32px 44px;
}

/* Typography and hierarchy */
h1 { color:#16243a; letter-spacing:-.025em; }
h2,h3 { color:#1d2c43; }
.page-title {
  align-items:center;
  min-height:72px;
  margin:0 0 20px;
  padding:0 2px;
}
.page-title > div:first-child { min-width:0; }
.page-title h1 { margin:0 0 5px; font-size:30px; line-height:1.12; }
.page-title p { max-width:820px; margin:0; color:#65748b; font-size:14px; line-height:1.5; }
.page-title.compact { min-height:auto; padding:0; }
.page-title.compact h3 { margin:0 0 4px; }

/* Screen action system: secondary utilities first, primary action last */
.screen-actions,.page-actions,.toolbar__actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:9px;
  flex-wrap:wrap;
}
.screen-actions { flex:0 0 auto; }
.screen-actions .btn,.page-actions .btn { white-space:nowrap; }

/* Buttons */
.btn {
  min-height:40px;
  padding:8px 14px;
  border:1px solid var(--screen-border-strong);
  border-radius:9px;
  background:#fff;
  color:#30435d;
  font-weight:600;
  box-shadow:0 1px 1px rgba(25,38,53,.025);
  transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease,transform .08s ease;
}
.btn:hover:not(:disabled) { border-color:#aabbd0; background:#f8fbff; color:#1d426f; box-shadow:0 2px 8px rgba(25,38,53,.06); }
.btn:active:not(:disabled) { transform:translateY(1px); }
.btn:focus-visible,.link-btn:focus-visible { outline:2px solid rgba(52,88,184,.30); outline-offset:2px; }
.btn.primary {
  background:linear-gradient(180deg,#26498a 0%,#203f79 100%);
  border-color:#203f79;
  color:#fff;
  box-shadow:0 5px 14px rgba(36,63,134,.18);
}
.btn.primary:hover:not(:disabled) { background:linear-gradient(180deg,#213f7c 0%,#1b3568 100%); border-color:#1b3568; color:#fff; box-shadow:0 7px 18px rgba(36,63,134,.22); }
.btn.ghost { border-color:transparent; box-shadow:none; background:transparent; }
.btn.ghost:hover { border-color:#e0e6ef; background:#f6f8fb; }
.btn.danger { box-shadow:0 4px 12px rgba(180,35,24,.12); }
.btn:disabled { opacity:.52; cursor:not-allowed; box-shadow:none; }
.screen-action { background:#fff; }

/* Cards and section surfaces */
.card {
  border-color:var(--screen-border);
  border-radius:14px;
  box-shadow:var(--screen-shadow);
}
.card:hover { border-color:#d3ddea; }
.kpi { padding:19px 20px; min-height:112px; }
.kpi::before { width:4px; background:linear-gradient(180deg,#bed0e8,#dce7f4); }
.kpi strong { margin:3px 0 2px; font-size:28px; letter-spacing:-.025em; font-variant-numeric:tabular-nums; }
.kpi span:first-child { color:#607089; font-weight:500; }
.section-head { margin:28px 0 13px; }

/* Inputs and form rhythm */
.field { gap:7px; }
label { color:#40516a; font-size:13px; font-weight:600; }
input,select,textarea {
  min-height:42px;
  border-color:#cbd6e5;
  border-radius:9px;
  background:#fff;
  color:#22324a;
  transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;
}
input:hover,select:hover,textarea:hover { border-color:#b3c2d5; }
input:focus,select:focus,textarea:focus {
  outline:none;
  border-color:#678dcc;
  box-shadow:0 0 0 3px rgba(52,88,184,.12);
}
input::placeholder,textarea::placeholder { color:#9aa5b3; }
.field-hint { line-height:1.4; }

/* Filter workspace: filters only; screen actions live in the heading */
.list-tools {
  margin:0 0 18px;
  padding:17px 18px 13px;
  border-color:#d7e1ed;
  background:linear-gradient(180deg,#fff 0%,#fbfcff 100%);
}
.list-tools__filters { gap:13px; }
.product-list-tools .list-tools__filters { grid-template-columns:minmax(250px,1.6fr) repeat(5,minmax(130px,1fr)); }
.list-tools__footer {
  justify-content:flex-start;
  min-height:34px;
  margin-top:13px;
  padding-top:11px;
}
.list-tools__meta { gap:11px; }
.list-tools__count { background:#edf4ff; border:1px solid #d9e7f8; color:#244f86; }

/* Tables */
.table-wrap,.data-table-wrap {
  border-color:#dce5ef;
  border-radius:12px;
  box-shadow:0 1px 2px rgba(25,38,53,.025);
}
table { font-variant-numeric:tabular-nums; }
th,td { padding:11px 13px; }
th {
  background:#f5f8fc;
  color:#43546c;
  font-size:12px;
  font-weight:700;
  letter-spacing:.035em;
}
td { color:#25354b; }
.data-table tbody tr { transition:background .12s ease; }
.data-table tbody tr:nth-child(even) { background:#fbfcfe; }
.data-table tbody tr:hover { background:#f1f6fc; }
.data-table tbody tr:last-child td { border-bottom:0; }
.code { color:#375171; }
.row-actions { gap:10px; }
.link-btn { color:#285b94; }
.link-btn:hover { color:#173f70; }

/* Status and feedback */
.badge {
  min-height:25px;
  padding:3px 9px;
  border:1px solid transparent;
  font-weight:600;
}
.badge.ok { border-color:#c7eadb; background:#eaf8f2; color:#14785a; }
.badge.future { border-color:#f3deb1; background:#fff7e5; color:#8f5a08; }
.notice { border-radius:11px; }
.empty-state {
  min-height:150px;
  display:grid;
  place-items:center;
  align-content:center;
  border-color:#cdd8e6;
  border-radius:13px;
  background:linear-gradient(180deg,#fff,#fbfcff);
}

/* Module navigation */
.module-tabs {
  min-height:56px;
  align-items:stretch;
  gap:2px;
  margin-bottom:24px;
  padding:0 12px;
  border-color:#dce4ee;
  border-radius:14px;
  background:#fff;
  box-shadow:var(--screen-shadow);
}
.module-tab {
  min-height:54px;
  padding:12px 15px 11px;
  border-bottom-width:3px;
  color:#52637a;
}
.module-tab:hover { background:#f8fafd; color:#1e406d; }
.module-tab.active { color:#183d70; border-bottom-color:#2d5d99; }
.ar-section-heading {
  align-items:center;
  min-height:60px;
  padding:2px 2px 4px;
}
.ar-section-heading h2 { font-size:24px; }
.ar-section-heading p { max-width:760px; line-height:1.45; }
.ar-section-heading > .screen-actions { margin-left:auto; }
.ar-quick-card { border-radius:13px; }
.ar-quick-card:hover { transform:translateY(-1px); box-shadow:var(--screen-shadow-hover); }

/* Drawer polish */
.side-nav-backdrop { background:rgba(18,29,45,.34); backdrop-filter:blur(1px); }
.side-nav-drawer { width:min(350px,92vw); border-right-color:#d8e0eb; box-shadow:20px 0 48px rgba(17,31,49,.16); }
.side-nav-head { min-height:82px; padding:17px 15px 15px 20px; }
.side-nav-head strong { color:#17263d; font-size:20px; }
.side-nav-search-wrap { padding:15px 14px 9px; }
.side-nav-section-toggle { color:#6f7d91; }
.side-nav-item { min-height:44px; border-radius:9px; }
.side-nav-item.active { background:linear-gradient(90deg,#eaf1fb 0%,#f2f6fc 100%); border-left-color:#2f5f9b; color:#183f73; }
.side-nav-workspace { background:#fafcff; }

/* Dialog and modal finishing */
.editor-panel.transaction-modal,.ofi-dialog { border-color:#d6e0ec; box-shadow:0 28px 76px rgba(15,28,45,.22); }
.transaction-modal__header { background:linear-gradient(180deg,#fff,#fcfdff); }
.transaction-modal__copy h2 { letter-spacing:-.015em; }
.ofi-toast { border-color:#d4deeb; }

/* Responsive visual foundation */
@media (max-width:900px) {
  .content { padding:24px 20px 36px; }
  .page-title { align-items:flex-start; flex-direction:column; }
  .page-title > .screen-actions,.page-title > .page-actions { width:100%; justify-content:flex-start; }
  .screen-actions { justify-content:flex-start; }
}
@media (max-width:760px) {
  .content { padding:20px 14px 30px; }
  .topbar { height:60px; padding:0 12px; }
  .page-title h1 { font-size:27px; }
  .screen-actions { width:100%; }
  .screen-actions .btn { flex:1 1 auto; }
  .ar-section-heading > .screen-actions { margin-left:0; }
  .module-tabs { min-height:52px; margin-bottom:18px; }
  .module-tab { min-height:50px; }
}
@media (max-width:520px) {
  .screen-actions .btn { width:100%; flex-basis:100%; }
  .kpi { min-height:102px; padding:16px; }
  .list-tools { padding:14px; }
}

/* F8 RC6-F4 HF6 — Operation workspace refinement */
.operation-home { display:grid; gap:0; }
.operation-kpis { margin-bottom:20px; }
.operation-hub { padding:20px; }
.operation-section-heading,.inventory-section-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}
.operation-section-heading h2,.operation-section-heading h3,.inventory-section-heading h2 { margin:0 0 4px; }
.operation-section-heading p,.inventory-section-heading p { margin:0; }
.operation-shortcuts {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-top:16px;
}
.operation-shortcut {
  position:relative;
  min-height:154px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  padding:17px;
  border:1px solid #dbe4ef;
  border-radius:13px;
  background:linear-gradient(180deg,#fff 0%,#fafcff 100%);
  color:#213047;
  text-align:left;
  cursor:pointer;
  transition:transform .14s ease,border-color .14s ease,box-shadow .14s ease,background .14s ease;
}
.operation-shortcut::before {
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  border-radius:13px 0 0 13px;
  background:#b8c8df;
}
.operation-shortcut--purchase::before { background:#6d83ad; }
.operation-shortcut--sale::before { background:#4f78b8; }
.operation-shortcut--inventory::before { background:#5c8d7c; }
.operation-shortcut--ar::before { background:#7b6ca8; }
.operation-shortcut:hover { transform:translateY(-2px); border-color:#c5d3e3; box-shadow:var(--screen-shadow-hover); background:#fff; }
.operation-shortcut:focus-visible { outline:2px solid rgba(52,88,184,.30); outline-offset:2px; }
.operation-shortcut__eyebrow { color:#7b8798; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.operation-shortcut strong { font-size:18px; color:#1d3150; }
.operation-shortcut__description { min-height:40px; color:#627188; line-height:1.4; }
.operation-shortcut__meta { margin-top:auto; color:#244f86; font-weight:600; }
.operation-overview { align-items:stretch; }
.operation-summary-card { padding:20px; }
.operation-stat-list { display:grid; gap:0; margin-top:14px; border-top:1px solid #e8edf4; }
.operation-stat-list > div { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:12px 0; border-bottom:1px solid #edf1f6; }
.operation-stat-list > div:last-child { border-bottom:0; padding-bottom:0; }
.operation-stat-list span { color:#66758a; }
.operation-stat-list strong { color:#203550; font-variant-numeric:tabular-nums; }
.catalog-stat-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; }
.catalog-stat { min-height:92px; padding:14px; border:1px solid #e1e8f1; border-radius:11px; background:#fbfcff; display:flex; flex-direction:column; gap:3px; }
.catalog-stat span { color:#66758a; font-size:12px; }
.catalog-stat strong { color:#203550; font-size:24px; }
.catalog-stat small { color:#8b97a8; }
.operation-list-stack,.list-workspace { gap:18px; }
.editor-section { padding:18px; border:1px solid #e0e7f0; border-radius:12px; background:#fbfcff; }
.editor-section + .editor-section { margin-top:14px; }
.editor-section__heading { margin-bottom:14px; }
.editor-section__heading h3 { margin:0 0 3px; }
.editor-section__heading p { margin:0; }
.inventory-section-heading { min-height:54px; align-items:center; }
.inventory-section-heading > div:first-child { min-width:0; }
.inventory-section-heading > .screen-actions { margin-left:auto; }
.inventory-tools { margin-bottom:0; }
.inventory-filters { grid-template-columns:minmax(280px,1.7fr) minmax(210px,.8fr); }
.inventory-kardex-filters { grid-template-columns:minmax(260px,1.4fr) minmax(260px,1.2fr) minmax(150px,.7fr) minmax(150px,.7fr); }
.inventory-adjustment-filters { grid-template-columns:minmax(240px,1.4fr) minmax(170px,.8fr) minmax(170px,.8fr) minmax(150px,.7fr) minmax(150px,.7fr); }

@media (max-width:1180px) {
  .operation-shortcuts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .inventory-kardex-filters,.inventory-adjustment-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .operation-shortcuts,.catalog-stat-grid { grid-template-columns:1fr; }
  .operation-shortcut { min-height:132px; }
  .operation-section-heading,.inventory-section-heading { flex-direction:column; align-items:stretch; }
  .inventory-section-heading > .screen-actions { margin-left:0; width:100%; }
  .inventory-filters,.inventory-kardex-filters,.inventory-adjustment-filters { grid-template-columns:1fr; }
}

/* F8 RC6-F4 HF7 — Finance workspaces */
.finance-view,.report-view { gap:18px; }
.finance-section-heading {
  min-height:60px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:2px 2px 4px;
}
.finance-section-heading h2 { margin:0 0 4px; font-size:24px; }
.finance-section-heading p { max-width:780px; margin:0; line-height:1.45; }
.finance-section-heading > .screen-actions { margin-left:auto; }
.finance-kpis .kpi { overflow:hidden; }
.kpi--primary::before { background:linear-gradient(180deg,#6f9bd1,#b9cde6); }
.kpi--positive::before { background:linear-gradient(180deg,#58ad8d,#b8decf); }
.kpi--attention::before { background:linear-gradient(180deg,#e0a245,#f3d5a1); }
.kpi--warning::before { background:linear-gradient(180deg,#d9853d,#f0c89f); }
.kpi--danger::before { background:linear-gradient(180deg,#c65f55,#e6b2ac); }
.kpi--muted::before { background:linear-gradient(180deg,#8795a8,#cfd6df); }
.kpi--attention strong,.kpi--warning strong { color:#8b5409; }
.kpi--danger strong { color:#9a4038; }
.kpi--positive strong { color:#166d55; }
.finance-explainer {
  display:grid;
  grid-template-columns:minmax(180px,.42fr) minmax(0,1.58fr);
  align-items:start;
  gap:18px;
  padding:17px 19px;
  background:linear-gradient(135deg,#f8fbff 0%,#fff 64%);
  border-color:#d8e4f1;
}
.finance-explainer strong { color:#28466f; }
.finance-explainer p { margin:0; line-height:1.55; }
.commission-effect { min-width:82px; justify-content:center; }
.commission-effect--potential { background:#edf4ff; border-color:#d6e5f8; color:#285483; }
.commission-effect--earned { background:#eaf8f2; border-color:#c8eadc; color:#176f57; }
.financial-negative { color:#a8443c; font-weight:600; }
.report-tabs { overflow-x:auto; scrollbar-width:thin; }
.report-filter-card { margin-bottom:18px; }
.report-filter-grid { grid-template-columns:minmax(240px,1.45fr) repeat(4,minmax(150px,.8fr)); }
.report-result-card { min-height:260px; }
.report-result-heading { align-items:flex-start; }
.report-period-badge {
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 10px;
  border:1px solid #dbe4ef;
  border-radius:999px;
  background:#f7f9fc;
  color:#5b6d84;
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}
.report-result-card td.numeric-right,.report-result-card th.numeric-right { font-variant-numeric:tabular-nums; }
.ar-insight-card { background:linear-gradient(180deg,#fff 0%,#fcfdff 100%); }

@media (max-width:1100px) {
  .report-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .finance-section-heading { flex-direction:column; }
  .finance-section-heading > .screen-actions { width:100%; margin-left:0; justify-content:flex-start; }
  .finance-explainer { grid-template-columns:1fr; gap:7px; }
  .report-filter-grid { grid-template-columns:1fr; }
  .report-result-heading { flex-direction:column; align-items:flex-start; }
}

/* F8 RC6-F4 HF8 — Catalog & system workspaces + final polish */
.catalog-workspace,.system-workspace,.setup-workspace { gap:18px; }
.catalog-section-heading,.system-feature-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}
.catalog-section-heading h2,.catalog-section-heading h3,.system-feature-heading h3 { margin:0 0 4px; }
.catalog-section-heading p,.system-feature-heading p { margin:0; max-width:820px; }
.catalog-section-heading > .screen-actions { margin-left:auto; }
.catalog-workspace .list-card { overflow:hidden; }
.catalog-workspace .list-card__heading { padding-bottom:2px; }

.system-tabs,.setup-tabs { overflow-x:auto; scrollbar-width:thin; }
.system-message:empty { display:none; }
.system-message { margin-bottom:18px; }
.system-kpis .kpi { min-height:104px; }
.system-feature-card {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:start;
  gap:17px;
  padding:21px;
  background:linear-gradient(135deg,#f8fbff 0%,#fff 64%);
  border-color:#d7e3f1;
}
.system-feature-icon {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  flex:0 0 42px;
  border-radius:12px;
  background:#eaf5ef;
  color:#187056;
  font-size:20px;
  font-weight:700;
}
.system-detail-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:16px;
}
.system-detail-grid > div {
  min-height:76px;
  padding:12px 13px;
  border:1px solid #e0e8f1;
  border-radius:10px;
  background:#fff;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.system-detail-grid span { color:#77869a; font-size:12px; }
.system-detail-grid strong { color:#263b58; overflow-wrap:anywhere; }
.system-guidance { padding:20px; }
.system-step-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.system-step {
  min-height:126px;
  padding:15px;
  border:1px solid #e1e8f1;
  border-radius:12px;
  background:#fbfcff;
}
.system-step > span {
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  margin-bottom:9px;
  border-radius:999px;
  background:#eaf1fb;
  color:#244f86;
  font-weight:700;
}
.system-step strong { display:block; margin-bottom:3px; color:#243955; }
.system-step p { margin:0; line-height:1.45; }
.restore-workspace { padding:22px; }
.restore-dropzone {
  display:grid;
  gap:7px;
  padding:22px;
  border:1px dashed #b7c7da;
  border-radius:12px;
  background:#f9fbfe;
}
.restore-dropzone p { margin:0 0 7px; }
.restore-actions { justify-content:flex-start; }
.system-risk-note {
  padding:17px 19px;
  border-color:#ead9b5;
  background:linear-gradient(180deg,#fffdf8,#fffaf0);
}
.system-risk-note strong { color:#72521b; }
.system-risk-note p { margin:4px 0 0; line-height:1.5; }

.setup-context {
  padding:17px 19px;
  background:linear-gradient(135deg,#f7faff 0%,#fff 70%);
}
.setup-context h2 { margin:3px 0 4px; font-size:22px; }
.setup-context p { margin:0; }
.setup-context__eyebrow {
  color:#52739f;
  font-size:11px;
  font-weight:700;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.setup-kpis .kpi { min-height:96px; }
.setup-workspace > section:not(.setup-context) { min-width:0; }

.migration-step-card { padding:22px; }
.migration-upload {
  padding:18px;
  border:1px dashed #bccbdd;
  border-radius:12px;
  background:#fafcff;
}
.migration-preview {
  margin-top:15px;
  padding:17px;
  border:1px solid #d7e5ef;
  border-radius:12px;
  background:#fff;
}
.migration-preview__heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:13px;
}
.migration-preview__heading p { margin:3px 0 0; }
.migration-summary-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; }
.migration-summary-item {
  min-height:82px;
  padding:11px;
  border:1px solid #e2e9f2;
  border-radius:10px;
  background:#fbfcff;
  display:flex;
  flex-direction:column;
}
.migration-summary-item span { color:#66758a; font-size:12px; }
.migration-summary-item strong { margin:3px 0; color:#213a5d; font-size:22px; }
.migration-summary-item small { color:#96a1b0; }
.migration-safety {
  display:grid;
  grid-template-columns:auto 1fr;
  gap:15px;
  align-items:start;
  padding:18px;
}
.migration-safety h3 { margin:0 0 4px; }
.migration-safety p { margin:0; line-height:1.5; }
.migration-run-actions { justify-content:flex-end; }

.role-workspace { padding:20px; }
.role-workspace > .field { max-width:520px; }
.role-grid { gap:10px; }
.role-check {
  min-height:68px;
  border:1px solid #e0e7f0;
  border-radius:11px;
  background:#fbfcff;
  transition:border-color .14s ease,background .14s ease,box-shadow .14s ease;
}
.role-check:hover { border-color:#c6d5e7; background:#fff; box-shadow:0 3px 10px rgba(25,38,53,.05); }
.permission-groups { gap:14px; }
.permission-group {
  border-color:#dfe7f1;
  border-radius:12px;
  background:#fbfcff;
  box-shadow:none;
}
.permission-group h4 { color:#2d4565; }
.permission-check { border-bottom-color:#e9eef5; }

/* Final global consistency pass */
.list-card__heading h3 { margin:0 0 4px; }
.list-card__heading p { margin:0; }
.footer-note { line-height:1.5; }
.data-table td strong { color:#21364f; }
.data-table td small.block { margin-top:2px; }
.page-title + .module-tabs { margin-top:-2px; }

@media (max-width:1180px) {
  .system-detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .migration-summary-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:860px) {
  .system-step-grid { grid-template-columns:1fr; }
  .migration-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .catalog-section-heading,.system-feature-heading,.migration-preview__heading { flex-direction:column; align-items:stretch; }
  .catalog-section-heading > .screen-actions { width:100%; margin-left:0; justify-content:flex-start; }
  .system-feature-card,.migration-safety { grid-template-columns:1fr; }
  .system-detail-grid,.migration-summary-grid { grid-template-columns:1fr; }
  .restore-actions,.migration-run-actions { justify-content:flex-start; }
}

/* F8 RC6-F4 HF8.3 — enriched sales product search */
.product-sales-meta { display:flex; align-items:center; justify-content:flex-end; gap:6px; flex-wrap:wrap; }
.product-sales-chip { display:inline-flex; align-items:center; min-height:24px; padding:3px 8px; border:1px solid #d8e2ee; border-radius:999px; background:#f8fafc; color:#4b5f78; font-size:11px; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; }
.product-sales-chip--stock { border-color:#cfe5d9; background:#f0faf5; color:#1d6a4f; }
.product-sales-chip--danger { border-color:#f1c8c4; background:#fff3f2; color:#a1372e; }
.product-sales-chip--price { border-color:#cbdcf1; background:#f2f7fd; color:#244f82; }
.product-sales-chip--warning { border-color:#ead6a8; background:#fff9ea; color:#8b620f; }
.product-picker__result--sales { align-items:flex-start; min-height:68px; }
.product-picker__result--sales .product-picker__result-main small { margin-top:3px; color:#78869a; font-size:11px; }
.product-picker__result-meta--sales { min-width:220px; }
.product-combobox__option--sales { grid-template-columns:auto 1fr; padding-top:9px; padding-bottom:9px; }
.product-combobox__option--sales .product-sales-meta { grid-column:1/-1; justify-content:flex-start; margin-top:3px; }
.product-sales-meta--compact .product-sales-chip { min-height:21px; padding:2px 6px; font-size:10px; }
@media (max-width:620px) {
  .product-picker__result--sales { flex-direction:column; gap:7px; }
  .product-picker__result-meta--sales { min-width:0; width:100%; }
  .product-picker__result-meta--sales .product-sales-meta { justify-content:flex-start; }
}

/* RC6-F4 HF8.4 — smart price-list switching */
.ofi-choice-dialog { width:min(620px,100%); }
.ofi-choice-dialog__options { display:grid; gap:10px; margin-top:18px; }
.ofi-choice-dialog__option {
  width:100%;
  display:grid;
  gap:4px;
  text-align:left;
  padding:13px 14px;
  border:1px solid #d5dfeb;
  border-radius:11px;
  background:#fff;
  color:#293b54;
  cursor:pointer;
  transition:border-color .15s ease,background .15s ease,box-shadow .15s ease;
}
.ofi-choice-dialog__option:hover,.ofi-choice-dialog__option:focus-visible { border-color:#7f9eca; background:#f8fbff; box-shadow:0 0 0 3px rgba(52,88,184,.10); outline:none; }
.ofi-choice-dialog__option.is-primary { border-color:#a8bad5; background:#f8faff; }
.ofi-choice-dialog__option strong { color:#1c3150; font-size:14px; }
.ofi-choice-dialog__option span { color:#66758b; font-size:12px; line-height:1.45; }
.ofi-choice-dialog__check {
  display:grid;
  grid-template-columns:auto 1fr;
  gap:10px;
  align-items:start;
  padding:12px 13px;
  border:1px solid #e0e7f0;
  border-radius:10px;
  background:#fbfcfe;
}
.ofi-choice-dialog__check input { min-height:auto; margin-top:2px; }
.ofi-choice-dialog__check strong { display:block; color:#34445d; font-size:13px; }
.ofi-choice-dialog__check small { display:block; margin-top:2px; color:#7a8799; font-size:12px; font-weight:400; }
.transaction-price-list-context {
  display:inline-flex;
  align-items:center;
  width:max-content;
  margin-top:7px;
  padding:4px 8px;
  border:1px solid #d8e3f1;
  border-radius:999px;
  background:#f4f8fd;
  color:#345277;
  font-size:11px;
  font-weight:600;
}
.transaction-grid__number--manual-price {
  border-color:#d2a84e !important;
  background:#fffaf0 !important;
  box-shadow:inset 3px 0 0 #d2a84e;
}
@media (max-width: 640px) {
  .ofi-choice-dialog { padding:16px; }
  .ofi-choice-dialog__option { padding:12px; }
}

/* RC6-F4 HF8.6 — complete price-list workspace */
.product-workspace-tabs { margin-bottom:16px; }
.price-list-workspace { gap:18px; }
.price-list-manager { gap:14px; }
.price-matrix-card { overflow:hidden; }
.price-matrix-table { overflow-x:auto; }
.price-matrix-table table { min-width:max(980px, 100%); }
.price-matrix-heading { min-width:150px; }
.price-matrix-cell { min-width:150px; padding:7px 10px !important; }
.price-matrix-input {
  width:100%;
  min-width:120px;
  min-height:36px;
  padding:7px 9px;
  border:1px solid #d7e0ec;
  border-radius:8px;
  background:#fff;
  color:#21364f;
  text-align:right;
  font:inherit;
  font-variant-numeric:tabular-nums;
}
.price-matrix-input:focus { outline:none; border-color:#7d9cc5; box-shadow:0 0 0 3px rgba(54,91,145,.10); }
.price-matrix-input.is-dirty { border-color:#c89a39; background:#fffaf0; box-shadow:inset 3px 0 0 #d2a84e; }
.price-matrix-cell .muted { display:block; text-align:right; }
@media (max-width:760px) {
  .price-matrix-heading,.price-matrix-cell { min-width:132px; }
  .price-matrix-input { min-width:104px; }
}


/* F8 RC6-F4 HF8.7 — compact purchase workspace + purchase stock context */
.purchase-metrics-strip {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:0;
  min-height:42px;
  padding:8px 14px;
  border:1px solid #dbe5f1;
  border-radius:12px;
  background:#fff;
  box-shadow:0 5px 16px rgba(31,62,99,.045);
}
.purchase-metrics-strip__item {
  display:inline-flex;
  align-items:baseline;
  gap:6px;
  padding:2px 14px;
  color:#637188;
  font-size:13px;
  line-height:1.35;
  white-space:nowrap;
  border-right:1px solid #e4ebf4;
}
.purchase-metrics-strip__item:first-child { padding-left:0; }
.purchase-metrics-strip__item:last-child { border-right:0; padding-right:0; }
.purchase-metrics-strip__item strong {
  color:var(--navy);
  font-size:14px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
@media (max-width:760px) {
  .purchase-metrics-strip { gap:6px 0; }
  .purchase-metrics-strip__item { width:50%; border-right:0; padding:3px 8px 3px 0; }
}

/* F8 RC6 F4 HF8.10 — purchase commercial lines + purchase reports */
.transaction-grid--purchase .transaction-grid__header,
.transaction-grid--purchase .transaction-grid__row {
  grid-template-columns:56px minmax(300px,1fr) 96px 132px 112px 96px 126px 112px;
}
.transaction-grid--purchase .transaction-grid__header > div:nth-child(3),
.transaction-grid--purchase .transaction-grid__row > :nth-child(3) { justify-content:center; text-align:center; }
.transaction-grid--purchase .transaction-grid__header > div:nth-child(4),
.transaction-grid--purchase .transaction-grid__header > div:nth-child(5),
.transaction-grid--purchase .transaction-grid__header > div:nth-child(6),
.transaction-grid--purchase .transaction-grid__header > div:nth-child(7),
.transaction-grid--purchase .transaction-grid__row > :nth-child(4),
.transaction-grid--purchase .transaction-grid__row > :nth-child(5),
.transaction-grid--purchase .transaction-grid__row > :nth-child(6),
.transaction-grid--purchase .transaction-grid__row > :nth-child(7) { justify-content:flex-end; text-align:right; }
.transaction-grid--purchase .transaction-grid__header > div:nth-child(8),
.transaction-grid--purchase .transaction-grid__row > :nth-child(8) { justify-content:center; text-align:center; }
.transaction-grid--purchase .transaction-grid__row > input:nth-child(3) { text-align:center; }
.transaction-grid--purchase .transaction-grid__row > input:nth-child(4),
.transaction-grid--purchase .transaction-grid__row > input:nth-child(5),
.transaction-grid--purchase .transaction-grid__row > input:nth-child(6) { text-align:right; font-variant-numeric:tabular-nums; }
.document-detail__totals { align-self:flex-end; min-width:min(390px,100%); display:grid; gap:7px; padding:12px 14px; border:1px solid #d7e1ee; border-radius:10px; background:#f8fbff; }
.document-detail__totals > div { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.document-detail__totals > div:last-child { margin-top:3px; padding-top:8px; border-top:1px solid #d7e1ee; color:#1d4f82; font-size:16px; }
.setup-purchase-settings__intro { margin-bottom:4px; }
.setup-purchase-settings__intro h3 { margin:0 0 4px; }
@media (max-width:980px){
  .transaction-grid--purchase .transaction-grid__header,
  .transaction-grid--purchase .transaction-grid__row { min-width:1120px; }
}

/* F8 RC6-F4 HF8.11 — cost evolution + historical Kardex */
.inventory-opening-strip {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0;
  border:1px solid #dbe5f1;
  border-radius:12px;
  background:#fff;
  box-shadow:0 5px 16px rgba(31,62,99,.045);
  overflow:hidden;
}
.inventory-opening-strip > div {
  display:grid;
  gap:3px;
  padding:10px 14px;
  border-right:1px solid #e4ebf4;
}
.inventory-opening-strip > div:last-child { border-right:0; }
.inventory-opening-strip span { color:#6b788c; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.025em; }
.inventory-opening-strip strong { color:var(--navy); font-size:14px; font-variant-numeric:tabular-nums; }
.cost-evolution-filters { grid-template-columns:minmax(210px,1.2fr) minmax(220px,1.4fr) minmax(220px,1.2fr) minmax(138px,.7fr) minmax(138px,.7fr); }
.cost-evolution-change td { background:#fffaf0; }
.cost-evolution-change:hover td { background:#fff6df; }
.cost-up { color:#9a5a00 !important; font-weight:700; }
.cost-down { color:#176c4e !important; font-weight:700; }
.cost-evolution-summary .kpi { min-height:112px; }
@media (max-width:980px) {
  .inventory-opening-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .inventory-opening-strip > div:nth-child(2) { border-right:0; }
  .inventory-opening-strip > div:nth-child(-n+2) { border-bottom:1px solid #e4ebf4; }
  .cost-evolution-filters { grid-template-columns:1fr 1fr; }
}
@media (max-width:640px) {
  .inventory-opening-strip { grid-template-columns:1fr; }
  .inventory-opening-strip > div { border-right:0; border-bottom:1px solid #e4ebf4; }
  .inventory-opening-strip > div:last-child { border-bottom:0; }
  .cost-evolution-filters { grid-template-columns:1fr; }
}


/* F8 RC6-F4 HF8.12 — inventory summary / replenishment decision support */
.inventory-filters { grid-template-columns:minmax(240px,1.5fr) repeat(4,minmax(145px,.8fr)); }
.stock-status { display:inline-flex; align-items:center; min-height:26px; padding:3px 9px; border-radius:999px; border:1px solid transparent; font-size:12px; font-weight:700; white-space:nowrap; }
.stock-status--ok { background:#ecfdf3; border-color:#c7ead5; color:#176b3a; }
.stock-status--warning { background:#fff8df; border-color:#f4df91; color:#8a6200; }
.stock-status--critical { background:#fff0f0; border-color:#f3c2c2; color:#a32727; }
.stock-status--neutral { background:#f3f5f8; border-color:#dfe4eb; color:#667085; }
.inventory-stock-row--warning td { background:#fffdf4; }
.inventory-stock-row--critical td { background:#fff7f7; }
.inventory-stock-row--warning:hover td { background:#fff9df; }
.inventory-stock-row--critical:hover td { background:#fff0f0; }
.inventory-summary-kpis .kpi-card:nth-child(2) strong { font-variant-numeric:tabular-nums; }
@media (max-width:1200px){ .inventory-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } .inventory-filters .field:first-child { grid-column:span 2; } }
@media (max-width:760px){ .inventory-filters { grid-template-columns:1fr; } .inventory-filters .field:first-child { grid-column:auto; } }

/* HF8.13 · Product image workspace and transaction reference preview */
.product-image-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; width:100%; height:100%; min-height:84px; border:1px dashed #cbd5e1; border-radius:10px; background:#f8fafc; color:#7c8798; }
.product-image-placeholder--compact { width:42px; min-width:42px; height:42px; min-height:42px; border-radius:8px; }
.product-image-placeholder__icon { font-size:20px; line-height:1; color:#8ea0b7; }
.product-image-placeholder small { font-size:11px; }
.product-image-thumb { display:inline-flex; align-items:center; justify-content:center; width:56px; height:56px; padding:0; overflow:hidden; border:1px solid #d9e2ee; border-radius:9px; background:#fff; cursor:pointer; }
.product-image-thumb--compact { width:42px; min-width:42px; height:42px; }
.product-image-thumb img { width:100%; height:100%; object-fit:contain; display:block; }
.product-image-thumb:hover { border-color:#8fb3df; box-shadow:0 0 0 2px rgba(32,95,174,.08); }
.product-image-table-cell { width:74px; }
.product-image-zoom { display:flex; flex-direction:column; gap:14px; }
.product-image-zoom > img { display:block; max-width:100%; max-height:62vh; margin:auto; object-fit:contain; border:1px solid #dbe3ee; border-radius:12px; background:#fff; }
.product-image-zoom__meta { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.product-images-workspace .data-table td { vertical-align:middle; }

.product-picker__thumb { flex:0 0 42px; width:42px; height:42px; }
.product-picker__result { justify-content:flex-start; }
.product-picker__result-main { flex:1 1 auto; }
.product-picker__result-meta { margin-left:auto; }
.product-combobox__option { grid-template-columns:42px auto 1fr; align-items:center; }
.product-combobox__option > .product-image-thumb,
.product-combobox__option > .product-image-placeholder { grid-row:1 / span 2; grid-column:1; }
.product-combobox__option > strong { grid-column:2; }
.product-combobox__option > span:not(.product-image-placeholder):not(.product-image-thumb):not(.product-sales-meta) { grid-column:3; }
.product-combobox__option > small,
.product-combobox__option > .product-sales-meta { grid-column:2 / -1; }

.transaction-products-layout { display:grid; grid-template-columns:minmax(0,1fr) 190px; gap:14px; align-items:start; }
.transaction-products-layout__grid { min-width:0; }
.transaction-product-image { position:sticky; top:12px; display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid #dbe3ee; border-radius:12px; background:#fbfcfe; min-width:0; }
.transaction-product-image__heading { display:flex; flex-direction:column; min-width:0; }
.transaction-product-image__heading strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; color:#172033; }
.transaction-product-image__canvas { height:150px; display:flex; align-items:center; justify-content:center; overflow:hidden; border:1px solid #e2e8f0; border-radius:10px; background:#fff; }
.transaction-product-image__canvas img { width:100%; height:100%; object-fit:contain; cursor:zoom-in; }
.transaction-product-image .product-image-placeholder { border:0; min-height:100%; border-radius:0; }
.product-image-loading { font-size:11px; color:#7b8798; }
.transaction-product-image > small { line-height:1.25; }

@media (max-width: 1050px) {
  .transaction-products-layout { grid-template-columns:1fr; }
  .transaction-product-image { position:static; display:grid; grid-template-columns:92px 1fr; grid-template-rows:auto auto; align-items:center; }
  .transaction-product-image__canvas { grid-row:1 / span 2; height:82px; }
  .transaction-product-image > small { align-self:start; }
}
@media (max-width: 620px) {
  .product-picker__result-meta { margin-left:0; }
  .product-picker__result { align-items:flex-start; flex-wrap:wrap; }
  .product-picker__result-main { min-width:calc(100% - 58px); }
  .product-picker__result-meta--sales { padding-left:58px; }
  .transaction-product-image { grid-template-columns:74px 1fr; }
  .transaction-product-image__canvas { height:68px; }
}

/* F8 RC6-F4 HF8.14 — Initial inventory import + dynamic sales analytics */
.badge.info { border-color:#c9daeb; background:#edf5ff; color:#285483; }
.badge.warn { border-color:#f3deb1; background:#fff7e5; color:#8f5a08; }
.badge.error { border-color:#edc7c4; background:#fff0ef; color:#a33f37; }
.opening-import-controls { grid-template-columns:minmax(260px,1.3fr) minmax(220px,.7fr); }
.opening-preview-card { overflow:hidden; }
.opening-row-warning td { background:#fffaf0 !important; }
.opening-row-error td { background:#fff3f2 !important; }
.report-chart-card { margin:0 0 18px; padding:18px 20px; border:1px solid #dce5ef; border-radius:13px; background:linear-gradient(180deg,#fff,#fbfdff); overflow:hidden; }
.report-chart-line { fill:none; stroke:#285b94; stroke-width:2.25; vector-effect:non-scaling-stroke; }
.report-chart-point { fill:#fff; stroke:#285b94; stroke-width:2; vector-effect:non-scaling-stroke; }
.report-line-svg { display:block; width:100%; min-width:560px; height:auto; }
.report-chart-zero { stroke:#cfd8e4; stroke-width:1; stroke-dasharray:4 4; vector-effect:non-scaling-stroke; }
.report-bar-chart { display:grid; gap:11px; }
.report-bar-row { display:grid; grid-template-columns:minmax(150px,.5fr) minmax(220px,1.5fr) auto; align-items:center; gap:12px; }
.report-bar-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#344a66; font-size:13px; font-weight:600; }
.report-bar-track { position:relative; height:13px; overflow:hidden; border-radius:999px; background:#edf2f7; }
.report-bar-fill { position:absolute; inset:0 auto 0 0; min-width:2px; border-radius:inherit; background:linear-gradient(90deg,#6f9bd1,#2f5f9b); }
.report-bar-value { color:#52637a; font-variant-numeric:tabular-nums; font-size:12px; font-weight:600; white-space:nowrap; }
@media (max-width:760px) {
  .opening-import-controls { grid-template-columns:1fr; }
  .report-bar-row { grid-template-columns:1fr; gap:6px; }
  .report-bar-value { justify-self:start; }
  .report-tabs { padding-bottom:3px; }
}


/* F8 RC6-F4 HF8.14.1 — Report Center responsive navigation / overflow hotfix */
.report-center {
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:hidden;
}
.report-center > * {
  max-width:100%;
  min-width:0;
}
.report-navigation {
  display:grid;
  gap:8px;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0 0 18px;
}
.report-groups {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  padding:8px;
  border:1px solid #dce5ef;
  border-radius:13px;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.025);
}
.report-group-button {
  min-width:0;
  min-height:40px;
  padding:8px 12px;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:#52637a;
  font:inherit;
  font-weight:700;
  text-align:center;
}
.report-group-button:hover {
  background:#f5f8fc;
  color:#183153;
}
.report-group-button.active {
  border-color:#c9daed;
  background:#edf4fc;
  color:#183153;
  box-shadow:0 1px 2px rgba(24,49,83,.05);
}
.report-tabs {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:4px 6px;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  padding:0 4px 6px;
  overflow-x:visible;
  scrollbar-width:auto;
}
.report-tabs .module-tab {
  min-height:38px;
  padding:7px 11px 8px;
}
.report-filter-card,
.report-view,
.report-result-card {
  width:100%;
  max-width:100%;
  min-width:0;
}
.report-filter-grid {
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.report-filter-grid .field {
  min-width:0;
}
.report-filter-grid .field:first-child {
  grid-column:span 2;
}
.report-filter-grid input,
.report-filter-grid select {
  width:100%;
  min-width:0;
  max-width:100%;
}
.report-chart-card {
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
}
@media (max-width:1180px) {
  .report-filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .report-filter-grid .field:first-child { grid-column:span 2; }
}
@media (max-width:900px) {
  .report-groups { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-filter-grid .field:first-child { grid-column:1 / -1; }
}
@media (max-width:620px) {
  .report-groups { grid-template-columns:1fr 1fr; gap:6px; padding:6px; }
  .report-group-button { min-height:38px; padding:7px 8px; }
  .report-tabs { padding-left:0; padding-right:0; }
  .report-tabs .module-tab { flex:1 1 auto; text-align:center; white-space:normal; }
  .report-filter-grid { grid-template-columns:1fr; }
  .report-filter-grid .field:first-child { grid-column:auto; }
}

/* F8 RC6-F4 HF8.14.3 — cost evolution continuity explanation */
.cost-evolution-initial td { background:#f4f8ff; }
.cost-evolution-initial:hover td { background:#edf4ff; }
.cost-initial-label { display:inline-flex; align-items:center; min-height:24px; padding:2px 8px; border:1px solid #bdd1ed; border-radius:999px; background:#edf4ff; color:#244f85; font-size:12px; font-weight:700; }
.cost-evolution-context-row td { padding:7px 12px !important; background:#f7f9fc !important; border-top:1px dashed #d3dce8; border-bottom:1px dashed #d3dce8; }
.cost-evolution-context { display:grid; gap:2px; color:#44546a; }
.cost-evolution-context strong { color:#24364f; font-size:12px; }
.cost-evolution-context small { color:#6a778a; font-size:11px; line-height:1.45; }


/* F8 RC6-F4 HF8.14.4 — mathematical cost explanation */
.cost-variation-wrap { display:inline-flex; align-items:center; justify-content:flex-end; gap:6px; width:100%; }
.cost-calc-button { width:26px; height:26px; flex:0 0 26px; display:inline-grid; place-items:center; padding:0; border:0; border-radius:50%; background:transparent; color:#285483; font:inherit; font-size:16px; line-height:1; cursor:pointer; }
.cost-calc-button:hover { background:#edf5ff; color:#163f70; }
.cost-calc-button:focus-visible { outline:2px solid #2b65a8; outline-offset:2px; background:#edf5ff; }
.cost-calc { display:grid; gap:16px; }
.cost-calc-explainer { padding:13px 15px; border:1px solid #cfe0f2; border-radius:11px; background:#f5f9ff; }
.cost-calc-explainer strong { display:block; margin-bottom:4px; color:#1f4e82; }
.cost-calc-explainer p { margin:0; color:#41536c; line-height:1.5; }
.cost-calc-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.cost-calc-card { display:grid; align-content:start; gap:10px; padding:15px; border:1px solid #dde5ef; border-radius:12px; background:#fbfcfe; }
.cost-calc-card--result { border-color:#bfd3ec; background:#f6f9ff; }
.cost-calc-card h3 { margin:0 0 2px; color:#213653; font-size:15px; }
.cost-calc-metric { min-width:0; padding-top:9px; border-top:1px solid #e7edf4; }
.cost-calc-metric:first-of-type { padding-top:0; border-top:0; }
.cost-calc-metric span { display:block; color:#667085; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.cost-calc-metric strong { display:block; margin-top:2px; color:#182b47; font-size:17px; }
.cost-calc-metric small { display:block; margin-top:2px; color:#6b778c; line-height:1.35; }
.cost-calc-formula { display:grid; gap:7px; padding:15px 17px; border:1px solid #d9e2ee; border-radius:12px; background:#fff; }
.cost-calc-formula__label { color:#53657d; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.cost-calc-formula__line { overflow-wrap:anywhere; color:#172b4d; font-family:ui-monospace,SFMono-Regular,Consolas,'Liberation Mono',monospace; font-size:13px; line-height:1.55; }
@media (max-width:760px) {
  .cost-calc-grid { grid-template-columns:1fr; }
}

/* HF8.14.8 — compact help for Evolución del costo */
.field-label-row { display:flex; align-items:center; gap:6px; }
.field-label-row > label { margin:0; }
.field-help-button { width:22px; height:22px; flex:0 0 22px; display:inline-grid; place-items:center; padding:0; border:0; border-radius:50%; background:transparent; color:#285483; font:inherit; font-size:14px; line-height:1; cursor:pointer; }
.field-help-button:hover { background:#edf5ff; color:#163f70; }
.field-help-button:focus-visible { outline:2px solid #2b65a8; outline-offset:2px; background:#edf5ff; }
.cost-view-help { display:grid; gap:16px; }
.cost-view-help section { border:1px solid #dbe5f4; border-radius:12px; padding:14px 16px; background:#fbfdff; }
.cost-view-help strong { display:block; color:#173f70; margin-bottom:4px; }
.cost-view-help p { margin:0; }


/* F3/8 · CxC history opening balance */
.ar-opening-row td{
  background:#f7f9fc;
  border-top:1px solid #d8e0ec;
  border-bottom:1px solid #d8e0ec;
  color:#344054;
}
.ar-opening-row td:last-child{font-weight:700;color:#172554}


/* F5/8 — Daily / weekly / monthly sales analytics and interactive charts */
.report-chart-heading { align-items:flex-start; gap:18px; }
.report-chart-frame { position:relative; width:100%; min-width:620px; }
.report-chart-grid { stroke:#e5eaf1; stroke-width:1; vector-effect:non-scaling-stroke; }
.report-chart-axis-label { fill:#69778a; font-size:11px; font-weight:600; font-variant-numeric:tabular-nums; }
.report-chart-axis-label--x { font-size:10.5px; }
.report-chart-area { fill:#eef5fd; opacity:.86; pointer-events:none; }
.report-chart-line--sales { stroke:#285b94; }
.report-chart-line--profit { stroke:#2f7a55; }
.report-chart-point { cursor:help; outline:none; }
.report-chart-point--sales { fill:#fff; stroke:#285b94; }
.report-chart-point--profit { fill:#fff; stroke:#2f7a55; }
.report-chart-point:focus { stroke-width:3.5; }
.report-chart-tooltip { position:absolute; z-index:3; min-width:170px; max-width:230px; transform:translate(-50%,-100%); padding:9px 11px; border:1px solid #cad6e5; border-radius:9px; background:#fff; box-shadow:0 8px 26px rgba(25,44,70,.16); pointer-events:none; }
.report-chart-tooltip[hidden] { display:none; }
.report-chart-tooltip strong { display:block; margin-bottom:3px; color:#213751; font-size:12px; }
.report-chart-tooltip span { display:block; color:#5d6b7f; font-size:11px; line-height:1.45; font-variant-numeric:tabular-nums; }
.report-chart-legend { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px 14px; padding-top:2px; }
.report-chart-legend__item { display:inline-flex; align-items:center; gap:6px; color:#52637a; font-size:11px; font-weight:600; white-space:nowrap; }
.report-chart-legend__item i { display:block; width:18px; height:3px; border-radius:999px; background:#285b94; }
.report-chart-legend__item--profit i { background:#2f7a55; }
@media (max-width:760px) {
  .report-chart-heading { display:grid; grid-template-columns:1fr; }
  .report-chart-legend { justify-content:flex-start; }
  .report-chart-frame { min-width:560px; }
}

/* F6/8 — Estado de cuenta PRO */
.account-profile { padding:18px; gap:16px; }
.account-profile__heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.account-profile__heading h3 { margin:2px 0 2px; font-size:21px; color:#1f3350; }
.account-profile__heading p { margin:0; }
.account-profile__grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px 18px; padding-top:14px; border-top:1px solid #e4eaf2; }
.account-profile__item { min-width:0; }
.account-profile__item span { display:block; color:#667085; font-size:12px; font-weight:600; }
.account-profile__item strong { display:block; margin-top:3px; color:#263b57; font-size:14px; overflow-wrap:anywhere; }
.account-statement-kpis .kpi strong { font-size:23px; }
@media (max-width:980px) {
  .account-profile__grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .account-statement-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
  .account-profile__heading { flex-direction:column; }
  .account-profile__grid,.account-statement-kpis { grid-template-columns:1fr; }
}

/* F8.2.1/4 — Thermal print engine and configuration */
.thermal-settings-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,340px); gap:22px; align-items:start; }
.thermal-setting-toggles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.thermal-setting-toggle { display:flex; align-items:flex-start; gap:9px; padding:10px 11px; border:1px solid #dfe6ef; border-radius:10px; background:#fbfcfe; cursor:pointer; }
.thermal-setting-toggle input { margin-top:3px; flex:0 0 auto; }
.thermal-setting-toggle span { min-width:0; display:grid; gap:2px; }
.thermal-setting-toggle strong { color:#263b57; font-size:13px; font-weight:600; }
.thermal-setting-toggle small { color:#667085; font-size:11px; line-height:1.35; }
.thermal-preview-panel { position:sticky; top:18px; padding:12px; border:1px solid #dfe6ef; border-radius:12px; background:#f5f7fa; }
.thermal-preview-panel__head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:9px; }
.thermal-preview-panel__head strong { color:#263b57; font-size:13px; }
.thermal-settings-preview { display:block; width:100%; height:520px; border:0; border-radius:9px; background:#fff; box-shadow:0 7px 22px rgba(32,52,78,.10); }
.thermal-settings-preview[data-paper="58"] { max-width:258px; margin-inline:auto; }
@media (max-width:920px) {
  .thermal-settings-layout { grid-template-columns:1fr; }
  .thermal-preview-panel { position:static; }
  .thermal-settings-preview { max-width:340px; margin-inline:auto; }
}
@media (max-width:620px) {
  .thermal-setting-toggles { grid-template-columns:1fr; }
}

/* F8.2.2 · vista previa térmica de Ventas */
.thermal-sale-preview-shell { max-width:860px; margin-inline:auto; }
.thermal-sale-preview-tools { align-items:end; }
.thermal-sale-preview-summary { display:grid; gap:3px; align-self:end; min-height:42px; padding:8px 11px; border:1px solid #dfe6ef; border-radius:10px; background:#fbfcfe; }
.thermal-sale-preview-summary strong { color:#263b57; font-size:14px; font-weight:600; }
.thermal-sale-preview-panel { position:static; }
.thermal-sale-preview { height:560px; max-width:380px; margin-inline:auto; }
.thermal-sale-preview[data-paper="58"] { max-width:274px; }
@media (max-width:720px){.thermal-sale-preview-tools{grid-template-columns:1fr}.thermal-sale-preview{height:500px}}


/* F8.3.1 — Compras: encabezado + imagen; productos ancho completo; totales debajo. */
.purchase-entry__top {
  display:grid;
  grid-template-columns:minmax(0,2.45fr) minmax(260px,1fr);
  align-items:stretch;
  gap:14px;
  margin:0 0 16px;
}
.purchase-entry__details,.purchase-entry__image {
  min-width:0;
  padding:14px;
  border:1px solid #dbe3ee;
  border-radius:12px;
  background:#fff;
}
.purchase-entry__heading {
  margin:0 0 14px;
  padding-bottom:9px;
  border-bottom:1px solid #e8edf4;
  color:#172033;
  font-size:16px;
  font-weight:600;
}
.purchase-entry__details .transaction-meta-grid--purchase {
  grid-template-columns:minmax(0,1.5fr) minmax(0,.95fr) minmax(0,1.15fr);
  gap:12px;
  margin-bottom:0;
}
.purchase-entry__image .transaction-product-image {
  position:static;
  display:grid;
  grid-template-columns:100px minmax(0,1fr);
  grid-template-rows:auto 1fr;
  align-items:center;
  gap:5px 10px;
  padding:0;
  border:0;
  background:transparent;
}
.purchase-entry__image .transaction-product-image__canvas { grid-column:1; grid-row:1 / 3; height:96px; }
.purchase-entry__image .transaction-product-image__heading { grid-column:2; grid-row:1; }
.purchase-entry__image .transaction-product-image > small { grid-column:2; grid-row:2; align-self:start; }
.purchase-entry__products.transaction-lines { margin-top:0; min-width:0; }
.purchase-entry__products .transaction-products-layout--full { display:block; min-width:0; }
.purchase-entry__products .transaction-products-layout__grid { min-width:0; }
.purchase-entry__products .transaction-grid--purchase .transaction-grid__header,
.purchase-entry__products .transaction-grid--purchase .transaction-grid__row {
  grid-template-columns:50px minmax(240px,1fr) 85px 126px 105px 95px 100px 106px;
}
.purchase-entry__products .transaction-lines__footer { align-items:flex-start; }
.purchase-entry__products .transaction-summary { margin-left:auto; }
@media(max-width:1050px){
  .purchase-entry__top { grid-template-columns:1fr; }
  .purchase-entry__image .transaction-product-image { grid-template-columns:92px minmax(0,1fr); }
  .purchase-entry__image .transaction-product-image__canvas { height:80px; }
}
@media(max-width:980px){
  .purchase-entry__details .transaction-meta-grid--purchase { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .purchase-entry__products .transaction-grid--purchase .transaction-grid__header,
  .purchase-entry__products .transaction-grid--purchase .transaction-grid__row { min-width:930px; }
}
@media(max-width:640px){
  .purchase-entry__details .transaction-meta-grid--purchase { grid-template-columns:1fr; }
  .purchase-entry__details,.purchase-entry__image { padding:12px; }
  .purchase-entry__products .transaction-summary { width:100%; }
  .purchase-entry__image .transaction-product-image { grid-template-columns:74px minmax(0,1fr); }
  .purchase-entry__image .transaction-product-image__canvas { height:68px; }
}


/* F8.3.2 — Compras: pulido visual, tabla ancho completo y responsive.
   Todas las reglas se limitan a purchase-entry__; Ventas permanece intacto. */
.purchase-entry__top {
  grid-template-columns:minmax(0, 2.45fr) minmax(275px, 1fr);
  gap:12px;
  margin-bottom:12px;
}
.purchase-entry__details, .purchase-entry__image {
  padding:13px 14px;
  border-color:#dce5ef;
  background:#fff;
}
.purchase-entry__heading {
  margin:0 0 11px;
  padding-bottom:8px;
  line-height:1.3;
}
.purchase-entry__details .transaction-meta-grid--purchase {
  gap:10px 12px;
}
.purchase-entry__details .transaction-meta__field { min-width:0; }
.purchase-entry__image .transaction-product-image {
  grid-template-columns:96px minmax(0,1fr);
  gap:6px 10px;
}
.purchase-entry__image .transaction-product-image__canvas { height:90px; }
.purchase-entry__image .transaction-product-image__heading strong {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.purchase-entry__image .transaction-product-image > small {
  font-size:11px;
  line-height:1.35;
}
.purchase-entry__products.transaction-lines {
  border:1px solid #dce5ef;
  border-radius:12px;
  padding:14px;
  background:#fff;
}
.purchase-entry__products .transaction-lines__heading {
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.purchase-entry__products .transaction-lines__heading > div { min-width:0; }
.purchase-entry__products .transaction-lines__heading h3 { margin-bottom:3px; }
.purchase-entry__products .transaction-lines__hint { max-width:630px; line-height:1.4; }
.purchase-entry__products .transaction-grid__quick-search {
  flex:0 1 300px;
  max-width:100%;
}
.purchase-entry__products .transaction-grid-scroll {
  min-width:0;
  max-width:100%;
}
.purchase-entry__products .transaction-grid--purchase .transaction-grid__header,
.purchase-entry__products .transaction-grid--purchase .transaction-grid__row {
  grid-template-columns:50px minmax(242px,1fr) minmax(78px,.35fr) minmax(119px,.52fr) minmax(94px,.40fr) minmax(92px,.39fr) minmax(112px,.49fr) 98px;
}
.purchase-entry__products .transaction-grid__header { min-height:42px; }
.purchase-entry__products .transaction-grid__header > div {
  padding:7px 6px;
  font-size:11.5px;
  line-height:1.3;
}
.purchase-entry__products .transaction-grid__row { min-height:58px; }
.purchase-entry__products .transaction-grid__row > * {
  margin-left:5px;
  margin-right:5px;
}
.purchase-entry__products .transaction-grid__line-no { margin-left:7px!important; }
.purchase-entry__products .transaction-grid__actions {
  margin-left:3px!important;
  margin-right:5px!important;
}
.purchase-entry__products .transaction-grid__subtotal {
  text-align:right;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.purchase-entry__products .transaction-lines__footer {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(305px,355px);
  gap:14px;
  align-items:start;
  margin-top:12px;
}
.purchase-entry__products .transaction-grid__add { justify-self:start; }
.purchase-entry__products .transaction-summary {
  width:100%;
  margin-left:0;
  min-width:0;
}
.purchase-entry__products .transaction-summary__title {
  padding:9px 12px;
  border-bottom:1px solid #e5edf6;
  color:#263b57;
  background:#f9fbfe;
  font-size:13px;
  font-weight:600;
}
.purchase-entry__products .transaction-summary__row {
  padding:7px 12px;
  font-variant-numeric:tabular-nums;
}
.purchase-entry__products .transaction-summary__row--total {
  padding:10px 12px;
}
/* Collapse the top row only when its input fields no longer fit comfortably. */
@media(max-width:1050px) {
  .purchase-entry__top { grid-template-columns:1fr; }
  .purchase-entry__image .transaction-product-image { grid-template-columns:90px minmax(0,1fr); }
  .purchase-entry__image .transaction-product-image__canvas { height:78px; }
}
@media(max-width:980px) {
  .purchase-entry__details .transaction-meta-grid--purchase { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .purchase-entry__products .transaction-grid-scroll { overflow-x:auto; overflow-y:hidden; scrollbar-gutter:stable; -webkit-overflow-scrolling:touch; }
  .purchase-entry__products .transaction-grid--purchase .transaction-grid__header,
  .purchase-entry__products .transaction-grid--purchase .transaction-grid__row { min-width:930px; }
  .purchase-entry__products .transaction-lines__heading { flex-direction:column; align-items:stretch; }
  .purchase-entry__products .transaction-grid__quick-search { width:100%; flex:auto; min-width:0; }
}
@media(max-width:700px) {
  .purchase-entry__products .transaction-lines__footer { grid-template-columns:1fr; }
  .purchase-entry__products .transaction-summary { width:100%; }
}
@media(max-width:640px) {
  .purchase-entry__details .transaction-meta-grid--purchase { grid-template-columns:1fr; gap:10px; }
  .purchase-entry__details, .purchase-entry__image { padding:12px; }
  .purchase-entry__products.transaction-lines { padding:10px; }
  .purchase-entry__image .transaction-product-image { grid-template-columns:70px minmax(0,1fr); }
  .purchase-entry__image .transaction-product-image__canvas { height:66px; }
}
