/* Change the variables and the logo to rebrand. */
:root {
  --accent: #f7931a;
  --accent-dark: #b86600;
  --bg: #f6f6f6;
  --surface: #fff;
  --text: #222;
  --muted: #5f5f5f;
  --line: #e2e2e2;
  --error: #b3261e;
  --success: #1b7f4b;
  --radius: 12px;
}

@font-face { font-family: Montserrat; font-weight: 400; font-display: swap; src: url('/fonts/Montserrat-Regular.ttf') format('truetype'); }
@font-face { font-family: Montserrat; font-weight: 600; font-display: swap; src: url('/fonts/Montserrat-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-weight: 700; font-display: swap; src: url('/fonts/PlayfairDisplay-Bold.woff2') format('woff2'); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 Montserrat, system-ui, sans-serif;
}

h1, h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; line-height: 1.2; margin: 0 0 8px; outline: none; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 12px; }
a { color: var(--accent-dark); }

.brand { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 440px; margin: 8px 0 20px; }
.brand a { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 1.15rem; }
.brand img { border-radius: 50%; }

.card { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 12px rgb(0 0 0 / 7%); }

.legal { display: flex; gap: 16px; margin-top: auto; padding-top: 24px; font-size: .85rem; }
.legal a { color: var(--muted); }

label { display: block; margin: 16px 0 4px; font-weight: 600; font-size: .9rem; }
input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #b5b5b5;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid #b5b5b5;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: 600 1rem/1.2 Montserrat, system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { border-color: var(--text); }
button:disabled { opacity: .6; cursor: progress; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #1f1300; }
button.primary:hover, .button.primary:hover { background: #e8850f; border-color: #e8850f; }
button.link { min-height: 32px; padding: 4px 0; border: 0; background: none; color: var(--accent-dark); font-weight: 600; font-size: .9rem; text-decoration: underline; }
.card > form > .primary, .card > .primary, .card > .button { width: 100%; margin-top: 20px; }
.card > .primary + .button { margin-top: 10px; }
section > .link { display: block; margin: 16px auto 0; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { margin: 12px 0 0; color: var(--error); font-weight: 600; font-size: .92rem; }
.eyebrow { margin: 0; color: var(--muted); font-size: .85rem; font-weight: 600; word-break: break-word; }
.amount { margin: 2px 0 16px; font: 700 2rem/1.2 'Playfair Display', Georgia, serif; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.method-list { display: grid; gap: 10px; margin: 12px 0 16px; }
.method { display: grid; justify-content: stretch; justify-items: start; gap: 2px; width: 100%; padding: 12px 16px; text-align: left; }
.method:hover { border-color: var(--accent); background: #fff8ef; }
.method span { color: var(--muted); font-weight: 400; font-size: .85rem; }

.sats { margin: -12px 0 12px; color: var(--muted); font-weight: 600; }
.qr { display: block; width: min(100%, 280px); margin: 0 auto 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qr img { display: block; width: 100%; height: auto; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .button { padding: 10px 6px; font-size: .95rem; }
.copy-text { margin: 12px 0; padding: 8px 10px; border-radius: 6px; background: #f1f1f1; color: var(--muted); font: .75rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 4.4em; overflow: auto; overflow-wrap: anywhere; }
.status { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: #fff4e5; font-weight: 600; font-size: .92rem; }
.status[data-kind='pending'] { background: #e8f4ec; color: var(--success); }
.status[data-kind='warning'] { background: #fdecea; color: var(--error); }

.done-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 50%; background: var(--success); color: #fff; font-size: 2rem; }

/* Admin */
body.admin .brand { max-width: 1040px; }
#app-view { width: 100%; max-width: 1040px; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 12px rgb(0 0 0 / 7%); }
.panel summary { cursor: pointer; font-weight: 600; }
.panel[open] summary { margin-bottom: 12px; }
.banner { padding: 12px 16px; margin-bottom: 16px; border-radius: 8px; background: #fff4e5; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.row .field { flex: 1 1 200px; }
.row label { margin-top: 0; }
.result { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-top: 16px; padding: 16px; border: 1px solid var(--accent); border-radius: 8px; }
.result > div { flex: 1 1 240px; min-width: 0; }
.result p { margin-bottom: 4px; }
button.small { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
th, td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.row-actions { white-space: nowrap; }
.row-actions button { margin-right: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; background: #eee; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-open { background: #fff4e5; color: #8a4b00; }
.badge-pending { background: #e7f0fb; color: #1a5296; }
.badge-paid { background: #e8f4ec; color: var(--success); }
.badge-review { background: #fdecea; color: var(--error); }
.plain-list { list-style: none; margin: 12px 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }

/* On a phone every invoice becomes a small card instead of a wide table. */
@media (max-width: 720px) {
  thead { display: none; }
  table, tbody { display: block; }
  tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  td { padding: 0; border: 0; }
  td:nth-child(5), td:nth-child(6), td:nth-child(7) { grid-column: 1 / -1; }
  td:nth-child(5) { color: var(--muted); font-size: .85rem; }
  td:nth-child(2), td:nth-child(4) { text-align: right; }
  .row-actions { padding-top: 4px; }
}
