:root {
  --navy: #071a52;
  --blue: #1746d1;
  --blue-soft: #edf3ff;
  --ink: #172033;
  --muted: #687386;
  --line: #e2e7ef;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --green: #138a5b;
  --red: #c43e3e;
  --shadow: 0 8px 28px rgba(26, 43, 79, .07);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { color: white; background: linear-gradient(115deg, #06133f, #092d83); border-bottom: 3px solid #2f68ff; }
.topbar-inner, main { width: min(1380px, calc(100% - 40px)); margin: auto; }
.topbar-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand, .user-area, .panel-heading, .welcome { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: white; color: var(--blue); font-weight: 900; font-size: 22px; }
.brand-refresh { flex: 0 0 42px; padding: 0; border: 0; box-shadow: none; line-height: 1; -webkit-tap-highlight-color: transparent; }
.brand-refresh:hover { background: #eef4ff; }
.brand-refresh:active { transform: scale(.96); }
.brand-refresh:focus-visible { outline: 3px solid #8fb0ff; outline-offset: 3px; }
h1 { margin: 1px 0 0; font-size: 20px; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: #aebfe9; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.blue { color: var(--blue); }
.user-area { gap: 10px; font-size: 13px; }
.user-area div { display: grid; }
.user-area small { color: #b9c7e8; margin-top: 2px; }
.payment-page-actions { display: flex; align-items: center; gap: 10px; }
.notification-bell { position: relative; display: inline-grid; width: 48px; height: 48px; place-items: center; border: 1px solid #b9c9eb; border-radius: 8px; background: white; color: var(--blue); font-size: 20px; cursor: pointer; }
.notification-bell:hover { background: #f1f5ff; }
.notification-badge { min-width: 19px; height: 19px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 10px; background: #e5484d; color: white; font-size: 10px; font-weight: 850; }
.notification-bell .notification-badge { position: absolute; top: -7px; right: -7px; }
.tab-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 5px; padding: 0 5px; border-radius: 10px; background: #e5484d; color: white; font-size: 10px; }
.notification-center-rows { max-height: 62vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.notification-center-item { width: 100%; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 16px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: white; text-align: left; cursor: pointer; }
.notification-center-item:last-child { border-bottom: 0; }
.notification-center-item:hover { background: #f7f9fd; }
.notification-center-item.unread { box-shadow: inset 3px 0 var(--blue); background: #f2f6ff; }
.notification-kind { display: inline-flex; justify-content: center; padding: 5px 8px; border-radius: 999px; background: #fff1c9; color: #8a5a00; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.notification-kind.danger { background: #ffe1e1; color: #b42323; }
.notification-kind.action { background: #dfeaff; color: var(--blue); }
.notification-copy { display: grid; gap: 3px; min-width: 0; }
.notification-copy small { color: var(--muted); }
.notification-copy p { margin: 3px 0 0; color: #526079; line-height: 1.45; }
.notification-center-item > b { color: var(--ink); white-space: nowrap; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #55d79b; box-shadow: 0 0 0 4px rgba(85, 215, 155, .14); }
.outline { border: 1px solid rgba(255,255,255,.35); color: white; background: transparent; border-radius: 8px; padding: 8px 12px; margin-left: 8px; }
.app-switch-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.app-switch-link::before { content: "\2190"; margin-right: 6px; font-weight: 900; }
.outline.dark { color: var(--blue); border-color: #b9c9f1; }
main { padding: 30px 0 60px; }
.welcome { justify-content: space-between; margin-bottom: 22px; }
.welcome h2 { margin: 4px 0; font-size: 28px; letter-spacing: -.03em; }
.welcome p:not(.eyebrow) { margin: 0; color: var(--muted); }
.period-pill, .badge { border: 1px solid #d7e1f7; background: #fff; color: #52627b; border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.period-pill span { color: var(--green); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.filters { display: grid; grid-template-columns: repeat(5, 1fr) auto; align-items: end; gap: 12px; padding: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 11px; font-weight: 750; color: #526079; }
select, input[type="date"] { width: 100%; padding: 10px 11px; border: 1px solid #ccd5e2; border-radius: 8px; color: var(--ink); background: white; }
.primary, .file-button { border: 0; border-radius: 8px; padding: 11px 18px; color: white; background: linear-gradient(135deg, #1646cf, #0b2f96); font-weight: 700; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 14px 0 18px; }
.kpi { min-height: 116px; padding: 18px; display: flex; align-items: center; gap: 13px; }
.kpi-icon { flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 900; }
.kpi-icon.grand { color: #7c3aed; background: #f2edff; }
.kpi-icon.bills { color: #b66b00; background: #fff5df; }
.kpi-icon.traffic { color: #00848d; background: #e4f8f7; }
.kpi-icon.basket { color: #b52b57; background: #ffedf3; }
.kpi div { min-width: 0; display: grid; }
.kpi small { color: var(--muted); font-weight: 650; }
.kpi strong { margin: 4px 0 3px; font-size: clamp(18px, 1.55vw, 24px); letter-spacing: -.04em; white-space: nowrap; }
.kpi em { color: var(--green); font-size: 11px; font-style: normal; }
.kpi em span { display: block; line-height: 1.35; }
.kpi em .run-rate { font-weight: 800; }
.kpi em.negative { color: var(--red); }
.owner-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.owner-card { min-height: 170px; padding: 18px; }
.owner-card .panel-heading { margin-bottom: 10px; }
.target-card > strong { display: block; margin: 6px 0 10px; font-size: 21px; letter-spacing: -.03em; }
.target-card p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.target-run-rate { margin: -4px 0 10px; color: var(--green); font-size: 12px; font-weight: 850; }
.target-run-rate.negative { color: var(--red); }
.branch-run-rates { display: grid; gap: 6px; margin-top: 12px; max-height: 116px; overflow-y: auto; padding-right: 4px; }
.branch-run-rates div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.branch-run-rates span { min-width: 0; color: var(--muted); font-size: 11px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-run-rates strong { display: grid; justify-items: end; color: var(--green); font-size: 12px; line-height: 1.2; text-align: right; }
.branch-run-rates strong em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 750; white-space: nowrap; }
.branch-run-rates .negative strong { color: var(--red); }
.action-list { display: grid; gap: 8px; max-height: 178px; overflow-y: auto; padding-right: 4px; }
.action-item { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.action-item > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.action-item strong { min-width: 0; color: var(--ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-item b { color: var(--green); font-size: 12px; }
.action-item b.negative { color: var(--red); }
.action-item span { color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.3; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e8edf6; }
.progress-track span { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #1646cf, #16a085); transition: width .25s ease; }
.compact-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.compact-list li { padding: 8px 9px; border-left: 3px solid #e0a11b; border-radius: 7px; color: #3d465a; background: #fff9e9; font-size: 12px; line-height: 1.35; }
.ranking-list, .calendar-list { display: grid; gap: 8px; }
.calendar-list { max-height: 246px; overflow-y: auto; padding-right: 4px; }
.ranking-list div, .calendar-list div { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ranking-list span, .calendar-list em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.ranking-list strong, .calendar-list span { color: var(--ink); font-size: 12px; }
.ranking-list em, .calendar-list strong { color: var(--blue); font-size: 11px; font-style: normal; font-weight: 850; }
.bar-target-marker { stroke: #d93535; stroke-width: 2; stroke-dasharray: 5 4; }
.bar-target-label { fill: #b32626 !important; font-size: 9px !important; font-weight: 900; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.pie-slice { cursor: pointer; stroke: #fff; stroke-width: 2; }
.planning-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.planning-card { padding: 20px; }
.suggestion-list { display: grid; gap: 10px; margin-top: 14px; }
.suggestion-item { display: grid; gap: 9px; padding: 12px; border: 1px solid #d7e1f7; border-radius: 10px; background: #f8fbff; }
.suggestion-item > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.suggestion-item strong { color: var(--ink); font-size: 13px; }
.suggestion-item span { color: var(--muted); font-size: 11px; }
.suggestion-item dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.suggestion-item dt { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.suggestion-item dd { margin: 2px 0 0; color: var(--ink); font-size: 12px; font-weight: 800; }
.target-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.target-option-grid section { display: grid; gap: 7px; padding: 10px; border: 1px solid #dfe7f5; border-radius: 8px; background: white; }
.target-option-grid b { color: var(--blue); font-size: 12px; }
.target-option-grid small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid #d7deea; }
.tab { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 11px 16px; font-weight: 700; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.page { display: none; }
.page.active { display: block; }
.content-grid { display: grid; grid-template-columns: 1.72fr .8fr; gap: 14px; margin-bottom: 14px; }
.content-grid.equal { grid-template-columns: 1fr 1fr; }
.chart-panel, .insights, .page > .panel { padding: 20px; }
.panel-heading { justify-content: space-between; gap: 16px; margin-bottom: 15px; }
h3 { margin: 3px 0 0; font-size: 16px; }
.legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.legend i:nth-child(2) { background: #aebbd4; margin-left: 6px; }
.chart-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.seg { border: 1px solid #ccd5e2; border-radius: 7px; padding: 6px 10px; color: #526079; background: white; font-size: 11px; font-weight: 800; }
.seg.active { color: white; border-color: #1646cf; background: #1646cf; }
.badge { color: #8a5a00; background: #fff8e8; border-color: #f4dfad; }
.chart { min-height: 286px; position: relative; }
.chart.large { min-height: 350px; }
.chart svg { width: 100%; height: 286px; display: block; overflow: visible; }
.chart.large svg { height: 350px; }
.chart text { fill: #748096; font-size: 11px; }
.gridline { stroke: #e8ecf3; stroke-width: 1; }
.latest-line { fill: none; stroke: var(--blue); stroke-width: 3; }
.previous-line { fill: none; stroke: #aebbd4; stroke-width: 2; stroke-dasharray: 5 5; }
.target-line { fill: none; stroke: #d93535; stroke-width: 2.4; stroke-dasharray: 7 5; }
.target-label { fill: #b32626 !important; font-size: 10px !important; font-weight: 900; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.series-line { fill: none; stroke-width: 2.5; }
.series-line.average { stroke: #9aa8bf; stroke-width: 2; stroke-dasharray: 6 5; }
.point { fill: white; stroke: var(--blue); stroke-width: 3; }
.previous-point { fill: white; stroke: #aebbd4; stroke-width: 2; }
.series-point { fill: white; stroke-width: 2.5; }
.point-label { fill: #10214c !important; font-size: 10px !important; font-weight: 800; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.point-label.previous { fill: #7e8ba2 !important; }
.series-label { font-size: 10px !important; font-weight: 800; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.series-value-label { font-size: 9px !important; font-weight: 800; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.hit-point { fill: transparent; stroke: transparent; cursor: pointer; pointer-events: all; }
.chart-tooltip { position: absolute; z-index: 5; width: 206px; padding: 10px 11px; color: white; background: #10214c; border-radius: 8px; box-shadow: 0 14px 32px rgba(16,33,76,.24); font-size: 11px; pointer-events: none; }
.chart-tooltip strong, .chart-tooltip span, .chart-tooltip code { display: block; }
.chart-tooltip strong { font-size: 13px; margin-bottom: 3px; }
.chart-tooltip span { color: #c7d4f4; margin-bottom: 6px; }
.chart-tooltip code { white-space: normal; word-break: break-word; color: #eaf0ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.35; }
.bar { fill: #2c57d5; rx: 5; }
.bar.alt { fill: #7d9bea; }
.hit-bar { fill: transparent; stroke: transparent; cursor: pointer; pointer-events: all; }
.line-toggles { max-width: 520px; }
.line-toggles .seg { border-left-width: 5px; }
.insights ul { margin: 4px 0 18px; padding: 0; list-style: none; }
.insights li { padding: 12px 0 12px 25px; border-bottom: 1px solid var(--line); position: relative; font-size: 13px; line-height: 1.45; }
.insights li::before { content: "↗"; position: absolute; left: 0; top: 12px; color: var(--blue); font-weight: 900; }
.coming-soon { display: grid; gap: 4px; padding: 13px; border-radius: 10px; color: #465676; background: var(--blue-soft); font-size: 12px; }
.coming-soon strong { color: var(--blue); }
.assistant-box { display: grid; gap: 10px; padding: 13px; border-radius: 10px; background: var(--blue-soft); }
.assistant-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assistant-head div { display: grid; gap: 2px; }
.assistant-head strong { color: var(--blue); font-size: 13px; }
.assistant-head span:not(.badge) { color: #526079; font-size: 11px; }
.ai-badge { padding: 5px 8px; font-size: 10px; }
.quick-prompts { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-prompts button { border: 1px solid #c9d8f6; border-radius: 7px; padding: 6px 8px; color: #1746d1; background: white; font-size: 11px; font-weight: 750; }
.assistant-answer { min-height: 96px; max-height: 220px; overflow: auto; padding: 11px; border: 1px solid #d6e2fb; border-radius: 8px; color: #26354f; background: white; font-size: 12px; line-height: 1.45; white-space: pre-wrap; }
.assistant-answer.error { color: var(--red); border-color: #f3bbbb; background: #fff7f7; }
.target-opinion { margin-top: 10px; }
.assistant-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.assistant-input textarea { width: 100%; resize: vertical; min-height: 42px; max-height: 120px; padding: 9px 10px; border: 1px solid #ccd5e2; border-radius: 8px; color: var(--ink); background: white; }
.assistant-input .primary { padding-inline: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); background: #f7f9fc; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
td:nth-child(n+2), th:nth-child(n+2) { text-align: right; }
.upload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.upload-card { min-height: 250px; padding: 26px; display: flex; flex-direction: column; align-items: flex-start; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); border-radius: 13px; font-weight: 900; }
.upload-card h3 { margin-top: 20px; }
.upload-card p { max-width: 480px; color: var(--muted); line-height: 1.5; }
.file-button { display: inline-block; margin-top: auto; cursor: pointer; }
.file-button input { display: none; }
.file-status { margin-top: 10px; color: var(--muted); }
.file-status.error { color: var(--red); }
.upload-preview { width: 100%; margin: 16px 0; padding: 14px; border: 1px solid #c9d8f6; border-radius: 10px; background: var(--blue-soft); }
.upload-preview dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.upload-preview dl div { display: grid; gap: 2px; }
.upload-preview dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.upload-preview dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 750; }
.validation-success { margin: 12px 0 0 !important; color: var(--green) !important; font-size: 12px; }
.upload-card .primary { margin-top: 2px; }
.upload-card .primary:disabled { cursor: wait; opacity: .65; }
.import-history-card { align-items: stretch; }
.import-history { width: 100%; display: grid; gap: 8px; margin-top: 8px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.import-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.import-item > div { display: grid; gap: 3px; min-width: 0; }
.import-item > div:last-child { justify-items: end; white-space: nowrap; }
.import-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.import-item span, .empty-state { color: var(--muted); }
.import-item b { padding: 3px 7px; border-radius: 999px; font-size: 9px; text-transform: uppercase; }
.status-completed { color: #08734a; background: #dff7ec; }
.status-processing { color: #795713; background: #fff3cf; }
.status-failed { color: var(--red); background: #fee7e7; }
.status-rolled_back { color: #526079; background: #eef2f7; }
.coverage-summary { width: 100%; display: grid; gap: 12px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.coverage-group { display: grid; gap: 6px; }
.coverage-group h4 { margin: 0; font-size: 10px; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; }
.coverage-group p { margin: 0; color: var(--muted); font-size: 12px; }
.month-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.month-chip { display: inline-grid; gap: 1px; padding: 6px 9px; border: 1px solid #c9d7f2; border-radius: 8px; background: white; color: var(--ink); font-size: 12px; font-weight: 850; }
.month-chip em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 750; }
.empty-state { padding: 24px 0; text-align: center; font-size: 12px; }
.notice { margin-top: 14px; padding: 14px 16px; border: 1px solid #f0d89d; color: #795713; background: #fff9e9; border-radius: 10px; font-size: 13px; }
.staff-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: 14px; margin-bottom: 14px; }
.staff-card { padding: 20px; }
.staff-history-wrap { max-height: 360px; overflow-y: auto; }
.staff-form { display: grid; gap: 12px; }
.staff-form .primary { margin-top: 4px; }
.access-layout { grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.28fr); }
.access-table-wrap { max-height: 440px; overflow-y: auto; }
.form-status { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-status.error { color: var(--red); }
.inline-select { min-width: 120px; padding: 7px 9px; font-size: 12px; }
.access-status { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.access-status.active { color: #08734a; background: #dff7ec; }
.access-status.inactive { color: #795713; background: #fff3cf; }
.danger-link { color: var(--red); }
td strong, td small { display: block; }
td small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.link-button { border: 0; padding: 4px 6px; color: var(--blue); background: transparent; font-size: 11px; font-weight: 800; }
.link-button.danger { color: var(--red); }
.document-preview-row td { padding: 0 12px 14px; white-space: normal; background: #fbfcff; }
.payment-document-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: white; }
.payment-document-list { display: grid; gap: 12px; margin-bottom: 8px; }
.payment-document-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.payment-document-preview-header strong, .payment-document-preview-header small { display: block; }
.payment-document-preview-header small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.payment-document-preview-header > div:last-child { display: flex; align-items: center; gap: 4px; }
.payment-document-frame { display: block; width: 100%; height: 540px; border: 0; background: #f4f6fa; }
.payment-document-image { display: block; width: auto; max-width: 100%; max-height: 640px; margin: 0 auto; object-fit: contain; background: #f4f6fa; }
.approval-view-tabs { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #f4f7fb; }
.approval-view-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.approval-view-tabs button.active { background: white; color: var(--blue); box-shadow: 0 1px 3px rgb(15 38 87 / 12%); }
.approval-view-tabs span { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: #e7edf8; color: inherit; font-size: 11px; text-align: center; }
@media (max-width: 720px) {
  .approval-view-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .approval-view-tabs button { justify-content: center; min-width: 0; }
}
.petty-cash-receipt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #f7f9fc; }
.petty-cash-document-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 0 0 6px 6px; background: #f7f9fc; }
.petty-cash-document-card { min-width: 0; align-self: start; }
.petty-cash-document-card .payment-document-frame { height: 440px; }
.petty-cash-document-card .payment-document-image { width: 100%; height: 440px; object-fit: contain; }
@media (max-width: 720px) {
  .petty-cash-document-gallery { grid-template-columns: 1fr; padding: 8px; }
  .petty-cash-document-card .payment-document-frame,
  .petty-cash-document-card .payment-document-image { height: 360px; }
}
.access-picker { display: grid; gap: 9px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.access-picker legend { padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.access-picker label, .app-access-controls label { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.app-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.app-badge { display: inline-flex; padding: 4px 7px; border-radius: 6px; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.app-badge.finance { color: #1648c8; background: #e9f0ff; }
.app-badge.payments { color: #087469; background: #ddf7f2; }
.app-access-controls { display: grid; gap: 5px; min-width: 96px; text-align: left; }
.chooser-screen { min-height: 100vh; padding: 42px 24px; background: #f4f7fc; }
.chooser-inner { width: min(1040px, 100%); margin: 0 auto; }
.chooser-heading { display: flex; align-items: center; justify-content: space-between; }
.chooser-heading .brand { color: var(--ink); }
.chooser-copy { margin: 86px 0 28px; }
.chooser-copy h2 { margin: 8px 0; font-size: 42px; }
.chooser-copy > p:last-child { color: var(--muted); font-size: 17px; }
.app-choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.app-choice { min-height: 190px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 28px; border: 1px solid #d6deeb; border-radius: 8px; color: var(--ink); background: white; box-shadow: 0 12px 34px rgba(18, 42, 86, .06); text-align: left; }
.app-choice:hover { border-color: #7e9ee8; transform: translateY(-2px); box-shadow: 0 16px 42px rgba(18, 42, 86, .1); }
.app-choice-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 8px; font-size: 18px; font-weight: 900; }
.app-choice-icon.finance { color: var(--blue); background: var(--blue-soft); }
.app-choice-icon.payments { color: #087469; background: #ddf7f2; }
.app-choice span:nth-child(2) { display: grid; gap: 8px; }
.app-choice strong { font-size: 18px; }
.app-choice small { max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.app-choice b { color: var(--blue); font-size: 12px; }
.payments-shell { width: min(100% - 48px, 1380px); margin: 0 auto; padding: 38px 0 70px; }
.payments-welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.payments-welcome h2 { margin: 8px 0; font-size: 34px; }
.payments-welcome p:not(.eyebrow) { margin: 0; color: var(--muted); }
.payment-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.payment-kpi { min-height: 126px; display: grid; align-content: center; gap: 7px; padding: 20px; }
.payment-kpi small { color: var(--muted); font-size: 12px; font-weight: 800; }
.payment-kpi strong { font-size: 28px; }
.payment-kpi span { color: #087469; font-size: 13px; font-weight: 800; }
.payment-tabs {
  margin-bottom: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #b7c5dc transparent;
}
.payment-tabs .tab { flex: 0 0 auto; white-space: nowrap; }
.payment-page { display: none; }
.payment-page.active { display: block; }
.payment-panel { min-width: 0; padding: 22px; }
.payment-two-column > * { min-width: 0; }
.payment-page .table-wrap {
  max-height: min(560px, 62vh);
  overflow: auto;
  border: 1px solid #dce4f0;
  border-radius: 7px;
  background: white;
  scrollbar-width: thin;
  scrollbar-color: #aebbd0 #f2f5f9;
}
.payment-page .table-wrap table { min-width: 760px; }
.payment-page .table-wrap thead { position: sticky; top: 0; z-index: 3; }
.payment-page .table-wrap th { box-shadow: inset 0 -1px 0 var(--line); }
.payment-page .table-wrap tbody tr:last-child td { border-bottom: 0; }
.payment-page .table-wrap tbody tr:hover:not(.document-preview-row) { background: #fbfcff; }
.payment-page .table-wrap:focus-within { border-color: #9eb5e5; box-shadow: 0 0 0 3px rgba(23, 70, 209, .06); }
.payment-page .table-wrap::-webkit-scrollbar,
.petty-cash-ledger #pettyCashLedgerRows::-webkit-scrollbar,
.vendor-pending-list::-webkit-scrollbar,
.claim-summary-grid::-webkit-scrollbar { width: 9px; height: 9px; }
.payment-page .table-wrap::-webkit-scrollbar-track,
.petty-cash-ledger #pettyCashLedgerRows::-webkit-scrollbar-track,
.vendor-pending-list::-webkit-scrollbar-track,
.claim-summary-grid::-webkit-scrollbar-track { background: #f2f5f9; }
.payment-page .table-wrap::-webkit-scrollbar-thumb,
.petty-cash-ledger #pettyCashLedgerRows::-webkit-scrollbar-thumb,
.vendor-pending-list::-webkit-scrollbar-thumb,
.claim-summary-grid::-webkit-scrollbar-thumb { border: 2px solid #f2f5f9; border-radius: 999px; background: #aebbd0; }

/* Operational tables use semantic alignment instead of dashboard-wide numeric alignment. */
[data-payment-panel="requests"] th:nth-child(-n+3),
[data-payment-panel="requests"] th:nth-child(6),
[data-payment-panel="requests"] th:nth-child(7),
[data-payment-panel="requests"] #myRequestRows td:nth-child(-n+3),
[data-payment-panel="requests"] #myRequestRows td:nth-child(6),
[data-payment-panel="requests"] #myRequestRows td:nth-child(7),
[data-payment-panel="approvals"] th:nth-child(n+2):nth-child(-n+5),
[data-payment-panel="approvals"] th:nth-child(7),
[data-payment-panel="approvals"] #approvalRows td:nth-child(n+2):nth-child(-n+5),
[data-payment-panel="approvals"] #approvalRows td:nth-child(7),
[data-payment-panel="vendors"] th:nth-child(-n+3),
[data-payment-panel="vendors"] #vendorRows td:nth-child(-n+3),
[data-payment-panel="summary"] th:nth-child(-n+6),
[data-payment-panel="summary"] #claimSummaryDetailRows td:nth-child(-n+6),
[data-payment-panel="funds-outflow"] th:nth-child(-n+4),
[data-payment-panel="funds-outflow"] #fundOutflowRows td:nth-child(-n+4),
[data-payment-panel="access"] th:nth-child(-n+3),
[data-payment-panel="access"] #paymentAccessRows td:nth-child(-n+3),
[data-payment-panel="access"] #pettyCashAssignmentRows td:nth-child(-n+2),
[data-payment-panel="fraud"] th:nth-child(-n+4),
[data-payment-panel="fraud"] #fraudReviewRows td:nth-child(-n+4) { text-align: left; }
.fraud-filter-bar { display: grid; grid-template-columns: minmax(130px, .75fr) minmax(140px, .8fr) minmax(190px, 1fr) minmax(250px, 1.45fr) auto; gap: 10px; align-items: end; margin: 14px 0; padding: 12px; border: 1px solid #d7e1ef; background: #f7f9fc; }
.fraud-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.fraud-heading-actions .summary-hint { margin: 0; max-width: 260px; text-align: right; }
.fraud-risk { display: inline-grid; min-width: 52px; padding: 5px 8px; border-radius: 5px; text-align: center; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.fraud-risk.high { color: #a92323; background: #fee7e7; }
.fraud-risk.medium { color: #8e5a00; background: #fff2ca; }
.fraud-risk.low { color: #06715b; background: #e2f7ef; }
.fraud-score { display: block; margin-top: 5px; color: #596b87; font-size: 11px; font-weight: 750; }
.fraud-analysis-note { display: block; margin-top: 5px; color: #596b87; line-height: 1.35; }
.fraud-filter-bar .field { gap: 4px; }
.fraud-filter-bar label { font-size: 12px; }
.fraud-filter-bar select, .fraud-filter-bar input { min-height: 40px; }
.fraud-clear-filter { min-height: 40px; white-space: nowrap; }
[data-payment-panel="approvals"] th:first-child,
[data-payment-panel="approvals"] #approvalRows td:first-child { text-align: center; }
.payment-filter-row { display: flex; justify-content: flex-end; margin: -2px 0 12px; }
.payment-filter-row select { width: auto; min-width: 180px; }
.summary-hint { margin: 5px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.claim-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  max-height: 390px;
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: #aebbd0 #f2f5f9;
}
.claim-summary-overall { min-height: 112px; display: grid; align-content: start; gap: 7px; padding: 15px; color: var(--ink); font: inherit; text-align: left; border: 1px solid #8aa6f7; border-radius: 6px; background: var(--blue-soft); }
.claim-summary-overall:hover, .claim-summary-overall.active { border-color: var(--blue); background: #e2ebff; }
.claim-summary-overall span { color: var(--blue); font-size: 12px; font-weight: 800; }
.claim-summary-overall strong { color: var(--navy); font-size: 21px; }
.claim-summary-overall small { color: var(--muted); font-size: 11px; font-weight: 700; }
.claim-summary-card { min-height: 112px; display: grid; align-content: start; gap: 7px; padding: 15px; color: var(--ink); text-align: left; border: 1px solid var(--line); border-radius: 6px; background: white; }
.claim-summary-card:hover, .claim-summary-card.active { border-color: #7da0ff; background: var(--blue-soft); }
.claim-summary-card span { color: var(--muted); font-size: 12px; font-weight: 800; }
.claim-summary-card strong { color: var(--blue); font-size: 19px; }
.claim-summary-card small { color: var(--muted); font-size: 11px; font-weight: 700; }
.claim-summary-detail-panel { margin-top: 14px; }
.payment-two-column { display: grid; grid-template-columns: .72fr 1.28fr; gap: 14px; }
.funds-outflow-layout { grid-template-columns: minmax(360px, .76fr) minmax(620px, 1.24fr); }
.funds-outflow-heading { align-items: end; }
.funds-outflow-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.funds-outflow-filters label { display: grid; gap: 5px; color: #526582; font-size: 12px; font-weight: 800; }
.funds-outflow-filters input, .funds-outflow-filters select { min-height: 38px; padding: 6px 9px; border: 1px solid #cbd7e7; border-radius: 5px; color: #182949; background: white; font: inherit; }
.funds-outflow-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.funds-outflow-summary article { display: grid; gap: 5px; padding: 14px; border: 1px solid #cfe0ff; border-radius: 6px; background: #f6f9ff; }
.funds-outflow-summary article.rejected { border-color: #f4d4d4; background: #fff8f7; }
.funds-outflow-summary span, .funds-outflow-summary small { color: var(--muted); font-size: 11px; font-weight: 750; }
.funds-outflow-summary strong { color: var(--navy); font-size: 20px; }
.payment-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: #526079; background: #eef2f7; font-size: 9px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.status-manager_review, .status-finance_review, .status-owner_review { color: #80570a; background: #fff2ca; }
.status-approved, .status-scheduled { color: #0b5fba; background: #e5f2ff; }
.status-paid { color: #08734a; background: #dff7ec; }
.status-returned, .status-rejected { color: var(--red); background: #fee7e7; }
.workflow-stage { display: grid; gap: 5px; min-width: 190px; }
.workflow-stage strong { font-size: 12px; }
.workflow-stage small, .follow-up-owner small { color: var(--muted); line-height: 1.35; }
.workflow-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 126px; }
.workflow-progress span { height: 4px; border-radius: 999px; background: #d9e1ef; }
.workflow-progress span.complete { background: var(--blue); }
.workflow-progress span.current { background: #e9a91c; }
.follow-up-owner { display: grid; gap: 3px; min-width: 130px; }
.follow-up-owner strong { font-size: 12px; }
.payment-dialog { width: min(880px, calc(100% - 30px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(3, 15, 45, .3); }
.payment-dialog::backdrop { background: rgba(4, 15, 42, .6); backdrop-filter: blur(2px); }
.payment-dialog form { padding: 26px; overflow-y: auto; }
.compact-dialog { width: min(560px, calc(100% - 30px)); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 6px 0 0; }
.icon-close { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: #f0f3f8; font-size: 24px; line-height: 1; }
.request-type-switch { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; padding: 4px; border-radius: 8px; background: #edf1f7; }
.request-type-switch button { padding: 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-weight: 800; }
.request-type-switch button.active { color: var(--blue); background: white; box-shadow: 0 2px 7px rgba(20, 44, 90, .1); }
.dialog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field-wide { grid-column: 1 / -1; }
.field small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.review-actions { justify-content: space-between; }
.danger-outline { border-color: #efb6b6 !important; color: var(--red) !important; }
.toast { position: fixed; right: 22px; bottom: 22px; transform: translateY(90px); opacity: 0; padding: 13px 16px; color: white; background: #16254c; border-radius: 9px; box-shadow: 0 12px 40px rgba(0,0,0,.18); transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.hidden { display: none !important; }
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .82fr) 1.18fr; background: white; }
.auth-card { width: min(440px, calc(100% - 48px)); margin: auto; padding: 42px 0; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: white; background: var(--navy); border-radius: 14px; padding: 13px 16px; }
.auth-copy { margin: 62px 0 26px; }
.auth-copy h2 { margin: 8px 0; font-size: 34px; letter-spacing: -.04em; }
.auth-copy p:not(.eyebrow), .auth-message { color: var(--muted); line-height: 1.5; }
.google-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 16px; border: 1px solid #cbd5e1; border-radius: 9px; color: var(--ink); background: white; font-weight: 750; box-shadow: 0 2px 5px rgba(15,23,42,.05); }
.google-button:hover { background: #f8fafc; }
.google-mark { color: #174ea6; font-size: 18px; font-weight: 900; }
.auth-message { margin: 14px 0; text-align: center; font-size: 12px; }
.auth-message.error { color: var(--red); }
.demo-access { margin-top: 30px; padding: 14px; border: 1px dashed #b8c7e5; border-radius: 10px; background: var(--blue-soft); }
.demo-access > div:first-child { display: grid; gap: 3px; color: var(--blue); font-size: 12px; font-weight: 800; }
.demo-access small { color: var(--muted); font-weight: 500; }
.demo-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
.demo-buttons button { border: 1px solid #b9c9ef; border-radius: 7px; color: var(--blue); background: white; padding: 8px; font-size: 12px; font-weight: 750; }
.auth-aside { display: flex; flex-direction: column; justify-content: center; padding: 10%; color: white; background: radial-gradient(circle at 90% 10%, #2459db, transparent 28%), linear-gradient(145deg, #07153f, #0a2f87); }
.auth-aside > div { max-width: 620px; }
.auth-aside h2 { margin: 14px 0 18px; max-width: 570px; font-size: clamp(36px, 4vw, 62px); line-height: 1.02; letter-spacing: -.05em; }
.auth-aside p:not(.eyebrow) { max-width: 540px; color: #c4d0ed; font-size: 17px; line-height: 1.6; }
.auth-aside ul { display: grid; gap: 18px; margin: 55px 0 0; padding: 0; list-style: none; }
.auth-aside li { display: grid; gap: 4px; padding-left: 20px; border-left: 2px solid #4f7ff1; }
.auth-aside li span { color: #b7c5e7; font-size: 13px; }

@media (max-width: 1050px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-grid { grid-template-columns: repeat(2, 1fr); }
  .owner-grid, .planning-grid { grid-template-columns: 1fr 1fr; }
  .content-grid, .content-grid.equal { grid-template-columns: 1fr; }
  .payment-kpis { grid-template-columns: repeat(2, 1fr); }
  .app-choice-grid, .payment-two-column { grid-template-columns: 1fr; }
  .funds-outflow-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .topbar-inner, main { width: min(100% - 24px, 1380px); }
  .topbar-inner { padding: 12px 0; }
  .user-area > div, .status-dot { display: none; }
  .user-area { gap: 5px; }
  .user-area .outline { margin-left: 0; padding: 8px 10px; }
  .notification-badge { font-size: 9px; }
  .notification-center-item { grid-template-columns: 82px minmax(0, 1fr); }
  .notification-center-item > b { grid-column: 2; }
  .app-switch-link { font-size: 0; }
  .app-switch-link::before { margin-right: 0; font-size: 18px; }
  .welcome { align-items: flex-start; gap: 15px; flex-direction: column; }
  .filters, .kpi-grid, .owner-grid, .planning-grid, .upload-grid, .staff-grid { grid-template-columns: 1fr; }
  .target-option-grid { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card { width: min(440px, calc(100% - 32px)); }
  .chooser-screen { padding: 24px 16px; }
  .chooser-copy { margin-top: 56px; }
  .chooser-copy h2 { font-size: 32px; }
  .app-choice { grid-template-columns: auto 1fr; min-height: 150px; padding: 20px; }
  .app-choice b { display: none; }
  .payments-shell { width: min(100% - 24px, 1380px); padding-top: 24px; }
  .funds-outflow-filters, .funds-outflow-summary { grid-template-columns: 1fr; }
  .payments-welcome { align-items: flex-start; flex-direction: column; }
  .payment-kpis, .dialog-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .payment-dialog form { padding: 20px; }
}

.payments-standalone {
  min-height: 100vh;
}

.payments-auth-aside {
  background: #10245e;
}

.approval-flow {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.approval-flow li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.approval-flow b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #163fca;
}

.approval-flow span {
  display: grid;
  gap: 3px;
}

.approval-flow small {
  color: rgba(255, 255, 255, 0.72);
}

.payments-standalone .payments-shell {
  min-height: calc(100vh - 92px);
}

.inline-vendor-form {
  margin: 0;
  padding: 14px;
  border: 1px solid #d8e1f0;
  background: #f7faff;
}

.vendor-review {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #dce4f0;
}

.vendor-review h4 { margin: 4px 0 10px; }
.vendor-pending-list {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: #aebbd0 #f2f5f9;
}

.vendor-pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dce4f0;
  background: #fffdf8;
}

.vendor-pending-item strong,
.vendor-pending-item small { display: block; }
.vendor-pending-item small { margin-top: 4px; color: #687893; }
.vendor-pending-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.vendor-pending-actions .small-button { margin: 0; }
.small-button { min-width: 94px; padding: 9px 12px; font-size: 14px; }

.file-paste-target {
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px dashed #96addd;
  border-radius: 6px;
  color: #35558d;
  background: #f7faff;
  font-size: 13px;
  cursor: pointer;
}

.file-paste-target:focus,
.file-paste-target:hover {
  border-color: var(--blue);
  outline: none;
  background: #eef4ff;
}

.status-history-button {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

#paymentStatusDialog[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(720px, calc(100vh - 32px));
  overflow: hidden;
}
#paymentStatusDialog .dialog-heading { margin: 0; padding: 20px 24px 16px; border-bottom: 1px solid #e0e7f2; }
#paymentStatusDialog .dialog-actions { margin: 0; padding: 0 24px 20px; }

.status-history-list { min-height: 0; margin: 20px 16px 24px 24px; padding-right: 8px; overflow-y: auto; }

.status-history-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9e4f5;
  border-radius: 7px;
  background: #f7faff;
}

.status-history-summary .payment-status { flex: 0 0 auto; }
.status-history-summary strong { display: block; color: #132547; }
.status-history-summary p { margin: 5px 0; color: #405474; line-height: 1.4; }
.status-history-summary small { color: #697c98; font-weight: 700; }

.status-timeline { position: relative; display: grid; gap: 0; margin-top: 20px; padding-left: 26px; }
.status-timeline::before { content: ""; position: absolute; top: 15px; bottom: 24px; left: 7px; width: 2px; background: #dce5f2; }

.status-timeline-event { position: relative; padding: 0 0 15px 15px; }
.status-timeline-event:last-child { padding-bottom: 0; }

.status-timeline-dot {
  position: absolute;
  top: 14px;
  left: -1px;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2453c7;
  box-shadow: 0 0 0 2px #aabddd;
}

.status-timeline-event.approved .status-timeline-dot { background: #0d9a82; box-shadow: 0 0 0 2px #8fd6ca; }
.status-timeline-event.complete .status-timeline-dot { background: #128a45; box-shadow: 0 0 0 2px #91d2a9; }
.status-timeline-event.negative .status-timeline-dot { background: #cf3434; box-shadow: 0 0 0 2px #efaaaa; }

.status-timeline-card { padding: 13px 14px; border: 1px solid #e0e7f2; border-radius: 7px; background: #fff; }
.status-timeline-event.current .status-timeline-card { border-color: #aac1ed; box-shadow: 0 5px 14px rgba(24, 61, 122, .08); }
.status-timeline-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.status-timeline-heading strong { color: #162644; }
.status-timeline-heading time { color: #687b97; font-size: 12px; white-space: nowrap; }
.status-timeline-actor { display: grid; gap: 2px; margin-top: 8px; }
.status-timeline-actor span { color: #344764; font-size: 13px; font-weight: 800; }
.status-timeline-actor small { color: #7586a0; font-size: 12px; }
.status-timeline-note { margin: 10px 0 0; padding: 9px 10px; border-left: 3px solid #dfaa24; color: #4d5a70; background: #fff9e9; line-height: 1.4; }

@media (max-width: 600px) {
  .status-history-list { margin: 16px 8px 16px 16px; padding-right: 8px; }
  #paymentStatusDialog .dialog-heading { padding: 18px 16px 14px; }
  #paymentStatusDialog .dialog-actions { padding: 0 16px 16px; }
  .status-timeline-heading { display: grid; gap: 4px; }
}

.owner-settings-panel { max-width: 900px; }
.owner-settings-panel textarea { min-height: 220px; resize: vertical; }

.fraud-signal-list { display: grid; gap: 5px; min-width: 280px; white-space: normal; }
.fraud-signal-list small { color: #596b87; line-height: 1.35; }
.fraud-signal { display: inline-flex; width: max-content; padding: 4px 7px; border-radius: 999px; color: #8e5a00; background: #fff2ca; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.fraud-signal.high { color: #a92323; background: #fee7e7; }
.fraud-review-signals { display: grid; gap: 8px; margin: 0 0 16px; }
.fraud-review-signals p { margin: 0; padding: 11px 12px; border-left: 3px solid #e2a40e; color: #495872; background: #fff9e9; line-height: 1.4; }
.fraud-evidence-dialog { width: min(1040px, calc(100vw - 32px)); max-width: 1040px; }
.fraud-evidence-dialog .dialog-heading { align-items: flex-start; }
.fraud-evidence-dialog .summary-hint { max-width: 760px; margin-top: 6px; line-height: 1.45; }
.fraud-evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-height: 64vh; overflow-y: auto; padding: 4px 10px 10px 2px; }
.fraud-evidence-card { min-width: 0; padding: 16px; border: 1px solid #cedbec; border-radius: 8px; background: #f8faff; box-shadow: 0 5px 16px rgba(24, 49, 92, .06); }
.fraud-evidence-card > header { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid #dce5f1; }
.fraud-evidence-card > header div { display: grid; gap: 3px; }
.fraud-evidence-card > header span { color: #55708f; font-size: 12px; font-weight: 800; }
.fraud-evidence-card dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; margin: 12px 0; }
.fraud-evidence-card dl div { display: contents; }
.fraud-evidence-card dt { color: #657895; font-size: 12px; font-weight: 800; }
.fraud-evidence-card dd { margin: 0; overflow-wrap: anywhere; }
.fraud-evidence-documents { display: grid; gap: 10px; }
.fraud-evidence-document { overflow: hidden; border: 1px solid #dce5f1; border-radius: 7px; background: #fff; }
.fraud-evidence-document > div:first-child { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.fraud-evidence-document > div:first-child > div { display: grid; min-width: 0; gap: 3px; }
.fraud-evidence-document > div:first-child strong { overflow-wrap: anywhere; }
.fraud-evidence-document > div:first-child small { color: #657895; }
.fraud-evidence-media { display: block; width: 100%; height: 280px; border: 0; object-fit: contain; background: #eef3f9; }
.fraud-evidence-card footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #dce5f1; }
.fraud-review-state { display: flex; align-items: center; gap: 7px; }
.fraud-unresolved-marker { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: #e59b00; font-weight: 900; box-shadow: 0 0 0 3px #fff3cf; }
.petty-cash-rejected { opacity: .72; background: #fff7f7; }
.petty-rejection-note { color: #a92323 !important; font-weight: 750; }
.petty-cash-focus { outline: 3px solid rgba(36, 82, 214, .25); outline-offset: -3px; background: #edf3ff !important; transition: background .25s ease, outline-color .25s ease; }
.payment-purpose-cell { min-width: 220px; white-space: normal; line-height: 1.4; }
.batch-claim-list { display: grid; gap: 7px; min-width: 270px; }
.batch-claim-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 7px; border-bottom: 1px solid #edf0f5; }
.batch-claim-line:last-child { padding-bottom: 0; border-bottom: 0; }
.batch-claim-line div { display: grid; gap: 2px; }
.batch-claim-line span { color: #53647f; font-size: 12px; line-height: 1.35; }
.batch-claim-line b { color: #182949; font-size: 12px; text-align: right; white-space: nowrap; }
.batch-claim-line .link-button { padding: 0; font-size: 11px; text-align: right; }
[data-payment-panel="queue"] th:nth-child(-n+4),
[data-payment-panel="queue"] #paymentQueueRows td:nth-child(-n+4) { text-align: left; }
[data-payment-panel="queue"] #paymentQueueRows td:nth-child(n+5) { text-align: right; }
[data-payment-panel="queue"] #paymentQueueRows td:nth-child(2) { min-width: 170px; }
[data-payment-panel="queue"] #paymentQueueRows td:nth-child(3) { min-width: 300px; }
[data-payment-panel="queue"] #paymentQueueRows td:nth-child(4) { min-width: 230px; }
[data-payment-panel="queue"] .batch-claim-line > div:first-child { min-width: 0; text-align: left; }
[data-payment-panel="queue"] .batch-claim-line > div:first-child strong,
[data-payment-panel="queue"] .batch-claim-line > div:first-child span { text-align: left; }
[data-payment-panel="queue"] .batch-claim-line > div:last-child { flex: 0 0 auto; justify-items: end; text-align: right; }

.owner-bulk-approval-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #cddbf4;
  border-left: 4px solid var(--blue);
  background: #f7faff;
}
.owner-bulk-approval-controls strong,
.owner-bulk-approval-controls small { display: block; }
.owner-bulk-approval-controls small { margin-top: 4px; color: #647793; }
.owner-bulk-approval-actions { display: flex; align-items: center; gap: 10px; }
.owner-bulk-approval-actions span { color: #425675; font-size: 13px; font-weight: 750; white-space: nowrap; }
.owner-bulk-approval-controls .form-status { margin: 0; }
.owner-bulk-checkbox { width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer; }
.owner-bulk-column { width: 54px; text-align: center !important; }

.danger-link { color: #b42323; }
.claim-summary-actions { display: flex; align-items: end; gap: 12px; }
.claim-summary-actions label { display: grid; gap: 5px; color: #526582; font-size: 12px; font-weight: 800; }
.claim-summary-actions input { min-width: 148px; min-height: 44px; padding: 8px 10px; border: 1px solid #cbd7e7; border-radius: 6px; color: #182949; background: #fff; font: inherit; }
.claim-summary-actions input:focus { outline: 3px solid rgba(20, 75, 180, .16); border-color: var(--blue); }
.claim-status-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.claim-status-summary article { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid #cde6de; border-left: 4px solid #0d9a82; background: #f3fbf8; }
.claim-status-summary article.rejected { border-color: #f0d0d0; border-left-color: #c43a3a; background: #fff7f7; }
.claim-status-summary span { color: #526582; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.claim-status-summary strong { color: #163260; font-size: 22px; }
.claim-status-summary small { color: #647793; }

.petty-cash-layout { align-items: start; }
.petty-cash-control-column { display: grid; min-width: 0; gap: 14px; align-content: start; }
.petty-cash-topup { margin: 0; }
.petty-cash-assignment-panel { margin-top: 20px; }
.petty-cash-ledger {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #dce4f0;
  border-radius: 8px;
  background: #fbfcff;
}
.petty-cash-ledger > .eyebrow { margin-bottom: 10px; }
.petty-cash-ledger-heading { align-items: end; margin-bottom: 12px; }
.petty-cash-ledger-heading h4 { margin: 0; color: #182949; font-size: 17px; }
.petty-cash-ledger-actions { display: flex; align-items: center; gap: 8px; }
.petty-cash-ledger-actions .active { color: #fff; border-color: var(--blue); background: var(--blue); }
.petty-cash-ledger-filters { display: flex; gap: 10px; margin-bottom: 12px; }
.petty-cash-ledger-filters label { display: grid; flex: 1; gap: 5px; color: #526582; font-size: 12px; font-weight: 800; }
.petty-cash-ledger-filters select, .petty-cash-ledger-filters input { min-height: 38px; padding: 6px 9px; border: 1px solid #cbd7e7; border-radius: 5px; color: #182949; font: inherit; }
.petty-cash-ledger #pettyCashLedgerRows {
  max-height: min(560px, 62vh);
  overflow-y: auto;
  border: 1px solid #dce4f0;
  border-radius: 7px;
  background: white;
  scrollbar-width: thin;
  scrollbar-color: #aebbd0 #f2f5f9;
}
.petty-cash-ledger-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 16px; border-bottom: 1px solid #e6ebf3; }
.petty-cash-ledger-row:hover { background: #f8faff; }
.petty-cash-ledger-row:last-child { border-bottom: 0; }
.petty-cash-ledger-row > div { display: grid; gap: 4px; }
.petty-cash-ledger-row > div:last-child { justify-items: end; text-align: right; }
.petty-cash-row-title { display: flex; align-items: center; gap: 9px; }
.petty-cash-unresolved { border-left: 3px solid #e59b00; background: #fffdf6; }
.petty-cash-review-actions { display: flex; justify-content: flex-end; gap: 10px; }
.fraud-review-link { font-weight: 850; }
.petty-cash-ledger-row small { color: #687b97; font-size: 12px; line-height: 1.35; }
.petty-cash-ledger-row .access-status { width: max-content; }
.cash-in { color: #087c63; }
.cash-out { color: #b42323; }
.receipt-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 12px; padding: 12px 14px; border: 1px solid #d7e1f1; border-radius: 6px; background: #f8fbff; }
.receipt-status-error { border-color: #f1d6ac; background: #fffaf0; }
.receipt-status p { display: grid; gap: 3px; margin: 0; color: #586b87; font-size: 13px; text-align: left; }
.receipt-status p strong { color: #263a5a; }
.receipt-status p span { color: #876733; font-size: 12px; }
.receipt-status .outline { flex: 0 0 auto; margin: 0; white-space: nowrap; }

.request-lines-field { padding: 16px; border: 1px solid #d8e2f0; border-radius: 7px; background: #f8faff; }
.request-lines-heading, .request-total, .payment-line-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.request-lines-heading small { display: block; margin-top: 3px; color: #657895; }
.payment-line-items { display: grid; gap: 12px; margin-top: 14px; }
.payment-line-item { padding: 14px; border: 1px solid #d8e2f0; border-radius: 6px; background: white; }
.payment-line-toolbar { margin-bottom: 10px; }
.payment-line-toolbar .icon-close { width: 32px; height: 32px; }
.payment-line-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.payment-line-grid .line-documents { grid-column: 1 / -1; }
.payment-line-paste-target { min-height: 52px; margin-top: 6px; padding: 12px; }
.payment-line-grid .line-description { grid-column: span 2; }
.payment-line-grid select { min-width: 0; width: 100%; }
.line-total { display: grid; gap: 4px; align-self: end; min-height: 58px; padding: 8px 10px; border-left: 3px solid var(--blue); background: #f3f7ff; }
.line-total span { color: #657895; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.request-total { margin-top: 14px; padding-top: 12px; border-top: 1px solid #d8e2f0; }
.request-total strong { color: #123886; font-size: 22px; }
.status-history-lines, .request-comment-box { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border: 1px solid #dce5f2; border-radius: 7px; background: #fff; }
.status-history-lines > div { display: flex; justify-content: space-between; gap: 16px; padding-top: 8px; border-top: 1px solid #edf1f6; }
.status-history-lines span, .status-history-lines small { display: block; }
.status-history-lines small, .request-comment-box small { color: #71839d; }
.request-comment-box p { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; margin: 0; padding: 8px 0; border-top: 1px solid #edf1f6; color: #465976; }
.finance-controls-header { display: flex; justify-content: space-between; gap: 24px; margin: 4px 0 18px; }
.finance-controls-header h2 { margin: 4px 0 5px; font-size: 25px; }
.finance-controls-header > div > p:last-child { margin: 0; color: var(--muted); }
.finance-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 28px 0 12px; padding-bottom: 10px; border-bottom: 1px solid #d9e2ef; }
.finance-section-heading h3 { margin-top: 2px; font-size: 18px; }
.finance-section-heading > p { max-width: 480px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.finance-control-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.finance-control-kpi { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 16px 18px; }
.finance-control-kpi span { max-width: calc(100% - 54px); color: #526582; font-size: 13px; font-weight: 750; line-height: 1.35; }
.finance-control-kpi strong { flex: 0 0 auto; color: #173a86; font-size: 25px; }
.finance-overview-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr); align-items: stretch; gap: 14px; }
.finance-config-grid { display: block; }
.finance-overview-grid > .panel, .finance-config-grid > .panel { min-width: 0; }
.finance-control-list { display: grid; max-height: 320px; overflow-y: auto; padding-right: 6px; }
.finance-control-list article { display: flex; justify-content: space-between; gap: 16px; min-height: 62px; padding: 12px 2px; border-bottom: 1px solid #e3e9f2; }
.finance-control-list article div { display: grid; gap: 3px; }
.finance-control-list article div:last-child { justify-items: end; }
.finance-control-list small, .finance-control-list span { color: #6b7d98; font-size: 12px; }
.finance-table { max-height: 310px !important; }
.finance-table table { min-width: 680px !important; }
.finance-upload-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; }
.finance-upload-row input { min-width: 0; flex: 1; }
.finance-upload-row .primary { flex: 0 0 auto; }
.finance-control-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finance-control-form { max-width: 900px; }
.finance-control-form > button { width: auto; min-width: 150px; justify-self: start; }
.finance-audit-panel { margin-bottom: 18px; }
.finance-tool-tabs { display: flex; gap: 6px; margin-bottom: 12px; padding: 5px; border: 1px solid #d9e2ef; border-radius: 8px; background: #eaf0f8; overflow-x: auto; }
.finance-tool-tabs button { flex: 0 0 auto; min-height: 38px; padding: 8px 16px; border: 0; border-radius: 6px; color: #526582; background: transparent; font-weight: 800; }
.finance-tool-tabs button:hover { color: var(--blue); background: rgba(255,255,255,.65); }
.finance-tool-tabs button.active { color: white; background: var(--blue); box-shadow: 0 2px 7px rgba(22, 66, 175, .2); }
.finance-tool-panel:not(.active) { display: none; }
.finance-tool-panel.active { min-height: 0; }
.finance-tool-panel[data-finance-tool-panel="policy"],
.finance-tool-panel[data-finance-tool-panel="budget"],
.finance-tool-panel[data-finance-tool-panel="gl"] { padding-bottom: 18px; }

@media (max-width: 760px) {
  .vendor-pending-item { align-items: stretch; flex-direction: column; }
  .vendor-pending-actions { width: 100%; }
  .vendor-pending-actions .small-button { flex: 1 1 0; min-height: 44px; }
  .fraud-filter-bar { grid-template-columns: 1fr 1fr; }
  .fraud-heading-actions { justify-content: flex-start; width: 100%; }
  .fraud-heading-actions .summary-hint { max-width: none; text-align: left; }
  .fraud-search-field, .fraud-clear-filter { grid-column: 1 / -1; }
  .payment-panel { padding: 16px; }
  .payment-page .table-wrap { max-height: 68vh; border-radius: 6px; }
  .petty-cash-ledger { padding: 14px; }
  .petty-cash-ledger #pettyCashLedgerRows { max-height: 66vh; }
  .petty-cash-ledger-row { align-items: stretch; flex-direction: column; }
  .petty-cash-ledger-row > div:last-child { justify-items: start; text-align: left; }
  .petty-cash-ledger-filters { flex-direction: column; }
  .receipt-status { align-items: stretch; flex-direction: column; }
  .owner-bulk-approval-controls { align-items: flex-start; flex-direction: column; }
  .owner-bulk-approval-actions { width: 100%; flex-wrap: wrap; }
  .claim-summary-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .claim-summary-actions input, .claim-summary-actions button { width: 100%; }
  .claim-status-summary { grid-template-columns: 1fr; }
  .payment-line-grid { grid-template-columns: 1fr 1fr; }
  .payment-line-grid .line-description { grid-column: span 2; }
  .finance-control-kpis { grid-template-columns: 1fr 1fr; }
  .finance-overview-grid { grid-template-columns: 1fr; }
  .finance-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .finance-section-heading > p { text-align: left; }
  .finance-upload-row { align-items: stretch; flex-direction: column; }
  .fraud-evidence-grid { grid-template-columns: 1fr; max-height: 72vh; }
  .fraud-evidence-media { height: 300px; }
}

@media (max-width: 520px) {
  .finance-control-kpis { grid-template-columns: 1fr; }
  .finance-control-form { grid-template-columns: 1fr; }
  .finance-controls-header h2 { font-size: 22px; }
}

.petty-return-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 12px 12px;
  padding: 12px;
  border: 1px solid #efd58a;
  border-left: 3px solid #d99a00;
  background: #fff9e8;
}
.petty-return-action p { margin: 0; }
.petty-return-action p strong,
.petty-return-action p span { display: block; }
.petty-return-action p span { margin-top: 3px; color: #6d5a25; }
@media (max-width: 640px) {
  .petty-return-action { align-items: stretch; flex-direction: column; }
}
.approval-type-badge { display:inline-flex; align-items:center; padding:2px 7px; border-radius:999px; font-size:10px; font-weight:800; text-transform:uppercase; line-height:1.4; }
.approval-type-badge.claim { color:#1746c8; background:#e8efff; }
.approval-type-badge.petty { color:#8a5a00; background:#fff1c7; }
.petty-approval-row { background:#fffcf4; }
.approve-link { color:#087a5b; }
