/* SnackMaster – blue & gold, polished mobile-first */
:root {
  --blue: #1a56db;
  --blue-dark: #1240a8;
  --blue-deep: #0a286e;
  --gold: #d4a017;
  --gold-light: #f0c040;
  --surface: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --radius: 1rem;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
  --topbar-h: 56px;
  --bottom-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

body.app-body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 0;
  margin: 0;
}

@media (max-width: 991.98px) {
  body.app-body { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px)); }
}

/* Top bar */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(26, 86, 219, 0.25);
}
.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff !important;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.app-logo .text-gold { color: var(--gold) !important; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.btn-icon:hover { background: rgba(255,255,255,0.22); color: #fff; }

.btn-account {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}
.btn-account:hover, .btn-account:focus {
  background: rgba(255,255,255,0.25);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}
.btn-account::after { margin-left: 0.25rem; }

.country-select {
  max-width: 72px;
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 0.4rem;
}
.country-select option { color: #000; background: #fff; }

/* Subnav (desktop) */
.app-subnav {
  background: rgba(0,0,0,0.12);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.app-subnav .nav-link {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 0.9rem;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.app-subnav .nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.app-subnav .nav-link.active {
  color: #fff;
  background: transparent;
  box-shadow: inset 0 -3px 0 var(--gold);
}

/* Main */
.app-main {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Bottom nav (mobile) */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1040;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color 0.15s;
}
.bn-item i { font-size: 1.25rem; line-height: 1; }
.bn-item:hover, .bn-item:focus { color: var(--blue); }
.bn-item.bn-primary {
  color: var(--blue);
}
.bn-item.bn-primary i {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-top: -18px;
  box-shadow: 0 6px 16px rgba(26, 86, 219, 0.4);
  border: 3px solid #fff;
}

/* Cards & stats */
.card {
  border: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 600;
  padding: 1rem 1.25rem;
}
.card-body { padding: 1.25rem; }

.stat-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--blue);
}
.stat-card.success::before { background: #16a34a; }
.stat-card.warning::before { background: var(--gold); }
.stat-card.danger::before { background: #dc2626; }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Buttons */
.btn-brand, .btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 0.65rem;
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.25);
}
.btn-brand:hover, .btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-deep));
  color: #fff;
  box-shadow: 0 6px 16px rgba(26, 86, 219, 0.35);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none;
  color: #1a1a1a;
  font-weight: 600;
  border-radius: 0.65rem;
}
.btn-gold:hover { filter: brightness(1.05); color: #1a1a1a; }
.btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  font-weight: 600;
  border-radius: 0.65rem;
}
.btn-outline-primary {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
  border-radius: 0.65rem;
}
.btn-outline-primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Forms */
.form-control, .form-select {
  border-radius: 0.65rem;
  border-color: #e2e8f0;
  padding: 0.6rem 0.9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}
.form-control-lg { padding: 0.75rem 1rem; font-size: 1.05rem; }

/* Photos & QR */
.child-photo {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #f1f5f9;
}
.child-photo-lg {
  width: 112px; height: 112px;
  object-fit: cover;
  border-radius: 1.25rem;
  border: 3px solid #e2e8f0;
  box-shadow: var(--shadow);
}
.qr-box {
  max-width: 260px;
  margin: 0 auto;
  padding: 1.25rem;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.quick-amount {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.quick-amount .btn {
  font-weight: 600;
  border-radius: 0.65rem;
}

/* Badges */
.badge-status-pending { background: var(--gold); color: #1a1a1a; }
.badge-status-approved { background: #16a34a; }
.badge-status-rejected { background: #dc2626; }
.badge-status-suspended { background: #64748b; }

/* Tables */
.table { --bs-table-bg: transparent; }
.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  border-bottom-width: 1px;
}
.table-hover tbody tr:hover { background: #f8fafc; }

/* Filter bar */
.filter-bar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.filter-bar .form-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* Page titles */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.page-subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.25rem; }

/* Offcanvas */
.offcanvas { border-radius: 1rem 0 0 1rem; }
.list-group-item.active {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-color: transparent;
}

/* Alerts */
.alert { border: none; border-radius: 0.75rem; }

/* Utilities */
.text-gold { color: var(--gold) !important; }
.bg-brand { background: var(--blue) !important; }

@media (max-width: 576px) {
  .stat-value { font-size: 1.35rem; }
  .page-title { font-size: 1.25rem; }
}
