/* RentFlow Styling - IBM Carbon Design & Google Forms Light Theme */

:root {
  --font-primary: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'Inter', sans-serif;

  /* Theme Colors (Carbon Light Theme / Google Forms Light) */
  --bg-app: #f4f4f4;          /* Carbon UI background */
  --bg-card: #ffffff;         /* Carbon White page background */
  --bg-card-hover: #f7f9fc;
  --border-color: #dde1e6;     /* Carbon border color */
  --border-color-hover: #8d8d8d;
  
  --primary: #0f62fe;          /* Carbon Blue 60 */
  --primary-glow: #edf5ff;     /* Carbon Blue 10 (very light tint) */
  --primary-dark: #0043ce;     /* Carbon Blue 70 */
  --text-main: #161616;        /* Carbon Gray 100 */
  --text-muted: #525252;       /* Carbon Gray 60 */
  --text-dark: #161616;
  
  /* High Contrast Status Colors */
  --color-strong: #198038;     /* Carbon Green 60 */
  --color-strong-glow: #def8e9;
  --color-good: #0f62fe;       /* Carbon Blue 60 */
  --color-good-glow: #edf5ff;
  --color-weak: #d16d00;       /* Carbon Orange 60 */
  --color-weak-glow: #fff1e5;
  --color-poor: #da1e28;       /* Carbon Red 60 */
  --color-poor-glow: #fff1f1;

  /* Layout Constants (IBM Carbon inspired) */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s cubic-bezier(0.2, 0, 0.38, 0.9);
}

/* Reset & Core Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Structured Layout Common Class */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

/* Utilities */
.hide {
  display: none !important;
}

.text-muted {
  color: var(--text-muted);
}

/* Buttons (Carbon-like flat and sharp) */
.btn {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.16px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn:active {
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border-color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--text-main);
}

.btn-danger {
  background: var(--color-poor);
  color: #ffffff;
  border-color: var(--color-poor);
}

.btn-danger:hover {
  background: #a21019;
  border-color: #a21019;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 16px 20px;
  font-size: 0.95rem;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.badge-pulse {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(15, 98, 254, 0.2);
  position: relative;
  overflow: hidden;
}

.badge-pulse::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: none;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Inputs & Form Elements (Carbon & Google Forms style) */
.form-group {
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: var(--font-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i,
.input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #8d8d8d; /* Carbon gray 40 for unselected inputs */
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), outline var(--transition-fast);
}

.input-wrapper input {
  padding-left: 36px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-color: var(--primary);
  box-shadow: none;
}

/* Views Management */
.view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.view:not(.active) {
  display: none !important;
}

/* Login Card styling */
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  border-top: 4px solid var(--primary); /* Google Forms top accent */
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.logo-icon {
  background: var(--primary);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon i {
  width: 18px;
  height: 18px;
}

.logo-text {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  font-family: var(--font-primary);
  color: var(--text-main);
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
}

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-poor-glow);
  border: 1px solid rgba(218, 30, 40, 0.25);
  color: var(--color-poor);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.error-message i {
  width: 14px;
  height: 14px;
}

/* Layout for Logged In User */
#main-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-radius: 0 !important;
  border-bottom: 1px solid var(--border-color);
  border-top: none;
  border-left: none;
  border-right: none;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  margin-bottom: 0;
}

nav {
  display: flex;
  gap: 0;
  height: 100%;
}

.nav-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  height: 100%;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-link i {
  width: 16px;
  height: 16px;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.02);
}

.nav-link.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  background: transparent;
}

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

.username-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.username-label i {
  width: 14px;
  height: 14px;
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout:hover {
  color: var(--color-poor);
  background: var(--color-poor-glow);
}

/* Main Content Area */
.content-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  flex: 1;
}

.sub-view:not(.active) {
  display: none !important;
}

/* ==========================================================================
   DASHBOARD DESIGN
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 24px;
}

.metric-card {
  padding: 24px;
  margin-bottom: 24px;
  background: #ffffff;
}

.metric-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
  font-family: var(--font-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.card-header-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.card-header-simple h3 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.sample-size {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #f4f4f4;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.sample-size i {
  width: 12px;
  height: 12px;
}

/* Hero Scorecard Panel */
.hero-metric-body {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-top: 20px;
}

.gauge-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
}

.gauge-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.gauge-bg {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 8;
}

.gauge-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: square;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0, 0.38, 0.9), stroke 0.4s ease;
}

.gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.gauge-lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.verdict-wrapper {
  flex: 1;
}

.verdict-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.verdict-badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: #f4f4f4;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.verdict-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Key Performance Indicators Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.metrics-table th {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.05em;
}

.metrics-table td {
  padding: 12px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
}

