/* ============================================================
   MOSTAQER GROWTH COMPASS — compass.css  v2
   Full redesign for contrast, clarity, print quality
   ============================================================ */

/* ── REQUIRED / OPTIONAL FIELD LABELS ── */
.req-star {
  color: #EF4444;
  font-weight: 900;
  margin-right: 2px;
}
.optional-label {
  font-size: .72rem;
  color: #888;
  font-weight: 400;
  margin-right: 4px;
}

/* ── RESET WITHIN MODULE ── */
#compass-module *,
#compass-module *::before,
#compass-module *::after {
  box-sizing: border-box;
}

/* ── MODULE WRAPPER ── */
#compass-module {
  width: 100%;
  min-height: 100vh;
  background: #FAF9F6;
  color: #1C1917;
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  display: block;
}
#compass-module.hidden { display: none !important; }

/* ── COMPASS HEADER ── */
.compass-header {
  background: #FFFFFF;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid #EDE8D0;
  position: sticky;
  top: 62px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(196,154,0,.08);
}

.compass-header-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.compass-header-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #C49A00, #E6B800);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(196,154,0,.3);
}

.compass-header-titles h2 {
  font-size: .95rem; font-weight: 700; color: #1C1917; margin: 0;
}
.compass-header-titles p {
  font-size: .7rem; color: #78716C; margin: 0;
}

.compass-header-progress {
  flex: 1; max-width: 260px;
  display: flex; align-items: center; gap: .5rem;
}

.compass-progress-bar-wrap {
  flex: 1; height: 8px;
  background: #EDE8D0;
  border-radius: 4px; overflow: hidden;
}

.compass-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #C49A00, #E6B800);
  border-radius: 4px;
  transition: width .4s ease;
  width: 0%;
}

#compass-progress-pct {
  font-size: .78rem; color: #44403C; min-width: 32px; font-weight: 600;
}

.compass-header-actions {
  display: flex; gap: .5rem;
}

.compass-btn-icon {
  background: #FAFAF5;
  border: 1px solid #EDE8D0;
  color: #44403C;
  padding: .5rem .65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  transition: all .2s;
}
.compass-btn-icon:hover {
  background: #FFFBEA;
  border-color: #C49A00;
  color: #C49A00;
}

/* ── PAGE SYSTEM ── */
.compass-page {
  padding: 1.5rem;
  min-height: calc(100vh - 64px);
  display: none;
}
.compass-page.hidden { display: none !important; }
.compass-page.active { display: block; }

#compass-page-intro.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

#compass-page-questionnaire.active {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  min-height: calc(100vh - 64px);
  padding: 1.25rem;
  align-items: start;
}

/* ─────────────────────────────────────────────
   COMPASS INTRO PAGE
───────────────────────────────────────────── */
.compass-intro-banner {
  background: linear-gradient(135deg, #C49A00 0%, #E6B800 100%);
  border-radius: 18px; padding: 2rem;
  display: flex; align-items: flex-start; gap: 1.5rem;
  box-shadow: 0 8px 32px rgba(196,154,0,.2);
  border: 1px solid rgba(196,154,0,.3);
}

.cib-icon {
  font-size: 3.5rem; flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(0,0,0,.3));
}

.cib-texts h1 {
  font-size: 1.4rem; font-weight: 900; color: #fff; margin: 0 0 .4rem;
}
.cib-texts p { font-size: .88rem; color: rgba(255,255,255,.9); margin: 0; }
.cib-report-title {
  font-size: .72rem; color: rgba(255,255,255,.55);
  margin-top: .5rem; font-style: italic;
}

.compass-intro-domains {
  display: flex; gap: .75rem; flex-wrap: wrap;
}

.cid-chip {
  border: 1px solid;
  border-radius: 20px; padding: .45rem 1rem;
  font-size: .84rem; font-weight: 600;
  background: #FFFFFF;
  transition: all .2s;
}
.cid-chip:hover {
  background: #FFFBEA;
  transform: translateY(-1px);
}

