/* Alpha Capitol Forward Testing Dashboard (Sprint 31)
   Plain, dependency-free CSS - no framework, no build step, per this
   sprint's own "do not add unnecessary complexity" instruction.
   Mobile-first: a single-column stat grid and stacked nav on narrow
   screens (iPhone Safari), widening into a multi-column layout above
   600px (tablet/desktop). */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1115;
  color: #e6e8eb;
  -webkit-text-size-adjust: 100%;
}

.hidden {
  display: none !important;
}

/* Login screen */

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 360px;
  background: #171a21;
  border: 1px solid #262b35;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
}

.login-box h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.subtitle {
  margin: 0 0 24px;
  color: #8a92a3;
  font-size: 14px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#login-form input {
  font-size: 16px; /* prevents iOS Safari auto-zoom on focus */
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #2b313d;
  background: #0f1115;
  color: #e6e8eb;
}

#login-form button {
  font-size: 16px;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #3d7eff;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

#login-form button:active {
  opacity: 0.85;
}

.error-text {
  color: #ff5c5c;
  font-size: 13px;
  min-height: 16px;
  margin: 4px 0 0;
}

/* Dashboard shell */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #1f232c;
  position: sticky;
  top: 0;
  background: #0f1115;
  z-index: 10;
}

.brand {
  font-weight: 700;
  font-size: 16px;
}

.logout-btn {
  background: transparent;
  border: 1px solid #2b313d;
  color: #8a92a3;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.tabs {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid #1f232c;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: #8a92a3;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: #1c2029;
  color: #ffffff;
  font-weight: 600;
}

.content {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page h2 {
  font-size: 15px;
  color: #8a92a3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 24px 0 12px;
}

.page h2:first-child {
  margin-top: 0;
}

/* Stat cards - single column on mobile, grid from 480px up */

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 700px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: #171a21;
  border: 1px solid #21252e;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 12px;
  color: #8a92a3;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
}

.stat-value.positive {
  color: #35d07f;
}

.stat-value.negative {
  color: #ff5c5c;
}

/* Tables - horizontal scroll on narrow screens rather than squeezing columns */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 480px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #1f232c;
  white-space: nowrap;
}

th {
  color: #8a92a3;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

.empty-note {
  color: #8a92a3;
  font-size: 14px;
  padding: 12px 0;
}

.chart-box {
  background: #171a21;
  border: 1px solid #21252e;
  border-radius: 10px;
  padding: 12px;
}

.chart-box svg {
  width: 100%;
  height: auto;
  display: block;
}

.refresh-note {
  text-align: center;
  color: #565d6b;
  font-size: 12px;
  padding: 16px;
}

/* AI Research summary (Sprint 32) */

.ai-summary-box {
  background: #171a21;
  border: 1px solid #21252e;
  border-radius: 10px;
  padding: 14px 16px;
}

.ai-line {
  font-size: 14px;
  margin: 0 0 8px;
  line-height: 1.5;
}

.ai-warning {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  color: #ffb454;
  margin: 0 0 8px;
  line-height: 1.5;
}

/* AI Desk panel (Sprint 33) */

#ai-desk-content .card-grid {
  margin-bottom: 12px;
}

.desk-decision {
  font-weight: 600;
  margin: 0;
}
