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

/* ===== Theme Variables ===== */
:root {
  --primary: #4f6ef7;
  --primary-light: rgba(79, 110, 247, 0.08);
  --primary-dark: #3b56d4;
  --secondary: #6366f1;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 240px;
  --topbar-height: 60px;
  --tabs-height: 44px;
  --content-padding: 24px;
}

/* Light Theme (Default) - Flat Design */
[data-theme="light"] {
  --sidebar-bg: #ffffff;
  --sidebar-hover: #f8fafc;
  --sidebar-active: rgba(79, 110, 247, 0.1);
  --sidebar-text: #475569;
  --sidebar-text-active: #4f6ef7;
  --sidebar-border: transparent;
  --topbar-bg: #ffffff;
  --topbar-border: transparent;
  --page-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: rgba(0, 0, 0, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.06);
  --tab-bg: #f1f5f9;
  --tab-active-bg: #ffffff;
  --tab-hover-bg: #e2e8f0;
}

/* Dark Theme */
[data-theme="dark"] {
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: rgba(79, 110, 247, 0.15);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-border: transparent;
  --topbar-bg: #1e293b;
  --topbar-border: transparent;
  --page-bg: #0f172a;
  --card-bg: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
  --tab-bg: #334155;
  --tab-active-bg: #1e293b;
  --tab-hover-bg: #475569;
}

/* Blue Theme */
[data-theme="blue"] {
  --sidebar-bg: #ffffff;
  --sidebar-hover: #f0f7ff;
  --sidebar-active: rgba(59, 130, 246, 0.1);
  --sidebar-text: #475569;
  --sidebar-text-active: #3b82f6;
  --sidebar-border: transparent;
  --topbar-bg: #ffffff;
  --topbar-border: transparent;
  --page-bg: #f0f7ff;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: rgba(59, 130, 246, 0.1);
  --shadow: 0 1px 2px rgba(59, 130, 246, 0.05);
  --shadow-md: 0 4px 6px rgba(59, 130, 246, 0.08);
  --shadow-lg: 0 10px 15px rgba(59, 130, 246, 0.1);
  --tab-bg: #e0f2fe;
  --tab-active-bg: #ffffff;
  --tab-hover-bg: #bae6fd;
  --primary: #3b82f6;
}

/* Green Theme */
[data-theme="green"] {
  --sidebar-bg: #ffffff;
  --sidebar-hover: #ecfdf5;
  --sidebar-active: rgba(16, 185, 129, 0.1);
  --sidebar-text: #475569;
  --sidebar-text-active: #10b981;
  --sidebar-border: transparent;
  --topbar-bg: #ffffff;
  --topbar-border: transparent;
  --page-bg: #ecfdf5;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: rgba(16, 185, 129, 0.1);
  --shadow: 0 1px 2px rgba(16, 185, 129, 0.05);
  --shadow-md: 0 4px 6px rgba(16, 185, 129, 0.08);
  --shadow-lg: 0 10px 15px rgba(16, 185, 129, 0.1);
  --tab-bg: #d1fae5;
  --tab-active-bg: #ffffff;
  --tab-hover-bg: #a7f3d0;
  --primary: #10b981;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--page-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }

/* ===== Top Bar ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.topbar-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 70px;
  white-space: nowrap;
}

.topbar-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.25);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.topbar-nav-item {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.topbar-nav-item:hover {
  color: var(--text-primary);
  background: var(--page-bg);
}

.topbar-nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.topbar-user:hover {
  background: var(--page-bg);
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.2);
}

.user-arrow {
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform var(--transition);
}

.topbar-user:hover .user-arrow,
.topbar-user.active .user-arrow {
  transform: rotate(180deg);
}

/* User Dropdown */
.topbar-user {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 180px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
  z-index: 100;
  overflow: hidden;
}

.topbar-user:hover .user-dropdown,
.topbar-user.active .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-primary);
}

.user-dropdown-item:hover {
  background: var(--page-bg);
}

.user-dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.dropdown-icon {
  font-size: 14px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

/* Theme Switcher */
.theme-switcher {
  position: relative;
}

.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--page-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
}

.theme-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 150px;
  display: none;
  z-index: 1001;
  overflow: hidden;
}

.theme-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.theme-option {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition);
}

.theme-option:hover {
  background: var(--page-bg);
}

