/* ============================================
   AdminHub Dashboard — Complete Design System
   Dark-first, ultra-clean, minimal
   Inspired by Linear, Vercel, Stripe
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }
ul, ol { list-style: none; }

/* === CSS VARIABLES — DARK THEME === */
:root,
[data-theme="dark"] {
  --bg-base: #0F172A;
  --bg-surface: #1E293B;
  --bg-surface-hover: #253349;
  --bg-elevated: #1a2438;
  --bg-overlay: rgba(0, 0, 0, 0.6);
  --border: rgba(148, 163, 184, 0.1);
  --border-hover: rgba(148, 163, 184, 0.2);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-muted: #475569;
  --primary: #6366F1;
  --primary-hover: #818CF8;
  --primary-bg: rgba(99, 102, 241, 0.1);
  --primary-border: rgba(99, 102, 241, 0.3);
  --success: #22C55E;
  --success-bg: rgba(34, 197, 94, 0.1);
  --success-border: rgba(34, 197, 94, 0.3);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);
  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --info-border: rgba(59, 130, 246, 0.3);
  --sidebar-width: 60px;
  --topbar-height: 56px;
  --banner-height: 36px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* === LIGHT THEME === */
[data-theme="light"] {
  --bg-base: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F1F5F9;
  --bg-elevated: #FFFFFF;
  --bg-overlay: rgba(0, 0, 0, 0.4);
  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.15);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --text-muted: #CBD5E1;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* === DEMO BANNER === */
.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: var(--banner-height);
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.demo-banner a {
  color: white;
  text-decoration: underline;
  font-weight: 700;
  margin-left: 4px;
}

/* === APP LAYOUT === */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: var(--banner-height);
}

/* === ICON SIDEBAR (Left, compact) === */
.icon-sidebar {
  position: fixed;
  top: var(--banner-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  z-index: 100;
  transition: all 0.2s ease;
}
.icon-sidebar .sidebar-logo {
  width: 36px;
  height: 36px;
  margin-bottom: 24px;
  flex-shrink: 0;
}
.icon-sidebar .sidebar-logo svg {
  width: 100%;
  height: 100%;
}
.icon-sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.icon-sidebar .sidebar-link {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  font-size: 20px;
  transition: all 0.15s ease;
}
.icon-sidebar .sidebar-link:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.icon-sidebar .sidebar-link.active {
  background: var(--primary-bg);
  color: var(--primary);
}
.icon-sidebar .sidebar-link .tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.icon-sidebar .sidebar-link:hover .tooltip {
  opacity: 1;
}
.icon-sidebar .sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* === MAIN AREA === */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--banner-height));
}

/* === TOP BAR === */
.topbar {
  position: sticky;
  top: var(--banner-height);
  z-index: 90;
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.topbar-breadcrumb span:last-child {
  color: var(--text-primary);
  font-weight: 500;
}
.topbar-breadcrumb .sep {
  font-size: 11px;
}
.topbar-search {
  margin-left: auto;
  position: relative;
  width: 280px;
}
.topbar-search i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 16px;
}
.topbar-search input {
  width: 100%;
  height: 34px;
  padding: 0 60px 0 34px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.topbar-search input::placeholder { color: var(--text-tertiary); }
.topbar-search input:focus { border-color: var(--primary); }
.topbar-search .search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-surface-hover);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  border: 1px solid var(--border);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 18px;
  transition: all 0.15s;
  position: relative;
}
.topbar-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.topbar-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}
.topbar-avatar-wrap {
  position: relative;
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-left: 8px;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color 0.15s;
  object-fit: cover;
}
.topbar-avatar:hover { border-color: var(--primary); }

