/* ============================================================
   VPS HOSTING PRO - ADVANCED ULTRA MODERN STYLESHEET
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================ */
:root {
  /* Brand Colors */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --accent-green: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-orange: #f97316;

  /* Gradient Palettes */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --grad-hero: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  --grad-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-rose: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --grad-amber: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
  --grad-violet: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --grad-sidebar: linear-gradient(180deg, #0f0c29 0%, #1a1040 50%, #0f0c29 100%);

  /* Neon Glows */
  --glow-primary: 0 0 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(99, 102, 241, 0.2);
  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.4), 0 0 40px rgba(6, 182, 212, 0.2);
  --glow-green: 0 0 20px rgba(16, 185, 129, 0.4);
  --glow-rose: 0 0 20px rgba(244, 63, 94, 0.4);
  --glow-amber: 0 0 20px rgba(245, 158, 11, 0.4);

  /* Dark Mode (Default) */
  --bg-primary: #080b14;
  --bg-secondary: #0d111f;
  --bg-tertiary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-primary: rgba(99, 102, 241, 0.3);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --sidebar-bg: #060912;
  --sidebar-width: 280px;
  --sidebar-collapsed: 72px;
  --topbar-height: 70px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-base: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-neon: 0 0 30px rgba(99, 102, 241, 0.15);
}

/* Light Mode Tokens */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-tertiary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.9);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-primary: rgba(99, 102, 241, 0.3);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --sidebar-bg: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: clamp(13.6px, 0.9vw, 14.6px);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', 'Outfit', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* Thin scrollbar for sidebar */
.scrollbar-thin::-webkit-scrollbar {
  width: 3px;
}

/* ============================================================
   LAYOUT STRUCTURE
   ============================================================ */
.panel-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(99, 102, 241, 0.15);
  transition: width var(--transition-base), transform var(--transition-base);
  overflow: visible;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 60%);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  overflow: visible;
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: var(--topbar-height);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--grad-primary);
  border-radius: var(--radius-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--glow-primary);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.sidebar-logo-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar-logo-text .brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.sidebar-logo-text .brand-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-logo {
  padding: 14px 0;
  justify-content: center;
}

.sidebar.collapsed .sidebar-logo-text {
  display: none !important;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.nav-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 16px 20px 6px;
  white-space: nowrap;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-section-label {
  display: none !important;
}

.nav-item {
  position: relative;
  margin: 2px 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-base);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.nav-link:hover {
  color: #fff;
  transform: translateX(2px);
}

.nav-link:hover::before {
  opacity: 0.1;
}

.nav-link.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.nav-link.active::before {
  opacity: 0.08;
}

.nav-link.active .nav-icon {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--glow-primary);
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link:hover .nav-icon {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
}

.nav-text {
  flex: 1;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-text {
  display: none !important;
}

.nav-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--grad-primary);
  color: #fff;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-badge {
  display: none !important;
}

.nav-arrow {
  font-size: 0.7rem;
  transition: transform var(--transition-fast), opacity var(--transition-base);
}

.sidebar.collapsed .nav-arrow {
  display: none !important;
}

.nav-arrow.rotated {
  transform: rotate(90deg);
}

/* Submenu */
.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.nav-submenu.open {
  max-height: 400px;
}

.nav-sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 56px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin: 1px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.nav-sublink:hover {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.08);
}

.nav-sublink.active {
  color: var(--primary-light);
}

.nav-sublink::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.5;
}

.nav-sublink.active::before {
  opacity: 1;
  background: var(--primary-light);
}

/* Sidebar Bottom */
.sidebar-bottom {
  padding: 16px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--bg-glass-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.user-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid var(--sidebar-bg);
}

.user-info {
  overflow: hidden;
  transition: opacity var(--transition-base);
}

