@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg-primary: #0A0A0A;
  --bg-secondary: #111111;
  --bg-card: #141414;
  --bg-elevated: #181818;
  --border: #1F1F1F;
  --border-hover: #2A2A2A;
  --purple: #A855F7;
  --purple-light: #C084FC;
  --purple-dim: #7C3AED;
  --purple-glow: rgba(168, 85, 247, 0.15);
  --text-primary: #F0F0F0;
  --text-secondary: #9CA3AF;
  --text-dim: #6B7280;
  --green: #22C55E;
  --red: #EF4444;
  --yellow: #EAB308;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

.stars-canvas {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.login-card h1 {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-dim);
  font-size: 0.9em;
  margin-bottom: 28px;
}

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

.login-form input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 1em;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}

.login-form input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}

.login-form input::placeholder {
  color: var(--text-dim);
}

.error-msg {
  color: var(--red);
  font-size: 0.85em;
  margin-top: 12px;
  min-height: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 0.95em;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover { background: var(--purple-light); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--purple);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.9em;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-outline:hover {
  border-color: var(--purple);
  background: var(--purple-glow);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  color: var(--text-secondary);
  border: none;
  padding: 8px 14px;
  font-size: 0.85em;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85em;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all 0.2s;
  text-decoration: none;
}

.back-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.admin-header h1 {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--purple);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-body {
  display: flex;
  height: calc(100vh - 65px);
}

.admin-tabs {
  width: 200px;
  min-width: 200px;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  background: var(--bg-secondary);
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.9em;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  margin-bottom: 4px;
}

.admin-tab:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.admin-tab.active {
  background: var(--purple-glow);
  color: var(--purple);
  font-weight: 600;
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.panel-header {
  margin-bottom: 32px;
}

.panel-header h2 {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.panel-header p {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.stats-row {
  display: flex;
  gap: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  color: var(--text-secondary);
}

.stat-value {
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.green { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95em;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}

.form-input::placeholder {
  color: var(--text-dim);
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row .form-input {
  flex: 1;
}

.form-hint {
  font-size: 0.8em;
  color: var(--text-dim);
  margin-top: 6px;
  min-height: 18px;
}

.form-hint.success { color: var(--green); }
.form-hint.error { color: var(--red); }

.form-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.toggle-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.95em !important;
  color: var(--text-primary) !important;
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--purple);
  border-color: var(--purple);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: white;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 20px;
}

.settings-section h3 {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 20px;
}

.reports-table-container {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
}

.reports-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.reports-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9em;
  color: var(--text-secondary);
}

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

.reports-table tr:hover td {
  background: var(--bg-card);
}

.run-id-link {
  color: var(--purple);
  text-decoration: none;
  font-weight: 600;
  font-family: 'Inter', monospace;
}

.run-id-link:hover {
  color: var(--purple-light);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  font-weight: 500;
}

.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.completed::before { background: var(--green); }
.status-dot.completed { color: var(--green); }
.status-dot.pending::before { background: var(--yellow); }
.status-dot.pending { color: var(--yellow); }

.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon-sm:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 0.95em;
}

.admin-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s;
}

.admin-icon:hover {
  border-color: var(--purple);
  color: var(--purple);
  box-shadow: 0 0 20px var(--purple-glow);
}
