@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&family=Outfit:wght@300;400;600;700&display=swap');

:root {
  --bg-dark: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
  --bg-panel: rgba(255, 255, 255, 0.45);
  --border-color: rgba(255, 255, 255, 0.6);
  --text-main: #0f172a;
  --text-muted: #475569;
  --highlight-rgb: 5, 150, 105;
  --highlight: rgb(var(--highlight-rgb));
  --highlight-hover: #047857;
  --glass: rgba(255, 255, 255, 0.55);
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.06), inset 0 0 20px rgba(255, 255, 255, 0.4);
  --sidebar-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}



body {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Hide scrollbars globally but keep functionality if needed */
::-webkit-scrollbar {
  display: none;
}
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Liquid Metal Text Effect */
.liquid-metal-text {
  background: linear-gradient(to right, #6b6b6b 0%, #dbdbdb 10%, #ffffff 30%, #7d7d7d 50%, #f4f4f4 70%, #6b6b6b 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shineText 5s linear infinite;
  text-transform: uppercase;
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  letter-spacing: -1px;
}

@keyframes shineText { to { background-position: 200% center; } }

/* Layout Grid */
.dashboard-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--bg-panel);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 0 0 20px;
  box-shadow: var(--sidebar-shadow);
  z-index: 10;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
  transition: padding 0.3s ease;
  min-height: 230px;
  box-sizing: border-box;
}

.brand-logo {
  max-height: 200px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: all 0.3s ease;
  display: block;
  mix-blend-mode: multiply;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 12px;
  right: 15px;
  background: none !important;
  background-image: none !important;
  border: none !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  padding: 5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.2s, background-color 0.2s !important;
  border-radius: 4px !important;
  animation: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  z-index: 5;
}

.sidebar-toggle-btn:hover {
  color: var(--highlight) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 0 10px;
  transition: padding 0.3s ease;
}

/* Slim scrollbars for sidebar navigation and balances */
.nav-menu::-webkit-scrollbar,
#sidebar-node-balances::-webkit-scrollbar {
  display: block !important;
  width: 4px;
}
.nav-menu::-webkit-scrollbar-track,
#sidebar-node-balances::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.03);
  border-radius: 2px;
}
.nav-menu::-webkit-scrollbar-thumb,
#sidebar-node-balances::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 2px;
}
.nav-menu::-webkit-scrollbar-thumb:hover,
#sidebar-node-balances::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.3);
}
.nav-menu,
#sidebar-node-balances {
  scrollbar-width: thin !important;
  -ms-overflow-style: auto !important;
  scrollbar-color: rgba(15, 23, 42, 0.15) rgba(15, 23, 42, 0.03) !important;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-menu a svg {
  width: 20px; height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

.nav-menu a:hover, .nav-menu a.active {
  background: rgba(15, 23, 42, 0.03);
  color: var(--highlight);
  box-shadow: inset 3px 0 0 var(--highlight);
}

.nav-menu a.active svg {
  stroke: var(--highlight);
  filter: drop-shadow(0 0 5px rgba(var(--highlight-rgb), 0.3));
}

/* Sidebar Admin links & Titles */
.admin-title {
  font-family: 'Fira Code', monospace;
  font-size: 0.6rem;
  color: var(--highlight);
  margin: 10px 0 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}
.admin-link {
  color: var(--text-muted) !important;
  font-size: 0.75rem !important;
  display: flex !important;
  align-items: center !important;
  padding: 8px 12px !important;
  margin: 3px 0 !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid var(--border-color) !important;
}
.admin-link:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  color: var(--text-main) !important;
  border-color: var(--highlight) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}
.admin-link svg {
  margin-right: 8px;
  flex-shrink: 0;
}

/* Sidebar Custom Buttons & Inputs */
.sidebar-input {
  background: rgba(255, 255, 255, 0.5) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  color: var(--text-main) !important;
  padding: 8px 10px !important;
  font-family: monospace !important;
  font-size: 0.7rem !important;
  outline: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}
.sidebar-input:focus {
  background: #ffffff !important;
  border-color: var(--highlight) !important;
  box-shadow: 0 0 10px rgba(var(--highlight-rgb), 0.2) !important;
}

