/* Admin CMS Dashboard — Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --adm-bg: #0a0e1a;
  --adm-surface: #111827;
  --adm-surface-2: #1a2236;
  --adm-surface-3: #1f2a40;
  --adm-border: rgba(255,255,255,0.08);
  --adm-border-hover: rgba(255,255,255,0.16);
  --adm-text: #e2e8f0;
  --adm-text-muted: #8896ab;
  --adm-text-dim: #5a6a80;
  --adm-accent: #3b82f6;
  --adm-accent-glow: rgba(59,130,246,0.25);
  --adm-cyan: #06b6d4;
  --adm-green: #10b981;
  --adm-amber: #f59e0b;
  --adm-red: #ef4444;
  --adm-purple: #8b5cf6;
  --adm-sidebar-w: 260px;
  --adm-topbar-h: 64px;
  --adm-radius: 12px;
  --adm-radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.admin-dash-body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--adm-bg);
  color: var(--adm-text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Sidebar ── */
.adm-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--adm-sidebar-w);
  background: var(--adm-surface);
  border-right: 1px solid var(--adm-border);
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.adm-sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--adm-border);
  text-decoration: none; color: #fff;
  font-weight: 800; font-size: 15px;
}

.adm-sidebar-brand .brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #1e3a5f, #0e7490);
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(6,182,212,0.25);
}

.adm-sidebar-brand .brand-icon svg {
  width: 24px; height: 24px;
  fill: none; stroke: #fff; stroke-width: 3; stroke-linejoin: round;
}

.adm-sidebar-brand .brand-icon svg path:nth-child(2) { stroke: var(--adm-cyan); }

.adm-sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.adm-nav-label {
  display: block; padding: 8px 12px 6px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--adm-text-dim);
}

.adm-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin: 2px 0;
  border-radius: var(--adm-radius-sm);
  color: var(--adm-text-muted);
  font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  transition: all 0.2s;
}

.adm-nav-item:hover { background: var(--adm-surface-2); color: var(--adm-text); }
.adm-nav-item.active { background: var(--adm-accent); color: #fff; box-shadow: 0 4px 12px var(--adm-accent-glow); }

.adm-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.adm-sidebar-footer {
  padding: 16px 22px; border-top: 1px solid var(--adm-border);
  font-size: 12px; color: var(--adm-text-dim);
}

.adm-sidebar-footer a { color: var(--adm-accent); text-decoration: none; }

/* ── Topbar ── */
.adm-topbar {
  position: fixed; top: 0; right: 0;
  left: var(--adm-sidebar-w);
  height: var(--adm-topbar-h);
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--adm-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; z-index: 35;
}

.adm-topbar-title { font-size: 18px; font-weight: 700; }

.adm-topbar-actions { display: flex; gap: 10px; }

.adm-topbar-btn {
  padding: 8px 16px; border-radius: var(--adm-radius-sm);
  border: none; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}

.adm-topbar-btn.primary {
  background: var(--adm-accent); color: #fff;
  box-shadow: 0 4px 12px var(--adm-accent-glow);
}

.adm-topbar-btn.primary:hover { background: #2563eb; }

.adm-topbar-btn.secondary {
  background: var(--adm-surface-2); color: var(--adm-text);
  border: 1px solid var(--adm-border);
}

.adm-menu-toggle {
  display: none; width: 40px; height: 40px;
  border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm);
  background: var(--adm-surface-2); color: #fff;
  font-size: 18px; cursor: pointer;
}

/* ── Main ── */
.adm-main {
  margin-left: var(--adm-sidebar-w);
  padding-top: var(--adm-topbar-h);
  min-height: 100vh;
}

.adm-content { padding: 28px; }

.adm-section { display: none; }
.adm-section.active { display: block; }

/* ── Stats Cards ── */
.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px; margin-bottom: 28px;
}

.adm-stat-card {
  padding: 22px 24px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  position: relative; overflow: hidden;
  transition: border-color 0.3s;
}

.adm-stat-card:hover { border-color: var(--adm-border-hover); }

.adm-stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}

