._bar_1qc05_1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

._breadcrumb_1qc05_11 {
  display: flex;
  align-items: center;
  gap: 6px;
}

._segment_1qc05_17 {
  display: flex;
  align-items: center;
  gap: 4px;
}

._select_1qc05_23 {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  max-width: 240px;
}

._select_1qc05_23:focus {
  outline: none;
  border-color: var(--primary);
}

._clear_1qc05_39 {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

._clear_1qc05_39:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

._separator_1qc05_58 {
  color: var(--text-muted);
  font-size: 16px;
}

._context_1qc05_63 {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
._shell_1hdfv_1 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

._header_1hdfv_7 {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

._logo_1hdfv_26 {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

._brandText_1hdfv_39 {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

._brandName_1hdfv_45 {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
}

._brandSub_1hdfv_51 {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

._nav_1hdfv_60 {
  display: flex;
  gap: 4px;
  flex: 1;
  margin-left: 16px;
}

._navLink_1hdfv_67 {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}

._navLink_1hdfv_67:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}

._navActive_1hdfv_86 {
  background: var(--accent-dim);
  color: var(--primary);
}

._navIcon_1hdfv_91 {
  font-size: 15px;
}

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

._timer_1hdfv_101 {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-hover);
}

._timerWarn_1hdfv_111 {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
  animation: _timerPulse_1hdfv_1 1s infinite;
}

._session_1hdfv_95 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

._sessionDot_1hdfv_126 {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: _pulse_1hdfv_1 2s infinite;
}

._logoutBtn_1hdfv_134 {
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

._logoutBtn_1hdfv_134:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

._timeoutBanner_1hdfv_151 {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes _pulse_1hdfv_1 {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes _timerPulse_1hdfv_1 {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

._main_1hdfv_171 {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
._loginPage_1i48v_1 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 24px;
}

._loginCard_1i48v_10 {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

._logoArea_1i48v_20 {
  text-align: center;
  margin-bottom: 28px;
}

._logo_1i48v_20 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  border-radius: 14px;
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 12px;
}

._logoArea_1i48v_20 h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

._logoArea_1i48v_20 p {
  font-size: 13px;
  color: var(--text-muted);
}

._form_1i48v_50 {
  margin-bottom: 20px;
}

._label_1i48v_54 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

._inputRow_1i48v_64 {
  display: flex;
  gap: 8px;
}

._input_1i48v_64 {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

._input_1i48v_64:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

._loginBtn_1i48v_85 {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

._loginBtn_1i48v_85:hover {
  background: var(--primary-hover);
}

._error_1i48v_102 {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

._divider_1i48v_108 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}

._divider_1i48v_108::before,
._divider_1i48v_108::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

._supplierList_1i48v_125 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

._supplierBtn_1i48v_134 {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

._supplierBtn_1i48v_134:hover {
  border-color: var(--primary);
  background: var(--accent-dim);
}

._supplierAvatar_1i48v_153 {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #475569, #64748b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

._supplierInfo_1i48v_167 {
  flex: 1;
  min-width: 0;
}

._supplierName_1i48v_172 {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

._supplierEmail_1i48v_179 {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

._wsCount_1i48v_188 {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 2px 8px;
  background: var(--surface-hover);
  border-radius: 10px;
}

._footer_1i48v_197 {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

._lockIcon_1i48v_210 {
  font-size: 13px;
}
/* ---- Layout ---- */
._page_1r4zw_2 { display: flex; flex-direction: column; gap: 20px; }
._pageHeader_1r4zw_3 { display: flex; align-items: center; gap: 12px; }
._pageHeader_1r4zw_3 h1 { font-size: 22px; font-weight: 700; }
._badge_1r4zw_5 {
  font-size: 12px; font-weight: 500; padding: 2px 10px;
  background: var(--accent-dim); color: var(--primary);
  border-radius: 20px;
}

._empty_1r4zw_11 {
  text-align: center; padding: 80px 24px;
  color: var(--text-muted);
}
._empty_1r4zw_11 h2 { margin-bottom: 8px; color: var(--text); }
._hint_1r4zw_16 { font-size: 13px; margin-top: 12px; }

/* ---- KPI Cards ---- */
._kpiGrid_1r4zw_19 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
._kpiCard_1r4zw_22 {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; flex-direction: column; align-items: center;
}
._kpiValue_1r4zw_27 { font-size: 28px; font-weight: 700; }
._kpiLabel_1r4zw_28 { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
._kpiDanger_1r4zw_29 ._kpiValue_1r4zw_27 { color: var(--danger); }
._kpiClickable_1r4zw_30 { cursor: pointer; transition: all 0.15s; }
._kpiClickable_1r4zw_30:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

/* ---- Cards ---- */
._card_1r4zw_34 {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px; overflow: hidden;
}
._cardHeader_1r4zw_38 {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
._cardHeader_1r4zw_38 h2 { font-size: 15px; font-weight: 600; }
._cardLink_1r4zw_43 { font-size: 13px; color: var(--primary); }
._cardEmpty_1r4zw_44 { font-size: 13px; color: var(--text-muted); text-align: center; padding: 24px 0; }

/* ---- Two Column ---- */
._twoCol_1r4zw_47 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- List Stack ---- */
._listStack_1r4zw_50 { display: flex; flex-direction: column; gap: 8px; }
._listItem_1r4zw_51 {
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid transparent;
  transition: border-color 0.15s;
}
._listItem_1r4zw_51:hover { border-color: var(--border); }
._listItemClickable_1r4zw_57 { cursor: pointer; }
._listItemClickable_1r4zw_57:hover { border-color: var(--primary); background: var(--surface-hover); }
._listItemTop_1r4zw_59 { display: flex; align-items: center; gap: 8px; }
._listTitle_1r4zw_60 { font-size: 13px; font-weight: 500; flex: 1; }
._listMeta_1r4zw_61 {
  display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); margin-top: 4px;
  text-transform: capitalize;
}

/* ---- Priority Dots ---- */
._priorityDot_1r4zw_67 {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
._prio_urgent_1r4zw_70 { background: var(--danger); }
._prio_high_1r4zw_71 { background: var(--warning); }
._prio_medium_1r4zw_72 { background: var(--primary); }
._prio_low_1r4zw_73 { background: var(--rag-grey); }

/* ---- Status Badges ---- */
._statusBadge_1r4zw_76 {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  font-weight: 500; text-transform: capitalize; white-space: nowrap;
}
._status_draft_1r4zw_80 { background: #e2e8f0; color: #475569; }
._status_sent_1r4zw_81 { background: #dbeafe; color: #1e40af; }
._status_acknowledged_1r4zw_82 { background: #e0e7ff; color: #4338ca; }
._status_in_progress_1r4zw_83 { background: #fef3c7; color: #92400e; }
._status_completed_1r4zw_84 { background: #d1fae5; color: #065f46; }
._status_overdue_1r4zw_85 { background: #fee2e2; color: #991b1b; }
._status_cancelled_1r4zw_86 { background: #f1f5f9; color: #64748b; }

._docStatus_clean_1r4zw_88 { background: #d1fae5; color: #065f46; }
._docStatus_approved_1r4zw_89 { background: #d1fae5; color: #065f46; }
._docStatus_rejected_1r4zw_90 { background: #fee2e2; color: #991b1b; }
._docStatus_quarantined_1r4zw_91 { background: #fef3c7; color: #92400e; }
._docStatus_scanning_1r4zw_92 { background: #dbeafe; color: #1e40af; }
._docStatus_uploading_1r4zw_93 { background: #e0e7ff; color: #4338ca; }
._docStatus_archived_1r4zw_94 { background: #f1f5f9; color: #64748b; }
._docStatus_superseded_1r4zw_95 { background: #f1f5f9; color: #64748b; }

/* ---- File Icon ---- */
._fileIcon_1r4zw_98 { font-size: 16px; }
._fileName_1r4zw_99 { display: flex; align-items: center; gap: 6px; font-size: 13px; }
._catBadge_1r4zw_100 {
  font-size: 11px; padding: 1px 6px; border-radius: 6px;
  background: var(--surface-hover); text-transform: capitalize;
}

/* ---- Overdue ---- */
._overdue_1r4zw_106 { color: var(--danger); font-weight: 600; }

/* ---- Workspace Cards ---- */
._wsGrid_1r4zw_109 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
._wsCard_1r4zw_110 {
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  transition: all 0.15s;
}
._wsCardClickable_1r4zw_115 { cursor: pointer; }
._wsCardClickable_1r4zw_115:hover { border-color: var(--primary); background: var(--surface-hover); }
._wsName_1r4zw_117 { font-size: 14px; font-weight: 600; }
._wsBadge_1r4zw_118 {
  display: inline-block; font-size: 11px; padding: 1px 8px;
  border-radius: 10px; margin-top: 4px; text-transform: capitalize;
}
._ws_active_1r4zw_122 { background: #d1fae5; color: #065f46; }
._ws_suspended_1r4zw_123 { background: #fef3c7; color: #92400e; }
._ws_archived_1r4zw_124 { background: #f1f5f9; color: #64748b; }
._wsMeta_1r4zw_125 {
  display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); margin-top: 8px;
}

/* ---- Filter Bar ---- */
._filterBar_1r4zw_130 {
  display: flex; gap: 4px; flex-wrap: wrap;
}
._filterBtn_1r4zw_133 {
  padding: 5px 12px; border-radius: 20px; font-size: 12px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; text-transform: capitalize;
  transition: all 0.15s;
}
._filterBtn_1r4zw_133:hover { border-color: var(--primary); color: var(--text); }
._filterActive_1r4zw_140 {
  background: var(--accent-dim); color: var(--primary);
  border-color: var(--primary);
}

/* ---- Instructions ---- */
._instrList_1r4zw_146 { display: flex; flex-direction: column; gap: 8px; }
._instrCard_1r4zw_147 {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
._instrOverdue_1r4zw_151 { border-left: 3px solid var(--danger); }
._instrHeader_1r4zw_152 {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer;
}
._instrHeader_1r4zw_152:hover { background: var(--surface-hover); }
._instrTitle_1r4zw_157 { flex: 1; min-width: 0; }
._instrName_1r4zw_158 { font-size: 14px; font-weight: 500; display: block; }
._instrType_1r4zw_159 { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
._instrRight_1r4zw_160 { display: flex; align-items: center; gap: 10px; }
._instrDue_1r4zw_161 { font-size: 12px; color: var(--text-muted); }
._chevron_1r4zw_162 { font-size: 10px; color: var(--text-muted); }

._instrBody_1r4zw_164 { padding: 0 16px 16px; }
._instrDesc_1r4zw_165 { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
._instrMeta_1r4zw_166 {
  display: flex; gap: 16px; font-size: 12px; color: var(--text-muted);
  margin-bottom: 12px; text-transform: capitalize;
}
._quoteInfo_1r4zw_170 {
  font-size: 14px; font-weight: 600; color: var(--primary);
  margin-bottom: 12px;
}

/* ---- Response Area ---- */
._responseArea_1r4zw_176 { margin-top: 12px; }
._fieldLabel_1r4zw_177 { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; display: block; }
._textarea_1r4zw_178 {
  width: 100%; padding: 8px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 13px; resize: vertical;
  background: var(--bg);
}
._dateInput_1r4zw_183 {
  padding: 6px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 13px;
}
._responseRow_1r4zw_187 {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-top: 8px;
}
._responseActions_1r4zw_191 { display: flex; gap: 8px; }

/* ---- Buttons ---- */
._btnPrimary_1r4zw_194, ._btnSecondary_1r4zw_194, ._btnSuccess_1r4zw_194 {
  padding: 6px 16px; border-radius: var(--radius); font-size: 13px;
  font-weight: 500; border: none; cursor: pointer; transition: all 0.15s;
}
._btnPrimary_1r4zw_194 { background: var(--primary); color: #fff; }
._btnPrimary_1r4zw_194:hover { background: var(--primary-hover); }
._btnSecondary_1r4zw_194 { background: var(--surface-hover); color: var(--text); border: 1px solid var(--border); }
._btnSecondary_1r4zw_194:hover { background: var(--border); }
._btnSuccess_1r4zw_194 { background: var(--success); color: #fff; }
._btnSuccess_1r4zw_194:hover { opacity: 0.9; }

._instrActions_1r4zw_205 { display: flex; gap: 8px; margin-top: 12px; }

/* ---- Instruction Attachments ---- */
._docSection_1r4zw_208 { margin-top: 12px; }
._docSectionHeader_1r4zw_209 {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
._docList_1r4zw_213 { display: flex; flex-direction: column; gap: 4px; }
._docItem_1r4zw_214 {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px;
}
._docName_1r4zw_220 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
._docSize_1r4zw_221 { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
._docEmpty_1r4zw_222 {
  font-size: 12px; color: var(--text-muted);
  padding: 10px; background: var(--bg); border-radius: var(--radius);
  border: 1px dashed var(--border); text-align: center;
}
._btnUploadSmall_1r4zw_227 {
  padding: 4px 10px; border-radius: var(--radius); font-size: 12px;
  font-weight: 500; border: 1px solid var(--primary); background: transparent;
  color: var(--primary); cursor: pointer; transition: all 0.15s;
}
._btnUploadSmall_1r4zw_227:hover { background: var(--accent-dim); }
._requiredTag_1r4zw_233 { color: var(--danger); font-weight: 600; }
._attachIcon_1r4zw_234 { margin-left: 6px; font-size: 14px; }
._btnMarkup_1r4zw_235 {
  padding: 2px 8px; border-radius: var(--radius); font-size: 10px;
  font-weight: 600; border: 1px solid var(--primary); background: transparent;
  color: var(--primary); cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
._btnMarkup_1r4zw_235:hover { background: var(--accent-dim); }

._markupOverlay_1r4zw_242 {
  position: fixed; inset: 0; z-index: 250;
  background: var(--bg);
  display: flex; flex-direction: column;
}

._siteBadge_1r4zw_248 {
  margin-left: 8px; padding: 1px 6px; border-radius: 4px;
  background: var(--accent-dim); color: var(--primary);
  font-size: 10px; font-weight: 600; text-transform: none;
}

/* ---- Drop Zone ---- */
._dropZone_1r4zw_255 {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 10px; transition: all 0.2s; min-height: 60px;
}
._dropZoneActive_1r4zw_259 {
  border-color: var(--primary); background: var(--accent-dim);
}
._dropEmpty_1r4zw_262 {
  text-align: center; padding: 16px 12px; color: var(--text-muted);
}
._dropIcon_1r4zw_265 { font-size: 22px; display: block; margin-bottom: 4px; }
._dropEmpty_1r4zw_262 p { font-size: 12px; margin-bottom: 4px; }
._dropFormats_1r4zw_267 { font-size: 10px; color: var(--text-muted); opacity: 0.7; }
._dropHint_1r4zw_268 {
  font-size: 11px; color: var(--text-muted); text-align: center;
  padding: 6px 0 2px; opacity: 0.7;
}
._btnRemoveDoc_1r4zw_272 {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
._btnRemoveDoc_1r4zw_272:hover { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ---- History ---- */
._historyDetails_1r4zw_281 { margin-top: 12px; font-size: 12px; }
._historyDetails_1r4zw_281 summary { cursor: pointer; color: var(--text-muted); font-weight: 500; }
._historyList_1r4zw_283 { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
._historyItem_1r4zw_284 { display: flex; gap: 12px; padding: 4px 0; }
._historyStatus_1r4zw_285 { text-transform: capitalize; font-weight: 500; min-width: 100px; }
._historyBy_1r4zw_286 { color: var(--text-muted); min-width: 80px; }
._historyDate_1r4zw_287 { color: var(--text-muted); }

/* ---- Upload Zone ---- */
._uploadZone_1r4zw_290 {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all 0.2s; color: var(--text-muted);
}
._uploadZone_1r4zw_290:hover { border-color: var(--primary); background: var(--accent-dim); }
._uploadDragOver_1r4zw_296 { border-color: var(--primary); background: var(--accent-dim); }
._uploadIcon_1r4zw_297 { font-size: 28px; margin-bottom: 8px; }
._uploadHint_1r4zw_298 { font-size: 11px; margin-top: 4px; display: block; }
._uploadError_1r4zw_299 { font-size: 13px; color: var(--danger); margin-top: 4px; }

/* ---- Table ---- */
._tableWrap_1r4zw_302 { overflow-x: auto; }
._table_1r4zw_302 {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
._table_1r4zw_302 th {
  text-align: left; padding: 8px 12px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
._table_1r4zw_302 td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
._table_1r4zw_302 tr:last-child td { border-bottom: none; }
._table_1r4zw_302 tbody tr:hover { background: var(--surface-hover); }
._tableEmpty_1r4zw_314 { text-align: center; color: var(--text-muted); padding: 24px !important; }

/* ---- Metrics ---- */
._ratingBanner_1r4zw_317 {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff; padding: 24px 28px; border-radius: var(--radius-lg);
}
._ratingCircle_1r4zw_322 {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.15); display: flex;
  align-items: baseline; justify-content: center; flex-shrink: 0;
}
._ratingValue_1r4zw_327 { font-size: 32px; font-weight: 700; }
._ratingMax_1r4zw_328 { font-size: 16px; opacity: 0.7; }
._ratingText_1r4zw_329 h2 { font-size: 18px; font-weight: 600; }
._ratingText_1r4zw_329 p { font-size: 13px; opacity: 0.8; margin-top: 4px; }

._metricsGrid_1r4zw_332 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
._metricCard_1r4zw_333 {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column;
  border-top: 3px solid transparent;
}
._metricMet_1r4zw_339 { border-top-color: var(--success); }
._metricMissed_1r4zw_340 { border-top-color: var(--danger); }
._metricValue_1r4zw_341 { font-size: 24px; font-weight: 700; }
._metricLabel_1r4zw_342 { font-size: 13px; font-weight: 500; margin-top: 2px; }
._metricTarget_1r4zw_343 { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
._metricDetail_1r4zw_344 { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

._summaryGrid_1r4zw_346 { display: flex; flex-direction: column; gap: 6px; }
._summaryRow_1r4zw_347 {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
._summaryRow_1r4zw_347:last-child { border-bottom: none; }
._summaryValue_1r4zw_353 { font-weight: 600; font-size: 15px; }

._miniBar_1r4zw_355 {
  display: flex; align-items: center; gap: 8px; height: 18px;
}
._miniBar_1r4zw_355 span { font-size: 12px; font-weight: 500; min-width: 36px; }
._miniBarFill_1r4zw_359 {
  height: 6px; background: var(--success); border-radius: 3px;
  min-width: 0; max-width: 100px; transition: width 0.3s;
}

/* ---- Toast ---- */
._toast_1r4zw_365 {
  position: fixed;
  top: 70px;
  right: 24px;
  background: var(--success);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: _slideIn_1r4zw_1 0.3s ease;
}
@keyframes _slideIn_1r4zw_1 {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Completed Response ---- */
._completedResponse_1r4zw_385 {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--success);
}
._completedResponse_1r4zw_385 p { font-size: 13px; margin-top: 4px; }

/* ---- Status: pending ---- */
._status_pending_1r4zw_395 { background: #e0e7ff; color: #4338ca; }

/* ---- Completeness/Programme ---- */
._progGrid_1r4zw_398 { display: flex; flex-direction: column; gap: 12px; }
._progBar_1r4zw_399 { }
._progInfo_1r4zw_400 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
._progName_1r4zw_401 { font-size: 13px; font-weight: 500; }
._progPct_1r4zw_402 { font-size: 14px; font-weight: 700; color: var(--primary); }
._progTrack_1r4zw_403 {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
._progFill_1r4zw_406 {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 4px; transition: width 0.5s;
}
._progDetail_1r4zw_410 { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

._overdueBadge_1r4zw_412 {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: #fee2e2; color: #991b1b; font-weight: 600; white-space: nowrap;
}
._badgeDanger_1r4zw_416 { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  ._twoCol_1r4zw_47 { grid-template-columns: 1fr; }
  ._kpiGrid_1r4zw_19 { grid-template-columns: repeat(2, 1fr); }
  ._metricsGrid_1r4zw_332 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  ._kpiGrid_1r4zw_19 { grid-template-columns: 1fr 1fr; }
  ._metricsGrid_1r4zw_332 { grid-template-columns: 1fr; }
}
._overlay_gj2l1_1 {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
}
._modal_gj2l1_6 {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 480px; max-width: 95vw;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
._header_gj2l1_12 {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 0;
}
._header_gj2l1_12 h3 { font-size: 16px; font-weight: 700; }
._closeBtn_gj2l1_17 {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
._closeBtn_gj2l1_17:hover { background: var(--surface-hover); }
._subtitle_gj2l1_23 {
  padding: 4px 20px 12px; font-size: 13px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
._checkList_gj2l1_27 { padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; }
._checkRow_gj2l1_28 {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius);
}
._checkPassed_gj2l1_32 { background: rgba(34, 197, 94, 0.08); }
._checkFailed_gj2l1_33 { background: rgba(239, 68, 68, 0.08); }
._checkIcon_gj2l1_34 {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
._checkPassed_gj2l1_32 ._checkIcon_gj2l1_34 { background: rgba(34, 197, 94, 0.2); color: #16a34a; }
._checkFailed_gj2l1_33 ._checkIcon_gj2l1_34 { background: rgba(239, 68, 68, 0.2); color: #dc2626; }
._checkContent_gj2l1_41 { flex: 1; }
._checkLabel_gj2l1_42 { display: block; font-size: 13px; font-weight: 500; }
._checkMessage_gj2l1_43 { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
._footer_gj2l1_44 { padding: 12px 20px 16px; border-top: 1px solid var(--border); }
._readyMsg_gj2l1_45 { font-size: 13px; color: var(--success); font-weight: 500; margin-bottom: 10px; }
._blockedMsg_gj2l1_46 { font-size: 13px; color: var(--danger); font-weight: 500; margin-bottom: 10px; }
._footerActions_gj2l1_47 { display: flex; gap: 8px; justify-content: flex-end; }
._cancelBtn_gj2l1_48 {
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  cursor: pointer;
}
._cancelBtn_gj2l1_48:hover { background: var(--surface-hover); }
._confirmBtn_gj2l1_54 {
  padding: 8px 20px; border-radius: var(--radius); font-size: 13px;
  border: none; background: var(--success); color: #fff;
  cursor: pointer; font-weight: 600;
}
._confirmBtn_gj2l1_54:hover { opacity: 0.9; }
._viewer_vzi63_1 {
  display: flex; flex-direction: column; height: 100%; background: var(--bg);
  border-left: 1px solid var(--border);
}

._toolbar_vzi63_6 {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
._filename_vzi63_11 { font-size: 12px; font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
._toolbarCenter_vzi63_12 { font-size: 11px; color: var(--text-muted); }
._toolbarRight_vzi63_13 { display: flex; align-items: center; gap: 6px; }
._zoomBtn_vzi63_14 {
  width: 26px; height: 26px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
._zoomBtn_vzi63_14:hover { background: var(--surface-hover); }
._zoomLevel_vzi63_20 { font-size: 11px; font-weight: 500; min-width: 36px; text-align: center; }
._closeBtn_vzi63_21 {
  width: 26px; height: 26px; border-radius: var(--radius); border: none;
  background: transparent; color: var(--text-muted); font-size: 14px; cursor: pointer;
  margin-left: 8px;
}
._closeBtn_vzi63_21:hover { background: var(--surface-hover); color: var(--danger); }
._annotCount_vzi63_27 { padding: 2px 8px; border-radius: 10px; background: var(--accent-dim); color: var(--primary); font-weight: 500; }

._viewerBody_vzi63_29 { display: flex; flex: 1; min-height: 0; overflow: hidden; }

._canvasArea_vzi63_31 { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 12px; background: #1a1a2e; }
._canvasWrapper_vzi63_32 { position: relative; transition: transform 0.15s; }

._placeholder_vzi63_34 {
  position: relative; background: #1e293b; border: 1px solid #334155; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
._placeholderTitle_vzi63_37 {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 2px;
}
._placeholderLabel_vzi63_41 { font-size: 14px; font-weight: 700; color: #94a3b8; letter-spacing: 1px; }
._placeholderFile_vzi63_42 { font-size: 11px; color: #64748b; }
._placeholderInfo_vzi63_43 { font-size: 10px; color: #475569; }
._placeholderGrid_vzi63_44 { position: absolute; top: 0; left: 0; pointer-events: none; }

._overlay_vzi63_46 { position: absolute; top: 0; left: 0; pointer-events: all; }
._annotationGroup_vzi63_47 { transition: opacity 0.2s; }

/* ---- Comment Panel ---- */
._commentPanel_vzi63_50 {
  width: 280px; flex-shrink: 0; background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
._commentHeader_vzi63_55 {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
._commentType_vzi63_59 { font-size: 12px; font-weight: 600; text-transform: capitalize; margin-right: 6px; }
._commentStatus_vzi63_60 { font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
._statusOpen_vzi63_61 { background: #fef3c7; color: #92400e; }
._statusClosed_vzi63_62 { background: #d1fae5; color: #065f46; }
._commentClose_vzi63_63 {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer;
}
._commentClose_vzi63_63:hover { background: var(--surface-hover); }
._commentAuthor_vzi63_68 { font-size: 11px; color: var(--text-muted); padding: 4px 12px; }

._commentList_vzi63_70 { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
._commentItem_vzi63_71 {
  padding: 8px; border-radius: var(--radius); background: var(--bg);
  border-left: 3px solid var(--border);
}
._commentReply_vzi63_75 { border-left-color: var(--primary); background: var(--accent-dim); }
._commentMeta_vzi63_76 { display: flex; justify-content: space-between; margin-bottom: 3px; }
._commentName_vzi63_77 { font-size: 11px; font-weight: 600; }
._commentTime_vzi63_78 { font-size: 10px; color: var(--text-muted); }
._commentText_vzi63_79 { font-size: 12px; line-height: 1.4; }

._replyArea_vzi63_81 { padding: 8px 12px; border-top: 1px solid var(--border); }
._replyInput_vzi63_82 {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-size: 12px; resize: none;
}
._replyInput_vzi63_82:focus { outline: none; border-color: var(--primary); }
._replyBtn_vzi63_88 {
  margin-top: 4px; padding: 4px 12px; border-radius: var(--radius);
  border: none; background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 500; cursor: pointer; float: right;
}
._replyBtn_vzi63_88:hover { opacity: 0.9; }
._replyBtn_vzi63_88:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Annotation List (bottom bar) ---- */
._annotList_vzi63_97 {
  padding: 8px 12px; border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
._annotListTitle_vzi63_101 { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
._annotItems_vzi63_102 { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
._annotItem_vzi63_102 {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  font-size: 11px; cursor: pointer; color: var(--text);
}
._annotItem_vzi63_102:hover { border-color: var(--primary); }
._annotItemSelected_vzi63_110 { border-color: var(--primary); background: var(--accent-dim); }
._annotDot_vzi63_111 { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
._annotDotOpen_vzi63_112 { background: #f59e0b; }
._annotDotClosed_vzi63_113 { background: #22c55e; }
._annotLabel_vzi63_114 { text-transform: capitalize; font-weight: 500; }
._annotComments_vzi63_115 { color: var(--text-muted); }
/*
 * SCOPE Master App — Unified Design System
 * Single source of truth for tokens, base styles, and shared utility classes.
 * Imported once per app via `import '@scope/shared/src/theme.css'` in main.tsx.
 *
 * Sections:
 *   1. Design tokens (colors, spacing, typography, radii, shadows)
 *   2. Base styles (resets, body, focus rings)
 *   3. Touch-friendly defaults (48px minimum tap targets for field use)
 *   4. Shared utility classes (.scope-btn, .scope-card, .scope-table-wrap, .scope-status-*)
 */

:root {
  color-scheme: light dark;

  /* ── Colors (light mode) ─────────────────────────────────────────── */
  /* Background scale: bg (page) → surface (cards) → surface-hover (rows on hover)
     Text scale: text-strong (headings) → text (body) → text-muted (labels, hints) */
  --bg: #f1f5f9;             /* slate-100 — slightly cooler so white cards pop */
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-elevated: #ffffff;
  --border: #cbd5e1;         /* slate-300 — was e2e8f0, stronger to see card edges */
  --border-strong: #94a3b8;
  --text-strong: #0f172a;    /* slate-900 — for h1/h2 — pitch contrast */
  --text: #1e293b;           /* slate-800 — body */
  --text-muted: #475569;     /* slate-600 — was 64748b, darker for AA contrast */
  --text-inverse: #f8fafc;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.1);

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);

  --rag-red: #ef4444;
  --rag-amber: #f59e0b;
  --rag-green: #22c55e;
  --rag-grey: #94a3b8;

  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.15);

  /* ── Spacing (4px scale) ─────────────────────────────────────────── */
  --space-1: 0.25rem; /*  4px */
  --space-2: 0.5rem;  /*  8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem;    /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem;  /* 24px */
  --space-8: 2rem;    /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem;   /* 48px */

  /* ── Typography ──────────────────────────────────────────────────── */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --text-xs: 0.72rem;
  --text-sm: 0.85rem;
  --text-base: 0.95rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* ── Radii ───────────────────────────────────────────────────────── */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* ── Shadows ─────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.15);

  /* ── Touch targets (CRITICAL for field workers wearing gloves) ───── */
  /* WCAG 2.5.5: minimum 24x24, recommended 44x44. We use 44 for desktop
     and bump to 48 in the touch media query. */
  --touch-min: 44px;

  /* ── Z layers ────────────────────────────────────────────────────── */
  --z-sticky: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* ── Transitions ─────────────────────────────────────────────────── */
  --transition-fast: 100ms ease-out;
  --transition: 150ms ease-out;
}

/* ── Explicit overrides via UserSettingsProvider ─────────────────────
   These come BEFORE the prefers-color-scheme rule so they take priority
   when the user picks light or dark explicitly. The 'system' option does
   NOT set data-theme so prefers-color-scheme remains the source of truth. */
:root[data-theme="dark"] {
  --bg: #020617;
  --surface: #0f172a;
  --surface-hover: #1e293b;
  --surface-elevated: #1e293b;
  --border: #334155;
  --border-strong: #475569;
  --text-strong: #ffffff;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-inverse: #0f172a;
  --primary-soft: rgba(59, 130, 246, 0.18);
  --success-soft: rgba(34, 197, 94, 0.16);
  --warning-soft: rgba(245, 158, 11, 0.16);
  --danger-soft: rgba(248, 113, 113, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}
:root[data-theme="light"] {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-elevated: #ffffff;
  --border: #cbd5e1;
  --border-strong: #94a3b8;
  --text-strong: #0f172a;
  --text: #1e293b;
  --text-muted: #475569;
  --text-inverse: #f8fafc;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --success-soft: rgba(34, 197, 94, 0.12);
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger-soft: rgba(239, 68, 68, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.15);
}

/* ── Auto dark mode (only when no explicit data-theme) ─────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Page background is the deepest layer; cards lift above it. */
    --bg: #020617;             /* slate-950 — was 0f172a, darker so cards stand out */
    --surface: #0f172a;        /* slate-900 — was 1e293b */
    --surface-hover: #1e293b;  /* slate-800 */
    --surface-elevated: #1e293b;
    --border: #334155;         /* slate-700 — was 475569, stronger card edges */
    --border-strong: #475569;
    --text-strong: #ffffff;    /* pure white — for headings */
    --text: #f1f5f9;           /* slate-100 — body */
    --text-muted: #cbd5e1;     /* slate-300 — was 94a3b8, much brighter for AA contrast */
    --text-inverse: #0f172a;

    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-soft: rgba(59, 130, 246, 0.18);

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.16);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.16);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.16);

    --rag-red: #f87171;
    --rag-amber: #fbbf24;
    --rag-green: #4ade80;
    --rag-grey: #64748b;

    --accent: #3b82f6;
    --accent-dim: rgba(59, 130, 246, 0.2);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
}

/* ════════════════════════════════════════════════════════════════════
   Base resets & body
   ════════════════════════════════════════════════════════════════════ */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Avoid horizontal scrollbars on phones from rounding errors */
  overflow-x: hidden;
}

#root {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

/* Headings inherit the strong-contrast token so they pop on both modes
   without each component having to opt in. */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-strong);
  font-weight: 700;
  line-height: var(--leading-tight);
}

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

button {
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}

/* Visible focus ring for keyboard navigation (accessibility). */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════
   Touch-friendly defaults
   On coarse pointers (touchscreens), grow tap targets to 48px and bump
   font sizes a touch so gloved hands and field tablets work properly.
   ════════════════════════════════════════════════════════════════════ */

@media (pointer: coarse) {
  :root {
    --touch-min: 48px;
  }
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  input[type="checkbox"],
  input[type="radio"],
  select,
  a[role="button"] {
    min-height: var(--touch-min);
  }
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="password"],
  input[type="date"],
  input[type="time"],
  textarea {
    min-height: var(--touch-min);
    font-size: max(16px, var(--text-base)); /* iOS won't zoom on focus when >= 16px */
  }
}

/* ════════════════════════════════════════════════════════════════════
   Shared utility classes — opt-in via className="scope-*"
   These give every app a consistent look without mandating a refactor.
   ════════════════════════════════════════════════════════════════════ */

/* Buttons */
.scope-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  min-height: var(--touch-min);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.scope-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.scope-btn-primary  { background: var(--primary); color: #fff; }
.scope-btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.scope-btn-secondary { background: var(--surface-hover); color: var(--text); border-color: var(--border); }
.scope-btn-secondary:hover:not(:disabled) { background: var(--border); }
.scope-btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.scope-btn-ghost:hover:not(:disabled) { background: var(--surface-hover); }
.scope-btn-danger { background: var(--danger); color: #fff; }
.scope-btn-danger:hover:not(:disabled) { background: #b91c1c; }

/* Cards */
.scope-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

/* Tables — wrap in this div to get horizontal scroll on mobile */
.scope-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.scope-table-wrap > table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.scope-table-wrap th,
.scope-table-wrap td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.scope-table-wrap th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-hover);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}

/* Status pills (RAG, generic) */
.scope-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.scope-pill-success { background: var(--success-soft); color: var(--success); }
.scope-pill-warning { background: var(--warning-soft); color: var(--warning); }
.scope-pill-danger  { background: var(--danger-soft);  color: var(--danger); }
.scope-pill-info    { background: var(--primary-soft); color: var(--primary); }
.scope-pill-muted   { background: var(--surface-hover); color: var(--text-muted); }

/* Form controls */
.scope-input,
.scope-select,
.scope-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-base);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.scope-input:focus,
.scope-select:focus,
.scope-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}
.scope-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

/* Loading & empty states */
.scope-loading,
.scope-empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Spinner — apply to any element via className="scope-spinner" */
.scope-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: scope-spin 0.6s linear infinite;
}
@keyframes scope-spin {
  to { transform: rotate(360deg); }
}

/* Save status badge — use with .scope-save-status[data-state="..."] */
.scope-save-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid transparent;
}
.scope-save-status[data-state="saved"]    { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
.scope-save-status[data-state="saving"]   { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.scope-save-status[data-state="offline"]  { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-soft); }
.scope-save-status[data-state="retrying"] { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-soft); }
.scope-save-status[data-state="error"]    { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger-soft); }
.scope-save-status[data-state="idle"]     { background: var(--surface-hover); color: var(--text-muted); border-color: var(--border); }

/* ════════════════════════════════════════════════════════════════════
   Responsive helpers
   Tablet breakpoint: 720-1024px
   Mobile breakpoint: <720px
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  :root {
    /* Slightly tighter spacing on tablets to fit more on-screen */
    --space-5: 1rem;
    --space-6: 1.25rem;
  }
}

@media (max-width: 720px) {
  :root {
    --text-base: 0.92rem;
    --text-sm: 0.82rem;
  }
  .scope-table-wrap > table {
    font-size: var(--text-xs);
  }
}

/* Stack any element with .scope-stack-mobile vertically below 720px */
@media (max-width: 720px) {
  .scope-stack-mobile {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* Hide on mobile only */
@media (max-width: 720px) {
  .scope-hide-mobile { display: none !important; }
}
/* Hide on desktop only */
@media (min-width: 721px) {
  .scope-hide-desktop { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════
   User-controlled primary colour overrides
   Set via UserSettingsProvider → <html data-primary="...">
   The default (data-primary missing) keeps the SCOPE Blue defined above.
   ════════════════════════════════════════════════════════════════════ */

:root[data-primary="teal"] {
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-soft: rgba(13, 148, 136, 0.12);
  --accent: #0d9488;
  --accent-dim: rgba(13, 148, 136, 0.18);
}
:root[data-primary="purple"] {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-soft: rgba(124, 58, 237, 0.12);
  --accent: #7c3aed;
  --accent-dim: rgba(124, 58, 237, 0.18);
}
:root[data-primary="orange"] {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: rgba(234, 88, 12, 0.12);
  --accent: #ea580c;
  --accent-dim: rgba(234, 88, 12, 0.18);
}
:root[data-primary="green"] {
  --primary: #16a34a;
  --primary-hover: #15803d;
  --primary-soft: rgba(22, 163, 74, 0.12);
  --accent: #16a34a;
  --accent-dim: rgba(22, 163, 74, 0.18);
}
:root[data-primary="rose"] {
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-soft: rgba(225, 29, 72, 0.12);
  --accent: #e11d48;
  --accent-dim: rgba(225, 29, 72, 0.18);
}

/* Same overrides under dark mode — ensure soft tints stay readable on dark surfaces */
:root[data-theme="dark"][data-primary="teal"]   { --primary: #2dd4bf; --primary-hover: #5eead4; --primary-soft: rgba(45, 212, 191, 0.20); --accent: #2dd4bf; --accent-dim: rgba(45, 212, 191, 0.25); }
:root[data-theme="dark"][data-primary="purple"] { --primary: #a78bfa; --primary-hover: #c4b5fd; --primary-soft: rgba(167, 139, 250, 0.22); --accent: #a78bfa; --accent-dim: rgba(167, 139, 250, 0.28); }
:root[data-theme="dark"][data-primary="orange"] { --primary: #fb923c; --primary-hover: #fdba74; --primary-soft: rgba(251, 146, 60, 0.22); --accent: #fb923c; --accent-dim: rgba(251, 146, 60, 0.28); }
:root[data-theme="dark"][data-primary="green"]  { --primary: #4ade80; --primary-hover: #86efac; --primary-soft: rgba(74, 222, 128, 0.22); --accent: #4ade80; --accent-dim: rgba(74, 222, 128, 0.28); }
:root[data-theme="dark"][data-primary="rose"]   { --primary: #fb7185; --primary-hover: #fda4af; --primary-soft: rgba(251, 113, 133, 0.22); --accent: #fb7185; --accent-dim: rgba(251, 113, 133, 0.28); }

/* ════════════════════════════════════════════════════════════════════
   User-controlled density
   Compact = tighter spacing, smaller padding/font.
   Comfortable = the default values declared in :root above.
   Spacious = roomier padding, slightly bigger font.
   ════════════════════════════════════════════════════════════════════ */

:root[data-density="compact"] {
  --space-3: 0.5rem;
  --space-4: 0.75rem;
  --space-5: 1rem;
  --space-6: 1.125rem;
  --text-base: 0.85rem;
  --text-sm: 0.78rem;
  --touch-min: 36px;
}
:root[data-density="spacious"] {
  --space-3: 1rem;
  --space-4: 1.25rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --text-base: 1.05rem;
  --text-sm: 0.95rem;
  --touch-min: 52px;
}

/* ════════════════════════════════════════════════════════════════════
   User-controlled table row height
   Drives the height of every row in `.scope-table-wrap` AND any table
   that opts in via the same data attribute.
   ════════════════════════════════════════════════════════════════════ */

:root[data-row-height="compact"] .scope-table-wrap th,
:root[data-row-height="compact"] .scope-table-wrap td {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}
:root[data-row-height="spacious"] .scope-table-wrap th,
:root[data-row-height="spacious"] .scope-table-wrap td {
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}
/*
 * Per-app CSS hook.
 *
 * Design tokens, base styles, and utility classes live in
 * @scope/shared/src/theme.css and are imported once from main.tsx.
 *
 * This file is intentionally minimal — add ONLY app-specific overrides here
 * (e.g. header backgrounds, brand-specific tweaks). Token values must come
 * from the shared theme so all 8 apps stay harmonised.
 */
