:root {
  --bg-main: #020617;
  --bg-darker: #05080f;
  --bg-card: rgba(15, 23, 42, 0.6);
  --border-card: rgba(255, 255, 255, 0.08);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;

  --color-primary: #3b82f6;
  --color-green: #10b981;
  --color-red: #ef4444;

  --glow-primary: rgba(59, 130, 246, 0.4);
  --sidebar-width: 280px;
  --border-glass: rgba(255, 255, 255, 0.05); /* Thinner border */
  --bg-deep: #0a0c14; /* Deep Obsidian */
}

.badge-red {
  background: #ef4444;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  width: 24px;
  height: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 2px solid #fff;
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 99;
  line-height: 1;
}

.pulse {
  animation: pulse-animate 2s infinite;
}

@keyframes pulse-animate {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-darker: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --border-card: rgba(0, 0, 0, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --bg-deep: #f1f5f9;
  --border-glass: rgba(0, 0, 0, 0.08);
  --bg-nav-item-hover: rgba(0, 0, 0, 0.04);
  --color-nav-active: #2563eb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Tajawal", sans-serif;
}

@media (min-width: 901px) {
  html {
    font-size: 13.5px; /* Increased from 11px for better readability */
  }
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.08) 0%, transparent 40%);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

.dashboard-container {
  display: flex;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE – TABLET ≤ 1200px
═══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .sidebar { width: 220px; }
  .stats-cards { flex-wrap: wrap; gap: 1rem; }
  .stat-card { min-width: 140px; }
  .modal-content { width: 95% !important; }
  .plans-wrapper { padding: 8px !important; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE – TABLET ≤ 900px
═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  html {
    font-size: 15px !important;
  }

  /* Reset layout for mobile */
  .dashboard-container {
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
  }

  /* Sidebar: Modern Slide-out Menu (Drawer) */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -280px !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 9999 !important;
    flex-direction: column !important;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5) !important;
    background: var(--bg-darker) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    display: flex !important;
    overflow-y: auto !important;
    border-left: 1px solid var(--border-glass);
    padding: 30px 20px !important;
  }

  .sidebar.collapsed {
    right: 0px !important;
    pointer-events: auto !important;
  }

  /* Force Logo visibility on mobile even when sidebar is "collapsed" (open) */
  .sidebar.collapsed .sidebar-logo-container,
  .sidebar.collapsed .logo-box,
  .sidebar.collapsed .logo-box h1,
  .sidebar.collapsed .logo-box h1 img {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100% !important;
    height: auto !important;
    position: static !important;
    transform: none !important;
    padding: 20px !important;
  }

  /* Keep sidebar toggle on top of EVERYTHING */
  #sidebar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 10000 !important;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    margin-right: 15px; /* Stay on the far right in RTL */
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
  }

  /* Change icon to X when sidebar is open */
  body.sidebar-open #sidebar-toggle i::before {
    content: "\f00d" !important; /* fa-xmark */
  }

  .dashboard-container::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s ease;
    pointer-events: none;
    display: block !important;
    backdrop-filter: blur(4px);
  }
  
  body.sidebar-open .dashboard-container::before {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar .logo-box { 
    padding: 40px 20px 30px; 
    text-align: center; 
    display: block !important; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .sidebar .sidebar-nav { 
    padding: 20px 10px !important; 
    display: flex !important; 
    flex-direction: column !important; 
    gap: 8px !important; 
  }

  .sidebar .nav-item {
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
  }

  .sidebar .nav-item span { 
    display: inline !important; 
    opacity: 1 !important; 
    visibility: visible !important; 
    width: auto !important; 
    position: static !important; 
    margin-right: 15px !important;
  }
  
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .dropdown-arrow,
  .sidebar.collapsed .badge-count {
      opacity: 1 !important;
      visibility: visible !important;
      width: auto !important;
      height: auto !important;
      position: static !important;
      margin: 0 !important;
  }

  .nav-item {
      padding: 14px 20px !important;
      border-radius: 12px !important;
      gap: 12px !important;
      justify-content: flex-start !important;
  }

  .nav-item i:not(.dropdown-arrow) {
      order: 1 !important; /* Move icon to right (start) in RTL */
      margin: 0 !important;
  }

  .nav-item span {
      order: 2 !important;
      text-align: right !important;
  }

  .top-navbar {
    position: sticky;
    top: 0;
    z-index: 1001;
    padding: 10px 15px !important;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    width: 100%;
    border-bottom: 1px solid var(--border-glass);
  }

  #sidebar-toggle {
    display: flex !important; /* CRITICAL: Show toggle on mobile */
  }

  .main-content {
    flex: 1;
    overflow: hidden; 
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
  }
  
  .scrollable-content {
    padding: 15px !important;
  }


  .main-column { order: 1; }
  .side-column { order: 2; }

  .stats-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .status-card {
    grid-column: span 2 !important;
  }

  .stat-box {
    padding: 15px 12px !important;
  }

  .stat-box i { font-size: 1.4rem !important; }
  .stat-box p { font-size: 1.1rem !important; }

  /* Modal responsiveness */
  .modal-content {
    width: 94% !important;
    margin: 3vh auto;
    max-height: 94vh;
  }

  .map-topbar { flex-wrap: wrap; gap: 8px; }
  .map-controls { bottom: 10px; left: 10px; }
  
  /* Hide desktop-only elements */
  .mikrotik-status { display: none !important; }

  /* Welcome Banner Mobile */
  .welcome-banner {
    padding: 20px 20px 180px !important; /* Increased space for large image at bottom */
    text-align: center !important;
    border-radius: 18px !important;
    background-position: bottom center !important;
    background-size: 180px auto !important; /* Large image as requested */
  }
  .welcome-text {
    font-size: clamp(1rem, 4vw, 1.2rem) !important;
  }
  .welcome-text span {
    font-size: 0.85rem !important;
  }

  /* Subscription Card Mobile Adjustment */
  .side-column .dashboard-card h3.card-title,
  .side-column .dashboard-card .balance-actions {
      display: none !important; /* Hide less critical parts in main view on mobile if space is tight */
  }
  .side-column .dashboard-card {
      margin-top: 0 !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
  }

  /* Notes */
  .notes-panel { padding: 14px !important; }
  .notes-panel textarea { min-height: 90px !important; }

  /* Sub row */
  .sub-row { font-size: 0.82rem; padding: 8px 0; border: 1px solid rgba(255,255,255,0.05); margin-bottom: 5px; border-radius: 10px; background: rgba(0,0,0,0.1); }
  .value-text { max-width: 120px; font-size: 0.85rem; }

  /* ── MAP TOPBAR ── */
  .map-topbar { padding: 10px 15px; gap: 8px; }
  .map-title-block { display: none; }
  .map-network-select-wrap { max-width: 140px; }
  .map-net-select { min-width: 90px; font-size: 0.8rem; }
  .map-stat-pill { padding: 4px 8px; font-size: 0.75rem; }
  .server-bar-label { display: none; }
  .map-controls { gap: 4px; }
  .pan-btn { width: 30px; height: 30px; font-size: 0.78rem; }

  /* ── MODALS — Bottom Sheet ── */
  .modal { align-items: flex-end !important; padding: 0 !important; }
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    margin: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    position: relative !important;
    bottom: auto !important;
  }
  .modal-body { padding: 14px !important; }
  .modal-header { padding: 14px !important; }

  /* ── TABLES ── */
  .styled-table-wrapper, .admin-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .styled-table { font-size: 0.8rem; min-width: 480px; }
  .styled-table th, .styled-table td { padding: 8px !important; }

  /* Premium Mobile Table to Cards Transformation */
  #manage-modal .styled-table,
  #manage-modal .styled-table thead,
  #manage-modal .styled-table tbody,
  #manage-modal .styled-table th,
  #manage-modal .styled-table td,
  #manage-modal .styled-table tr {
    display: block;
    width: 100%;
  }

  #manage-modal .styled-table thead {
    display: none; /* Hide headers on mobile */
  }

  #manage-modal .styled-table tr {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    margin-bottom: 20px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
  }

  #manage-modal .styled-table td {
    border: none;
    padding: 8px 0 !important;
    text-align: right !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  }

  #manage-modal .styled-table td:last-child {
    border-bottom: none;
    flex-direction: column;
    align-items: stretch;
    padding-top: 15px !important;
  }

  #manage-modal .styled-table td[dir="ltr"] {
    text-align: left !important;
    flex-direction: row-reverse;
  }

  #manage-modal .styled-table td::before {
    content: attr(data-label);
    font-weight: 800;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-left: 10px;
  }

  #manage-modal .actions-container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    justify-content: stretch !important;
  }

  #manage-modal .btn-modern {
    width: 100% !important;
    margin: 0 !important;
    justify-content: center !important;
    padding: 10px !important;
    font-size: 0.8rem !important;
  }

  #manage-modal .btn-modern.sync-open {
    grid-column: span 2;
  }

  /* ── FORMS ── */
  .save-btn { padding: 12px !important; font-size: 0.9rem !important; }
  input[type="text"], input[type="password"], input[type="email"], select, textarea {
    font-size: 16px !important;
  }

  /* ── MISC ── */
  .plans-wrapper div[style*="grid"] { grid-template-columns: 1fr !important; }
  .plan-card { min-width: auto !important; }
  .vault-grid { grid-template-columns: 1fr !important; }
  /* Header Responsive Fixes */
  .top-navbar {
    padding: 10px 15px !important;
    gap: 12px !important;
  }
  .profile-dropdown-container .profile-info {
    display: none !important; /* Return to original: hide name on small mobile */
  }
  .profile-dropdown-container {
    padding: 6px !important;
    gap: 0 !important;
  }
  .top-nav-actions {
    gap: 4px !important;
    padding: 2px 6px !important;
  }
  .icon-btn-premium {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.95rem !important;
  }
}


