:root {
  --brand: #F1C349;
  --brand-dark: #C99A2E;
  --ink: #1B1B1B;
  --paper: #FFFDF8;
  --card: #FFFFFF;
  --line: #ECE6D9;
  --muted: #8A8578;
  --success: #2E7D4F;
  --danger: #C4432B;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(27,27,27,0.06), 0 12px 32px rgba(27,27,27,0.05);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Auth screens ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(241,195,73,0.16), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(241,195,73,0.12), transparent 45%),
    var(--paper);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px 32px;
  border: 1px solid var(--line);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.auth-logo img { height: 56px; }
.auth-logo .fallback {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ink);
}

.auth-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 28px;
  line-height: 1.5;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 16px;
  background: #fff;
  transition: border-color .15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--brand-dark);
}

.code-input {
  text-align: center;
  letter-spacing: 10px;
  font-size: 26px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 18px;
  border-radius: 10px;
  border: none;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .15s ease;
}
.btn-primary {
  background: var(--brand);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(241,195,73,0.45);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.btn-google:hover { border-color: #C9C2AE; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin: 18px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--line);
}
.divider span { padding: 0 12px; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.4;
}
.alert-error { background: #FCE9E4; color: var(--danger); }
.alert-success { background: #E5F3EA; color: var(--success); }

.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- App shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--ink);
  color: #EFE9DA;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 0 8px;
}
.sidebar-logo img { height: 32px; }
.sidebar-logo span { font-weight: 700; font-size: 15px; color: #fff; }

.nav-group { margin-bottom: 8px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: #C9C2AE;
  margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active {
  background: var(--brand);
  color: var(--ink);
  font-weight: 700;
}
.nav-icon { width: 18px; text-align: center; opacity: 0.9; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.main {
  flex: 1;
  padding: 32px 40px 64px;
  max-width: 1100px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-size: 26px; font-weight: 800; margin: 0; }
.page-sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
}
.pill img { width: 24px; height: 24px; border-radius: 50%; }

/* ---------- Cards / grids ---------- */

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
  .sidebar-logo, .sidebar-footer { display: none; }
  .nav-link { white-space: nowrap; }
  .main { padding: 24px 20px 48px; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.stat-value { font-size: 28px; font-weight: 800; }

.section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title a { font-size: 13.5px; color: var(--brand-dark); font-weight: 600; }

/* ---------- Tables ---------- */

table.orders { width: 100%; border-collapse: collapse; }
table.orders th {
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
table.orders td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
table.orders tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge-completed { background: #E5F3EA; color: var(--success); }
.badge-processing { background: #FFF3D6; color: #96700B; }
.badge-pending { background: #EFEAE0; color: var(--muted); }
.badge-cancelled, .badge-failed, .badge-refunded { background: #FCE9E4; color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state .icon { font-size: 36px; margin-bottom: 12px; }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }

.form-actions { margin-top: 20px; display: flex; gap: 12px; }
.btn-small { width: auto; padding: 11px 22px; }

/* ---------- Placeholder ---------- */

.placeholder-card {
  text-align: center;
  padding: 60px 24px;
}
.placeholder-card .icon { font-size: 40px; margin-bottom: 14px; }
.placeholder-card h2 { margin: 0 0 8px; }
.placeholder-card p { color: var(--muted); max-width: 380px; margin: 0 auto; }
