/* Betslip Builder — Minimal Dark Theme */
:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #242836;
  --fg: #e1e4eb;
  --fg2: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --border: #2d3148;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: var(--fg2);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background 0.15s;
}
.nav-links a:hover { background: var(--bg3); color: var(--fg); }
.nav-links a.active { background: var(--accent); color: #fff; }
.nav-logout { color: var(--red) !important; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-success { background: #052e16; border: 1px solid #166534; color: #86efac; }
.alert-error { background: #450a0a; border: 1px solid #991b1b; color: #fca5a5; }
.alert-info { background: #1e3a5f; border: 1px solid #1e40af; color: #93c5fd; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3);
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--border); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

/* Forms */
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
legend {
  font-weight: 600;
  padding: 0 8px;
  color: var(--accent);
}
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--fg2);
  margin-bottom: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 0.9rem;
  font-family: inherit;
}
.form-group textarea { resize: vertical; font-family: monospace; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

/* Checkbox grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.checkbox-label:hover { background: var(--bg3); }
.checkbox-label input[type="checkbox"] { width: auto; }

/* Stats */
.stats-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
  flex: 1;
  min-width: 160px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--fg2); margin-top: 4px; }

/* Quick actions */
.quick-actions { display: flex; gap: 12px; margin-bottom: 24px; }

/* Slips grid */
.slips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.slip-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.slip-panel h2 { font-size: 1rem; margin-bottom: 12px; color: var(--fg2); }
.slip-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 0.78rem;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.empty { color: var(--fg2); font-style: italic; }

/* Table */
.slips-table {
  width: 100%;
  border-collapse: collapse;
}
.slips-table th,
.slips-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.slips-table th { color: var(--fg2); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.slips-table tr:hover { background: var(--bg2); }
.filename { font-family: monospace; font-size: 0.82rem; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-daily { background: #1e3a5f; color: #93c5fd; }
.badge-weekly { background: #3b0764; color: #d8b4fe; }
.badge-safe { background: #052e16; color: #86efac; }
.badge-betpawa { background: #713f12; color: #fde68a; }
.badge-odds-target { background: #450a0a; color: #fca5a5; }

/* Filter bar */
.filter-bar { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg2);
  color: var(--fg2);
  text-decoration: none;
  font-size: 0.82rem;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--fg); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Slip detail */
.slip-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.slip-header h1 { font-size: 1.2rem; }
.slip-detail {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.slip-detail pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  line-height: 1.7;
}

/* Generated slip */
.generated-slip {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.generated-slip h2 { font-size: 1.1rem; margin-bottom: 8px; }
.slip-stats { display: flex; gap: 20px; margin-bottom: 16px; font-size: 0.9rem; color: var(--fg2); }
.slip-stats span { font-weight: 600; }
.slip-selections { width: 100%; border-collapse: collapse; }
.slip-selections th,
.slip-selections td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.slip-selections th { color: var(--fg2); font-size: 0.78rem; text-transform: uppercase; }

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 360px;
  text-align: center;
}
.login-card h1 { color: var(--accent); margin-bottom: 8px; }
.login-card p { color: var(--fg2); margin-bottom: 20px; font-size: 0.9rem; }
.login-card input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 1rem;
  margin-bottom: 16px;
}
.login-card button {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.login-card button:hover { background: var(--accent-hover); }

/* Secrets fieldset */
.secrets-fieldset {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.04);
}
.secrets-fieldset legend { color: var(--red); }
.secrets-note {
  font-size: 0.82rem;
  color: var(--fg2);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.secrets-note code { color: var(--red); font-weight: 600; }
