/* EduOS Guardian Admin Console */
:root {
  --sidebar-width: 260px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #334155;
  --topbar-height: 56px;
  --primary: #4f46e5;
  --primary-light: #e0e7ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bg-page: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
}

/* Sidebar */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s;
}

.sidebar-brand {
  padding: 20px 24px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid #334155;
}

.sidebar-brand small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--sidebar-text);
  margin-top: 2px;
}

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

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}

.sidebar-nav a:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.05);
}

.sidebar-nav a.active,
.sidebar-nav a.router-link-active,
.sidebar-nav a.router-link-exact-active {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
  font-weight: 500;
}

.sidebar-nav a i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-nav .nav-section {
  padding: 16px 24px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
}

.sidebar-user {
  padding: 16px 24px;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.sidebar-user .info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .name {
  font-size: 13px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .role {
  font-size: 11px;
  color: #64748b;
}

.sidebar-user .logout-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
}

.sidebar-user .logout-btn:hover { color: #ef4444; }

/* Main content */
.admin-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.admin-topbar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.admin-topbar .page-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.admin-topbar .topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-topbar .menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  margin-right: 12px;
  cursor: pointer;
}

.admin-content {
  padding: 24px;
}

/* Cards */
.stat-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.content-card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 20px;
}

.content-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.content-card .card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #f8fafc; }

/* Status chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.chip-success { background: #d1fae5; color: #065f46; }
.chip-warning { background: #fef3c7; color: #92400e; }
.chip-danger { background: #fee2e2; color: #991b1b; }
.chip-info { background: #dbeafe; color: #1e40af; }
.chip-gray { background: #f1f5f9; color: #475569; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  margin: 8px 0 16px;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1023px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-topbar .menu-toggle {
    display: block;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
  }
  .sidebar-overlay.active {
    display: block;
  }
}

@media (max-width: 767px) {
  .admin-content {
    padding: 16px;
  }
  .stat-card .stat-value {
    font-size: 20px;
  }
  .data-table {
    font-size: 12px;
  }
}

/* Mastery bar */
.mastery-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.mastery-bar .fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.mastery-bar .fill.mastered { background: var(--success); }
.mastery-bar .fill.learning { background: var(--primary); }
.mastery-bar .fill.struggling { background: var(--warning); }
.mastery-bar .fill.new { background: #cbd5e1; }

/* Timeline */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.timeline-content .time {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Notification item */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #f8fafc;
}
.notif-item.unread { background: var(--primary-light); }
.notif-item .notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.notif-item .notif-body { flex: 1; min-width: 0; }
.notif-item .notif-title { font-size: 13px; font-weight: 500; }
.notif-item .notif-time { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
