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

:root {
  --navy: #1a2332;
  --navy-light: #243044;
  --green: #2ecc71;
  --green-dark: #27ae60;
  --red: #e74c3c;
  --yellow: #f39c12;
  --gray: #95a5a6;
  --gray-light: #ecf0f1;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --white: #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f4f6f9;
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 6px;
}

.sidebar-team {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.sidebar-record {
  display: inline-flex;
  gap: 8px;
}

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-win { background: rgba(46,204,113,0.2); color: var(--green); }
.badge-loss { background: rgba(231,76,60,0.2); color: #e74c3c; }
.badge-season { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.nav-item.active { border-left: 3px solid var(--green); }

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.refresh-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}

.gc-input-group {
  display: flex;
  gap: 6px;
}

.gc-input {
  flex: 1;
  padding: 8px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: var(--white);
  font-size: 14px;
  letter-spacing: 2px;
  min-width: 0;
}

.gc-input::placeholder { color: rgba(255,255,255,0.3); letter-spacing: 0; }

.gc-input:focus {
  outline: none;
  border-color: var(--green);
  background: rgba(255,255,255,0.12);
}

.btn-submit-code {
  padding: 8px 12px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-submit-code:hover { background: var(--green-dark); }

.gc-hint {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  line-height: 1.5;
}

.code-success {
  margin-top: 6px;
  font-size: 12px;
  color: var(--green);
  display: none;
}

/* MAIN CONTENT */
.main {
  flex: 1;
  min-width: 0;
  padding: 32px;
  overflow-y: auto;
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-light);
  font-size: 14px;
}

/* SECTION */
.section { margin-bottom: 32px; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

/* GAME CARDS */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.game-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.15s;
}

.game-card:hover { box-shadow: var(--shadow-hover); }

.game-date-block {
  text-align: center;
  min-width: 44px;
}

.game-month {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}

.game-day-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.game-dow {
  font-size: 10px;
  color: var(--text-light);
  text-transform: uppercase;
}

.game-divider {
  width: 1px;
  height: 48px;
  background: #e0e0e0;
  flex-shrink: 0;
}

.game-info { flex: 1; min-width: 0; }

.game-location {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 2px;
}

.game-opponent {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-time {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.game-result {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}

.result-w { color: var(--green-dark); }
.result-l { color: var(--red); }

.game-actions { flex-shrink: 0; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-scout {
  background: var(--green);
  color: white;
}
.btn-scout:hover { background: var(--green-dark); }

.btn-request {
  background: var(--gray-light);
  color: var(--text-light);
}

.btn-next-game {
  background: var(--navy);
  color: white;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  display: block;
  text-align: center;
}

/* REPORTS PAGE */
.report-header {
  background: var(--navy);
  color: white;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.report-team-name {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.report-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}

.report-meta span { display: flex; align-items: center; gap: 5px; }

.threat-summary {
  background: #fff8e1;
  border-left: 4px solid var(--yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.6;
  color: #7d5a00;
}

/* TABLES */
.table-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-light);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table th {
  background: #f8f9fa;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  border-bottom: 1px solid #e8e8e8;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

table.data-table th:hover { background: #f0f2f5; }

table.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

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

.threat-high { background: rgba(231,76,60,0.06); }
.threat-medium { background: rgba(243,156,18,0.06); }
.threat-low { background: rgba(149,165,166,0.04); }

.threat-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.threat-badge-HIGH { background: rgba(231,76,60,0.15); color: #c0392b; }
.threat-badge-MEDIUM { background: rgba(243,156,18,0.15); color: #d68910; }
.threat-badge-LOW { background: rgba(149,165,166,0.15); color: #7f8c8d; }

.avg-cell { font-weight: 700; font-family: monospace; font-size: 14px; }
.avg-high { color: #c0392b; }
.avg-medium { color: #d68910; }

.position-pill {
  display: inline-block;
  background: #eef0f3;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  color: #5d6d7e;
  margin-right: 2px;
}

.sb-badge {
  display: inline-block;
  background: #e8f8f0;
  color: #1a7a45;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 600;
}

.notes-cell {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  max-width: 280px;
}

/* PITCHER CARDS */
.pitcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.pitcher-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.pitcher-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.pitcher-role {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 14px;
}

.pitcher-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.pitcher-stat-item { text-align: center; }

.pitcher-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.era-bad { color: var(--red); }

.pitcher-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.pitcher-notes {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  padding-top: 12px;
  border-top: 1px solid var(--gray-light);
}

/* BASERUNNING */
.br-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}

.br-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}

.br-stat { text-align: center; }
.br-stat-value { font-size: 28px; font-weight: 800; color: var(--navy); }
.br-stat-label { font-size: 11px; text-transform: uppercase; color: var(--text-light); }

.br-threats { margin-bottom: 14px; }
.br-threat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
}

.br-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.br-notes {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
}

/* COACHING NOTES */
.coaching-notes {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}

.coaching-note {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  line-height: 1.6;
}

.coaching-note:last-child { border-bottom: none; }

.note-num {
  width: 24px;
  height: 24px;
  background: var(--navy);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* GAME LOG */
.game-log {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.game-log-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  text-align: center;
  min-width: 110px;
}

.game-log-opp { font-weight: 600; margin-bottom: 2px; }
.game-log-result { font-weight: 700; }
.game-log-result.w { color: var(--green-dark); }
.game-log-result.l { color: var(--red); }

/* FLOATING ACTION BAR */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 260px;
  right: 0;
  background: white;
  border-top: 1px solid #e0e0e0;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.action-bar .btn-back {
  color: var(--text-light);
  background: var(--gray-light);
}

.action-bar .spacer { flex: 1; }

.btn-print { background: #34495e; color: white; }
.btn-print:hover { background: #2c3e50; }
.btn-email { background: #3498db; color: white; }
.btn-email:hover { background: #2980b9; }
.btn-share { background: var(--green); color: white; }
.btn-share:hover { background: var(--green-dark); }

/* LOADING & EMPTY */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-light);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-light);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; min-height: auto; height: auto; position: static; }
  .main { padding: 16px; }
  .game-grid { grid-template-columns: 1fr; }
  .action-bar { left: 0; }
  .pitcher-grid { grid-template-columns: 1fr; }
}

/* ─── AUTH & NEW COMPONENTS ──────────────────────────────────────────────── */

/* Nav user display */
.nav-user {
  padding: 8px 20px 2px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Logout button */
.nav-logout {
  color: rgba(231,76,60,0.75) !important;
}
.nav-logout:hover {
  color: #e74c3c !important;
  background: rgba(231,76,60,0.08) !important;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.status-active  { background: rgba(46,204,113,0.15); color: #1a7a45; }
.status-injured { background: rgba(231,76,60,0.15);  color: #c0392b; }
.status-unavailable { background: rgba(243,156,18,0.15); color: #d68910; }

/* Lineup slot colors */
.lineup-slot-top    { border-left: 4px solid #2980b9; }
.lineup-slot-heart  { border-left: 4px solid #f39c12; }
.lineup-slot-bottom { border-left: 4px solid #95a5a6; }

/* Stat chips */
.stat-chip {
  display: inline-block;
  background: #f0f2f5;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #5d6d7e;
}

/* User & audit tables */
.user-table, .audit-table { font-size: 13px; }

/* Action badges for audit */
.action-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Temp password display */
.temp-password-box {
  background: #fff8e1;
  border: 2px solid #f39c12;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 12px 0;
}

/* Must-change badge */
.must-change-badge {
  display: inline-block;
  background: rgba(243,156,18,0.15);
  color: #d68910;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Danger button */
.btn-danger {
  background: #e74c3c;
  color: white;
}
.btn-danger:hover { background: #c0392b; }

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  padding: 24px 28px;
  min-width: 320px;
  max-width: 480px;
  width: 90%;
}

/* Login card (used in login/change-pw/etc pages) */
.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
}
