#iso-cmm-app-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  color: #222;
}

.iso-cmm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 2px solid #1f4e78;
  margin-bottom: 10px;
}
.iso-cmm-header h2 { margin: 0; color: #1f4e78; }
.iso-cmm-brand { display: flex; flex-direction: column; }
.iso-cmm-tagline { font-size: 11px; letter-spacing: 0.4px; color: #e8792b; font-weight: 500; text-transform: uppercase; }
.iso-cmm-user { font-size: 13px; color: #555; text-align: right; }
.iso-cmm-org-name { font-weight: 500; color: #e8792b; }

.iso-cmm-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.iso-cmm-nav-btn, .iso-cmm-btn, .iso-cmm-subtab-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
}
.iso-cmm-nav-btn.active, .iso-cmm-subtab-btn.active {
  background: #1f4e78;
  color: #fff;
  border-color: #1f4e78;
}
.iso-cmm-btn { background: #2e75b6; color: #fff; border-color: #2e75b6; margin-top: 10px; }
.iso-cmm-btn:hover { opacity: 0.9; }

.iso-cmm-gate {
  max-width: 420px; margin: 40px auto; text-align: center;
  padding: 24px; border: 1px solid #e5e7eb; border-radius: 8px;
}
.iso-cmm-gate .iso-cmm-btn {
  display: inline-block; text-decoration: none; padding: 10px 20px; font-size: 15px;
  border: none; cursor: pointer; width: 100%;
}
.iso-cmm-gate form p { text-align: left; }
.iso-cmm-gate form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.iso-cmm-gate form input.input,
.iso-cmm-gate form input[type="text"],
.iso-cmm-gate form input[type="email"],
.iso-cmm-gate form input[type="password"] {
  width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 14px;
  border: 1px solid #d1d5db; border-radius: 4px; margin-bottom: 10px;
}
.iso-cmm-gate form input[type="submit"] {
  width: 100%; padding: 10px 20px; font-size: 15px; border: none; cursor: pointer;
  background: #2e75b6; color: #fff; border-radius: 4px;
}
.iso-cmm-gate form input[type="checkbox"] { width: auto; margin-right: 6px; }
.iso-cmm-gate-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.iso-cmm-gate-tab {
  flex: 1; padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: #f0f0f0; border: 1px solid #d1d5db; border-radius: 6px 6px 0 0;
  color: #555;
}
.iso-cmm-gate-tab.active { background: #2e75b6; color: #fff; border-color: #2e75b6; }
.iso-cmm-gate-panel { text-align: left; }
.iso-cmm-gate-error { color: #b00020; font-weight: 600; }

.iso-cmm-subtabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }

.iso-cmm-table { border-collapse: collapse; width: 100%; margin-bottom: 12px; font-size: 13px; }
.iso-cmm-table th, .iso-cmm-table td { border: 1px solid #ddd; padding: 6px 8px; text-align: left; vertical-align: top; }
.iso-cmm-table th { background: #2e75b6; color: #fff; }
.iso-cmm-table tr:nth-child(even) { background: #f7f9fb; }

.iso-cmm-note { font-style: italic; color: #888; font-size: 13px; }

/* Questionnaire layout */
.iso-cmm-q-layout { display: flex; gap: 16px; align-items: flex-start; }
.iso-cmm-q-list { width: 320px; max-height: 720px; overflow-y: auto; border: 1px solid #ddd; border-radius: 4px; padding: 6px; }
.iso-cmm-q-detail { flex: 1; min-width: 0; }
.iso-cmm-fam-group { margin-bottom: 10px; }
.iso-cmm-fam-title { font-weight: bold; font-size: 12px; color: #1f4e78; margin: 8px 0 4px; text-transform: uppercase; }
.iso-cmm-control-row {
  display: flex; justify-content: space-between; gap: 6px;
  padding: 4px 6px; border-radius: 3px; cursor: pointer; font-size: 13px;
}
.iso-cmm-control-row:hover { background: #eef4fa; }
.iso-cmm-control-row.active { background: #d9e8f5; font-weight: bold; }
.iso-cmm-control-id { width: 45px; }
.iso-cmm-control-score { width: 20px; text-align: center; }
.iso-cmm-control-confirmed { width: 20px; text-align: center; color: #38761d; }

.iso-cmm-detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.iso-cmm-field-box { border: 1px solid #ddd; border-radius: 4px; padding: 10px; margin-bottom: 10px; background: #fafafa; }
.iso-cmm-field-label { font-weight: bold; font-size: 12px; color: #444; margin-bottom: 6px; text-transform: uppercase; }
.iso-cmm-field-readonly { white-space: pre-wrap; font-size: 14px; }
.iso-cmm-field-box textarea, .iso-cmm-field-box input[type=text] { width: 100%; box-sizing: border-box; padding: 6px; font-size: 14px; }

.iso-cmm-radios { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.iso-cmm-radio { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.iso-cmm-confirm-row { font-size: 13px; }

.iso-cmm-history-body table { margin-top: 6px; }

.iso-cmm-hint-btn { background: #6aa84f; border-color: #6aa84f; color: #fff; margin-top: 0; }

/* Modal */
.iso-cmm-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.iso-cmm-modal {
  background: #fff; padding: 20px; border-radius: 6px; max-width: 900px; max-height: 80vh; overflow-y: auto;
}

/* Results grid */
.iso-cmm-legend { display: flex; gap: 4px; margin-bottom: 10px; }
.iso-cmm-legend-chip { padding: 4px 10px; border-radius: 3px; font-size: 12px; color: #222; font-weight: bold; }
.iso-cmm-score-box {
  display: inline-block; min-width: 46px; text-align: center; padding: 6px 4px;
  border-radius: 3px; font-weight: bold; font-size: 13px;
}
.iso-cmm-total-box { font-size: 15px; padding: 8px 6px; }
.iso-cmm-trend { text-align: center; font-size: 18px; font-weight: bold; }
.iso-cmm-total-row td { font-weight: bold; background: #eef4fa; }
.iso-cmm-fam-name { font-weight: 500; }

.iso-cmm-error { color: #b00020; font-weight: bold; }

/* ===================== Dashboard screen ===================== */
.iso-cmm-dash-toprow {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
.iso-cmm-dash-toprow h3 { margin: 0; color: #1f2937; }
.iso-cmm-year-picker { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.iso-cmm-year-select { padding: 6px 10px; border-radius: 4px; border: 1px solid #ccc; font-size: 13px; }

.iso-cmm-kpi-row { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.iso-cmm-kpi-card {
  flex: 1; min-width: 180px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.iso-cmm-kpi-icon { font-size: 28px; }
.iso-cmm-kpi-value { font-size: 26px; font-weight: 700; color: #1f2937; line-height: 1.1; }
.iso-cmm-kpi-label { font-size: 12px; color: #6b7280; margin-top: 2px; }

.iso-cmm-dash-row { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; align-items: stretch; }
.iso-cmm-card {
  flex: 1; min-width: 280px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.iso-cmm-card-wide { flex: 2; }
.iso-cmm-card-full { flex-basis: 100%; }
.iso-cmm-card h4 { margin: 0 0 12px; color: #1f2937; font-size: 15px; }

.iso-cmm-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.iso-cmm-donut {
  width: 170px; height: 170px; border-radius: 50%; position: relative; flex-shrink: 0;
}
.iso-cmm-donut-hole {
  position: absolute; inset: 26px; background: #fff; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.iso-cmm-donut-score { font-size: 26px; font-weight: 700; color: #1f2937; }
.iso-cmm-donut-level { font-size: 12px; color: #6b7280; }
.iso-cmm-donut-legend { font-size: 12px; }
.iso-cmm-legend-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.iso-cmm-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.iso-cmm-bars { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.iso-cmm-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.iso-cmm-bar-name { width: 220px; flex-shrink: 0; color: #374151; }
.iso-cmm-bar-track { flex: 1; height: 10px; background: #e5e7eb; border-radius: 5px; overflow: hidden; }
.iso-cmm-bar-fill { height: 100%; border-radius: 5px; }
.iso-cmm-bar-value { width: 30px; text-align: right; font-weight: 600; color: #374151; }

.iso-cmm-progress-track { height: 14px; background: #e5e7eb; border-radius: 7px; overflow: hidden; margin-bottom: 10px; }
.iso-cmm-progress-fill { height: 100%; background: #2e75b6; border-radius: 7px; transition: width 0.3s; }
.iso-cmm-progress-label { display: flex; justify-content: space-between; font-size: 13px; color: #374151; }

.iso-cmm-improve-list { display: flex; flex-direction: column; gap: 8px; }
.iso-cmm-improve-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 6px 0; border-bottom: 1px solid #f0f0f0;
}
.iso-cmm-priority-pill { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }

.iso-cmm-status-pill { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.iso-cmm-status-Completed { background: #d9ead3; color: #274e13; }
.iso-cmm-status-InProgress { background: #fce5cd; color: #994c00; }

/* CSV toolbar (Questionnaire screen) */
.iso-cmm-csv-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f7f9fb; border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 10px 12px; margin-bottom: 14px;
}
.iso-cmm-csv-btn { margin-top: 0; background: #2e75b6; }
.iso-cmm-csv-sep { color: #ccc; }
.iso-cmm-csv-file { font-size: 12px; max-width: 220px; }
.iso-cmm-csv-hint { font-size: 12px; color: #6b7280; flex-basis: 100%; }
