:root {
  --navy: #032947;
  --navy-2: #073a64;
  --navy-active: #164f7e;
  --accent: #047f9c;
  --accent-dark: #056b83;
  --text: #17212f;
  --muted: #647184;
  --border: #d8dee7;
  --border-strong: #b8c2cf;
  --surface: #ffffff;
  --surface-subtle: #f6f8fa;
  --success: #11842b;
  --warning: #d56905;
  --danger: #b42318;
  --sidebar-width: 205px;
  --topbar-height: 86px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #fff; }
body { font-size: 14px; line-height: 1.45; }
a { color: #075dae; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; color: white; background: linear-gradient(180deg, var(--navy) 0%, #03233d 100%); overflow: hidden; }
.sidebar-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 154px; padding: 14px 12px 16px; color: white; text-align: center; font-size: 14px; font-weight: 720; line-height: 1.25; }
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-logo-wrap { display: flex; align-self: center; align-items: center; justify-content: center; width: 168px; min-height: 63px; padding: 4px; background: transparent; }
.sidebar-brand-logo { display: block; width: 159px; height: 55px; margin-inline: auto; object-fit: contain; filter: drop-shadow(0 0 2px rgba(255,255,255,1)) drop-shadow(0 0 7px rgba(255,255,255,.78)) drop-shadow(0 4px 7px rgba(0,20,36,.32)); }
.sidebar-brand-copy { display: flex; align-items: center; justify-content: center; gap: 7px; }
.sidebar-brand-flag { flex: 0 0 auto; font-size: 22px; line-height: 1; }
.brand-mark { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border: 1px solid rgba(255,255,255,.56); border-radius: 5px; font-size: 15px; color: white; background: rgba(255,255,255,.09); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0; }
.nav-item { min-height: 51px; display: flex; align-items: center; gap: 11px; padding: 9px 17px; color: #fff; border-left: 4px solid transparent; font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav-item.active { border-left-color: #39a8ff; background: var(--navy-active); }
.nav-icon { width: 21px; text-align: center; font-size: 20px; line-height: 1; font-weight: 400; }
.nav-arrow { margin-left: auto; font-size: 21px; }
.collapse-button { margin-top: auto; min-height: 54px; border: 0; border-top: 1px solid rgba(255,255,255,.11); background: transparent; color: #fff; text-align: left; padding: 0 20px; }
.app-body { min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar { min-height: var(--topbar-height); display: flex; align-items: center; gap: 30px; padding: 12px 28px; border-bottom: 1px solid var(--border); background: #fff; }
.topbar-field { display: grid; gap: 6px; min-width: 130px; color: #303b4b; font-size: 13px; }
.topbar-field select { min-height: 37px; padding: 0 36px 0 11px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text); background: #fff; }
.topbar-report-form { display: flex; align-items: end; gap: 10px; }
.topbar-report-form .topbar-field { min-width: 130px; }
.topbar-overview-controls { display: flex; align-items: end; gap: 10px; }
.topbar-overview-controls .topbar-month-field { min-width: 145px; }
.topbar-quick-export { display: flex; align-items: end; margin: 0; }
.topbar-report-button { min-height: 37px; white-space: nowrap; }
.environment { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid #5fa46d; border-radius: 4px; color: #127a28; font-weight: 700; letter-spacing: .03em; }
.environment i { width: 9px; height: 9px; border-radius: 50%; background: #14852b; }
.user-menu { position: relative; display: flex; align-items: center; gap: 10px; padding-left: 24px; border-left: 1px solid var(--border); }
.user-menu-button { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.user-identity { display: grid; }
.user-menu strong { font-size: 14px; }
.user-menu small { color: var(--muted); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border-radius: 50%; color: #fff; background: #6a7d91; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-chevron { color: var(--muted); font-size: 16px; }
.user-menu-popover { position: absolute; z-index: 80; top: calc(100% + 12px); right: 0; width: 240px; padding: 7px; border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: 0 18px 42px rgba(5,37,61,.18); }
.user-menu-popover[hidden] { display: none; }
.user-menu-summary { display: grid; padding: 10px 11px 12px; border-bottom: 1px solid var(--border); }
.user-menu-popover a, .user-menu-popover button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 10px 11px; border: 0; border-radius: 4px; color: var(--text); background: transparent; font: inherit; font-weight: 650; text-align: left; }
.user-menu-popover a:hover, .user-menu-popover button:hover { background: var(--surface-subtle); text-decoration: none; }
.user-menu-logout-form { margin: 0; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 23px; }
.page-content { flex: 1; padding: 0; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 14px 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 106px; padding: 28px 31px 20px; border-bottom: 1px solid var(--border); }
.page-header h1 { margin: 0; font-size: 25px; line-height: 1.15; letter-spacing: -.025em; }
.page-header p { margin: 7px 0 0; color: var(--muted); }
h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.open-section { margin: 25px 31px; }
.open-section > h2, .open-section > .section-heading { margin-bottom: 16px; }
.setup-link-panel { max-width: 900px; }
.setup-link-panel > label { display: grid; gap: 7px; margin: 20px 0; color: #3b4655; font-size: 12px; font-weight: 580; }
.setup-link-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: 4px; color: #154568; background: #fff; font-size: 13px; font-weight: 650; }
.button:hover { text-decoration: none; background: var(--surface-subtle); }
.button-primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.button-primary:hover { background: var(--accent-dark); }
.button-danger { border-color: var(--danger); color: #fff; background: var(--danger); }
.button-danger:hover { color: #fff; background: #8f1c14; }
.button-large { min-width: 184px; min-height: 49px; font-size: 14px; }
.text-button { border: 0; background: transparent; color: #075dae; font-weight: 650; }

.flash-stack { position: fixed; z-index: 60; top: 96px; right: 24px; width: min(420px, calc(100vw - 32px)); }
.alert { margin: 8px 0; padding: 12px 15px; border: 1px solid #b8d8c0; border-radius: 4px; color: #17632a; background: #f2fbf4; box-shadow: 0 8px 22px rgba(11,35,54,.12); transition: opacity .18s ease, transform .18s ease; }
.flash-stack .alert.is-dismissing { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.alert-error { border-color: #edb6b0; color: var(--danger); background: #fff4f3; }
.field-error, .errorlist { margin: 6px 0; color: var(--danger); font-size: 12px; }
.errorlist { padding-left: 18px; }
.muted { color: var(--muted); }

.workspace-grid { display: grid; grid-template-columns: minmax(640px, 1fr) 395px; min-height: calc(100vh - var(--topbar-height) - 47px); }
.workspace-main { min-width: 0; border-right: 1px solid var(--border); }
.workspace-main .page-header { min-height: 100px; }
.workspace-rail { padding: 28px 26px; }
.form-section { padding: 26px 31px 0; }
.form-section > h2, .form-section > .section-heading { margin-bottom: 16px; }
.period-controls { display: grid; grid-template-columns: 1fr 1fr 30px 1fr 1.2fr; gap: 19px; align-items: start; }
.period-controls label, .form-grid label, .stack-form label, .month-selector, .ending-period-selector { display: grid; gap: 7px; color: #3b4655; font-size: 12px; font-weight: 580; }
[data-bank-exchange-rate][hidden] { display: none !important; }
.period-field { min-width: 0; }
.field-inline-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 7px; }
.field-inline-actions .load-state { flex: 1; }
.button-compact { min-height: 31px; padding: 5px 10px; font-size: 11px; white-space: nowrap; }
.load-state { min-height: 14px; color: var(--warning); font-size: 10px; font-weight: 650; }
.load-state.loaded, .section-load-state.loaded { color: var(--success); }
.period-load-row { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.section-load-state { margin-left: auto; color: var(--warning); font-size: 10px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 39px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(4,127,156,.15); border-color: var(--accent); }
input[readonly] { background: var(--surface-subtle); color: #566171; }
.accounting-input { font-variant-numeric: tabular-nums; }
.period-arrow { align-self: start; height: 39px; margin-top: 24px; display: grid; place-items: center; font-size: 21px; }
.info-dot { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: auto; border: 1px solid #6d7784; border-radius: 50%; color: #4e5967; font-size: 11px; }
.reclass-table { border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.reclass-head, .reclass-table label { display: grid; grid-template-columns: 1fr .9fr 1.15fr; gap: 18px; align-items: center; min-height: 45px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.reclass-head { min-height: 37px; color: #4f5a68; background: var(--surface-subtle); font-size: 12px; }
.reclass-table label:last-child { border-bottom: 0; }
.reclass-table input { max-width: 100%; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 55px; padding: 34px 31px 0; }
.upload-grid.single-upload { grid-template-columns: minmax(320px, .5fr); }
.upload-grid h2 { margin-bottom: 13px; }
.dropzone { position: relative; min-height: 185px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px dashed #6d7f91; border-radius: 5px; color: #344052; background: #fff; transition: .15s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: #f4fbfd; }
.dropzone.has-file { border-style: solid; border-color: #4e9f60; background: #f7fcf8; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone strong { margin-top: 8px; padding: 7px 15px; border: 1px solid #8794a3; border-radius: 4px; color: #075dae; background: #fff; font-size: 12px; }
.dropzone small { color: var(--muted); }
.upload-icon { font-size: 41px; line-height: 1; color: #172334; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; padding: 31px; }
.checkbox-row { display: inline-flex !important; align-items: center; gap: 9px; color: #4e5967; font-size: 12px; }
.checkbox-row input { width: 16px; height: 16px; min-height: 0; }
.confirmation-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 7px; color: var(--text); background: #fff; box-shadow: 0 24px 70px rgba(2,24,41,.3); }
.confirmation-dialog::backdrop { background: rgba(3,30,52,.52); }
.confirmation-dialog form { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 15px; padding: 25px; }
.confirmation-dialog h2 { margin: 1px 0 9px; font-size: 19px; }
.confirmation-dialog p { margin: 0 0 9px; }
.confirmation-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: var(--warning); font-size: 20px; font-weight: 800; }
.confirmation-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 5px; padding-top: 17px; border-top: 1px solid var(--border); }

.readiness { padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.readiness h2 { margin-bottom: 18px; }
.readiness ul, .recent-activity ul { list-style: none; margin: 0; padding: 0; }
.readiness li { display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 8px; min-height: 42px; }
.readiness li i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #697584; background: #e8ecf1; font-style: normal; font-size: 12px; font-weight: 800; }
.readiness li.ready i { color: #fff; background: var(--success); }
.readiness li small { color: var(--warning); }
.readiness li.ready small { color: var(--success); }
.recent-activity { padding-top: 22px; }
.recent-activity .section-heading { margin-bottom: 8px; }
.recent-activity li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.recent-activity li.empty-state { display: block; }
.recent-activity li > span:nth-child(2) { display: grid; gap: 1px; }
.recent-activity strong { font-size: 12px; }
.recent-activity small { color: var(--muted); font-size: 11px; }
.recent-activity time { color: var(--muted); font-size: 10px; text-align: right; }
.activity-icon { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #73b783; border-radius: 50%; color: var(--success); }

.two-column { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 42px; align-items: start; }
.workflow-note, .summary-rail { margin: 25px 31px 25px 0; padding: 22px; border-left: 3px solid var(--accent); background: var(--surface-subtle); }
.workflow-note h2 { margin-bottom: 10px; }
.workflow-note p, .workflow-note li { color: #536071; }
.report-form { margin-right: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.month-selector { margin-top: 18px; }
.month-selector select { min-height: 150px; }
.month-selector small { color: var(--muted); font-weight: 400; }
.ending-period-selector { margin-top: 18px; }
.ending-period-selector small { color: var(--muted); font-weight: 400; }
.month-selector[hidden], .ending-period-selector[hidden] { display: none; }
.report-form .form-actions { padding: 18px 0 0; }
.auto-download-status { display: flex; align-items: center; gap: 10px; margin: 18px 31px 0; padding: 12px 14px; border: 1px solid #8fc79c; border-radius: 4px; color: #175d28; background: #effaf2; font-size: 12px; font-weight: 600; transition: opacity .18s ease, transform .18s ease; }
.auto-download-status .status-queued::before, .auto-download-status .status-running::before { background: var(--success); }
.auto-download-status.is-ready { border-color: #69b37a; color: #0f5420; background: #e4f6e8; }
.auto-download-status.is-failed { border-color: #edb6b0; color: var(--danger); background: #fff4f3; }
.auto-download-status.is-dismissing { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.auto-download-status a { margin-left: auto; font-weight: 700; }

.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table th { padding: 10px 12px; color: #4e5968; background: var(--surface-subtle); border-bottom: 1px solid var(--border-strong); font-weight: 650; white-space: nowrap; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td small { display: block; color: var(--muted); }
.empty-row { padding: 30px !important; text-align: center; color: var(--muted); }
.job-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.job-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8995a4; }
.status-succeeded::before { background: var(--success); }
.status-failed::before { background: var(--danger); }
.status-running::before { background: #087eb2; }
.status-queued::before { background: #c67a00; }
.error-detail { max-width: 250px; color: var(--danger) !important; }
.bridge-inputs { margin: 18px 0; padding: 16px; border: 1px solid var(--border); background: var(--surface-subtle); }
.bridge-inputs h3 { margin: 0 0 5px; font-size: 14px; }
.bridge-inputs p { margin: 0 0 13px; }
.bridge-inputs[hidden] { display: none; }
.audit-adjustment-selector { align-items: start; }
.audit-adjustment-selector small { display: block; margin: 3px 0 0 24px; color: var(--muted); font-weight: 400; }
.checkbox-row.audit-adjustment-selector[hidden] { display: none !important; }

.search-bar { display: flex; gap: 10px; max-width: 650px; margin: 24px 31px; }
.upload-panel { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 18px; border: 1px solid var(--border); background: var(--surface-subtle); }
.upload-panel p { margin: 5px 0 3px; color: var(--muted); }
.upload-panel small { color: var(--muted); }
.inline-upload-form { display: flex; align-items: center; gap: 10px; min-width: min(460px, 48%); }
.inline-upload-form input[type="file"] { min-width: 280px; }
.mapping-import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 24px 31px 32px; }
.mapping-import-card { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.mapping-import-card .eyebrow { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.mapping-import-card h2 { margin: 4px 0 7px; }
.mapping-import-card p { color: var(--muted); }
.mapping-import-card small { color: var(--muted); }
.mapping-import-form { display: grid; gap: 14px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.mapping-import-form > label, .mapping-import-form .form-grid label { display: grid; gap: 7px; color: #3b4655; font-size: 12px; font-weight: 580; }
.mapping-import-form .button { justify-self: start; }
.catalog-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-counts span { padding: 6px 9px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); background: var(--surface-subtle); font-size: 11px; }
.section-tabs { display: flex; gap: 24px; padding: 0 31px; border-bottom: 1px solid var(--border); background: #fff; }
.section-tabs a { padding: 14px 1px 12px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.section-tabs a.active { border-bottom-color: var(--accent); color: var(--navy); }
.adjustment-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 0 31px 32px; }
.adjustment-layout .open-section { margin-left: 0; margin-right: 0; }
.adjustment-editor { min-width: 0; }
.adjustment-editor .section-heading p, .saved-pairs .section-heading p { margin: 5px 0 0; color: var(--muted); }
.pair-state { color: var(--success); font-size: 11px; font-weight: 700; }
.adjustment-header-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.adjustment-header-grid label { display: grid; gap: 6px; color: #3c4856; font-size: 11px; font-weight: 650; }
.adjustment-header-grid input, .adjustment-header-grid select { width: 100%; }
.pair-loader { display: flex; align-items: center; gap: 12px; margin: 13px 0; }
.adjustment-explainer { display: grid; gap: 3px; margin: 16px 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: #f3f8fb; color: #526070; font-size: 11px; line-height: 1.5; }
.adjustment-explainer strong { color: var(--navy); }
.adjustment-row-header, .adjustment-entry-row { display: grid; grid-template-columns: 34px minmax(260px, 1fr) minmax(130px, .35fr) 110px 28px; gap: 8px; align-items: center; }
.adjustment-row-header { padding: 8px 9px; border: 1px solid var(--border); background: var(--surface-subtle); color: #526070; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.adjustment-entry-row { padding: 7px 9px; border: 1px solid var(--border); border-top: 0; }
.adjustment-entry-row select, .adjustment-entry-row input { min-width: 0; width: 100%; min-height: 34px; padding: 6px 8px; font-size: 11px; }
.adjustment-entry-row output { text-align: right; color: #526070; font-variant-numeric: tabular-nums; }
.row-number { color: var(--muted); }
.row-remove { border: 0; background: transparent; color: var(--danger); font-size: 18px; cursor: pointer; }
.adjustment-actions { display: flex; align-items: center; gap: 10px; padding-top: 16px; }
.adjustment-actions .button-primary { margin-left: auto; }
.saved-pair { padding: 14px 0; border-bottom: 1px solid var(--border); }
.saved-pair > div:first-child { display: grid; gap: 3px; }
.saved-pair > div:first-child span { color: var(--muted); font-size: 11px; }
.saved-pair dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.saved-pair dl div { display: grid; gap: 2px; }
.saved-pair dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.saved-pair dd { margin: 0; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.saved-pair-actions { display: flex; align-items: center; gap: 12px; }
.saved-pair-actions form { margin: 0; }
.danger-text { color: var(--danger); }
.mapping-table input { min-width: 150px; min-height: 33px; padding: 6px 8px; font-size: 12px; }
.mapping-table td:nth-child(2) { min-width: 220px; }
.json-cell { max-width: 420px; overflow-wrap: anywhere; color: #526070; }
.admin-columns { grid-template-columns: minmax(320px, .75fr) minmax(480px, 1.25fr); }
.stack-form { display: grid; gap: 15px; }
.role-summary { padding: 13px 0; border-bottom: 1px solid var(--border); }
.role-summary:last-child { border-bottom: 0; }
.role-summary p { margin: 4px 0 9px; color: var(--muted); }
.role-summary code, .assignment { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 6px; border: 1px solid var(--border); border-radius: 3px; color: #3e4d5e; background: var(--surface-subtle); font-size: 10px; }
.capability-groups { display: grid; gap: 18px; padding: 16px; border: 1px solid var(--border); }
.capability-group { display: grid; gap: 10px; }
.capability-group h3 { margin: 0; padding-bottom: 7px; border-bottom: 1px solid var(--border); color: var(--navy); font-size: 13px; }
.capability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; gap: 12px 22px; }
.capability-grid label { display: grid; grid-template-columns: 17px minmax(0, 1fr); align-items: start; gap: 8px; min-width: 0; font-size: 12px; }
.capability-grid input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 2px 0 0; padding: 0; }
.capability-grid label span { display: grid; min-width: 0; line-height: 1.35; }
.capability-grid small { color: var(--muted); font-family: ui-monospace, monospace; }
.inline-admin-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inline-admin-form select { min-width: 95px; min-height: 32px; padding: 5px; }
.assignment-form { display: inline-flex; align-items: center; }
.assignment-form button { margin-left: -7px; border: 0; background: transparent; color: var(--danger); cursor: pointer; }
.application-matrix th:not(:first-child), .application-matrix td:not(:first-child) { text-align: center; }
.application-matrix td:first-child { min-width: 270px; }
.matrix-toggle { display: inline-grid; justify-items: center; gap: 3px; color: var(--muted); font-size: 9px; }
.matrix-toggle input { width: 16px; height: 16px; min-height: 0; }
.database-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.database-card { padding: 22px; border: 1px solid var(--border); }
.database-card p { color: var(--muted); }
.database-restore-card { grid-column: 1 / -1; }
.database-engine { padding: 5px 9px; border: 1px solid #88b8c3; border-radius: 3px; color: var(--accent-dark); background: #f0fafc; font-size: 11px; font-weight: 700; }
.database-details { display: grid; gap: 12px; margin: 20px 0; }
.database-details div { display: grid; gap: 3px; }
.database-details dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.database-details dd { margin: 0; }
.database-details code { overflow-wrap: anywhere; }
.database-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.database-stats div { display: grid; padding: 12px; border: 1px solid var(--border); background: var(--surface-subtle); }
.database-stats strong { font-size: 21px; }
.database-stats span { color: var(--muted); font-size: 11px; }
.danger-notice { display: grid; gap: 3px; margin: 16px 0; padding: 12px 14px; border-left: 3px solid var(--danger); color: #73312c; background: #fff4f3; font-size: 12px; }

.permission-pill, .count-chip { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid #9bc8d2; border-radius: 999px; color: var(--accent-dark); background: #f2fbfc; font-size: 11px; font-weight: 750; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 25px 31px; }
.settings-grid .open-section { margin: 0; }
.settings-card { padding: 22px; border: 1px solid var(--border); background: #fff; }
.settings-card .section-heading p, .settings-card > div > p { margin: 5px 0 0; color: var(--muted); }
.profile-photo-row { display: flex; align-items: center; gap: 18px; margin: 20px 0; }
.profile-photo-row > div { display: grid; gap: 3px; }
.profile-photo-row small { color: var(--muted); }
.profile-photo-preview { display: grid; place-items: center; flex: 0 0 82px; width: 82px; height: 82px; overflow: hidden; border-radius: 50%; color: #fff; background: #6a7d91; font-size: 24px; font-weight: 800; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-actions { display: flex; gap: 8px; margin-top: 10px; }
.profile-photo-actions form { margin: 0; }
.field-hint { color: var(--muted); font-size: 10px; }
.settings-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-facts div { padding: 12px; border: 1px solid var(--border); background: var(--surface-subtle); }
.settings-facts dt, .access-list-label { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.settings-facts dd { margin: 4px 0 0; font-weight: 700; }
.settings-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-form-grid label { display: grid; gap: 6px; color: #3b4655; font-size: 12px; font-weight: 650; }
.settings-check-list { display: grid; gap: 10px; }
.settings-check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; align-items: start; }
.settings-check input { width: 16px; height: 16px; min-height: 0; margin-top: 3px; }
.settings-check span { display: grid; }
.settings-check small { color: var(--muted); font-weight: 400; }
.settings-access-list { display: grid; gap: 10px; margin-top: 16px; }
.settings-access-list article { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; padding: 15px; border: 1px solid var(--border); background: var(--surface-subtle); }
.settings-access-list article > div { display: grid; align-content: start; gap: 3px; }
.settings-access-list p { margin: 2px 0 8px; }
.security-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mfa-settings-status { display: flex; flex-wrap: wrap; gap: 9px; margin: 15px 0 0; }
.mfa-settings-status div { min-width: 145px; padding: 9px 11px; border: 1px solid var(--border); background: var(--surface-subtle); }
.mfa-settings-status dt { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.mfa-settings-status dd { margin: 3px 0 0; font-weight: 700; }

.admin-user-list { display: grid; gap: 12px; }
.user-access-card { border: 1px solid var(--border); background: #fff; }
.user-access-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; cursor: pointer; }
.user-access-card > summary > span:first-child { display: grid; }
.user-access-card > summary small { color: var(--muted); }
.admin-user-status { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.mfa-pending-pill { border-color: #e7c27c; color: #82510b; background: #fff9ef; }
.text-button-danger { color: var(--danger); }
.user-access-body { display: grid; gap: 17px; padding: 18px; border-top: 1px solid var(--border); }
.user-access-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; }
.user-access-toolbar > label:not(.checkbox-row) { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.global-admin-notice { padding: 12px 14px; border-left: 3px solid var(--success); color: #17632a; background: #f2fbf4; }
.user-access-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.global-admin-notice[hidden], .user-access-matrix[hidden], .access-company-options[hidden] { display: none; }
.access-company { border: 1px solid var(--border); background: var(--surface-subtle); }
.access-company.enabled { border-color: #9bc8d2; background: #f5fbfc; }
.access-company-toggle { display: flex; align-items: center; gap: 9px; padding: 13px; }
.access-company-toggle input, .access-checkbox-grid input { flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; }
.access-company-toggle span { display: grid; }
.access-company-toggle small { color: var(--muted); }
.access-company-options { display: grid; gap: 14px; padding: 0 13px 14px; }
.access-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.access-checkbox-grid > span { grid-column: 1 / -1; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.access-checkbox-grid label { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 11px; }
.disabled-option { color: #98a1ad; }
.access-save-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.access-save-row p { margin: 0; color: var(--muted); font-size: 11px; }

.overview-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.income-dashboard { margin: 25px 31px 30px; border: 1px solid var(--border); background: #fff; }
.income-dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.income-dashboard-heading h2 { font-size: 18px; }
.income-dashboard-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.dashboard-filters { display: grid; grid-template-columns: 130px 150px; gap: 12px; flex: 0 0 auto; }
.dashboard-filters label { display: grid; gap: 5px; color: #445064; font-size: 10px; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.dashboard-filters select { min-height: 35px; padding-top: 5px; padding-bottom: 5px; color: var(--text); font-size: 12px; font-weight: 600; text-transform: none; }
.dashboard-readiness { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 22px; border-bottom: 1px solid #efd3aa; color: #82510b; background: #fff9ef; font-size: 11px; font-weight: 600; }
.income-dashboard-table-wrap { width: 100%; overflow-x: auto; }
.income-dashboard-table { width: 100%; min-width: 1030px; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.income-dashboard-table th, .income-dashboard-table td { padding: 11px 13px; border-bottom: 1px solid var(--border); }
.income-dashboard-table thead th { color: #fff; background: var(--navy); font-weight: 700; text-align: right; white-space: nowrap; }
.income-dashboard-table thead th:first-child { min-width: 270px; text-align: left; }
.income-dashboard-table thead .comparison-heading { min-width: 112px; border-left: 1px solid rgba(255,255,255,.22); color: #d8f3e0; background: #0a3c58; text-align: center; vertical-align: middle; }
.income-dashboard-table thead tr:first-child th:nth-child(n+3) { border-left: 1px solid rgba(255,255,255,.22); }
.income-dashboard-table .dashboard-subhead th { padding-top: 7px; padding-bottom: 7px; color: #4e5968; background: var(--surface-subtle); border-bottom-color: var(--border-strong); font-size: 10px; }
.income-dashboard-table .dashboard-subhead th:nth-child(4), .income-dashboard-table .dashboard-subhead th:nth-child(6) { border-left: 1px solid var(--border); }
.income-dashboard-table tbody th { position: relative; color: #374354; font-weight: 550; text-align: left; }
.income-dashboard-table tbody td { min-width: 92px; text-align: right; }
.income-dashboard-table tbody td:nth-child(3), .income-dashboard-table tbody td:nth-child(5), .income-dashboard-table tbody td:nth-child(7) { border-left: 1px solid var(--border); }
.income-dashboard-table .comparison-cell { min-width: 112px; text-align: center; }
.comparison-cell strong, .comparison-cell span { display: block; }
.comparison-cell strong { font-size: 12px; }
.comparison-cell span { margin-top: 1px; font-size: 9px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.comparison-improved { color: var(--success) !important; background: #f2faf4; }
.comparison-worsened { color: var(--danger) !important; background: #fff4f3; }
.comparison-unchanged, .comparison-unavailable { color: var(--muted) !important; background: var(--surface-subtle); }
.dashboard-operator { display: inline-block; width: 22px; color: var(--muted); font-weight: 700; text-align: center; }
.dashboard-row-credit th, .dashboard-row-credit td { color: #08728a; }
.dashboard-row-subtotal th, .dashboard-row-subtotal td { border-top: 2px solid var(--border-strong); background: #f2f7fa; font-weight: 750; }
.dashboard-row-total th, .dashboard-row-total td { border-top: 2px solid var(--navy); border-bottom: 0; color: var(--navy); background: #edf5f8; font-weight: 800; }
.dashboard-no-data { color: var(--muted); font-size: 10px; }
.dashboard-footnote { margin: 0; padding: 11px 22px; color: var(--muted); background: var(--surface-subtle); font-size: 10px; line-height: 1.5; }
.dashboard-empty { padding: 26px 22px; }
.summary-rail { border-left: 1px solid var(--border); background: #fff; }
.summary-rail div { display: grid; padding: 14px 0; border-bottom: 1px solid var(--border); }
.summary-rail strong { font-size: 24px; }
.summary-rail span { color: var(--muted); }
.period-list { display: flex; flex-wrap: wrap; gap: 8px; }
.period-list > span { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--border); }
.period-list small { color: var(--muted); }
.period-list .status-open { color: var(--success); }
.empty-state { padding: 20px 0; color: var(--muted); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef2f6; }
.login-panel { width: min(430px, 100%); padding: 38px; border: 1px solid var(--border); background: #fff; box-shadow: 0 20px 45px rgba(5,37,61,.12); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 32px; color: var(--navy); text-align: center; }
.login-brand-logo-wrap { display: flex; align-items: center; justify-content: center; width: 176px; min-height: 69px; padding: 7px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.login-brand-logo { display: block; width: 159px; height: 55px; object-fit: contain; }
.login-brand-copy { display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-brand-copy strong { max-width: 250px; font-size: 16px; line-height: 1.25; }
.login-brand-flag { flex: 0 0 auto; font-size: 24px; line-height: 1; }
.login-panel h1 { margin: 0 0 8px; font-size: 25px; }
.login-panel .muted { margin-bottom: 24px; }
.mfa-panel { width: min(540px, 100%); }
.mfa-step { display: inline-flex; margin-bottom: 8px; color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mfa-step-success { color: var(--success); }
.mfa-qr-wrap { display: grid; place-items: center; margin: 18px 0; padding: 16px; border: 1px solid var(--border); background: #fff; }
.mfa-qr-wrap img { display: block; width: min(230px, 100%); height: auto; image-rendering: pixelated; }
.mfa-manual-key { margin: 0 0 20px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface-subtle); }
.mfa-manual-key summary { cursor: pointer; font-weight: 700; }
.mfa-manual-key p { margin: 10px 0 7px; color: var(--muted); font-size: 11px; }
.mfa-manual-key code { display: block; overflow-wrap: anywhere; color: var(--navy); font-size: 13px; letter-spacing: .08em; }
.mfa-recovery-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0; padding: 0; list-style: none; }
.mfa-recovery-list li { padding: 10px; border: 1px solid var(--border); background: var(--surface-subtle); text-align: center; }
.mfa-recovery-list code { color: var(--navy); font-size: 13px; font-weight: 750; letter-spacing: .05em; }
.local-notice { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 24px 0 0; color: var(--success); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.local-notice span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.sidebar-collapsed { --sidebar-width: 64px; }
.sidebar-collapsed .sidebar-brand-copy, .sidebar-collapsed .nav-item > span:not(.nav-icon), .sidebar-collapsed .collapse-button span { display: none; }
.sidebar-collapsed .sidebar-brand { min-height: 84px; padding: 14px 8px; }
.sidebar-collapsed .sidebar-brand-logo-wrap { width: 48px; min-height: 48px; padding: 4px; }
.sidebar-collapsed .sidebar-brand-logo { width: 44px; height: auto; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 10px; }
.application-switcher { display: grid; gap: 6px; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.13); border-bottom: 1px solid rgba(255,255,255,.13); color: rgba(255,255,255,.7); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.application-switcher select { width: 100%; min-height: 36px; padding: 6px 20px 6px 8px; border-color: rgba(255,255,255,.28); color: #fff; background-color: rgba(255,255,255,.08); font-size: 10px; font-weight: 650; text-transform: none; }
.application-switcher select option { color: #172334; background-color: #fff; font-weight: 600; }
.application-switcher select option:checked { color: #fff; background-color: #456879; }
.sidebar-collapsed .application-switcher { display: none; }
.cogs-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 20px; margin: 22px 31px; }
.cogs-layout .open-section { margin: 0; }
.cogs-upload-card, .cogs-method-card { display: grid; align-content: start; gap: 22px; }
.cogs-method-card { background: #f6fafc; }
.threshold-field input { width: 130px; }
.inventory-source-dropzones { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.inventory-source-dropzones h3 { margin: 0 0 9px; font-size: 13px; }
.inventory-dropzone { min-height: 215px; padding: 20px; text-align: center; }
.dropzone-selection { max-width: 100%; margin-top: 5px; overflow: hidden; color: var(--success); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.inventory-mapping-form { align-items: end; margin: 18px 0; }
.inventory-mapping-form label { min-width: 240px; }
.eyebrow { color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.clean-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.clean-list li { position: relative; padding-left: 20px; color: #445064; font-size: 12px; line-height: 1.45; }
.clean-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.notice-card { padding: 14px; border-left: 3px solid var(--accent); color: #385063; background: #f2f8fa; font-size: 12px; }

@media (max-width: 1050px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .workspace-main { border-right: 0; }
  .workspace-rail { border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
  .readiness { border-bottom: 0; padding-bottom: 0; }
  .recent-activity { padding-top: 0; }
  .user-menu small { display: none; }
  .adjustment-layout { grid-template-columns: 1fr; }
  .topbar { gap: 16px; }
  .topbar-report-button { max-width: 170px; white-space: normal; line-height: 1.15; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -240px; width: 220px; transition: left .2s ease; box-shadow: 8px 0 24px rgba(2,24,41,.28); }
  .sidebar-open .sidebar { left: 0; }
  .topbar { min-height: 72px; padding: 10px 15px; gap: 12px; flex-wrap: wrap; }
  .mobile-menu { display: block; }
  .environment, .user-identity { display: none; }
  .topbar-report-form .topbar-field { display: none; }
  .topbar-overview-controls { order: 10; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .topbar-overview-controls .topbar-report-form { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .topbar-overview-controls .topbar-report-form .topbar-field { display: grid; min-width: 0; }
  .topbar-overview-controls .topbar-field select { padding-right: 28px; }
  .topbar-report-button { width: 44px; max-width: 44px; overflow: hidden; padding: 8px 11px; color: transparent; font-size: 0; white-space: nowrap; }
  .topbar-report-button::after { content: "IS"; color: #fff; font-size: 12px; }
  .topbar-field { min-width: 90px; }
  .user-menu { margin-left: auto; padding-left: 12px; }
  .page-header { min-height: 90px; padding: 20px; align-items: flex-start; }
  .page-header .button { display: none; }
  .workspace-main .page-header { min-height: 90px; }
  .form-section, .upload-grid { padding-left: 20px; padding-right: 20px; }
  .period-controls { grid-template-columns: 1fr 1fr; }
  .period-arrow { display: none; }
  .upload-grid, .workspace-rail, .two-column, .overview-layout, .admin-columns, .database-layout, .mapping-import-grid, .cogs-layout, .settings-grid, .user-access-matrix { grid-template-columns: 1fr; }
  .settings-grid { margin: 20px; }
  .settings-form-grid, .settings-access-list article { grid-template-columns: 1fr; }
  .security-card, .access-save-row { align-items: stretch; flex-direction: column; }
  .mfa-recovery-list { grid-template-columns: 1fr; }
  .cogs-layout { margin: 20px; }
  .database-restore-card { grid-column: auto; }
  .upload-panel, .inline-upload-form { align-items: stretch; flex-direction: column; min-width: 0; }
  .inline-upload-form input[type="file"] { min-width: 0; }
  .upload-grid { gap: 24px; }
  .workspace-rail { padding: 22px 20px; }
  .workflow-note, .summary-rail { margin: 0 20px 25px; }
  .income-dashboard { margin: 20px; }
  .income-dashboard-heading { align-items: stretch; flex-direction: column; padding: 17px; }
  .dashboard-filters { grid-template-columns: 1fr 1fr; }
  .income-dashboard-table th, .income-dashboard-table td { padding: 10px; }
  .dashboard-footnote { padding: 11px 17px; }
  .auto-download-status { align-items: flex-start; flex-wrap: wrap; margin: 16px 20px 0; }
  .auto-download-status a { width: 100%; margin-left: 0; }
  .open-section { margin: 22px 20px; }
  .form-grid, .capability-grid { grid-template-columns: 1fr; }
  .form-actions { padding: 24px 20px; flex-direction: column; align-items: stretch; }
  .button-large { width: 100%; }
  .footer { padding: 13px 20px; }
  .section-tabs { padding: 0 20px; }
  .mapping-import-grid { padding: 0 20px 24px; }
  .adjustment-layout { padding: 0 20px 24px; }
  .adjustment-header-grid { grid-template-columns: 1fr; }
  .adjustment-row-header { display: none; }
  .adjustment-entry-row { grid-template-columns: 28px minmax(0, 1fr) 28px; }
  .adjustment-entry-row input { grid-column: 2; }
  .adjustment-entry-row output { grid-column: 2; text-align: left; }
  .adjustment-entry-row .row-remove { grid-column: 3; grid-row: 1; }
  .adjustment-actions { flex-wrap: wrap; }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.staged-mapping-form {
  flex-wrap: nowrap;
  align-items: center;
}

.staged-mapping-form label {
  min-width: 16rem;
  flex: 1;
}

.inventory-reason-decisions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.inventory-reason-decisions h3 {
  margin: 3px 0 5px;
  font-size: 16px;
}

.reason-decision-table td:nth-child(1) {
  min-width: 9rem;
}

.reason-decision-table td:nth-child(4) {
  min-width: 12rem;
}

.reason-decision-table td:nth-child(5) {
  min-width: 25rem;
}

.reason-decision-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.reason-decision-actions form {
  margin: 0;
}

.reason-map-form {
  flex-wrap: nowrap;
}

.reason-map-form select {
  min-width: 12rem;
  min-height: 31px;
  padding: 4px 8px;
  font-size: 11px;
}

.skip-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inventory-run-actions {
  display: block;
  margin-top: 1.25rem;
}

.inventory-run-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
}

.inventory-run-controls form {
  margin: 0;
}

.inventory-run-controls > form:first-child {
  justify-self: start;
  padding-top: 21px;
}

.inventory-run-form {
  display: grid;
  grid-template-columns: 180px auto;
  grid-template-rows: auto auto;
  align-items: end;
  gap: 5px 10px;
  justify-self: end;
}

.inventory-run-form label {
  display: grid;
  gap: 5px;
  width: 180px;
  color: #3b4655;
  font-size: 11px;
  font-weight: 650;
}

.inventory-run-form input[type="text"] {
  width: 130px;
}

.inventory-run-form > .button {
  grid-column: 2;
  grid-row: 1;
}

.inventory-threshold-help {
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.35;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 760px) {
  .inventory-source-dropzones { grid-template-columns: 1fr; }
  .inventory-dropzone { min-height: 175px; }
  .inventory-run-controls { display: flex; align-items: stretch; flex-direction: column; }
  .inventory-run-controls > form:first-child { padding-top: 0; }
  .inventory-run-form { grid-template-columns: 1fr; grid-template-rows: auto auto auto; align-items: stretch; justify-self: stretch; }
  .inventory-run-form > .button { grid-column: 1; grid-row: 3; }
  .inventory-threshold-help { grid-column: 1; grid-row: 2; }
  .inventory-run-controls form, .inventory-run-form label, .inventory-run-form input[type="text"] { width: 100%; }
}
