:root {
  --bg: #0a0c0b;
  --panel: #121512;
  --card: #171b16;
  --line: #2a322c;
  --gold: #d4af37;
  --tx: #e8edea;
  --mut: #8a948e;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--tx);
  font-family: Archivo, system-ui, sans-serif;
}
body {
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}

#app { min-height: 100dvh; }

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 320px at 20% -10%, rgba(212,175,55,.18), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px 20px;
}
.login-card img {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 14px;
}
.login-card h1 {
  margin: 0 0 4px;
  text-align: center;
  font-size: 1.15rem;
  color: var(--gold);
}
.login-card p {
  margin: 0 0 18px;
  text-align: center;
  color: var(--mut);
  font-size: .9rem;
}
label {
  display: block;
  font-size: .78rem;
  color: var(--mut);
  margin: 0 0 6px;
  font-weight: 600;
}
input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e110f;
  color: var(--tx);
  padding: 0 12px;
  font-size: 1rem;
  margin-bottom: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  font-family: inherit;
}
.btn-primary {
  width: 100%;
  background: var(--gold);
  color: #0a0c0b;
  margin-top: 6px;
}
.btn-ghost {
  background: #1a1f1c;
  color: var(--tx);
  border: 1px solid var(--line);
}
.btn-task {
  width: 100%;
  justify-content: space-between;
  background: #1a1f1c;
  color: var(--tx);
  border: 1px solid var(--line);
  text-align: left;
  padding: 12px 14px;
}
.btn-task:disabled { opacity: .45; cursor: default; }
.err {
  color: var(--err);
  font-size: .85rem;
  min-height: 1.2em;
  margin: 4px 0 8px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(10,12,11,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top h1 {
  margin: 0;
  font-size: 1rem;
  color: var(--gold);
}
.top .sub { color: var(--mut); font-size: .78rem; }

.wrap { padding: 14px 16px 28px; }
.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.stat b { display: block; font-size: 1.4rem; color: var(--gold); }
.stat span { color: var(--mut); font-size: .78rem; }

.trip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.trip-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.folio { font-weight: 800; color: var(--gold); }
.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(212,175,55,.15);
  color: var(--gold);
}
.meta { color: var(--mut); font-size: .82rem; line-height: 1.4; margin-bottom: 10px; }
.route { font-weight: 600; margin: 0 0 10px; font-size: .95rem; }
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task-title { font-weight: 700; }
.task-sub { color: var(--mut); font-size: .78rem; font-weight: 500; }
.done-tag { color: var(--ok); font-size: .75rem; font-weight: 700; }

.empty {
  text-align: center;
  color: var(--mut);
  padding: 40px 16px;
}
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: #1c241e;
  border: 1px solid var(--line);
  color: var(--tx);
  padding: 12px 14px;
  border-radius: 12px;
  z-index: 50;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.toast[hidden] { display: none !important; }


.trip.focus {
  border-color: rgba(212, 175, 55, 0.85);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35), 0 12px 28px rgba(0,0,0,.35);
}

.wrap {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.tabnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 12, 11, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mut);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  min-height: 40px;
  border-radius: 10px;
  cursor: pointer;
}
.tab.active {
  color: #0a0c0b;
  background: var(--gold);
}

.pay-hero {
  background: linear-gradient(160deg, rgba(212,175,55,.16), rgba(23,27,22,.9));
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
}
.pay-hero .lbl {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
}
.pay-hero .period {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--tx);
}
.pay-hero .net {
  margin: 8px 0;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.pay-list { display: flex; flex-direction: column; gap: 10px; }
.pay-card {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}
.pay-card.focus {
  border-color: rgba(212, 175, 55, 0.85);
}
.pay-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.pay-card-net {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.chip.ok { background: #153021; color: var(--ok); }
.chip.warn { background: #2b2612; color: var(--warn); }

.block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.block h2 {
  margin: 0 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mut);
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.row:last-child { border-bottom: 0; }
.row.total {
  font-weight: 800;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.mono { font-variant-numeric: tabular-nums; }
.minus { color: var(--err); }
.trip-line {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.trip-line:last-child { border-bottom: 0; }
.trip-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #12283f;
  color: #60a5fa;
  margin-left: 6px;
  font-weight: 700;
}
.notes {
  font-size: 0.92rem;
  white-space: pre-wrap;
  line-height: 1.45;
}
.back-btn {
  margin-bottom: 12px;
  width: auto;
  min-height: 36px;
  padding: 0 12px;
}
.share-link {
  display: flex;
  width: 100%;
  text-decoration: none;
  margin-top: 4px;
}
.foot-note {
  color: var(--mut);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.45;
  margin: 14px 0 0;
}
.toast {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
