:root {
  --bg: #14110e;
  --bg-2: #1c1814;
  --paper: #221c16;
  --line: #3a3128;
  --ink: #f3eadf;
  --muted: #a89880;
  --gold: #e8c872;
  --gold-dim: #b8963a;
  --cash: #8fbf88;
  --card: #e8c872;
  --bizum: #7eb6d9;
  --xfer: #c9a0d9;
  --danger: #e07a6a;
  --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 var(--safe);
}

#app { max-width: 440px; margin: 0 auto; padding: 20px 18px 40px; }

h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 8px 0 4px;
}
.lede { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}
.tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.tile .lbl { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tile .num { font-size: 22px; margin-top: 6px; color: var(--gold); font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

form.add {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 22px;
}
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
input[type="text"], input[type="number"], input[type="password"], input[type="date"], textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 17px;
}
input:focus, textarea:focus { outline: 2px solid var(--gold-dim); border-color: transparent; }
.metodos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metodos label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.metodos input { accent-color: var(--gold); }
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  background: var(--gold);
  color: #1a140c;
  font-weight: 600;
  width: 100%;
  margin-top: 14px;
  font-size: 16px;
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
button.danger { background: transparent; color: var(--danger); width: auto; padding: 6px 10px; margin: 0; font-size: 13px; }
.msg { margin-top: 10px; font-size: 14px; color: var(--cash); min-height: 1.2em; }
.msg.err { color: var(--danger); }

.day { margin: 18px 0 8px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row .who { flex: 1; min-width: 0; }
.row .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who span { font-size: 12px; color: var(--muted); }
.row .eur { font-variant-numeric: tabular-nums; font-size: 16px; }
.pill {
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: capitalize;
}
.pill.efectivo { color: var(--cash); }
.pill.tarjeta { color: var(--card); }
.pill.bizum { color: var(--bizum); }
.pill.transferencia { color: var(--xfer); }

.login { padding-top: 48px; }
.login h1 { font-size: 36px; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.toolbar h2 { font-size: 16px; margin: 0; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 16px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--gold); }
