/* ============================================================
   ADMIN PANEL — content manager styles
   ============================================================ */
@import url("style.css");

.admin-body { display: block; }

/* Login gate */
.gate {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative;
}
.gate .mesh { position: fixed; }
.gate-card {
  position: relative; z-index: 2; width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 44px 38px; box-shadow: 0 40px 90px rgba(0,0,0,0.55);
}
.gate-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.6rem;
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.gate-sub { color: var(--txt-mut); font-family: var(--font-mono); font-size: 0.82rem; margin-bottom: 30px; }
.gate-hint { color: var(--txt-mut); font-size: 0.8rem; margin-top: 16px; text-align: center; }

/* Layout */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line-soft); background: var(--bg-soft);
  padding: 26px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { font-size: 1.15rem; margin-bottom: 4px; }
.side .side-sub { font-family: var(--font-mono); font-size: 0.72rem; color: var(--txt-mut); margin-bottom: 30px; padding-left: 20px; }
.nav-tab {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: transparent; color: var(--txt-dim); font-family: var(--font-body);
  font-size: 0.96rem; text-align: left; transition: all 0.2s var(--ease); margin-bottom: 4px;
}
.nav-tab svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-tab:hover { background: var(--surface); color: var(--txt); }
.nav-tab.active { background: var(--accent); color: #0b0c0e; font-weight: 600; }
.side-foot { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; }
.side-foot a, .side-foot button {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--txt-dim);
  background: none; border: 0; cursor: pointer; text-align: left; padding: 8px 16px;
  border-radius: var(--r-sm); transition: color 0.2s, background 0.2s; display: flex; align-items: center; gap: 10px;
}
.side-foot a:hover, .side-foot button:hover { color: var(--accent); background: var(--surface); }

.main { padding: 40px 48px; max-width: 920px; }
.page-head { margin-bottom: 32px; }
.page-head h1 { font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.02em; }
.page-head p { color: var(--txt-mut); margin-top: 4px; }

.panel { display: none; }
.panel.active { display: block; animation: fade 0.4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Forms */
.field { margin-bottom: 20px; }
.field label {
  display: block; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--txt-dim); margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; color: var(--txt); font-family: var(--font-body); font-size: 0.98rem;
  transition: border-color 0.2s, box-shadow 0.2s; resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,196,81,0.14);
}
.field textarea { min-height: 96px; line-height: 1.55; }
.field .hint { font-size: 0.78rem; color: var(--txt-mut); margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Buttons */
.b {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
  padding: 11px 20px; border-radius: 100px; border: 1px solid transparent; transition: all 0.25s var(--ease);
}
.b-primary { background: var(--grad-accent); color: #0b0c0e; }
.b-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--accent-glow); }
.b-ghost { background: transparent; border-color: var(--line); color: var(--txt); }
.b-ghost:hover { border-color: var(--accent); color: var(--accent); }
.b-danger { background: transparent; border-color: rgba(255,90,90,0.4); color: #ff6b6b; }
.b-danger:hover { background: rgba(255,90,90,0.12); }
.b-sm { padding: 7px 13px; font-size: 0.82rem; }
.b svg { width: 16px; height: 16px; }
.actions-bar { display: flex; gap: 12px; margin-top: 26px; align-items: center; flex-wrap: wrap; }

/* Item list (CRUD) */
.list { display: grid; gap: 14px; margin-bottom: 24px; }
.item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px 20px; display: flex; align-items: center; gap: 16px;
}
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 1.02rem; }
.item-meta { color: var(--txt-mut); font-size: 0.85rem; margin-top: 3px; font-family: var(--font-mono); }
.item-acts { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); color: var(--txt-dim); cursor: pointer; display: grid; place-items: center;
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.del:hover { color: #ff6b6b; border-color: rgba(255,90,90,0.5); }
.icon-btn svg { width: 16px; height: 16px; }
.empty { color: var(--txt-mut); font-style: italic; padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-md); }

/* Image upload */
.img-uploader { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.img-preview {
  width: 150px; height: 180px; border-radius: var(--r-md); object-fit: cover;
  border: 1px solid var(--line); background: var(--bg);
}
.uploader-ctrls { flex: 1; min-width: 220px; }
input[type="file"] { display: none; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000; background: rgba(5,6,8,0.78);
  backdrop-filter: blur(6px); display: none; align-items: flex-start; justify-content: center;
  padding: 50px 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px; box-shadow: 0 40px 90px rgba(0,0,0,0.6);
  animation: fade 0.3s var(--ease);
}
.modal h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin-bottom: 22px; }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(120px);
  background: var(--accent); color: #0b0c0e; font-weight: 600; padding: 14px 24px;
  border-radius: 100px; z-index: 3000; box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  transition: transform 0.4s var(--ease); font-size: 0.95rem;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: #ff6b6b; color: #fff; }

@media (max-width: 760px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 6px; }
  .side .brand, .side .side-sub { width: 100%; }
  .nav-tab { width: auto; }
  .side-foot { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .main { padding: 28px 20px; }
  .row2 { grid-template-columns: 1fr; }
}
