@media (max-width:600px) {

  /* Base mobile typography */
  body {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }

  /* Sticky mobile dropdown for quick navigation */
  #mobileSectionDropdownWrapper {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: var(--bg);
    padding: 8px 0;
  }

  /* Stack question table rows and cells for mobile readability */
  .table tbody[data-questions] tr,
  .table tbody[data-evidence] tr,
  .table tbody[data-findings] tr {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    background: var(--bg-elev);
  }

  /* Mobile-friendly search input */
  #sidebarSearch {
    font-size: 16px !important;
    padding: 12px 16px !important;
    height: 44px !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-border-radius: 12px !important;
  }

  /* Prevent zoom on iOS when focusing input */
  #sidebarSearch:focus {
    font-size: 16px !important;
  }

  /* Better touch targets for nav items on mobile */
  .nav-item {
    padding: 14px 16px !important;
    min-height: 48px !important;
    font-size: 15px !important;
  }

  .nav-item .nav-icon {
    font-size: 18px !important;
    margin-right: 12px !important;
  }

  /* Better photo button for mobile */
  .photo-upload-actions {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .photo-upload-button {
    width: 48% !important;
    max-width: 140px !important;
    padding: 7px 10px !important;
    font-size: 11px !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  /* Responsive photo grid */
  .photos-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  }

  /* Better landscape photo layout */
  @media (orientation: landscape) {
    .photos-grid {
      grid-template-columns: repeat(3, 1fr) !important;
    }
  }

  /* Better comment styling on mobile */
  .photo-comment {
    font-size: 14px !important;
    min-height: 50px !important;
    padding: 10px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 8px !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    background: white !important;
    color: #333 !important;
    resize: vertical !important;
  }

  /* Ensure photo containers stack properly on mobile */
  .photo-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }

  /* Mobile textarea height - 120px for questions, but General Notes stays 200px */
  textarea {
    min-height: 90px !important;
  }

  /* Keep General Notes textarea at 200px on mobile */
  #meta-notes {
    min-height: 200px !important;
  }

  /* Ensure touch targets meet 44px height */
  button,
  .photo-upload-button,
  .table .secondary,
  .table .danger {
    min-height: 44px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .reg-chip-remove {
    font-size: 18px;
    min-width: 24px;
    min-height: 24px;
  }

  /* Add breathing room between stacked controls */
  .row-actions,
  .table tbody[data-findings] td:last-child,
  .table tbody[data-questions] td:last-child,
  .table tbody[data-evidence] td:last-child {
    margin-top: 8px !important;
  }

  .table tbody[data-questions] td,
  .table tbody[data-evidence] td,
  .table tbody[data-findings] td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    padding: 8px 8px 0 8px;
    border: none;
  }

  .table tbody[data-questions] td:last-child,
  .table tbody[data-evidence] td:last-child,
  .table tbody[data-findings] td:last-child {
    margin-top: 6px;
    padding-bottom: 10px;
  }

  .table tbody[data-questions]~thead,
  .table thead {
    display: none;
  }

  /* Wrap long IDs/labels instead of squeezing */
  .table td,
  .table td .readonly-cell,
  .table td textarea {
    word-break: break-word !important;
  }

  /* Question text wrapping on mobile */
  .table td:nth-child(2) .readonly-cell {
    max-width: none;
    width: 100%;
  }

  /* Sticky actions on mobile */
  .row-actions {
    width: 100% !important;
    padding: 6px 0 !important;
    position: sticky;
    bottom: 12px;
    z-index: 900;
    background: var(--bg);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
    margin-top: 10px !important;
  }

  .row-actions button {
    width: 100% !important;
  }

  /* Inputs and selects with lighter borders on mobile */
  input,
  select,
  textarea {
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: none !important;
  }

  /* Full-width primary actions */
  .row-actions {
    width: 100% !important;
    padding: 6px 0 !important;
  }

  .row-actions button {
    width: 100% !important;
  }

  /* Photo overlays: avoid overlapping delete and zoom hint on mobile */
  .photo-delete {
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
  }

  .photo-zoom-hint {
    left: 50% !important;
    bottom: 8px !important;
    transform: translateX(-50%) !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
  }

  /* Taller photo thumbnails for easier tapping */
  .photo-thumbnail {
    height: 170px !important;
  }

  /* Mobile sidebar sections separation */
  .sidebar-header {
    font-size: 14px !important;
    padding: 8px 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #60a5fa !important;
  }

  #sidebarAdmin {
    padding-bottom: 16px !important;
    margin-bottom: 16px !important;
    border-bottom: 2px solid rgba(96, 165, 250, 0.3) !important;
    position: relative !important;
  }

  #sidebarAdmin::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.5), transparent) !important;
  }

  #sidebarDocuments {
    padding-bottom: 16px !important;
    margin-bottom: 16px !important;
    border-bottom: 2px solid rgba(96, 165, 250, 0.3) !important;
    position: relative !important;
  }

  #sidebarDocuments::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.5), transparent) !important;
  }
}

/* ---------------------------------------------
   Professional Compact UI — drop-in replacement
   Works with your existing HTML + app.js IDs/classes
   --------------------------------------------- */



* {
  box-sizing: border-box;
}

/* THEME TOKENS */


