:root {
  --primary-hue: 152;
  --color-primary: #2d6a4f;
  --color-primary-hover: #1b4332;
  --color-primary-light: #d8f3dc;
  --color-primary-dark: #081c15;
  
  --color-secondary: #40916c;
  --color-secondary-light: #e8f5e9;
  
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #52b788;
  --color-warning-light: #e8f5e9;
  --color-danger: #ef4444;

  --bg-main: #f4f7f5;
  --bg-card: #ffffff;
  --bg-subtle: #eef4f0;
  --bg-dark: #081c15;

  --text-main: #1b2820;
  --text-muted: #526559;
  --text-light: #f4f7f5;

  --border-color: #d1e2d7;
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;

  --shadow-sm: 0 2px 4px rgba(27, 67, 50, 0.04);
  --shadow-md: 0 4px 12px rgba(27, 67, 50, 0.08);
  --shadow-lg: 0 10px 25px rgba(27, 67, 50, 0.12);
  --shadow-fab: 0 8px 20px rgba(45, 106, 79, 0.35);

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Fira Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 90px;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
  color: var(--text-light);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #52b788, #2d6a4f);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(82, 183, 136, 0.3);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a3b18a;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Consent Status Bar & Status Badge */
.consent-status-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #52b788;
}

.status-pending .badge-dot { background-color: #52b788; }
.status-pending { color: #1b4332; background: #e8f5e9; border-color: #b7e4c7; }

.status-completed .badge-dot { background-color: #10b981; }
.status-completed { color: #065f46; background: #d1fae5; border-color: #a7f3d0; }

/* Navigation Bar */
.nav-bar {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  position: sticky;
  top: 68px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }

.nav-tab {
  flex: 1;
  min-width: 100px;
  padding: 12px 10px;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--color-primary);
  background: #eef8f2;
}

.nav-tab.active {
  color: #081c15;
  border-bottom-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Main Container */
.main-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}
.tab-pane.active {
  display: block;
}

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

/* Cards & Layout */
.hero-card {
  background: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
  color: white;
  border-radius: var(--border-radius-lg);
  padding: 32px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-text {
  font-size: 1.05rem;
  opacity: 0.95;
  margin-bottom: 20px;
  line-height: 1.65;
}

.hero-notice {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border-left: 4px solid #52b788;
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
  margin-top: 16px;
}
.hero-notice h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #d8f3dc;
  letter-spacing: -0.01em;
}

.section-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 32px;
  margin-bottom: 36px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 32px;
  margin-bottom: 36px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-accent {
  border-top: 4px solid var(--color-primary);
}

.card-subtle {
  background: var(--bg-subtle);
  border: 1px solid #cbd5e1;
}

.card-header {
  margin-bottom: 24px;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Principles Grid */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.principle-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.principle-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-secondary);
}

.principle-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 10px;
  line-height: 1.35;
}

.principle-desc {
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.55;
}

.principle-practice {
  font-size: 0.85rem;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 4px solid var(--color-primary);
  line-height: 1.5;
}

/* Forms & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

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

.form-label-lg {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.required {
  color: var(--color-danger);
}

.form-input, .form-select, .form-textarea {
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input-lg {
  font-size: 1.15rem;
  padding: 14px 18px;
  height: 52px;
  border-radius: 10px;
  font-weight: 500;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  width: 100%;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  width: 100%;
  font-size: 1rem;
  line-height: 1.45;
}

.checkbox-label:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 0;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.info-list li {
  margin-bottom: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.98rem;
  line-height: 1.5;
}
.info-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Signature Pad */
.signature-container {
  background: #ffffff;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
}

canvas#signaturePad {
  width: 100%;
  max-width: 500px;
  height: 150px;
  background: #fafafa;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  touch-action: none;
}

.signature-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin-top: 14px;
}

/* Toggle Switch */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-slider {
  width: 40px;
  height: 22px;
  background-color: #cbd5e1;
  border-radius: 20px;
  position: relative;
  transition: 0.2s;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--color-success);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Section Pills for Interview */
.section-pills {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin-bottom: 28px;
  scrollbar-width: none;
}
.section-pills::-webkit-scrollbar { display: none; }

.pill-btn {
  padding: 10px 18px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.pill-btn.active {
  background: var(--color-primary-dark);
  color: white;
  border-color: var(--color-primary-dark);
  box-shadow: var(--shadow-sm);
}

/* Question Card & Dividers */
.section-block {
  margin-bottom: 36px;
}

.question-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.question-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  background-color: var(--color-primary-light);
  border: 1px solid rgba(45, 106, 79, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(45, 106, 79, 0.1);
}

.question-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.45;
}