.sidebar-btn-gold {
  padding: 6px 8px !important;
  font-size: 0.62rem !important;
  border-radius: 5px !important;
  border: 1px solid rgba(var(--highlight-rgb), 0.5) !important;
  background: rgba(var(--highlight-rgb), 0.15) !important;
  color: var(--highlight) !important;
  font-family: 'Fira Code', monospace !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  transition: all 0.2s ease !important;
  flex: 1.2;
}
.sidebar-btn-gold:hover {
  background: rgba(var(--highlight-rgb), 0.3) !important;
  border-color: rgba(var(--highlight-rgb), 0.8) !important;
}

.sidebar-btn-purple {
  padding: 6px 8px !important;
  font-size: 0.62rem !important;
  border-radius: 5px !important;
  border: 1px solid rgba(168, 85, 247, 0.5) !important;
  background: rgba(168, 85, 247, 0.15) !important;
  color: #7e22ce !important;
  font-family: 'Fira Code', monospace !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  transition: all 0.2s ease !important;
  flex: 0.8;
}
.sidebar-btn-purple:hover {
  background: rgba(168, 85, 247, 0.3) !important;
  border-color: rgba(168, 85, 247, 0.8) !important;
}

.sidebar-btn-red {
  padding: 6px 8px !important;
  font-size: 0.62rem !important;
  border-radius: 5px !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.12) !important;
  color: #b91c1c !important;
  font-family: 'Fira Code', monospace !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  transition: all 0.2s ease !important;
  flex: 1;
}
.sidebar-btn-red:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
}

.sidebar-footer {
  padding: 12px 15px;
  border-top: 1px solid var(--border-color);
  transition: all 0.3s ease;
}
.sidebar-footer .user-badge {
  display: flex; align-items: center; gap:10px; margin-bottom: 15px;
  transition: all 0.3s ease;
}
.logout-btn {
  display: inline-block; text-align: center;
  padding: 4px 10px; background: transparent; border: 1px solid rgba(153, 27, 27, 0.4); color: #ff6b6b;
  text-decoration: none; border-radius: 4px; font-weight: 500; font-size: 0.65rem; font-family: 'Fira Code', monospace;
  transition: 0.3s; margin-top: 5px;
}
.logout-btn:hover { background: rgba(220, 38, 38, 0.1); color: #ff9999; border-color: #dc2626; box-shadow: 0 0 5px rgba(220, 38, 38, 0.3); }

/* COLLAPSED SIDEBAR RULES (ONLY ON DESKTOP SCREENS) */
@media (min-width: 769px) {
  .sidebar.collapsed {
    width: 75px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.collapsed:hover {
    width: 260px;
    box-shadow: 5px 0 25px rgba(0,0,0,0.9);
  }

  .sidebar.collapsed:not(:hover) .brand {
    justify-content: center;
    padding: 12px 5px;
    min-height: 60px;
  }
  .sidebar.collapsed:not(:hover) .brand-logo {
    display: none;
  }
  .sidebar.collapsed:not(:hover) .sidebar-toggle-btn {
    position: static !important;
    margin: 0 auto !important;
  }
  .sidebar.collapsed:not(:hover) .sidebar-toggle-btn svg {
    transform: rotate(180deg);
  }
  .sidebar.collapsed:not(:hover) .sidebar-text,
  .sidebar.collapsed:not(:hover) .sidebar-header-title,
  .sidebar.collapsed:not(:hover) .admin-title,
  .sidebar.collapsed:not(:hover) #addMasterForm {
    display: none !important;
  }
  .sidebar.collapsed:not(:hover) .nav-menu {
    padding: 0 5px;
    align-items: center;
  }
  .sidebar.collapsed:not(:hover) .nav-menu a {
    justify-content: center;
    padding: 12px 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: 2px auto;
  }
  .sidebar.collapsed:not(:hover) .nav-menu a svg {
    margin-right: 0 !important;
  }
  
  /* Collapsed Total Balance Box */
  .sidebar.collapsed:not(:hover) .sidebar-total-box {
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px auto 12px !important;
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.5) !important;
  }
  .sidebar.collapsed:not(:hover) .sidebar-total-box .total-details {
    display: none !important;
  }
  .sidebar.collapsed:not(:hover) .sidebar-total-box .total-icon-mini {
    display: flex !important;
  }
  
  /* Collapsed Node Balances list */
  .sidebar.collapsed:not(:hover) #sidebar-node-balances {
    align-items: center;
  }
  .sidebar.collapsed:not(:hover) [id^="sidebar-bal-wrapper-"] {
    width: 100%;
  }
  .sidebar.collapsed:not(:hover) [id^="sidebar-bal-"] {
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    margin: 4px auto !important;
    border-color: rgba(255,255,255,0.1) !important;
  }
  .sidebar.collapsed:not(:hover) [id^="sidebar-bal-"] > div:nth-child(1) > span,
  .sidebar.collapsed:not(:hover) [id^="sidebar-bal-"] > div:nth-child(1) > .sidebar-edit-icon,
  .sidebar.collapsed:not(:hover) [id^="sidebar-bal-"] > div:nth-child(2) {
    display: none !important;
  }
  .sidebar.collapsed:not(:hover) [id^="sidebar-bal-"] > div:nth-child(1) {
    justify-content: center !important;
    flex: none !important;
    gap: 0 !important;
  }
  .sidebar.collapsed:not(:hover) [id^="sidebar-sub-container-"] {
    display: none !important;
  }

  /* Collapsed Footer */
  .sidebar.collapsed:not(:hover) .sidebar-footer {
    padding: 12px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .sidebar.collapsed:not(:hover) .user-badge {
    justify-content: center;
    padding: 0 !important;
    margin-bottom: 12px !important;
  }
  .sidebar.collapsed:not(:hover) .user-badge > div {
    display: none !important;
  }
  .sidebar.collapsed:not(:hover) .sidebar-footer a {
    justify-content: center;
    padding: 0 !important;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin: 4px auto !important;
  }
  .sidebar.collapsed:not(:hover) .sidebar-footer a span {
    display: none !important;
  }
  .sidebar.collapsed:not(:hover) .sidebar-footer a svg {
    margin-right: 0 !important;
  }

  /* TOOLTIPS FOR COLLAPSED STATE (ONLY WHEN NOT HOVERING SIDEBAR) */
  .sidebar.collapsed:not(:hover) [data-tooltip] {
    position: relative;
  }
  .sidebar.collapsed:not(:hover) [data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  }
  .sidebar.collapsed:not(:hover) [data-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }

  /* Tooltip for total balance */
  .sidebar.collapsed:not(:hover) .sidebar-total-box {
    position: relative;
  }
  .sidebar.collapsed:not(:hover) .sidebar-total-box::after {
    content: attr(data-tooltip-total);
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  }
  .sidebar.collapsed:not(:hover) .sidebar-total-box:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }

  /* Tooltip for nodes list */
  .sidebar.collapsed:not(:hover) [data-tooltip-node] {
    position: relative;
  }
  .sidebar.collapsed:not(:hover) [data-tooltip-node]::after {
    content: attr(data-tooltip-node);
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: monospace;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  }
  .sidebar.collapsed:not(:hover) [data-tooltip-node]:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* Sidebar edit icon hover */
