:root {
  --bg-color: #f9fafb;
  --surface-color: #ffffff;
  --surface-alt: #f3f4f6;
  
  --text-main: #111827;
  --text-muted: #6b7280;
  
  --border-color: #e5e7eb;
  --border-focus: #c7d2fe;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  
  --green: #10b981;
  --green-soft: #d1fae5;
  --green-dark: #065f46;
  
  --red: #ef4444;
  --red-soft: #fee2e2;
  --red-dark: #991b1b;
  
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --amber-dark: #92400e;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.w-full { width: 100%; }
.p-0 { padding: 0 !important; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-danger { color: var(--red) !important; }
.align-start { align-items: flex-start !important; }
.no-border-radius { border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important; border-top: none !important; }

/* Login */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  backdrop-filter: blur(8px);
}
.login-overlay[hidden] { display: none; }
.task-progress {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  z-index: 220;
  pointer-events: none;
}
.task-progress[hidden] { display: none; }
.task-progress-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
  padding: 12px 14px 14px;
}
.task-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.task-progress-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}
.task-progress-text {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.task-progress-percent {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.task-progress-track {
  position: relative;
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
}
.task-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 45%, #22c55e 100%);
  transform-origin: left center;
}
.login-modal {
  width: 100%;
  max-width: 400px;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  border: 1px solid var(--border-color);
}
.login-header { text-align: center; margin-bottom: 24px; }
.brand-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.login-header h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 8px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; color: var(--text-main); }

/* Form Controls */
.input-control {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-main);
  transition: all 0.2s;
}
.input-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}
.text-area { min-height: 120px; resize: vertical; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-large { padding: 12px 20px; font-size: 0.9375rem; font-weight: 600; }
.btn-primary { background-color: var(--primary); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-progress {
  position: relative;
  overflow: hidden;
}
.btn-progress::after {
  content: "";
  position: absolute;
  left: 0;
  right: auto;
  bottom: 0;
  height: 2px;
  width: calc(var(--progress, 0) * 1%);
  background: rgba(255, 255, 255, 0.92);
  transition: width 0.18s ease;
}
.btn-secondary { background-color: var(--surface-color); color: var(--text-main); border-color: var(--border-color); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background-color: var(--bg-color); border-color: #d1d5db; }
.btn-ghost { background-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background-color: var(--surface-alt); color: var(--text-main); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Layout */
.app-container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.card { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.card-header h4 { font-size: 1.125rem; font-weight: 600; }
.card-body { padding: 24px; }

/* View Header */
.view-header {
  margin-bottom: 24px;
}
.view-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.view-subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 4px;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  background: var(--surface-color);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 8px; }
.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-main);
  font-size: 1rem;
  padding: 0 8px;
}

/* View Tabs */
.view-tabs {
  display: flex;
  background-color: var(--surface-alt);
  padding: 4px;
  border-radius: 999px;
}
.view-tab {
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.view-tab:hover { color: var(--text-main); }
.view-tab.active {
  background-color: var(--surface-color);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* About View */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
}
.about-main,
.about-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.about-hero {
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.8fr);
  gap: 24px;
  align-items: start;
}
.about-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.about-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
}
.about-hero h3 {
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 700;
}
.about-hero p {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.about-metrics {
  display: grid;
  gap: 12px;
}
.about-metric {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric-label,
.stack-label,
.code-caption,
.side-key {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.about-metric strong {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
}
.about-section-card .card-body,
.side-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.flow-grid,
.reason-grid,
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.flow-step,
.reason-item,
.stack-card,
.side-item {
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}
.flow-index {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8125rem;
  margin-bottom: 12px;
}
.flow-step h5,
.reason-item h5,
.stack-card strong {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
}
.flow-step p,
.reason-item p,
.stack-card p {
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-muted);
}
.prose-block p {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text-muted);
}
.prose-block p + p {
  margin-top: 10px;
}
.about-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}
.about-list.compact {
  gap: 8px;
  font-size: 0.85rem;
}
.stack-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.code-callout {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #111827;
  color: #e5e7eb;
}
.code-callout code,
.side-item code {
  font-size: 0.85rem;
  word-break: break-all;
}
.side-list {
  gap: 10px !important;
}
.side-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
}
.side-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.side-tag {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface-alt);
  font-size: 0.8125rem;
  color: var(--text-main);
}

/* Console Section */
.console-section { margin-bottom: 24px; }

