/* ============================================================
   assets/css/site.css
   Shared visual system for every non-POS page (POS keeps its own
   dark camera-focused theme in pos-specific CSS). Loaded after
   Bootstrap so these rules can refine Bootstrap's defaults.
   ============================================================ */

:root {
  --brand-primary: #d94f30;      /* warm terracotta — South African sunset tone */
  --brand-primary-dark: #b83e23;
  --brand-secondary: #1f7a5c;    /* deep teal-green accent */
  --brand-accent: #f4a340;       /* warm amber highlight */
  --surface: #ffffff;
  --surface-alt: #fbf6f1;
  --ink: #26221f;
  --ink-muted: #6b6058;
  --border-soft: #eee0d6;
}

/* ---------- Sticky footer layout (fixes "huge white space below
   the footer" — content now fills the viewport before the footer
   is allowed to sit at the bottom, instead of a short page leaving
   a gap) ---------- */
html, body {
  height: 100%;
}
body.app-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--surface-alt);
  color: var(--ink);
}
.app-main {
  flex: 1 0 auto;
  width: 100%;
}
.app-footer {
  flex-shrink: 0;
  padding: 18px 0;
  margin-top: 32px;
  background: #fff;
  border-top: 1px solid var(--border-soft);
  color: var(--ink-muted);
  font-size: 13px;
}

/* ---------- Navbar ---------- */
.app-navbar {
  background: linear-gradient(100deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.app-navbar .navbar-brand {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 500;
  border-radius: 8px;
  padding: 6px 12px !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.app-navbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
}
.app-navbar .nav-link.active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff !important;
}
.app-username {
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 0.85rem;
}
.app-logout-link {
  color: #ffe0d6 !important;
}
.app-shop-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
}
.app-shop-name-mobile {
  background: var(--brand-primary-dark);
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 0;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(38, 34, 31, 0.06);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover {
  box-shadow: 0 6px 18px rgba(38, 34, 31, 0.1);
}
.kpi-card {
  border-radius: 16px;
}

/* ---------- Buttons ---------- */
.btn-danger, .btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-danger:hover, .btn-primary:hover {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}
.btn-outline-danger, .btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-outline-danger:hover, .btn-outline-primary:hover {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-success {
  background-color: var(--brand-secondary);
  border-color: var(--brand-secondary);
}
.btn-success:hover {
  filter: brightness(0.92);
}
.btn, .form-control, .form-select {
  border-radius: 10px;
}
.btn {
  font-weight: 600;
}

/* ---------- Tables ---------- */
.table-responsive {
  border-radius: 12px;
  overflow: hidden;
}
.table thead {
  background: var(--ink);
  color: #fff;
}

/* ---------- Badges / status ---------- */
.badge-purchase-completed {
  background: var(--brand-secondary);
}
.badge-purchase-cancelled {
  background: #9c8f85;
}

/* ---------- Mobile responsiveness ---------- */
@media (max-width: 768px) {
  .app-main {
    padding-left: 12px;
    padding-right: 12px;
  }
  h2, .h2 {
    font-size: 1.4rem;
  }
  .card {
    border-radius: 12px;
  }
  .table {
    font-size: 0.85rem;
  }
  .navbar-brand {
    font-size: 1rem;
  }
  .btn {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .app-main {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* ---------- Table column priority for narrow screens ----------
   Rather than transform tables into a different layout (tried that —
   it changed the whole look of the page for a problem that's really
   just "too many columns competing for width"), less-essential
   columns are simply hidden below md, so what's left fits without
   cutting anything off. Apply .col-hide-mobile to both the <th> and
   matching <td> cells you want hidden. */
@media (max-width: 767px) {
  .col-hide-mobile {
    display: none !important;
  }
}

/* A value that's legitimately not set (e.g. no cost price entered
   yet) reads as "—", not the word "N/A" repeated down a column —
   less noisy, and visually distinct from a real zero. */
.value-unset {
  color: var(--ink-muted);
  font-style: italic;
}