[id^="sidebar-bal-"]:hover .sidebar-edit-icon {
  opacity: 1 !important;
}


/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background-image: 
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 50px 50px;
}

.page-header {
  margin-bottom: 40px;
}
.page-header h2 { margin: 0; font-size: 2rem; color: var(--highlight); }
.page-header p { margin: 5px 0 0; color: var(--text-muted); font-family: 'Fira Code', monospace; }

/* GLASS CARDS */
.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

.glass-panel h3 {
  margin-top: 0; margin-bottom: 20px;
  font-family: 'Fira Code', monospace;
  color: var(--highlight);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-box {
  background: var(--bg-panel); border: 1px solid var(--border-color);
  padding: 20px; border-radius: 12px; display: flex; flex-direction: column;
}
.stat-title { font-family: 'Fira Code', monospace; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }
.stat-value { font-size: 2.5rem; font-weight: 700; margin-top: 10px; }

/* TABLES */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { color: var(--text-muted); font-family: 'Fira Code', monospace; font-size: 0.85rem; text-transform: uppercase; }
tr:hover { background: rgba(15, 23, 42, 0.02); }

/* FORMS */
.input-row { display: flex; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
.input-group { flex: 1; min-width: 200px; }
label { display: block; font-family: 'Fira Code', monospace; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
input, select {
  width: 100%; padding: 12px 15px; background: rgba(255,255,255,0.7);
  border: 1px solid var(--border-color); border-radius: 8px;
  color: var(--text-main); font-family: 'Outfit', sans-serif; box-sizing: border-box;
}
input:focus, select:focus { border-color: var(--highlight); outline: none; background: #ffffff; }

/* BUTTONS */
button, .btn {
  background: var(--highlight);
  border: 1px solid rgba(var(--highlight-rgb), 0.4);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 10px 20px;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(var(--highlight-rgb), 0.12);
}
button:hover, .btn:hover {
  background: var(--highlight-hover);
  border-color: var(--highlight-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(var(--highlight-rgb), 0.25);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--highlight);
  border: 1px solid var(--highlight);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.btn-secondary:hover {
  background: rgba(var(--highlight-rgb), 0.05);
  border-color: var(--highlight-hover);
  color: var(--highlight-hover);
}

.btn-success {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.04);
}
.btn-success:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.04);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #dc2626;
}

/* BADGES */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-family: 'Fira Code', monospace; font-weight: bold; }
.badge-admin { background: rgba(var(--highlight-rgb), 0.1); color: var(--highlight); border: 1px solid var(--border-color); }
.badge-user { background: rgba(15, 23, 42, 0.05); color: var(--text-muted); border: 1px solid var(--border-color); }

@media (max-width: 768px) {
  .dashboard-wrapper { flex-direction: column; overflow-y: auto; }
  .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border-color); }
  .main-content { overflow: visible; }
}