/* ═══════════════════════════════════════════════════════
   END OF RESPONSIVE
═══════════════════════════════════════════════════════ */



/* Sidebar REDESIGN to match ADMIN */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(25px);
  display: flex;
  flex-direction: column;
  padding: 30px 20px !important;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2) !important;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  border-left: 1px solid var(--border-glass) !important;
}

.sidebar-logo-container {
    padding: 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-glass);
    text-align: center;
}

.sidebar-logo-container img {
    width: 130px !important;
    padding-bottom: 20px;
}

.sidebar.collapsed {
  width: 85px;
  padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .logo-box h1,
.sidebar.collapsed .sidebar-nav a span,
.sidebar.collapsed .mikrotik-status p,
.sidebar.collapsed .mikrotik-status #mikrotik-connection-text,
.sidebar.collapsed .mikrotik-status .timer-box,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .stats-card-mini {
  display: none;
}

.sidebar.collapsed .logo-box img {
  width: 50px !important;
}

.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding: 12px 0;
}

.sidebar.collapsed .sidebar-nav a i {
  margin: 0;
  font-size: 1.4rem;
}

.logo-box {
  text-align: center;
  margin-bottom: 3rem;
}

.sidebar-logo-container {
  padding: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  overflow: hidden;
}

.logo-box h1 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-box h1 img {
  width: 100%;
  height: auto;
  display: block;
}

.sidebar-nav {
  flex-grow: 1;
  padding: 10px 0 !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 14px 20px !important;
  color: #94a3b8 !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: 0.3s;
  cursor: pointer;
  gap: 12px;
  border-radius: 12px !important;
  border: 1px solid transparent;
  margin-bottom: 5px;
}

.nav-item i:not(.dropdown-arrow) {
  order: 1; /* Icon on right */
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  color: inherit;
  transition: 0.3s;
}

.nav-item span {
  flex-grow: 1;
  order: 2; /* Text in middle */
  text-align: right;
}

.dropdown-arrow {
  order: 3; /* Arrow on left */
  font-size: 0.75rem;
  opacity: 0.5;
  transition: 0.3s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff !important;
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
  border-right: none !important; /* Remove old border-right style */
}

.nav-item.active i {
  color: #60a5fa;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 900;
  color: #475569;
  margin: 25px 15px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.nav-label i {
  order: 2;
  font-size: 0.9rem;
}

/* Red Notification Badge - image style */
.badge-count {
  background: #f56565;
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 10px;
  box-shadow: 0 0 10px rgba(245, 101, 101, 0.4);
}

.nav-submenu a:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #fff !important;
}

.nav-submenu a:hover i {
  color: #fff;
}

.sidebar-footer {
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
    margin-top: auto;
}

.logout-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-radius: 12px;
    color: #f87171;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: 0.3s;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    gap: 12px;
}

.logout-link:hover {
  background: #ef4444;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

.logout-link i {
  font-size: 1.1rem;
}

/* Sidebar collapse logic (Only for Desktop/Laptop) */
@media (min-width: 901px) {
    .sidebar.collapsed {
      width: 80px !important;
      padding: 15px 0 !important;
    }
    
    .sidebar.collapsed .sidebar-logo-container {
      padding: 15px 0 !important;
      border-bottom: none !important;
    }
    
    .sidebar.collapsed .logo-box h1 {
      justify-content: center !important;
      padding: 0 !important;
    }
    
    .sidebar.collapsed .logo-box h1 img {
      height: 35px !important;
      width: auto !important;
      margin: 0 !important;
    }

    .sidebar.collapsed .logo-box h1 span,
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .nav-label span,
    .sidebar.collapsed .dropdown-arrow,
    .sidebar.collapsed .badge-count,
    .sidebar.collapsed .nav-submenu {
      opacity: 0 !important;
      visibility: hidden !important;
      width: 0 !important;
      height: 0 !important;
      overflow: hidden !important;
      padding: 0 !important;
      margin: 0 !important;
      position: absolute !important;
    }
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 15px 0;
  gap: 0;
}

.sidebar.collapsed .nav-item i:not(.dropdown-arrow) {
  order: 0; /* Reset order to center icons */
  margin: 0;
  font-size: 1.5rem;
}

.sidebar.collapsed .nav-label {
  justify-content: center;
  margin: 20px 0 10px;
  padding: 0;
}

.sidebar.collapsed .nav-label i {
  order: 0;
  margin: 0;
}

.sidebar.collapsed .logout-link {
  justify-content: center;
  width: 45px;
  height: 45px;
  padding: 0;
  margin: 0 auto;
}

.sidebar.collapsed .logout-link i {
  margin: 0 !important;
  font-size: 1.3rem;
}

.sidebar.collapsed .logout-link span {
  display: none !important;
}

.logo-box p {
  font-size: 0.75rem;
  color: #475569;
  letter-spacing: 0.5px;
}

.pulse-icon {
  font-size: 2.5rem;
  color: var(--color-primary);
  animation: pulse 2s infinite;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 14px 20px !important;
  color: #94a3b8 !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  gap: 12px;
  border-radius: 12px !important;
  border: 1px solid transparent;
  margin-bottom: 5px;
}

.nav-item i:not(.dropdown-arrow) {
  order: 1; /* Icon on right (Start) */
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  color: inherit;
  transition: 0.3s;
}

.nav-item span {
  flex-grow: 1;
  order: 2; /* Text in middle */
  text-align: right;
}

.dropdown-arrow {
  order: 3; /* Arrow on left (End) */
  font-size: 0.75rem;
  opacity: 0.5;
  transition: 0.3s;
}

.nav-item:hover {
  background: var(--bg-nav-item-hover);
  color: var(--text-primary) !important;
  transform: translateX(-5px);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
  color: var(--color-nav-active) !important;
}

.nav-item.active i {
  color: #60a5fa;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 900;
    color: #475569;
    margin: 25px 15px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Sidebar Dropdown/Submenu */
.nav-dropdown {
    position: relative;
    display: flex;
    flex-direction: column;
}

.nav-dropdown > a .dropdown-arrow {
    margin-right: auto;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-dropdown.open > a .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    background: rgba(0, 0, 0, 0.15);
    margin: 0 8px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-dropdown.open .nav-submenu {
    max-height: 500px;
    transition: max-height 0.4s cubic-bezier(1, 0, 1, 0);
    padding: 8px 0;
    margin-top: 4px;
    margin-bottom: 8px;
}

.nav-submenu a {
    padding: 10px 45px 10px 15px !important;
    font-size: 0.85rem !important;
    border-right: none !important;
    opacity: 0.8;
}

.nav-submenu a:hover {
    opacity: 1;
    background: rgba(59, 130, 246, 0.1) !important;
    transform: none !important;
}

.nav-submenu a i {
    font-size: 1rem !important;
    width: 20px !important;
}

.router-count-badge {
    margin-right: auto;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--color-primary);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
}

.nav-submenu a.active {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    opacity: 1 !important;
    font-weight: 700 !important;
}

.sidebar-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 5px 15px;
}

/* Main Content & Panels Scroll Fixes */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;   /* Layout wrapper shouldn't scroll */
  min-height: 0;
}

