:root {
  --bg: #f5f6fa; --surface: #fff; --text: #172033; --muted: #5d6880; --border: #e2e5ee;
  --primary: #2f5bea; --primary-text: #fff; --ok: #137a48; --ok-bg: #e3f5ec; --warn: #8a5a00;
  --warn-bg: #fff3d6; --bad: #b42318; --bad-bg: #fdeceb; --info-bg: #e8eefe;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420; --surface: #171e2e; --text: #e6e9f2; --muted: #9aa4bb; --border: #283146;
    --primary: #6d8cff; --primary-text: #0b1020; --ok: #4cd18b; --ok-bg: #12301f; --warn: #f2c14e;
    --warn-bg: #3a2f10; --bad: #ff7b72; --bad-bg: #3b1716; --info-bg: #1b2647;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }

.topbar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand svg { width: 26px; height: 26px; fill: var(--primary); }
nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
nav a { color: var(--muted); font-weight: 500; }
nav a.active { color: var(--text); }
.user { margin-left: auto; display: flex; gap: 1rem; align-items: center; color: var(--muted); }
.badge {
  display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: .75rem; text-align: center;
}

main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 1.5rem; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

.banner { padding: .7rem 1.5rem; text-align: center; background: var(--info-bg); }
.banner.error { background: var(--bad-bg); color: var(--bad); }
.banner.success { background: var(--ok-bg); color: var(--ok); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.stack > * + * { margin-top: 1.25rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.center { justify-content: center; }
.note { margin-top: 1rem; font-size: .9rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.amount.big { font-size: 1.8rem; }
.amount.pos { color: var(--ok); }
.amount.neg { color: var(--text); }

.account-card .name { font-weight: 600; }
.account-card .iban { color: var(--muted); }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--primary); background: var(--primary); color: var(--primary-text);
  font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 8px; cursor: pointer;
}
button.secondary, .button.secondary { background: transparent; color: var(--primary); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.link { background: none; border: 0; color: var(--primary); padding: 0; font-weight: 500; }
button:disabled { opacity: .55; cursor: not-allowed; }

form.form { display: grid; gap: 1rem; max-width: 520px; }
label { display: grid; gap: .3rem; font-weight: 500; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem .7rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }
td.right, th.right { text-align: right; }
.table-wrap { overflow-x: auto; }

.status { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.status.COMPLETED, .status.MATCH { background: var(--ok-bg); color: var(--ok); }
.status.REVIEW, .status.PENDING, .status.PROCESSING, .status.CLOSE_MATCH { background: var(--warn-bg); color: var(--warn); }
.status.REJECTED, .status.FAILED, .status.NO_MATCH { background: var(--bad-bg); color: var(--bad); }
.status.DISABLED, .status.LOCKED { background: var(--bad-bg); color: var(--bad); }
.status.NOT_AVAILABLE { background: var(--info-bg); color: var(--muted); }

.hero { text-align: center; padding: 3rem 1rem; }
.hero h1 { font-size: 2.2rem; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 1.5rem; }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 2rem; text-align: left; }

.notice { padding: .8rem 1rem; border-radius: 8px; background: var(--info-bg); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.error { background: var(--bad-bg); color: var(--bad); }
.notice.success { background: var(--ok-bg); color: var(--ok); }
.unread { border-left: 3px solid var(--primary); }
.empty { color: var(--muted); text-align: center; padding: 2rem; }
