:root {
  --bg: #ffffff;
  --bg-alt: #f6f5f4;
  --text: #1f1f1f;
  --text-muted: #6b6b6b;
  --border: #e3e2e0;
  --accent: #2563eb;
  --danger: #c0392b;
  --radius: 6px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg-alt);
  color: var(--text);
  line-height: 1.55;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
  flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.topbar nav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.topbar nav a { color: var(--text-muted); font-size: 0.92rem; }
.topbar .spacer { flex: 1; }
.topbar .search input {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
}
.topbar .user { color: var(--text-muted); font-size: 0.9rem; }
.topbar .logout { font-size: 0.9rem; }

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

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

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.9rem; }
.grid a.tile {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text);
}
.grid a.tile:hover { border-color: var(--accent); text-decoration: none; }
.grid a.tile .count { color: var(--text-muted); font-size: 0.85rem; }

table.list, table.props {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
}
table.list th, table.list td, table.props th, table.props td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
table.list th { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
table.props th { width: 180px; color: var(--text-muted); font-weight: 600; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-size: 0.92rem;
}
.btn:hover { opacity: 0.92; text-decoration: none; }
.btn.secondary { background: var(--bg-alt); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }

.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-row input[type=text], .form-row input[type=url], .form-row input[type=password],
.form-row textarea, .form-row select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}
.form-row textarea { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.kv-row { display: flex; gap: 0.5rem; margin-bottom: 0.4rem; }
.kv-row input { flex: 1; }

.content h1, .content h2, .content h3 { margin-top: 1.4em; }
.content pre { background: #1e1e1e; color: #eee; padding: 0.9rem; border-radius: var(--radius); overflow-x: auto; }
.content code { background: var(--bg-alt); padding: 0.1em 0.35em; border-radius: 4px; }
.content pre code { background: none; padding: 0; }
.content blockquote { border-left: 3px solid var(--accent); margin: 0.8em 0; padding: 0.2em 1em; color: var(--text-muted); }
.content img { max-width: 100%; border-radius: var(--radius); }
.content table { border-collapse: collapse; width: 100%; margin: 0.8em 0; }
.content table th, .content table td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; }

.breadcrumbs { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1rem; }
.muted { color: var(--text-muted); }
.actions { display: flex; gap: 0.6rem; margin: 1rem 0; }
.flash { background: #fef6e0; border: 1px solid #e8d78a; padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash.error { background: #fdecea; border-color: #f3b0ab; }

.login-wrap { max-width: 360px; margin: 4rem auto; }
.login-wrap h1 { text-align: center; font-size: 1.3rem; }
