/* FarmMint Admin — shared premium workspace kit (Sprint 6). Used by every module redesigned in the luxury sprint.
   Colours: exact navy #203968 / green #4CAF61 via tokens (+ alpha tints), white, documented neutrals, status tints and the
   documented --fm-chart-* data-viz palette. */

.kit-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.kit-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-stack { display: grid; gap: 20px; }
.kit-stack[hidden] { display: none; }

/* ---------- KPI cards ---------- */
.kit-kpis { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 14px; }
.kit-kpi { grid-template-areas: 'icon value' 'label label' 'sub sub'; }
.kit-kpi__sub { grid-area: sub; margin-top: -4px; font: 400 12px/16px var(--fm-font); color: var(--fm-text-secondary); }
div.kit-kpi:hover { transform: none; box-shadow: var(--dx-shadow); }
div.kit-kpi { cursor: default; }
.kit-kpi--green .ux-kpi__icon { background: var(--fm-accent-light); color: var(--fm-accent-text); }
.kit-kpi--amber .ux-kpi__icon { background: #fef3c7; color: #92400e; }
.kit-kpi--red .ux-kpi__icon { background: #fee2e2; color: #991b1b; }
.kit-kpi--blue .ux-kpi__icon { background: #dbeafe; color: #1e40af; }
.kit-kpi--green .ux-kpi__value { color: var(--fm-accent-text); }
.kit-kpi--red .ux-kpi__value { color: #991b1b; }
.kit-kpi--amber .ux-kpi__value { color: #92400e; }

/* ---------- Pills / tabs ---------- */
.kit-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-pill { appearance: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--fm-border); border-radius: var(--fm-radius-full); background: var(--fm-surface); color: var(--fm-text); font: 600 13px/18px var(--fm-font); cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease; }
.kit-pill:hover { border-color: var(--fm-primary); color: var(--fm-primary); }
.kit-pill:active { transform: scale(0.97); }
.kit-pill:focus-visible { outline: 2px solid var(--fm-primary); outline-offset: 2px; box-shadow: var(--fm-focus-ring); }
.kit-pill.is-active { background: var(--fm-primary); border-color: var(--fm-primary); color: #fff; }
.kit-pill__count { min-width: 22px; padding: 1px 7px; border-radius: var(--fm-radius-full); background: rgb(32 57 104 / 10%); font: 700 12px/18px var(--fm-font); text-align: center; font-variant-numeric: tabular-nums; }
.kit-pill.is-active .kit-pill__count { background: rgb(255 255 255 / 22%); }

/* ---------- Filter extras ---------- */
.kit-pair__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.kit-pair__row > span { color: var(--fm-text-secondary); }
.kit-fb-err { margin-top: 8px; }
.kit-panel { padding: 16px 18px; }
/* Table alignment contract (every Admin table): a column's alignment lives on BOTH its <th> and its <td> through the same class, and the selector is as
   specific as the base '.fm-table th' rule so a numeric header can never fall back to left. Sort arrows sit before right-aligned labels, so the label's
   right edge is the column's right edge — exactly where the values end. */
.kit-num { text-align: right; font-variant-numeric: tabular-nums; }
.fm-table th.kit-num, .fm-table td.kit-num { text-align: right; font-variant-numeric: tabular-nums; }
.fm-table th .fm-th-btn { white-space: nowrap; }
.fm-table th.kit-num .fm-th-btn { justify-content: flex-end; }
.fm-table th.kit-num .fm-th-btn > span[aria-hidden='true'] { order: -1; }
.fm-table th.kit-num, .fm-table td.kit-num { min-width: 88px; }
.fm-table td.kit-num .tf-id { text-align: right; }
.kit-row--pending td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.kit-row--done td { color: var(--fm-text-secondary); }
.kit-row--done td strong, .kit-row--done .ux-user__name { color: inherit; }
.kit-cell-sub { margin: 0; font: 400 12.5px/18px var(--fm-font); color: var(--fm-text-secondary); }
.kit-cell-main { margin: 0; font: 600 14px/20px var(--fm-font); color: var(--fm-primary); }
.kit-link { all: unset; cursor: pointer; font: 600 14px/20px var(--fm-font); color: var(--fm-primary); border-radius: 4px; }
.kit-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.kit-link:focus-visible { outline: 2px solid var(--fm-primary); outline-offset: 2px; }
.kit-age { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/18px var(--fm-font); }
.kit-age--late { color: #92400e; font-weight: 600; }

/* ---------- Drawer building blocks ---------- */
.kit-section { display: grid; gap: 12px; }
.kit-section + .kit-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--ux-line); }
.kit-section__title { margin: 0; font: 600 11px/16px var(--fm-font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fm-text-secondary); }
.kit-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kit-lines { list-style: none; margin: 0; padding: 0; display: grid; }
.kit-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ux-line); font: 400 14px/20px var(--fm-font); }
.kit-lines li:last-child { border-bottom: 0; }
.kit-lines strong { font-variant-numeric: tabular-nums; }
.kit-lines .is-total { font-weight: 700; color: var(--fm-primary); }
.kit-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font: 400 13px/18px var(--fm-font); }
.kit-banner--amber { background: #fef3c7; color: #92400e; }
.kit-banner--green { background: var(--fm-accent-light); color: var(--fm-accent-text); }
.kit-banner--red { background: #fee2e2; color: #991b1b; }
.kit-banner--blue { background: #dbeafe; color: #1e40af; }
.kit-stepper { display: flex; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
.kit-stepper li { flex: 1; position: relative; text-align: center; font: 500 11.5px/16px var(--fm-font); color: var(--fm-text-secondary); padding-top: 22px; }
.kit-stepper li::before { content: ''; position: absolute; top: 5px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--fm-surface); border: 2px solid var(--fm-border); z-index: 1; }
.kit-stepper li::after { content: ''; position: absolute; top: 10px; left: calc(-50% + 6px); right: calc(50% + 6px); height: 2px; background: var(--fm-border); }
.kit-stepper li:first-child::after { display: none; }
.kit-stepper li.is-done { color: var(--fm-primary); }
.kit-stepper li.is-done::before { background: var(--fm-primary); border-color: var(--fm-primary); }
.kit-stepper li.is-done::after { background: var(--fm-primary); }
.kit-stepper li.is-now { color: var(--fm-primary); font-weight: 700; }
.kit-stepper li.is-now::before { background: var(--fm-accent); border-color: var(--fm-accent); box-shadow: 0 0 0 4px rgb(76 175 97 / 25%); }
.kit-stepper.is-cancelled li::before { border-color: #fecaca; background: #fee2e2; }

/* ---------- Image placeholders & picker ---------- */
.kit-tone-0 { background: linear-gradient(135deg, var(--fm-primary), var(--fm-primary-dark)); color: #fff; }
.kit-tone-1 { background: var(--fm-accent); color: var(--fm-text); }
.kit-tone-2 { background: rgb(32 57 104 / 10%); color: var(--fm-primary); }
.kit-tone-3 { background: var(--fm-accent-light); color: var(--fm-accent-text); }
.kit-image { display: grid; gap: 10px; }
.kit-image__ph { display: grid; place-items: center; gap: 6px; align-content: center; height: 150px; border-radius: 12px; border: 1px dashed rgb(32 57 104 / 35%); font: 500 13px/18px var(--fm-font); }
.kit-image__img { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; border: 1px solid var(--ux-line); }
.kit-image__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-image__btn { cursor: pointer; }
.fm-sr-only:focus-visible + .kit-image .kit-image__btn { outline: 2px solid var(--fm-primary); }

/* ---------- KYC document viewer ---------- */
.kyc-docs { display: flex; flex-wrap: wrap; gap: 8px; }
.kyc-viewer { border: 1px solid var(--ux-line); border-radius: 14px; background: var(--fm-background); overflow: hidden; }
.kyc-viewer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--fm-surface); border-bottom: 1px solid var(--ux-line); }
.kyc-viewer__zoom { display: inline-flex; align-items: center; gap: 4px; }
.kyc-viewer__level { min-width: 48px; text-align: center; font: 600 13px/20px var(--fm-font); font-variant-numeric: tabular-nums; }
.kyc-viewer__stage { height: 340px; overflow: auto; padding: 18px; display: grid; justify-items: center; align-items: start; }
.kyc-doc { width: 300px; flex: none; transform-origin: top center; transition: transform 0.2s ease; box-shadow: var(--dx-shadow); border-radius: 6px; background: #fff; }
.kyc-viewer__note { margin: 0; padding: 8px 12px; font: 400 12px/16px var(--fm-font); color: var(--fm-text-secondary); background: var(--fm-surface); border-top: 1px solid var(--ux-line); }
.kyc-icon-btn { all: unset; box-sizing: border-box; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; color: var(--fm-primary); transition: background-color 0.15s ease; }
.kyc-icon-btn:hover { background: var(--fm-background); }
.kyc-icon-btn:focus-visible { outline: 2px solid var(--fm-primary); }
.kyc-icon-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.kyc-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kyc-checklist label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 1px solid var(--ux-line); border-radius: 10px; font: 400 14px/20px var(--fm-font); cursor: pointer; }
.kyc-checklist input { width: 18px; height: 18px; accent-color: var(--fm-primary); }

/* ---------- Product & banner cards ---------- */
.pd-thumb { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; font: 700 15px/1 var(--fm-font); }
.pd-cell { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.pd-stock { min-width: 120px; }
.pd-stock__row { display: flex; justify-content: space-between; gap: 8px; font: 500 12.5px/16px var(--fm-font); margin-bottom: 4px; }
.pd-stock__bar { height: 6px; border-radius: 99px; background: rgb(32 57 104 / 8%); overflow: hidden; }
.pd-stock__fill { height: 100%; border-radius: inherit; background: var(--fm-accent-text); transition: width 0.4s ease; }
.pd-stock--low .pd-stock__fill { background: var(--fm-chart-4); }
.pd-stock--out .pd-stock__fill { background: var(--fm-error); }
.pd-hero { height: 180px; border-radius: 14px; display: grid; place-items: center; font: 700 44px/1 var(--fm-font); }
.pd-hero img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.bn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.bn-card { padding: 0; overflow: hidden; display: grid; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.bn-card:hover { transform: translateY(-3px); box-shadow: var(--dx-shadow-lg); }
.bn-preview { position: relative; aspect-ratio: 16 / 7; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; overflow: hidden; background-size: cover; background-position: center; }
.bn-preview__title { margin: 0; font: 700 20px/26px var(--fm-font); letter-spacing: -0.02em; }
.bn-preview__sub { margin: 0; font: 400 13px/18px var(--fm-font); opacity: 0.92; max-width: 34ch; }
.bn-preview__cta { align-self: flex-start; margin-top: 8px; padding: 5px 12px; border-radius: 99px; background: rgb(255 255 255 / 92%); color: var(--fm-primary); font: 700 12px/16px var(--fm-font); }
.bn-preview.kit-tone-1 .bn-preview__cta { background: var(--fm-primary); color: #fff; }
.bn-preview.is-off { filter: grayscale(0.7) opacity(0.8); }
.bn-body { padding: 14px 16px 16px; display: grid; gap: 10px; }
.bn-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 400 12.5px/18px var(--fm-font); color: var(--fm-text-secondary); }
.bn-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Support thread ---------- */
.tk-thread { display: grid; gap: 12px; }
.tk-msg { max-width: 92%; padding: 12px 14px; border-radius: 14px; font: 400 14px/20px var(--fm-font); }
.tk-msg--user { background: var(--fm-background); border: 1px solid var(--ux-line); border-top-left-radius: 4px; justify-self: start; }
.tk-msg--staff { background: rgb(32 57 104 / 8%); color: var(--fm-text); border-top-right-radius: 4px; justify-self: end; }
.tk-msg--note { background: #fef9e7; border: 1px dashed #e0b24a; justify-self: stretch; max-width: none; }
.tk-msg__meta { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 4px; font: 600 12px/16px var(--fm-font); color: var(--fm-text-secondary); }
.tk-msg p { margin: 0; }
.tk-composer { display: grid; gap: 10px; }
.tk-composer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- Charts ---------- */
.kit-chart { position: relative; display: grid; gap: 10px; }
.kit-chart__svg { width: 100%; height: auto; display: block; overflow: visible; }
.kit-chart__grid { stroke: var(--ux-line); stroke-dasharray: 3 5; }
.kit-chart__axis { fill: var(--fm-text-secondary); font: 400 11px var(--fm-font); }
.kit-chart__line { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.kit-chart__area { animation: dx-fade 0.9s ease 0.35s both; }
.kit-chart__dot { fill: #fff; stroke-width: 2.5; transition: r 0.15s ease; animation: dx-fade 0.5s ease 0.9s both; }
.kit-chart__guide { stroke: rgb(32 57 104 / 28%); stroke-dasharray: 3 4; }
.kit-chart__hit { fill: transparent; cursor: crosshair; outline: none; }
.kit-chart__hit:focus-visible { fill: rgb(32 57 104 / 6%); }
.kit-bar { cursor: pointer; outline: none; transform-box: fill-box; transform-origin: bottom; animation: kit-grow 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) calc(var(--i, 0) * 60ms) both; transition: opacity 0.15s ease; }
.kit-chart__svg:hover .kit-bar { opacity: 0.55; }
.kit-chart__svg .kit-bar:hover, .kit-chart__svg .kit-bar:focus { opacity: 1; }
.kit-bar:focus-visible { stroke: var(--fm-text); stroke-width: 2; }
.kit-tip { position: absolute; z-index: 6; pointer-events: none; min-width: 130px; padding: 9px 11px; border-radius: 10px; background: var(--fm-primary-dark); color: #fff; box-shadow: var(--fm-shadow-2); font: 400 12px/16px var(--fm-font); }
.kit-tip[hidden] { display: none; }
.kit-tip__title { margin: 0 0 4px; font: 700 12px/16px var(--fm-font); }
.kit-tip__row { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; }
.kit-tip__row strong { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.kit-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font: 500 12.5px/18px var(--fm-font); color: var(--fm-text-secondary); }
.kit-legend li { display: inline-flex; align-items: center; gap: 6px; }
.kit-legend__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.kit-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.kit-hbars__row { display: flex; justify-content: space-between; gap: 12px; font: 500 14px/20px var(--fm-font); }
.kit-hbars__row strong { font-variant-numeric: tabular-nums; }
.kit-hbars__label em { margin-left: 8px; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--fm-text-secondary); }
.kit-hbars__track { height: 8px; margin-top: 8px; border-radius: 99px; background: rgb(32 57 104 / 8%); overflow: hidden; }
.kit-hbars__fill { height: 100%; width: var(--w); border-radius: inherit; animation: dx-grow 0.9s cubic-bezier(0.22, 0.8, 0.3, 1) calc(var(--i, 0) * 90ms + 300ms) both; }
.kit-donut { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; justify-items: stretch; align-items: center; position: relative; }
.kit-donut__plot { position: relative; width: 200px; height: 200px; justify-self: center; }
.kit-donut__svg { width: 100%; height: 100%; overflow: visible; }
.kit-donut__track { fill: none; stroke: rgb(32 57 104 / 8%); stroke-width: 26; }
.kit-donut__seg { fill: none; stroke-width: 26; cursor: pointer; outline: none; transition: stroke-width 0.2s ease; animation: dx-fade 0.6s ease calc(var(--i, 0) * 100ms) both; }
.kit-donut__seg:hover, .kit-donut__seg:focus { stroke-width: 31; }
.kit-donut__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.kit-donut__ctitle { margin: 0; font: 500 12px/16px var(--fm-font); color: var(--fm-text-secondary); }
.kit-donut__cvalue { margin: 0; font: 700 22px/28px var(--fm-font); letter-spacing: -0.02em; color: var(--fm-primary); }
.kit-donut__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kit-donut__legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 44px; gap: 10px; align-items: center; font: 500 14px/20px var(--fm-font); }
.kit-donut__val { font-variant-numeric: tabular-nums; }
.kit-donut__pct { text-align: right; color: var(--fm-text-secondary); font-variant-numeric: tabular-nums; }
.kit-donut .kit-tip { left: 0; }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rp-grid--wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.rp-types { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Roles matrix ---------- */
.rl-roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.rl-role { appearance: none; text-align: left; font: inherit; cursor: pointer; display: grid; gap: 6px; padding: 16px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.rl-role:hover { transform: translateY(-2px); box-shadow: var(--dx-shadow-lg); }
.rl-role:focus-visible { outline: 2px solid var(--fm-primary); outline-offset: 2px; }
.rl-role.is-selected { box-shadow: inset 0 0 0 2px var(--fm-primary), var(--dx-shadow); }
.rl-role__name { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font: 700 16px/22px var(--fm-font); color: var(--fm-primary); }
.rl-role__desc { margin: 0; font: 400 13px/18px var(--fm-font); color: var(--fm-text-secondary); }
.rl-role__count { margin: 4px 0 0; font: 600 13px/18px var(--fm-font); font-variant-numeric: tabular-nums; }
.rl-lock { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: rgb(32 57 104 / 8%); color: var(--fm-primary); font: 600 11px/16px var(--fm-font); }
.rl-wrap { max-height: 620px; overflow: auto; border-radius: 0 0 16px 16px; }
.rl-table { width: 100%; border-collapse: separate; border-spacing: 0; font: var(--fm-text-body); }
.rl-table thead th { position: sticky; top: 0; z-index: 3; background: var(--fm-surface); padding: 12px 14px; text-align: center; font: 600 12px/16px var(--fm-font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fm-text-secondary); border-bottom: 1px solid var(--ux-line); }
.rl-table thead th:first-child, .rl-table tbody th { position: sticky; left: 0; z-index: 2; background: var(--fm-surface); text-align: left; }
.rl-table thead th:first-child { z-index: 4; }
.rl-table tbody th { padding: 0 14px; min-width: 220px; font: 500 14px/20px var(--fm-font); border-bottom: 1px solid var(--ux-line); }
.rl-table td { text-align: center; border-bottom: 1px solid var(--ux-line); padding: 0; }
.rl-table tbody tr:hover > * { background: rgb(32 57 104 / 3.5%); }
.rl-table .is-col-selected { background: rgb(76 175 97 / 8%); }
.rl-table tbody tr:hover > .is-col-selected { background: rgb(76 175 97 / 12%); }
.rl-group th { position: sticky; left: 0; background: var(--fm-background) !important; padding: 10px 14px !important; font: 700 11px/16px var(--fm-font) !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fm-primary) !important; }
.rl-group td { background: var(--fm-background); }

/* ---------- Switch ---------- */
.fm-switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.fm-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fm-switch__track { position: relative; width: 44px; height: 26px; flex: none; border-radius: 99px; background: #cbd2dc; transition: background-color 0.2s ease; }
.fm-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform 0.2s cubic-bezier(0.22, 0.8, 0.3, 1); }
.fm-switch input:checked + .fm-switch__track { background: var(--fm-primary); }
.fm-switch input:checked + .fm-switch__track::after { transform: translateX(18px); }
.fm-switch input:focus-visible + .fm-switch__track { outline: 2px solid var(--fm-primary); outline-offset: 2px; box-shadow: var(--fm-focus-ring); }
.fm-switch input:disabled + .fm-switch__track { opacity: 0.5; cursor: not-allowed; }

/* ---------- Settings ---------- */
.st-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.st-nav { display: grid; gap: 4px; padding: 10px; position: sticky; top: 92px; }
.st-nav__item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font: 500 14px/20px var(--fm-font); color: var(--fm-text); transition: background-color 0.2s ease, color 0.2s ease; }
.st-nav__item:hover { background: var(--fm-background); }
.st-nav__item[aria-selected='true'] { background: rgb(32 57 104 / 8%); color: var(--fm-primary); font-weight: 600; }
.st-nav__item:focus-visible { outline: 2px solid var(--fm-primary); }
.st-card { padding: 4px 22px; }
.st-head { padding: 18px 0 4px; }
.st-head h3 { margin: 0; font: 700 18px/24px var(--fm-font); color: var(--fm-primary); }
.st-head p { margin: 2px 0 0; font: 400 13px/18px var(--fm-font); color: var(--fm-text-secondary); }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 28px; align-items: start; padding: 18px 0; border-top: 1px solid var(--ux-line); }
.st-row:first-of-type { margin-top: 12px; }
.st-row__label { margin: 0; font: 600 14px/20px var(--fm-font); }
.st-row__desc { margin: 2px 0 0; font: 400 13px/18px var(--fm-font); color: var(--fm-text-secondary); }
.st-row__ctl { display: grid; gap: 6px; align-content: start; }
.st-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 0; margin-top: 4px; background: linear-gradient(180deg, transparent, var(--fm-surface) 30%); border-top: 1px solid var(--ux-line); }
.st-foot__note { margin-left: auto; font: 400 12.5px/18px var(--fm-font); color: var(--fm-text-secondary); }
.st-integration { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Audit timeline ---------- */
.au-day { margin: 0 0 10px; font: 700 12px/16px var(--fm-font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fm-text-secondary); }
.au-feed { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 0; }
.au-feed li { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 12px 0 12px 22px; border-bottom: 1px solid var(--ux-line); }
.au-feed li::before { content: ''; position: absolute; left: 0; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--fm-primary); }
.au-time { font: 600 13px/20px var(--fm-font); color: var(--fm-text-secondary); font-variant-numeric: tabular-nums; }
.au-line { margin: 0; font: 500 14px/20px var(--fm-font); }
.au-sub { margin: 2px 0 0; font: 400 12.5px/18px var(--fm-font); color: var(--fm-text-secondary); }
.au-card { padding: 18px 22px; }

/* ---------- Component gallery ---------- */
.gl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.gl-card { display: flex; flex-direction: column; gap: 20px; padding: 24px; min-width: 0; }
.gl-card__head { display: grid; gap: 4px; }
.gl-card__title { margin: 0; font: 700 16px/24px var(--fm-font); color: var(--fm-primary); }
.gl-card__sub { margin: 0; font: 400 13px/20px var(--fm-font); color: var(--fm-text-secondary); }
.gl-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; min-width: 0; }
.gl-row .fm-btn { min-height: 44px; }
.gl-row .fm-btn.fm-btn--sm { min-height: 36px; }
.gl-row .fm-check, .gl-row .fm-switch { min-height: 44px; }
.gl-stack { display: grid; gap: 12px; min-width: 0; }
.gl-full { grid-column: 1 / -1; min-width: 0; }
.gl-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 20px 16px; }
.gl-swatch { display: grid; gap: 2px; align-content: start; min-width: 0; font: 600 13px/18px var(--fm-font); color: var(--fm-text); }
.gl-swatch span:last-child { font: 400 12px/16px var(--fm-font); color: var(--fm-text-secondary); overflow-wrap: anywhere; }
.gl-swatch__chip { display: block; height: 44px; margin-bottom: 8px; border-radius: 10px; border: 1px solid var(--ux-line); }
.gl-type { display: grid; gap: 12px; }
.gl-type > * { margin: 0; }
.gl-type h1 { font: 700 28px/36px var(--fm-font); color: var(--fm-primary); }
.gl-type h2 { font: 700 22px/30px var(--fm-font); color: var(--fm-primary); }
.gl-type h3 { font: 700 18px/26px var(--fm-font); color: var(--fm-primary); }
.gl-type p { font: 400 14px/22px var(--fm-font); }
.gl-card .fm-form { gap: 16px 20px; }
.gl-card .ux-tabs, .gl-card .fm-tabs { margin: 0; }
.gl-card .dx-list, .gl-card .fm-empty { margin: 0; }
@keyframes kit-grow { from { transform: scaleY(0); } }

/* Print / "Save as PDF": only the report content */
@media print {
  .sidebar, .header, .scrim, .ux-tools, .kit-head__actions, .kit-pills, .fm-toasts, .ux-foot, .kit-noprint { display: none !important; }
  html, body { background: #fff !important; height: auto !important; }
  .shell, .main { display: block !important; background: #fff !important; min-height: 0 !important; height: auto !important; } /* .shell is min-height:100vh on screen; in print that forced an extra blank page */
  .content, .kit-stack { background: #fff !important; min-height: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .dx-card { box-shadow: none !important; border: 1px solid #d5dae3 !important; break-inside: avoid; }
  .kit-bar, .kit-hbars__fill, .kit-chart__area, .kit-donut__seg { animation: none !important; }
}

@media (max-width: 1180px) {
  .rl-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-grid--wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .kit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-grid { grid-template-columns: minmax(0, 1fr); }
  .gl-grid { grid-template-columns: minmax(0, 1fr); }
  .st-layout { grid-template-columns: minmax(0, 1fr); }
  .st-nav { position: static; display: flex; overflow-x: auto; }
  .st-nav__item { white-space: nowrap; }
}
@media (max-width: 639px) {
  .kit-head { align-items: stretch; }
  .kit-head__actions .fm-btn { flex: 1 1 auto; }
  .kit-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-row { grid-template-columns: minmax(0, 1fr); }
  .st-card { padding: 4px 16px; }
  .kit-donut { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .kit-donut__legend { width: 100%; }
  .rl-roles { grid-template-columns: minmax(0, 1fr); }
  .kyc-viewer__stage { height: 260px; }
  .bn-grid { grid-template-columns: minmax(0, 1fr); }
  .au-feed li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .kit-bar, .kit-hbars__fill, .kit-chart__area, .kit-chart__dot, .kit-donut__seg { animation: none; }
  .bn-card:hover, .rl-role:hover { transform: none; }
}

/* Settings rows: the row heading already names the control, so the field label is read by screen readers only */
.st-row__ctl .fm-field > label:first-child { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.st-row__ctl .fm-field { margin: 0; position: relative; }


.kit-stack > * { min-width: 0; }

/* Demo role switch in the header */
.header__role { width: auto; min-height: 36px; padding-block: 4px; margin-right: 8px; font-size: 13px; max-width: 160px; }
@media (max-width: 639px) { .header__role { max-width: 110px; font-size: 12px; margin-right: 4px; } }

/* Payments & Settlements */
button.dx-item { width: 100%; border: 0; background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ux-pill svg { vertical-align: -2px; margin-right: 6px; }
.fm-input[type='file'] { padding: 7px 10px; line-height: 28px; height: auto; min-height: 44px; }

/* Dashboard KPI cards are links (full-surface, keyboard operable) */
.dx-kpi--link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.dx-kpi--link:focus-visible { outline: none; box-shadow: var(--fm-focus-ring), var(--dx-shadow-lg); }
.dx-kpi--link:active { transform: translateY(-1px); }
.dx-kpi__cta { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font: 600 12.5px/16px var(--fm-font); color: var(--fm-accent-text); }
.dx-kpi__cta svg { transition: transform 0.18s ease; }
.dx-kpi--link:hover .dx-kpi__cta svg, .dx-kpi--link:focus-visible .dx-kpi__cta svg { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) { .dx-kpi__cta svg { transition: none; } }

/* Revenue breakdown tiles */
.rev-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.rev-tile { border-top: 3px solid var(--ux-line); }
.rev-tile--green { border-top-color: var(--fm-accent); } .rev-tile--amber { border-top-color: var(--fm-warning); } .rev-tile--navy { border-top-color: var(--fm-primary); } .rev-tile--blue { border-top-color: var(--fm-info); } .rev-tile--red { border-top-color: var(--fm-error); }
@media (max-width: 1100px) { .rev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .rev-grid { grid-template-columns: minmax(0, 1fr); } }

/* Catalogue import wizard */
.fm-modal__footer:empty { display: none; }
.iw { display: grid; gap: 16px; min-width: 0; }
.iw-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.iw-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgb(32 57 104 / 5%); font: 600 13px/18px var(--fm-font); color: var(--fm-text-secondary); min-width: 0; }
.iw-steps li.is-current { background: var(--fm-primary); color: #fff; }
.iw-steps li.is-done { background: var(--fm-accent-light); color: var(--fm-accent-text); }
.iw-steps__n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / 22%); font-size: 12px; }
.iw-steps li:not(.is-current) .iw-steps__n { background: rgb(32 57 104 / 12%); }
.iw-steps__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iw-body { display: grid; gap: 14px; max-height: min(58vh, 560px); overflow: auto; padding-right: 2px; min-width: 0; }
.iw-drop { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; border: 2px dashed var(--fm-border-strong, #b6c0d1); border-radius: 14px; background: rgb(32 57 104 / 3%); color: var(--fm-primary); cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease; }
.iw-drop:hover, .iw-drop.is-over, input:focus-visible + .iw-drop { background: var(--fm-accent-light); border-color: var(--fm-accent); }
.iw-drop span { color: var(--fm-text-secondary); font-size: 14px; } .iw-drop small { color: var(--fm-text-secondary); font-size: 12.5px; max-width: 46ch; }
.iw-file { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--ux-line); border-radius: 12px; color: var(--fm-accent-text); }
.iw-file__name { margin: 0; font: 700 14px/20px var(--fm-font); color: var(--fm-text); word-break: break-all; } .iw-file p { margin: 0; }
.iw-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.iw-tile--green { border-top: 3px solid var(--fm-accent); } .iw-tile--amber { border-top: 3px solid var(--fm-warning); } .iw-tile--red { border-top: 3px solid var(--fm-error); }
.iw-issues-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; } .iw-issues-head h3 { margin: 0; font: 700 15px/22px var(--fm-font); color: var(--fm-primary); }
.iw-issues { max-height: 240px; overflow: auto; border: 1px solid var(--ux-line); border-radius: 10px; }
.iw-h { margin: 4px 0 0; font: 700 15px/22px var(--fm-font); color: var(--fm-primary); }
.iw-options { display: grid; gap: 10px; }
.iw-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--ux-line); border-radius: 12px; cursor: pointer; transition: border-color 0.18s ease, background 0.18s ease; }
.iw-option:hover { border-color: var(--fm-primary); } .iw-option.is-checked { border-color: var(--fm-primary); background: rgb(32 57 104 / 4%); }
.iw-option input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--fm-primary); flex: none; }
.iw-option strong { display: block; font: 600 14px/20px var(--fm-font); } .iw-option small { display: block; margin-top: 2px; color: var(--fm-text-secondary); font: 400 13px/18px var(--fm-font); }
.iw-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .iw-rules li { display: flex; gap: 8px; align-items: flex-start; font: 400 14px/20px var(--fm-font); } .iw-rules svg { flex: none; margin-top: 2px; color: var(--fm-accent-text); }
.iw-sum { border: 1px solid var(--ux-line); border-radius: 12px; overflow: hidden; }
.iw-sum__row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--ux-line); font: 400 14px/20px var(--fm-font); } .iw-sum__row:last-child { border-bottom: 0; } .iw-sum__row strong { text-align: right; }
.iw-confirm { display: flex; gap: 10px; align-items: flex-start; font: 500 14px/20px var(--fm-font); }
.iw-stage { margin: 24px 0 8px; font: 600 15px/22px var(--fm-font); color: var(--fm-primary); }
.iw-bar { height: 10px; border-radius: 999px; background: rgb(32 57 104 / 10%); overflow: hidden; margin-bottom: 24px; } .iw-bar__fill { height: 100%; background: var(--fm-accent); transition: width 0.25s ease; }
.iw-footer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--ux-line); } .iw-footer__gap { flex: 1; }
.kit-banner--green { background: var(--fm-accent-light); color: var(--fm-accent-text); border-color: transparent; } .kit-banner--red { background: #fdecea; color: #8f1d12; }
@media (max-width: 700px) { .iw-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .iw-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .iw-body { max-height: 52vh; } }
@media (prefers-reduced-motion: reduce) { .iw-bar__fill, .iw-drop, .iw-option { transition: none; } }

/* wizard sizing: wider dialog, content may never push the dialog wider (tables scroll inside) */
.fm-modal:has(.iw) { max-width: 860px; }
.fm-modal__body:has(.iw) { grid-template-columns: minmax(0, 1fr); }
.iw, .iw-body { grid-template-columns: minmax(0, 1fr); }
.iw-body > * { min-width: 0; }
.iw-body .fm-table-wrap, .iw-body .fm-table, .iw-body table { max-width: 100%; }
.iw-body .fm-table-wrap, .iw-body .fm-card, .iw-issues { overflow: auto; }
.iw-tiles .ux-tile { min-width: 0; }
.iw-issues td:last-child { white-space: normal; min-width: 260px; }

/* Admin action feedback: one toast component, top-right, above drawers and modals */
.fm-toasts { top: 84px; bottom: auto; right: 24px; z-index: 600; max-width: min(420px, calc(100vw - 32px)); }
.fm-toast { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; box-shadow: 0 10px 30px rgb(0 0 0 / 22%); }
.fm-toast { cursor: pointer; }
.fm-toast::after { content: "×"; margin-left: auto; font-size: 20px; line-height: 1; padding: 0 4px; opacity: .75; }
.fm-toast:hover::after, .fm-toast:focus-visible::after { opacity: 1; }
@media print { .fm-toasts { display: none !important; } }

/* Notification Center */
.ncen-grid{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:var(--fm-space-5,20px);align-items:start}
@media (max-width:900px){.ncen-grid{grid-template-columns:1fr}}
.ncen-pick{max-height:260px;overflow:auto;border:1px solid var(--fm-border,#e5e7eb);border-radius:var(--fm-radius-md,10px);padding:8px}
.ncen-pick__row{display:flex;gap:10px;align-items:center;min-height:44px;padding:4px 6px;cursor:pointer}
.ncen-recips,.ncen-inbox{list-style:none;margin:0;padding:0;display:grid;gap:8px;max-height:360px;overflow:auto}
.ncen-preview h4{margin:8px 0 4px}
.ux-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ux-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (max-width:600px){.ux-grid2{grid-template-columns:1fr}}

/* Reusable State / City / PIN selector */
.loc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.loc-cell { min-width: 0; }
@media (max-width: 720px) { .loc-grid { grid-template-columns: 1fr; } }