:root {
  /* Base Colors - deeper, richer darks */
  --bg: #030712;
  /* Gray 950 - deeper black/blue */
  --bg-base: #0f172a;
  /* Slate 900 */
  --bg-elev: #1e293b;
  /* Slate 800 */
  --bg-elev-1: #1e293b;
  --bg-elev-2: #334155;
  /* Slate 700 */
  --bg-elev-3: #475569;
  /* Slate 600 */
  --text: #f8fafc;
  /* Slate 50 */
  --muted: #94a3b8;
  /* Slate 400 */
  --text-secondary: #cbd5e1;
  /* Slate 300 */

  /* Primary Colors - More vibrant */
  --primary: #3b82f6;
  /* Blue 500 */
  --primary-600: #2563eb;
  /* Blue 600 */
  --primary-100: #172554;
  /* Blue 950 */

  /* Semantic Colors */
  --border: rgba(148, 163, 184, 0.15);
  /* Subtle border */
  --card: rgba(30, 41, 59, 0.7);
  /* Glassy card */
  --danger: #ef4444;
  --danger-100: #450a0a;
  --success: #22c55e;
  --success-100: #052e16;
  --warning: #f59e0b;
  --warning-100: #451a03;
  --focus: rgba(59, 130, 246, 0.5);

  /* Shadows - Smoother, deeper */
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);

  /* Border Radius Scale - Slightly more rounded */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  --radius: 16px;
  /* Default card radius */

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* Reusable Gradients - cleaner */
  --gradient-primary: linear-gradient(135deg, #3b82f6, #60a5fa);
  --gradient-success: linear-gradient(135deg, #22c55e, #4ade80);
  --gradient-danger: linear-gradient(135deg, #ef4444, #f87171);
  --gradient-warning: linear-gradient(135deg, #f59e0b, #fbbf24);
  --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
  --gradient-bg-elev: linear-gradient(180deg, #1e293b, #0f172a);

  /* Effects */
  --glow-primary: 0 0 20px rgba(59, 130, 246, 0.5);
  --glow-success: 0 0 20px rgba(34, 197, 94, 0.5);
  --glow-danger: 0 0 20px rgba(239, 68, 68, 0.5);
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --backdrop-blur: blur(12px);

  /* Timing Functions */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* BASE */

html,
body {
  height: 100%
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-600) transparent;
}

body::-webkit-scrollbar {
  width: 12px;
  background: transparent;
}

body::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(8, 13, 26, 0.95), rgba(15, 23, 42, 0.85));
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  border-radius: 999px;
  border: 2px solid rgba(8, 13, 26, 0.9);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7dd3fc, var(--primary));
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.45);
}

/* Ensure emojis render properly */
.nav-icon,
.icon {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.title h2 {
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px
}

/* HEADER */

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 1200;
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .2px
}

.muted {
  color: var(--muted)
}

/* HEADER ACTIONS */
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* LAYOUT */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  min-height: calc(100vh - 70px);
}

/* SIDEBAR */
.sidebar {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 96px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-inner {
  padding: 14px;
}

.sidebar-header {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #60a5fa;
}

/* Documents Section Styling */
#sidebarAdmin {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(96, 165, 250, 0.3);
  position: relative;
}

#sidebarAdmin::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.5), transparent);
}

#sidebarDocuments {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(96, 165, 250, 0.3);
  position: relative;
}

#sidebarDocuments::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.5), transparent);
}

/* Systems Section Styling */
#sidebarNav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#sidebarNav::-webkit-scrollbar {
  width: 8px;
}

#sidebarNav::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, .3);
  border-radius: 999px;
}

@media (hover: none) and (pointer: coarse) {
  .sidebar {
    height: calc(100vh - 110px);
    overflow: hidden;
  }

  .sidebar-inner {
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  #sidebarNav {
    max-height: none;
    padding-right: 8px;
  }

  .nav-item {
    padding: 12px 14px;
  }
}


.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .2s var(--ease-out);
  justify-content: flex-start;
  color: #e2e8f0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  transform: translateX(4px);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.2);
}



.nav-item .nav-icon {
  width: 24px;
  text-align: center;
  font-size: 18px
}

.nav-item .nav-text {
  flex: 1;
}

.nav-badge {
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-badge.idle {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.nav-badge.warn {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.4);
}

.nav-badge.done {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* CONTENT AREA */
.content {
  min-width: 0;
}

/* CARDS */
.card {
  background: var(--card);
  /* Glassy background */
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 24px 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.2s var(--ease-out);
  will-change: transform;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .45);
  border-color: rgba(96, 165, 250, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(14, 23, 42, .8), rgba(30, 41, 59, .4));
  border-left: 3px solid transparent;
  transition: border-left-color 0.2s ease, background 0.3s ease;
}

.card[data-completed="true"] .card-header {
  border-left-color: #16a34a;
  background: linear-gradient(135deg, rgba(22, 101, 52, .15), rgba(14, 23, 42, .8));
}

.card:hover .card-header {
  border-left-color: var(--primary);
}

.card-body {
  padding: 16px 16px 18px
}


.icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-100);
  border: 1px solid #3b82f6;
  font-size: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover .icon {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
}

.icon.global {
  background: linear-gradient(135deg, #134e4a, #0f766e);
  border-color: #0e7490;
}

.card:hover .icon.global {
  box-shadow: 0 0 16px rgba(15, 118, 110, 0.3);
}

.card-header .title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .2px;
  transition: color 0.2s ease;
}

.card:hover .title h2 {
  color: #93c5fd;
}

.subtitle {
  font-size: 12px;
  margin-top: 2px;
  color: var(--muted)
}

/* GRID + FORMS */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px
}

@media (max-width:1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:640px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

.metadata-grid input[type="date"] {
  max-width: 180px;
}

.grid-span-full {
  grid-column: 1 / -1;
}

.meta-notes {
  min-height: 320px;
}

.session-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #fff;
}

@media (max-width: 768px) {
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .metadata-grid input[type="date"] {
    max-width: 100%;
  }
}

.session-switcher {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.session-switcher select {
  min-width: 200px;
}

.session-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.session-btn {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out), opacity 0.15s var(--ease-out);
}

.session-btn:hover {
  transform: translateY(-1px);
}

.session-btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

.session-btn.ghost {
  background: linear-gradient(135deg, #0f172a, #111827);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #fff
}

input,
select,
textarea {
  width: 100%;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 2px var(--focus), 0 4px 12px rgba(96, 165, 250, 0.15);
  border-color: var(--primary);
  background: rgba(14, 23, 42, 0.8);
}

textarea {
  min-height: 160px;
  resize: vertical
}

.findings-textarea {
  min-height: 260px;
}

input[readonly],
textarea[readonly] {
  background: #1e293b;
  color: #64748b
}

/* BUTTONS */
button {
  appearance: none;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  cursor: pointer;
  transition: all .2s var(--ease-out);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
  will-change: transform;
}

button:hover {
  background: var(--bg-elev-3);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button.primary {
  color: white;
  background: var(--gradient-primary);
  border: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

button.primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.4);
}

button.secondary {
  background: var(--bg-elev-1);
}

button.danger {
  background: var(--gradient-danger);
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

button.danger:hover {
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.4);
}

/* TABLES */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #1e293b, #0e172a);
  color: #fff;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
}

.table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  vertical-align: top;
  font-size: 14px;
  color: #fff;
  transition: background-color 0.15s ease;
}