.user-info .user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.user-info .user-role {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar.collapsed .user-info {
  display: none !important;
}

/* Collapsed Sidebar Layout and Centering Enhancements */
.sidebar.collapsed .sidebar-bottom {
  padding: 16px 0;
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .sidebar-user {
  padding: 0;
  width: 48px;
  height: 48px;
  justify-content: center;
  align-items: center;
  margin: 0;
}

.sidebar.collapsed .nav-item {
  margin: 4px 0;
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .nav-link {
  width: 48px;
  height: 48px;
  padding: 0;
  justify-content: center;
  align-items: center;
}

.sidebar.collapsed .nav-submenu {
  display: none !important;
}

.sidebar.collapsed .gradient-divider {
  margin: 10px 8px !important;
}

.sidebar.collapsed .sidebar-nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar.collapsed .sidebar-nav::-webkit-scrollbar {
  display: none;
  width: 0;
}

/* Sidebar toggle button */
.sidebar-toggle {
  position: absolute;
  top: 22px;
  right: -14px;
  width: 28px;
  height: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
}

.sidebar-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-base);
  overflow-x: hidden;
  min-width: 0;
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  padding: 9px 18px 9px 44px;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.topbar-search input:focus {
  border-color: var(--primary);
  background: var(--bg-glass-hover);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

.topbar-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-base);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition-fast);
  position: relative;
  text-decoration: none;
}

.topbar-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--primary-light);
  border-color: var(--border-primary);
}

.topbar-btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--accent-rose);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.theme-toggle {
  width: 52px;
  height: 28px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 99px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.theme-toggle .toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-primary);
  transition: transform var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #fff;
}

[data-theme="light"] .theme-toggle .toggle-thumb {
  transform: translateX(24px);
}

/* User profile in topbar */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-base);
  cursor: pointer;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-fast);
}

.topbar-user:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-primary);
}

.topbar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.topbar-user .name {
  font-size: 0.85rem;
  font-weight: 600;
}

.topbar-user .role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Hamburger menu for mobile */
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  max-width: 100%;
}

/* Page Header */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--primary-light);
}

.breadcrumb .sep {
  font-size: 0.65rem;
}

/* ============================================================
   CARDS / GLASS PANELS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-primary);
}

.card-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  margin-bottom: 0 !important;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-card .stat-value {
  grid-column: 2;
  grid-row: 1;
  font-family: 'Outfit', sans-serif;
  font-size: 1.22rem !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-card .stat-label {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.76rem !important;
  color: var(--text-secondary);
  margin-top: 0 !important;
  font-weight: 500;
  line-height: 1.1;
}

.stat-card .stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 99px;
}

.stat-change.up {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
}

.stat-change.down {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
}

.stat-change.neutral {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
}

/* Progress arc / ring */
.stat-ring {
  position: absolute;
  top: 16px;
  right: 16px;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  filter: blur(4px);
}

.stat-card .progress-bar,
.stat-card .progress-fill,
.stat-card .stat-change,
.stat-card .text-3xs {
  grid-column: span 2;
  width: 100%;
}

.stat-card > .skeleton-box:nth-child(1) {
  grid-column: 1;
  grid-row: 1 / span 2;
  margin-bottom: 0 !important;
}

.stat-card > .skeleton-box:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 0 !important;
}

.stat-card > .skeleton-box:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
  margin-top: 0 !important;
}

/* ============================================================
   QUICK ACTION CARDS
   ============================================================ */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-bounce);
  text-align: center;
  gap: 10px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  text-decoration: none;
  color: var(--text-primary);
}

.quick-action:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--border-primary);
  background: var(--bg-glass-hover);
  box-shadow: var(--glow-primary);
}

.quick-action .action-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform var(--transition-bounce);
}

.quick-action:hover .action-icon {
  transform: scale(1.1) rotate(-5deg);
}

.quick-action .action-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================================
   STATUS INDICATORS
   ============================================================ */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse-green 2s infinite;
}

.status-dot.offline {
  background: var(--accent-rose);
}

.status-dot.warning {
  background: var(--accent-amber);
  animation: pulse-amber 2s infinite;
}

.status-dot.maintenance {
  background: var(--accent-orange);
}

@keyframes pulse-green {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-amber {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}

.status-badge.online {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
}

.status-badge.offline {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
}

.status-badge.maintenance {
  background: rgba(249, 115, 22, 0.12);
  color: var(--accent-orange);
}

.status-badge.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-light);
}

/* ============================================================
   CHARTS AREA
   ============================================================ */
.chart-container {
  position: relative;
  height: 220px;
  margin-top: 16px;
}

.chart-container.large {
  height: 300px;
}

.chart-container.small {
  height: 160px;
}

/* ============================================================
   DATA TABLES
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-glass);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   AI PANEL
   ============================================================ */
