:root {
    color-scheme: light;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #18283b; background: #f4f6f8;
    --navy: #132739; --blue: #174c63; --line: #e1e7ed; --muted: #546579;
    --green: #155844; --amber: #7b460c; --red: #9a302a;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 15.75rem minmax(0, 1fr); }
a { color: #14526b; text-underline-offset: .2em; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.6rem; padding: .62rem .95rem; border: 1px solid transparent; background: var(--blue); color: white; border-radius: .45rem; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { filter: brightness(.88); }
button:disabled { cursor: default; opacity: .5; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #078196; outline-offset: 3px; }
.secondary { border-color: #bdcbd4; background: white; color: #17475c; }
.quiet { padding: .2rem 0; min-height: 2rem; background: transparent; color: inherit; text-decoration: underline; font-weight: 500; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2.1rem; padding: 1.5rem 1.1rem; background: var(--navy); color: #f6f8fa; }
.brand { display: flex; width: fit-content; align-items: center; gap: .75rem; color: inherit; font-size: 1.25rem; font-weight: 720; text-decoration: none; letter-spacing: -.02em; }
.brand small { display: block; color: inherit; opacity: .83; font-weight: 480; font-size: .72rem; letter-spacing: .015em; }
.mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; background: #e8b28c; color: #2d251f; border-radius: .45rem; font-weight: 780; }
.sidebar nav { display: grid; gap: .4rem; }
.sidebar nav a { text-decoration: none; color: #e9f0f5; padding: .7rem .65rem; border-radius: .4rem; font-size: .92rem; }
.sidebar nav a:hover, .sidebar nav a.active { background: #26445b; }
.account { margin-top: auto; border-top: 1px solid #425463; padding: .85rem .45rem 0; font-size: .88rem; }
.main { width: min(100%, 90rem); padding: clamp(1rem, 3vw, 3rem); margin-inline: auto; min-width: 0; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 0 0 1.35rem; }
h1, h2 { margin: 0; line-height: 1.2; letter-spacing: -.025em; }
h1 { font-size: clamp(1.85rem, 3.4vw, 2.8rem); overflow-wrap: anywhere; }
h2 { font-size: 1.17rem; }
h2 small { color: var(--muted); font-size: .75rem; font-weight: 500; margin-left: .4rem; }
p { margin: .45rem 0; }
.heading p:not(.eyebrow), .muted { color: var(--muted); }
.eyebrow { margin: 0 0 .4rem; color: #4d6376; font-size: .72rem; font-weight: 720; letter-spacing: .09em; text-transform: uppercase; }
.panel, .tile { background: white; border: 1px solid var(--line); border-radius: .7rem; }
.panel { padding: clamp(.9rem, 2vw, 1.35rem); margin: 0 0 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .8rem; margin-bottom: 1.05rem; }
.tile { padding: .8rem 1rem; color: var(--muted); text-decoration: none; font-weight: 540; }
.tile:hover { border-color: #86aab7; }
.tile strong { display: block; color: #233d57; font-size: 1.75rem; line-height: 1.15; margin-bottom: .25rem; }
.tile.danger strong { color: var(--red); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .65rem; margin-top: .85rem; }
.metric { display: grid; gap: .35rem; align-content: start; padding: .7rem; background: #f6f8fa; border: 1px solid var(--line); border-radius: .4rem; }
.metric strong { font-size: 1.18rem; }
.table-wrap { overflow-x: auto; margin-top: .65rem; }
.flow-journal th { white-space: nowrap; }
[data-flow-branch][hidden], [data-messaging-closing][hidden], [data-legacy-messaging][hidden] { display: none; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: .65rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
thead th { color: #435971; font-size: .78rem; background: #f5f8fa; }
.badge { display: inline-block; width: fit-content; padding: .22rem .48rem; border-radius: 1rem; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.badge.ok { background: #e3f3eb; color: var(--green); }
.badge.bad { background: #fbe8e5; color: var(--red); }
.badge.warn { background: #fff0d9; color: var(--amber); }
.badge.neutral { background: #e8eef4; color: #3b5369; }
.document-line { display: flex; justify-content: space-between; gap: .6rem; border-bottom: 1px solid var(--line); padding: .35rem 0 .65rem; margin: .35rem 0; overflow-wrap: anywhere; }
.document-line span { color: var(--muted); white-space: nowrap; }
.daily-label { display: none; }
.regional-report { padding-top: .6rem; }
.actions, .pagination { display: flex; gap: .6rem; flex-wrap: wrap; }
.pagination { margin-top: .75rem; }
.catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); gap: .85rem; }
.catalog .panel { margin: 0; }
.steps { margin: .8rem 0 0; padding-left: 1.6rem; }
.steps li { border-left: 2px solid #d9e4eb; padding: .35rem .58rem .45rem; margin: 0 0 .35rem; }
.steps li.current { border-left-color: #228198; background: #eef7f9; }
.steps li span { display: block; color: var(--muted); font-size: .85rem; }
.detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; }
.data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .55rem; padding: .65rem; border: 1px solid var(--line); border-radius: .35rem; }
dt { color: var(--muted); font-size: .78rem; }
dd { margin: .15rem 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.filter { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; }
.filter label { min-width: min(22rem, 100%); }
.stack { display: grid; gap: .85rem; margin-top: 1rem; }
label { display: grid; gap: .33rem; color: #344d65; font-size: .88rem; font-weight: 620; }
label[hidden] { display: none; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 2.55rem; border: 1px solid #a9bac8; border-radius: .36rem; background: white; padding: .5rem .55rem; color: #18283b; font: inherit; font-weight: 450; }
textarea { resize: vertical; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .4rem; margin: 0; padding: .7rem; }
legend { font-size: .86rem; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .72rem; }
.calculated-cell { display: block; padding: .6rem; min-height: 2.55rem; border-radius: .36rem; background: #e7edf2; }
.reprise-preview { border-left: .22rem solid var(--blue); padding: .3rem .9rem; }
.reprise-preview ul { padding-left: 1.2rem; }
.record-line { padding: .72rem; background: #f5f8fa; margin-bottom: .55rem; border-radius: .4rem; }
.check { display: flex; align-items: center; }
.check input { width: 1rem; height: 1rem; }
.return { border-top: 1px solid var(--line); padding-top: .8rem; }
.back { display: inline-block; margin-bottom: .8rem; }
.notice, .error { padding: .7rem .85rem; border-radius: .4rem; margin: 0 0 1rem; }
.notice { background: #e3f3eb; color: var(--green); }
.error { background: #fbe8e5; color: var(--red); }
.error ul { margin: 0; }
.guest { display: grid; grid-template-columns: 1fr; align-items: center; background: radial-gradient(ellipse at top left, #315068, var(--navy) 70%); }
.environment { width: fit-content; margin: 0 0 .9rem; padding: .26rem .53rem; border-radius: .3rem; background: #fff0d9; color: var(--amber); font-size: .77rem; font-weight: 630; }
.notice-warn { color: var(--amber); margin: .5rem 0; font-size: .88rem; }
.guest .main { width: min(100%, 29rem); }
.login { padding: clamp(1.1rem, 6vw, 2rem); }
.login .brand { margin-bottom: 1.65rem; }
.login p { color: var(--muted); }
@media (max-width: 850px) {
    body { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; padding: .7rem 1rem; flex-direction: row; align-items: center; gap: .7rem; flex-wrap: wrap; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: .15rem; }
    .sidebar nav a { padding: .45rem; font-size: .8rem; }
    .account { margin: 0 0 0 auto; border: 0; padding: 0; }
}
@media (max-width: 540px) {
    .heading { align-items: start; flex-direction: column; }
    .detail { grid-template-columns: 1fr; gap: 0; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar nav { order: 1; width: 100%; }
    .table-wrap { max-width: 100%; }
    .daily-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .daily-table tr { display: block; margin-bottom: .6rem; border: 1px solid var(--line); border-radius: .4rem; }
    .daily-table th[scope=row] { display: block; padding: .45rem .55rem; background: #f5f8fa; }
    .daily-table td { display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding: .4rem .55rem; }
    .daily-table td:last-child { border-bottom: 0; }
    .daily-label { display: inline; font-size: .78rem; }
}
.admin-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.15rem; }
.admin-tabs a { padding: .53rem .78rem; border-radius: .45rem; background: white; color: #174c63; text-decoration: none; border: 1px solid var(--line); }
.admin-tabs a[aria-current=page] { color: white; background: #174c63; border-color: #174c63; }
.admin-record { border: 1px solid var(--line); border-radius: .45rem; padding: .75rem; margin-top: .65rem; }
.admin-record summary { cursor: pointer; }

.cash-workspace { border-top: 3px solid var(--blue); }
.cash-workspace__heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.cash-workspace h3 { font-size: 1rem; margin: 1.15rem 0 .45rem; }
.cash-list { list-style: none; padding: 0; margin: .55rem 0; }
.cash-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--line); padding: .65rem 0; }
.cash-list a:not(.button) { display: block; }
.cash-list a span { display: block; color: var(--muted); font-size: .84rem; }
.cash-list--starts a { border-left: 3px solid var(--blue); padding: .15rem .65rem; }
.task-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.task-filters [aria-current] { border-color: var(--blue); box-shadow: inset 0 -2px var(--blue); }
.task-reason { margin: .35rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.task-deadline { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .85rem; }
.task-guidance-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cash-memo summary { cursor: pointer; color: var(--blue); font-weight: 700; }
.cash-memo[open] summary { margin-bottom: .55rem; }
.cash-memo p { max-width: 72ch; }
@media print {
    body { display: block; color: #000; background: #fff; }
    .sidebar, .no-print { display: none !important; }
    .main { width: 100%; padding: 0; }
    tr { break-inside: avoid; }
    .table-wrap { overflow: visible; }
}

.task-filters { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.task-board { display: grid; grid-template-columns: minmax(0, 2fr) minmax(13rem, 1fr); gap: 18px; align-items: start; }
.task-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 12px; }
.task-card { border: 1px solid #ccd9e4; border-radius: 12px; background: #fff; padding: 14px; min-width: 0; overflow-wrap: anywhere; }
.task-card h3 { margin: 8px 0 5px; font-size: 1rem; }
.task-card p { margin: 4px 0; }
.task-card-summary[draggable] { cursor: grab; }
.task-card.is-dragging { opacity: .6; }
.task-card .task-responsible { margin: 12px 0 9px; border-top: 1px solid #dce4eb; padding-top: 9px; }
.task-card details form { margin-top: 10px; }
.task-card summary { cursor: pointer; color: #15465c; }
.task-targets { position: sticky; top: 12px; }
.task-targets ul { list-style: none; padding: 0; max-height: 60vh; overflow: auto; display: grid; gap: 6px; }
.task-targets li { border: 1px dashed #91a9bb; padding: 8px; border-radius: 7px; overflow-wrap: anywhere; }
.task-targets li.is-eligible { border-color: #1e6976; background: #e8f4f5; }
.task-targets li.is-over { outline: 2px solid #15465c; outline-offset: -2px; }
@media (max-width: 760px) {
    .task-filters, .task-board { grid-template-columns: minmax(0, 1fr); }
    .task-targets { display: none; }
}