.table tbody tr:hover td {
  background: rgba(96, 165, 250, 0.06);
}

.notes-textarea {
  width: 100%;
  min-height: 250px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #0f172a, #0b1220);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2) inset, 0 1px 2px rgba(0, 0, 0, .15);
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.notes-textarea::placeholder {
  color: #94a3b8
}

.notes-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
  background: linear-gradient(180deg, #0f172a, #0b1220);
}

.notes-textarea:disabled {
  opacity: .7;
  cursor: not-allowed
}

@media (max-width: 768px) {
  .notes-textarea {
    min-height: 200px;
  }

  .comments-textarea {
    min-height: 180px !important;
  }
}

/* PHOTO ATTACHMENTS */
.photo-block details {
  border-radius: var(--radius);
}

.photos-container {
  margin: 10px 0;
}

.photo-upload {
  margin-bottom: 15px;
}

.photo-input {
  display: none;
}

.photo-upload-button {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
  transition: all 0.2s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.photo-upload-button:hover,
.photo-upload-button:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.photo-upload-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.photo-upload-button.secondary {
  background: linear-gradient(135deg, #0f172a, #111827);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.photo-upload-button.compact {
  padding: 9px 12px;
  font-size: 12px;
  border-radius: 9px;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.photo-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-thumbnail-wrapper {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.photo-thumbnail-wrapper:active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
}

.photo-thumbnail-wrapper:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  border-color: rgba(59, 130, 246, 0.4);
}

.photo-thumbnail {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.regulation-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.regulation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
}

.reg-chip {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.reg-chip-remove {
  background: transparent;
  border: none;
  color: #bfdbfe;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}

.regulation-toggle {
  align-self: flex-start;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25);
}

.regulation-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.regulation-menu {
  display: none;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 12px;
  padding: 12px;
  max-height: 240px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(96, 165, 250, 0.1);
  margin-top: 6px;
  z-index: 10;
}

.regulation-menu.open {
  display: block;
}

.reg-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.4;
}

.regulation-menu .reg-option-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.7)) !important;
  color: #e2e8f0 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.regulation-menu .reg-option-btn:hover {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.8)) !important;
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.regulation-menu .reg-option-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 2px 8px rgba(59, 130, 246, 0.4);
  transform: translateX(2px);
}

.summary-detail {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.summary-detail th {
  text-align: left;
  width: 110px;
  font-size: 11px;
  color: #cbd5e1;
  padding: 6px 8px;
  vertical-align: top;
}

.summary-detail td {
  padding: 6px 8px;
  font-size: 12px;
  color: #e5e7eb;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  width: auto;
}

.summary-detail tr+tr td,
.summary-detail tr+tr th {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-detail-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
  touch-action: auto;
}

/* Give description more width than regulation in findings detail rows */
.finding-detail-row .summary-detail-block {
  grid-template-columns: minmax(180px, 0.6fr) minmax(320px, 1.4fr);
}

.summary-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  touch-action: auto;
  pointer-events: auto;
}

.summary-field .field-label {
  font-size: 11px;
  color: #94a3b8;
}

.findings-summary {
  width: 100%;
}

.findings-summary table {
  width: calc(100% + 32px) !important;
  margin-left: -16px;
  margin-right: -16px;
  table-layout: auto;
  display: table;
  border-collapse: collapse;
}

.finding-detail-row td {
  background: var(--bg-elev);
  border-top: none;
  touch-action: auto;
  pointer-events: auto;
}

.finding-detail-row td[colspan] {
  padding-left: 16px;
}

.reg-desc-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 8px 0;
}

.description-wrapper label {
  font-size: 12px;
  color: #cbd5e1;
  display: block;
  margin-bottom: 4px;
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 11px;
  color: #94a3b8;
}

.photo-delete {
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #f87171, #dc2626);
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  border-radius: 0 8px 0 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.2s ease;
}

.photo-delete:hover {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  opacity: 0.95;
}

.photo-zoom-hint {
  position: absolute;
  bottom: 5px;
  left: 5px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  pointer-events: none;
}

.photo-comment-wrapper {
  width: 100%;
  margin-top: 8px;
}

.photo-comment {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border-radius: 8px;
  border: 2px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(180deg, #0f172a, #0b1220);
  color: #e2e8f0;
  padding: 10px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-comment:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  outline: none;
}

.comments-textarea {
  min-height: 180px;
}

.photo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.photo-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.photo-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Attachments list */
.attachments-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachments-empty {
  color: #64748b;
  font-style: italic;
  padding: 12px;
  font-size: 13px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
}

.attachment-icon {
  font-size: 24px;
}

.attachment-info {
  flex: 1;
  min-width: 0;
}

.attachment-link {
  font-weight: 500;
  color: #60a5fa;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.attachment-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.attachment-meta {
  font-size: 11px;
  color: #94a3b8;
}

.attachment-remove {
  min-width: 80px;
}

/* App modal dialogs */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: appModalFadeIn 0.2s ease;
}

.app-modal {
  background: var(--card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: min(450px, 90vw);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(59, 130, 246, 0.15);
  animation: appModalSlideUp 0.3s var(--ease-out);
}

.app-modal--compact {
  width: min(400px, 90vw);
}

.app-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.app-modal-icon {
  font-size: 36px;
}

.app-modal-title {
  margin: 0 0 20px 0;
  color: #e2e8f0;
  font-size: 18px;
  font-weight: 700;
}

.app-modal-title--inline {
  margin: 0;
  font-size: 20px;
}

.app-modal-message {
  margin: 0 0 24px 0;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.6;
}

.app-modal-input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.app-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.app-modal-btn {
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.app-modal-btn-secondary {
  border: 1px solid rgba(96, 165, 250, 0.3);
  background: transparent;
  color: #94a3b8;
}

.app-modal-btn-secondary:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.5);
}

.app-modal-btn-primary {
  border: none;
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.app-modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}

.app-modal-btn-danger {
  border: none;
  background: var(--gradient-danger);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.app-modal-btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
}

@keyframes appModalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes appModalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0.7;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.table tr:hover td {
  background: rgba(2, 6, 23, .02);
}

.readonly-cell {
  font-size: 13px;
  color: #cbd5e1;
}

/* Question column text wrapping */
.table td:nth-child(2) .readonly-cell {
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  max-width: 250px;
}