.ai-panel {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  position: relative;
  overflow: hidden;
}

.ai-panel::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.ai-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--primary-light);
}

.ai-thinking .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: ai-bounce 1.4s infinite;
}

.ai-thinking .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-thinking .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ai-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.ai-suggestion-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-base);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.ai-suggestion-item:hover {
  border-color: var(--border-primary);
  background: var(--bg-glass-hover);
}

.ai-suggestion-item .ai-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ============================================================
   TERMINAL WIDGET
   ============================================================ */
.terminal-widget {
  background: #0a0d16;
  border-radius: var(--radius-lg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  overflow: hidden;
}

.terminal-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-body {
  padding: 14px;
  color: #a6f0c6;
  line-height: 1.8;
  max-height: 200px;
  overflow-y: auto;
}

.terminal-line {
  display: flex;
  gap: 8px;
}

.terminal-prompt {
  color: var(--primary-light);
}

.terminal-cmd {
  color: var(--text-primary);
}

.terminal-out {
  color: #94a3b8;
  padding-left: 24px;
}

/* ============================================================
   MONITORING METRICS
   ============================================================ */
.metric-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.metric-bar-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
}

.metric-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-bar-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* ============================================================
   NOTIFICATION / ALERT TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-base);
  padding: 14px 18px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toast-in {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.hiding {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content .toast-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.toast-content .toast-msg {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.charts-grid .col-8 {
  grid-column: span 8;
}

.charts-grid .col-7 {
  grid-column: span 7;
}

.charts-grid .col-6 {
  grid-column: span 6;
}

.charts-grid .col-5 {
  grid-column: span 5;
}

.charts-grid .col-4 {
  grid-column: span 4;
}

.charts-grid .col-3 {
  grid-column: span 3;
}

.charts-grid .col-12 {
  grid-column: span 12;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.anim-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-fade-up.animated {
  opacity: 1;
  transform: translateY(0);
}

.anim-fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-fade-left.animated {
  opacity: 1;
  transform: translateX(0);
}

.anim-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.anim-scale.animated {
  opacity: 1;
  transform: scale(1);
}

.delay-100 {
  transition-delay: 0.1s;
}

.delay-200 {
  transition-delay: 0.2s;
}

.delay-300 {
  transition-delay: 0.3s;
}

.delay-400 {
  transition-delay: 0.4s;
}

.delay-500 {
  transition-delay: 0.5s;
}

/* ============================================================
   BADGE / PILL STYLES
   ============================================================ */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}

.pill-primary {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.pill-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pill-rose {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.pill-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pill-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-base);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.btn-icon {
  padding: 9px;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: var(--grad-rose);
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-success {
  background: var(--grad-green);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-warning {
  background: var(--grad-amber);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .title-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* ============================================================
   REALTIME TICKER
   ============================================================ */
.realtime-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--accent-green);
  font-weight: 600;
}

.realtime-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse-green 1.5s infinite;
}

/* ============================================================
   DROPDOWN MENUS
   ============================================================ */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 8px;
  min-width: 200px;
  z-index: 200;
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(20px);
  display: none;
}

.dropdown-menu.open {
  display: block;
  animation: dropdown-in 0.2s ease;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.dropdown-item.danger:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--accent-rose);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 6px 0;
}

/* ============================================================
   NETWORK TRAFFIC MINI CHART
   ============================================================ */
.mini-chart {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 30px;
}

.mini-chart span {
  width: 4px;
  background: var(--primary-light);
  border-radius: 2px 2px 0 0;
  animation: mini-bar 1s ease-in-out infinite alternate;
  opacity: 0.6;
}

@keyframes mini-bar {
  from {
    opacity: 0.4;
  }

  to {
    opacity: 1;
  }
}

/* ============================================================
   CIRCULAR PROGRESS (SVG)
   ============================================================ */
.circle-progress svg {
  transform: rotate(-90deg);
}

.circle-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
}

.circle-fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   GLASS MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-base);
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: var(--bg-glass-hover);
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

/* ============================================================
   SERVER STATUS BANNER
   ============================================================ */
.server-status-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

/* ============================================================
   ANIMATED GRADIENT BACKGROUND ORBS
   ============================================================ */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.07;
  animation: orb-float 10s ease-in-out infinite alternate;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -200px;
  right: -100px;
  animation-duration: 12s;
}