/* Global scroll class used in multiple PHP files */
.scrollable-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: 50px !important;
}

#overview-panel, #map-panel, .content-wrapper {
  /* Ensure they fill parent but scroll internally */
  flex: 1;
  min-height: 0;
}

#map-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Hide top-navbar when map panel is visible */
.map-active .top-navbar {
  display: none !important;
}

/* When map is active, map-panel fills ALL of main-content */
.map-active #map-panel {
  display: flex !important;
}

/* ═══════════════════════════════════════════
   OVERVIEW PANEL LAYOUT
═══════════════════════════════════════════ */
.overview-panel {
  padding: 0 !important;
}

/* Base Cards removed for premium override */

/* Overview Grid & Layout - Restored Desktop Layout */
.overview-grid {
  display: grid;
  grid-template-areas: "main side";
  grid-template-columns: 1fr 380px;
  gap: 30px;
  padding: 30px;
  max-width: 1750px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.side-column {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.main-column {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 0;
}

@media (max-width: 1024px) {
  .overview-grid {
    grid-template-areas: "main" "side";
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 25px;
  }
}

/* Welcome Banner Consolidate */
.welcome-banner {
  background: #0b0f19 url("ad.png") no-repeat 25px center;
  background-size: 200px; /* Much larger image */
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 45px 45px 45px 250px; /* Increased padding to accommodate larger image */
  backdrop-filter: blur(25px);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 200px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.welcome-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}

.welcome-text span.user-highlight {
  color: var(--color-primary);
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

@media (max-width: 908px) {
  .welcome-banner {
    background-position: top center;
    background-size: 300px;
    padding: 140px 20px 25px 20px;
    flex-direction: column;
    text-align: center;
  }
}

/* Premium Sidebar Cards */
.premium-sidebar-card {
  background: rgba(15, 23, 42, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 28px !important;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3) !important;
  transition: transform 0.3s ease;
}

.premium-sidebar-card:hover {
  transform: translateY(-5px);
}

.card-header-premium {
  padding: 20px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 900;
  font-size: 1.1rem;
  color: #fff;
}

.card-header-premium.gold {
  background: linear-gradient(to right, rgba(251, 191, 36, 0.15), transparent);
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}
.card-header-premium.gold i { color: #fbbf24; }

.card-header-premium.cyan {
  background: linear-gradient(to right, rgba(34, 211, 238, 0.15), transparent);
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
}
.card-header-premium.cyan i { color: #22d3ee; }

.premium-card-body {
  padding: 25px;
}

.sub-detail-flex {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.sub-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 700;
}

.sub-badge-premium {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 900;
}
.sub-badge-premium.success { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }

.sub-value {
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

.divider-glass {
  height: 1px;
  background: linear-gradient(to right, rgba(255,255,255,0.05), transparent);
  margin-bottom: 20px;
}

.sub-item-full label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 700;
}

.sub-plan-box, .sub-limit-box, .renewal-date-box {
  background: rgba(255,255,255,0.02);
  padding: 15px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-plan-box i { color: #8b5cf6; }
.sub-plan-box span { color: #a78bfa; font-weight: 800; }

.sub-limit-box i { color: #ec4899; }
.sub-limit-box span { color: #f472b6; font-weight: 800; }

.renewal-date-box i { color: #3b82f6; }
.renewal-date-box span { color: #fff; font-weight: 800; }

.account-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.stat-mini-card {
  background: rgba(0,0,0,0.2);
  padding: 15px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-mini-card label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.stat-mini-card p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
}

.balance-actions-premium {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.p-btn-action {
  width: 100%;
  padding: 15px;
  border-radius: 18px;
  border: none;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.p-btn-action.gold-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #451a03;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.25);
}
.p-btn-action.gold-btn:hover { transform: scale(1.02); box-shadow: 0 15px 30px rgba(245, 158, 11, 0.35); }

.p-btn-action.green-btn {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.p-btn-action.green-btn:hover { background: rgba(16, 185, 129, 0.15); border-color: #10b981; }

.page-footer-divider {
  text-align: center;
  padding: 50px 20px;
  opacity: 0.4;
  width: 100%;
}

.page-footer-divider .divider-line {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--text-secondary), transparent);
  margin-bottom: 15px;
}

.page-footer-divider p {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Stats Cards Grid (4-column grid of stat boxes) */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* Individual Stat Box */
.stat-box {
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 0;
  overflow: hidden; /* Prevent text from escaping boxes */
}

.stat-box:hover {
  transform: translateY(-8px);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.stat-box i {
  font-size: 1.8rem;
  flex-shrink: 0;
  color: #fff;
  opacity: 0.9;
}

.stat-box h3 {
  font-size: clamp(1rem, 1.8vw, 1.4rem); /* Fluid font size */
  font-weight: 800;
  opacity: 0.95;
  margin-bottom: 6px;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  line-height: 1.2;
}

.stat-box p {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem); /* Fluid font size for numbers */
  font-weight: 900;
  margin: 0;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  line-height: 1.1;
}

.cyan-bg   { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.purple-bg { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.green-bg  { background: linear-gradient(135deg, #059669, #10b981); }
.orange-bg { background: linear-gradient(135deg, #d97706, #fbbf24); color: #000; }
.orange-bg h3, .orange-bg p { color: #000; }
.blue-bg   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.red-bg    { background: linear-gradient(135deg, #e11d48, #fb7185); }
.indigo-bg { background: linear-gradient(135deg, #4f46e5, #818cf8); }
.teal-bg   { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.status-card { background: rgba(0,0,0,0.2) !important; }

/* Sub-info rows in dashboard cards */
.sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.88rem;
  gap: 10px;
}

.sub-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.badge-blue  { background: rgba(59,130,246,0.15);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

.value-text {
  font-weight: 700;
  color: #e2e8f0;
  font-size: 0.85rem;
  text-align: left;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Notes Panel */
.notes-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.notes-panel textarea {
  width: 100%;
  min-height: 130px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 12px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.notes-panel textarea:focus {
  border-color: rgba(59,130,246,0.4);
}

/* Support Banner */
.support-banner {
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(5,150,105,0.05));
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.support-banner a {
  color: #10b981;
  text-decoration: none;
  font-weight: 700;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   OVERVIEW RESPONSIVE — TABLET
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 1100px) {
  .stats-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .main-column { order: 1; }
  .side-column { order: 2; }
  .stats-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   OVERVIEW RESPONSIVE — MOBILE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 600px) {
  .welcome-banner { padding: 14px 16px; }
  .welcome-text { font-size: 1.05rem; }

  /* Stats: 2 cols on mobile */
  .stats-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* The spanning status card resets to full width */
  .status-card { grid-column: span 2 !important; }

  .stat-box { padding: 12px 14px; gap: 10px; }
  .stat-box i { font-size: 1.4rem; }
  .stat-box h3 { font-size: 0.75rem; }
  .stat-box p { font-size: 1rem; }

  .sub-row { font-size: 0.82rem; padding: 8px 0; }
  .value-text { max-width: 90px; font-size: 0.78rem; }

  .support-banner { flex-direction: column; text-align: center; gap: 8px; font-size: 0.82rem; }

  .notes-panel { padding: 14px; }
  .notes-panel textarea { min-height: 100px; }
}

@media (max-width: 380px) {
  .stats-cards-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-box { padding: 10px; gap: 8px; }
  .stat-box i { font-size: 1.2rem; }
  .stat-box p { font-size: 0.9rem; }
}

/* Legacy stat-card (map topbar) */
.stats-cards {
  display: flex;
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 1rem 1.5rem;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 180px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

.stat-card:hover { transform: translateY(-5px); }
.stat-icon { font-size: 1.8rem; color: var(--text-secondary); }
.online-card .stat-icon { color: var(--color-green); }
.offline-card .stat-icon { color: var(--color-red); }
.total-card .stat-icon { color: var(--color-primary); }
.stat-info h3 { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.stat-info h2 { font-size: 1.5rem; font-weight: 700; }


/* ══════════════════════════════════════════
   MAP PANEL — Full redesign
══════════════════════════════════════════ */

#map-panel {
  display: flex;
  flex-direction: column;
  height: 100%;      /* fill all of main-content */
  overflow: hidden;  /* children manage their own scroll */
}

/* ── Enhanced Map Top Bar ── */
.map-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(25px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  z-index: 100;
  flex-shrink: 0;
  gap: 20px;
}

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

.map-topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Title Block */
.map-title-block {
  display: flex;
  align-items: center;
  gap: 15px;
}

.map-pulse-icon {
  width: 45px;
  height: 45px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  animation: radar-spin 4s linear infinite;
}

@keyframes radar-spin {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(10deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(-10deg); }
  100% { transform: rotate(0deg); }
}

.map-title-text {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}

.map-subtitle-text {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

/* Separators */
.map-separator {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.1);
}

/* Network Selector */
.map-network-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  padding: 8px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: 0.3s;
}

.map-network-select-wrap:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(59, 130, 246, 0.4);
}

.map-network-select-wrap i { color: #60a5fa; font-size: 0.9rem; }

.map-net-select {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

/* Stat Group */
.map-stat-group {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 8px;
  backdrop-filter: blur(5px);
}

.map-stat-pill {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 24px;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.stat-pill-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.stat-pill-val {
  font-size: 1.4rem;
  font-weight: 900;
  display: block;
}

.stat-pill-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.total-pill { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.2); }
.online-pill { background: rgba(16, 185, 129, 0.12); color: #34d399; border-color: rgba(16, 185, 129, 0.2); }
.offline-pill { background: rgba(239, 68, 68, 0.12); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }

.map-stat-pill i {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 10px currentColor);
}

.map-stat-pill:hover {
  transform: translateY(-5px) scale(1.05);
  border-color: currentColor;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px -5px currentColor;
  filter: brightness(1.3);
}

.map-stat-pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: 0.5s;
}

.map-stat-pill:hover::before {
  left: 100%;
}

/* Live Status Section */
.map-stat-pill:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.2);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.map-network-select-wrap:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.map-live-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 6px 6px 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.live-dot-wrap {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  animation: pulse-ring 2s infinite cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.refresh-circle-btn i { transition: transform 0.4s ease; }
.refresh-circle-btn:active i { transform: rotate(180deg); }

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

#mikrotik-connection-text {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
}

.sync-time {
  font-size: 0.65rem;
  color: #64748b;
}

/* Action Buttons */
.refresh-circle-btn, .action-circle-btn, .back-to-ov-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.refresh-circle-btn:hover, .action-circle-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  transform: translateY(-2px);
}

.back-to-ov-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.action-circle-btn { position: relative; }

/* Quick Dropdowns */
.map-quick-dropdown { position: relative; }

.map-dropdown-panel {
  position: absolute;
  top: 48px;
  left: 0;
  z-index: 999;
  min-width: 320px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 15px;
  animation: dropdownSlide 0.3s ease-out;
}

@keyframes dropdownSlide {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive adjustments for map-topbar */
@media (max-width: 1024px) {
  .map-topbar { padding: 12px 15px; gap: 12px; }
  .map-topbar-center { order: 3; width: 100%; display: flex; justify-content: center; } /* Keep stats visible */
  .map-stat-group { width: 100%; justify-content: center; gap: 8px; overflow-x: auto; padding-bottom: 5px; }
  .map-stat-pill { min-width: auto; padding: 6px 12px; height: auto; }
  .map-title-text { font-size: 0.95rem; }
  .map-subtitle-text { font-size: 0.7rem; }
}

@media (max-width: 768px) {
  .map-topbar { flex-wrap: wrap; height: auto; padding: 12px; gap: 15px; }
  .map-topbar-right, .map-topbar-left { width: 100%; justify-content: space-between; }
  .map-separator { display: none; }
  .map-stat-pill { flex: 1; justify-content: center; min-width: 75px; padding: 6px 8px; }
  .map-stat-pill .stat-pill-label { display: block; font-size: 0.6rem; } /* labels restored */
  .map-stat-pill .stat-pill-val { font-size: 0.85rem; }
  .map-stat-pill i { font-size: 1.1rem; }
}

/* ── Server IP Bar ── */
.map-server-bar {
  flex-shrink: 0;
  padding: 8px 20px;
  background: rgba(251,191,36,0.05);
  border-bottom: 1px solid rgba(251,191,36,0.15);
}

.map-server-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 860px;
}

.server-bar-label {
  color: #cbd5e1;
  font-size: 0.85rem;
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
}

.server-ip-input {
  flex: 1;
  min-width: 0;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  color: #f1f5f9;
  padding: 5px 12px;
  font-family: 'Tajawal', monospace, sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.server-ip-input:focus {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 0 3px rgba(251,191,36,0.1);
}

.server-ip-input::placeholder {
  color: #475569;
  font-style: italic;
}

.server-ip-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 3px 10px;
  flex-shrink: 0;
}

/* ── Map Canvas ── */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;   /* No internal scroll — map fills the screen */
  min-height: 0;
}

.map-wrapper {
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(59,130,246,0.06) 0%, transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(99,102,241,0.05) 0%, transparent 50%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 100%,
    50px 50px,
    50px 50px;
  position: relative;
  border-radius: 0;
  border: none;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.5);
  overflow: hidden;
  touch-action: none;
}

/* ── Router Nodes ── */
.router-node {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  animation: node-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: box-shadow 0.3s;
}

.router-node:active { cursor: grabbing; }

@keyframes node-pop-in {
  from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Inner Core */
.router-node::before {
  content: "";
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 0 4px rgba(255,255,255,0.8);
}

/* Ping Ring */
.router-node::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 1;
  animation: router-ping 2.5s cubic-bezier(0,0,0.2,1) infinite;
}

.router-online {
  background: radial-gradient(circle, #10b981, #059669);
  box-shadow: 0 0 18px rgba(16,185,129,0.7), 0 0 40px rgba(16,185,129,0.3);
}
.router-online::after {
  background-color: rgba(16,185,129,0.5);
}

.router-offline {
  background: radial-gradient(circle, #ef4444, #dc2626);
  box-shadow: 0 0 18px rgba(239,68,68,0.7), 0 0 40px rgba(239,68,68,0.3);
}
.router-offline::after {
  background-color: rgba(239,68,68,0.5);
  animation: router-ping-fast 1.2s cubic-bezier(0,0,0.2,1) infinite;
}

/* ── Main Server Node — Premium Golden Style ── */
.server-map-node {
  z-index: 20 !important;
  width: 70px !important;
  height: 70px !important;
  border-radius: 22px !important;
  background: linear-gradient(135deg, #78350f, #d97706, #fbbf24) !important;
  border: 3px solid rgba(255, 255, 255, 0.3) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: grab !important;
  animation: server-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
  position: absolute !important;
  transform: translate(-50%, -50%) !important;
  user-select: none;
}

/* Remove default router-node dot */
.server-map-node::before {
  display: none !important;
}

/* Animated glow ring */
.server-map-node::after {
  content: "" !important;
  position: absolute !important;
  inset: -12px !important;
  border-radius: 30px !important;
  border: 2px solid rgba(251, 191, 36, 0.5) !important;
  animation: srv-ring-pulse 2.5s ease-out infinite !important;
  opacity: 0.8 !important;
  background: transparent !important;
  width: auto !important;
  height: auto !important;
  box-shadow: none !important;
}

.server-map-node .premium-server-icon {
  font-size: 1.7rem;
  color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  pointer-events: none;
}

@keyframes server-bounce-in {
  0%   { transform: translate(-50%, -50%) scale(0.2) rotate(-15deg); opacity: 0; }
  70%  { transform: translate(-50%, -50%) scale(1.05) rotate(3deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

@keyframes srv-ring-pulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0;   }
}

@keyframes srv-pulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0;   }
}

/* Override the generic router-node ping animation on server */
.server-map-node.router-online,
.server-map-node.router-offline {
  background: linear-gradient(135deg, #78350f, #d97706, #fbbf24) !important;
}

.server-map-node.router-online {
  box-shadow: 0 0 20px rgba(251,191,36,0.5), 0 0 60px rgba(16,185,129,0.25) !important;
}

.server-map-node.router-offline {
  box-shadow: 0 0 20px rgba(251,191,36,0.3), 0 0 60px rgba(239,68,68,0.3) !important;
}

.router-label {
  position: absolute;
  top: -65px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,42,0.9);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  transform: translateX(-50%) translateY(10px);
  backdrop-filter: blur(12px);
  min-width: 130px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.router-node:hover .router-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  z-index: 10;
}

/* Always-visible name+status label below router node */
.router-badge {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
}

.router-badge-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(0,0,0,0.65);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.router-badge-status {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.02em;
}

/* Map Controls — fixed at bottom-left corner of map-container */
.map-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 20;
}

.pan-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,23,42,0.85);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
  pointer-events: all;
  font-size: 0.85rem;
}

.pan-btn:hover {
  background: rgba(59,130,246,0.25);
  border-color: rgba(59,130,246,0.5);
  color: #60a5fa;
  transform: scale(1.1);
}

.center-btn {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.3);
  color: #60a5fa;
}

/* Animations */
@keyframes router-ping {
  0%   { transform: scale(1); opacity: 0.8; }
  75%,100% { transform: scale(2.8); opacity: 0; }
}

@keyframes router-ping-fast {
  0%   { transform: scale(1); opacity: 0.8; }
  75%,100% { transform: scale(3.5); opacity: 0; }
}

@keyframes server-pulse {
  0%, 100% { box-shadow: 0 0 15px currentColor, 0 0 30px currentColor; transform: scale(1); }
  50%       { box-shadow: 0 0 25px currentColor, 0 0 50px currentColor; transform: scale(1.05); }
}


/* Scrollbar customizations */
.custom-scrollbar::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--bg-darker);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — All screen sizes
══════════════════════════════════════════════════ */

/* ── Desktop large (1400px+) ── */
@media (min-width: 1400px) {
  .sidebar { width: 260px; }
  .map-topbar { padding: 14px 28px; }
  .map-title-text { font-size: 1.1rem; }
}

/* ── Laptop/medium (900px – 1399px) ── */
@media (max-width: 1399px) and (min-width: 901px) {
  .sidebar { width: 220px; }
  .map-topbar { padding: 10px 16px; gap: 8px; }
  .map-title-text { font-size: 0.95rem; }
  .map-stat-pill { padding: 5px 10px; font-size: 0.78rem; }
  .map-conn-pill { padding: 5px 10px; font-size: 0.75rem; }
}

/* ── Tablet + small laptop (600px – 900px) ── */
@media (max-width: 900px) {
  .dashboard-container {
    flex-direction: column;
    overflow: hidden;
    height: 100dvh;
  }

  /* Sidebar becomes top bar */
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-left: none;
    border-bottom: 1px solid var(--border-card);
    flex-shrink: 0;
    gap: 8px;
  }

  .logo-box {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .logo-box img { width: 80px !important; }
  .logo-box h1 { font-size: 1rem; margin-bottom: 0; }
  .logo-box p  { display: none; }

  .sidebar-nav { display: none; }

  .mikrotik-status {
    margin-top: 0;
    padding: 0.4rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
  }

  .mikrotik-status p { display: none; }
  .status-indicator, .timer-box { margin-top: 0; }

  /* Main content fills remaining height */
  .main-content {
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }

  /* Overview panel scrollable */
  #overview-panel {
    height: 100%;
    overflow-y: auto;
  }

  .top-header { flex-direction: column; padding: 1rem; gap: 0.8rem; }

  .stats-cards { width: 100%; overflow-x: auto; padding-bottom: 5px; flex-wrap: nowrap; }
  .stat-card   { min-width: 130px; padding: 0.7rem 0.9rem; }
  .stat-icon   { font-size: 1.3rem; }
  .stat-info h2{ font-size: 1.1rem; }

  /* Map topbar: stack vertically */
  .map-topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    gap: 8px;
  }

  .map-topbar-right,
  .map-topbar-left {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .map-pulse-icon { width: 34px; height: 34px; font-size: 0.9rem; }
  .map-title-text { font-size: 0.88rem; }
  .map-subtitle-text { display: none; }

  .map-stat-pill { padding: 4px 10px; font-size: 0.75rem; }
  .map-conn-pill { padding: 4px 10px; font-size: 0.72rem; }
  .map-conn-pill span#mikrotik-connection-text { max-width: 90px; }

  .map-server-bar { padding: 6px 14px; }
  .map-server-bar-inner { gap: 8px; }
  .map-server-bar-inner span { font-size: 0.78rem; }
  #server-ip-status { display: none !important; }

  .map-container { padding: 0; overflow: hidden; }
  .map-wrapper   { width: 100%; height: 100%; }

  .map-controls { bottom: 10px; right: 10px; }
  .pan-btn { width: 34px; height: 34px; font-size: 0.8rem; }

  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
  }
}

/* ── Phone (under 600px) ── */
@media (max-width: 599px) {
  .sidebar { padding: 0.5rem 0.8rem; }
  .logo-box img { width: 60px !important; }
  .logo-box h1  { font-size: 0.85rem; }

  /* Map topbar extra compact */
  .map-topbar { padding: 8px 10px; gap: 6px; }
  .map-pulse-icon { width: 28px; height: 28px; font-size: 0.8rem; }
  .map-title-text { font-size: 0.8rem; }
  .map-network-select-wrap { padding: 4px 8px; }
  .map-net-select { min-width: 100px; font-size: 0.8rem; }

  .map-stat-pill { padding: 3px 8px; font-size: 0.7rem; gap: 4px; }
  .map-stat-pill small { display: none; }
  .map-conn-pill { padding: 3px 8px; font-size: 0.68rem; gap: 5px; }

  .map-server-bar { padding: 5px 10px; }
  .map-server-bar-inner span:first-of-type { display: none; }

  .map-container { padding: 0; overflow: hidden; }
  .map-wrapper   { width: 100%; height: 100%; }

  .pan-btn { width: 30px; height: 30px; font-size: 0.75rem; }

  /* Overview stats stacked 2-col */
  .stats-cards-grid { grid-template-columns: 1fr 1fr !important; }
}

/* Settings Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background-color: var(--bg-darker);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  width: auto;
  min-width: 320px;
  max-width: 95%;
  max-height: 95vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: modalScaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-header {
  background: rgba(255, 255, 255, 0.02);
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-card);
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: #fff;
}
.close-btn {
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: 0.3s;
  line-height: 1;
}
.close-btn:hover {
  color: var(--color-red);
  transform: rotate(90deg);
}
.modal-body {
  padding: 25px;
  overflow-y: auto;
  flex-grow: 1;
}
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.form-group input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}
.form-group input:focus {
  border-color: var(--color-primary);
}
.save-btn {
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
  margin-top: 10px;
}
.save-btn:hover {
  background: #2563eb;
}
#settings-msg {
  margin-top: 15px;
  text-align: center;
  font-size: 0.9rem;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table Styles */
.styled-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-primary);
}
.styled-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  margin: 0 5px;
  font-size: 1.1rem;
  transition: 0.2s;
}
.action-btn.edit {
  color: var(--color-primary);
}
.action-btn.delete {
  color: var(--color-red);
}
.action-btn:hover {
  transform: scale(1.2);
}

/* Improved Styled Table for Netwatch */
.styled-table-wrapper {
  background: rgba(10, 15, 25, 0.4);
  border-radius: 12px;
  border: 1px solid var(--border-card);
  overflow: hidden;
  margin-top: 15px;
}
.styled-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}
.styled-table thead tr {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
  text-align: right;
  font-weight: bold;
  border-bottom: 2px solid var(--color-primary);
}
.styled-table th {
  padding: 15px 12px;
}
.styled-table tbody tr {
  border-bottom: 1px solid var(--border-card);
  transition: all 0.2s ease-in-out;
}
.styled-table tbody tr:nth-of-type(even) {
  background-color: rgba(255, 255, 255, 0.01);
}
.styled-table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.05);
  transform: scale(1.01);
}
.styled-table td {
  padding: 15px 12px;
}
.status-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-block;
}
.status-online {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-offline {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.actions-container {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-modern {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.3s;
}
.btn-modern.edit {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
}
.btn-modern.edit:hover {
  background: var(--color-primary);
  color: white;
}
.btn-modern.delete {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-red);
}
.btn-modern.delete:hover {
  background: var(--color-red);
  color: white;
}

/* Beautiful Glowing Overlay on Hover */
.styled-table-wrapper {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.modal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--bg-darker);
}
.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
  background-color: var(--color-primary);
  border-radius: 10px;
}

.btn-modern.edit-ip {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}
.btn-modern.edit-ip:hover {
  background: #f59e0b;
  color: white;
}

.btn-modern.link-ip {
  background: rgba(139, 69, 19, 0.1); /* Brown tint */
  color: #8b4513;
}
.btn-modern.link-ip:hover {
  background: #8b4513;
  color: white;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInLeft 0.5s ease forwards;
  min-width: 300px;
  max-width: 400px;
}
.toast-online {
  background: var(--color-green);
  border-left: 5px solid #047857; /* Left because RTL is right side in logic? Wait, document is RTL. left goes opposite */
  border-right: 5px solid #047857;
}
.toast-offline {
  background: var(--color-red);
  border-right: 5px solid #b91c1c;
}
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Map Navigation Controls */
.map-controls {
  position: absolute;
  bottom: 40px;
  right: 40px;
  display: grid;
  grid-template-columns: 45px 45px 45px;
  grid-template-rows: 45px 45px 45px;
  gap: 5px;
  z-index: 100;
}
.map-controls #pan-up {
  grid-column: 2;
  grid-row: 1;
}
.map-controls #pan-down {
  grid-column: 2;
  grid-row: 3;
}
.map-controls #pan-left {
  grid-column: 1;
  grid-row: 2;
}
.map-controls #pan-right {
  grid-column: 3;
  grid-row: 2;
}
.map-controls #pan-center {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.9rem;
}

.pan-btn {
  background: rgba(20, 27, 45, 0.9);
  border: 1px solid var(--color-primary);
  color: var(--text-primary);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.pan-btn:hover {
  background: var(--color-primary);
  color: white;
  transform: scale(1.1);
}
.pan-btn:active {
  transform: scale(0.95);
}

/* Network Selector specific styles */
.network-selector-container {
  padding: 0 1rem 1rem 1rem;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 1rem;
}
.network-selector-container label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
  display: block;
}
.network-select {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
}
.network-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Networks Modal List & Premium Forms */
.networks-panel {
  animation: modalScaleUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  background: linear-gradient(135deg, #0f172a, #020617);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-container-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 25px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

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

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.premium-form .form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.premium-form .form-group label i {
  color: var(--color-primary);
  opacity: 0.7;
}

.premium-form input {
  width: 100%;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: white;
  transition: all 0.3s ease;
}

.premium-form input:focus {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  outline: none;
}

.premium-btn {
  background: linear-gradient(135deg, var(--color-primary), #1e40af);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: 0.4s;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.premium-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
  filter: brightness(1.1);
}

.networks-list-container {
  margin-top: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.networks-list {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 5px;
}

.network-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 15px 20px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  transition: 0.3s;
}

.network-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--color-primary);
  transform: translateX(-5px);
}

.network-item-info h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.network-item-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  gap: 15px;
}

.network-item-actions {
  display: flex;
  gap: 8px;
}

.network-item-actions button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0,0,0,0.2);
}

.network-item-actions .edit { color: #60a5fa; }
.network-item-actions .edit:hover { background: #3b82f6; color: white; border-color: #3b82f6; }

.network-item-actions .delete { color: #f87171; }
.network-item-actions .delete:hover { background: #ef4444; color: white; border-color: #ef4444; }

/* Animated Tech Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, #0d1221 0%, #060810 100%);
  overflow: hidden;
}
.animated-bg::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%233b82f6" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
  opacity: 0.8;
  animation: slideBg 100s linear infinite;
}
@keyframes slideBg {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(50%, 50%);
  }
}

/* Glassmorphism Auth Box */
.glass-auth-box {
  background: rgba(16, 21, 35, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 450px;
  margin: auto;
  text-align: right; /* RTL Base */
  position: relative;
  overflow: hidden;
}
.glass-auth-box::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-header h2 {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(to right, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}
.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-input-group {
  position: relative;
  margin-bottom: 1.5rem;
}
.auth-input-group i {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 15px; /* RTL */
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: 0.3s;
}
.auth-input-group input {
  width: 100%;
  padding: 14px 45px 14px 15px; /* Space for icon right */
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}
.auth-input-group input:focus {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  outline: none;
}
.auth-input-group input:focus + i {
  color: var(--color-primary);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
  position: relative;
  overflow: hidden;
}
.auth-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-20deg);
  transition: 0.5s;
}
.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}
.auth-btn:hover::after {
  left: 150%;
}
.auth-btn-alt {
  background: transparent;
  border: 2px solid var(--color-green);
  color: var(--color-green);
  box-shadow: none;
}
.auth-btn-alt:hover {
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.auth-switch a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
  transition: 0.3s;
  cursor: pointer;
}
.auth-switch a:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* Plans Design */
.plans-wrapper {
  margin-top: 15px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.plan-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
  position: relative;
}
.plan-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}
.plan-card.selected {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}
.plan-card h4 {
  color: white;
  font-size: 0.9rem;
  margin-bottom: 5px;
}
.plan-card .price {
  color: var(--color-green);
  font-weight: 700;
  font-size: 1.1rem;
}
.plan-card .desc {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 5px;
}
.plan-card input[type="radio"] {
  display: none;
}

/* Upgrade Specific Card Styles */
.upgrade-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 25px 15px !important;
  gap: 15px !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-radius: 24px !important;
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 200px;
  justify-content: center !important;
}

.upgrade-card:hover {
  background: rgba(59, 130, 246, 0.05) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  transform: translateY(-8px) !important;
  box-shadow: 0 15px 30px rgba(0,0,0,0.3) !important;
}

.upgrade-card.selected {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3) !important;
}

.upgrade-card .plan-icon-circle {
  width: 55px;
  height: 55px;
  flex-shrink: 0;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.6rem;
  transition: 0.4s;
  margin: 0 auto !important;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.upgrade-card .plan-info {
  flex-grow: 1;
}

.upgrade-card h4 {
  font-size: 1.05rem;
  margin-bottom: 2px;
  font-weight: 700;
  color: white;
}

.upgrade-card .price {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--color-green);
  margin: 5px 0;
  background: rgba(16, 185, 129, 0.08);
  padding: 5px 12px;
  border-radius: 10px;
  display: inline-block;
}

.upgrade-card .desc {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.6);
  min-height: 2.8em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrade-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.upgrade-card:hover .plan-icon-circle {
  transform: scale(1.1) rotate(-8deg);
  background: var(--color-primary);
  color: white;
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.upgrade-card.selected {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 2px var(--color-primary), 0 10px 40px rgba(59, 130, 246, 0.2);
  transform: translateY(-4px);
}

.upgrade-card.selected .plan-icon-circle {
  background: var(--color-primary);
  color: white;
}

.upgrade-card.highlight {
  border-color: #fbbf24;
}

.upgrade-card.highlight.selected {
  box-shadow: 0 0 0 2px #fbbf24, 0 10px 40px rgba(251, 191, 36, 0.2);
}

.yearly-card {
  border-style: solid;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.03), rgba(255, 255, 255, 0.02));
}

.section-title {
  position: relative;
  padding-right: 15px;
}

.section-title::before {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 18px;
  background: var(--color-primary);
  border-radius: 10px;
}

.section-title.yearly::before {
  background: #fbbf24;
}

.premium-upgrade-btn {
  background: linear-gradient(135deg, var(--color-primary), #1d4ed8);
  color: white;
  border: none;
  padding: 15px 20px;
  border-radius: 15px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.premium-upgrade-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, #4f46e5, var(--color-primary));
}

.premium-upgrade-btn i {
  color: #fbbf24;
  font-size: 1.1rem;
  animation: crownBounce 2s infinite ease-in-out;
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-3px) rotate(8deg); }
}

@keyframes modalScaleUp {
  0% { opacity: 0; transform: scale(0.95) translateY(30px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

#plans-modal .modal-content {
  animation: modalScaleUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  background: linear-gradient(to bottom right, #0f172a, #020617);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* CSS Animations for Landing Page */
.fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  opacity: 0;
  transform: translateY(30px);
}
.delay-1 {
  animation-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.6s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating Animation */
.floating {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Enhancing Feature Cards */
.feature-card {
  position: relative;
  overflow: hidden;
}
.feature-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: 0.5s;
  pointer-events: none;
}
.feature-card:hover::after {
  opacity: 1;
}

/* Enhancing Navbar on Scroll */
.navbar.scrolled {
  background: rgba(6, 8, 16, 0.98);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  padding: 10px 5%;
}

/* User Profile Card in Sidebar */
.user-profile-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}
.user-profile-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.user-profile-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.user-profile-card .user-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.user-profile-card .user-name {
  font-weight: 700;
  color: white;
  font-size: 0.95rem;
}
.user-profile-card .user-role {
  font-size: 0.75rem;
  color: #fbbf24;
  margin-top: 2px;
}
.user-profile-card .admin-role {
  color: #10b981;
}
.user-profile-card .logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: 0.3s;
}
.user-profile-card .logout-btn:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

/* Mega-Tik Style Dashboard Overview */
/* Removed dupe */
/* Removed dupe layout */

/* Main Column */
/* Removed dupe */
/* welcome-text consolidated in line 963 */
.welcome-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}
.btn-app {
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
}
.btn-win {
  background: #ef4444;
}
.btn-win:hover {
  background: #dc2626;
}
.btn-mob {
  background: #3b82f6;
}
.btn-mob:hover {
  background: #2563eb;
}

/* Stat Boxes */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat-box {
  padding: 25px;
  border-radius: 12px;
  color: white;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.stat-box:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}
.stat-box i {
  font-size: 2.5rem;
  opacity: 0.8;
  transition: 0.3s;
}
.stat-box:hover i {
  transform: scale(1.1) rotate(5deg);
  opacity: 1;
}
.stat-box h3 {
  font-size: 1rem;
  margin-bottom: 5px;
  opacity: 0.9;
  font-weight: 500;
}
.stat-box p {
  font-size: 1.2rem;
  font-weight: 700;
}
.cyan-bg {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}
.purple-bg {
  background: linear-gradient(135deg, #6366f1, #818cf8);
}
.green-bg {
  background: linear-gradient(135deg, #10b981, #34d399);
}
.blue-bg {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}
.orange-bg {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
}

.status-card {
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.status-card:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--color-primary) !important;
}

.status-indicator-premium {
  position: relative;
  width: 15px;
  height: 15px;
}
.status-indicator-premium .dot {
  width: 100%;
  height: 100%;
  position: absolute;
}


/* Animations added */
@keyframes entrySlideUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}
.animated-entry {
  animation: entrySlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.animated-card {
  opacity: 0;
  animation: entrySlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.card-1 { animation-delay: 0.1s; }
.card-2 { animation-delay: 0.2s; }
.card-3 { animation-delay: 0.3s; }

/* Support Banner */
.support-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 20px 25px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-secondary);
  font-size: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.support-banner i {
  color: #3b82f6;
  font-size: 1.6rem;
}
.support-banner a {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 800;
  transition: 0.3s;
}
.support-banner a:hover {
  filter: brightness(1.2);
}

/* Notes Panel */
.notes-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.notes-panel h3 {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text-primary);
}
.notes-panel textarea {
  width: 100%;
  flex-grow: 1;
  min-height: 180px;
  background: var(--bg-deep);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 15px;
  font-size: 1rem;
  line-height: 1.6;
  resize: none;
  font-family: inherit;
  outline: none;
  transition: 0.3s;
}
.notes-panel textarea:focus {
  border-color: var(--color-primary);
  background: var(--bg-card);
}

/* Side Column (Subscription) */
.side-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 20px;
}
.dashboard-card h3.card-title {
  text-align: center;
  font-size: 1.15rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-weight: 800;
}
.sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 12px;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-secondary);
}
.sub-row:last-child {
  border-bottom: none;
}
.sub-badge {
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
}
.badge-green {
  background: #10b981;
}
.badge-blue {
  background: #3b82f6;
}
.value-text {
  color: var(--color-primary); /* Use primary color instead of hardcoded light blue */
  font-weight: bold;
  font-size: 1.15rem;
}

/* Balance Card */
.balance-top {
  display: flex;
  justify-content: space-between;
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
}
.balance-top p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 5px;
}
.balance-top h4 {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 800;
}
.balance-top h4.text-red {
  color: #ef4444;
}
.balance-actions {
  display: flex;
  gap: 10px;
}
.balance-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.btn-green {
  background: #10b981;
}
.btn-green:hover {
  background: #059669;
}
.btn-blue {
  background: #6366f1;
}
.btn-blue:hover {
  background: #4f46e5;
}