.metrics-table tr:last-child td {
  border-bottom: none;
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-pass {
  background: var(--color-strong);
}

.status-fail {
  background: var(--color-poor);
}

/* Segment Bars */
.segment-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.segment-item {
  width: 100%;
}

.segment-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.segment-info .lbl {
  color: var(--text-muted);
}

.segment-info .val {
  font-weight: 600;
}

.bar-bg {
  width: 100%;
  height: 4px;
  background: #e0e0e0;
  border-radius: 0;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 0;
  transition: width 0.8s ease;
}

/* Fit Segment Colors matches IBM Carbon colors */
.strong-fill { background: var(--color-strong); }
.good-fill { background: var(--color-good); }
.weak-fill { background: var(--color-weak); }
.poor-fill { background: var(--color-poor); }

/* Decision Matrix Reference */
.matrix-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matrix-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
}

.matrix-list li.highlighted-verdict {
  background: var(--primary-glow);
  border: 1px solid rgba(15, 98, 254, 0.25);
  font-weight: 500;
}

.verdict-badge-inline {
  width: 90px;
  text-align: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
}

.matrix-list li .desc {
  font-size: 0.85rem;
}

/* Verdict classes colors */
.build-agg {
  background: var(--color-strong-glow);
  color: var(--color-strong);
  border: 1px solid rgba(25, 128, 56, 0.2);
}
.build-mvp {
  background: var(--color-good-glow);
  color: var(--color-good);
  border: 1px solid rgba(15, 98, 254, 0.2);
}
.refine-pos {
  background: var(--color-weak-glow);
  color: var(--color-weak);
  border: 1px solid rgba(209, 109, 0, 0.2);
}
.pivot-feat {
  background: var(--color-poor-glow);
  color: var(--color-poor);
  border: 1px solid rgba(218, 30, 40, 0.2);
}
.reconsider-biz {
  background: #f4f4f4;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Recent Activity List */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f4f4f4;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.recent-item:hover {
  background: #e8e8e8;
  border-color: #dde1e6;
}

.recent-info-lbl {
  font-weight: 500;
  font-size: 0.875rem;
}

.recent-info-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.recent-score-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}


/* ==========================================================================
   COLLECT RESPONSE / FORM DESIGN
   ========================================================================== */

.form-container {
  max-width: 760px; /* Aligned closer to typical Google Forms width */
  margin: 0 auto;
}

.form-hero {
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 6px solid var(--primary); /* Google Forms colored banner style */
  background: #ffffff;
}

.form-hero h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-hero p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.realtime-score-widget {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  text-align: center;
  min-width: 120px;
  position: sticky;
  top: 76px;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.realtime-score-widget .lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 2px;
}