.bg-orb-2 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  bottom: -100px;
  left: -100px;
  animation-duration: 9s;
  animation-delay: -4s;
}

.bg-orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  top: 50%;
  left: 40%;
  animation-duration: 15s;
  animation-delay: -7s;
}

@keyframes orb-float {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(30px, -30px) scale(1.1);
  }
}

/* ============================================================
   MOBILE SIDEBAR OVERLAY
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 260px;
  }

  .charts-grid .col-8 {
    grid-column: span 12;
  }

  .charts-grid .col-7 {
    grid-column: span 12;
  }

  .charts-grid .col-6 {
    grid-column: span 12;
  }

  .charts-grid .col-5 {
    grid-column: span 12;
  }

  .charts-grid .col-4 {
    grid-column: span 12;
  }

  .charts-grid .col-3 {
    grid-column: span 6;
  }
}

/* ============================================================
   RESPONSIVE — Mobile (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Sidebar: slide off-screen by default, slide in when .mobile-open */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    z-index: 100;
  }

  /* When sidebar opens on mobile, it must NEVER be collapsed */
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Ensure nav-text labels are always visible in mobile-open sidebar */
  .sidebar.mobile-open .nav-text,
  .sidebar.mobile-open .nav-badge,
  .sidebar.mobile-open .nav-arrow,
  .sidebar.mobile-open .nav-section-label,
  .sidebar.mobile-open .sidebar-logo-text,
  .sidebar.mobile-open .user-info {
    display: flex !important;
    opacity: 1 !important;
  }
  .sidebar.mobile-open .nav-section-label {
    display: block !important;
  }
  .sidebar.mobile-open .sidebar-logo-text {
    display: flex !important;
  }
  .sidebar.mobile-open .user-info {
    display: block !important;
  }
  .sidebar.mobile-open .sidebar-logo {
    padding: 24px 20px;
    justify-content: flex-start;
  }
  .sidebar.mobile-open .nav-item {
    margin: 2px 10px;
    display: block;
    justify-content: unset;
  }
  .sidebar.mobile-open .nav-link {
    width: auto;
    height: auto;
    padding: 10px 14px;
    justify-content: flex-start;
  }
  .sidebar.mobile-open .sidebar-bottom {
    padding: 16px 10px;
    display: block;
    justify-content: unset;
  }
  .sidebar.mobile-open .sidebar-user {
    padding: 10px 12px;
    width: auto;
    height: auto;
    justify-content: flex-start;
    margin: unset;
  }

  .sidebar-overlay.mobile-open {
    display: block;
  }

  .sidebar-toggle {
    display: none;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .hamburger {
    display: flex;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
    overflow: hidden;
  }

  .topbar-search {
    max-width: 180px;
  }

  .page-content {
    padding: 12px;
  }

  /* Stats cards: 2 columns minimum */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* ALL charts-grid columns collapse to full width on mobile */
  .charts-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .charts-grid .col-12,
  .charts-grid .col-8,
  .charts-grid .col-7,
  .charts-grid .col-6,
  .charts-grid .col-5,
  .charts-grid .col-4,
  .charts-grid .col-3 {
    grid-column: span 1;
  }

  /* Tables: enforce scroll containment */
  [style*="overflowX"],
  [style*="overflow-x"] {
    max-width: 100%;
  }

  .topbar-user .name,
  .topbar-user .role {
    display: none;
  }

  /* Touch target minimums */
  .btn {
    min-height: 40px;
  }

  .nav-link {
    min-height: 44px;
  }
}

