/* =================================================================
   PUMA ENERGY INSPECTIONS — themed to match pumatravel.africalocalapps.com
   Brand:  primary #ED1C24 · dark #b60000 · navy #002147 · slate #455364
   Fonts:  PT Sans Narrow (body), Poppins (display)
   ================================================================= */

:root {
  /* Brand */
  --primary:        #ED1C24;
  --primary-dark:   #b60000;
  --primary-light:  #fde6e7;
  --puma-navy:      #002147;
  --puma-slate:     #455364;
  --puma-text:      #1d1d1b;

  /* Status */
  --green:          #75a63d;
  --green-light:    #ecf4dd;
  --green-dark:     #15803d;
  --red:            #ED1C24;
  --red-light:      #fde6e7;
  --red-dark:       #b60000;
  --amber:          #d97706;
  --amber-light:    #fef3c7;
  --amber-dark:     #92400e;
  --blue:           #1d4ed8;
  --blue-light:     #eff6ff;

  /* Greys (Tailwind-style) */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white:    #ffffff;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow:    0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --radius:      0.5rem;
  --radius-lg:   0.75rem;
  --radius-pill: 50px;
  --radius-full: 9999px;
  --transition:  .15s ease;

  --font-body:    "PT Sans Narrow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --sidebar-w: 260px;
  --topbar-h: 64px;

  /* Back-compat with existing template tokens */
  --puma-red: var(--primary);
  --puma-red-dark: var(--primary-dark);
  --puma-red-deep: var(--primary-dark);
  --puma-charcoal: var(--puma-text);
  --puma-graphite: var(--puma-text);
  --puma-grey: var(--gray-500);
  --puma-light: var(--gray-100);
  --puma-mist: var(--gray-100);
  --puma-line: var(--gray-200);
  --puma-white: var(--white);
  --puma-success: var(--green);
  --puma-warning: var(--amber);
  --puma-danger: var(--red);
  --puma-info: var(--blue);
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 17px; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--puma-slate);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--puma-text);
  letter-spacing: -0.01em;
  margin: 0 0 .5rem 0;
}
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.0625rem; font-weight: 600; }

/* ============================================================
   App shell
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  border-top: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  z-index: 110;
  overflow-y: auto;
  transition: transform .25s ease;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.625rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
  font-family: var(--font-display);
}
.sidebar-brand .brand-logo {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
}
.sidebar-brand .brand-sub {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--puma-slate);
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.sidebar-nav .nav-section {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  padding: 0.875rem 0.875rem 0.25rem;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.7rem 0.875rem;
  border-radius: 8px;
  color: var(--puma-slate);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.sidebar-nav a:hover {
  background: var(--gray-50);
  color: var(--puma-text);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.sidebar-nav a .icon {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
  opacity: .9;
}

.sidebar-footer {
  padding: 0.875rem 1.25rem 1.1rem;
  border-top: 1px solid var(--gray-100);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  color: var(--puma-slate);
  font-weight: 500;
}
.sidebar-footer small {
  display: block;
  font-size: 0.6875rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0;
  z-index: 90;
}
.topbar-toggle {
  display: none;
  background: transparent;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: var(--puma-text);
  width: 40px; height: 40px;
}
.topbar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--puma-text);
}
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.375rem 0.625rem;
}
.topbar-user .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.875rem;
}
.topbar-user .who {
  line-height: 1.15;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--puma-text);
}
.topbar-user .who small {
  display: block;
  color: var(--gray-500);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.1rem;
}

.content { padding: 1.5rem; flex: 1; }

.page-header {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0; font-size: 1.75rem; }
.page-header .crumbs {
  font-family: var(--font-display);
  color: var(--gray-400);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.375rem;
}
.page-header .actions {
  margin-left: auto;
  display: flex; gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  gap: 0.75rem;
  background: var(--white);
}
.card-header h2, .card-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--puma-text);
}
.card-header .badge-section {
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-body { padding: 1.25rem; }
.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* ============================================================
   KPI / stat cards
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kpi {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.kpi .label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
}
.kpi .value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.375rem;
  color: var(--puma-text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.kpi .sub {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.4rem;
  font-weight: 500;
}
.kpi.success { border-top-color: var(--green); }
.kpi.success .value { color: var(--green-dark); }
.kpi.warning { border-top-color: var(--amber); }
.kpi.warning .value { color: var(--amber-dark); }
.kpi.danger  { border-top-color: var(--red); }
.kpi.danger  .value { color: var(--red-dark); }
.kpi.info    { border-top-color: var(--blue); }
.kpi.info    .value { color: var(--blue); }

/* ============================================================
   Forms
   ============================================================ */
