/* ==========================================================================
   FIRE MATRIX - COMPLIANCE DESIGN SYSTEM & APP STYLESHEET
   Supports Dark Mode (Default) & Light Mode with Professional Industrial Palette
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CORE CSS VARIABLES & DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Dark Industrial Theme */
  --bg-app: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #334155;
  --bg-input: #0f172a;
  --border-color: #334155;
  --border-focus: #3b82f6;

  /* Typography */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-heading: #ffffff;

  /* Brand Accents */
  --brand-red: #e11d48;
  --brand-red-hover: #be123c;
  --brand-charcoal: #1e293b;
  --brand-blue: #2563eb;
  --brand-amber: #d97706;

  /* Risk Ratings Palette */
  --risk-trivial: #10b981;       /* Emerald */
  --risk-tolerable: #84cc16;     /* Lime */
  --risk-moderate: #f59e0b;      /* Amber */
  --risk-substantial: #f97316;   /* Orange */
  --risk-intolerable: #ef4444;   /* Crimson Red */

  /* UI Spacing & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-focus: #2563eb;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-heading: #0f172a;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 10px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
}

/* --------------------------------------------------------------------------
   2. GLOBAL BASE STYLES & RESET
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
}

/* Print Only Helper */
.print-only {
  display: none !important;
}

/* --------------------------------------------------------------------------
   3. APP HEADER & TOP TOOLBAR
   -------------------------------------------------------------------------- */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--text-heading);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Status Chip */
.status-chip {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   4. BUTTONS & UI COMPONENTS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-hover) 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.4);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-outline-primary {
  background-color: transparent;
  border: 1px solid var(--brand-red);
  color: var(--brand-red);
}

.btn-outline-primary:hover {
  background-color: var(--brand-red);
  color: #ffffff;
}

.btn-outline-secondary {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline-secondary:hover {
  background-color: var(--bg-surface-elevated);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

/* Dropdown Component */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.4rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  z-index: 1050;
  overflow: hidden;
}

.dropdown.active .dropdown-menu {
  display: block;
  animation: fadeIn 0.15s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  color: var(--text-main);
  background: none;
  border: none;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.dropdown-item:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--brand-red);
}

/* --------------------------------------------------------------------------
   5. APP MAIN CONTAINER & LAYOUT
   -------------------------------------------------------------------------- */
.app-main {
  max-width: 1240px;
  margin: 1.5rem auto;
  padding: 0 1rem 3rem 1rem;
}

.report-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Section Card Container */
.section-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-heading);
}

.section-title i {
  color: var(--brand-red);
}

.section-badge {
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* --------------------------------------------------------------------------
   6. REPORT HEADER BANNER (BRANDING)
   -------------------------------------------------------------------------- */
.report-header-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--brand-red);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
}

.company-logo-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2.5rem;
  color: var(--brand-red);
}

.company-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.company-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.company-address {
  font-size: 0.75rem;
  color: #cbd5e1;
  margin-top: 0.2rem;
}

