:root {
  --bg: #0e1116;
  --card: #171c24;
  --card2: #1f2630;
  --line: #2a3340;
  --text: #e8edf4;
  --muted: #8b97a7;
  --brand: #ff5a3c;
  --brand2: #ff7d29;
  --green: #26c281;
  --blue: #3b82f6;
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 84px; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }

header.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
}
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.4px; }
.logo span { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin: 14px 18px;
}
.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border: none; color: #fff;
}
.hero .balance { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.hero .balance small { font-size: 18px; font-weight: 600; opacity: .9; }
.stat-row { display: flex; gap: 10px; margin: 14px 18px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; text-align: center; }
.stat b { font-size: 20px; display: block; }
.stat span { font-size: 12px; color: var(--muted); }

h2.section { margin: 22px 18px 6px; font-size: 16px; }

button, .btn {
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  border: none; border-radius: 12px; padding: 13px 16px; width: 100%;
  background: var(--brand); color: #fff; transition: transform .05s, opacity .15s;
}
button:active { transform: scale(0.98); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn-green { background: var(--green); }
.btn-blue { background: var(--blue); }
.btn-sm { width: auto; padding: 9px 14px; font-size: 13px; }

input, select {
  font-family: inherit; font-size: 16px; width: 100%; padding: 13px 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); margin-bottom: 10px;
}
label.field { display: block; font-size: 13px; color: var(--muted); margin: 4px 2px; }

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.pill.issued { background: rgba(59,130,246,.15); color: #7fb0ff; }
.pill.used { background: rgba(139,151,167,.15); color: var(--muted); }
.pill.pts { background: rgba(255,90,60,.15); color: var(--brand2); }

.timer { font-size: 52px; font-weight: 800; text-align: center; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.dist { font-size: 30px; font-weight: 800; text-align: center; color: var(--brand2); }

/* 하단 탭바 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; background: none; color: var(--muted); border-radius: 0;
  padding: 10px 0 12px; font-size: 11px; font-weight: 600;
}
.tabbar button.active { color: var(--brand); }
.tabbar .ico { font-size: 20px; display: block; margin-bottom: 2px; }

.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: #000; color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; z-index: 100; max-width: 90%; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.coupon {
  background: var(--card); border: 1px dashed var(--line); border-radius: 14px;
  padding: 16px; margin: 12px 18px; position: relative;
}
.coupon.used { opacity: .55; }
.coupon .code {
  font-family: ui-monospace, "Consolas", monospace; font-size: 22px; font-weight: 800;
  letter-spacing: 2px; color: var(--brand2); margin: 6px 0;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* 관리자 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi b { font-size: 26px; display: block; }
.kpi span { color: var(--muted); font-size: 13px; }
.admin-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
a.link { color: var(--brand2); text-decoration: none; }