/* Timetable Wrapper */
.timetable-wrapper {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.timetable-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.week-display {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 140px;
  text-align: center;
}
.timetable-grid {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-color);
}
.grid-header, .grid-row {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
  border-bottom: 1px solid var(--border-color);
}
.grid-row:last-child {
  border-bottom: none;
}
.grid-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  font-size: 0.875rem;
  border-right: 1px dashed var(--border-color);
  text-align: center;
}
.grid-cell:last-child {
  border-right: none;
}
.header-cell, .row-label {
  background: var(--surface-alt);
  font-weight: 500;
  color: var(--text-muted);
}
.header-cell {
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.header-active {
  background: var(--primary-soft);
  color: var(--primary);
}
.header-cell.is-today .day-name {
  color: var(--primary);
}
.day-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}
.day-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.today-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}
.empty-cell {
  background: var(--surface-alt);
}
.row-label {
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}
.period-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}
.period-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}
.slot-cell {
  background: var(--surface-color);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  color: transparent; /* icon color will be controlled */
}
.slot-cell::after {
  content: "✔";
  color: transparent;
  font-size: 0.875rem;
}
.slot-cell:hover {
  background: #f8fafc;
}
.slot-cell.col-active {
  background: var(--primary-soft);
  opacity: 0.6;
}
.slot-cell.selected {
  background: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
  opacity: 1;
}
.slot-cell.selected::after {
  color: white;
}

.console-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.action-left { display: flex; gap: 12px; }
.action-hint { font-size: 0.875rem; color: var(--text-muted); }

/* Results Board */
.results-board { display: flex; flex-direction: column; gap: 24px; margin-top: 24px; }
.result-section { display: flex; flex-direction: column; gap: 16px; background: var(--surface-color); border-radius: var(--radius-lg); border: 1px solid var(--border-color); padding: 24px; }
.section-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.header-left { display: flex; align-items: center; gap: 8px; }
.section-heading { display: flex; flex-direction: column; gap: 4px; }
.section-title { font-size: 1.125rem; font-weight: 600; }
.section-context { font-size: 0.8125rem; color: var(--text-muted); }
.header-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.filter-group { display: flex; gap: 8px; }
.select-filter { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); font-size: 0.8125rem; background: var(--surface-alt); outline: none; cursor: pointer; }
.action-group { display: flex; align-items: center; gap: 8px; }
.random-picker { display: flex; align-items: center; background: var(--surface-alt); border-radius: var(--radius-sm); border: 1px solid var(--border-color); overflow: hidden; }
.input-tiny { width: 40px; border: none; background: transparent; text-align: center; font-size: 0.8125rem; outline: none; padding: 6px 0; -moz-appearance: textfield; }
.input-tiny::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.random-picker .btn { border-radius: 0; border: none; border-left: 1px solid var(--border-color); background: var(--surface-color); }

.free-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.free-card { padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--green-soft); background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%); cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; }
.free-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1); border-color: var(--green); }
.free-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--green); }
.card-name { font-weight: 600; font-size: 1rem; color: var(--text-main); margin-bottom: 4px; }
.card-slot { font-size: 0.78rem; color: var(--green-dark); margin-bottom: 8px; font-weight: 500; }
.card-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; }

.section-busy { border: 1px dashed var(--border-color); background: transparent; padding: 16px 24px; }
.busy-chips-container { display: flex; flex-wrap: wrap; gap: 8px; }
.busy-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 12px; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 14px; font-size: 0.75rem; color: var(--text-muted); cursor: help; max-width: min(100%, 320px); }
.busy-chip-main { display: inline-flex; align-items: center; gap: 6px; color: var(--text-main); font-weight: 500; }
.busy-chip-meta { font-size: 0.72rem; color: var(--text-muted); line-height: 1.45; padding-left: 12px; }
.status-dot { display: inline-block; border-radius: 50%; }
.dot-red { background-color: var(--red); width: 6px; height: 6px; }
.dot-green { background-color: var(--green); width: 8px; height: 8px; }

.alert-danger { display: flex; gap: 12px; padding: 16px 20px; background-color: var(--red-soft); border-left: 4px solid var(--red); border-radius: var(--radius-md); color: var(--red-dark); }
.alert-icon { margin-top: 2px; }
.alert-content h4 { font-weight: 600; font-size: 0.9375rem; margin-bottom: 8px; }
.failed-compact-list { display: flex; flex-wrap: wrap; gap: 8px; }
.failed-item { font-size: 0.75rem; background: rgba(255,255,255,0.6); padding: 2px 8px; border-radius: 4px; border: 1px solid rgba(239, 68, 68, 0.2); }

