/* ============================================================
   Safement — Base Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --colour-primary:   #1a5276;
  --colour-accent:    #2e86c1;
  --colour-success:   #1e8449;
  --colour-warning:   #d68910;
  --colour-danger:    #c0392b;
  --colour-bg:        #f4f6f8;
  --colour-surface:   #ffffff;
  --colour-border:    #d5d8dc;
  --colour-text:      #1c2833;
  --colour-muted:     #717d7e;
  --radius:           6px;
  --shadow:           0 2px 8px rgba(0,0,0,0.08);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--colour-text);
  background: var(--colour-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- NAV ----- */
.navbar {
  background: var(--colour-primary);
  color: #fff;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.03em;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.navbar-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.navbar-link:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.navbar-link--active {
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-weight: 600;
}

/* ----- NAVBAR DROPDOWNS ----- */
.navbar-dropdown {
  position: relative;
  display: inline-flex;
}

.navbar-dropdown-toggle {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.navbar-dropdown:hover .navbar-dropdown-toggle,
.navbar-dropdown:focus-within .navbar-dropdown-toggle {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.navbar-dropdown--active .navbar-dropdown-toggle {
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-weight: 600;
}

.navbar-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--colour-surface);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  padding: 0.4rem 0;
  z-index: 50;
}

.navbar-dropdown:hover .navbar-dropdown-menu,
.navbar-dropdown:focus-within .navbar-dropdown-menu,
.navbar-dropdown--open .navbar-dropdown-menu {
  display: block;
}

/* Hamburger toggle - hidden on desktop, shown at mobile widths below */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.navbar-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--colour-text);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.navbar-dropdown-item:hover {
  background: var(--colour-bg);
}

.navbar-dropdown-item--active {
  font-weight: 600;
  color: var(--colour-primary);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.navbar-user a { color: #aed6f1; text-decoration: none; }
.navbar-user a:hover { color: #fff; }

.role-badge {
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.75rem;
  text-transform: capitalize;
}

/* ----- MAIN ----- */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ----- FOOTER ----- */
.site-footer {
  background: #eaecee;
  border-top: 1px solid var(--colour-border);
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--colour-muted);
}

/* ----- AUTH ----- */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.auth-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--colour-primary);
}

/* ----- FORMS ----- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--colour-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--colour-text);
  background: #fff;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--colour-accent);
  box-shadow: 0 0 0 3px rgba(46,134,193,0.15);
}

/* ----- BUTTONS ----- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.88; }

.btn-primary  { background: var(--colour-accent);   color: #fff; }
.btn-success  { background: var(--colour-success);  color: #fff; }
.btn-danger   { background: var(--colour-danger);   color: #fff; }
.btn-full     { display: block; width: 100%; text-align: center; }

/* ----- ALERTS ----- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error   { background: #fadbd8; border: 1px solid #e74c3c; color: #922b21; }
.alert-success { background: #d5f5e3; border: 1px solid #27ae60; color: #1e8449; }
.alert-warning { background: #fef9e7; border: 1px solid #f1c40f; color: #7d6608; }

/* ----- DASHBOARD ----- */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; color: var(--colour-primary); }
.page-subtitle { color: var(--colour-muted); margin-top: 0.25rem; }

/* ----- DASHBOARD MERGED TILES ----- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 480px) {
  .dash-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

.dash-tile {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--colour-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.dash-tile:hover {
  border-color: var(--colour-accent);
  box-shadow: 0 4px 12px rgba(46,134,193,0.15);
}
.dash-tile--info {
  cursor: default;
}
.dash-tile--info:hover {
  border-color: var(--colour-border);
  box-shadow: var(--shadow);
}
.dash-tile-icon  { font-size: 1.75rem; }
.dash-tile-count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--colour-primary);
  line-height: 1.1;
}
.dash-tile-label {
  font-size: 0.75rem;
  color: var(--colour-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--colour-primary);
  line-height: 1;
}

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

.quick-actions h2 {
  font-size: 1.1rem;
  color: var(--colour-primary);
  margin-bottom: 1rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.action-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--colour-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.action-card:hover {
  border-color: var(--colour-accent);
  box-shadow: 0 4px 12px rgba(46,134,193,0.15);
}

.action-icon { font-size: 2rem; }
.action-label { font-size: 0.85rem; font-weight: 600; }

/* ----- EVALUATION FORM ----- */
.eval-skill {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--colour-border);
}
.eval-skill:last-child { border-bottom: none; padding-bottom: 0; }
.eval-skill-name { font-weight: 600; margin-bottom: 0.75rem; }