/* FLOWCHART ORGANOGRAM STYLES */
.flowchart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.flowchart-level {
  display: flex;
  justify-content: center;
  gap: 40px;
  width: 100%;
  position: relative;
}

/* Connectors */
.connector-vertical {
  width: 2px;
  height: 60px;
  background: linear-gradient(180deg, var(--highlight) 0%, #2563eb 100%);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.25);
  margin: 0 auto;
}

/* Glass Cards */
.flow-card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
  min-width: 220px;
  text-align: center;
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 20px rgba(var(--highlight-rgb), 0.05), var(--shadow);
  transition: all 0.3s ease;
}

.flow-card:hover {
  border-color: var(--highlight);
  box-shadow: inset 0 0 20px rgba(var(--highlight-rgb), 0.15), 0 15px 40px rgba(15, 23, 42, 0.12), 0 0 20px rgba(var(--highlight-rgb), 0.25);
  transform: translateY(-5px);
}

.flow-card.master {
  border: 2px solid var(--highlight);
  box-shadow: inset 0 0 30px rgba(var(--highlight-rgb), 0.08), 0 0 30px rgba(var(--highlight-rgb), 0.15);
  min-width: 350px;
}

.flow-card.master:hover {
  border-color: var(--highlight);
  box-shadow: inset 0 0 30px rgba(var(--highlight-rgb), 0.15), 0 0 40px rgba(var(--highlight-rgb), 0.3);
}

.flow-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 15px;
  background: linear-gradient(135deg, rgba(var(--highlight-rgb), 0.1), rgba(37, 99, 235, 0.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--highlight-rgb), 0.3);
}

.flow-card.master .flow-icon {
  width: 80px;
  height: 80px;
}

.flow-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--highlight);
}

.flow-card.master .flow-icon svg {
  width: 40px;
  height: 40px;
}

.flow-title {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 5px;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 1px;
}

.flow-value {
  color: #2563eb;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 0 15px rgba(37, 99, 235, 0.6);
  font-family: 'Fira Code', monospace;
  margin: 10px 0;
}

.flow-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Fira Code', monospace;
}

.tentacles-wrapper {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 0;
  position: relative;
}

/* Empty placeholder for future sub-wallets */
.tentacles-wrapper.empty {
  border: 1px dashed rgba(37, 99, 235, 0.3);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(0,0,0,0.2);
}

/* CYBER UPLOAD COMPONENT */
.cyber-upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: rgba(var(--highlight-rgb), 0.05);
  border: 1px dashed rgba(var(--highlight-rgb), 0.4);
  border-radius: 12px;
  color: var(--highlight);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.cyber-upload-box:hover {
  background: rgba(var(--highlight-rgb), 0.1);
  border-color: var(--highlight);
  box-shadow: 0 0 15px rgba(var(--highlight-rgb), 0.15) inset;
}

.cyber-upload-box svg {
  width: 28px;
  height: 28px;
  stroke: var(--highlight);
}

.cyber-upload-btn {
  background: linear-gradient(90deg, rgba(var(--highlight-rgb), 0.8) 0%, rgba(16, 185, 129, 0.8) 100%);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.1);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.cyber-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(var(--highlight-rgb), 0.3);
  border-color: var(--highlight);
}