/* STATUS ROW COLORS */
.yes-row {
  background: rgba(16, 185, 129, .13)
}

.no-row {
  background: rgba(220, 38, 38, .13)
}

/* MISC */
.block {
  margin: 12px 0
}

summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

small.hint {
  color: var(--muted);
  font-size: 12px
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap
}

.radio input {
  margin: 0
}

.sm {
  font-size: 13px
}

.actions button {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  min-height: 38px;
}

.btn-primary {
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.25);
}

.btn-primary:hover {
  background: #1e40af;
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.35);
}

.btn-secondary {
  background: #334155;
  color: #e2e8f0;
}

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

.btn-secondary:focus-visible {
  box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.35);
}

.btn-purple {
  background: #5b21b6;
  color: #f8fafc;
}

.btn-purple:hover {
  background: #4c1d95;
}

.btn-purple:focus-visible {
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.35);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-danger:focus-visible {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1px solid #475569;
  color: #475569;
}

.btn-outline:hover {
  background: #1f2937;
  color: #e2e8f0;
}

.btn-outline:focus-visible {
  box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.35);
}

.btn-outline-orange {
  background: transparent;
  border: 1px solid #d97706;
  color: #d97706;
}

.btn-outline-orange:hover {
  background: #7c2d12;
  color: #fef3c7;
}

.btn-outline-orange:focus-visible {
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.35);
}

/* Ensure header buttons keep intended colors */
.actions .btn-primary {
  background: #1d4ed8 !important;
  color: #fff !important;
  border-color: transparent !important;
}

.actions .btn-primary:hover {
  background: #1e40af !important;
}

.actions .btn-secondary {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: transparent !important;
}

.actions .btn-secondary:hover {
  background: #1f2937 !important;
}

.actions .btn-purple {
  background: #5b21b6 !important;
  color: #f8fafc !important;
  border-color: transparent !important;
}

.actions .btn-purple:hover {
  background: #4c1d95 !important;
}

.actions .btn-danger {
  background: #dc2626 !important;
  color: #fff !important;
  border-color: transparent !important;
}

.actions .btn-danger:hover {
  background: #b91c1c !important;
}

.actions .btn-outline-orange {
  background: transparent !important;
  border: 1px solid #d97706 !important;
  color: #d97706 !important;
}

.actions .btn-outline-orange:hover {
  background: #7c2d12 !important;
  color: #fef3c7 !important;
}

/* Mobile search results */
.mobile-result-icon {
  margin-right: 8px;
}

.mobile-result-text {
  display: inline-block;
}

/* TOOLBAR (top right actions, if present) */
.toolbar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin: 8px 0
}

.banner {
  background: var(--warning-100);
  border: 1px solid #facc15;
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 12px 0;
  box-shadow: var(--shadow-sm);
}

.banner-info {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}

.banner-success {
  background: var(--success-100);
  border-color: #22c55e;
}

.banner-warning {
  background: var(--warning-100);
  border-color: #facc15;
}

.banner-error {
  background: var(--danger-100);
  border-color: #ef4444;
}

/* Ensure answer highlights stay visible on mobile stacks */
.table tr.yes-row td {
  background: rgba(16, 185, 129, .13) !important;
}

.table tr.no-row td {
  background: rgba(220, 38, 38, .13) !important;
}

/* Hide noisy save banner on small screens */
@media (max-width: 768px) {
  #loadStatus {
    display: none;
  }
}

.question-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.citation-pill {
  display: inline-block;
  background: #2f3542;
  /* refined neutral */
  color: #e5e7eb;
  border: 1px solid #4b5563;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
}

.citation-pill.regulation-badge {
  background: #1e293b;
  border-color: #334155;
  color: #e0f2fe;
}

.citation-pill.regulation-badge.regulation-epac {
  background: #312e81;
  border-color: #4338ca;
  color: #ede9fe;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.3);
}

.citation-pill.control-2022-badge {
  background: #111827;
  border-color: #1f2937;
  color: #c7d2fe;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

@media (max-width: 640px) {
  .question-line {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ANCHOR offsets for smooth scroll under sticky header */
.anchor {
  position: relative;
  top: -78px
}

/* RESPONSIVE BEHAVIOR */
@media (max-width:1000px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sidebar {
    position: static;
    top: auto;
  }
}

@media (max-width:600px) {

  /* Show mobile section switcher, hide sidebar */
  #mobileSectionDropdownWrapper {
    display: block;
    margin: 6px 0 2px;
  }

  /* Mobile results list with scroll hint */
  #mobileResultsList {
    position: relative;
  }

  #mobileResultsList::after {
    content: '⬇ Scroll for more';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--bg-elev) 60%, transparent);
    padding: 12px 16px 8px;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    pointer-events: none;
    font-weight: 600;
    letter-spacing: 0.5px;
  }

  .sidebar {
    display: none !important;
  }
}

/* Mobile section dropdown styling */
#mobileSectionDropdownWrapper select,
.section-dropdown {
  width: 100%;
  appearance: none;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  letter-spacing: .2px;
  box-shadow: var(--shadow-sm);
  background-image:
    linear-gradient(180deg, transparent, transparent),
    radial-gradient(8px 8px at 95% 50%, rgba(2, 6, 23, .2) 50%, transparent 51%);
  background-repeat: no-repeat;
  background-position: right 14px center, right 42px center;
}

#mobileSectionDropdownWrapper small {
  color: var(--muted);
}

/* FOCUS VISIBLE */
:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--focus), 0 4px 12px rgba(96, 165, 250, 0.15);
}

/* Enhanced focus for interactive elements */
.nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* REDUCED MOTION SUPPORT */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .matrix-canvas {
    display: none;
  }
}

/* Smooth scroll for normal users */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* AUTH OVERLAY */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(20px) saturate(180%);
  animation: fadeIn 0.3s ease;
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
  filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.4));
  pointer-events: none;
  display: block !important;
}

.auth-card {
  background: var(--gradient-card);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: var(--radius-2xl);
  padding: 40px 36px;
  width: min(420px, 90vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(96, 165, 250, 0.1);
  color: var(--text);
  position: relative;
  z-index: 1;
  overflow: hidden;
  animation: slideUp 0.4s var(--ease-out);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.6;
  }
}