.theme-option.active {
  color: var(--primary);
  background: var(--primary-light);
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-dot.light { 
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}
.theme-dot.dark { 
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
.theme-dot.blue { 
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}
.theme-dot.green { 
  background: linear-gradient(135deg, #10b981, #059669);
}

/* ===== Layout ===== */
.layout {
  display: flex;
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15); }

/* ===== Menu Item ===== */
.menu-section { padding: 12px 0; }

.menu-item { cursor: pointer; user-select: none; }

.menu-item-content {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  padding-left: calc(var(--depth) * 16px + 20px);
  color: var(--sidebar-text);
  transition: all var(--transition);
  gap: 12px;
  min-height: 44px;
  position: relative;
  margin: 2px 12px;
  border-radius: var(--radius-sm);
}

.menu-item-content:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.menu-item.active > .menu-item-content {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

.menu-item.active > .menu-item-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.menu-item-text { 
  flex: 1; 
  font-size: 14px;
  font-weight: 500;
}

.menu-item-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-arrow {
  font-size: 14px;
  transition: transform var(--transition);
  flex-shrink: 0;
  opacity: 0.5;
}

.menu-item.expanded > .menu-item-content .menu-arrow {
  transform: rotate(90deg);
}

.menu-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.menu-item.expanded > .menu-children {
  max-height: 1000px;
}

/* ===== Content Area with Tabs ===== */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tabs */
.tabs-wrapper {
  height: var(--tabs-height);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.tab-scroll-btn {
  width: 36px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: none;
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  flex-shrink: 0;
}

.tab-scroll-btn:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.tab-scroll-right {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.tabs-container {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
}

.tabs-container::-webkit-scrollbar { height: 0; }

.tab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--tab-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
  border: none;
  max-width: 160px;
}

.tab-item:hover {
  background: var(--tab-hover-bg);
  color: var(--text-primary);
}

.tab-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.tab-icon {
  font-size: 14px;
}

.tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-close {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.5;
  transition: all var(--transition);
}

.tab-close:hover {
  background: rgba(0,0,0,0.08);
  opacity: 1;
}

.tab-item.active .tab-close:hover {
  background: rgba(79, 110, 247, 0.15);
}

/* Tab Context Menu */
.tab-context-menu {
  position: fixed;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  min-width: 140px;
  z-index: 9999;
  display: none;
  border: 1px solid var(--border-color);
}

.tab-context-menu.show {
  display: block;
}

.context-menu-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.context-menu-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

/* Content */
.content {
  flex: 1;
  padding: var(--content-padding);
  overflow: hidden;
  background: var(--page-bg);
}

.content > iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--card-bg);
}

/* ===== Page Styles ===== */
.page-header {
  padding: 0 0 28px 0;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.page-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ===== Stats ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), transparent);
  border-radius: var(--radius) 0 0 var(--radius);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 110, 247, 0.05), transparent);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1);
}

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

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform var(--transition);
  position: relative;
  z-index: 10;
}

.stat-icon.blue { background: linear-gradient(135deg, rgba(79, 110, 247, 0.15), rgba(79, 110, 247, 0.05)); color: #4f6ef7; }
.stat-icon.green { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05)); color: #10b981; }
.stat-icon.orange { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05)); color: #f59e0b; }
.stat-icon.purple { background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05)); color: #8b5cf6; }
.stat-icon.red { background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05)); color: #ef4444; }
.stat-icon.pink { background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.05)); color: #ec4899; }
.stat-icon.cyan { background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05)); color: #06b6d4; }

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.stat-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===== Cards ===== */
.content-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  transition: all var(--transition);
}

.content-card:hover {
  box-shadow: var(--shadow-md);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(79, 110, 247, 0.04), rgba(79, 110, 247, 0.02));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid var(--primary);
}

.section-title::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.8;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all var(--transition);
}

.form-input:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.form-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-select:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.form-select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all var(--transition);
  resize: vertical;
  min-height: 100px;
}

.form-textarea:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.form-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

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

th, td {
  text-align: left;
  padding: 14px 16px;
  font-size: 14px;
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--page-bg);
  position: sticky;
  top: 0;
  border-bottom: 2px solid var(--border-color);
}

td {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: background var(--transition);
}

tr:hover td {
  background: var(--primary-light);
}

/* 斑马纹效果 */
tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

tbody tr:nth-child(even):hover {
  background: var(--primary-light);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
}

.badge:hover {
  transform: scale(1.05);
}

.badge-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  color: var(--success);
}

.badge-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  color: var(--warning);
}

.badge-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  color: var(--danger);
}

.badge-info {
  background: linear-gradient(135deg, rgba(79, 110, 247, 0.15), rgba(79, 110, 247, 0.05));
  color: var(--primary);
}

.badge-purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
  color: #8b5cf6;
}

.badge-pink {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.05));
  color: #ec4899;
}

.badge-cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
  color: #06b6d4;
}

/* ===== Progress Bar ===== */
.progress-bar {
  height: 6px;
  background: var(--page-bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition);
}

.progress-primary {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.progress-success {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.progress-danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* ===== Filters ===== */
.filter-bar {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-item label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-item input, .filter-item select {
  padding: 10px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all var(--transition);
}

.filter-item input:hover, .filter-item select:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.filter-item input:focus, .filter-item select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 60px;
  }
  
  .menu-item-text {
    display: none;
  }
  
  .menu-item-content {
    padding: 12px;
    justify-content: center;
  }
  
  .menu-item.active > .menu-item-content::before {
    left: 50%;
    top: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 3px 3px 0 0;
  }
  
  .topbar-brand span:last-child {
    display: none;
  }
  
  .topbar-brand {
    margin-right: 20px;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .topbar-nav-item span {
    display: none;
  }
  
  .topbar-nav-item {
    padding: 10px;
  }
}