label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--puma-text);
  margin-bottom: 0.375rem;
  text-transform: none;
  letter-spacing: 0;
}

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=time], input[type=number],
input[type=tel], input[type=url], input[type=search],
select, textarea {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--puma-text);
  background: var(--white);
  min-height: 42px;
  line-height: 1.3;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--gray-400); }
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(237 28 36 / .15);
}
textarea { min-height: 80px; resize: vertical; }
select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='none' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5' stroke='%23455364' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 18px;
  padding-right: 2.25rem;
}

.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1rem;
}

/* Aligned form grid (used on capture headers + admin forms) */
.form-grid {
  display: grid;
  gap: 1rem 1.25rem;
  align-items: start;
}
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.field-label {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--puma-text);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}
.req { color: var(--red); margin-left: 0.1rem; font-weight: 700; }

.capture-form .card { max-width: 1100px; margin-left: auto; margin-right: auto; }
.capture-form .card-footer { background: var(--gray-50); }

@media (max-width: 900px) {
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .form-grid.cols-4, .form-grid.cols-3, .form-grid.cols-2 { grid-template-columns: 1fr; }
}
.field-help {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.375rem;
}
.field-error {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 0.375rem;
  font-weight: 500;
}

/* ============================================================
   Buttons — Puma corporate (pill, uppercase, Poppins 700)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus { outline: 0; box-shadow: 0 0 0 3px rgb(237 28 36 / .25); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--white);
  color: var(--puma-text);
  border-color: var(--gray-300);
}
.btn-secondary:hover {
  background: var(--gray-50);
  color: var(--puma-text);
  border-color: var(--gray-400);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--puma-slate);
  border-color: var(--gray-200);
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--puma-text);
  border-color: var(--gray-300);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #5d8b2c; border-color: #5d8b2c; color: #fff; }
.btn-danger  { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover  { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 0.9375rem; }
.btn-block { width: 100%; justify-content: center; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
table.data th, table.data td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
table.data th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--puma-slate);
  background: var(--gray-50);
}
table.data tr:hover { background: var(--gray-50); }
table.data tr:last-child td { border-bottom: 0; }

/* ============================================================
   Badges & pills
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.badge-passed { background: var(--green-light); color: var(--green-dark); }
.badge-failed { background: var(--red-light); color: var(--red-dark); }
.badge-draft  { background: var(--gray-100); color: var(--gray-500); }
.badge-info   { background: var(--blue-light); color: var(--blue); }
.badge-sc     { background: var(--primary); color: #fff; }

/* ============================================================
   Inspection items
   ============================================================ */
.section-card { margin-bottom: 1.25rem; }
.section-card .card-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}

.item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  align-items: start;
}
.item-row:last-child { border-bottom: 0; }
.item-row .item-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--puma-text);
}
.item-row .item-desc {
  font-size: 0.875rem;
  color: var(--puma-slate);
  margin-top: 0.25rem;
  line-height: 1.5;
  white-space: pre-line;
}
.item-row .item-comment { grid-column: 1 / -1; }
.item-row .item-comment textarea { min-height: 50px; }
.item-row.has-fail { background: var(--red-light); }
.item-row.is-critical .item-label::after {
  content: "SAFETY CRITICAL";
  margin-left: 0.5rem;
  background: var(--primary);
  color: #fff;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* OK / Not OK / N/A choice */
.choice-group {
  display: inline-flex;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}
.choice-group input[type=radio] { display: none; }
.choice-group label {
  margin: 0;
  padding: 0.5rem 0.875rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  color: var(--puma-slate);
  border-right: 1px solid var(--gray-200);
  background: var(--white);
  transition: background .12s, color .12s;
  user-select: none;
}
.choice-group label:last-child { border-right: 0; }
.choice-group label:hover { background: var(--gray-50); }
.choice-group input[type=radio]:checked + label.ok    { background: var(--green); color: #fff; }
.choice-group input[type=radio]:checked + label.notok { background: var(--red); color: #fff; }
.choice-group input[type=radio]:checked + label.na    { background: var(--gray-500); color: #fff; }

/* PPE checkbox grid */
.ppe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.625rem;
}
.ppe-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--puma-text);
  cursor: pointer;
  transition: all var(--transition);
}
.ppe-grid label:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
.ppe-grid input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
}
.ppe-grid label.checked {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green-dark);
}

