:root {
  --ink: #1d1b19;
  --muted: #6f6860;
  --line: #e4ddd3;
  --paper: #fbf7f0;
  --panel: #ffffff;
  --accent: #1f7a68;
  --accent-dark: #155547;
  --gold: #c6923d;
  --danger: #b84242;
  --shadow: 0 18px 45px rgba(38, 31, 24, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
}

.app-body {
  background:
    linear-gradient(180deg, rgba(31, 122, 104, 0.16), transparent 280px),
    var(--paper);
}

.mobile-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.hero-panel {
  min-height: 172px;
  border-radius: 8px;
  padding: 22px;
  color: white;
  background:
    linear-gradient(135deg, rgba(29, 27, 25, 0.92), rgba(31, 122, 104, 0.82)),
    url("https://images.unsplash.com/photo-1514933651103-005eec06c04b?auto=format&fit=crop&w=1000&q=80") center/cover;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.balance-pill {
  min-width: 96px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: 12px;
  text-align: right;
  background: rgba(255, 255, 255, 0.12);
}

.balance-pill span {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.balance-pill small,
.muted,
.list-item p,
.stat small {
  color: var(--muted);
}

.hero-panel .balance-pill small {
  color: rgba(255, 255, 255, 0.78);
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(38, 31, 24, 0.06);
}

.level-card,
.qr-card {
  margin-top: 14px;
  padding: 18px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece5da;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.3s ease;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.stat {
  padding: 16px;
}

.stat span {
  display: block;
  font-size: 25px;
  font-weight: 850;
}

.qr-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.qr-card img {
  width: 118px;
  height: 118px;
  border-radius: 8px;
}

.code {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 850;
  color: var(--accent);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 14px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 247, 240, 0.9);
  backdrop-filter: blur(12px);
}

.tab {
  min-height: 38px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
}

.tab.active {
  color: white;
  background: var(--accent);
}

.tab-panel {
  display: grid;
  gap: 10px;
}

.hidden {
  display: none;
}

.list-item,
.form-card {
  padding: 16px;
}

.list-item strong {
  display: block;
  margin-bottom: 4px;
}

.row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.positive {
  color: var(--accent);
  font-weight: 800;
}

.negative,
.error {
  color: var(--danger);
  font-weight: 800;
}

.form-card {
  display: grid;
  gap: 12px;
}

.form-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.admin-body {
  background: #f6f3ee;
}

.admin-header,
.admin-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 18px;
}

.admin-header h1 {
  color: var(--ink);
}

.admin-main {
  display: grid;
  gap: 16px;
  padding-bottom: 40px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.admin-stats article,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 28px rgba(38, 31, 24, 0.05);
}

.admin-stats article {
  padding: 18px;
}

.admin-stats strong {
  display: block;
  font-size: 28px;
}

.admin-stats span {
  color: var(--muted);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.table-card {
  overflow: auto;
  padding: 6px;
}

.table-card h2 {
  padding: 14px 14px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f8f4ed;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.login-box {
  width: min(420px, calc(100% - 32px));
  margin: 12vh auto 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.ghost-button {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.big-balance {
  padding: 14px 16px;
  border-radius: 8px;
  color: white;
  background: var(--accent);
}

.guest-layout {
  grid-template-columns: 1fr;
}

.manager-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
}

@media (max-width: 760px) {
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-stats,
  .manager-actions {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 10px;
  }
}