/* === NOTIFICATION DROPDOWN === */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-header h4 { font-size: 13px; font-weight: 600; }
.notif-header span { font-size: 12px; color: var(--primary); cursor: pointer; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-surface-hover); }
.notif-item:last-child { border-bottom: none; }
.notif-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.notif-item .notif-text { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.notif-item .notif-text strong { color: var(--text-primary); }
.notif-item .notif-time { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* === USER DROPDOWN === */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  overflow: hidden;
  padding: 6px;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.user-dropdown-header .uname { font-size: 13px; font-weight: 600; }
.user-dropdown-header .uemail { font-size: 11px; color: var(--text-tertiary); }
.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  text-align: left;
}
.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.user-dropdown .divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.user-dropdown .logout {
  color: var(--danger);
}
.user-dropdown .logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* === PAGE CONTENT === */
.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

/* === PAGE HEADER === */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 13px;
}

/* === KPI CARDS === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s;
}
.kpi-card:hover {
  border-color: var(--border-hover);
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 18px;
}
.kpi-icon.purple { background: var(--primary-bg); color: var(--primary); }
.kpi-icon.green { background: var(--success-bg); color: var(--success); }
.kpi-icon.orange { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.blue { background: var(--info-bg); color: var(--info); }
.kpi-trend {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: var(--mono);
  line-height: 1.2;
}
.kpi-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.kpi-sparkline {
  margin-top: 12px;
}
.kpi-sparkline svg {
  width: 100%;
  height: 32px;
}

/* === CARDS === */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-action {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s;
}
.card-action:hover { color: var(--primary-hover); }
.card-body {
  padding: 20px;
}

/* === CHART BOXES === */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.charts-row.full {
  grid-template-columns: 1fr;
}
.chart-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chart-box .card-header {
  padding: 16px 20px;
}
.chart-box canvas {
  padding: 16px 20px;
  height: 280px !important;
}
.chart-full {
  grid-column: 1 / -1;
}

/* === ACTIVITY FEED === */
.activity-feed {
  padding: 4px 0;
  max-height: 420px;
  overflow-y: auto;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
  transition: background 0.15s;
}
.activity-item:hover {
  background: var(--bg-surface-hover);
}
.activity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.activity-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-family: var(--mono);
}

/* === TABLE STYLES === */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
}
table tbody td {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table tbody tr {
  transition: background 0.15s;
}
table tbody tr:hover {
  background: var(--bg-surface-hover);
}
table tbody tr:last-child td {
  border-bottom: none;
}
.table-mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* Sortable headers */
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover {
  color: var(--text-primary);
}
.sort-arrow {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.5;
}
th.sortable.asc .sort-arrow,
th.sortable.desc .sort-arrow {
  opacity: 1;
  color: var(--primary);
}

/* === SERVER STATUS === */
.server-list {
  padding: 4px 0;
}
.server-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.server-item:last-child { border-bottom: none; }
.server-item:hover { background: var(--bg-surface-hover); }
.server-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }
.server-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.server-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--mono);
}
.uptime-bar {
  width: 80px;
  height: 4px;
  background: var(--bg-base);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.uptime-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}
.server-response {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-tertiary);
}

/* === SHORTCUTS GRID === */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  padding: 16px 20px;
}
.shortcut-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  cursor: pointer;
}
.shortcut-card:hover {
  border-color: var(--primary-border);
  background: var(--primary-bg);
}
.shortcut-card i {
  font-size: 22px;
  color: var(--primary);
}
.shortcut-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-neutral {
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* === USER TABLE (users page) === */
.user-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.user-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-stat-card .stat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 20px;
}
.user-stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.02em;
}
.user-stat-card .stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