.eval-rating-group { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.eval-rating-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.eval-rating-group label {
  cursor: pointer;
  padding: 0.35rem 0.8rem;
  border: 2px solid var(--colour-border);
  border-radius: 20px;
  font-size: 0.825rem;
  background: var(--colour-surface);
  color: var(--colour-text);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}
.eval-rating-group input[type="radio"]:checked + label {
  border-color: var(--colour-primary);
  background: var(--colour-primary);
  color: #fff;
}
.eval-rating-group input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--colour-accent);
  outline-offset: 2px;
}
.eval-comment {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--colour-text);
  background: var(--colour-surface);
  resize: vertical;
  min-height: 56px;
  font-family: inherit;
  box-sizing: border-box;
}
.rating-badge-excellent       { background:#d1fae5;color:#065f46;padding:0.2rem 0.65rem;border-radius:12px;font-size:0.8rem;font-weight:600;white-space:nowrap; }
.rating-badge-good            { background:#dbeafe;color:#1e40af;padding:0.2rem 0.65rem;border-radius:12px;font-size:0.8rem;font-weight:600;white-space:nowrap; }
.rating-badge-satisfactory    { background:#fef3c7;color:#92400e;padding:0.2rem 0.65rem;border-radius:12px;font-size:0.8rem;font-weight:600;white-space:nowrap; }
.rating-badge-needs_attention { background:#fee2e2;color:#991b1b;padding:0.2rem 0.65rem;border-radius:12px;font-size:0.8rem;font-weight:600;white-space:nowrap; }

/* ----- PAGE HEADER ROW ----- */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--colour-muted);
  margin-bottom: 0.35rem;
}

.breadcrumb a { color: var(--colour-accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ----- TABLES ----- */
.table-wrapper {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  background: #f0f3f6;
  border-bottom: 2px solid var(--colour-border);
  border-right: 1px solid var(--colour-border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--colour-muted);
  white-space: nowrap;
}

.data-table th:last-child { border-right: none; }

.data-table td {
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid #eaecee;
  border-right: 1px solid #f0f0f0;
  vertical-align: top;
}

.data-table td:last-child { border-right: none; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f7f9fb; }

.table-link {
  color: var(--colour-primary);
  font-weight: 600;
  text-decoration: none;
}

.table-link:hover { text-decoration: underline; }

.muted-link {
  color: var(--colour-muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.muted-link:hover { text-decoration: underline; }

.table-actions {
  text-align: right;
  white-space: nowrap;
}

.table-actions a {
  color: var(--colour-accent);
  text-decoration: none;
  font-size: 0.8rem;
  margin-left: 0.75rem;
}

.table-actions a:hover { text-decoration: underline; }

/* Status-coloured action links (e.g. "Staff checklist" on the audits list) need
   their badge colour to win over the default .table-actions a colour above. */
.table-actions a.badge-success { color: #1e8449; }
.table-actions a.badge-pending { color: #7d6608; }
.table-actions a.badge-danger  { color: #922b21; }
.table-actions a.badge-info    { color: #1a5276; }
.table-actions a.badge:hover   { text-decoration: none; opacity: 0.8; }

.table-actions .btn-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--colour-accent);
  font-size: 0.8rem;
  margin-left: 0.75rem;
  padding: 0;
  text-decoration: none;
}
.table-actions .btn-link:hover { text-decoration: underline; }
.table-actions .btn-link.text-danger { color: #922b21; }
.table-actions .btn-link.text-danger:hover { text-decoration: underline; }

.row-inactive td { opacity: 0.5; }

/* ----- EMPTY STATE ----- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--colour-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { margin-bottom: 1.25rem; }

/* ----- DETAIL VIEW ----- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.detail-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}

.detail-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--colour-muted);
  margin-bottom: 0.75rem;
}

address { font-style: normal; line-height: 1.7; font-size: 0.9rem; }

.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  font-size: 0.875rem;
}

.detail-list dt {
  color: var(--colour-muted);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  padding-top: 0.1rem;
}

.detail-list dd { color: var(--colour-text); word-break: break-word; overflow-wrap: break-word; }
.detail-list a  { color: var(--colour-accent); text-decoration: none; word-break: break-all; }
.detail-list a:hover { text-decoration: underline; }

.section-actions {
  margin-top: 0.5rem;
}

/* ----- FORMS ----- */
.form-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  max-width: 860px;
}

.form-section {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--colour-border);
}

.form-section:last-of-type { border-bottom: none; }

.form-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--colour-muted);
  margin-bottom: 1.1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 1rem;
}

.form-group--narrow { max-width: 160px; }

.required { color: var(--colour-danger); margin-left: 2px; }

select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--colour-text);
  background: #fff;
}

select:focus {
  outline: none;
  border-color: var(--colour-accent);
  box-shadow: 0 0 0 3px rgba(46,134,193,0.15);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid var(--colour-border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.btn-secondary {
  background: #fff;
  color: var(--colour-text);
  border: 1px solid var(--colour-border);
}

.btn-secondary:hover { background: #f4f6f8; opacity: 1; }

/* ----- RESPONSIVE ----- */
@media (max-width: 600px) {
  .main-content { padding: 1rem; }
  .navbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .navbar-brand { order: 1; }
  .navbar-toggle { display: block; order: 2; }
  .navbar-user { order: 3; }
  .navbar-user span:first-child { display: none; }

  /* Nav links collapse into a hamburger-triggered panel that pushes the
     page down (not an overlay) - full width, stacked, no horizontal scroll. */
  .navbar-links {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }
  .navbar-links--open { display: flex; }
  .navbar-link { padding: 0.6rem 0.75rem; }

  /* Dropdowns become inline accordions, not floating cards - hover/focus-within
     don't apply well to touch, so opening is click-driven via .navbar-dropdown--open. */
  .navbar-dropdown { display: block; }
  .navbar-dropdown-toggle { display: block; width: 100%; text-align: left; padding: 0.6rem 0.75rem; }
  .navbar-dropdown-menu {
    display: none;
    position: static;
    box-shadow: none;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    min-width: 0;
    margin: 0.15rem 0 0.15rem 0.75rem;
    padding: 0.2rem 0;
  }
  .navbar-dropdown-item { color: rgba(255,255,255,0.85); padding: 0.5rem 0.75rem; }
  .navbar-dropdown-item:hover { background: rgba(255,255,255,0.12); }
  .navbar-dropdown-item--active { color: #fff; }

  .form-section { padding: 1.25rem; }
  .form-actions { padding: 1rem 1.25rem; }
  .page-header-row { flex-direction: column; }
}

/* ----- BADGES ----- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #d5f5e3; color: #1e8449; }
.badge-pending { background: #fef9e7; color: #7d6608; }
.badge-danger  { background: #fadbd8; color: #922b21; }
.badge-info    { background: #d6eaf8; color: #1a5276; }

/* ----- REFERENCE CODES ----- */
.ref-code {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  background: #f0f3f6;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--colour-primary);
  letter-spacing: 0.05em;
}

.ref-code-large {
  font-family: 'Courier New', monospace;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--colour-primary);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.ref-hint {
  font-size: 0.78rem;
  color: var(--colour-muted);
  margin-top: 0.25rem;
}

/* ----- MISC ----- */
.muted-text {
  font-size: 0.8rem;
  color: var(--colour-muted);
}

.alert-info {
  background: #d6eaf8;
  border: 1px solid #2e86c1;
  color: #1a5276;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.form-section-hint {
  font-size: 0.8rem;
  color: var(--colour-muted);
  margin-bottom: 1rem;
  margin-top: -0.5rem;
}

textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--colour-text);
  background: #fff;
  resize: vertical;
  font-family: inherit;
}

textarea:focus {
  outline: none;
  border-color: var(--colour-accent);
  box-shadow: 0 0 0 3px rgba(46,134,193,0.15);
}

/* ----- AUDIT PROGRESS ----- */
.audit-progress-bar {
  margin-bottom: 1.25rem;
}

.audit-progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.audit-progress-fill {
  height: 100%;
  background: var(--colour-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.audit-progress-label {
  font-size: 0.78rem;
  color: var(--colour-muted);
  font-weight: 600;
}

.audit-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.audit-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--colour-border);
  background: #fff;
  color: var(--colour-muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.15s;
}

.audit-pill:hover { border-color: var(--colour-accent); }

.audit-pill--active {
  border-color: var(--colour-primary);
  background: var(--colour-primary);
  color: #fff;
}

.audit-pill--complete:not(.audit-pill--active) {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #16a34a;
}

/* ----- AUDIT SECTION CARD ----- */
.audit-section-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
}

.audit-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.audit-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--colour-primary);
  margin: 0;
}

.audit-section-ref {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.audit-question-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.audit-question {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 1.25rem;
}

.audit-question:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.audit-question-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.audit-question-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}

.audit-question-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin: -0.3rem 0 0.5rem;
  line-height: 1.5;
}

.audit-help-toggle {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--colour-border);
  background: #fff;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.15s;
}

.audit-help-toggle--active,
.audit-help-toggle:hover {
  border-color: var(--colour-accent);
  background: #eaf3fb;
  color: var(--colour-accent);
}

.audit-help-panel {
  background: #eaf3fb;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--colour-accent);
}

.audit-help-block { margin-bottom: 0.5rem; }
.audit-help-block:last-child { margin-bottom: 0; }

.audit-help-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--colour-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.audit-help-block p {
  font-size: 0.8rem;
  color: #475569;
  margin: 0.2rem 0 0;
  line-height: 1.5;
}

.audit-yesno-group {
  display: flex;
  gap: 0.6rem;
}

.audit-yesno-btn {
  padding: 0.45rem 1.2rem;
  border-radius: 7px;
  border: 1.5px solid var(--colour-border);
  background: #fff;
  color: var(--colour-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.audit-yesno-btn:hover:not(:disabled) { border-color: #94a3b8; }
.audit-yesno-btn:disabled { cursor: not-allowed; opacity: 0.6; }

.audit-yesno-btn--yes-active {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #16a34a;
}

.audit-yesno-btn--no-active {
  border-color: #ef4444;
  background: #fef2f2;
  color: #dc2626;
}

.audit-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-success {
  background: #22c55e;
  color: #fff;
}

.btn-success:hover { opacity: 0.9; }

/* ----- STAGE 2 CROSS-REFERENCE ----- */
.s1-crossref {
  background: #eaf3fb;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.s1-crossref-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--colour-accent);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.s1-crossref-value {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
}

/* ----- THREE-STATE CHECK BUTTONS ----- */
.check-btn-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.check-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  border: 1.5px solid var(--colour-border);
  background: #fff;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.check-btn:hover:not(:disabled) { border-color: #94a3b8; }
.check-btn:disabled { cursor: not-allowed; opacity: 0.6; }

.check-btn--confirmed.check-btn--active {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #16a34a;
}

.check-btn--not-met.check-btn--active {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #dc2626;
}

.check-btn--na.check-btn--active {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.check-note-input {
  width: 100%;
  border: 1.5px solid var(--colour-border);
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  box-sizing: border-box;
  margin-top: 0.25rem;
}

/* ----- RATING CARDS ----- */
.rating-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rating-btn {
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 9px;
  border: 2px solid var(--colour-border);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.rating-btn--active {
  border-color: var(--rating-border);
  background: var(--rating-bg);
}

.rating-btn-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #374151;
}

.rating-btn--active .rating-btn-label { color: var(--rating-color); }

.rating-btn-desc {
  font-size: 0.78rem;
  color: var(--colour-muted);
  margin-top: 0.15rem;
}

/* ----- ACTION PLAN ----- */
.action-item-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
}

.action-item-text {
  flex: 1;
  font-size: 0.85rem;
  color: #374151;
}

.action-item-priority {
  font-size: 0.75rem;
  border: 1px solid var(--colour-border);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  background: #fff;
}

.action-item-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
}

.action-add-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.action-add-row input {
  flex: 1;
}

/* ----- SIGNATURE PAD ----- */
.signature-pad-wrapper {
  border: 1.5px solid var(--colour-border);
  border-radius: 8px;
  overflow: hidden;
}

.signature-pad-header {
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.sig-clear-btn {
  font-size: 0.72rem;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
}

.sig-clear-btn:hover { color: var(--colour-danger); }

.signature-pad-wrapper canvas {
  display: block;
  width: 100%;
  height: 90px;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
}

.signoff-mode-banner {
  background: var(--colour-bg);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--colour-primary);
  font-weight: 600;
}

/* ----- AUDIT LIST: NEEDS ATTENTION ----- */
.row-needs-attention td {
  background: #fffbeb;
}

.row-needs-attention:hover td {
  background: #fef3c7;
}

/* ----- PLACEMENT JOURNEY TIMELINE ----- */
.journey-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.journey-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.timeline-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 180px;
}

.timeline-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 2px solid var(--colour-border);
  background: #fff;
  color: var(--colour-muted);
}

.timeline-step-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--colour-text);
}

