/* ══════════════════════════════
   ADMIN PANEL
══════════════════════════════ */
.adm-auth,
.adm-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(2,4,10,0.93); backdrop-filter: blur(28px);
  align-items: center; justify-content: center; padding: 1rem;
}
.adm-auth.active, .adm-overlay.active { display: flex; animation: admFadeIn 0.2s ease; }
@keyframes admFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes admSlideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

.adm-auth-card {
  background: #060a18; border: 1px solid rgba(240,180,41,0.18);
  border-radius: 18px; padding: 2.5rem 2rem; width: 100%; max-width: 340px;
  text-align: center; box-shadow: 0 40px 100px rgba(0,0,0,0.85);
  animation: admSlideUp 0.3s ease;
}
.adm-auth-logo {
  width: 54px; height: 54px; background: rgba(240,180,41,0.08);
  border: 1px solid rgba(240,180,41,0.18); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem;
}
.adm-auth-title { font-size: 1.15rem; font-weight: 800; color: #f1f5f9; margin-bottom: 0.3rem; }
.adm-auth-sub { color: #475569; font-size: 0.78rem; margin-bottom: 1.5rem; }
.adm-auth-field {
  display: flex; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07); border-radius: 8px;
  overflow: hidden; margin-bottom: 0.65rem; transition: border-color 0.2s;
}
.adm-auth-field:focus-within { border-color: rgba(240,180,41,0.4); }
.adm-auth-field input {
  flex: 1; background: none; border: none; padding: 0.75rem 1rem;
  color: #f1f5f9; font-size: 0.9rem; outline: none;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.1em;
}
.adm-auth-field button {
  background: rgba(240,180,41,0.08); border: none;
  border-left: 1px solid rgba(255,255,255,0.06); color: #f0b429;
  cursor: pointer; padding: 0 1rem; display: flex; align-items: center;
  transition: background 0.2s;
}
.adm-auth-field button:hover { background: rgba(240,180,41,0.18); }
.adm-auth-err { color: #f87171; font-size: 0.73rem; min-height: 1rem; margin-bottom: 0.4rem; }
.adm-auth-dismiss {
  background: none; border: none; color: #334155;
  font-size: 0.76rem; cursor: pointer; margin-top: 0.4rem; transition: color 0.2s;
}
.adm-auth-dismiss:hover { color: #94a3b8; }

.adm-panel {
  background: #04070f; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px; width: 100%; max-width: 920px;
  height: min(590px, 90vh); display: flex;
  box-shadow: 0 60px 120px rgba(0,0,0,0.92), 0 0 0 1px rgba(240,180,41,0.04);
  overflow: hidden; animation: admSlideUp 0.3s ease;
}

.adm-sidebar {
  width: 210px; flex-shrink: 0; background: rgba(3,5,12,0.85);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex; flex-direction: column; padding: 1.5rem 0 1rem;
}
.adm-brand {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0 1.2rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 0.75rem;
}
.adm-brand-text span {
  display: block; font-size: 0.6rem; color: #334155;
  text-transform: uppercase; letter-spacing: 0.16em; font-family: 'JetBrains Mono', monospace;
}
.adm-brand-text strong { font-size: 0.8rem; color: #e2e8f0; font-weight: 700; }
.adm-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0.65rem; flex: 1; }
.adm-nav-btn {
  display: flex; align-items: center; gap: 0.6rem; background: none; border: none;
  color: #475569; font-size: 0.77rem; font-weight: 500; padding: 0.6rem 0.7rem;
  border-radius: 8px; cursor: pointer; text-align: left; width: 100%;
  transition: all 0.18s; font-family: 'Poppins', sans-serif;
}
.adm-nav-btn svg { flex-shrink: 0; opacity: 0.55; transition: opacity 0.18s; stroke: currentColor; fill: none; }
.adm-nav-btn:hover { background: rgba(255,255,255,0.04); color: #cbd5e1; }
.adm-nav-btn:hover svg { opacity: 0.85; }
.adm-nav-btn.active {
  background: rgba(240,180,41,0.07); color: #f0b429;
  border: 1px solid rgba(240,180,41,0.12);
}
.adm-nav-btn.active svg { opacity: 1; }
.adm-sidebar-footer { padding: 0.65rem 0.65rem 0; }
.adm-logout-btn {
  display: flex; align-items: center; gap: 0.55rem; background: none;
  border: 1px solid rgba(255,255,255,0.06); color: #334155;
  font-size: 0.73rem; padding: 0.5rem 0.7rem; border-radius: 7px;
  cursor: pointer; width: 100%; transition: all 0.18s; font-family: 'Poppins', sans-serif;
}
.adm-logout-btn svg { stroke: currentColor; fill: none; }
.adm-logout-btn:hover { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.2); color: #f87171; }

.adm-main {
  flex: 1; overflow-y: auto; padding: 1.75rem 2rem;
  scrollbar-width: thin; scrollbar-color: rgba(240,180,41,0.15) transparent;
}
.adm-main::-webkit-scrollbar { width: 3px; }
.adm-main::-webkit-scrollbar-thumb { background: rgba(240,180,41,0.2); border-radius: 2px; }

.adm-tab { display: none; }
.adm-tab.active { display: block; }
.adm-tab-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.5rem;
}
.adm-tab-head h2 { font-size: 1.05rem; font-weight: 800; color: #f1f5f9; letter-spacing: -0.02em; margin-bottom: 0.18rem; }
.adm-tab-head p { color: #334155; font-size: 0.75rem; }
.adm-version-badge {
  background: rgba(240,180,41,0.07); border: 1px solid rgba(240,180,41,0.18);
  color: #f0b429; font-size: 0.6rem; font-weight: 700;
  padding: 0.18rem 0.55rem; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.08em; white-space: nowrap;
}

.adm-stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 0.65rem; margin-bottom: 1rem; }
.adm-stat {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px; padding: 0.9rem; display: flex; align-items: center; gap: 0.8rem;
  transition: border-color 0.2s;
}
.adm-stat:hover { border-color: rgba(240,180,41,0.14); }
.adm-stat-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.adm-stat-icon svg { stroke: currentColor; fill: none; }
.adm-stat-icon.pages    { background: rgba(240,180,41,0.1);  color: #f0b429; }
.adm-stat-icon.products { background: rgba(124,58,237,0.1);  color: #a78bfa; }
.adm-stat-icon.partners { background: rgba(6,182,212,0.1);   color: #22d3ee; }
.adm-stat-icon.ebooks   { background: rgba(16,185,129,0.1);  color: #34d399; }
.adm-stat-num { display: block; font-size: 1.35rem; font-weight: 800; color: #f1f5f9; line-height: 1; margin-bottom: 0.12rem; font-family: 'JetBrains Mono', monospace; }
.adm-stat-lbl { font-size: 0.62rem; color: #334155; text-transform: uppercase; letter-spacing: 0.1em; }

.adm-info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.55rem; }
.adm-info-item { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; padding: 0.7rem 0.9rem; }
.adm-info-key { display: block; font-size: 0.58rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: #334155; margin-bottom: 0.22rem; font-family: 'JetBrains Mono', monospace; }
.adm-info-val { font-size: 0.78rem; font-weight: 600; color: #64748b; font-family: 'JetBrains Mono', monospace; }
.adm-status-live { color: #34d399; }

.adm-pages-list { display: flex; flex-direction: column; gap: 0.45rem; }
.adm-page-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px; padding: 0.85rem 1rem; text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.adm-page-row:hover { background: rgba(240,180,41,0.03); border-color: rgba(240,180,41,0.14); }
.adm-page-info { display: flex; align-items: center; gap: 0.8rem; }
.adm-page-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.adm-page-dot.home     { background: #f0b429; box-shadow: 0 0 6px #f0b429; }
.adm-page-dot.about    { background: #a78bfa; box-shadow: 0 0 6px #a78bfa; }
.adm-page-dot.store    { background: #34d399; box-shadow: 0 0 6px #34d399; }
.adm-page-dot.ebooks   { background: #22d3ee; box-shadow: 0 0 6px #22d3ee; }
.adm-page-dot.partners { background: #f97316; box-shadow: 0 0 6px #f97316; }
.adm-page-dot.blog     { background: #e879f9; box-shadow: 0 0 6px #e879f9; }
.adm-page-dot.contact  { background: #94a3b8; box-shadow: 0 0 6px #94a3b8; }
.adm-page-info strong { display: block; font-size: 0.82rem; color: #e2e8f0; font-weight: 600; margin-bottom: 0.08rem; }
.adm-page-info span { font-size: 0.68rem; color: #334155; font-family: 'JetBrains Mono', monospace; }
.adm-page-actions { display: flex; align-items: center; gap: 0.7rem; }
.adm-page-badge { background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.18); color: #34d399; font-size: 0.58rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 3px; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.08em; }
.adm-page-actions svg { color: #334155; stroke: currentColor; fill: none; transition: color 0.2s; }
.adm-page-row:hover .adm-page-actions svg { color: #f0b429; }

.adm-settings-list { display: flex; flex-direction: column; gap: 0.55rem; }
.adm-setting-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 10px; padding: 1rem 1.2rem; }
.adm-setting-info strong { display: block; font-size: 0.82rem; color: #e2e8f0; margin-bottom: 0.12rem; }
.adm-setting-info span { font-size: 0.72rem; color: #334155; }
.adm-toggle { width: 42px; height: 23px; border-radius: 100px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.09); cursor: pointer; position: relative; flex-shrink: 0; transition: background 0.25s, border-color 0.25s; }
.adm-toggle.on { background: rgba(240,180,41,0.22); border-color: rgba(240,180,41,0.38); }
.adm-toggle-thumb { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #334155; transition: transform 0.25s, background 0.25s; }
.adm-toggle.on .adm-toggle-thumb { transform: translateX(19px); background: #f0b429; }
.adm-btn-sm { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); color: #64748b; font-size: 0.7rem; font-weight: 600; padding: 0.38rem 0.8rem; border-radius: 6px; cursor: pointer; font-family: 'Poppins', sans-serif; transition: all 0.18s; white-space: nowrap; }
.adm-btn-sm:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.adm-btn-sm.danger { color: #ef4444; border-color: rgba(239,68,68,0.18); }
.adm-btn-sm.danger:hover { background: rgba(239,68,68,0.07); }
.adm-change-pass { display: flex; gap: 0.55rem; margin-top: 0.85rem; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 10px; padding: 0.9rem; }
.adm-change-pass input { flex: 1; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 0.42rem 0.75rem; color: #f1f5f9; font-size: 0.82rem; font-family: 'JetBrains Mono', monospace; outline: none; }
.adm-change-pass input:focus { border-color: rgba(240,180,41,0.35); }

.adm-notes-area { width: 100%; min-height: 340px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 1.1rem 1.2rem; color: #94a3b8; font-size: 0.84rem; font-family: 'JetBrains Mono', monospace; line-height: 1.75; resize: none; outline: none; transition: border-color 0.2s; }
.adm-notes-area:focus { border-color: rgba(240,180,41,0.22); }
.adm-notes-area::placeholder { color: #1e293b; }

.adm-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding-top: 0.5rem; }
.adm-qr-box { background: #ffffff; border-radius: 14px; padding: 18px; display: inline-block; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
.adm-qr-box canvas, .adm-qr-box img { display: block; }
.adm-qr-meta { text-align: center; }
.adm-qr-url { font-size: 1rem; font-weight: 700; color: #f0b429; margin-bottom: 0.4rem; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; }
.adm-qr-hint { font-size: 0.74rem; color: #334155; }

@media (max-width: 640px) {
  .adm-panel { flex-direction: column; border-radius: 14px; height: 92vh; }
  .adm-sidebar { width: 100%; padding: 0.75rem; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .adm-brand { display: none; }
  .adm-nav { flex-direction: row; gap: 3px; padding: 0; }
  .adm-nav-btn { padding: 0.45rem 0.6rem; font-size: 0.68rem; justify-content: center; }
  .adm-nav-btn svg { display: none; }
  .adm-sidebar-footer { padding: 0; }
  .adm-logout-btn { justify-content: center; }
  .adm-stat-grid { grid-template-columns: repeat(2,1fr); }
  .adm-info-grid { grid-template-columns: repeat(2,1fr); }
  .adm-main { padding: 1.25rem; }
}
