:root {
  --primary: #E30A17;
  --primary-dark: #B90812;
  --primary-light: #FF5566;
  --primary-soft: rgba(227, 10, 23, 0.1);
  --bg: #fdf9fa;
  --bg-elev: #ffffff;
  --text: #1a0a0e;
  --muted: #6b4a50;
  --border: #f0e6e8;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(26, 10, 14, 0.08);
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --display: Syne, "Plus Jakarta Sans", sans-serif;
}
body.theme-dark {
  --bg: #14080b;
  --bg-elev: #1f1014;
  --text: #fdf9fa;
  --muted: #c9a8ae;
  --border: #3a2228;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
.app { min-height: 100%; display: flex; flex-direction: column; }
.splash {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: #1a0a0e; color: #fff;
}
.splash img { width: 72px; height: 72px; border-radius: 18px; }
.splash strong { font-family: var(--display); font-size: 22px; }
.splash span { color: rgba(255,255,255,.65); font-size: 13px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.balance-chip {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff; border: 0; border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: 13px;
}

.screen { padding: 16px 16px calc(var(--nav-h) + var(--safe-bot) + 20px); flex: 1; }
.hero-card, .card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
}
.hero-card h1, .screen h1 { font-family: var(--display); font-size: 26px; line-height: 1.15; }
.muted { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick {
  display: flex; flex-direction: column; gap: 6px; padding: 14px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); text-align: left;
}
.quick b { font-size: 13px; }
.quick span { font-size: 12px; color: var(--muted); }

label { display: block; font-size: 12px; font-weight: 700; margin: 0 0 6px; }
.field, select.field, textarea.field {
  width: 100%; border: 1.5px solid var(--border); background: var(--bg);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; outline: none;
}
.field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 700; cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(145deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-ghost { background: var(--bg-elev); color: var(--text); border: 1.5px solid var(--border); }
.btn-google { background: #fff; color: #1f1f1f; border: 1.5px solid #e5e7eb; }
body.theme-dark .btn-google { background: #fff; }
.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 14px; }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #fef2f2; color: var(--danger); }
.alert-ok { background: #f0fdf4; color: var(--ok); }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); }
body.theme-dark .alert-error { background: rgba(185,28,28,.18); color: #fecaca; }
body.theme-dark .alert-ok { background: rgba(21,128,61,.18); color: #bbf7d0; }

.list-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: 0; }
.badge { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 4px 8px; }
.badge-pending { background: #fff7ed; color: var(--warn); }
.badge-completed, .badge-green { background: #f0fdf4; color: var(--ok); }
.badge-canceled, .badge-cancelled, .badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-inprogress, .badge-processing { background: #eff6ff; color: #1d4ed8; }
.badge-partial { background: #fef3c7; color: #92400e; }

.tabs { display: flex; gap: 8px; overflow: auto; padding-bottom: 8px; margin-bottom: 8px; }
.chip {
  border: 1.5px solid var(--border); background: var(--bg-elev); border-radius: 999px;
  padding: 8px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.chip.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px calc(8px + var(--safe-bot));
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.bottom-nav button {
  background: none; border: 0; color: var(--muted); font-size: 10px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px;
}
.bottom-nav button.is-on { color: var(--primary); }
.bottom-nav svg { width: 22px; height: 22px; }

.empty { text-align: center; padding: 32px 12px; color: var(--muted); }
.skeleton { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--border), var(--bg), var(--border)); background-size: 200% 100%; animation: shine 1.2s infinite; }
@keyframes shine { to { background-position: -200% 0; } }
.row-actions { display: flex; gap: 8px; margin-top: 8px; }
.row-actions .btn { width: auto; padding: 8px 12px; font-size: 12px; }
.wallet {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all; background: var(--bg); border-radius: 12px; padding: 12px; font-size: 13px;
}
.auth-wrap { min-height: 100vh; padding: calc(28px + var(--safe-top)) 20px 32px; }
.auth-wrap .brand { margin-bottom: 24px; }
.hidden { display: none !important; }
.reply { padding: 10px 0; border-bottom: 1px solid var(--border); }
.reply.staff { background: rgba(21,128,61,.08); margin: 0 -16px; padding: 10px 16px; }
.svc-rate { font-weight: 800; color: var(--primary); white-space: nowrap; }