/* Move user profile to top header */

/* ─── ULTIMATE GLOBAL HEADER ─── */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 25px;
  background: rgba(10, 12, 20, 0.85); /* Glass Background */
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid var(--border-glass);
  z-index: 1001;
  min-height: 70px;
  transition: background 0.3s ease;
}

.top-nav-left {
  display: flex;
  align-items: center;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 10px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.icon-btn-premium {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-size: 1.1rem;
}

.icon-btn-premium:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-2px);
}

.icon-btn-premium i {
  transition: transform 0.3s ease;
}

.icon-btn-premium:hover i {
  transform: scale(1.1);
}

/* Specific Notification Glow */
#notif-btn.has-new-notif::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--bg-main);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* ─── PREMIUM PROFILE DROP-CLICK ─── */
.profile-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 14px 6px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
}

.profile-dropdown-container:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.profile-dropdown-container .profile-info {
  display: flex;
  flex-direction: column;
  text-align: right;
  padding-right: 5px;
}

.profile-dropdown-container .profile-name {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.2;
}

.profile-dropdown-container .profile-role {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 700;
}

.profile-dropdown-container .avatar-wrapper {
  width: 38px;
  height: 38px;
  position: relative;
}

.profile-dropdown-container .avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.05);
}

/* Dropdown Menu Style - Standardized */
.profile-menu {
  position: absolute;
  top: calc(100% + 15px);
  left: 0;
  width: 260px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 2005;
  transform: translateY(15px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-dropdown-container.active .profile-menu {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.profile-menu-header {
  padding: 20px 15px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px;
}

.profile-menu-header h4 { margin: 8px 0 2px; font-weight: 800; font-size: 1rem; }
.profile-menu-header p { margin: 0; font-size: 0.75rem; color: #64748b; }

.profile-menu-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 12px;
  transition: 0.2s;
}

.profile-menu-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.profile-menu-links a i { font-size: 1.1rem; width: 20px; text-align: center; color: #3b82f6; }
.profile-menu-links .logout-link { color: #ef4444 !important; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 5px; padding-top: 15px; }
.profile-menu-links .logout-link i { color: #ef4444; }

/* Desktop Adjustment for centering scroll content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.overview-panel {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 50px !important;
  scroll-behavior: smooth;
}

/* Mobile responsive fixes */
@media (max-width: 900px) {
  .top-navbar { padding: 10px 15px; }
  .profile-menu { width: 240px; }
  .profile-info { display: none; } /* Hide text info on mobile chip */
}

/* Adjust Sidebar to not have user profile */
.sidebar .logo-box {
  margin-bottom: 2rem;
}

.nav-brand-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}
.nav-logo { height: 40px; }

@media (max-width: 900px) {
    .nav-brand-center { display: none; }
}

.status-dot-active {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #0a0c14;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Dropdown Menu */
@keyframes dropdownBounce {
  0% { opacity: 0; transform: translateY(15px) scale(0.95); }
  60% { opacity: 1; transform: translateY(-2px) scale(1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- ORGANIZED PREMIUM DROPDOWNS --- */
.notif-menu, .profile-menu {
  position: absolute;
  top: calc(100% + 15px);
  background: var(--bg-darker);
  border: 1px solid var(--border-glass) !important;
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 2000;
  overflow: visible; /* To see the arrow */
}

/* Dropdown Arrow for Laptop/Desktop */
.notif-menu::before, .profile-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 20px;
  width: 16px;
  height: 16px;
  background: var(--bg-darker);
  border-left: 1px solid var(--border-glass);
  border-top: 1px solid var(--border-glass);
  transform: rotate(45deg);
  z-index: -1;
}

.profile-dropdown-container.active .profile-menu,
.notification-dropdown-container.active .notif-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-menu {
  left: 0;
  right: auto;
  width: 290px;
}

.profile-menu-header {
  padding: 30px 20px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.03), transparent);
}

.profile-menu-header .large-avatar {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  margin: 0 auto 15px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  object-fit: cover;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.profile-menu-header h4 {
  color: var(--text-primary);
  font-size: 1.5rem; /* Extra Large */
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
}

.profile-menu-header p {
  color: var(--text-secondary);
  font-size: 1.15rem; /* Very readable */
  margin: 6px 0 0;
}

.profile-menu-links {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-menu-links a {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 14px;
  font-size: 1.25rem; /* Large and bold */
  font-weight: 700;
  transition: all 0.25s ease;
}

.profile-menu-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transform: translateX(-5px);
}

.profile-menu-links a i {
  font-size: 1.15rem;
  color: #3b82f6;
  width: 24px;
  text-align: center;
}

.profile-menu-links .logout-link {
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.05);
  margin-top: 10px;
  padding: 14px 18px !important;
}

.profile-menu-links .logout-link:hover {
  background: #ef4444;
  color: #fff !important;
}

.profile-menu-links .logout-link i {
  color: inherit !important;
}

.notif-menu {
  width: 380px !important;
  left: 0 !important;
  right: auto !important;
  max-height: 550px;
  display: flex;
  flex-direction: column;
}

/* 📱 Responsive Mobile Adjustments for Menus */
@media (max-width: 600px) {
  .notif-menu, .profile-menu {
    position: fixed !important; /* Use fixed for better stability on mobile */
    top: 75px !important;
    left: 15px !important; /* Stick to left side because they are in the left half of the screen in RTL */
    right: auto !important;
    width: 300px !important;
    max-width: calc(100vw - 30px) !important;
    margin: 0 !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
    max-height: 80vh !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 99999 !important;
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-sizing: border-box !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: translateY(10px) !important;
  }

  /* When Active */
  .notification-dropdown-container.active .notif-menu,
  .profile-dropdown-container.active .profile-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    transform: translateY(0) !important;
  }

  /* Compact header for mobile */
  .profile-menu-header {
    padding: 25px 20px !important;
    text-align: center;
  }
  
  .profile-menu-header img {
    width: 65px !important;
    height: 65px !important;
  }

  .profile-menu-links a {
    padding: 15px 20px !important;
    font-size: 1.1rem !important;
    border-radius: 12px !important;
  }

  .notif-item {
    padding: 12px 15px !important;
  }

  /* Hide the little arrow on mobile to prevent alignment issues */
  .notif-menu::before, .profile-menu::before {
    display: none !important;
  }
}

.notif-header {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-header h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.mark-read {
  font-size: 0.75rem;
  color: #3b82f6;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

.mark-read:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.notif-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 20px;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  border-radius: 12px;
  margin: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(-5px);
}

/* Type Specific Colors (Requested) */
.notif-item.online {
  background: rgba(16, 185, 129, 0.08);
  border-right: 4px solid #10b981;
}
.notif-item.online:hover {
  background: rgba(16, 185, 129, 0.15);
}

.notif-item.offline {
  background: rgba(239, 68, 68, 0.08);
  border-right: 4px solid #ef4444;
}
.notif-item.offline:hover {
  background: rgba(239, 68, 68, 0.15);
}

.notif-item.admin-notif {
  background: rgba(245, 158, 11, 0.05);
  border-right: 4px solid #f59e0b;
}

.notif-item.unread {
  background: rgba(59, 130, 246, 0.05);
  box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
}

.notif-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem; /* Larger icon */
  position: relative;
}

/* Icon backgrounds based on type */
.notif-icon-wrap.online { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.notif-icon-wrap.offline { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.notif-icon-wrap.system { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }

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

.notif-title {
  color: var(--text-primary);
  font-size: 1.25rem; /* Massive clarity */
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 6px;
}

.notif-desc {
  color: var(--text-secondary);
  font-size: 1.15rem; /* Super readable */
  line-height: 1.5;
  margin: 0;
}

.notif-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.notif-time {
  font-size: 1rem; /* Clear time */
  color: #94a3b8;
}

.unread-dot {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Main Footer Bar */
.main-footer {
  background: var(--bg-darker);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-glass);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
  width: 100%;
}
.main-footer p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0;
}
.main-footer .version-tag {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6; /* Solid Blue for better visibility */
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 800;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PREMIUM NETWORKS MODAL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.networks-card {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 28px !important;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.9) !important;
    overflow: hidden !important;
}

.premium-input-box {
    position: relative;
    margin-bottom: 20px;
}

.premium-input-box i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-primary);
    font-size: 1.1rem;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.premium-input-box input, 
.premium-input-box textarea {
    width: 100%;
    padding: 15px 50px 15px 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.premium-input-box input:focus,
.premium-input-box textarea:focus {
    border-color: #3b82f6;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.15);
}

.premium-input-box input:focus + i {
    color: #60a5fa;
    transform: translateY(-50%) scale(1.15);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.network-item-premium {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.network-item-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-primary);
    opacity: 0;
    transition: 0.3s;
}

.network-item-premium:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(-10px);
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.3);
}

.network-item-premium:hover::before {
    opacity: 1;
}

.sync-toggle-card {
    background: rgba(0, 0, 0, 0.25);
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.3s;
}

.sync-toggle-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.sync-toggle-card select {
    background: #0f172a;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: #60a5fa;
    border-radius: 10px;
    padding: 8px 15px;
    font-weight: 800;
    cursor: pointer;
    outline: none;
    transition: 0.3s;
}

.sync-toggle-card select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
/* Global Royal Design System */
.p-card {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    padding: 20px;
    transition: all 0.5s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.p-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    z-index: 1;
}

.p-card-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 1.2rem;
    color: #60a5fa;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.p-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.p-card-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.p-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.p-detail-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.p-detail-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.p-detail-value {
    display: block;
    font-weight: 700;
    color: #e2e8f0;
    font-size: 1rem;
    font-family: 'Outfit', 'Tajawal', sans-serif;
}

.p-card-footer {
    margin-top: auto;
    display: flex;
    gap: 12px;
}

.p-action-btn {
    padding: 12px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    flex: 1;
}

.p-main-btn {
    width: 100%;
    margin-top: 15px;
    background: linear-gradient(to right, #1e293b, #0f172a);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #fff;
    padding: 14px;
    border-radius: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.p-main-btn:hover {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    transform: scale(1.02);
}

.p-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 40px;
    border: 2px dashed rgba(255, 255, 255, 0.05);
}

@keyframes pulse-wave {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(3); opacity: 0; }
}

/* --- System Pulse Premium Widget --- */
.system-pulse-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
    grid-column: span 3;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fadeIn 0.8s ease forwards;
}

@media (max-width: 900px) {
    .system-pulse-card {
        grid-column: span 2;
    }
}

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

.pulse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
}

.pulse-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.pulse-header .live-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 20px;
    align-items: center;
}

@media (max-width: 600px) {
    .pulse-body {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.pulse-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.pulse-ring {
    position: relative;
    width: 85px;
    height: 85px;
}

.pulse-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pulse-ring circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.pulse-ring .ring-bg {
    stroke: rgba(255,255,255,0.05);
}

.pulse-ring .ring-fill {
    stroke-dasharray: 226.2; /* 2 * PI * 36 (radius) */
    stroke-dashoffset: 226.2;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-cpu .ring-fill { stroke: #3b82f6; filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5)); }
.ring-ram .ring-fill { stroke: #8b5cf6; filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5)); }

.pulse-ring .ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    direction: ltr;
}

.pulse-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.uptime-vibe {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 18px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.03);
    position: relative;
    overflow: hidden;
}

.uptime-vibe::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.uptime-timer {
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 900;
    color: #2dd4bf;
    letter-spacing: 0.5px;
    margin-top: 8px;
    text-shadow: 0 0 15px rgba(45, 212, 191, 0.4);
    direction: ltr;
}

.uptime-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

