:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #1d9bf0;
  --accent-hover: #1a8cd8;
  --success: #00ba7c;
  --danger: #f4212e;
  --warning: #ffd400;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

header h1 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

header h1 span { color: var(--accent); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

nav {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}

nav button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.15s;
}

nav button:hover { background: var(--surface2); color: var(--text); }
nav button.active { background: var(--accent); color: #fff; }

main { padding: 24px; max-width: 1100px; margin: 0 auto; }

.panel { display: none; }
.panel.active { display: block; }

.alert-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 212, 0, 0.35);
  background: rgba(255, 212, 0, 0.08);
  color: var(--text);
  line-height: 1.5;
  white-space: pre-line;
}

.alert-banner a { color: var(--accent); }

.pin-panel {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
}

.pin-panel input {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card .label { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.card .value { font-size: 1.75rem; font-weight: 700; }
.card .sub { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.section h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

input, textarea, select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.9rem;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 100px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.toggle-row input[type="checkbox"] { width: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 500; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(0,186,124,0.15); color: var(--success); }
.badge-failed { background: rgba(244,33,46,0.15); color: var(--danger); }
.badge-skipped { background: rgba(255,212,0,0.15); color: var(--warning); }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.empty { color: var(--muted); text-align: center; padding: 32px; }

.auth-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.auth-card .auth-status .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.auth-card .auth-status .value {
  font-size: 1.3rem;
  font-weight: 600;
}

.auth-card .auth-status .sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

.char-count { text-align: right; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