.user-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.user-table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.user-table-toolbar .search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.user-table-toolbar .search-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 16px;
}
.user-table-toolbar .search-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.user-table-toolbar .search-wrap input:focus {
  border-color: var(--primary);
}
.filter-select {
  height: 34px;
  padding: 0 28px 0 10px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.filter-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13px;
}
.user-email {
  font-size: 12px;
  color: var(--text-tertiary);
}
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.role-chip.admin { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-border); }
.role-chip.editor { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.role-chip.viewer { background: var(--bg-surface-hover); color: var(--text-secondary); }

/* User detail slide-over */
.slide-over-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.slide-over-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.slide-over {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.slide-over-overlay.open .slide-over {
  transform: translateX(0);
}
.slide-over-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.slide-over-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.slide-over-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 18px;
  transition: all 0.15s;
}
.slide-over-close:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.slide-over-body {
  padding: 20px;
  flex: 1;
}

/* User detail content */
.user-profile-section {
  text-align: center;
  margin-bottom: 24px;
}
.user-profile-section img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  object-fit: cover;
}
.user-profile-section .profile-name {
  font-size: 16px;
  font-weight: 600;
}
.user-profile-section .profile-email {
  font-size: 13px;
  color: var(--text-tertiary);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.detail-item label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}
.detail-item span {
  font-size: 13px;
  color: var(--text-primary);
}
.timeline {
  border-left: 2px solid var(--border);
  padding-left: 16px;
  margin-top: 16px;
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-surface);
}
.timeline-item .tl-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.timeline-item .tl-time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--mono);
  margin-top: 2px;
}
.permission-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* Bulk action bar */
.bulk-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  display: none;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 800;
}
.bulk-bar .count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.pagination-info {
  font-size: 12px;
  color: var(--text-tertiary);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: transparent;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* === ANALYTICS PAGE === */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.metric-card .metric-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: 8px;
}
.metric-card .metric-value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.03em;
}
.metric-card .metric-compare {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
}
.metric-card .metric-compare .change {
  font-weight: 600;
  font-family: var(--mono);
}
.metric-card .metric-compare .change.up { color: var(--success); }
.metric-card .metric-compare .change.down { color: var(--danger); }
.metric-card .metric-compare .prev {
  color: var(--text-tertiary);
}

/* Real-time counter */
.realtime-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}
.realtime-number {
  font-size: 52px;
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing: -0.04em;
  color: var(--primary);
  line-height: 1;
}
.realtime-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.realtime-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Date range picker */
.date-range-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.date-range-bar .preset-btn {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: transparent;
  transition: all 0.15s;
}
.date-range-bar .preset-btn:hover,
.date-range-bar .preset-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.date-range-bar input[type="date"] {
  height: 32px;
  padding: 0 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}
.date-range-bar input[type="date"]:focus {
  border-color: var(--primary);
}
.date-range-bar input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
}

/* Country list */
.country-list {
  padding: 4px 0;
}
.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
}
.country-item:last-child { border-bottom: none; }
.country-flag {
  font-size: 18px;
  width: 24px;
  text-align: center;
}
.country-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 100px;
}
.country-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
}
.country-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.country-count {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-secondary);
  min-width: 50px;
  text-align: right;
}
.country-change {
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  min-width: 44px;
  text-align: right;
}
.country-change.up { color: var(--success); }
.country-change.down { color: var(--danger); }

/* Browser stats */
.browser-list {
  padding: 4px 0;
}
.browser-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
}
.browser-item:last-child { border-bottom: none; }
.browser-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
}
.browser-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 80px;
}
.browser-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
}
.browser-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.browser-pct {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

/* === DATA TABLES PAGE === */
.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-style-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.style-tab {
  padding: 5px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  border: 1px solid transparent;
  transition: all 0.15s;
  background: transparent;
}
.style-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}
.style-tab.active {
  color: var(--primary);
  background: var(--primary-bg);
  border-color: var(--primary-border);
}
.items-per-page {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.items-per-page select {
  height: 28px;
  padding: 0 8px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

/* Table style variations */
.table-striped tbody tr:nth-child(even) {
  background: var(--bg-base);
}
.table-bordered,
.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border);
}
.table-compact th,
.table-compact td {
  padding: 6px 12px;
  font-size: 12px;
}
.table-borderless td,
.table-borderless th {
  border: none;
}

