:root {
  --bg: #0a0a0c;
  --panel: #131318;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3f1ee;
  --muted: #a7a3a0;
  --accent: #ff2a3c;
  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(255, 42, 60, 0.18), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 500 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2 { font-family: var(--font-display); margin: 0; }
h1 { font-size: clamp(22px, 4vw, 30px); }
h2 { font-size: 17px; }
p { margin: 8px 0 0; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; }
b { color: var(--accent); }

/* ---------- login ---------- */
.login {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login__box {
  width: min(400px, 100%);
  background: linear-gradient(180deg, #15151b, #111116);
  border: 1px solid rgba(255, 42, 60, 0.35);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 0 50px rgba(255, 42, 60, 0.15), 0 30px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login__box p { margin: 0; }
.login__error { color: #ff7a84; font-size: 14px; }

/* ---------- layout ---------- */
.wrap { width: min(1100px, 100% - 32px); margin: 24px auto 60px; }
.head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.head__tools { display: flex; gap: 8px; flex-shrink: 0; }

.panel {
  background: linear-gradient(180deg, #15151b, #111116);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
}
.panel--form {
  border-color: rgba(255, 42, 60, 0.35);
  box-shadow: 0 0 30px rgba(255, 42, 60, 0.12);
}
.panel__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.panel__row .hint { margin: 0; }

/* ---------- form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  margin-top: 14px;
}
.fields { display: flex; flex-direction: column; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }

label, .label-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #dfdcd8;
  font-weight: 600;
  font-size: 14px;
}
input[type="text"], input[type="password"], select {
  width: 100%;
  background: #0e0e12;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  height: 42px;
  padding: 0 12px;
  font: inherit;
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(255, 42, 60, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 42, 60, 0.2);
}

.photo-field { display: flex; flex-direction: column; gap: 10px; }
.photo-preview {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: #0e0e12;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; }
.file-btn input { display: none; }
.photo-field .hint { margin: 0; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font: 600 14px var(--font-body);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.35); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn--primary {
  border-color: rgba(255, 42, 60, 0.6);
  background: linear-gradient(135deg, #ff3b4c, #e6192c);
  box-shadow: 0 8px 24px rgba(255, 42, 60, 0.3);
}
.btn--primary:hover:not(:disabled) { box-shadow: 0 10px 30px rgba(255, 42, 60, 0.45); }
.btn--danger { border-color: rgba(255, 84, 84, 0.45); color: #ffd8d8; }
.btn--danger:hover:not(:disabled) { border-color: rgba(255, 84, 84, 0.9); }
.btn--full { width: 100%; }

/* ---------- cards list ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #121217;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.item--editing {
  border-color: rgba(255, 42, 60, 0.7);
  box-shadow: 0 0 24px rgba(255, 42, 60, 0.25);
}
.item__img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #0c0c10;
  display: block;
}
.item__meta { padding: 10px 11px 12px; }
.item__name { font-family: var(--font-display); font-size: 16px; }
.item__age { font-family: var(--font-body); color: var(--muted); font-weight: 500; }
.item__sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__tg { color: #dfdcd8; }
.item__tools {
  display: grid;
  grid-template-columns: 38px 38px 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.item__tools .btn { padding: 8px 6px; font-size: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1c1c22;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 10;
  max-width: calc(100% - 32px);
}
.toast--error { border-color: rgba(255, 42, 60, 0.7); color: #ffd8d8; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .form-grid { grid-template-columns: 1fr; }
  .photo-field { max-width: 300px; }
}
@media (max-width: 640px) {
  .wrap { width: min(1100px, 100% - 20px); margin-top: 14px; }
  .head { flex-direction: column; }
  .two { grid-template-columns: 1fr 100px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .item__tools { grid-template-columns: 34px 34px 1fr 1fr; gap: 4px; }
  .item__tools .btn { padding: 7px 4px; font-size: 11px; }
}
