:root { color-scheme: light; --purple: #6b4fa1; --purple-soft: #f3eefb; --ink: #2b2438; --muted: #6f6580; --line: #e3dcef; --red: #a33; --green: #2e7d4f; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #faf8fd; color: var(--ink); line-height: 1.45; }
header { background: var(--purple); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
header h1 { margin: 0; font-size: 1.3rem; }
header p { margin: 2px 0 0; opacity: .9; font-size: .9rem; }
header button { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.5); }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; font-size: 1rem; }
button.primary { background: var(--purple); color: #fff; border-color: var(--purple); }
button:disabled { opacity: .55; cursor: default; }
#gate, #app { max-width: 720px; margin: 16px auto; padding: 0 12px 32px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 10px; font-size: 1.15rem; }
.muted { color: var(--muted); font-size: .9rem; }
.err { background: #fdecea; color: var(--red); border: 1px solid #f3c1bd; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
label { display: block; font-weight: 600; margin: 10px 0 4px; }
input, select { width: 100%; padding: 9px 10px; font-size: 1rem; border: 1px solid #c9bddb; border-radius: 8px; background: #fff; }
.row { display: flex; gap: 12px; }
.row > div { flex: 1; min-width: 0; }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.total { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.total .num { font-size: 1.25rem; font-weight: 700; }
.total .lbl { font-size: .85rem; color: var(--muted); }
.total.warn { border-color: #e8b4b4; background: #fdf3f3; }
.total.warn .num { color: var(--red); }
.group h3 { margin: 20px 0 8px; font-size: 1.05rem; }
.bill { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.bill.overdue { border-color: #e8b4b4; }
.bill .dot { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--purple); background: #fff; color: var(--purple); font-size: 1rem; line-height: 1; padding: 0; margin-top: 2px; }
.bill.paid .dot { background: var(--green); border-color: var(--green); color: #fff; }
.bill .main { flex: 1; min-width: 0; }
.bill .name { font-weight: 700; }
.bill .sub { color: var(--muted); font-size: .9rem; }
.bill .amt { font-weight: 700; white-space: nowrap; }
.bill .when { font-size: .9rem; }
.bill .when.over { color: var(--red); font-weight: 700; }
.bill .when.soon { color: #8a5a00; font-weight: 600; }
.bill .actions { display: flex; gap: 6px; margin-top: 6px; }
.bill .actions button { padding: 4px 10px; font-size: .9rem; }
.tag { display: inline-block; background: var(--purple-soft); color: var(--purple); border-radius: 20px; padding: 1px 8px; font-size: .8rem; margin-left: 6px; }
.empty { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 14px; }
@media (max-width: 560px) { .totals { grid-template-columns: repeat(2, 1fr); } .row { flex-direction: column; gap: 0; } }