.company-legal {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.app-screen-footer {
  margin-top: 2rem;
  padding: 1.25rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.app-screen-footer p {
  margin: 0.15rem 0;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}

.compliance-badge {
  background: rgba(225, 29, 72, 0.15);
  color: var(--brand-red);
  border: 1px solid rgba(225, 29, 72, 0.3);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.report-ref-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.ref-input {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--brand-red);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  width: 170px;
}

/* --------------------------------------------------------------------------
   7. SUMMARY STATS BAR
   -------------------------------------------------------------------------- */
.summary-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.icon-blue { background: rgba(37, 99, 235, 0.15); color: #3b82f6; }
.icon-amber { background: rgba(217, 119, 6, 0.15); color: #f59e0b; }
.icon-red { background: rgba(225, 29, 72, 0.15); color: #e11d48; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   8. FORM UTILITIES & GRIDS
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  gap: 1rem;
}

.col-2 { grid-template-columns: repeat(2, 1fr); }
.col-3 { grid-template-columns: repeat(3, 1fr); }
.col-4 { grid-template-columns: repeat(4, 1fr); }

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-label.required::after {
  content: " *";
  color: var(--brand-red);
}

.form-control, .form-select, textarea {
  width: 100%;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.sub-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Standard Selector Cards */
.standard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.standard-card {
  position: relative;
  background-color: var(--bg-surface-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
}

.standard-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.standard-card:hover {
  border-color: var(--border-focus);
}

.standard-card.active {
  border-color: var(--brand-red);
  background-color: rgba(225, 29, 72, 0.05);
}

.card-body-content {
  flex: 1;
}

.standard-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.standard-title i { color: var(--brand-red); }

.standard-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.check-mark {
  color: var(--brand-red);
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.standard-card.active .check-mark {
  opacity: 1;
}

/* Assessor Card Box */
.assessor-card-box {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.assessor-avatar {
  width: 54px;
  height: 54px;
  background: var(--bg-app);
  border: 2px solid var(--brand-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--brand-red);
}

.assessor-details-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   9. MODULE B: RISK MATRIX STYLES
   -------------------------------------------------------------------------- */
.risk-matrix-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  align-items: start;
}

.matrix-controls-panel {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.risk-result-card {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.result-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.badge-tag {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.result-summary-text {
  font-size: 0.8rem;
  margin-top: 0.75rem;
  line-height: 1.4;
}

/* 3x3 Visual Table Grid */
.matrix-grid-panel {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.matrix-title-head {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;

}

.table-risk-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px;
  text-align: center;
}

.table-risk-grid th {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem;
  color: var(--text-muted);
}

.axis-header-vertical {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem !important;
}

.axis-header-horizontal {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.row-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 0.5rem;
}

.cell-risk {
  position: relative;
  padding: 1rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.cell-risk:hover {
  transform: scale(1.04);
  z-index: 2;
}

.cell-risk.active-selected {
  outline: 3px solid #ffffff;
  outline-offset: -3px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.cell-selected-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.75rem;
}

/* Risk Color Classes */
.risk-trivial { background-color: var(--risk-trivial); }
.risk-tolerable { background-color: var(--risk-tolerable); color: #1e293b; }
.risk-moderate { background-color: var(--risk-moderate); color: #1e293b; }
.risk-substantial { background-color: var(--risk-substantial); }
.risk-intolerable { background-color: var(--risk-intolerable); }

.matrix-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   10. MODULE C: ACTION PLAN TABLE & PRESETS
   -------------------------------------------------------------------------- */
.presets-toolbar {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.presets-label {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.preset-buttons-wrap {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-preset {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  border-color: var(--brand-red);
  background-color: rgba(225, 29, 72, 0.1);
}

.font-red { color: var(--brand-red); }
.font-amber { color: var(--brand-amber); }
.font-yellow { color: #eab308; }
.font-blue { color: var(--brand-blue); }
.font-purple { color: #a855f7; }

.table-action-plan {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.table-action-plan th {
  background-color: var(--bg-surface-elevated);
  color: var(--text-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.table-action-plan td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.priority-select {
  font-weight: 700;
}

.priority-high { color: var(--risk-intolerable); }
.priority-medium { color: var(--risk-substantial); }
.priority-low { color: var(--risk-moderate); }
.priority-advisory { color: var(--risk-trivial); }

.table-footer-controls {
  display: flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   11. MODULE D: PHOTOGRAPHIC EVIDENCE MATRIX
   -------------------------------------------------------------------------- */
.photo-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-dropzone:hover, .photo-dropzone.dragover {
  border-color: var(--brand-red);
  background-color: rgba(225, 29, 72, 0.05);
}

.dropzone-icon {
  font-size: 2.2rem;
  color: var(--brand-red);
  margin-bottom: 0.5rem;
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.dropzone-text span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.photo-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.photo-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.photo-preview-wrap {
  width: 100%;
  height: 220px;
  background-color: #000;
  position: relative;
  overflow: hidden;
}

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-number-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.btn-remove-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(225, 29, 72, 0.9);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.photo-details-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.empty-photos-placeholder {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.empty-photos-placeholder i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--border-color);
}

/* --------------------------------------------------------------------------
   12. MODULE E: SIGNATURE PAD & ASSESSOR DECLARATION
   -------------------------------------------------------------------------- */
.declaration-text-box {
  background-color: var(--bg-surface-elevated);
  border-left: 4px solid var(--brand-red);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.5;
}

.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.sig-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sig-meta-item {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.sig-label {
  color: var(--text-muted);
  width: 120px;
}

.canvas-wrapper {
  background-color: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  width: 380px;
  max-width: 100%;
}

#signatureCanvas {
  display: block;
  cursor: crosshair;
  background-color: #ffffff;
}

.canvas-actions {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 0.3rem;
}

.sig-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.2rem;
}

/* --------------------------------------------------------------------------
   13. HELPER UTILITIES & ANIMATIONS
   -------------------------------------------------------------------------- */
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.ms-auto { margin-left: auto; }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: 0.8rem; }
.fs-xs { font-size: 0.72rem; }
.text-muted { color: var(--text-muted); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .risk-matrix-layout {
    grid-template-columns: 1fr;
  }
  .photo-matrix-grid {
    grid-template-columns: 1fr;
  }
  .standard-grid {
    grid-template-columns: 1fr;
  }
  .form-grid.col-3, .form-grid.col-4 {
    grid-template-columns: 1fr 1fr;
  }
  .signature-grid {
    grid-template-columns: 1fr;
  }
  .assessor-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .form-grid.col-2, .form-grid.col-3, .form-grid.col-4 {
    grid-template-columns: 1fr;
  }
/* --------------------------------------------------------------------------
   14. PAS 79-1 28-SECTION CHECKLIST STYLES
   -------------------------------------------------------------------------- */
.checklist-tabs-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border-color);
}

.btn-tab {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-tab:hover {
  background-color: var(--border-color);
}

.btn-tab.active {
  background-color: var(--brand-red);
  color: #ffffff;
  border-color: var(--brand-red);
}

.tab-badge-warning {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 50px;
}

.tab-badge-ok {
  color: #10b981;
  font-size: 0.75rem;
}

.btn-tab.active .tab-badge-ok {
  color: #ffffff;
}

.checklist-section-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sec-accordion-header {
  padding: 0.85rem 1.25rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  user-select: none;
}

.sec-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sec-num-badge {
  background: var(--brand-red);
  color: #ffffff;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.sec-heading {
  font-size: 0.95rem;
  color: var(--text-heading);
}

.sec-desc-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.checklist-item-box {
  background-color: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checklist-item-box:last-child {
  border-bottom: none;
}

.checklist-item-box.highlight-action-needed {
  background-color: rgba(239, 68, 68, 0.08);
  border-left: 4px solid var(--risk-intolerable);
}

.item-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.item-ref-title {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  flex: 1;
}

.item-ref-tag {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--brand-red);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.item-question-text {
  font-size: 0.88rem;
  color: var(--text-heading);
  line-height: 1.4;
}

.item-controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control-group-compact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.control-sublabel {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-toggle {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-toggle.active-yes { background-color: #10b981; color: #fff; border-color: #10b981; }
.btn-toggle.active-no { background-color: #ef4444; color: #fff; border-color: #ef4444; }
.btn-toggle.active-na { background-color: var(--border-color); color: var(--text-main); }

.btn-toggle-status {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.btn-toggle-status.status-sat { background-color: #10b981; color: #fff; border-color: #10b981; }
.btn-toggle-status.status-imp { background-color: #ef4444; color: #fff; border-color: #ef4444; }
.btn-toggle-status.status-na { background-color: var(--border-color); color: var(--text-main); }

.item-photos-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.item-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-photos-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.item-thumb-box {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.item-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