/* Column visibility toggles */
.col-toggle-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.col-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.col-toggle input[type="checkbox"] {
  accent-color: var(--primary);
}

/* Export dropdown */
.export-dropdown {
  position: relative;
}
.export-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 100;
  min-width: 140px;
  padding: 4px;
  overflow: hidden;
}
.export-menu.open { display: block; }
.export-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.export-menu button:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* === COMPONENTS PAGE === */
.components-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
}
.components-main {
  min-width: 0;
}
.component-section {
  margin-bottom: 40px;
}
.component-section .section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--topbar-height) + var(--banner-height) + 24px);
}
.component-section .section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.component-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 8px;
}
.component-note {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
  margin-bottom: 24px;
}
.preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.preview-row:last-child { margin-bottom: 0; }
.preview-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 16px;
  width: 100%;
}
.preview-label:first-child { margin-top: 0; }

/* Component nav sidebar (right) */
.component-nav {
  position: sticky;
  top: calc(var(--topbar-height) + var(--banner-height) + 24px);
  align-self: start;
}
.component-nav h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 12px;
}
.component-nav a {
  display: block;
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 4px 0;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  transition: all 0.15s;
}
.component-nav a:hover {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}
.component-nav a.active {
  color: var(--primary);
  border-color: var(--primary);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border-hover); }
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--bg-surface-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #DC2626; }
.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: #16A34A; }
.btn-warning {
  background: var(--warning);
  color: #0F172A;
}
.btn-warning:hover { background: #D97706; }

/* Button sizes */
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: var(--radius-sm); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* Button states */
.btn:disabled, .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Icon button */
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn-icon.btn-lg { width: 42px; height: 42px; }

/* Button group */
.btn-group {
  display: inline-flex;
}
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.btn-group .btn + .btn { margin-left: -1px; }

/* === INPUTS === */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-tertiary); }
.form-input-icon {
  position: relative;
}
.form-input-icon i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 16px;
}
.form-input-icon input { padding-left: 36px; }
.form-input-icon .input-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
}
.form-input-icon .input-action:hover { color: var(--text-primary); }
.form-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}
.form-textarea:focus { border-color: var(--primary); }