.adm-stat-card:nth-child(1)::after { background: linear-gradient(90deg, var(--adm-accent), var(--adm-cyan)); }
.adm-stat-card:nth-child(2)::after { background: linear-gradient(90deg, var(--adm-green), #34d399); }
.adm-stat-card:nth-child(3)::after { background: linear-gradient(90deg, var(--adm-amber), #fbbf24); }
.adm-stat-card:nth-child(4)::after { background: linear-gradient(90deg, var(--adm-purple), #a78bfa); }

.adm-stat-label {
  font-size: 12px; font-weight: 600;
  color: var(--adm-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.adm-stat-value {
  font-size: 32px; font-weight: 800; line-height: 1.1;
  color: #fff;
}

/* ── Tables ── */
.adm-table-wrap {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  overflow: hidden; margin-bottom: 28px;
}

.adm-table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--adm-border);
}

.adm-table-header h3 { font-size: 16px; font-weight: 700; }

.adm-table {
  width: 100%; border-collapse: collapse;
}

.adm-table th {
  padding: 12px 18px; text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--adm-text-dim);
  background: var(--adm-surface-2);
  border-bottom: 1px solid var(--adm-border);
}

.adm-table td {
  padding: 14px 18px; font-size: 14px;
  border-bottom: 1px solid var(--adm-border);
}

.adm-table tr:hover td { background: rgba(255,255,255,0.02); }
.adm-table tr:last-child td { border-bottom: none; }

.adm-table-btn {
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--adm-border);
  background: transparent; color: var(--adm-text-muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; margin-right: 4px;
}

.adm-table-btn:hover { background: var(--adm-surface-2); color: var(--adm-text); }
.adm-table-btn.danger:hover { background: rgba(239,68,68,0.12); color: var(--adm-red); border-color: var(--adm-red); }

/* ── Panels & Forms ── */
.adm-panel {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  margin-bottom: 24px;
}

.adm-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--adm-border);
}

.adm-panel-header h3 { font-size: 16px; font-weight: 700; }

.adm-panel-body { padding: 24px; }

.adm-form-group { margin-bottom: 18px; }

.adm-form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--adm-text-muted);
}

.adm-form-input,
.adm-form-select,
.adm-form-textarea {
  width: 100%; padding: 10px 14px;
  border-radius: var(--adm-radius-sm);
  border: 1px solid var(--adm-border);
  background: var(--adm-surface-2);
  color: var(--adm-text); font-size: 14px;
  font-family: inherit; outline: none;
  transition: border-color 0.2s;
}

.adm-form-input:focus,
.adm-form-select:focus,
.adm-form-textarea:focus {
  border-color: var(--adm-accent);
  box-shadow: 0 0 0 3px var(--adm-accent-glow);
}

.adm-form-textarea { resize: vertical; min-height: 100px; }

.adm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.adm-btn {
  padding: 10px 20px; border-radius: var(--adm-radius-sm);
  font-size: 14px; font-weight: 700;
  border: none; cursor: pointer; transition: all 0.2s;
}

.adm-btn-primary {
  background: var(--adm-accent); color: #fff;
  box-shadow: 0 4px 12px var(--adm-accent-glow);
}

.adm-btn-primary:hover { background: #2563eb; }

.adm-btn-ghost {
  background: transparent; color: var(--adm-text-muted);
  border: 1px solid var(--adm-border);
}

.adm-btn-ghost:hover { background: var(--adm-surface-2); }

/* ── Modal ── */
.adm-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: none; place-items: center;
  z-index: 100;
}

.adm-modal-overlay.open { display: grid; }

.adm-modal {
  width: min(580px, 92vw); max-height: 90vh; overflow-y: auto;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: admModalIn 0.25s ease;
}

@keyframes admModalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.adm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--adm-border);
}

.adm-modal-header h3 { font-size: 18px; font-weight: 700; }

.adm-modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--adm-border);
  background: transparent; color: var(--adm-text-muted);
  font-size: 18px; cursor: pointer;
}

.adm-modal-close:hover { background: var(--adm-surface-2); color: #fff; }

.adm-modal-body { padding: 24px; }

.adm-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--adm-border);
}

/* ── Activity Log ── */
.adm-activity-list { list-style: none; }

.adm-activity-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--adm-border);
}

.adm-activity-item:last-child { border-bottom: none; }

.adm-activity-dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
  background: var(--adm-accent);
}

.adm-activity-text { font-size: 14px; }
.adm-activity-time { font-size: 12px; color: var(--adm-text-dim); margin-top: 2px; }

/* ── Toast ── */
.adm-toast {
  position: fixed; bottom: 28px; right: 28px;
  padding: 14px 22px; border-radius: var(--adm-radius-sm);
  background: var(--adm-surface-2);
  border: 1px solid var(--adm-border);
  color: var(--adm-text); font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s ease;
  z-index: 200;
}

.adm-toast.show { transform: translateY(0); opacity: 1; }
.adm-toast.success { border-left: 3px solid var(--adm-green); }

/* ── Status Badge ── */
.adm-status {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase;
}

.adm-status.published { background: rgba(16,185,129,0.15); color: var(--adm-green); }
.adm-status.draft { background: rgba(245,158,11,0.15); color: var(--adm-amber); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .adm-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .adm-sidebar { transform: translateX(-100%); }
  .adm-sidebar.open { transform: translateX(0); }
  .adm-topbar { left: 0; }
  .adm-main { margin-left: 0; }
  .adm-menu-toggle { display: grid; place-items: center; }
  .adm-stats-grid { grid-template-columns: 1fr; }
  .adm-form-row { grid-template-columns: 1fr; }
}
