:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --brand: #8a4b2e;
  --brand-dark: #6b3a22;
  --border: #e5e0da;
  --danger: #b3261e;
  --success: #2e7d32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.page--wide { max-width: 860px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar a { color: var(--text); text-decoration: none; font-weight: 600; }

.lang-switch a {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.lang-switch a.active { background: var(--brand); color: #fff; }

h1 { font-size: 1.5rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
p.lead { color: var(--muted); margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.95rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  background: var(--surface);
  color: var(--text);
}

.field-hint { color: var(--muted); font-size: 0.85rem; margin-top: -0.75rem; margin-bottom: 1rem; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 0.9rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: var(--brand);
  color: #fff;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn--secondary { background: var(--surface); color: var(--brand); border: 1px solid var(--brand); }
.btn--danger { background: var(--danger); }
.btn--small { width: auto; padding: 0.5rem 0.9rem; font-size: 0.9rem; }

.alert { padding: 0.9rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.95rem; }
.alert--error { background: #fdecea; color: var(--danger); }
.alert--success { background: #eaf5ea; color: var(--success); }
.alert--info { background: #eef2fb; color: #2a4a9e; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; text-align: center; }
.stat .value { font-size: 1.6rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--border); }

.qr-wrap { text-align: center; padding: 1rem 0; }
.qr-wrap img { max-width: 280px; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.qr-code-text { font-size: 2rem; letter-spacing: 0.1em; font-weight: 700; text-align: center; margin-top: 0.5rem; }

.list-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }

.progress-bar { height: 14px; background: var(--border); border-radius: 7px; overflow: hidden; margin: 0.5rem 0 1rem; }
.progress-bar > span { display: block; height: 100%; background: var(--brand); }

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
