*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f4f5f7;
  --surface:  #ffffff;
  --border:   #e0e3e9;
  --text:     #1a1d23;
  --muted:    #6b7280;
  --primary:  #2563eb;
  --primary-hover: #1d4ed8;
  --success:  #16a34a;
  --danger:   #dc2626;
  --radius:   8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
}
.header-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { font-weight: 700; font-size: 16px; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.location-badge {
  background: #eff6ff;
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ── Main ────────────────────────────────────────────────────────── */
main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card.centered { max-width: 480px; margin-left: auto; margin-right: auto; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Two column ──────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* ── Page header ─────────────────────────────────────────────────── */
.page-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 22px; }

/* ── Forms ───────────────────────────────────────────────────────── */
h1 { font-size: 22px; margin-bottom: 1.25rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type="text"], input[type="password"], select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  background: white;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-full { width: 100%; text-align: center; display: block; margin-top: .5rem; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 14px; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

/* ── Table ───────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); }
tr.row-done td { color: var(--muted); }

/* ── DL ──────────────────────────────────────────────────────────── */
dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; }
dt { font-weight: 600; font-size: 13px; color: var(--muted); padding-top: 2px; }
dd { font-size: 14px; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: var(--success); }
.badge-neutral  { background: #f3f4f6; color: var(--muted); }

/* ── Card on file ────────────────────────────────────────────────── */
.card-on-file { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 14px; display: flex; gap: .75rem; align-items: center; }

/* ── Total amount ────────────────────────────────────────────────── */
.total-amount { font-size: 36px; font-weight: 700; margin: .5rem 0; }

/* ── Alert ───────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 1.25rem; font-size: 14px; }
.alert-error { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; }

/* ── Muted ───────────────────────────────────────────────────────── */
.muted { color: var(--muted); font-size: 13px; }

/* ── Success icon ────────────────────────────────────────────────── */
.success-icon {
  width: 56px; height: 56px;
  background: #dcfce7;
  color: var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  margin: 0 auto 1rem;
}

/* ── Receipt table ───────────────────────────────────────────────── */
.receipt-table { width: 100%; margin: 1rem 0 1.5rem; }
.receipt-table th { text-align: right; width: 40%; color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px 12px; background: none; text-transform: none; letter-spacing: 0; }
.receipt-table td { font-size: 14px; padding: 8px 12px; }

/* ── Action row ──────────────────────────────────────────────────── */
.action-row { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }

/* ── Charge summary ──────────────────────────────────────────────── */
.charge-summary { text-align: center; padding: 1rem 0 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
