:root {
  --bg: #0f1720;
  --surface: #17222e;
  --surface-2: #1e2c3a;
  --line: #2b3d4f;
  --text: #e7edf3;
  --muted: #93a6b8;
  --accent: #4da3ff;
  --danger: #ff6b6b;
  --ok: #46d39a;
  --warn: #ffc857;
  --radius: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin-top: 1.8em; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.topbar nav {
  display: flex;
  gap: 1rem;
}

.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--text); }

.account {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card.narrow { max-width: 460px; margin: 2rem auto; }

label {
  display: block;
  margin: 0.8rem 0 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.2);
}

button {
  margin-top: 1rem;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: #06121f;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover { filter: brightness(1.1); }

button.linklike {
  margin: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font-weight: 400;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}

.tile:hover { border-color: var(--accent); text-decoration: none; }

.tile .value { font-size: 1.9rem; font-weight: 700; }
.tile .label { color: var(--muted); font-size: 0.9rem; }

.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.4rem 1rem;
  margin: 1rem 0;
}

.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv code.wrap { word-break: break-all; }

.muted { color: var(--muted); }
.error { color: var(--danger); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.messages li {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  margin-bottom: 0.5rem;
}

.messages li.error { border-left-color: var(--danger); }
.messages li.success { border-left-color: var(--ok); }

.notice {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 200, 87, 0.1);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
}

code { font-family: var(--mono); font-size: 0.9em; }

@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 0.6rem; }
  main { padding: 1.25rem 1rem 3rem; }
}

.show-password {
  display: block;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
  color: #444;
}