.compass-intro-info {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.cii-card {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 12px; padding: 1rem;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: .4rem;
}

.cii-icon { font-size: 1.4rem; }
.cii-label { font-size: .72rem; color: #78716C; }
.cii-val { font-size: 1rem; font-weight: 700; color: #1C1917; }

.compass-intro-desc {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-right: 4px solid #C49A00;
  border-radius: 14px; padding: 1.5rem;
  line-height: 2; color: #44403C; font-size: .9rem;
}

.compass-intro-cta {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
  padding-bottom: 2rem;
}

.compass-btn-primary {
  background: linear-gradient(135deg, #C49A00, #E6B800);
  color: #fff; border: none; padding: .9rem 2rem;
  border-radius: 12px; font-size: 1rem; font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .25s;
  display: flex; align-items: center; gap: .5rem;
  box-shadow: 0 4px 16px rgba(196,154,0,.35);
}
.compass-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196,154,0,.45);
}

.compass-btn-secondary {
  background: #FFFFFF;
  color: #44403C; border: 1px solid #EDE8D0;
  padding: .9rem 1.5rem; border-radius: 12px;
  font-size: .9rem; font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .25s;
  display: flex; align-items: center; gap: .5rem;
}
.compass-btn-secondary:hover {
  background: #FFFBEA; color: #C49A00; border-color: #C49A00;
}

/* ─────────────────────────────────────────────
   QUESTIONNAIRE PAGE — HIGH CONTRAST
───────────────────────────────────────────── */
.compass-domain-sidebar {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 14px;
  padding: .75rem;
  height: fit-content;
  position: sticky; top: 142px;
}

.compass-sidebar-title {
  font-size: .72rem; font-weight: 700; color: #78716C;
  text-transform: uppercase; letter-spacing: 1px;
  padding: .4rem .5rem .8rem; border-bottom: 1px solid #EDE8D0;
  margin-bottom: .5rem;
}

#compass-domain-list { list-style: none; padding: 0; margin: 0; }

.compass-domain-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem .7rem; border-radius: 10px;
  cursor: pointer; transition: all .2s; margin-bottom: 3px;
  font-size: .84rem;
  color: #44403C;
}
.compass-domain-item:hover { background: #FFFBEA; color: #1C1917; }
.compass-domain-item.active {
  background: #FFFBEA;
  border: 1px solid #C49A00;
  color: #1C1917;
}
.compass-domain-item.done .cdl-prog { color: #059669; font-weight: 700; }
.compass-domain-item.done .cdl-name { color: #065F46; }

.cdl-icon {
  width: 30px; height: 30px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.cdl-name { flex: 1; }
.cdl-prog { font-size: .72rem; color: #78716C; white-space: nowrap; }

.compass-question-area {
  display: flex; flex-direction: column; gap: 1rem;
}

/* Domain header */
.compass-domain-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.1rem;
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 12px;
  border-bottom-width: 3px;
}

.cdh-icon {
  width: 38px; height: 38px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.cdh-name { font-size: 1.05rem; font-weight: 800; color: #1C1917; }
.cdh-sub  { font-size: .77rem; color: #78716C; margin-right: auto; }

/* Question card — DARK, VISIBLE BORDER */
.compass-question-card {
  background: #FFFFFF;
  border: 2px solid #EDE8D0;
  border-radius: 18px;
  padding: 1.85rem 1.75rem;
  flex: 1;
  box-shadow: 0 4px 20px rgba(196,154,0,.06);
}

.compass-q-number {
  font-size: .78rem; color: #C49A00; margin-bottom: .75rem;
  font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  display: flex; align-items: center; gap: .4rem;
}
.compass-q-number::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #C49A00; flex-shrink: 0;
}

.compass-q-text {
  font-size: 1.22rem; font-weight: 800; color: #1C1917;
  margin-bottom: .4rem; line-height: 1.7;
  text-shadow: none;
}

.compass-q-text-en {
  font-size: .82rem; color: #78716C; font-style: italic;
  margin-bottom: 1.5rem; direction: ltr; text-align: left;
  padding-bottom: 1rem;
  border-bottom: 1px solid #EDE8D0;
}

/* ── INDICATOR STATUS BADGE (shown if infoOnly / riskFlag) ── */
.compass-q-badge-row {
  display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem;
}
.compass-q-badge {
  font-size: .65rem; font-weight: 700; padding: .2rem .55rem;
  border-radius: 5px; display: flex; align-items: center; gap: .3rem;
}
.compass-q-badge-info   { background: #FFFBEA; color: #92400E; border: 1px solid #FDE68A; }
.compass-q-badge-risk   { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; animation: pulse-risk 2s ease infinite; }
.compass-q-badge-weight { background: #EEF2FF; color: #4338CA; border: 1px solid #C7D2FE; }

/* Answer buttons — HIGH CONTRAST */
.compass-answer-options {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
}

.compass-answer-btn {
  background: #FAFAF5;
  border: 2px solid #EDE8D0;
  border-radius: 14px; padding: 1.1rem .75rem;
  cursor: pointer; transition: all .25s;
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  font-family: 'Cairo', sans-serif;
  position: relative; overflow: hidden;
}
.compass-answer-btn::before {
  content: ''; position: absolute; inset: 0;
  background: var(--abcolor, #7C3AED);
  opacity: 0; transition: opacity .25s;
  border-radius: inherit;
}

.compass-answer-btn:hover {
  border-color: var(--abcolor, #C49A00);
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(196,154,0,.12);
}
.compass-answer-btn:hover::before { opacity: .08; }

.compass-answer-btn.selected {
  background: rgba(var(--abcolor-rgb, 196,154,0), .08);
  border-color: var(--abcolor, #C49A00);
  border-width: 2.5px;
  box-shadow: 0 0 0 4px rgba(var(--abcolor-rgb, 196,154,0), .1),
              0 6px 20px rgba(196,154,0,.08);
  transform: translateY(-2px);
}
.compass-answer-btn.selected::before { opacity: .12; }

.cab-val {
  font-size: 1.6rem; font-weight: 900;
  color: var(--abcolor, #1C1917);
  text-shadow: none;
  line-height: 1; position: relative;
}
.cab-label {
  font-size: .85rem; font-weight: 700;
  color: #1C1917;
  text-align: center; position: relative;
}
.cab-sub {
  font-size: .7rem; color: #78716C;
  text-align: center; position: relative;
}

/* Incomplete warning */
#compass-incomplete-msg {
  background: #FFFBEA;
  border: 1px solid #FDE68A;
  border-radius: 10px; padding: .9rem 1rem;
  color: #92400E; font-size: .9rem; font-weight: 600;
}
#compass-incomplete-msg.hidden,
#compass-finish-confirm.hidden { display: none; }

.compass-finish-btns {
  display: flex; gap: .75rem; flex-wrap: wrap;
}

/* Navigation */
.compass-question-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: .5rem;
}

.compass-btn-nav {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  color: #44403C; padding: .7rem 1.5rem;
  border-radius: 10px; font-size: .9rem; font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: .4rem;
}
.compass-btn-nav:hover {
  background: #FFFBEA;
  border-color: #C49A00;
  color: #C49A00;
}
.compass-btn-nav:disabled { opacity: .3; cursor: not-allowed; }

.compass-nav-info { font-size: .82rem; color: #78716C; font-weight: 600; }

/* ─────────────────────────────────────────────
   DASHBOARD / RESULTS PAGE — IMPROVED
───────────────────────────────────────────── */
#compass-page-dashboard {
  padding: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.compass-dash-header {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 16px; padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(196,154,0,.06);
}

.cdash-logo-row {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #EDE8D0;
}

.cdash-logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg,#C49A00,#E6B800);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(196,154,0,.3);
}

.cdash-report-title {
  font-size: 1.1rem; font-weight: 800; color: #1C1917;
}
.cdash-report-sub {
  font-size: .75rem; color: #78716C; margin-top: 2px;
}

.cdash-info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: .75rem;
}

.cdash-info-item {
  display: flex; align-items: center; gap: .65rem;
  background: #FAFAF5;
  border: 1px solid #EDE8D0;
  border-radius: 10px; padding: .65rem .9rem;
}
.cdash-info-item i { color: #C49A00; font-size: .95rem; flex-shrink: 0; }
.cdash-info-cell { display: flex; flex-direction: column; gap: 1px; }
.cdash-info-label { font-size: .65rem; color: #78716C; font-weight: 600; }
.cdash-info-val   { font-size: .88rem; font-weight: 700; color: #1C1917; }

/* Classification banner — vivid */
#cdash-classification-banner {
  border: 2px solid;
  border-radius: 16px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(196,154,0,.06);
}

.ccb-top {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: .75rem;
}
.ccb-texts { flex: 1; }
.ccb-label {
  font-size: 1.15rem; font-weight: 900;
  line-height: 1.3;
}
.ccb-label-en { font-size: .78rem; color: #78716C; margin-top: 2px; }

.ccb-score-badge {
  padding: .55rem 1rem; border-radius: 12px; color: #fff;
  text-align: center; min-width: 66px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.ccb-score-num { font-size: 1.5rem; font-weight: 900; display: block; }
.ccb-score-max { font-size: .72rem; opacity: .85; }

.ccb-bar-wrap {
  height: 10px; background: #EDE8D0;
  border-radius: 5px; overflow: hidden; margin-bottom: .45rem;
}
.ccb-bar {
  height: 100%; border-radius: 5px;
  transition: width 1s ease;
  box-shadow: 0 0 8px currentColor;
}
.ccb-bar-label { font-size: .77rem; color: #78716C; }

.ccb-alert {
  padding: .6rem .9rem; border-radius: 8px; font-size: .84rem; font-weight: 600;
  display: flex; align-items: center; gap: .45rem; margin-top: .5rem;
}
.ccb-alert.alert-high {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
}
.ccb-alert.alert-warn {
  background: #FFFBEA;
  border: 1px solid #FDE68A;
  color: #92400E;
}
.ccb-alert.alert-risk {
  background: #FEF2F2;
  border: 2px solid #F87171;
  color: #DC2626;
  font-size: .9rem;
  animation: pulse-risk 1.5s ease-in-out infinite;
}
@keyframes pulse-risk {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.3); }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,.0); }
}

/* Age-adjusted badge inside classification banner */
.ccb-age-adjusted-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .68rem; background: #EEF2FF;
  border: 1px solid #C7D2FE; color: #4338CA;
  border-radius: 5px; padding: .2rem .5rem; margin-top: .3rem;
}

/* Radar + Clinical row */
.cdash-radar-clinical-row {
  display: grid; grid-template-columns: 320px 1fr;
  gap: 1.25rem; margin-bottom: 1.5rem;
  align-items: start;
}

.cdash-chart-card {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 16px; padding: 1.25rem;
}

.cdash-chart-title {
  font-size: .87rem; font-weight: 700; color: #1C1917;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: .4rem;
}
.cdash-chart-title i { color: #C49A00; }

.cdash-radar-wrap {
  max-width: 280px; margin: 0 auto;
  position: relative; height: 270px;
}

.compass-clinical-summary {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 16px; padding: 1.25rem;
  height: 100%;
}

.compass-cs-title {
  font-size: .87rem; font-weight: 700; color: #1C1917;
  margin-bottom: .8rem;
  display: flex; align-items: center; gap: .4rem;
}
.compass-cs-title i { color: #059669; }

#cdash-clinical-summary {
  color: #44403C; font-size: .88rem; line-height: 1.9;
}

/* Domain cards grid */
.cdash-domains-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}

.cdash-domain-card {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 14px; padding: 1.2rem;
  transition: transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.cdash-domain-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(196,154,0,.1);
}

.cdc-header {
  display: flex; align-items: center; gap: .65rem; margin-bottom: .85rem;
}
.cdc-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
}
.cdc-titles { flex: 1; }
.cdc-name    { font-size: .9rem; font-weight: 800; color: #1C1917; }
.cdc-name-en { font-size: .68rem; color: #78716C; margin-top: 1px; }

.cdc-score-row {
  display: flex; align-items: baseline;
  justify-content: space-between; margin-bottom: .55rem;
}
.cdc-score { font-size: 1.6rem; font-weight: 900; color: #1C1917; line-height: 1; }
.cdc-max   { font-size: .78rem; color: #78716C; }
.cdc-pct-badge {
  padding: .25rem .65rem; border-radius: 8px;
  font-size: .82rem; font-weight: 800;
}

.cdc-bar-wrap {
  height: 7px; background: #EDE8D0;
  border-radius: 4px; overflow: hidden; margin-bottom: .65rem;
}
.cdc-bar { height: 100%; border-radius: 4px; transition: width .9s ease; }

.cdc-positive {
  font-size: .76rem; color: #78716C;
  display: flex; align-items: center; gap: .4rem; margin-bottom: .55rem;
}

.cdc-dots { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: .6rem; }
.cdc-dot  { width: 11px; height: 11px; border-radius: 50%; }

.cdc-alert-label {
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; gap: .35rem;
  padding: .4rem .6rem; border-radius: 7px;
  background: #FAFAF5;
}

/* Recommendations */
.cdash-recommendations {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 16px; padding: 1.35rem;
  margin-bottom: 1.5rem;
}

.crec-title {
  font-size: .92rem; font-weight: 800; color: #1C1917;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.crec-title i { color: #C49A00; }

/* Recommendation sections */
.crec-section { margin-bottom: 1.1rem; }
.crec-section-hdr {
  font-size: .8rem; font-weight: 700; color: #78716C;
  padding: .3rem 0 .5rem;
  border-bottom: 1px solid #EDE8D0;
  margin-bottom: .6rem;
  display: flex; align-items: center; gap: .4rem;
  text-transform: uppercase; letter-spacing: .5px;
}
.crec-section-hdr i { font-size: .85rem; }

#cdash-rec-grid {
  display: flex; flex-direction: column; gap: .5rem;
}

.crec-card {
  display: flex; align-items: flex-start; gap: .75rem;
  background: #FAFAF5;
  border: 1px solid #EDE8D0;
  border-right: 3px solid;
  border-radius: 10px; padding: .8rem 1rem;
  transition: background .2s;
}
.crec-card:hover { background: #FFFBEA; }

.crec-num {
  min-width: 26px; height: 26px;
  background: #FFFBEA;
  border: 1px solid #C49A00;
  color: #C49A00; border-radius: 50%;
  font-size: .76rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.crec-text { font-size: .87rem; color: #44403C; line-height: 1.65; }

/* Action buttons */
.cdash-actions {
  display: flex; gap: .75rem; flex-wrap: wrap;
  justify-content: center;
  padding: 1rem 0 2.5rem;
}

.cdash-btn-action {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  color: #44403C; padding: .75rem 1.35rem;
  border-radius: 10px; font-size: .88rem; font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: .4rem;
}
.cdash-btn-action:hover {
  background: #FFFBEA; color: #C49A00;
  transform: translateY(-1px);
  border-color: #C49A00;
}
.cdash-btn-action.primary {
  background: linear-gradient(135deg,#C49A00,#E6B800);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(196,154,0,.3);
}
.cdash-btn-action.primary:hover {
  box-shadow: 0 6px 20px rgba(196,154,0,.4);
  transform: translateY(-2px);
}
.cdash-btn-action.success {
  background: #F0FDF4;
  border-color: #86EFAC; color: #059669;
}
.cdash-btn-action.success:hover {
  background: #DCFCE7; color: #047857;
}

/* Save notification */
#compass-save-notif {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: #059669; color: #fff;
  padding: .8rem 1.75rem; border-radius: 12px;
  font-size: .92rem; font-weight: 700; z-index: 9999;
  box-shadow: 0 4px 20px rgba(5,150,105,.5);
  display: flex; align-items: center; gap: .5rem;
  animation: slideDown .3s ease;
}
#compass-save-notif.hidden { display: none; }

@keyframes slideDown {
  from { opacity:0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

/* ─────────────────────────────────────────────
   SETTINGS PANEL
───────────────────────────────────────────── */
#compass-settings-panel {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#compass-settings-panel.hidden { display: none; }

.cset-box {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 20px;
  width: 100%; max-width: 760px;
  max-height: 88vh; overflow-y: auto;
  padding: 1.75rem;
  scrollbar-width: thin; scrollbar-color: #C49A00 #FAF9F6;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

.cset-box::-webkit-scrollbar { width: 6px; }
.cset-box::-webkit-scrollbar-track { background: #FAF9F6; }
.cset-box::-webkit-scrollbar-thumb { background: #C49A00; border-radius: 3px; }

.cset-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 1px solid #EDE8D0;
}

.cset-header h3 {
  font-size: 1.1rem; font-weight: 800; color: #1C1917; margin: 0;
  display: flex; align-items: center; gap: .5rem;
}
.cset-header h3 i { color: #C49A00; }

.cset-close {
  background: #FAFAF5;
  border: 1px solid #EDE8D0;
  color: #44403C; padding: .45rem .65rem; border-radius: 8px;
  cursor: pointer; font-size: .9rem; transition: all .2s;
}
.cset-close:hover { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }

.cset-section { margin-bottom: 1.75rem; }

.cset-section-title {
  font-size: .78rem; font-weight: 700; color: #78716C;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: .9rem; padding-bottom: .5rem;
  border-bottom: 1px solid #EDE8D0;
  display: flex; align-items: center; gap: .4rem;
}
.cset-section-title i { color: #C49A00; }

.cset-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .9rem;
}

.cset-field label {
  font-size: .8rem; color: #78716C; display: block; margin-bottom: .35rem; font-weight: 600;
}

.cset-field input[type="number"],
.cset-field input[type="text"] {
  width: 100%; background: #FAFAF5;
  border: 1px solid #EDE8D0;
  border-radius: 9px; padding: .6rem .8rem;
  color: #1C1917; font-family: 'Cairo', sans-serif;
  font-size: .92rem; transition: border-color .2s;
}
.cset-field input:focus {
  outline: none;
  border-color: #C49A00;
  box-shadow: 0 0 0 3px rgba(196,154,0,.15);
}

/* Toggle switch */
.cset-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #FAFAF5;
  border: 1px solid #EDE8D0;
  border-radius: 10px; padding: .85rem 1.1rem;
  gap: 1rem;
}

.cset-toggle-label { font-size: .88rem; color: #1C1917; font-weight: 600; }
.cset-toggle-sub   { font-size: .72rem; color: #78716C; margin-top: 2px; }

.cset-toggle {
  position: relative; width: 48px; height: 26px; flex-shrink: 0;
}
.cset-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cset-toggle-slider {
  position: absolute; inset: 0;
  background: #EDE8D0;
  border: 1px solid #D6D3D1;
  border-radius: 26px;
  cursor: pointer; transition: .3s;
}
.cset-toggle-slider:before {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-radius: 50%;
  background: #FFFFFF; left: 3px; top: 2px; transition: .3s;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.cset-toggle input:checked + .cset-toggle-slider {
  background: rgba(196,154,0,.3);
  border-color: #C49A00;
}
.cset-toggle input:checked + .cset-toggle-slider:before {
  transform: translateX(22px);
  background: #C49A00;
}
/* Disabled state */
.cset-toggle input:disabled + .cset-toggle-slider {
  opacity: .5; cursor: not-allowed;
}

/* Indicators editor */
.cset-domain-block { margin-bottom: 1.35rem; }
.cset-domain-hdr {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem .9rem; background: #FAFAF5;
  border: 1px solid #EDE8D0;
  border-radius: 9px; margin-bottom: .6rem;
  font-size: .86rem; color: #1C1917;
}
.cset-domain-count { color: #78716C; font-size: .75rem; flex: 1; }
.cset-add-ind-btn {
  background: #FFFBEA; color: #C49A00;
  border: 1px solid #C49A00;
  padding: .32rem .75rem; border-radius: 7px; font-size: .76rem;
  cursor: pointer; transition: all .2s; font-family: 'Cairo',sans-serif;
}
.cset-add-ind-btn:hover { background: #FDE68A; }

.cset-ind-list { list-style: none; padding: 0; margin: .5rem 0 0 0; display: flex; flex-direction: column; gap: 8px; }

/* ── DARK INDICATOR CARD ── */
.cset-ind-item {
  display: flex; align-items: flex-start; gap: .55rem;
  background: #FAFAF5;
  border: 1.5px solid #EDE8D0;
  border-radius: 10px;
  padding: .65rem .7rem;
  transition: border-color .2s, box-shadow .2s;
}
.cset-ind-item:hover {
  border-color: #C49A00;
  box-shadow: 0 0 0 2px rgba(196,154,0,.1);
}
.cset-ind-item.info-only-card {
  border-color: #FDE68A;
  background: #FFFBEA;
}
.cset-ind-item.risk-card {
  border-color: #FECACA;
  background: #FEF2F2;
}

/* Text inputs inside card */
.cset-ind-inputs { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.cset-ind-drag { color: #A8A29E; cursor: grab; font-size: .9rem; padding-top: .3rem; flex-shrink: 0; }
.cset-ind-input {
  width: 100%; background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 7px; padding: .4rem .65rem;
  color: #1C1917; font-family: 'Cairo',sans-serif; font-size: .84rem;
  transition: border-color .2s;
}
.cset-ind-input:focus {
  outline: none; border-color: #C49A00;
  box-shadow: 0 0 0 2px rgba(196,154,0,.15);
}
.cset-ind-input::placeholder { color: #A8A29E; }
.cset-ind-en { font-size: .78rem; color: #78716C; }

/* Controls row inside card */
.cset-ind-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
  margin-top: .4rem;
}
.cset-ind-ctrl-label {
  display: flex; align-items: center; gap: .35rem;
  font-size: .72rem; color: #78716C; cursor: pointer;
  background: #FFFFFF; border: 1px solid #EDE8D0;
  border-radius: 6px; padding: .25rem .55rem; transition: all .2s;
  white-space: nowrap;
}
.cset-ind-ctrl-label:hover { background: #FFFBEA; color: #1C1917; }
.cset-ind-ctrl-label input[type="checkbox"] {
  accent-color: #C49A00; width: 13px; height: 13px; cursor: pointer; flex-shrink: 0;
}
.cset-ind-ctrl-label.ctrl-ignore input:checked ~ span,
.cset-ind-ctrl-label.ctrl-ignore:has(input:checked) { color: #F59E0B; }
.cset-ind-ctrl-label.ctrl-risk input:checked ~ span,
.cset-ind-ctrl-label.ctrl-risk:has(input:checked) { color: #EF4444; }

/* Weight selector */
.cset-ind-weight-wrap {
  display: flex; align-items: center; gap: .35rem;
  font-size: .72rem; color: #78716C;
  background: #FFFFFF; border: 1px solid #EDE8D0;
  border-radius: 6px; padding: .2rem .45rem .2rem .55rem;
}
.cset-ind-weight-wrap i { color: #C49A00; font-size: .68rem; }
.cset-ind-weight-select {
  background: transparent; border: none; color: #C49A00;
  font-family: 'Cairo',sans-serif; font-size: .76rem;
  cursor: pointer; padding: 0 .1rem; outline: none;
}
.cset-ind-weight-select option { background: #FFFFFF; color: #1C1917; }

/* Tag badges on indicator */
.cset-ind-badge {
  font-size: .65rem; font-weight: 700; padding: .18rem .45rem;
  border-radius: 4px; letter-spacing: .3px;
}
.cset-ind-badge-ignore { background: #FFFBEA; color: #92400E; border: 1px solid #FDE68A; }
.cset-ind-badge-risk   { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.cset-ind-badge-weight { background: #EEF2FF; color: #4338CA; border: 1px solid #C7D2FE; }

/* ── PER-AGE-GROUP WEIGHTS SECTION ── */
.cset-age-weights-section {
  margin-top: .55rem;
  background: #FFFBEA;
  border: 1px solid #EDE8D0;
  border-radius: 8px;
  padding: .6rem .75rem;
}
.cset-age-weights-title {
  font-size: .7rem; color: #C49A00; font-weight: 700;
  margin-bottom: .5rem; display: flex; align-items: center; gap: .3rem;
}
.cset-age-weights-grid {
  display: flex; flex-wrap: wrap; gap: .45rem;
}
.cset-age-weight-cell {
  display: flex; flex-direction: column; gap: .2rem;
  background: #FFFFFF; border: 1px solid #EDE8D0;
  border-radius: 7px; padding: .3rem .55rem;
  min-width: 120px;
}
.cset-age-weight-cell label {
  font-size: .64rem; color: #78716C; font-weight: 600;
}
.cset-age-wt-sel {
  background: transparent; border: none; color: #C49A00;
  font-family: 'Cairo',sans-serif; font-size: .8rem;
  cursor: pointer; outline: none;
}
.cset-age-wt-sel option { background: #FFFFFF; color: #1C1917; }

.cset-ind-del {
  background: #FEF2F2; color: #DC2626;
  border: 1px solid #FECACA;
  padding: .38rem .55rem; border-radius: 7px;
  cursor: pointer; font-size: .82rem; transition: all .2s;
  flex-shrink: 0; align-self: flex-start;
}
.cset-ind-del:hover { background: #FECACA; }

/* Legacy compat */
.cset-ind-scoring { display: flex; flex-direction: column; gap: 2px; }
.cset-ind-scoring-label { font-size: .65rem; color: #78716C; white-space: nowrap; }
.cset-ind-scoring input[type="checkbox"] { accent-color: #C49A00; width: 14px; height: 14px; cursor: pointer; }

/* Recommendations editor */
.cset-rec-block { margin-bottom: 1.1rem; }
.cset-rec-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .5rem; font-size: .86rem; color: #1C1917; font-weight: 600;
}
.cset-add-rec-btn {
  background: #F0FDF4; color: #059669;
  border: 1px solid #86EFAC;
  padding: .28rem .7rem; border-radius: 7px; font-size: .76rem;
  cursor: pointer; transition: all .2s; font-family: 'Cairo',sans-serif;
}
.cset-add-rec-btn:hover { background: #DCFCE7; }

.cset-rec-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.cset-rec-item { display: flex; gap: .5rem; align-items: center; }
.cset-rec-input {
  flex: 1; background: #FAFAF5;
  border: 1px solid #EDE8D0;
  border-radius: 7px; padding: .42rem .7rem;
  color: #1C1917; font-family: 'Cairo',sans-serif; font-size: .83rem;
}
.cset-rec-input:focus {
  outline: none; border-color: #C49A00;
  box-shadow: 0 0 0 2px rgba(196,154,0,.15);
}
.cset-rec-del {
  background: #FEF2F2; color: #DC2626;
  border: 1px solid #FECACA;
  padding: .35rem .55rem; border-radius: 7px;
  cursor: pointer; font-size: .78rem; transition: all .2s;
}
.cset-rec-del:hover { background: #FECACA; }

.cset-footer {
  display: flex; gap: .75rem; justify-content: flex-end; align-items: center;
  padding-top: 1rem; border-top: 1px solid #EDE8D0;
}

.cset-save-btn {
  background: linear-gradient(135deg,#C49A00,#E6B800);
  color: #fff; border: none; padding: .75rem 1.6rem;
  border-radius: 10px; font-size: .92rem; font-weight: 700;
  font-family: 'Cairo',sans-serif; cursor: pointer; transition: all .25s;
  box-shadow: 0 4px 12px rgba(196,154,0,.3);
}
.cset-save-btn:hover {
  box-shadow: 0 6px 18px rgba(196,154,0,.45);
  transform: translateY(-1px);
}

.cset-reset-btn {
  background: #FEF2F2; color: #DC2626;
  border: 1px solid #FECACA;
  padding: .75rem 1.3rem; border-radius: 10px; font-size: .9rem;
  font-family: 'Cairo',sans-serif; cursor: pointer; transition: all .2s;
}
.cset-reset-btn:hover { background: #FECACA; }

#compass-settings-saved-notif {
  background: #F0FDF4; color: #059669;
  border: 1px solid #86EFAC;
  padding: .45rem 1rem; border-radius: 8px; font-size: .82rem;
  font-family: 'Cairo',sans-serif;
  display: flex; align-items: center; gap: .4rem;
}
#compass-settings-saved-notif.hidden { display: none; }

/* ─────────────────────────────────────────────
   QR MODAL
───────────────────────────────────────────── */
#compass-qr-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#compass-qr-modal.hidden { display: none; }

.cqr-box {
  background: #FFFFFF;
  border: 1px solid #EDE8D0;
  border-radius: 20px; padding: 1.75rem;
  max-width: 500px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

.cqr-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; padding-bottom: 1rem;
  border-bottom: 1px solid #EDE8D0;
}
.cqr-header h3 {
  font-size: 1rem; font-weight: 700; color: #1C1917; margin: 0;
  display: flex; align-items: center; gap: .5rem;
}

.cqr-body {
  display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
}

#compass-qr-canvas {
  border-radius: 12px; background: #fff; padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

.cqr-child-banner {
  background: #FFFBEA;
  border: 1px solid #EDE8D0;
  border-radius: 9px; padding: .65rem 1rem;
  font-size: .84rem; color: #1C1917; text-align: center; width: 100%;
}

.cqr-link-row {
  display: flex; gap: .5rem; width: 100%;
}

.cqr-link-input {
  flex: 1; background: #FAFAF5;
  border: 1px solid #EDE8D0;
  border-radius: 9px; padding: .55rem .8rem;
  color: #1C1917; font-size: .8rem; direction: ltr;
  font-family: monospace;
}

.cqr-copy-btn {
  background: #FFFBEA; color: #C49A00;
  border: 1px solid #C49A00;
  padding: .55rem .85rem; border-radius: 9px;
  cursor: pointer; font-size: .95rem; transition: all .2s;
}
.cqr-copy-btn:hover { background: #FDE68A; color: #92400E; }

.cqr-footer {
  display: flex; gap: .65rem; justify-content: flex-end;
  margin-top: 1.1rem; padding-top: 1rem;
  border-top: 1px solid #EDE8D0;
}

/* ─────────────────────────────────────────────
   SHARED RESULT OVERLAY
───────────────────────────────────────────── */
#compass-shared-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#compass-shared-overlay.hidden { display: none; }

.css-result-wrap {
  background: #FFFFFF;
  border: 2px solid;
  border-radius: 20px; padding: 2rem;
  text-align: center; max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.css-icon   { font-size: 3rem; margin-bottom: .5rem; }
.css-child  { font-size: 1.2rem; font-weight: 800; color: #1C1917; margin-bottom: .3rem; }
.css-score  { font-size: 2rem; font-weight: 900; color: #1C1917; margin-bottom: .3rem; }
.css-label  { font-size: 1rem; font-weight: 700; margin-bottom: .6rem; }
.css-date   { font-size: .8rem; color: #78716C; margin-bottom: .4rem; }
.css-note   { font-size: .72rem; color: #A8A29E; }

/* ─────────────────────────────────────────────
   MODULE SELECTOR
───────────────────────────────────────────── */
.module-selector {
  background: #FAFAF5;
  border: 1px solid #EDE8D0;
  border-radius: 18px; padding: 1.5rem;
  margin-top: 1.5rem;
}

.module-selector-title {
  font-size: .78rem; font-weight: 700; color: #78716C;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 1rem;
}

.module-cards {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.module-card {
  background: #FFFFFF;
  border: 2px solid #E7E5E4;
  border-radius: 14px; padding: 1.35rem;
  cursor: pointer; transition: all .25s;
  text-align: center;
}
.module-card:hover {
  border-color: var(--mc, #C49A00);
  background: #FFFBEA;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(196,154,0,.12);
}

.mc-icon { font-size: 2rem; margin-bottom: .6rem; }
.mc-name { font-size: .92rem; font-weight: 800; color: #1C1917; margin-bottom: .3rem; }
.mc-sub  { font-size: .72rem; color: #78716C; }

/* ─────────────────────────────────────────────
   PRINT STYLES — PROFESSIONAL
───────────────────────────────────────────── */
@media print {
  /* Force print from compass dashboard */
  body > *:not(#compass-module) { display: none !important; }
  #compass-module { display: block !important; background: #fff !important; color: #111 !important; }

  .compass-header,
  .cdash-actions,
  .compass-header-actions,
  .no-print { display: none !important; }

  /* Use white background for print */
  #compass-page-dashboard {
    padding: 0 !important;
    max-width: 100% !important;
    display: block !important;
  }

  .compass-dash-header,
  .cdash-domains-grid .cdash-domain-card,
  .cdash-chart-card,
  .compass-clinical-summary,
  .cdash-recommendations {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    color: #111 !important;
    box-shadow: none !important;
  }

  .cdash-report-title,
  .cdash-info-val,
  .cdash-chart-title,
  .compass-cs-title,
  .crec-title,
  .cdc-name,
  .cdash-report-sub { color: #111 !important; }

  .cdash-info-label,
  .cdash-info-item i,
  .cdc-name-en,
  .cdc-positive,
  #cdash-clinical-summary,
  .crec-text { color: #555 !important; }

  .cdash-radar-clinical-row {
    grid-template-columns: 280px 1fr !important;
    page-break-inside: avoid;
  }

  .cdash-domains-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    page-break-inside: avoid;
  }

  #cdash-classification-banner {
    page-break-inside: avoid;
  }

  /* Force colors to print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  @page {
    margin: 1.5cm;
    size: A4;
  }
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 900px) {
  .cdash-radar-clinical-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  #compass-page-questionnaire.active {
    grid-template-columns: 1fr;
  }

  .compass-domain-sidebar {
    position: static;
    display: flex; overflow-x: auto; gap: .5rem;
    padding: .5rem; flex-direction: row;
    scrollbar-width: none; border-radius: 10px;
    top: auto;
  }
  .compass-domain-sidebar::-webkit-scrollbar { display: none; }
  .compass-sidebar-title { display: none; }
  #compass-domain-list {
    display: flex; gap: .4rem; flex-direction: row; width: max-content;
  }
  .compass-domain-item {
    flex-direction: column; align-items: center; text-align: center;
    min-width: 72px; padding: .5rem; font-size: .68rem;
  }
  .cdl-name { font-size: .67rem; }
  .cdl-prog { font-size: .65rem; }

  .compass-answer-options { grid-template-columns: 1fr; gap: .6rem; }

  .module-cards { grid-template-columns: 1fr; }
  .cdash-info-grid { grid-template-columns: 1fr 1fr; }
  .cdash-domains-grid { grid-template-columns: 1fr; }
}
