/* =========================================================
   admin.css — dashboard, sidebar, tables, forms
========================================================= */

:root {
  --bg-1: #0a0e1a;
  --bg-2: #131829;
  --panel: #10162a;
  --text-primary: #ffffff;
  --text-secondary: #93a2c0;
  --cyan: #00f0ff;
  --purple: #b967ff;
  --gold: #ffd700;
  --danger: #ff5470;
  --success: #3fcf5d;
  --border: rgba(255, 255, 255, 0.08);
  --sidebar-w: 250px;
}

* , *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-1);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Poppins', 'Inter', sans-serif; margin: 0; }
input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,240,255,0.12);
}
button { font-family: inherit; cursor: pointer; }

/* ---------- Auth (login) ---------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(185,103,255,0.15), transparent), var(--bg-1);
  padding: 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
}
.auth-logo {
  width: 52px; height: 52px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  color: #001014;
}
.auth-card h1 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.auth-sub { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1.5rem; }
.auth-card form { text-align: left; display: flex; flex-direction: column; gap: 1rem; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #ffffff;
  color: #3c4043;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.25); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.2rem 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-back {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.auth-back:hover { color: var(--cyan); }

/* ---------- Alerts ---------- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: left;
}
.alert-error { background: rgba(255,84,112,0.12); border: 1px solid rgba(255,84,112,0.35); color: #ff8fa3; }
.alert-success { background: rgba(63,207,93,0.12); border: 1px solid rgba(63,207,93,0.35); color: #7ee495; }

/* ---------- Shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.5rem 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand img { width: 32px; height: 32px; }
.sidebar-brand strong { display: block; font-size: 0.9rem; }
.sidebar-brand span { display: block; font-size: 0.7rem; color: var(--text-secondary); }

.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.sidebar-section {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 1rem 0.6rem 0.4rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.87rem;
  transition: background 0.2s, color 0.2s;
}
.sidebar-link svg { flex-shrink: 0; width: 18px; height: 18px; }
.sidebar-link:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.sidebar-link.active { background: linear-gradient(135deg, rgba(0,240,255,0.15), rgba(185,103,255,0.1)); color: var(--cyan); }
.sidebar-badge {
  margin-left: auto;
  background: var(--purple);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
}
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }

.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10,14,26,0.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-title { font-size: 1.05rem; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #001014;
}

.content { padding: 1.75rem; }

/* ---------- Cards / stats ---------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
}
.stat-card .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.8rem;
  background: rgba(0,240,255,0.1);
  color: var(--cyan);
}
.stat-card .value { font-size: 1.6rem; font-weight: 700; }
.stat-card .label { font-size: 0.8rem; color: var(--text-secondary); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.5rem;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.card-head h2 { font-size: 1rem; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-outline, .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: linear-gradient(135deg, var(--cyan), #009fb0); color: #00161a; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,240,255,0.25); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-danger { background: rgba(255,84,112,0.12); border-color: rgba(255,84,112,0.35); color: #ff8fa3; }
.btn-danger:hover { background: rgba(255,84,112,0.2); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.78rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 0.75rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-secondary); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
td.actions { display: flex; gap: 0.4rem; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: rgba(255,255,255,0.05); }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.badge-published { background: rgba(63,207,93,0.14); color: #7ee495; }
.badge-draft { background: rgba(255,215,0,0.14); color: var(--gold); }
.badge-unread { background: rgba(0,240,255,0.14); color: var(--cyan); }
.empty-row { color: var(--text-secondary); text-align: center; padding: 2rem !important; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-size: 0.82rem; color: var(--text-secondary); }
.form-actions { display: flex; gap: 0.7rem; margin-top: 0.5rem; }
.help-text { font-size: 0.76rem; color: var(--text-secondary); }
.current-file { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -100%; top: 0; z-index: 50; transition: left 0.25s; }
  .sidebar.open { left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}
