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

:root {
  --primary: #1a365d;
  --primary-light: #2b6cb0;
  --accent: #dd6b20;
  --bg: #f7fafc;
  --card-bg: #ffffff;
  --text: #2d3748;
  --text-light: #718096;
  --border: #e2e8f0;
  --success: #38a169;
  --danger: #e53e3e;
  --warning: #d69e2e;
  --radius: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.navbar {
  background: var(--primary);
  color: white;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.nav-brand { color: white; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.nav-links { display: flex; gap: 1rem; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.9rem; }
.nav-links a:hover { color: white; }

main { flex: 1; padding: 1.5rem 0; }

h1 { font-size: 1.8rem; margin-bottom: 1rem; color: var(--primary); }
h2 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; color: var(--primary); }
h3 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }

a { color: var(--primary-light); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(43,108,176,0.2);
}
.form-inline { display: flex; gap: 0.5rem; align-items: end; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--primary); color: white; font-weight: 600; position: sticky; top: 0; }
tr:hover { background: #f0f4f8; }
tr.dq { background: #fff5f5; color: var(--danger); }
tr.ineligible { opacity: 0.6; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: #c6f6d5; color: #22543d; }
.badge-danger { background: #fed7d7; color: #822727; }
.badge-warning { background: #fefcbf; color: #744210; }
.badge-info { background: #bee3f8; color: #2a4365; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.alert-error { background: #fed7d7; color: #822727; border: 1px solid #feb2b2; }
.alert-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.alert-info { background: #bee3f8; color: #2a4365; border: 1px solid #90cdf4; }

.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9rem;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  color: var(--text-light);
}
.tab.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.tab:hover { color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-light); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.footer { background: var(--primary); color: rgba(255,255,255,0.7); padding: 1rem 0; text-align: center; font-size: 0.85rem; margin-top: 2rem; }

.locked-badge { background: var(--danger); color: white; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.8rem; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.4rem 0.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