.auth-card h2 {
  margin: 0 0 24px 0;
  font-size: 24px;
  font-weight: 700;
  color: #e2e8f0;
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.2);
  position: relative;
  z-index: 1;
}

.auth-logo {
  font-size: 48px;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.auth-title {
  font-weight: 700;
  font-size: 18px;
  color: #60a5fa;
  text-align: center;
  line-height: 1.4;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-card input {
  padding: 14px 16px;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  outline: none;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auth-card input:focus {
  border-color: #60a5fa;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.auth-card input::placeholder {
  color: #64748b;
}

.auth-card button {
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-card button:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}

.auth-card button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.auth-error {
  min-height: 20px;
  color: #fca5a5;
  font-size: 13px;
  text-align: center;
  padding: 10px;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  animation: shake 0.5s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

.auth-error:empty {
  display: none;
}

/* Remove focus outline from completed checkbox */
input[data-completed]:focus {
  outline: none;
  box-shadow: none;
}

/* Better styling for completed checkbox */
input[data-completed] {
  accent-color: #22c55e;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

input[data-completed]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #22c55e40;
}

input[data-not-checked] {
  accent-color: #94a3b8;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

input[data-not-checked]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #94a3b850;
}

.completed-checkbox input[data-not-checked] {
  border-color: #475569;
  background: #0f172a;
}

.completed-checkbox input[data-not-checked]:checked {
  background: linear-gradient(135deg, #475569, #334155);
  border-color: #475569;
  box-shadow: none;
}

.completed-checkbox input[data-not-checked]:checked::after {
  color: #cbd5e1;
}

/* PRINT */
@media print {

  /* Hide UI elements */
  .header-bar,
  .sidebar,
  .toolbar,
  #mobileSectionDropdownWrapper,
  .auth-overlay,
  button,
  .actions,
  .nav-item,
  .toast,
  .tooltip,
  [data-add-finding],
  .photo-delete,
  .photo-upload,
  .session-switcher {
    display: none !important;
  }

  /* Reset colors for print */
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Page setup */
  @page {
    margin: 2cm;
    size: A4;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 11pt;
    line-height: 1.4;
  }

  /* Card styling */
  .card {
    box-shadow: none !important;
    border: 1px solid #000 !important;
    background: white !important;
    page-break-inside: avoid;
    margin-bottom: 20px;
  }

  .card-header {
    background: #f5f5f5 !important;
    border-bottom: 2px solid #000 !important;
    padding: 10px !important;
  }

  .card-body {
    padding: 15px !important;
  }

  /* Headers */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
    color: black !important;
    margin-top: 10pt;
    margin-bottom: 6pt;
  }

  h1 {
    font-size: 18pt;
  }

  h2 {
    font-size: 16pt;
  }

  h3 {
    font-size: 14pt;
  }

  /* Tables */
  .table {
    width: 100%;
    border-collapse: collapse;
    page-break-inside: auto;
  }

  .table thead {
    display: table-header-group;
  }

  .table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  .table th,
  .table td {
    border: 1px solid #000 !important;
    padding: 6px !important;
    font-size: 10pt;
    background: white !important;
    color: black !important;
  }

  .table th {
    background: #e5e5e5 !important;
    font-weight: bold;
  }

  /* Photos */
  .photos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    page-break-inside: avoid;
  }

  .photo-thumbnail {
    max-width: 100%;
    height: auto;
    border: 1px solid #000;
  }

  /* Show URLs for links */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  /* Don't show URLs for anchor links */
  a[href^="#"]::after {
    content: "";
  }

  /* Metadata grid */
  .metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
  }

  /* Text areas and inputs - show content */
  input,
  textarea,
  select {
    border: 1px solid #000 !important;
    background: white !important;
    color: black !important;
    padding: 4px !important;
    font-size: 10pt !important;
  }

  /* Page breaks */
  .page-break {
    page-break-after: always;
  }

  .no-break {
    page-break-inside: avoid;
  }

  /* Findings section */
  .findings-container {
    page-break-inside: avoid;
  }

  /* Impact badges */
  .impact-badge {
    border: 1px solid #000 !important;
    padding: 2px 6px !important;
    background: #f0f0f0 !important;
    color: black !important;
  }

  /* Status indicators */
  .yes-row {
    background: #e8f5e9 !important;
  }

  .no-row {
    background: #ffebee !important;
  }

  /* Navigation badges */
  .nav-badge {
    border: 1px solid #000 !important;
    background: white !important;
    color: black !important;
  }
}


/* You kept this class earlier — leaving it for backward compat */
.hidden {
  display: none
}

/* ===== UI ENHANCEMENTS ===== */

/* Enhanced Card Shadows */
.card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

/* Better Buttons */
button {
  transition: all 0.2s ease;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

button:active {
  transform: translateY(1px);
  opacity: 0.92;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Enhanced Primary Buttons */
button:not(.secondary):not(.danger):not(.photo-delete) {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
}

.ai-suggest-actions {
  margin-top: 10px;
}

.ai-suggest-btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(15, 23, 42, 0.8);
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-suggest-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.ai-sparkle {
  font-size: 15px;
}

#globalLoadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15000;
  backdrop-filter: blur(4px);
}

#globalLoadingOverlay .loader-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  padding: 32px 40px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
  color: #e2e8f0;
  font-size: 16px;
}

#globalLoadingOverlay .spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(148, 163, 184, 0.4);
  border-top-color: #60a5fa;
  margin: 0 auto 16px auto;
  animation: spin 1s linear infinite;
}

#globalLoadingOverlay p {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

button:not(.secondary):not(.danger):not(.photo-delete):hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* Enhanced Secondary Buttons */
button.secondary {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
  color: #475569;
}

button.secondary:hover {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-color: #cbd5e1;
}

/* Enhanced Danger Buttons */
button.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
}

button.danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Tap feedback on rows */
.table tbody tr {
  transition: transform 0.1s ease, box-shadow 0.12s ease;
}

.table tbody tr:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Floating Action Button Style for "Add Finding" */
button[data-add-finding] {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3), 0 2px 4px -1px rgba(5, 150, 105, 0.2);
}

button[data-add-finding]:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-2px);
  box-shadow: 0 8px 12px -2px rgba(5, 150, 105, 0.4), 0 4px 6px -1px rgba(5, 150, 105, 0.3);
}