.realtime-score-widget .val {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.realtime-score-widget .max {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.realtime-score-widget .rating-badge {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.rating-strong { background: var(--color-strong-glow); color: var(--color-strong); border: 1px solid rgba(25, 128, 56, 0.2); }
.rating-good { background: var(--color-good-glow); color: var(--color-good); border: 1px solid rgba(15, 98, 254, 0.2); }
.rating-weak { background: var(--color-weak-glow); color: var(--color-weak); border: 1px solid rgba(209, 109, 0, 0.2); }
.rating-poor { background: var(--color-poor-glow); color: var(--color-poor); border: 1px solid rgba(218, 30, 40, 0.2); }

.form-section {
  padding: 24px;
  margin-bottom: 16px;
  background: #ffffff;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.section-title i {
  color: var(--primary);
  width: 18px;
  height: 18px;
}

.section-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.section-title .sec-score {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: auto;
}

/* Grid Layout inside Forms */
.form-row {
  display: flex;
  gap: 16px;
}

.col-4 { width: 33.33%; }
.col-6 { width: 50%; }

/* Card Question Options Style */
.card-question {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.card-question:last-child {
  margin-bottom: 0;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.question-header h4 {
  font-size: 0.95rem;
  font-weight: 500;
  color: #161616;
  line-height: 1.4;
}

.selected-pts {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f4f4f4;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.selected-pts.selected {
  color: var(--primary);
  background: var(--primary-glow);
  border-color: rgba(15, 98, 254, 0.2);
}

.card-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-option {
  position: relative;
  cursor: pointer;
}

.card-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-content {
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--transition-fast);
}

.card-option:hover .option-content {
  background: #f4f4f4;
  border-color: #8d8d8d;
}

.opt-score {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  order: 2; /* Score shown on right */
}

.opt-text {
  font-size: 0.875rem;
  font-weight: 400;
  color: #161616;
  order: 1; /* text on left */
}

/* Checked option states (IBM Carbon Blue Selected State) */
.card-option input[type="radio"]:checked + .option-content {
  background: var(--primary-glow);
  border-color: var(--primary);
  outline: 1px solid var(--primary);
}

.card-option input[type="radio"]:checked + .option-content .opt-text {
  font-weight: 500;
}

.card-option input[type="radio"]:checked + .option-content .opt-score {
  background: var(--primary);
  color: #ffffff;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}


/* ==========================================================================
   VIEW RESPONSES PAGE
   ========================================================================== */

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

.view-header-row h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

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

.search-box {
  display: flex;
  align-items: center;
  padding: 0 12px;
  width: 240px;
  background: #ffffff;
  border: 1px solid #8d8d8d;
  border-radius: var(--radius-sm);
}

.search-box i {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.search-box input {
  background: transparent;
  border: none;
  padding: 8px 0;
  font-size: 0.85rem;
}

.search-box input:focus {
  outline: none;
  box-shadow: none;
}

.filter-box {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid #8d8d8d;
  border-radius: var(--radius-sm);
}

.filter-box i {
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  margin-right: 6px;
}

.filter-box select {
  background: transparent;
  border: none;
  padding: 8px 12px 8px 0;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-box select:focus {
  outline: none;
  box-shadow: none;
}

/* Grid layout of responses cards */
.responses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.response-card {
  padding: 16px;
  background: #ffffff;
  cursor: pointer;
}

.response-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.response-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.response-card-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.score-badge {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.response-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.response-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.response-card-meta i {
  width: 12px;
  height: 12px;
}

.response-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  font-size: 0.75rem;
}

.fit-indicator {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.01em;
}


/* ==========================================================================
   MODAL DIALOG DESIGN
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(22, 22, 22, 0.5); /* Carbon dark overlay opacity */
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

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

.modal-title-wrap h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-title-wrap p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.btn-close-modal:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.05);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.meta-item {
  background: #f4f4f4;
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.meta-item .label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.meta-item .value {
  font-size: 0.85rem;
  font-weight: 600;
}

.modal-score-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f4f4f4;
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.score-main {
  display: flex;
  align-items: baseline;
}

.score-main .score-num {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.score-main .score-max {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 1px;
}

.rating-box {
  text-align: right;
}

.rating-box .rating-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.rating-meaning {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-answers-section h3,
.modal-notes-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-answers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-answer-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.modal-answer-q {
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.modal-answer-a {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.modal-answer-pts {
  color: var(--primary);
}

.notes-block {
  padding: 12px;
  background: #f4f4f4;
  border-left: 3px solid var(--primary);
  border-radius: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}


.nav-left-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.drawer-header {
  display: none; /* hidden on desktop */
}

.btn-close-menu {
  display: none; /* hidden on desktop */
}

.menu-backdrop {
  display: none; /* hidden on desktop */
}

.btn-menu {
  display: none; /* hidden on desktop */
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}
.btn-menu:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}
.btn-menu i, .btn-menu svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   RESPONSIVENESS AND MOBILE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .btn-menu {
    display: flex;
  }

  .nav-left-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav-logo {
    display: flex !important;
  }

  .nav-logo .badge {
    display: none; /* hide dashboard badge on smaller screens to save space */
  }

  .nav-content {
    position: relative;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
  }

  nav {
    display: flex !important;
    position: fixed;
    top: 0;
    left: -280px; /* off-screen left */
    width: 280px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    flex-direction: column !important;
    padding: 0;
    z-index: 120;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.22s cubic-bezier(0.2, 0, 0.38, 1);
  }

  nav.open {
    transform: translateX(280px); /* slide in drawer */
  }

  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    background: #f4f4f4;
  }

  .btn-close-menu {
    display: flex;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
  }
  .btn-close-menu:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
  }
  .btn-close-menu i, .btn-close-menu svg {
    width: 18px;
    height: 18px;
  }

  .menu-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(22, 22, 22, 0.3);
    z-index: 110;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s linear;
  }
  
  .menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    height: 48px !important;
    padding: 0 24px !important;
    border-bottom: none !important;
    border-left: 4px solid transparent;
    justify-content: flex-start;
  }

  .nav-link.active {
    border-left: 4px solid var(--primary);
    background: var(--primary-glow);
  }

  .content-wrapper {
    padding: 16px;
  }

  .hero-metric-body {
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
  }

  .rating-box {
    text-align: center;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group {
    width: 100% !important;
  }

  .form-hero {
    flex-direction: column-reverse;
    align-items: stretch;
    padding: 16px;
  }

  .realtime-score-widget {
    position: static;
    margin-bottom: 12px;
    width: 100%;
  }

  .view-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .view-actions {
    flex-direction: column;
    width: 100%;
  }

  .search-box, .filter-box {
    width: 100%;
  }

  .modal-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-card {
    padding: 16px !important;
    margin-bottom: 16px !important;
  }

  .metrics-table td,
  .metrics-table th {
    padding: 10px 8px !important;
    font-size: 0.8rem !important;
    white-space: normal !important;
    word-break: normal !important;
  }

  .dashboard-grid {
    gap: 16px !important;
  }

  .card-header-simple {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .question-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .question-header .selected-pts {
    align-self: flex-end !important;
    margin-top: 4px;
  }
}
