/* Админка: тёмная тема, минимализм, крупные поля. */

body.admin { background: #0e1122; }

.admin-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.admin-side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.admin-brand {
  color: var(--text);
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 15px;
}

.admin-brand span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 600;
  margin-top: 2px;
}

.admin-nav { display: flex; flex-direction: column; gap: 4px; }

.admin-nav a {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.admin-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.admin-logout { margin-top: auto; }

.admin-main {
  padding: 28px clamp(16px, 3vw, 40px) 64px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-head h1 { margin: 0 0 6px; font-size: 26px; }
.page-head .backlink { margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- панели ---------- */

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  margin-bottom: 18px;
}

.panel--empty { text-align: center; padding: 40px 20px; }

.panel__title {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.panel__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- таблица ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }

.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.cell-icon img { border-radius: 10px; display: block; object-fit: cover; }
.icon-empty { color: var(--muted); }
.cell-title a { color: var(--text); font-weight: 700; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cell-links { min-width: 260px; }
.cell-actions { text-align: right; white-space: nowrap; }

.mini-link { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.mini-link code {
  font-size: 12px;
  color: #b9c3e6;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 7px;
  border-radius: 6px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--ok { color: #0b2b18; background: #6ee7a0; }
.badge--draft { color: #3a2c00; background: #f3cf75; }

/* ---------- формы ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }

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

.field { display: flex; flex-direction: column; gap: 6px; }

.field--inline { max-width: 260px; }

.field__label { font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); }
.field__hint { font-size: 12px; color: var(--muted); line-height: 1.4; }
.field__hint code { color: #c9d2f2; }

.input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus { border-color: rgba(255, 207, 74, 0.55); box-shadow: 0 0 0 3px rgba(255, 207, 74, 0.12); }
.input--area { resize: vertical; min-height: 120px; line-height: 1.5; }
.input--small { max-width: 140px; }

select.input { appearance: none; }

.form__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

/* ---------- ссылки ---------- */

.linkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.linkrow:last-child { border-bottom: 0; }
.linkrow__label { width: 210px; color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.linkrow__value { font-size: 13px; color: #c9d2f2; word-break: break-all; flex: 1 1 240px; }
.linkrow__empty { color: #6b7391; font-size: 13px; }

/* ---------- медиа ---------- */

.icon-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.icon-preview { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; background: #0b0e1f; }
.icon-preview--empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }

.shots-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.shot-item { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0b0e1f; }
.shot-item img { display: block; width: 100%; height: auto; }
.shot-item .btn { position: absolute; right: 6px; bottom: 6px; }

/* ---------- заметки ---------- */

.note-add { display: flex; gap: 10px; margin-bottom: 14px; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.note__toggle { display: flex; }
.note__check {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #0b2b18;
  font-weight: 900;
  cursor: pointer;
}
.note--done .note__check { background: #6ee7a0; }
.note__text { flex: 1 1 auto; font-size: 14px; }
.note--done .note__text { color: var(--muted); text-decoration: line-through; }
.note__del { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.note__del:hover { color: #ff8b8f; }

/* ---------- сообщения ---------- */

.flash {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.flash--ok { background: rgba(110, 231, 160, 0.12); border-color: rgba(110, 231, 160, 0.3); color: #b8f5d3; }
.flash--error { background: rgba(255, 90, 95, 0.12); border-color: rgba(255, 90, 95, 0.35); color: #ffc2c4; }

/* ---------- тост ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: #232a52;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}

.toast--show { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: #4a1f2a; border-color: rgba(255, 90, 95, 0.4); }

/* ---------- вход ---------- */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login__card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login__brand { font-weight: 900; letter-spacing: 2px; color: var(--text); font-size: 15px; }
.login__brand span { color: var(--muted); letter-spacing: 3px; font-size: 11px; margin-left: 6px; }
.login__title { margin: 0; font-size: 22px; }
.login__hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.login__hint code { color: #c9d2f2; }

/* ---------- адаптив ---------- */

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .admin-brand { white-space: nowrap; }
  .admin-brand span { display: none; }
  .admin-nav { flex-direction: row; gap: 2px; }
  .admin-nav a { white-space: nowrap; padding: 8px 10px; }
  .admin-logout { margin: 0 0 0 auto; }
  .admin-main { padding: 18px 14px 48px; }
  .linkrow__label { width: 100%; }
}