.detail-profile { display: flex; flex-direction: column; gap: 24px; padding: 8px 0; }
.profile-header { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.profile-title h2 { font-size: 1.5rem; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.profile-card { display: flex; flex-direction: column; gap: 12px; }
.profile-row { display: flex; flex-direction: column; gap: 4px; }
.profile-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.profile-value { font-size: 0.9375rem; color: var(--text-main); }
.empty-state { text-align: center; padding: 32px; color: var(--text-muted); font-size: 0.875rem; border: 1px dashed var(--border-color); border-radius: var(--radius-md); }

@keyframes highlightRandom {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); border-color: var(--primary); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); border-color: var(--primary); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}
.random-highlight { animation: highlightRandom 0.6s ease-out; border-color: var(--primary) !important; background: linear-gradient(180deg, var(--primary-soft) 0%, #fff 100%) !important; }

/* Management Section */
.management-section { display: flex; flex-direction: column; gap: 24px; }
.management-top { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.stats-cards { display: flex; flex-direction: column; gap: 16px; }
.stat-card { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.stat-label { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.stat-value { font-size: 1.5rem; font-weight: 600; }
.add-member-form { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 12px; }

/* Member Table */
.member-table-container { overflow-x: auto; }
.member-table-header { display: grid; grid-template-columns: 1.5fr 1.5fr 1.5fr 1fr 140px; gap: 16px; padding: 12px 24px; background-color: var(--surface-alt); border-bottom: 1px solid var(--border-color); font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); }
.member-table-row { display: grid; grid-template-columns: 1.5fr 1.5fr 1.5fr 1fr 140px; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--border-color); align-items: center; transition: background-color 0.2s; }
.member-table-row:hover { background-color: #f8fafc; }
.member-table-row:last-child { border-bottom: none; }
.table-cell-main { display: flex; flex-direction: column; gap: 2px; }
.table-cell-main strong { font-size: 0.875rem; font-weight: 500; }
.table-cell-main span { font-size: 0.75rem; color: var(--text-muted); }
.status-pill { display: inline-flex; align-items: center; justify-content: center; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; width: max-content; }
.status-pill.ok { background-color: var(--green-soft); color: var(--green-dark); }
.status-pill.error { background-color: var(--red-soft); color: var(--red-dark); }
.status-pill.unknown { background-color: var(--amber-soft); color: var(--amber-dark); }
.row-actions { display: flex; gap: 8px; }
.member-table-row.is-testing {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.06), rgba(79, 70, 229, 0.12), rgba(79, 70, 229, 0.06));
  background-size: 220% 100%;
  animation: testingShimmer 1.15s linear infinite;
}
.member-table-row.pulse-ok {
  animation: pulseOk 0.9s ease;
}
.member-table-row.pulse-error {
  animation: pulseError 0.9s ease;
}
.testing-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@keyframes testingShimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@keyframes pulseOk {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.32); }
  60% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.08); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseError {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.32); }
  60% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.08); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.status-pill.testing { 
  background-color: var(--primary-soft); 
  color: var(--primary); 
}
.spinner-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-right: 4px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.edit-input {
  width: 100%;
  padding: 6px 10px;
  background-color: var(--surface-alt);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--text-main);
  transition: all 0.2s;
}
.edit-input:focus {
  outline: none;
  background-color: var(--surface-color);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.edit-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.icon-btn:hover {
  background: var(--surface-alt);
  color: var(--text-main);
}
.icon-btn.text-danger:hover {
  background: var(--red-soft);
  color: var(--red);
}
.icon-btn.text-green { color: var(--green); }
.icon-btn.text-green:hover { background: var(--green-soft); }
.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}



/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(17, 24, 39, 0.34);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 620px;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}
.modal-form {
  padding: 24px;
  display: grid;
  gap: 18px;
}
.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.modal-grid-full {
  grid-column: 1 / -1;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* Toast */
.toast-message { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text-main); color: white; padding: 12px 24px; border-radius: 999px; font-size: 0.875rem; font-weight: 500; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; z-index: 200; }

/* Responsive */
@media (max-width: 1024px) {
  .results-board { grid-template-columns: 1fr; }
  .management-top { grid-template-columns: 1fr; }
  .stats-cards { flex-direction: row; }
  .stat-card { flex: 1; }
  .about-layout,
  .about-hero {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .app-container { padding: 12px; }
  .navbar { flex-wrap: wrap; gap: 12px; border-radius: var(--radius-lg); justify-content: center; }
  .nav-center { order: 3; width: 100%; display: flex; justify-content: center; }
  .view-tabs { width: 100%; justify-content: center; flex-wrap: wrap; }
  
  .card-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .card-header .header-left, .card-header .header-actions { width: 100%; }
  .card-header .header-actions button, .card-header button { width: 100%; }
  .header-left { flex-direction: column; align-items: flex-start; gap: 8px; }
  .header-left input { width: 100%; }
  
  .add-member-form { grid-template-columns: 1fr; }
  .stats-cards { flex-direction: column; }
  .member-table-header { display: none; }
  .member-table-row {
    grid-template-columns: 1fr;
    gap: 8px;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 12px;
    border: 1px solid var(--border-color);
  }
  .member-table-row:last-child { margin-bottom: 12px; }
  .row-actions { margin-top: 8px; justify-content: flex-end; }
  .console-actions { flex-direction: column; align-items: flex-start; }
  .modal-grid { grid-template-columns: 1fr; }
  .flow-grid,
  .reason-grid,
  .stack-grid {
    grid-template-columns: 1fr;
  }
  .about-hero {
    padding: 20px;
  }
}
