:root {
  color-scheme: light;
  --ink: #172c40;
  --muted: #53677b;
  --navy: #12283e;
  --blue: #245784;
  --paper: #f2f5f8;
  --line: #d8e1e9;
  --green: #176650;
  --red: #963b43;
  font: 16px/1.48 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(1.85rem, 5vw, 2.6rem); line-height: 1.12; letter-spacing: -.04em; }
h2 { font-size: 1.28rem; line-height: 1.25; }
h3 { font-size: 1rem; }
a { color: var(--blue); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 46px; padding: .62rem 1rem; border-radius: 8px; border: 1px solid transparent;
  background: var(--blue); color: white; text-decoration: none; font: inherit;
  font-weight: 650; cursor: pointer; text-align: center;
}
button:hover, .button:hover { filter: brightness(.93); }
button:disabled { opacity: .65; cursor: wait; }
.secondary { background: white; border-color: #bfcfdd; color: var(--navy); }
.danger { background: white; border-color: #dfbdc1; color: var(--red); }
.text-button { color: var(--blue); background: transparent; border: 0; }
:focus-visible { outline: 3px solid #ad6c22; outline-offset: 3px; }
.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { color: white; background: var(--navy); padding: 1.45rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; }
.brand { display: flex; gap: .8rem; align-items: center; font-size: 1.06rem; font-weight: 720; }
.brand img { width: 42px; height: 42px; border-radius: 9px; }
.brand small { display: block; font-size: .83rem; color: #c6d6e5; font-weight: 500; }
.nav { display: grid; gap: .34rem; }
.nav a { text-decoration: none; color: #dce8f2; min-height: 46px; padding: .65rem .8rem; border-radius: 8px; }
.nav a[aria-current] { background: #264760; color: white; font-weight: 680; }
.profile { margin-top: auto; display: grid; gap: .5rem; align-self: stretch; }
.profile p { color: #c6d6e5; font-size: .88rem; }
.profile button, .profile a { border-color: #597287; background: transparent; color: white; }
.workspace { min-width: 0; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(1rem,4vw,2.75rem); }
.mobile-head { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.4rem; }
.page-head p, .muted { color: var(--muted); }
.page-head p { margin-top: .4rem; }
.demo { padding: .34rem .65rem; border-radius: 20px; background: #e3ebf4; color: #1e466a; font-size: .81rem; font-weight: 690; white-space: nowrap; }
.overview { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.38fr); background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 1rem; }
.hero { padding: 1.45rem; color: white; background: var(--navy); display: grid; align-content: center; gap: .5rem; }
.hero span { color: #c6d9ed; }
.hero strong { font-size: clamp(1.7rem,4vw,2.6rem); line-height: 1.14; letter-spacing: -.045em; }
.metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: .6rem 1rem; }
.metric { padding: .76rem; display: grid; gap: .2rem; align-content: start; }
.metric span { font-size: .88rem; color: var(--muted); }
.metric strong { font-size: 1.12rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.panel { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 1.15rem; min-width: 0; }
.panel + .panel.full { margin-top: 1rem; }
.stack { display: grid; gap: 1rem; }
.tight { display: grid; gap: .55rem; }
.actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.actions.major { margin-bottom: 1.1rem; }
.row { display: flex; justify-content: space-between; gap: .6rem 1rem; align-items: start; padding: .68rem 0; }
.row + .row { border-top: 1px solid var(--line); }
.row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.row strong { font-variant-numeric: tabular-nums; }
.amount { text-align: right; white-space: nowrap; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.tag { display: inline-block; width: fit-content; border-radius: 20px; background: #e5eef6; color: #214d72; padding: .22rem .6rem; font-size: .87rem; }
.tag.pending { background: #fff0d9; color: #704811; }
.tag.paid { background: #e3f1eb; color: #185846; }
.tag.rejected,.tag.reversed { background: #f8e9ea; color: #80313d; }
form { margin: 0; }
label { display: grid; gap: .32rem; font-size: .92rem; font-weight: 620; }
input,select,textarea { width: 100%; min-height: 45px; padding: .58rem .66rem; border: 1px solid #adbecd; border-radius: 7px; background: white; font: inherit; font-size: 1rem; color: var(--ink); min-width: 0; }
input:disabled { color: var(--muted); background: #edf1f4; }
.check { display: flex; align-items: center; gap: .55rem; min-height: 44px; }
.check input { width: 20px; min-height: auto; height: 20px; accent-color: var(--blue); }
.pair,.fields { display: grid; gap: .8rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.fields.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.form-grid { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(0,1fr); align-items: start; gap: 1rem; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.absent { background: #f3f5f7; }
.summary { position: sticky; top: 1rem; }
.summary dl { margin: 0; }
.summary dl div { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; }
.summary dd { margin: 0; font-weight: 700; text-align: right; }
.summary .total { border-top: 1px solid var(--line); padding-top: .7rem; font-size: 1.14rem; }
details { border-top: 1px solid var(--line); padding: .45rem 0; }
summary { cursor: pointer; min-height: 44px; padding: .52rem 0; font-weight: 660; }
details[open] > summary { margin-bottom: .55rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: .35rem 0; }
.login-page { min-height: 100dvh; display: grid; align-items: center; justify-items: center; padding: 1rem; background: var(--navy); }
.login { width: min(100%, 430px); padding: 1.5rem; }
.login img { width: 50px; height: 50px; border-radius: 10px; }
dialog { padding: 1.3rem; border: 1px solid var(--line); border-radius: 12px; max-width: min(420px, 94vw); color: var(--ink); }
dialog form { display: grid; gap: .85rem; }
dialog::backdrop { background: #102538aa; }
.feedback { position: fixed; z-index: 2; right: 1rem; bottom: 1rem; max-width: min(94vw,420px); padding: .8rem 1rem; border-radius: 9px; background: #155642; color: white; box-shadow: 0 4px 16px #0002; }
.feedback.error { background: #81353e; }
.empty { padding: .6rem 0; color: var(--muted); }
[hidden] { display: none !important; }
@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { display: block; padding: .8rem 1rem; }
  .sidebar > .brand { display: none; }
  .mobile-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
  .mobile-head button { color: white; background: transparent; border-color: #597287; min-height: 42px; }
  .nav { margin-top: .65rem; background: #1a354d; padding: .2rem; border-radius: 9px; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .nav a { padding: .45rem .3rem; text-align: center; font-size: .87rem; display: grid; place-items: center; }
  .profile { display: none; }
  .workspace { padding-top: 1.4rem; }
}
@media (max-width: 590px) {
  .overview,.layout,.form-grid,.fields.three { grid-template-columns: 1fr; }
  .summary { position: static; }
  .hero { padding: 1.15rem; }
  .metrics { padding: .35rem .55rem; }
  .panel { padding: .9rem; }
  .major > * { flex: 1 1 145px; }
  .page-head { gap: .45rem; }
}
@media (max-width: 350px) { .fields { grid-template-columns: 1fr; } .demo { white-space: normal; } }
.mobile-account { color: white; }