/* RADIAL ORBITAL TIMELINE ANIMATIONS & UTILITIES */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-ping { animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite; }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.duration-300 { transition-duration: 300ms; }
.duration-700 { transition-duration: 700ms; }
.duration-1000 { transition-duration: 1000ms; }

.absolute { position: absolute; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.rounded-full { border-radius: 50%; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }

/* Radial Container & Orbit Center Centering and Shifting */
#radial-container {
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

#radial-container.offset-state {
  width: 400px;
  justify-content: flex-start;
}

#radial-container.centered-state {
  width: 100%;
  justify-content: center;
}

#orbit-center {
  transition: left 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

#orbit-center.offset-state {
  left: 300px;
  transform: none;
}

#orbit-center.centered-state {
  left: 50%;
  transform: translateX(-50%);
}

/* Sidebar Total Balance Box Interaction */
.sidebar-total-box {
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s !important;
}

.sidebar-total-box:hover {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.8) !important;
  transform: scale(1.02);
  box-shadow: inset 0 0 15px rgba(37,99,235,0.1), 0 0 10px rgba(37,99,235,0.2) !important;
}

/* Premium Glassmorphism Modals */
#qr_modal,
#instructions-modal-container,
#swap-modal-container,
#single-send-modal-container,
#user-management-modal,
#change-password-modal,
#swap-admin-modal,
#node_info_modal,
#consolidated_wallets_modal {
  background: rgba(15, 23, 42, 0.3) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
}

#qr_modal > div,
#instructions-modal-box,
#swap-modal-box,
#single-send-modal-box,
#user-management-modal > div,
#change-password-modal > div,
#swap-admin-modal > div,
#node_info_modal > div,
#consolidated_wallets_modal > div {
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 24px !important;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.15), inset 0 0 30px rgba(255, 255, 255, 0.25) !important;
}

/* Custom premium glass buttons */
.glass-btn-purple {
  color: #7c7ff6 !important;
  background: rgba(99, 102, 241, 0.15) !important;
  border: 1px solid rgba(99, 102, 241, 0.45) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1) !important;
  transition: all 0.2s ease !important;
}
.glass-btn-purple:hover {
  background: rgba(99, 102, 241, 0.3) !important;
  border-color: rgba(99, 102, 241, 0.7) !important;
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.25) !important;
  transform: translateY(-1px) !important;
}

.glass-btn-blue {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.15) !important;
  border: 1px solid rgba(37, 99, 235, 0.45) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1) !important;
  transition: all 0.2s ease !important;
}
.glass-btn-blue:hover {
  background: rgba(37, 99, 235, 0.3) !important;
  border-color: rgba(37, 99, 235, 0.7) !important;
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.25) !important;
  transform: translateY(-1px) !important;
}

/* Shared Animated Background Shapes (Orbs) */
.bg-shapes {
  position: absolute;
  top: 0; left: 0; width: 100vw; height: 100vh;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.55;
  pointer-events: none;
}
.shape-1 {
  width: 450px; height: 450px;
  background: rgba(var(--highlight-rgb), 0.2); /* Emerald tint */
  top: 15%; left: 15%;
  animation: floatShape1 20s infinite ease-in-out alternate;
}
.shape-2 {
  width: 550px; height: 550px;
  background: rgba(255, 255, 255, 0.45); /* Soft White highlight */
  bottom: 10%; right: 15%;
  animation: floatShape2 25s infinite ease-in-out alternate;
}
.shape-3 {
  width: 350px; height: 350px;
  background: rgba(var(--highlight-rgb), 0.1);
  top: 55%; left: 50%;
  animation: floatShape3 22s infinite ease-in-out alternate;
}

@keyframes floatShape1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(100px, 60px) scale(1.15); }
}
@keyframes floatShape2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-120px, -80px) scale(0.9); }
}
@keyframes floatShape3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, 90px) scale(1.25); }
}

/* Option 2: Active Node Connection Breathing */
@keyframes nodeBreath {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 15px rgba(37, 99, 235, 0.45));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 30px rgba(37, 99, 235, 0.75)) drop-shadow(0 0 15px rgba(var(--highlight-rgb), 0.35));
  }
}

@keyframes glowPulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
  }
}

.center-glow-orbe {
  position: absolute;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.5) 0%, rgba(var(--highlight-rgb), 0.2) 50%, transparent 70%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  z-index: 10;
  animation: glowPulse 4s ease-in-out infinite;
}

.breathing-node {
  animation: nodeBreath 4s ease-in-out infinite;
  transition: all 0.3s ease;
}

