:root {
  --brand: #0d3b66;
  --brand-2: #14507f;
  --accent: #f4a261;
  --ok: #2a9d8f;
  --bad: #e76f51;
  --sidebar-w: 240px;
  --header-h: 52px;
}

body {
  background: #f4f6f9;
  -webkit-tap-highlight-color: transparent;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--header-h);
  background: var(--brand);
  padding-top: env(safe-area-inset-top);
}

/* Shell layout */
.app-shell { display: flex; align-items: stretch; }

.app-sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #e4e8ee;
  min-height: calc(100vh - var(--header-h));
}
@media (min-width: 992px) {
  .app-sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; }
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1rem;
  padding-bottom: 5rem; /* room for bottom nav on phones */
  max-width: 1100px;
}
@media (min-width: 992px) {
  .app-main { padding: 1.5rem; padding-bottom: 1.5rem; }
}

/* Sidebar nav */
.app-nav .nav-link {
  color: #33404f;
  border-radius: 8px;
  margin: 2px 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}
.app-nav .nav-link:hover { background: #eef2f7; }
.app-nav .nav-link.active { background: var(--brand); color: #fff; }
.app-nav .nav-link i { width: 1.4rem; }
.nav-section {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a96a5;
  padding: 0.75rem 1rem 0.25rem;
}

/* Bottom tab bar (phones) */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1040;
  display: flex;
  justify-content: space-around;
  background: #fff;
  border-top: 1px solid #e4e8ee;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0;
  color: #6b7785;
  text-decoration: none;
  font-size: 0.68rem;
}
.bottom-nav a i { display: block; font-size: 1.25rem; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav .scan-btn {
  color: #fff;
}
.bottom-nav .scan-btn i {
  background: var(--accent);
  color: #fff;
  width: 46px; height: 46px;
  line-height: 46px;
  border-radius: 50%;
  margin: -18px auto 0;
  box-shadow: 0 3px 8px rgba(244,162,97,.5);
}
.bottom-nav .scan-btn span { color: #6b7785; }

/* Cards & money */
.stat-card { border: none; border-radius: 14px; box-shadow: 0 1px 4px rgba(20,40,70,.07); }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.pos { color: var(--ok); }
.money.neg { color: var(--bad); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }

/* Forms: bigger touch targets on mobile */
.form-control, .form-select, .btn { min-height: 44px; }
.form-control-lg { font-size: 1.05rem; }

/* Login */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--brand), var(--brand-2));
  padding: 1rem;
}
.auth-card { width: 100%; max-width: 380px; border-radius: 16px; }

/* Collection breakdown rows */
.breakdown-row td { vertical-align: middle; }
table.tight td, table.tight th { padding: .4rem .5rem; }