/* ============================================================
   Modal popup
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.65);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-backdrop.open {
  display: flex;
  animation: modal-fade .15s ease;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1000px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: auto;
  animation: modal-pop .18s ease;
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-shrink: 0;
  background: var(--white);
}
.modal-header .modal-mark {
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--puma-text);
  line-height: 1.2;
}
.modal-header h2 small {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}
.modal-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  width: 36px; height: 36px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-500);
  border-radius: var(--radius);
  display: grid; place-items: center;
  transition: background .12s, color .12s;
}
.modal-close:hover { background: var(--gray-100); color: var(--puma-text); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}
/* Wizard inside the modal should not have its own card chrome */
.modal-body .wizard { border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.modal-body .wizard-footer { display: none; } /* we render footer at modal level */

.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 2px solid var(--primary);
  background: var(--white);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  box-shadow: 0 -4px 14px rgba(0,0,0,.05);
}
.modal-footer .mf-summary {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--puma-slate);
}
.modal-footer .mf-summary strong { color: var(--puma-text); font-weight: 700; }

@media (max-width: 760px) {
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { max-width: 100%; max-height: 100vh; border-radius: 0; }
  .modal-footer { flex-wrap: wrap; }
}

/* Body lock when modal is open */
body.modal-open { overflow: hidden; }

/* ============================================================
   Capture wizard
   ============================================================ */
.wizard {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.wizard-progress {
  display: flex;
  align-items: stretch;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: thin;
}
.wizard-progress .wp-step {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1rem;
  border-right: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-right: 1px solid var(--gray-200);
  cursor: pointer;
  font-family: var(--font-display);
  text-align: left;
  color: var(--puma-slate);
  transition: background .15s, color .15s, border-color .15s;
}
.wizard-progress .wp-step:last-child { border-right: 0; }
.wizard-progress .wp-step:hover { background: var(--gray-100); color: var(--puma-text); }
.wizard-progress .wp-step .wp-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  font-weight: 700; font-size: 0.8125rem;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.wizard-progress .wp-step .wp-label {
  display: flex; flex-direction: column; min-width: 0;
  font-size: 0.8125rem; font-weight: 600;
  line-height: 1.15;
}
.wizard-progress .wp-step .wp-label small {
  font-size: 0.6875rem; font-weight: 500; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-top: 0.1rem;
}
.wizard-progress .wp-step.active {
  background: var(--white);
  color: var(--puma-text);
  border-bottom-color: var(--primary);
}
.wizard-progress .wp-step.active .wp-num {
  background: var(--primary);
  color: #fff;
}
.wizard-progress .wp-step.completed .wp-num {
  background: var(--green);
  color: #fff;
}
.wizard-progress .wp-step.completed .wp-num::before { content: "✓"; }
.wizard-progress .wp-step.completed .wp-num span { display: none; }

.wizard-bar {
  height: 4px;
  background: var(--gray-200);
  position: relative;
}
.wizard-bar .wb-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--primary);
  width: 0%;
  transition: width .25s ease;
}

.wizard-body { padding: 0; }
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: wizard-fade .15s ease; }
@keyframes wizard-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wizard-step .card { margin-bottom: 0; border: 0; border-radius: 0; box-shadow: none; }
.wizard-step .card-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 1.25rem 1.5rem;
}
.wizard-step .card-body { padding: 1.25rem 1.5rem 1.5rem; }

.wizard-footer {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 2px solid var(--primary);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  z-index: 12;
  box-shadow: 0 -6px 16px rgba(0,0,0,.06);
}
.wizard-footer .wf-summary {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--puma-slate);
}
.wizard-footer .wf-summary strong { color: var(--puma-text); font-weight: 700; }

@media (max-width: 760px) {
  .wizard-progress .wp-step { min-width: 110px; padding: 0.5rem 0.625rem; }
  .wizard-progress .wp-step .wp-label { font-size: 0.75rem; }
  .wizard-footer { flex-wrap: wrap; }
}

/* ============================================================
   Sign-off bar
   ============================================================ */
.signoff-bar {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 2px solid var(--primary);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 -6px 16px rgba(0,0,0,.06);
  z-index: 10;
  margin: -1.25rem -1.25rem -1.25rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.signoff-bar .summary {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--puma-slate);
}
.signoff-bar .summary strong { color: var(--puma-text); font-weight: 700; }

/* ============================================================
   Flashes
   ============================================================ */
.flashes { margin-bottom: 1rem; }
.flash {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  border-left: 4px solid;
  font-size: 0.875rem;
}
.flash-success { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.flash-danger  { background: var(--red-light);   border-color: var(--red);   color: var(--red-dark); }
.flash-warning { background: var(--amber-light); border-color: var(--amber); color: var(--amber-dark); }
.flash-info    { background: var(--blue-light);  border-color: var(--blue);  color: var(--blue); }

/* ============================================================
   Inspection summary header + Pass/Fail banner
   ============================================================ */
.inspection-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.inspection-summary .kv .k {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
}
.inspection-summary .kv .v {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--puma-text);
  margin-top: 0.25rem;
}

