/* G4 ERP look: CAPTURE's layout, one light theme (§8). White and light grey; navy for primary buttons and module
   tiles; G4 yellow for the active menu item and Sign out; Bootstrap colours only for statuses. */
:root {
  --g4-navy: #1d3557;
  --g4-navy-600: #2a4a75;
  --g4-yellow: #ffc107;
  --g4-bg: #f4f6fa;
  --g4-line: #e6e9ef;
  --g4-text: #212529;
  --g4-muted: #6c757d;
  --bs-primary: #1d3557;
  --bs-primary-rgb: 29, 53, 87;
}

body { background: var(--g4-bg); color: var(--g4-text); }

.btn-primary { --bs-btn-bg: var(--g4-navy); --bs-btn-border-color: var(--g4-navy);
  --bs-btn-hover-bg: var(--g4-navy-600); --bs-btn-hover-border-color: var(--g4-navy-600); }

/* ---------- layout ---------- */
.g4-app { display: flex; min-height: 100vh; }
.g4-sidebar { width: 250px; flex: none; background: #fff; border-right: 1px solid var(--g4-line);
  display: flex; flex-direction: column; padding: 16px 14px; }
.g4-brand img { height: 46px; margin: 4px 6px 18px; }
.g4-nav { display: flex; flex-direction: column; gap: 4px; }
.g4-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 6px;
  color: var(--g4-text); text-decoration: none; }
.g4-nav a:hover { background: var(--g4-bg); }
.g4-nav a.active { background: var(--g4-line); font-weight: 500; }
.g4-ic { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--g4-muted); }
.g4-nav a.active .g4-ic { background: var(--g4-yellow); color: #fff; }
.g4-side-foot { margin-top: auto; font-size: 12px; color: var(--g4-muted); padding: 12px 6px 0; }

.g4-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g4-topbar { background: #fff; border-bottom: 1px solid var(--g4-line); padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; }
.g4-topbar h1 { font-size: 20px; margin: 0; }
.g4-crumb { font-size: 12px; color: var(--g4-muted); }
.g4-top-right { display: flex; align-items: center; gap: 14px; }
.g4-bell { width: 34px; height: 34px; border-radius: 6px; background: var(--g4-navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; }
.g4-content { padding: 24px 28px; }

/* ---------- Apps launcher ---------- */
.g4-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.g4-tile { background: #fff; border: 1px solid var(--g4-line); border-radius: 10px; padding: 22px;
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--g4-text); }
.g4-tile-ic { width: 46px; height: 46px; border-radius: 10px; background: var(--g4-navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.g4-tile-name { font-weight: 600; font-size: 16px; }
.g4-tile-note { font-size: 12px; color: var(--g4-muted); }
.g4-tile--soon { opacity: .75; }

@media (max-width: 768px) {
  .g4-app { flex-direction: column; }
  .g4-sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--g4-line); }
}

/* ---------- sign-in pages (templates/accounts) ---------- */
.g4-signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.g4-signin-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--g4-line); border-radius: 10px;
  padding: 28px; }
.g4-signin-card h1 { font-size: 20px; margin: 0 0 18px; }
.g4-signin-logo { height: 52px; display: block; margin-bottom: 18px; }
.g4-signin-note { font-size: 13px; color: var(--g4-muted); margin: 14px 0 0; }
.g4-steps { padding-left: 20px; }
.g4-qr { display: flex; justify-content: center; margin: 8px 0; }
.g4-qr svg { width: 200px; height: 200px; }
.g4-secret { word-spacing: 4px; }
.g4-user { color: inherit; text-decoration: none; }
.g4-nav-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--g4-muted); padding: 14px 10px 4px; }

/* ---------- forms (partials/form_fields.html) ---------- */
.g4-field > label { display: block; font-weight: 500; margin-bottom: 4px; }
.g4-field .helptext { font-size: 13px; color: var(--g4-muted); margin-bottom: 4px; }
.g4-field .helptext ul { margin: 0; padding-left: 18px; }
.g4-field .errorlist { list-style: none; padding: 0; margin: 0 0 4px; color: var(--bs-danger); font-size: 13px; }
.g4-field .form-check-input { margin-right: 6px; }
.g4-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.g4-panel { background: #fff; border: 1px solid var(--g4-line); border-radius: 10px; padding: 22px; max-width: 860px; }
.g4-toolbar { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.g4-secret-box { font-size: 22px; letter-spacing: 2px; }
.g4-field legend { font-size: 1rem; font-weight: 500; margin-bottom: 4px; }
.g4-field fieldset label { font-weight: 400; }

/* ---------- filter panels (audit log; later the Buying lists) ---------- */
.g4-filters { max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0 16px; align-items: end; }
.g4-filter-buttons { display: flex; gap: 8px; margin-bottom: 1rem; }
.g4-price-column { width: 12rem; }
.g4-narrow-table { max-width: 24rem; }