/* Very small (≤480px) */
@media (max-width: 480px) {
  html {
    font-size: 12px;
  }

  .topbar-search {
    display: none;
  }

  .page-content {
    padding: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
    margin-bottom: 0 !important;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-title {
    font-size: 1.2rem;
  }

  .page-subtitle {
    font-size: 0.78rem;
  }

  /* Chart containers shrink on very small screens */
  .chart-container {
    height: 180px;
  }

  .chart-container.large {
    height: 220px;
  }

  /* Topbar compact */
  .topbar {
    padding: 0 8px;
    gap: 6px;
  }

  .topbar-btn {
    width: 36px;
    height: 36px;
  }

  .topbar-actions {
    gap: 4px;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  :root {
    --sidebar-width: 300px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* 4K (2560px+) */
@media (min-width: 2560px) {
  html {
    font-size: 20px;
  }

  :root {
    --sidebar-width: 360px;
    --topbar-height: 90px;
  }
}

/* ============================================================
   SPECIAL GRADIENT TEXT UTILITIES
   ============================================================ */
.grad-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grad-text-cyan {
  background: var(--grad-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grad-text-green {
  background: var(--grad-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grad-text-rose {
  background: var(--grad-rose);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   DIVIDERS
   ============================================================ */
.gradient-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  opacity: 0.3;
  margin: 20px 0;
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-wave {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ============================================================
   SPINNING LOADER
   ============================================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   NEON GLOW BORDER EFFECT
   ============================================================ */
.neon-border {
  position: relative;
}

.neon-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--grad-primary);
  z-index: -1;
  opacity: 0.5;
  filter: blur(4px);
}

/* ============================================================
   HOVER CARD SHINE EFFECT
   ============================================================ */
.shine-card {
  position: relative;
  overflow: hidden;
}

.shine-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
}

.shine-card:hover::after {
  left: 125%;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-section {
  gap: 20px;
}

.mt-section {
  margin-top: 20px;
}

.mb-section {
  margin-bottom: 20px;
}

/* Fancy number counter animation */
@keyframes count-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.count-anim {
  animation: count-up 0.6s ease forwards;
}

/* Table action button */
.tbl-action {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tbl-action:hover {
  background: var(--bg-glass-hover);
  color: var(--primary-light);
  border-color: var(--border-primary);
}

/* Gradient icon backgrounds */
.icon-primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: var(--primary-light);
}

.icon-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.icon-rose {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
}

.icon-violet {
  background: rgba(139, 92, 246, 0.15);
  color: var(--secondary);
}

.icon-orange {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
}

.icon-grad {
  background: var(--grad-primary);
  color: #fff;
}

/* ============================================================
   NOTIFICATION PANEL SLIDE
   ============================================================ */
.notif-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  width: 360px;
  max-height: calc(100vh - var(--topbar-height));
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-glass);
  overflow-y: auto;
  z-index: 95;
  transform: translateX(100%);
  transition: transform var(--transition-base);
  padding: 20px;
}

.notif-panel.open {
  transform: translateX(0);
}

.notif-item {
  padding: 12px;
  border-radius: var(--radius-base);
  margin-bottom: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notif-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-primary);
}

.notif-item.unread {
  border-left: 3px solid var(--primary);
}

/* Light mode overrides for specific elements */
[data-theme="light"] .sidebar {
  border-right-color: rgba(0, 0, 0, 0.08);
  background-image: none;
}

[data-theme="light"] .nav-link {
  color: var(--text-secondary);
}

[data-theme="light"] .nav-link:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .nav-link:hover .nav-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

[data-theme="light"] .nav-link.active {
  color: var(--primary-dark);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .nav-link.active .nav-icon {
  background: var(--grad-primary);
  color: #fff;
}

[data-theme="light"] .nav-icon {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
}

[data-theme="light"] .nav-arrow {
  color: var(--text-muted);
}

[data-theme="light"] .sidebar-bottom {
  border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .sidebar-logo {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}

[data-theme="light"] .terminal-widget {
  background: #1e1e2e;
}

[data-theme="light"] .bg-orb {
  opacity: 0.04;
}

[data-theme="light"] .form-input {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

[data-theme="light"] .form-input:focus {
  background: #fff;
}

[data-theme="light"] .card {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Override text-white in light theme so text remains readable (except for buttons and badges) */
[data-theme="light"] .text-white:not(.btn):not(.status-badge):not(.badge-pill) {
  color: var(--text-primary) !important;
}
/* Hide breadcrumbs globally */
.breadcrumb { display: none !important; }

/* GLOBAL LIGHT MODE FIXES FOR HARDCODED DARK TAILWIND CLASSES */
[data-theme="light"] .text-white { color: var(--text-primary) !important; }
[data-theme="light"] .text-slate-400,
[data-theme="light"] .text-slate-500 { color: var(--text-muted) !important; }
[data-theme="light"] .text-slate-300 { color: var(--text-secondary) !important; }
[data-theme="light"] .bg-slate-900,
[data-theme="light"] .bg-slate-800,
[data-theme="light"] .bg-[#0b101c],
[data-theme="light"] .bg-[#030508],
[data-theme="light"] .bg-[#070a12],
[data-theme="light"] .bg-[#0a0d14],
[data-theme="light"] .bg-black\/50,
[data-theme="light"] .bg-black\/30,
[data-theme="light"] .bg-black\/20 { background-color: var(--bg-secondary) !important; }
[data-theme="light"] .border-slate-800,
[data-theme="light"] .border-slate-700,
[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/10 { border-color: var(--border-glass) !important; }
[data-theme="light"] .hover\:bg-white\/5:hover { background-color: rgba(0,0,0,0.05) !important; }

/* Restore white text for specific colored components */
[data-theme="light"] .btn.text-white,
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-danger,
[data-theme="light"] .badge-pill.text-white,
[data-theme="light"] .nav-badge,
[data-theme="light"] .user-avatar,
[data-theme="light"] .nav-link.active .nav-icon { color: #fff !important; }

/* FORCE VISIBLE DARK TEXT FOR LIGHT MODE (OVERRIDING LIGHT GREYS) */
[data-theme="light"] .text-slate-400,
[data-theme="light"] .text-slate-500,
[data-theme="light"] .text-slate-300,
[data-theme="light"] .text-slate-600,
[data-theme="light"] .text-gray-400,
[data-theme="light"] .text-gray-500 {
  color: #1e293b !important; /* Very dark slate, almost black, highly readable */
}

/* Restore original text colors inside terminal, log-viewer, pre, and code blocks in light mode */
[data-theme="light"] .terminal-widget .text-slate-400,
[data-theme="light"] .terminal .text-slate-400,
[data-theme="light"] .log-viewer .text-slate-400,
[data-theme="light"] pre .text-slate-400,
[data-theme="light"] code .text-slate-400,
[data-theme="light"] .terminal-widget .text-slate-300,
[data-theme="light"] .terminal .text-slate-300,
[data-theme="light"] .log-viewer .text-slate-300,
[data-theme="light"] pre .text-slate-300,
[data-theme="light"] code .text-slate-300,
[data-theme="light"] .terminal-widget .text-slate-500,
[data-theme="light"] .terminal .text-slate-500,
[data-theme="light"] .log-viewer .text-slate-500,
[data-theme="light"] pre .text-slate-500,
[data-theme="light"] code .text-slate-500,
[data-theme="light"] .terminal-widget .text-gray-400,
[data-theme="light"] .terminal .text-gray-400,
[data-theme="light"] .log-viewer .text-gray-400,
[data-theme="light"] pre .text-gray-400,
[data-theme="light"] code .text-gray-400 {
  color: #94a3b8 !important;
}

[data-theme="light"] .terminal-widget .text-white,
[data-theme="light"] .terminal .text-white,
[data-theme="light"] .log-viewer .text-white,
[data-theme="light"] pre .text-white,
[data-theme="light"] code .text-white,
[data-theme="light"] .terminal-widget .text-slate-100,
[data-theme="light"] .terminal .text-slate-100,
[data-theme="light"] .log-viewer .text-slate-100,
[data-theme="light"] pre .text-slate-100,
[data-theme="light"] code .text-slate-100 {
  color: #fff !important;
}

/* ============================================================
   LIGHT MODE — DEPLOYMENT CENTER & GENERAL PAGE FIXES
   Targets hardcoded dark Tailwind classes used throughout the app
   ============================================================ */

/* text-slate-100 / text-slate-200 — used as "bright" labels on dark bg */
[data-theme="light"] .text-slate-100,
[data-theme="light"] .text-slate-200 {
  color: #0f172a !important;
}

/* Project card backgrounds that hardcode dark hex/rgba values */
[data-theme="light"] .bg-\[\#0e1322\]\/40,
[data-theme="light"] .bg-\[\#0e1322\]\/80,
[data-theme="light"] [class*="bg-[#0e1322]"],
[data-theme="light"] [class*="bg-[#0d1117]"],
[data-theme="light"] [class*="bg-[#0b101c]"] {
  background-color: var(--bg-secondary) !important;
}

/* border-slate-800 / border-slate-700 — near-invisible on light bg */
[data-theme="light"] .border-slate-800,
[data-theme="light"] .border-slate-700,
[data-theme="light"] [class*="border-slate-800"] {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Inline-style dark panel backgrounds used in GitDeploy log filter bar & project cards */
[data-theme="light"] [style*="background: rgba(15,23,42"],
[data-theme="light"] [style*="background: rgba(15, 23, 42"],
[data-theme="light"] [style*="background: rgba(14,19,34"],
[data-theme="light"] [style*="background:rgba(15,23,42"] {
  background: var(--bg-secondary) !important;
}

[data-theme="light"] [style*="border: 1px solid rgba(255,255,255,0.05)"],
[data-theme="light"] [style*="border:1px solid rgba(255,255,255,0.05)"] {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Deployment status badge — Idle uses #94a3b8 which is invisible on light */
[data-theme="light"] [style*="color: #94a3b8"]:not(.terminal-widget):not(.terminal):not(pre):not(code) {
  color: #475569 !important;
}

/* Project card — "GitHub Branch:" / "Docker Image:" label row text */
[data-theme="light"] .text-3xs.font-mono.text-slate-400,
[data-theme="light"] .font-mono.text-slate-400 {
  color: #334155 !important;
}

/* indigo-400 accents used for icons & values — keep vibrant but darken slightly */
[data-theme="light"] .text-indigo-400 {
  color: #4f46e5 !important;
}

[data-theme="light"] .text-violet-400 {
  color: #7c3aed !important;
}

/* Active project card — indigo border highlight on light */
[data-theme="light"] .border-indigo-500 {
  border-color: #6366f1 !important;
}

[data-theme="light"] .bg-indigo-500\/5,
[data-theme="light"] [class*="bg-indigo-500/5"] {
  background-color: rgba(99, 102, 241, 0.08) !important;
}

/* card hover: border-indigo-500/40 */
[data-theme="light"] .hover\:border-indigo-500\/40:hover {
  border-color: rgba(99, 102, 241, 0.5) !important;
}

/* Repo dropdown dark panel */
[data-theme="light"] [class*="bg-[#0d1117]"] {
  background-color: var(--bg-secondary) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Repo dropdown items */
[data-theme="light"] .hover\:bg-indigo-500\/10:hover {
  background-color: rgba(99, 102, 241, 0.1) !important;
}

[data-theme="light"] .text-slate-500.italic {
  color: #475569 !important;
}

/* "text-white" inside project header (project name heading) */
[data-theme="light"] h3.text-white,
[data-theme="light"] h4.text-slate-100,
[data-theme="light"] h4.font-bold.text-slate-100 {
  color: #0f172a !important;
}

/* Log/audit table rows inline styles using rgba dark backgrounds */
[data-theme="light"] [style*="background: rgba(15,23,42,0.4)"],
[data-theme="light"] [style*="background:rgba(15,23,42,0.4)"] {
  background: rgba(241, 245, 249, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Inline color: #64748b used for "Filters" label — fine in light mode, keep */

/* border-b border-slate-800/80 separator inside active project header */
[data-theme="light"] .border-slate-800\/80,
[data-theme="light"] [class*="border-slate-800/"] {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* "Last Deployment" row separator */
[data-theme="light"] .border-t.border-slate-800\/60,
[data-theme="light"] [class*="border-slate-800/60"] {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* select inside log filter bar */
[data-theme="light"] select.form-input,
[data-theme="light"] select.bg-black\/40 {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
}

/* Skeleton shimmer — uses rgba white which is invisible on light bg */
[data-theme="light"] [style*="rgba(255,255,255,0.03)"],
[data-theme="light"] [style*="rgba(255,255,255,0.07)"] {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%) !important;
}

/* pill-indigo — uses dark rgba that's near-invisible on light */
[data-theme="light"] .pill-indigo {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #4338ca !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
}

/* Data table row separator — rgba white border */
[data-theme="light"] .data-table tbody td {
  border-bottom-color: rgba(0, 0, 0, 0.04) !important;
}

/* Progress bar track — rgba white bg is invisible on light */
[data-theme="light"] .progress-bar,
[data-theme="light"] .metric-bar-track {
  background: rgba(0, 0, 0, 0.06) !important;
}

/* circle-track SVG stroke */
[data-theme="light"] .circle-track {
  stroke: rgba(0, 0, 0, 0.08) !important;
}
