/* ── Theme palette ── */
:root {
  --primary:   #DA0D0D;   /* KAIZEN360 red */
  --primary-dk:#B50B0B;   /* darker shade for hover */
  --accent:    #F6B53D;   /* orange-yellow */
  --accent2:   #DA0D0D;   /* coral-pink */
  --bg:        #F4F5F7;   /* neutral page background */
  --card-bg:   #ffffff;
  --text:      #242424;   /* charcoal text */
}

body { background: var(--bg); font-family: 'Segoe UI', sans-serif; color: var(--text); }
.sma-brand-mark {
  background: #FFFFFF;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 7px 8px;
  border-radius: 6px;
}

.brand-title {
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand-subtitle {
  color: rgba(255,255,255,.75);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: .5px;
  margin-top: 2px;
}
.card { border: none; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.10); background: var(--card-bg); }

/* Override Bootstrap primary buttons with our purple */
.btn-primary   { background: var(--primary)!important; border-color: var(--primary)!important; }
.btn-primary:hover { background: var(--primary-dk)!important; border-color: var(--primary-dk)!important; }
.btn-warning   { background: var(--accent)!important; border-color: var(--accent)!important; color:#1a1a3e!important; }
.btn-danger    { background: var(--accent2)!important; border-color: var(--accent2)!important; }
.btn-outline-light:hover { background: rgba(255,255,255,.15)!important; }
.btn-outline-primary { border-color: var(--primary)!important; color: var(--primary)!important; }
.btn-outline-primary:hover { background: var(--primary)!important; color:#fff!important; }

/* Progress bars */
.progress-bar { background: var(--primary)!important; }

/* Nav active/focus */
.nav-link.active, .nav-pills .nav-link.active { background: var(--primary)!important; }

.score-circle {
  width: 90px; height: 90px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; margin: auto;
}
.pillar-card { border-left: 5px solid; }
.pillar-leadership  { border-color: #0d6efd; }
.pillar-tm_engagement { border-color: #6f42c1; }
.pillar-organization { border-color: #fd7e14; }
.pillar-system       { border-color: #198754; }

/* Answer colours */
.q-yes           { background: #d1e7dd !important; }
.q-no            { background: #f8d7da !important; }
.q-na            { background: #e9ecef !important; }
.q-not_rolled_out { background: #fff3cd !important; }

/* Level badges — colours match maturity matrix */
.level-badge-0 { background:#6c757d; color:#fff; }
.level-badge-1 { background:#c0392b; color:#fff; }   /* Red       — Ad-hoc       */
.level-badge-2 { background:#e8a0a0; color:#5a0000; } /* Pink      — Reactive     */
.level-badge-3 { background:#f0d080; color:#5a4000; } /* Yellow    — Standardized */
.level-badge-4 { background:#a8d5a2; color:#1a4a18; } /* Lt green  — Proactive    */
.level-badge-5 { background:#2e7d32; color:#fff; }   /* Dk green  — Excellence   */

.alert-1pt { border-left: 6px solid #dc3545; }

/* Question rows */
.question-row {
  padding: 10px 14px; margin-bottom: 4px;
  border-radius: 8px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: background .15s;
}
.question-row:hover { background: #f0f4ff; }

/* Answer radio buttons */
.answer-radio label {
  cursor: pointer; padding: 4px 12px;
  border-radius: 6px; border: 1px solid #dee2e6;
  margin-right: 4px; font-size: .85rem;
  user-select: none; transition: all .1s;
}
.answer-radio input[type=radio] { display: none; }
.answer-radio input[type=radio]:checked + label.yes-lbl { background:#198754; color:#fff; border-color:#198754; }
.answer-radio input[type=radio]:checked + label.no-lbl  { background:#dc3545; color:#fff; border-color:#dc3545; }
.answer-radio input[type=radio]:checked + label.na-lbl  { background:#6c757d; color:#fff; border-color:#6c757d; }
.answer-radio input[type=radio]:checked + label.nr-lbl  { background:#ffc107; color:#000; border-color:#ffc107; }

/* Comment textarea */
.comment-field {
  font-size: .82rem; border-color: #dee2e6;
  resize: none; overflow: hidden; min-height: 32px;
  background: #fafafa;
}
.comment-field:focus { background: #fff; border-color: #86b7fe; }

/* Attachment items */
.att-item { background: #f8f9fa; font-size: .8rem; }

/* Sticky score panel */
.sticky-top { z-index: 100; }

/* Save indicator dot */
.saving-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ffc107; display: inline-block;
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Live badge pulse */
.live-pulse {
  animation: livePulse 2s infinite;
}
@keyframes livePulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* Smooth score updates */
.badge, .progress-bar { transition: background-color .4s, width .4s; }

/* GC self-assessment reference badges */
.self-yes  { background:#0a3622; color:#d1e7dd; border:1px solid #0a3622; }
.self-no   { background:#58151c; color:#f8d7da; border:1px solid #58151c; }
.self-na   { background:#495057; color:#e9ecef; border:1px solid #495057; }
.self-not_rolled_out { background:#664d03; color:#fff3cd; border:1px solid #664d03; }
.self-none { background:#dee2e6; color:#6c757d; border:1px solid #dee2e6; }

/* Inline self-ref block inside question row */
.self-ref-block { border-left: 3px solid; font-size:.82rem; }
.self-ref-yes   { border-color:#0a3622; background:#f0faf4; }
.self-ref-no    { border-color:#58151c; background:#fff5f5; }
.self-ref-na    { border-color:#adb5bd; background:#f8f9fa; }
.self-ref-not_rolled_out { border-color:#664d03; background:#fffdf0; }
.self-ref-none  { border-color:#dee2e6; background:#f8f9fa; }

/* Sticky filter bar */
.sticky-filter {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.10);
}

/* Multi-select dropdowns */
.ms-dropdown { position: relative; }
.ms-btn {
  width: 100%; text-align: left; background: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.ms-btn.active-filter { border-color: #0d6efd; color: #0d6efd; font-weight: 600; }
.ms-menu {
  display: none; position: absolute; top: calc(100% + 2px); left: 0;
  min-width: 200px; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid #dee2e6; border-radius: 8px;
  z-index: 9999; padding: 6px 0;
}
.ms-dropdown.open .ms-menu { display: block; }
.ms-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; cursor: pointer; font-size: .85rem;
  white-space: nowrap;
}
.ms-item:hover { background: #f0f4ff; }
.ms-item input[type=checkbox] { cursor: pointer; }
.pillar-section {
  scroll-margin-top: 140px;
}
/* =========================================================
   SMA login page
   ========================================================= */

.sma-login-page {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

.sma-login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 46%) 1fr;
}

.sma-login-brand-panel {
  position: relative;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(
      145deg,
      var(--primary) 0%,
      var(--primary-dk) 100%
    );
}

.sma-login-brand-panel::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  top: -160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.sma-login-brand-panel::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  left: -170px;
  bottom: -170px;
  border-radius: 50%;
  border: 55px solid rgba(255, 255, 255, 0.06);
}

.sma-login-brand-content {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  padding: 48px clamp(35px, 6vw, 85px);
  display: flex;
  flex-direction: column;
}

.sma-login-brand-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sma-login-brand-mark {
  flex-shrink: 0;
  padding: 10px 11px;
  border-radius: 7px;
  background: #fff;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.sma-login-brand-title {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.15;
}

.sma-login-brand-subtitle {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  letter-spacing: 0.4px;
}

.sma-login-message {
  max-width: 570px;
  margin: auto 0;
  padding: 70px 0;
}

.sma-login-message h1 {
  margin-bottom: 22px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 750;
  line-height: 1.08;
}

.sma-login-message p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.7;
}

.sma-login-security-note {
  color: rgba(255, 255, 255, 0.70);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sma-login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 45px 28px;
  background: var(--bg);
}

.sma-login-card {
  width: 100%;
  max-width: 460px;
  padding: 42px;
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: 0 14px 45px rgba(24, 30, 52, 0.14);
}

.sma-login-card .form-control {
  border-radius: 9px;
}

.sma-login-card .input-group .form-control {
  border-radius: 9px 0 0 9px;
}

.sma-login-card .input-group .btn {
  border-radius: 0 9px 9px 0;
}

.sma-login-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(85, 48, 130, 0.15);
}

.sma-login-help {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 991.98px) {
  .sma-login-shell {
    display: block;
  }

  .sma-login-brand-panel {
    display: none;
  }

  .sma-login-form-panel {
    min-height: 100vh;
  }

  .sma-login-card {
    padding: 34px 28px;
  }
}

@media (max-width: 480px) {
  .sma-login-form-panel {
    padding: 20px 14px;
  }

  .sma-login-card {
    padding: 30px 22px;
  }
}

/* ==========================================================
   MOBILE KPI GRID
   ========================================================== */

@media (max-width: 575.98px) {
  .command-kpi,
  .actions-kpi,
  .operations-kpi {
    min-height: 105px;
    padding: 0.72rem;
    border-radius: 14px;
  }

  .command-kpi-label,
  .actions-kpi-label,
  .operations-kpi-label {
    font-size: 0.64rem;
    line-height: 1.15;
  }

  .command-kpi-value,
  .actions-kpi-value,
  .operations-kpi-value {
    font-size: 1.45rem;
    line-height: 1.05;
  }

  .command-kpi-note,
  .actions-kpi-note,
  .operations-kpi-note {
    display: none;
  }

  .command-kpi-icon,
  .actions-kpi-icon {
    transform: scale(0.82);
    transform-origin: top right;
  }
}
/* KAIZEN360 login surface: supports the white/red brand artwork. */
.sma-login-brand-panel {
  background: radial-gradient(ellipse at bottom left, rgba(218,13,13,.16), transparent 60%), #181818;
}
.sma-login-card .form-control:focus {
  box-shadow: 0 0 0 .2rem rgba(218,13,13,.14);
}