/* Icon buttons enhancement */
button.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border: none;
  font-size: 16px;
  transition: all 0.2s ease;
}

button.icon-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
}

/* Button group styling */
.button-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.button-group button:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.button-group button:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.button-group button:not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes ripple-animation {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }

  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.btn-ripple:active::before {
  width: 300px;
  height: 300px;
}

/* Success/Error Button States */
button.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
}

button.success:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

button.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
}

button.warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

/* Disabled button state */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

button:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Chart Container */
.chart-container {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 16px;
  text-align: center;
}

.chart-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  justify-content: center;
}

.chart-item {
  background: linear-gradient(135deg, #334155, #1e293b);
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
  min-width: 140px;
  max-width: 180px;
}

.chart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.3);
}

.chart-value {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #ffffff;
}

.chart-label {
  font-size: 12px;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Photo comment textarea styling */
.photo-comment {
  width: 100%;
  background: linear-gradient(180deg, #0f172a, #0b1220);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  /* match .sm */
  color: var(--text);
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2) inset, 0 1px 2px rgba(0, 0, 0, .15);
}

.photo-comment::placeholder {
  color: #94a3b8
}

.photo-comment:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
}

@media (max-width: 768px) {
  .photo-comment {
    min-height: 80px;
  }
}

/* Summary/Findings charts */
.chart-container {
  margin: 12px 0 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.85));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.chart-container.summary-insights {
  padding: 10px;
}

.chart-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
}

.chart-container.summary-insights .chart-title {
  font-size: 13px;
  margin-bottom: 8px;
}

.chart-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-container.summary-insights .chart-grid {
  gap: 8px;
}

.chart-item {
  flex: 1 1 140px;
  min-width: 130px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-left: 4px solid var(--primary);
}

.chart-container.summary-insights .chart-item {
  flex: 1 1 110px;
  min-width: 110px;
  padding: 8px;
}

.chart-value {
  font-size: 22px;
  font-weight: 700;
  color: #e2e8f0;
}

.chart-container.summary-insights .chart-value {
  font-size: 18px;
}

.chart-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.chart-container.summary-insights .chart-label {
  font-size: 11px;
}

/* Classification-specific colors */
.chart-item.serious {
  border-left: 4px solid #dc2626;
}

.chart-item.serious .chart-value {
  color: #dc2626;
}

.chart-item.non-compliance {
  border-left: 4px solid #ea580c;
}

.chart-item.non-compliance .chart-value {
  color: #ea580c;
}

.chart-item.improvement {
  border-left: 4px solid #3b82f6;
}

.chart-item.improvement .chart-value {
  color: #3b82f6;
}

.chart-item.non-confirmation {
  border-left: 4px solid #6b7280;
}

.chart-item.non-confirmation .chart-value {
  color: #6b7280;
}

.chart-item.total {
  border-left: 4px solid #3b82f6;
}

.chart-item.total .chart-value {
  color: #3b82f6;
}

.chart-item.completed {
  border-left: 4px solid #10b981;
}

.chart-item.completed .chart-value {
  color: #10b981;
}

.chart-item.in-progress {
  border-left: 4px solid #f59e0b;
}

.chart-item.in-progress .chart-value {
  color: #f59e0b;
}

.chart-item.not-checked {
  border-left: 4px solid #64748b;
}

.chart-item.not-checked .chart-value {
  color: #64748b;
}

.chart-item.photos {
  border-left: 4px solid #38bdf8;
}

.chart-item.photos .chart-value {
  color: #38bdf8;
}

.chart-item.pdfs {
  border-left: 4px solid #a78bfa;
}

.chart-item.pdfs .chart-value {
  color: #a78bfa;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
  .chart-grid {
    gap: 12px;
  }

  .chart-item {
    padding: 12px;
    min-width: 120px;
    flex: 1 1 calc(50% - 6px);
  }

  .chart-value {
    font-size: 20px;
  }

  .card {
    margin: 8px 0;
    border-radius: 12px;
  }

  button {
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Mobile-first button enhancements */
  .actions {
    gap: 6px;
  }

  .actions button {
    padding: 10px 14px;
    font-size: 12px;
    min-height: 44px;
    /* Touch-friendly minimum */
  }

  /* Stack buttons vertically on very small screens */
  @media (max-width: 480px) {
    .actions {
      flex-direction: column;
      width: 100%;
      gap: 8px;
    }

    .actions button {
      width: 100%;
      padding: 14px 16px;
      justify-content: center;
    }
  }
}

@media (max-width: 480px) {
  .chart-grid {
    gap: 8px;
  }

  .chart-item {
    min-width: 100px;
    padding: 10px;
    flex: 1 1 100%;
  }

  .chart-container {
    padding: 16px;
    margin: 12px 0;
  }
}

/* Responsive text area heights for findings */

/* ===== BEAUTIFUL INTERFACE ENHANCEMENTS ===== */

/* Glassmorphism Effects */
.card {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border) !important;
  position: relative;
  overflow: hidden;
}

/* Gradient Borders for Cards */
.card-header {
  position: relative;
  background: linear-gradient(135deg, rgba(59, 130, 246, .1), rgba(147, 51, 234, .05));
  border-bottom: 1px solid var(--glass-border);
}

.card-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, .5), transparent);
}

/* Smooth Fade-in Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Table Row Stagger Animation */

/* Enhanced Input Focus Effects */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--focus), var(--glow-primary) !important;
  transform: scale(1.01);
  transition: all 0.2s ease;
}


/* Floating Labels Effect */
.meta-row label {
  transition: all 0.2s ease;
  transform-origin: left top;
}

input:focus+label,
input:not(:placeholder-shown)+label {
  transform: translateY(-8px) scale(0.85);
  color: var(--primary);
}

/* Animated Checkbox */
input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elev);
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--primary-600), var(--primary));
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  color: white;
  font-size: 14px;
  font-weight: bold;
  animation: checkmark 0.3s ease;
}

@keyframes checkmark {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-45deg);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

/* Animated Counter for Chart Values */
.chart-value {
  animation: countUp 0.8s ease-out;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pulse Effect for Critical Findings */
.chart-item.serious {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
  }
}

/* Enhanced Header with Gradient Animation */
.header-bar {
  background: linear-gradient(135deg, rgba(14, 23, 42, .95), rgba(30, 41, 59, .9), rgba(14, 23, 42, .95));
  background-size: 200% 200%;
}

