:root {
  --brand: #1f6feb; --brand-dark: #1a5fd0;
  --ink: #1a1a1a; --muted: #6b7280;
  --bg: #f7f8fa; --card: #fff; --line: #e8eaed;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, sans-serif; color: var(--ink); background: var(--bg); }
#app { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
h1 { color: var(--brand); font-size: 1.6rem; margin: 0 0 1.5rem; }
h2 { font-size: 1.05rem; margin: 2rem 0 .75rem; }

/* --- controls: one size for every input and button --- */
input, button {
  height: 40px; padding: 0 .8rem; border-radius: 8px;
  border: 1px solid #ccc; font: inherit; line-height: 1.2;
}
button {
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  font-weight: 600; white-space: nowrap; transition: background .12s;
}
button:hover:not(:disabled) { background: var(--brand-dark); }
button:disabled { opacity: .55; cursor: default; }

/* --- forms: inputs share the row evenly, the button never shrinks/wraps --- */
form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form input { flex: 1 1 160px; min-width: 0; }
form button { flex: 0 0 auto; }
/* checkbox rows sit inside the flex form, so stop the box being stretched to the
   40px control height and keep it next to its label */
form label { display: flex; align-items: center; gap: .4rem; flex: 0 0 auto; white-space: nowrap; }
form label input[type="checkbox"] { flex: 0 0 auto; height: auto; width: auto; margin: 0; }
input:disabled { background: #f0f1f3; color: var(--muted); }
#payout-status { color: var(--muted); font-size: .9rem; margin: .25rem 0 .75rem; }
p[id$="-msg"] { color: var(--muted); font-size: .9rem; min-height: 1.2em; margin: .5rem 0 0; }

/* --- tables --- */
table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: 10px; overflow: hidden; margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
th {
  color: var(--muted); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .02em; white-space: nowrap;
}

/* --- one action-cell pattern for every table --- */
.actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.actions.nowrap { flex-wrap: nowrap; } /* keep a row's controls on one line */
.actions button { height: 32px; padding: 0 .7rem; font-size: .85rem; }
.actions input { height: 32px; width: 3.5rem; padding: 0 .5rem; }
.actions button.danger { background: #fff; color: #d33f3f; border: 1px solid #e6b3b3; }
.actions button.danger:hover:not(:disabled) { background: #fdecec; }

code, .key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
code { background: #eef2ff; padding: .1rem .4rem; border-radius: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card { background: var(--card); border-radius: 10px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card .label { display: block; color: var(--muted); font-size: .85rem; }
.card .value { font-size: 1.5rem; font-weight: 600; }
