:root {
  --bg: #0b0d10;
  --panel: #14181d;
  --panel-2: #1b2026;
  --border: #262c33;
  --text: #e6e8eb;
  --muted: #8a929b;
  --accent: #6ea8fe;
  --accent-2: #4d7fd6;
  --danger: #ef4444;
  --ok: #22c55e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.nav h1 { font-size: 16px; margin: 0; letter-spacing: 0.4px; }
.nav .links a { margin-right: 18px; color: var(--muted); }
.nav .links a.active { color: var(--text); font-weight: 600; }
.nav button.logout {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.nav button.logout:hover { color: var(--text); border-color: var(--text); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

h2 { margin: 0 0 6px; font-size: 22px; }
.subtitle { color: var(--muted); margin: 0 0 24px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.profile-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.profile-card:hover { border-color: var(--accent-2); }
.profile-card .avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--panel-2);
  background-size: cover;
  background-position: center;
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.profile-card .name { font-weight: 600; }
.profile-card .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }

.btn {
  background: var(--accent);
  color: #0b0d10;
  border: 0;
  padding: 9px 16px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: var(--accent-2); color: #fff; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--border); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.1); }

.row { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 520px;
  max-width: 92vw;
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
}
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty h3 { color: var(--text); margin: 0 0 6px; }

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  display: none;
  z-index: 200;
}
.toast.show { display: block; }
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--danger); }

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  width: 380px;
  max-width: 92vw;
}
.login h1 { margin: 0 0 6px; font-size: 22px; }
.login p { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

.image-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--panel-2);
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.muted { color: var(--muted); font-size: 13px; }