/* Photo Hover Zoom */
.photo-thumbnail {
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-thumbnail img {
  transition: transform 0.5s ease;
  will-change: transform;
}

.photo-thumbnail:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .4), var(--glow-primary);
  z-index: 10;
}

.photo-thumbnail:hover img {
  transform: scale(1.1);
}

/* Success Toast Animation */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3), var(--glow-success);
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Enhanced Button Scale Effect */
button:active {
  transform: scale(0.95) !important;
}

/* Neon Glow for Active Elements */
.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, .2), rgba(147, 51, 234, .1));
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), #8b5cf6);
  border-radius: 0 3px 3px 0;
}

/* Improved Typography with Glow */
h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Badge Style for Classifications */
select[data-field="risk_level"],
.readonly-cell {
  transition: all 0.2s ease;
}

select[data-field="risk_level"]:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

/* Shake Animation for Errors */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.error {
  animation: shake 0.5s ease;
  border-color: var(--danger) !important;
  box-shadow: var(--glow-danger) !important;
}

/* Sidebar Enhanced Glassmorphism */
.sidebar {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border) !important;
}

/* Section Expand/Collapse Animation */
details[open] summary~* {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Details Summary */
summary {
  transition: all 0.2s ease;
  position: relative;
}

summary:hover {
  color: var(--primary);
  transform: translateX(4px);
}

/* Loading Spinner Enhancement */
.loading::after {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3b82f6;
}

/* Better Focus Visible States */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Smooth Color Transitions */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

button,
input,
select,
textarea,
.card,
.nav-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chart Item Hover Effect */
.chart-item {
  cursor: pointer;
  position: relative;
}

.chart-item::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chart-item:hover::before {
  opacity: 1;
}

/* Mobile Bottom Sheet Effect */
@media (max-width: 600px) {
  #mobileSectionDropdownWrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  }
}

/* ===== BEAUTIFUL FINDINGS SECTION ===== */

/* Enhanced Add Finding Button */
.btn-add-finding {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-add-finding:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.btn-add-finding .btn-icon {
  font-size: 13px;
}

/* Findings Actions Area */
.findings-actions {
  padding: 12px 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

/* Findings Container */
.findings-container {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Enhanced Findings Table */
.findings-table {
  background: transparent;
  border-spacing: 0 12px;
  border-collapse: separate;
}

.findings-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.findings-table thead th {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.05));
  color: #94a3b8;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  border: none;
  border-bottom: 2px solid rgba(96, 165, 250, 0.3);
}

.findings-table tbody tr {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.findings-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.6));
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.findings-table tbody td {
  padding: 16px;
  border: none;
  vertical-align: middle;
}

.findings-table tbody tr td:first-child {
  border-radius: 12px 0 0 12px;
}

.findings-table tbody tr td:last-child {
  border-radius: 0 12px 12px 0;
}

/* Enhanced Select Dropdowns in Findings */
.findings-table select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.findings-table select:hover {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(15, 23, 42, 0.9);
}

.findings-table select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
  outline: none;
}

/* Enhanced Textareas in Findings */
.findings-table textarea {
  background: linear-gradient(180deg, #0f172a, #0b1220);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 80px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2) inset, 0 1px 2px rgba(0, 0, 0, .15);
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
}

.findings-table textarea.findings-textarea {
  min-height: 260px;
}

.findings-table textarea:hover {
  border-color: rgba(96, 165, 250, 0.3);
}

.findings-table textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
  background: linear-gradient(180deg, #0f172a, #0b1220);
}

/* Finding Row Delete Button */
.findings-table button.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.findings-table button.danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Empty State for Findings */
.findings-table tbody:empty::after {
  content: 'No findings yet. Click "Add Finding" to create one.';
  display: block;
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-style: italic;
  font-size: 13px;
}

/* ===== UX ENHANCEMENTS ===== */

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gradient-success);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: slideInUp 0.3s var(--ease-out), slideOutDown 0.3s var(--ease-out) 2.7s;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  max-width: 400px;
}

.toast.toast-error {
  background: var(--gradient-danger);
}

.toast.toast-warning {
  background: var(--gradient-warning);
}

.toast.toast-info {
  background: var(--gradient-primary);
}

.toast-icon {
  font-size: 20px;
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  to {
    transform: translateY(100px);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
  filter: grayscale(50%);
}

.empty-state-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state-hint {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

.empty-state-action {
  margin-top: 20px;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg,
      var(--bg-elev) 0%,
      rgba(96, 165, 250, 0.1) 50%,
      var(--bg-elev) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.05),
      transparent);
  animation: shimmer 2s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.long {
  width: 90%;
}

.skeleton-button {
  height: 40px;
  width: 120px;
}

.skeleton-card {
  height: 200px;
  width: 100%;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* Progress Indicator */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(96, 165, 250, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Loading Spinner Enhancement */
.spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(96, 165, 250, 0.2);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.spinner-ring.small {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

.spinner-ring.large {
  width: 64px;
  height: 64px;
  border-width: 5px;
}

/* Pulse Animation for Live Updates */
@keyframes pulse-glow {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7);
  }

  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 8px rgba(96, 165, 250, 0);
  }
}

.pulse-indicator {
  animation: pulse-glow 2s infinite;
}

/* Tooltip */
.tooltip {
  position: absolute;
  background: var(--gradient-card);
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(96, 165, 250, 0.2);
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
}

.tooltip.show {
  opacity: 1;
}

.tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 4px solid transparent;
}

.tooltip[data-placement="top"] .tooltip-arrow {
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: rgba(30, 41, 59, 0.95);
}

.tooltip[data-placement="bottom"] .tooltip-arrow {
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: rgba(30, 41, 59, 0.95);
}

/* Mobile Responsive Findings */
@media (max-width: 768px) {
  .findings-container {
    padding: 12px;
  }

  .btn-add-finding {
    width: 100%;
    justify-content: center;
  }

  .findings-table {
    border-spacing: 0 8px;
  }

  .findings-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .findings-table tbody td {
    padding: 0;
    border-radius: 0 !important;
  }

  .findings-table thead {
    display: none;
  }

  .finding-detail-row .summary-detail-block {
    grid-template-columns: 1fr;
  }
}

