:root {
  --brand-green: #6fb52c;
  --brand-blue: #1c86c9;
  --brand-orange: #f2a900;
  --sidebar-width: 240px;
  --navbar-height: 58px;
  --ink: #22292f;
}

body {
  background: #f4f6f9;
  color: var(--ink);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Navbar ---------- */
.app-navbar {
  height: var(--navbar-height);
  background: linear-gradient(90deg, #16324f, #1c4d73);
  z-index: 1040;
}
.app-navbar .navbar-brand,
.app-navbar .btn-link,
.app-navbar .dropdown-toggle {
  color: #fff !important;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
  position: fixed;
  top: var(--navbar-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  background: #16324f;
  overflow-y: auto;
  z-index: 1030;
}
.app-sidebar .nav-link {
  color: #cfe0ee;
  padding: .75rem 1.25rem;
  border-left: 3px solid transparent;
  font-size: .95rem;
}
.app-sidebar .nav-link i { margin-right: .6rem; width: 18px; text-align: center; }
.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--brand-orange);
}

.app-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  min-height: calc(100vh - var(--navbar-height));
}

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .app-sidebar.show { transform: translateX(0); }
  .app-content { margin-left: 0; }
}

/* ---------- Cards / dashboard ---------- */
.stat-card {
  border: none;
  border-radius: .75rem;
  color: #fff;
  overflow: hidden;
}
.stat-card .bi { font-size: 2.2rem; opacity: .85; }
.stat-card.bg-green { background: linear-gradient(135deg, #6fb52c, #4d8a1a); }
.stat-card.bg-blue  { background: linear-gradient(135deg, #1c86c9, #135a86); }
.stat-card.bg-orange{ background: linear-gradient(135deg, #f2a900, #c98700); }

.card { border: none; border-radius: .65rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-header { background: #fff; border-bottom: 1px solid #eef1f4; font-weight: 600; }

.brand-strip {
  height: 6px;
  background: linear-gradient(90deg, var(--brand-green) 0 33%, var(--brand-blue) 33% 66%, var(--brand-orange) 66% 100%);
  border-radius: 3px;
}

/* ---------- Auth pages ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #16324f, #1c4d73);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 1rem;
  box-shadow: 0 15px 40px rgba(0,0,0,.25);
}

/* =====================================================================
   Certificate view (screen) - mirrors the printed PDF layout as closely
   as CSS allows: header block, title, product info, test table, footer.
   ===================================================================== */
.coa-sheet {
  background: #fff;
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 50px 30px;
  box-shadow: 0 1px 8px rgba(0,0,0,.12);
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
}
.coa-header-row { display: flex; justify-content: space-between; align-items: flex-start; }
.coa-title { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.coa-subtitle { font-size: 12px; color: #444; }
.coa-logo img { max-height: 80px; }
.coa-brand-strip { height: 5px; margin: 14px 0 22px; background: linear-gradient(90deg, var(--brand-green) 0 33%, var(--brand-blue) 33% 66%, var(--brand-orange) 66% 100%); }
.coa-info-table { width: 100%; margin-bottom: 20px; font-size: 13.5px; }
.coa-info-table td { padding: 3px 0; vertical-align: top; }
.coa-info-label { width: 230px; font-weight: 600; }
.coa-info-colon { width: 18px; }
.coa-section-title { font-size: 14px; font-weight: 700; margin: 10px 0 10px; }
table.coa-test-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 26px; }
table.coa-test-table th, table.coa-test-table td {
  border: 1px solid #333;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
table.coa-test-table th { background: #eef2f5; font-weight: 700; }
.coa-signature-block { margin-top: 34px; font-size: 13px; text-align: right; }
.coa-qc-label { margin-top: 2px; text-align: right; font-size: 13px; }
.coa-valid-note { font-size: 12px; margin-top: 24px; }
.coa-further-info-title { font-weight: 700; font-size: 13px; margin-top: 22px; text-decoration: underline; }
.coa-disclaimer { font-size: 10.5px; color: #333; line-height: 1.5; margin-top: 6px; }
.coa-footer { margin-top: 34px; border-top: 1px solid #999; padding-top: 14px; display: flex; gap: 20px; font-size: 10.5px; color: #333; }
.coa-footer .coa-footer-logo img { max-height: 40px; }
.coa-footer .coa-footer-col { flex: 1; }
.coa-footer .coa-footer-col strong { display: block; margin-bottom: 3px; }

@media print {
  .no-print { display: none !important; }
  .coa-sheet { box-shadow: none; max-width: 100%; }
  body { background: #fff; }
}

/* Dynamic row table (certificate form) */
#testRowsTable input { min-width: 140px; }
.row-drag-handle { cursor: move; color: #999; }
