* { box-sizing: border-box; }
:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --success: #3fb950;
  --danger: #f85149;
  --radius: 8px;
}
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
}
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
header h1 { margin: 0; font-size: 1.5rem; }
.subtitle { color: var(--muted); margin: 0.25rem 0 0; font-size: 0.9rem; }

.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.toolbar input, .toolbar select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}
.toolbar input[type="text"]:first-of-type { flex: 1; min-width: 200px; }
.toolbar button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
}
.toolbar button:hover { opacity: 0.9; }

main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  min-height: 400px;
}
@media (max-width: 768px) {
  main { grid-template-columns: 1fr; }
}

.list-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.list-panel ul { list-style: none; margin: 0; padding: 0; }
.list-panel li {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.list-panel li:hover { background: rgba(88, 166, 255, 0.1); }
.list-panel li.active { background: rgba(88, 166, 255, 0.2); border-left: 3px solid var(--accent); }
.list-panel li:last-child { border-bottom: none; }
.list-panel .muted { color: var(--muted); font-size: 0.8rem; }

.detail-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
}
#emptyState {
  color: var(--muted);
  text-align: center;
  padding: 3rem;
}
.hidden { display: none !important; }

.detail-header { margin-bottom: 1rem; }
.detail-header h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.detail-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.detail-meta span { margin-right: 1rem; }
.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.detail-actions button {
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
}
.detail-actions button:hover { background: var(--border); }
.detail-actions button.danger { color: var(--danger); border-color: var(--danger); }
.detail-actions button.danger:hover { background: rgba(248, 81, 73, 0.15); }

#detailContent {
  white-space: pre-wrap;
  font-family: inherit;
  margin: 0;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 0.95rem;
  max-height: 400px;
  overflow-y: auto;
}

form label { display: block; margin: 0.5rem 0 0.25rem; font-size: 0.9rem; color: var(--muted); }
form input, form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}
form textarea { resize: vertical; font-family: inherit; }
.form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}
.form-actions button {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
}
.form-actions button[type="submit"] {
  background: var(--success);
  color: #fff;
  border: none;
}
.form-actions button[type="button"] {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1000;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
