/* Nexus Defenders Admin Panel Styles */

:root {
  --admin-bg: #040914;
  --admin-surface: #0b1121;
  --admin-surface-light: rgba(255, 255, 255, 0.05);
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-primary: #3b82f6;
  --admin-primary-hover: #2563eb;
  --admin-text: #f8fafc;
  --admin-text-muted: #94a3b8;
  --admin-success: #22c55e;
  --admin-danger: #ef4444;
  --admin-warning: #f59e0b;
  --admin-gold: #fbbf24;
  --sidebar-width: 280px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* ── LAYOUT ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.admin-main {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  height: 70px;
  background: rgba(11, 17, 33, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.admin-content {
  padding: 30px;
  flex-grow: 1;
}

/* ── SIDEBAR ── */
.sidebar-header {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--admin-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(96, 165, 250, 0.5);
}

.sidebar-menu {
  padding: 20px 0;
  overflow-y: auto;
  flex-grow: 1;
}

.sidebar-menu-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0 25px;
  margin: 15px 0 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 25px;
  color: var(--admin-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link i {
  width: 24px;
  font-size: 1.1rem;
  margin-right: 10px;
}

.sidebar-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
  color: var(--admin-primary);
  background: rgba(59, 130, 246, 0.1);
  border-left-color: var(--admin-primary);
}

/* ── TOPBAR ── */
.topbar-search {
  position: relative;
  width: 300px;
}

.topbar-search i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-text-muted);
}

.topbar-search input {
  width: 100%;
  background: var(--admin-surface-light);
  border: 1px solid var(--admin-border);
  color: white;
  padding: 10px 15px 10px 40px;
  border-radius: 20px;
  outline: none;
  transition: 0.3s;
}

.topbar-search input:focus {
  border-color: var(--admin-primary);
  background: rgba(0,0,0,0.2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--admin-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  position: relative;
  transition: 0.2s;
}

.action-btn:hover {
  color: white;
}

.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--admin-danger);
  border-radius: 50%;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.admin-profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.admin-profile-info {
  display: flex;
  flex-direction: column;
}

.admin-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
}

.admin-role {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

/* ── DASHBOARD CARDS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: 0.3s;
}

.stat-card:hover {
  border-color: rgba(96, 165, 250, 0.3);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.stat-icon.primary { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.stat-icon.success { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: #f87171; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
}

/* ── TABLES ── */
.admin-panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 30px;
}

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

.panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

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

.admin-table th {
  background: rgba(0,0,0,0.2);
  padding: 15px 25px;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 15px 25px;
  border-bottom: 1px solid var(--admin-border);
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ── BADGES & BUTTONS ── */
.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
}
.status-active { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.status-pending { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.status-inactive { background: rgba(239, 68, 68, 0.1); color: #f87171; }

.btn-admin {
  background: var(--admin-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-admin:hover { background: var(--admin-primary-hover); }

.btn-admin-outline {
  background: transparent;
  color: white;
  border: 1px solid var(--admin-border);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
}
.btn-admin-outline:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); }

.action-icon {
  color: var(--admin-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 5px;
  transition: 0.2s;
}
.action-icon:hover { color: white; }
.action-icon.edit:hover { color: #60a5fa; }
.action-icon.delete:hover { color: #f87171; }

/* ── RESPONSIVE ── */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 992px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-main { margin-left: 0; }
  .mobile-toggle { display: block; }
  .sidebar-open .admin-sidebar { transform: translateX(0); }
  .topbar-search { display: none; }
}