/* === CHECKBOXES & RADIOS (custom) === */
.custom-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.custom-check input[type="checkbox"],
.custom-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* === TOGGLE SWITCH === */
.toggle {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle .slider {
  display: block;
  width: 40px;
  height: 22px;
  background: var(--text-muted);
  border-radius: 11px;
  transition: background 0.2s;
  position: relative;
}
.toggle .slider::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .slider { background: var(--primary); }
.toggle input:checked + .slider::after { transform: translateX(18px); }
.toggle.sm .slider { width: 32px; height: 18px; }
.toggle.sm .slider::after { width: 12px; height: 12px; }
.toggle.sm input:checked + .slider::after { transform: translateX(14px); }
.toggle.lg .slider { width: 52px; height: 28px; }
.toggle.lg .slider::after { left: 4px; top: 4px; width: 20px; height: 20px; }
.toggle.lg input:checked + .slider::after { transform: translateX(24px); }
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* === ALERTS === */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 10px;
  transition: all 0.3s;
  border: 1px solid;
}
.alert i { font-size: 18px; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.alert-body { flex: 1; }
.alert-body strong { display: block; margin-bottom: 2px; }
.alert-dismiss {
  color: inherit;
  opacity: 0.6;
  font-size: 18px;
  transition: opacity 0.15s;
  padding: 0;
}
.alert-dismiss:hover { opacity: 1; }

/* === MODALS === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: all 0.15s;
  font-size: 18px;
}
.modal-close:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.modal-body {
  padding: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.modal.fullscreen {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
}

/* === PROGRESS BARS === */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-base);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress.sm { height: 4px; }
.progress.lg { height: 12px; }
.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.progress-bar.primary { background: var(--primary); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.info { background: var(--info); }
.progress-bar.striped {
  background-image: linear-gradient(
    45deg,
    rgba(255,255,255,0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}
.progress-bar.animated {
  animation: progress-stripes 1s linear infinite;
}
@keyframes progress-stripes {
  from { background-position: 1rem 0; }
  to { background-position: 0 0; }
}

/* === TABS === */
.tabs-underline {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab-btn-underline {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  background: none;
}
.tab-btn-underline:hover { color: var(--text-primary); }
.tab-btn-underline.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tabs-pill {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border);
  width: fit-content;
}
.tab-btn-pill {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  background: none;
}
.tab-btn-pill:hover { color: var(--text-primary); }
.tab-btn-pill.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.tabs-vertical {
  display: flex;
  gap: 16px;
}
.tabs-vertical-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}
.tab-btn-vertical {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: all 0.15s;
  background: none;
}
.tab-btn-vertical:hover { color: var(--text-primary); background: var(--bg-surface-hover); }
.tab-btn-vertical.active {
  color: var(--primary);
  background: var(--primary-bg);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* === ACCORDION === */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
  transition: background 0.15s;
}
.accordion-header:hover { background: var(--bg-surface-hover); }
.accordion-arrow {
  font-size: 14px;
  color: var(--text-tertiary);
  transition: transform 0.3s;
}
.accordion.open .accordion-arrow { transform: rotate(180deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion.open .accordion-body { max-height: 500px; }
.accordion-content {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
  position: fixed;
  top: calc(var(--banner-height) + 12px);
  right: 16px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 400px;
  animation: toastIn 0.3s ease forwards;
}
.toast.hiding { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toast-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-close {
  color: var(--text-tertiary);
  font-size: 16px;
  padding: 0;
  transition: color 0.15s;
}
.toast-close:hover { color: var(--text-primary); }
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-danger { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info { border-left: 3px solid var(--info); }

/* === TOOLTIPS === */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}
.tooltip-text {
  position: absolute;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.tooltip-wrap:hover .tooltip-text { opacity: 1; }
.tooltip-text.top { bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
.tooltip-text.bottom { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
.tooltip-text.left { right: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
.tooltip-text.right { left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }

/* === DROPDOWN MENUS === */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-toggle { cursor: pointer; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: none;
  z-index: 200;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* === AVATAR STYLES === */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar.xs { width: 24px; height: 24px; }
.avatar.sm { width: 32px; height: 32px; }
.avatar.lg { width: 56px; height: 56px; }
.avatar.xl { width: 72px; height: 72px; }
.avatar-status {
  position: relative;
  display: inline-block;
}
.avatar-status .status-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}
.avatar-status .status-indicator.online { background: var(--success); }
.avatar-status .status-indicator.offline { background: var(--text-muted); }
.avatar-status .status-indicator.busy { background: var(--danger); }
.avatar-status .status-indicator.away { background: var(--warning); }
.avatar-group {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}
.avatar-group .avatar {
  border: 2px solid var(--bg-surface);
  margin-right: -10px;
}
.avatar-group .avatar:first-child { margin-right: 0; }

/* === FILE UPLOAD === */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.file-upload-zone i {
  font-size: 36px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  display: block;
}
.file-upload-zone .upload-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.file-upload-zone .upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}
.file-upload-zone .browse-link {
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}
.file-upload-zone input[type="file"] { display: none; }

/* === PRICING CARDS === */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
}
.pricing-card:hover {
  border-color: var(--border-hover);
}
.pricing-card.featured {
  border-color: var(--primary-border);
  background: var(--primary-bg);
}
.pricing-card .plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.pricing-card .plan-price {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.pricing-card .plan-period {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.pricing-card .plan-features {
  text-align: left;
  margin-bottom: 20px;
}
.pricing-card .plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
}
.pricing-card .plan-features li i { color: var(--success); }

/* === USER PROFILE CARD === */
.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 300px;
}
.profile-card .profile-cover {
  height: 80px;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
}
.profile-card .profile-body {
  padding: 0 20px 20px;
  text-align: center;
}
.profile-card .profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--bg-surface);
  margin: -32px auto 12px;
  object-fit: cover;
}
.profile-card .profile-name { font-size: 15px; font-weight: 600; }
.profile-card .profile-role { font-size: 12px; color: var(--text-tertiary); margin-bottom: 12px; }
.profile-card .profile-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.profile-card .profile-stat .stat-num {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--mono);
}
.profile-card .profile-stat .stat-lbl {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Stat card (component preview) */
.stat-card-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 240px;
}
.stat-card-preview .stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.stat-card-preview .stat-title {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-card-preview .stat-val {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--mono);
}
.stat-card-preview .stat-change {
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 600;
}

/* Info card */
.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 300px;
}
.info-card i { font-size: 24px; color: var(--primary); margin-bottom: 12px; display: block; }
.info-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.info-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* === FOOTER === */
.main-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* === ANIMATIONS === */
.anim {
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.5s ease;
}
.anim.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .kpi-grid,
  .metric-cards,
  .user-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .shortcuts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .components-layout {
    grid-template-columns: 1fr;
  }
  .component-nav { display: none; }
}

@media (max-width: 900px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .icon-sidebar {
    transform: translateX(-100%);
    z-index: 1001;
    width: 220px;
    align-items: flex-start;
    padding: 16px;
  }
  .icon-sidebar.mobile-open {
    transform: translateX(0);
  }
  .icon-sidebar .sidebar-link {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 12px;
  }
  .icon-sidebar .sidebar-link .tooltip {
    position: static;
    transform: none;
    opacity: 1;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    font-size: 13px;
  }
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 1000;
    display: none;
  }
  .mobile-overlay.open { display: block; }
  .main-area {
    margin-left: 0;
  }
  .topbar-search { display: none; }
  .hamburger-btn { display: flex; }
  .kpi-grid,
  .metric-cards,
  .user-stats-bar {
    grid-template-columns: 1fr;
  }
  .shortcuts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-content { padding: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* hamburger button */
.hamburger-btn {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 20px;
}
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
}

/* === MISC UTILITIES === */
.text-mono { font-family: var(--mono); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 13px; }
.text-muted { color: var(--text-tertiary); }
.text-primary-color { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }

/* Row checkbox in tables */
.row-check,
.user-check {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Notification wrapper for relative positioning */
.notif-wrap {
  position: relative;
}

/* Section divider */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Three-column grid for bottom */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .bottom-row { grid-template-columns: 1fr; }
}

/* Form layout in slide-over */
.slide-form .form-group {
  margin-bottom: 14px;
}
.slide-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Empty table row styling */
table .no-results {
  text-align: center;
  color: var(--text-tertiary);
  padding: 32px 16px;
}

/* Salary cell formatting */
.salary-cell {
  font-family: var(--mono);
  font-size: 12px;
}

/* Department chip */
.dept-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Sub section title in component page */
.sub-section {
  margin-bottom: 24px;
}
.sub-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* Cards grid for preview */
.cards-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* === Additional layout helpers === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Donut chart container */
.donut-chart-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.donut-chart-wrap canvas {
  max-width: 220px;
  max-height: 220px;
}

/* Traffic source horizontal bar */
.h-bar-chart {
  padding: 16px 20px;
}
.h-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.h-bar-item:last-child { margin-bottom: 0; }
.h-bar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 100px;
}
.h-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-base);
  border-radius: 4px;
  overflow: hidden;
}
.h-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}
.h-bar-value {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

/* === Selection highlight === */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

/* === Focus visible for accessibility === */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* === Clickable table rows === */
.clickable-row {
  cursor: pointer;
}

/* === User status with dot === */
.status-with-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* Relative time cell */
.relative-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
}