.question-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
  margin: 36px 0;
}

.section-nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.clarifications-box {
  background: var(--bg-subtle);
  border-left: 3px solid var(--color-secondary);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: var(--text-main);
}
.clarification-item {
  margin-top: 4px;
}

/* Audio Recorder Widget */
.audio-recorder-widget {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 18px 20px;
  margin-top: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.recorder-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-rec {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 28px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-rec:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

.btn-rec:active {
  transform: scale(0.96);
}

.rec-buttons-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-rec.btn-append {
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
}

.btn-rec.btn-append:hover {
  background: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
  box-shadow: 0 6px 18px rgba(27, 67, 50, 0.45);
}

.btn-rec.btn-delete {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-rec.btn-delete:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
}

@keyframes pulseRec {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.rec-timer {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.rec-status-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rec-status {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.rec-saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.audio-preview {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

audio {
  width: 100%;
  max-width: 480px;
  height: 42px;
  border-radius: 20px;
}

/* Formula Box */
.formula-box {
  background: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
  color: #d8f3dc;
  padding: 18px 24px;
  border-radius: var(--border-radius-md);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.formula-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.formula-code {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 6px;
  color: #fef3c7;
}

/* Data Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  background: white;
}

.data-table th, .data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  text-align: left;
  line-height: 1.5;
}

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

.data-table th {
  background: #f8fafc;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #334155;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e2e8f0;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.data-table tbody tr:hover {
  background: #f1f5f9;
}

/* H&S Checklist Grid & Header Redesign */
.hs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 20px;
}

.hs-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hs-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.hs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #f1f5f9;
}

.hs-index-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #52b788, #2d6a4f);
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(45, 106, 79, 0.25);
  flex-shrink: 0;
}

.hs-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.hs-desc {
  font-size: 0.94rem;
  color: #334155;
  margin-bottom: 14px;
  line-height: 1.55;
}

.hs-checkbox-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
}

.hs-checkbox-label {
  background: transparent;
  border: none;
  padding: 0;
}

.hs-checkbox-text {
  font-weight: 600;
  color: #0f172a;
}

/* Enhanced Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 12px 22px;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
  box-shadow: 0 6px 18px rgba(27, 67, 50, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(64, 145, 108, 0.25);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
  box-shadow: 0 6px 16px rgba(45, 106, 79, 0.35);
  transform: translateY(-1px);
}

.btn-tertiary {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: #1b4332;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.btn-tertiary:hover {
  background: #eef8f2;
  border-color: #52b788;
  color: #081c15;
}

.btn-menu-sessions {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  border-radius: 20px;
}

.btn-menu-sessions:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.45);
  transform: translateY(-1px);
}

#downloadZipBtn {
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
  color: white;
  border-radius: 18px;
  min-height: 56px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.35);
}

#downloadZipBtn:hover {
  background: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
  box-shadow: 0 8px 24px rgba(27, 67, 50, 0.45);
}

#saveConsentBtn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  border-radius: 18px;
  min-height: 54px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

#saveConsentBtn:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.45);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.84rem;
  min-height: 36px;
  border-radius: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  min-height: 50px;
  border-radius: 16px;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 4px;
}

/* Floating Action Button for Camera (Photo Icon) */
.fab-camera {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #52b788 0%, #1b4332 100%);
  color: white;
  border: none;
  box-shadow: var(--shadow-fab);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-camera:active { transform: scale(0.92); }

/* Modals & Sessions Manager */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-card-lg {
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header-flex h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 8px;
  transition: color 0.15s;
}

.btn-close:hover { color: #0f172a; }

.modal-body {
  overflow-y: auto;
  padding-right: 4px;
}

.session-meta-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 14px 18px;
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.saved-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.session-item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.session-item-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.session-item-card.active-session-card {
  border: 2px solid var(--color-primary);
  background: #fffbe6;
}

.session-item-info h5 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.session-item-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.session-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.photo-preview-container img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
}

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

/* Photo Gallery & Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  background: var(--bg-subtle);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  text-align: center;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.stat-value.text-warning {
  color: var(--color-primary);
}
.text-warning {
  color: var(--color-primary);
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photo-thumb {
  position: relative;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-thumb .photo-caption-tag {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.7rem;
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Alerts */
.alert-box {
  padding: 14px 18px;
  border-radius: var(--border-radius-sm);
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.alert-warning {
  background: var(--color-warning-light);
  color: #1b4332;
  border-left: 4px solid var(--color-primary);
}

/* PWA & Mobile Navigation Components */
.btn-pwa-install {
  background: linear-gradient(135deg, #52b788 0%, #2d6a4f 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(82, 183, 136, 0.3);
}
.btn-pwa-install:hover {
  background: linear-gradient(135deg, #40916c 0%, #1b4332 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(64, 145, 108, 0.4);
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Floating Help Button (?) at bottom left of screen */
.floating-help-btn {
  display: none !important;
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(27, 67, 50, 0.35);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.floating-help-btn:hover {
  transform: translateY(-3px) scale(1.06);
  background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
  box-shadow: 0 12px 28px rgba(27, 67, 50, 0.45);
}

.floating-help-btn:active {
  transform: scale(0.92);
}

.pwa-banner-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}
.pwa-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.pwa-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
}
.pwa-step-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.pwa-os-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: #e8f5e9;
  color: #1b4332;
}
.pwa-os-tag.os-ios {
  background: #d8f3dc;
  color: #081c15;
}
.pwa-step-list {
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
}
.pwa-step-list li {
  margin-bottom: 10px;
}

/* Responsive & Mobile Layout */
@media (max-width: 768px) {
  /* Mobile Header Overlay Drawer */
  .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 1002;
    background: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
    color: var(--text-light);
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-sizing: border-box;
  }

  .app-header.header-expanded {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .header-brand {
    width: 100%;
    justify-content: flex-start;
  }

  .header-status {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-status .btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .header-status .btn-text {
    display: inline !important;
  }

  /* Header Backdrop Overlay */
  .header-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 28, 21, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .header-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Floating Hamburger Menu Button */
  .mobile-nav-toggle {
    display: flex;
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1003;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(8, 28, 21, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-nav-toggle:active {
    transform: scale(0.92);
  }

  /* Fixed Bottom Navigation Bar */
  .nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100vw;
    height: 62px;
    z-index: 1000;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0;
    padding: 0 4px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .nav-bar.nav-collapsed {
    display: flex;
  }

  .nav-tab {
    flex: 1;
    height: 100%;
    padding: 6px 2px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    border-bottom: none;
    border-top: 3px solid transparent;
    border-radius: 0;
    background: transparent;
  }

  .nav-tab span {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.1;
  }

  .nav-tab svg {
    width: 20px;
    height: 20px;
  }

  .nav-tab.active {
    color: var(--color-primary-hover);
    border-top-color: var(--color-primary);
    background: var(--color-primary-light);
  }

  .consent-status-bar {
    padding: 8px 14px;
    justify-content: center;
  }

  body {
    padding-bottom: 84px;
  }

  .main-container {
    width: 100vw;
    max-width: 100%;
    padding: 12px 0 84px 0;
    box-sizing: border-box;
  }

  .hero-card,
  .section-card,
  .card,
  .question-card,
  .hs-card,
  .pwa-step-card,
  .alert-box {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 18px 16px;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
  }

  .interview-header {
    padding: 0 16px;
  }

  .section-pills {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .status-badge .badge-text {
    font-size: 0.75rem;
  }

  /* Floating Buttons on Mobile - positioned above bottom navbar */
  .fab-camera {
    position: fixed;
    bottom: 76px;
    right: 16px;
    z-index: 999;
    width: 54px;
    height: 54px;
  }

  .floating-help-btn {
    position: fixed;
    bottom: 76px;
    left: 16px;
    z-index: 999;
    width: 52px;
    height: 52px;
  }

  .table-responsive {
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  /* Summary / Sessions modal & interview list mobile layout */
  .modal-backdrop {
    padding: 12px;
  }

  .modal-card {
    padding: 20px 16px;
    border-radius: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .session-meta-box {
    padding: 12px 14px;
    word-break: break-word;
  }

  .session-item-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 14px;
  }

  .session-item-info {
    width: 100%;
    word-break: break-word;
  }

  .session-item-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
  }

  .session-item-actions .btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .brand-subtitle {
    display: none;
  }

  .brand-title {
    font-size: 0.98rem;
  }

  .pwa-banner-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-card,
  .section-card,
  .card,
  .question-card,
  .hs-card,
  .pwa-step-card,
  .alert-box {
    padding: 16px 14px;
  }

  .interview-header {
    padding: 0 14px;
  }

  .section-pills {
    padding-left: 14px;
    padding-right: 14px;
  }

  .table-responsive {
    margin-left: -14px;
    margin-right: -14px;
    width: calc(100% + 28px);
  }
}
