:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --danger: #ef4444;
  --success: #22c55e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

header h1 { margin: 0; font-size: 1.4rem; }
header h1 a { color: var(--accent); text-decoration: none; }
nav { display: flex; gap: 1rem; }
nav button, nav a {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
}
nav button:hover, nav a:hover { color: var(--text); background: var(--panel); }

main {
  flex: 1;
  padding: 2rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

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

h2 { margin-top: 0; }

input, button {
  font-family: inherit;
  font-size: 1rem;
}

input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  margin-bottom: 0.8rem;
}

input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button.primary {
  background: var(--accent);
  color: var(--bg);
  border: 0;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { background: var(--accent-hover); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}
button.ghost:hover { color: var(--text); border-color: var(--text); }

button.danger {
  background: transparent;
  color: var(--danger);
  border: 0;
  cursor: pointer;
  font-size: 0.9rem;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--danger); margin-top: 0.5rem; }
.success { color: var(--success); margin-top: 0.5rem; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
th { color: var(--muted); font-weight: 500; }
td a { color: var(--accent); }

.row { display: flex; gap: 0.5rem; align-items: center; }

canvas { background: var(--bg); border-radius: 6px; padding: 0.5rem; }