.timeline-step-status {
  font-size: 0.75rem;
  color: var(--colour-muted);
  margin-top: 0.1rem;
}

.timeline-connector {
  height: 2px;
  background: var(--colour-border);
  flex: 0 0 40px;
  margin: 0 0.25rem;
}

.timeline-step--complete .timeline-step-icon {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #16a34a;
}

.timeline-step--active .timeline-step-icon {
  border-color: var(--colour-accent);
  background: #eaf3fb;
  color: var(--colour-accent);
}

.timeline-step--attention .timeline-step-icon {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #d97706;
}

.timeline-step--attention .timeline-step-status {
  color: #d97706;
  font-weight: 600;
}

.journey-next-action {
  border-top: 1px solid #f0f0f0;
  padding-top: 1.1rem;
}

.journey-invite-status {
  border-top: 1px solid #f0f0f0;
  padding-top: 1.1rem;
}
.invite-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.invite-status-label { color: #6b7280; margin-right: 0.35rem; }
.invite-status-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ----- MANUAL LINKS (SAFETY NET NAVIGATION) ----- */
.manual-links-card {
  background: #f8f9fa;
  border: 1px dashed var(--colour-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.manual-links-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.manual-links-row a {
  font-size: 0.85rem;
  color: var(--colour-accent);
  text-decoration: none;
  font-weight: 600;
}

.manual-links-row a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .journey-timeline { flex-direction: column; align-items: flex-start; }
  .timeline-connector { display: none; }
  .timeline-step { width: 100%; }
}

/* ----- ACTION PLAN: AUTO-SUGGESTED BADGE ----- */
.action-auto-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  padding: 1px 8px;
}

/* ----- DASHBOARD REMINDERS ----- */
.reminders-section {
  margin-bottom: 2rem;
}

.reminders-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--colour-text);
}

.reminder-panel {
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.reminder-panel--warning {
  background: #fffbeb;
  border: 1px solid #f59e0b;
}

.reminder-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.6rem 0;
  color: #92400e;
}

.reminder-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reminder-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #fde68a;
  gap: 1rem;
}

.reminder-list li:last-child { border-bottom: none; }

.reminder-list a {
  color: var(--colour-accent);
  text-decoration: none;
  font-weight: 600;
}

.reminder-list a:hover { text-decoration: underline; }

.reminder-date {
  font-size: 0.82rem;
  color: #92400e;
  white-space: nowrap;
}

/* ----- BADGE: WARNING ----- */
.badge-warning {
  background: #f59e0b;
  color: #fff;
}
