:root {
  color-scheme: dark;
  --night: #091422;
  --panel: #13273e;
  --line: #30465b;
  --text: #f3f6fa;
  --muted: #b7c8d9;
  --orange: #ff9225;
}
* { box-sizing: border-box }
body { margin: 0; background: var(--night); color: var(--text); font: 16px/1.5 system-ui,sans-serif }
main { width: min(1120px,100%); margin: auto; padding: 28px clamp(16px,4vw,48px) 60px }
.brand { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-weight: 700; letter-spacing: .06em }
.brand img { width: 66px; height: auto; border-radius: 6px }
h1 { font-size: clamp(32px,5vw,58px); letter-spacing: -.04em; line-height: 1.1; margin: 32px 0 24px }
h2 { font-size: 19px; margin: 0 }
ul { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 12px }
li,form { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px }
li p { margin: 5px 0 0; color: var(--muted) }
.finance { border-top: 3px solid var(--orange); padding-top: 18px }
a { color: #ffab58; text-underline-offset: .23em }
li a,.back { display: inline-block; margin-top: 12px }
form { max-width: 500px }
input,button { font: inherit; border-radius: 6px; padding: 10px 12px }
input { background: var(--night); color: var(--text); width: 100%; margin: 8px 0 16px; border: 1px solid #71879c }
button { background: var(--orange); border: 0; color: #15191e; font-weight: 700; cursor: pointer }
:focus-visible { outline: 3px solid #ffbb74; outline-offset: 3px }
.table-scroll { overflow-x: auto }
table { width: 100%; border-collapse: collapse; background: var(--panel); font-variant-numeric: tabular-nums }
caption { text-align: left; padding: 12px 0; color: var(--muted) }
td { padding: 9px 12px; border-bottom: 1px solid var(--line) }
.section { background: #203d59; font-weight: 700 }
.total { background: #233347; color: #ffb668; font-weight: 700 }
body { min-height:100vh; background:radial-gradient(ellipse at 82% 0%,#17324d 0%,transparent 42%),#091422 }
header { margin-bottom:30px }
.brand { font-size:14px; letter-spacing:.12em }
.brand img { width:52px; border-radius:5px }
main > ul { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px }
main > ul > li { background:linear-gradient(125deg,#172e47,#112338); padding:22px; box-shadow:0 6px 20px #0002 }
main > ul > .finance { order:-1; grid-column:1/-1; background:linear-gradient(105deg,#213c57,#13283f); border-top:1px solid var(--line); border-left:4px solid var(--orange) }
.finance br { display:none }
.finance a { background:#ff992f; color:#152437; border-radius:6px; padding:8px 13px; font-size:14px; font-weight:700; text-decoration:none; margin:15px 8px 0 0 }
.finance a:hover { background:#ffb367 }
section { margin:20px 0; border:1px solid var(--line); padding:20px; border-radius:10px; background:var(--panel) }
summary { color:#ffb66c; cursor:pointer; padding:6px 0 }
hr { display:none }
@media(max-width:800px){ main > ul { grid-template-columns:repeat(2,minmax(0,1fr)) } }
@media(max-width:520px){ main > ul { grid-template-columns:1fr } .finance a { display:block } }

.finance-amount, .finance-balance, .finance-settled, .total td {
  font-variant-numeric: tabular-nums; font-weight: 700;
}
.finance-amount { color: #ffce8b; white-space: nowrap; }
.finance-balance { color: #60e7cd; }
.finance-settled { color: #bbccdc; }
.finance-alert, [role="alert"] { color: #ffb4a9; background: #42232d; padding: 3px 6px; border-radius: 4px; }
.total td { color: #ffd18b; background: #342d24; border-block: 1px solid #aa7342; }
td details form { min-width: 220px; }

.mois-nav {display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:20px 0}
.mois-nav form {display:flex;align-items:center;gap:8px;margin:0;padding:6px 10px}
.mois-nav input {width:auto;margin:0}
.flux-plus {--wash:#f1f7f2;--edge:#e0ede2;--ink:#273d31}
.flux-moins {--wash:#fcf4ef;--edge:#f2e3da;--ink:#49382f}
.flux-neutre {--wash:#f2f4f6;--edge:#e3e7ea;--ink:#303b46}
table:is(.flux-plus,.flux-moins,.flux-neutre) {background:var(--wash);color:var(--ink);margin-bottom:20px;color-scheme:light}
:is(.flux-plus,.flux-moins,.flux-neutre) :is(td,th) {background:var(--wash);color:var(--ink);padding:10px 12px;border-bottom:1px solid var(--edge);text-align:left}
:is(.flux-plus,.flux-moins,.flux-neutre) :is(thead,tfoot) :is(td,th) {background:var(--edge);font-weight:650}
:is(.flux-plus,.flux-moins,.flux-neutre) summary {color:var(--ink)}
:is(.flux-plus,.flux-moins,.flux-neutre) form {color:var(--text);color-scheme:dark}
.argent-plus,.argent-moins {display:inline-block;border-radius:4px;padding:2px 6px;font-weight:650;font-variant-numeric:tabular-nums}
.argent-plus {background:#f1f7f2;color:#273d31}
.argent-moins {background:#fcf4ef;color:#49382f}
td.argent-moins {display:table-cell}