/* Impact badges */
.impact-badges {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.system-description {
  margin: 0 0 14px;
  display: block;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  width: 100%;
  max-width: 960px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.system-description summary {
  padding: 10px 12px 6px;
  font-weight: 600;
  font-size: 12px;
  color: #7dd3fc;
  margin: 0;
}

.system-description summary::marker {
  color: #7dd3fc;
}

.system-description-body {
  padding: 0 12px 12px;
  font-size: 12px;
  color: #c7e3ff;
  font-style: italic;
  line-height: 1.4;
}

.impact-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.impact-badge.security {
  background: linear-gradient(135deg, #ffb703, #fb8500);
  color: #0b1220;
  box-shadow: 0 3px 10px rgba(255, 183, 3, 0.45);
}

.impact-badge.safety {
  background: linear-gradient(135deg, #ff3b30, #ff6b6b);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 59, 48, 0.45);
}

.impact-badge.operation {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  color: #0b1220;
  box-shadow: 0 3px 10px rgba(34, 211, 238, 0.45);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

/* ===== FORM VALIDATION STYLES ===== */

/* Only show validation states when explicitly added via classes */
input.is-valid,
textarea.is-valid,
select.is-valid {
  border-color: rgba(34, 197, 94, 0.4);
}

input.is-valid:focus,
textarea.is-valid:focus,
select.is-valid:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Invalid state - only with class */
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: rgba(239, 68, 68, 0.5);
}

input.is-invalid:focus,
textarea.is-invalid:focus,
select.is-invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Field helper text */
.field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-helper {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.field-helper-icon {
  font-size: 14px;
  margin-top: 1px;
}

.field-error {
  font-size: 12px;
  color: #fca5a5;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  animation: shake 0.3s ease;
}

.field-error::before {
  content: '⚠️';
  font-size: 14px;
}

.field-success {
  font-size: 12px;
  color: #86efac;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.field-success::before {
  content: '✓';
  font-size: 14px;
  font-weight: bold;
}

/* Character counter */
.field-counter {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

.field-counter.limit-near {
  color: var(--warning);
}

.field-counter.limit-exceeded {
  color: var(--danger);
  font-weight: 600;
}

/* Disabled state improvements */
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(71, 85, 105, 0.3);
}

/* Readonly state improvements */
input:read-only,
textarea:read-only {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(71, 85, 105, 0.3);
  cursor: default;
}

/* ===== ADMIN SECTION BEAUTIFUL UI ===== */

.admin-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.admin-card .title h2 {
  font-size: 16px;
  letter-spacing: 0.3px;
}

.admin-intro {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.admin-description {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.admin-workflow {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--space-xl);
  position: relative;
}

.admin-workflow::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 35px;
  bottom: 35px;
  width: 2px;
  background: linear-gradient(to bottom,
      var(--primary) 0%,
      rgba(96, 165, 250, 0.5) 50%,
      var(--primary) 100%);
  z-index: 0;
}

.workflow-step {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 0 0 4px rgba(59, 130, 246, 0.1);
  position: relative;
}

.step-number::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(96, 165, 250, 0.3);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
}

.step-content {
  flex: 1;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.4));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 0.3s var(--ease-out);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.step-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.5));
}

.step-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 1;
}

.step-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.step-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.2px;
}

.step-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.admin-btn .btn-icon {
  font-size: 14px;
}

.admin-btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.admin-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
  filter: brightness(1.1);
}

.admin-btn-secondary {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.8), rgba(30, 41, 59, 0.9));
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-btn-secondary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(71, 85, 105, 0.9), rgba(51, 65, 85, 0.9));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.admin-btn-warning {
  background: var(--gradient-warning);
  color: #000;
}

.admin-btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.5);
  filter: brightness(1.1);
}

.admin-info-panel {
  margin-bottom: var(--space-2xl);
}

.info-card {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(14, 116, 144, 0.05));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.1);
}

.info-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.info-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.info-value {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'Courier New', monospace;
}

.info-action {
  align-self: flex-start;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(14, 116, 144, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: var(--radius-sm);
  color: #67e8f9;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.info-action:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(14, 116, 144, 0.2));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.admin-status-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-status-message {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 16px;
  background: rgba(96, 165, 250, 0.05);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  display: none;
}

.admin-status-message:not(:empty) {
  display: block;
}

.admin-output {
  margin: 0;
  padding: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #86efac;
  font-size: 12px;
  line-height: 1.6;
  font-family: 'Courier New', monospace;
  display: none;
  max-height: 400px;
  overflow: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.admin-output:not(:empty) {
  display: block;
}

/* Responsive Admin */
@media (max-width: 1024px) {
  .step-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .admin-workflow::before {
    left: 15px;
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .step-icon {
    font-size: 24px;
  }

  .step-header {
    gap: 12px;
  }
}

/* ===== DRAG AND DROP FOR FINDINGS ===== */

.drag-handle {
  cursor: grab;
  opacity: 0.5;
  transition: opacity 0.2s var(--ease-out), color 0.2s var(--ease-out);
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}

.drag-handle:hover {
  opacity: 1;
  color: var(--primary);
}

.drag-handle:active {
  cursor: grabbing;
}

.finding-collapse-btn {
  transition: transform 0.2s var(--ease-out);
}

.finding-collapse-btn:hover {
  color: var(--primary-600) !important;
}

.findings-table tbody tr {
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  position: relative;
}

.findings-table tbody tr.dragging {
  opacity: 0.5;
  background: rgba(96, 165, 250, 0.15);
  position: relative;
  z-index: 1000;
}

.findings-table tbody tr.dragging td {
  background: rgba(96, 165, 250, 0.15);
}

.findings-table tbody tr.drag-over {
  border-top: 3px solid var(--primary);
  box-shadow: 0 -3px 8px rgba(96, 165, 250, 0.4);
}

.findings-table tbody tr.drag-over td {
  background: rgba(96, 165, 250, 0.08);
}

.finding-detail-row {
  transition: all 0.3s var(--ease-out);
}

.finding-detail-row.dragging {
  opacity: 0.5;
}

/* Mobile drag handle */
@media (max-width: 600px) {
  .drag-handle {
    font-size: 20px;
    padding: 6px;
    min-width: 32px;
    min-height: 32px;
  }

  .finding-collapse-btn {
    font-size: 18px !important;
    min-width: 32px;
    min-height: 32px;
  }
}