/* Invoicer web UI. The palette lives in tokens.css. */
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
header { background: #fff; border-bottom: 1px solid var(--line); }
nav { max-width: 1000px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 20px; align-items: baseline; }
nav .brand { font-weight: 700; margin-right: auto; }
nav a { color: var(--accent); text-decoration: none; }
nav a:hover { text-decoration: underline; }
main { max-width: 1000px; margin: 24px auto; padding: 0 20px 60px; }
/* Invoice tables carry long issue summaries; give them the window. */
main.wide { max-width: min(1600px, 96vw); }
nav.wide { max-width: min(1600px, 96vw); }
h1 { font-size: 22px; margin: 0 0 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
input, select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.field { margin-bottom: 4px; }
.actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; }
button, .btn { padding: 9px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.secondary { background: #fff; color: var(--accent); }
button:hover, .btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.secondary:hover { background: var(--tint); color: var(--accent-dark); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--head); background: var(--tint); }
/* Group headers: the tint carries the grouping, the rule survives printing. */
tr.group td { background: var(--tint); border-top: 1px solid var(--rule); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.msg.error { background: #fdecea; border: 1px solid #f5c2bd; }
.msg.success { background: #e8f5ec; border: 1px solid #b7ddc4; }
.msg.warning { background: #fdf5e2; border: 1px solid #ecd9a4; }
.msg.info { background: var(--tint); border: 1px solid var(--rule); }
.badge { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
         padding: 3px 9px; border-radius: 999px; vertical-align: middle; }
.badge.sent { background: var(--head); color: #fff; }
.errorlist { color: #b3261e; list-style: none; padding: 0; margin: 4px 0 0; font-size: 14px; }
.muted { color: var(--muted); }
.totals { margin-left: auto; width: 320px; }
.totals td { border: none; padding: 3px 10px; }
.totals tr.grand td { font-weight: 700; border-top: 1px solid var(--head); padding-top: 8px; }