.result-banner {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  border-left: 6px solid;
  box-shadow: var(--shadow-sm);
}
.result-banner .big {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.result-banner.passed { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.result-banner.failed { background: var(--red-light);   border-color: var(--red);   color: var(--red-dark); }
.result-banner.draft  { background: var(--gray-100);    border-color: var(--gray-400); color: var(--gray-700); }
.result-banner .reasons {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  opacity: .95;
}

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.875rem;
  align-items: end;
  box-shadow: var(--shadow-sm);
}
.filter-bar .actions-cell { display: flex; gap: 0.5rem; }

/* ============================================================
   Responsive shell
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar-toggle { display: inline-block; }
  .content { padding: 1rem; }
  .item-row { grid-template-columns: 1fr; }
  .item-row .choice-group { width: 100%; justify-content: stretch; }
  .item-row .choice-group label { flex: 1; text-align: center; }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .sidebar, .topbar, .signoff-bar, .page-header .actions, .filter-bar { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; page-break-inside: avoid; }
}

/* =================================================================
   LOGIN SCREEN — DO NOT RESTYLE
   Preserved from the original design as per requirement.
   ================================================================= */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: linear-gradient(135deg, #E2231A 0%, #7A1109 100%);
  color: #fff;
  padding: 60px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.auth-side h1, .auth-side h2, .auth-side h3 { font-family: inherit; color: #fff; }
.auth-side .brand-stripe {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 20px;
  letter-spacing: .02em;
  text-transform: none;
}
.auth-side .brand-stripe .brand-mark {
  width: 40px; height: 40px;
  background: #fff;
  color: #E2231A;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 18px;
}
.auth-side .auth-logo {
  width: 260px;
  max-width: 100%;
  height: auto;
  display: block;
  background: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.auth-side h1 {
  color: #fff;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -.02em;
  max-width: 460px;
  font-weight: 700;
}
.auth-side .tagline {
  font-size: 15px;
  line-height: 1.55;
  opacity: .9;
  max-width: 460px;
  margin-top: 16px;
}
.auth-side .footer-note { font-size: 12px; opacity: .7; }

.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.auth-form .panel { width: 100%; max-width: 380px; }
.auth-form h2 {
  font-size: 24px;
  margin-bottom: 6px;
  color: #1B1B1B;
  font-family: inherit;
  font-weight: 700;
}
.auth-form .lede { color: #6B6F76; margin-bottom: 28px; font-size: 14px; }

/* Login form fields revert to the legacy look */
.auth-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #4A4A4A;
  margin-bottom: 4px;
  font-family: inherit;
}
.auth-form input[type=text],
.auth-form input[type=email],
.auth-form input[type=password] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #D6D9DE;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: #1B1B1B;
  min-height: auto;
  text-transform: none;
  letter-spacing: 0;
}
.auth-form input:focus {
  outline: 0;
  border-color: #E2231A;
  box-shadow: 0 0 0 3px rgba(226,35,26,.15);
}
.auth-form .btn,
.auth-wrap .btn {
  border-radius: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-family: inherit;
  font-weight: 600;
  border-width: 1px;
}
.auth-form .btn-primary,
.auth-wrap .btn-primary {
  background: #E2231A;
  color: #fff;
  border-color: #E2231A;
  padding: 12px 22px;
  font-size: 15px;
}
.auth-form .btn-primary:hover,
.auth-wrap .btn-primary:hover { background: #B81C14; border-color: #B81C14; color: #fff; }
.auth-form .btn-secondary,
.auth-wrap .btn-secondary {
  background: #fff;
  color: #1B1B1B;
  border-color: #D6D9DE;
}
.auth-form .field-help { color: #6B6F76; }
.auth-form .field-error { color: #C62828; }

.auth-wrap .flash {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-transform: none;
  letter-spacing: 0;
}
.auth-wrap .flash-success { background: rgba(30,142,62,.08); border-color: #1E8E3E; color: #1a5e2a; }
.auth-wrap .flash-danger  { background: rgba(198,40,40,.08); border-color: #C62828; color: #7a1f1f; }
.auth-wrap .flash-warning { background: rgba(230,145,0,.08); border-color: #E69100; color: #7a4d00; }
.auth-wrap .flash-info    { background: rgba(21,101,192,.08); border-color: #1565C0; color: #0e3f7a; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 32px; }
  .auth-side h1 { font-size: 26px; }
}
