/* Rentala — one stylesheet, mobile-first, outdoor-readable. */
:root {
  --bg: #f6f7f8; --card: #ffffff; --ink: #17202a; --muted: #5c6770;
  --line: #dde2e6; --brand: #b45309; --brand-ink: #ffffff;
  --ok: #157347; --warn: #b45309; --bad: #b02a37; --info: #0b5ed7;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
}
main { max-width: 640px; margin: 0 auto; padding: 12px 14px 96px; }
header.app {
  position: sticky; top: 0; z-index: 20; background: var(--card);
  border-bottom: 1px solid var(--line); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
header.app h1 { font-size: 18px; margin: 0; flex: 1; }
header.app .tag { color: var(--muted); font-size: 13px; }
h2 { font-size: 16px; margin: 20px 0 8px; }
p.muted, .muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 10px 0;
}
.banner { border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; font-weight: 600; }
.banner.ok { background: #d9f2e5; color: var(--ok); }
.banner.warn { background: #fdeed9; color: #7a3e07; }
.banner.bad { background: #fadedd; color: var(--bad); }
.banner.info { background: #dbe9fd; color: #0a4bab; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { opacity: .45; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btnrow { display: flex; gap: 10px; margin: 10px 0; }
.btnrow > * { flex: 1; }

label { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 4px; }
input[type=text], input[type=tel], input[type=date], input[type=datetime-local],
input[type=number], input[type=password], textarea, select {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 72px; resize: vertical; }
.field-err { color: var(--bad); font-size: 13px; margin-top: 3px; }
.hp { position: absolute; left: -5000px; top: -5000px; }

/* Calendar */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 10px 0; }
.cal h3 { text-align: center; font-size: 15px; margin: 4px 0 8px; }
.cal .dow, .cal .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow div { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.cal button.day {
  min-height: 48px; padding: 0; border-radius: 9px; border: 1px solid transparent;
  background: #fff; font-weight: 600; font-size: 15px;
}
.cal button.day.free { border-color: var(--line); }
.cal button.day:disabled { color: #c3c9ce; background: transparent; font-weight: 400; }
.cal button.day.blocked { background: #eceff1; color: #9aa4ab; text-decoration: line-through; }
.cal button.day.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.cal button.day.inrange { background: #f6dcc0; border-color: #f6dcc0; }

.stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.stickybar .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.stickybar .sum { flex: 1; font-weight: 700; }
.stickybar .sub { font-size: 12px; color: var(--muted); font-weight: 400; }

/* Money rows */
.money { width: 100%; border-collapse: collapse; }
.money td { padding: 6px 0; }
.money td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.money tr.total td { border-top: 2px solid var(--ink); font-size: 19px; padding-top: 9px; }

/* Terms */
.terms { font-size: 15px; }
.terms p { margin: 0 0 10px; }
.attest {
  display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 12px; margin: 14px 0; min-height: 56px;
}
.attest input[type=checkbox] { width: 26px; height: 26px; margin-top: 2px; flex: none; }

/* Signature pad */
.sigwrap { border: 2px dashed var(--line); border-radius: var(--radius); background: #fff; position: relative; }
.sigwrap canvas { display: block; width: 100%; height: 180px; touch-action: none; border-radius: var(--radius); }
.sigwrap .hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #c3c9ce; font-size: 15px; pointer-events: none; }

/* Admin lists */
.item { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 8px 0; color: inherit; text-decoration: none; }
.item .t { font-weight: 700; }
.item .s { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.requested { background: #dbe9fd; color: #0a4bab; }
.pill.approved { background: #d9f2e5; color: var(--ok); }
.pill.active { background: #fdeed9; color: #7a3e07; }
.pill.completed { background: #e7e9eb; color: #444; }
.pill.denied, .pill.cancelled, .pill.expired { background: #fadedd; color: var(--bad); }
.pill.overdue { background: var(--bad); color: #fff; }

.savestate { font-size: 13px; font-weight: 700; }
.savestate.saving { color: var(--warn); }
.savestate.saved { color: var(--ok); }
.savestate.failed { color: var(--bad); }

.phototiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card);
  min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 10px; text-align: center; position: relative; overflow: hidden; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .lbl { font-weight: 700; font-size: 14px; z-index: 1; background: rgba(255,255,255,.85); border-radius: 8px; padding: 2px 8px; }
.tile .chip { position: absolute; bottom: 6px; left: 6px; right: 6px; z-index: 1; font-size: 11px; font-weight: 700;
  border-radius: 8px; padding: 3px 6px; background: rgba(255,255,255,.92); }
.tile .chip.warn { color: #7a3e07; } .tile .chip.ok { color: var(--ok); }

.qrbox { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; }
.qrbox svg, .qrbox img { width: 240px; height: 240px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

dialog { border: none; border-radius: var(--radius); padding: 18px; max-width: min(92vw, 480px); }
dialog::backdrop { background: rgba(0,0,0,.45); }

.copylink { display: flex; gap: 8px; align-items: center; }
.copylink input { flex: 1; font-size: 13px; }

@media (min-width: 700px) { .cal button.day { min-height: 56px; } }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

