/* c:\mynewapp\frontend-pwa\css\components.css */

/* Top Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-accent);
  margin: 0;
}

 /* Glassmorphism Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
  color: #f8fafc;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Neon Glassmorphism Panels */
.neon-glass-panel {
  background: var(--glass-bg); /* Dark base for neon */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

/* Neon Borders & Glows */
.neon-border-primary { border: 1px solid rgba(56, 189, 248, 0.4); box-shadow: 0 0 15px rgba(56, 189, 248, 0.2), inset 0 0 10px rgba(56, 189, 248, 0.1); }
.neon-border-success { border: 1px solid rgba(52, 211, 153, 0.4); box-shadow: 0 0 15px rgba(52, 211, 153, 0.2), inset 0 0 10px rgba(52, 211, 153, 0.1); }
.neon-border-warning { border: 1px solid rgba(245, 158, 11, 0.4); box-shadow: 0 0 15px rgba(245, 158, 11, 0.2), inset 0 0 10px rgba(245, 158, 11, 0.1); }
.neon-border-danger  { border: 1px solid rgba(248, 113, 113, 0.4); box-shadow: 0 0 15px rgba(248, 113, 113, 0.2), inset 0 0 10px rgba(248, 113, 113, 0.1); }
.neon-border-purple  { border: 1px solid rgba(192, 132, 252, 0.4); box-shadow: 0 0 15px rgba(192, 132, 252, 0.2), inset 0 0 10px rgba(192, 132, 252, 0.1); }

/* Glow Text */
.neon-text-primary { color: #38bdf8; text-shadow: 0 0 8px rgba(56, 189, 248, 0.8); }
.neon-text-success { color: #34d399; text-shadow: 0 0 8px rgba(52, 211, 153, 0.8); }
.neon-text-warning { color: #fbbf24; text-shadow: 0 0 8px rgba(251, 191, 36, 0.8); }
.neon-text-danger  { color: #f87171; text-shadow: 0 0 8px rgba(248, 113, 113, 0.8); }
.neon-text-purple  { color: #c084fc; text-shadow: 0 0 8px rgba(192, 132, 252, 0.8); }

.theme-toggle-btn {
  background: var(--surface-color);
  border: none;
  padding: 10px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--text-primary);
}

/* Dynamic Cloud Ad Banner */
.ad-banner-container {
  padding: 0 20px;
  margin-bottom: 20px;
}
.ad-banner {
  width: 100%;
  height: 120px;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, var(--primary-accent), #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Dashboard Action Grid - No Scroll, Fit Screen */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Default 3 columns for mobile */
  gap: 12px;
  padding: 0 15px;
  /* Make sure it fits the remaining viewport height without scrolling */
  height: calc(100vh - 220px); 
  align-content: start;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 columns for tablets/desktop */
    gap: 20px;
    height: calc(100vh - 200px);
  }
}

.action-card {
  padding: 10px 5px;
  text-align: center;
  border-radius: 18px; 
  text-decoration: none;
  color: white; /* Changed to white for better contrast with gradients */
  font-weight: 800;
  font-size: 0.8rem; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy hover transition */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
  /* Default dark gradient, but we will override per module */
  background: linear-gradient(135deg, #1e293b, #0f172a); 
}

/* Sophisticated Hover Effects */
.action-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 15px 25px rgba(0,0,0,0.2);
  z-index: 10;
  border-color: rgba(255,255,255,0.3);
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.5s;
}

.action-card:hover::before {
  left: 150%;
}

.action-card:active {
  transform: scale(0.95);
  box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.action-icon {
  font-size: 2.2rem; /* Slightly smaller to prevent scrolling */
  color: white; /* Icons should be white to contrast with the vibrant card backgrounds */
  margin-bottom: 2px;
  filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.2));
  transition: transform 0.3s ease;
}

.action-card:hover .action-icon {
  transform: scale(1.15) rotate(5deg);
}

/* Professional Gradients for each specific module */
.module-cash { background: linear-gradient(135deg, #10b981, #059669); } /* Green */
.module-payment { background: linear-gradient(135deg, #f43f5e, #e11d48); } /* Rose/Red */
.module-inventory { background: linear-gradient(135deg, #8b5cf6, #7c3aed); } /* Violet */
.module-sales { background: linear-gradient(135deg, #3b82f6, #2563eb); } /* Blue */
.module-statement { background: linear-gradient(135deg, #64748b, #475569); } /* Slate */
.module-purchase { background: linear-gradient(135deg, #f59e0b, #d97706); } /* Amber */
.module-analytics { background: linear-gradient(135deg, #0ea5e9, #0284c7); } /* Light Blue */
.module-audit { background: linear-gradient(135deg, #334155, #1e293b); } /* Dark Slate */
.module-partners { background: linear-gradient(135deg, #14b8a6, #0d9488); } /* Teal */
.module-payroll { background: linear-gradient(135deg, #a855f7, #9333ea); } /* Purple */
.module-settings { background: linear-gradient(135deg, #94a3b8, #64748b); } /* Gray */


/* Layout Modifiers */
.dashboard-grid.layout-list { grid-template-columns: 1fr; }
.dashboard-grid.layout-list .action-card {
  flex-direction: row; justify-content: flex-start; padding: 15px 20px; gap: 20px; font-size: 1.1rem; text-align: right; border-radius: 12px;
}
.dashboard-grid.layout-list .action-icon { margin-bottom: 0; font-size: 2rem; }

.dashboard-grid.layout-compact { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dashboard-grid.layout-compact .action-card { padding: 10px 2px; border-radius: 12px; font-size: 0.65rem; }
.dashboard-grid.layout-compact .action-icon { font-size: 1.8rem; }

.dashboard-grid.layout-large { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.dashboard-grid.layout-large .action-card { padding: 30px 10px; font-size: 1.1rem; border-radius: 24px; }
.dashboard-grid.layout-large .action-icon { font-size: 3.5rem; margin-bottom: 10px; }

.dashboard-grid.layout-metro { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 2px; }
.dashboard-grid.layout-metro .action-card { border-radius: 0 !important; border: none; }
.dashboard-grid.layout-metro .action-card.module-workflow { grid-column: span 100%; }

/* Shape Modifiers */
.action-card.shape-square { border-radius: 8px; }
.action-card.shape-circle { border-radius: 50%; aspect-ratio: 1/1; justify-content: center; padding: 5px; }

/* Prevent banners from breaking when shapes change */
.action-card.module-workflow {
  aspect-ratio: auto !important;
  border-radius: 18px !important;
}

/* One-Handed Workflow Layout (Cash Receipt) */
.one-handed-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.display-area {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 40px;
}

.amount-display {
  font-size: 3.5rem;
  font-weight: 900;
  text-align: right;
  color: var(--primary-accent);
  margin: 0;
  word-break: break-all;
}

.amount-label {
  text-align: right;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 5px;
}

/* Bottom Numpad (Optimized for Thumbs) */
.bottom-sheet {
  background: var(--surface-color);
  padding: 20px;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 15px;
}

.numpad-btn {
  background: var(--bg-color);
  border: none;
  border-radius: 15px;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 20px 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.numpad-btn:active {
  background: var(--glass-border);
}

.action-row {
  display: flex;
  gap: 15px;
}

.btn-primary {
  flex: 2;
  background: var(--primary-accent);
  color: white;
  border: none;
  padding: 20px;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.btn-secondary {
  flex: 1;
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 20px;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
}

/* =========================================================
   Professional Executive Dashboard (dashboard-pro.html)
   ========================================================= */

.pro-dashboard-body {
    display: flex;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-base);
}

/* Sidebar */
.pro-sidebar {
    width: 260px;
    background: var(--surface-color);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.pro-sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header .brand-title {
    font-size: 1.2rem;
    white-space: nowrap;
}

.pro-sidebar.collapsed .brand-title {
    display: none;
}

.toggle-sidebar-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-right: 4px solid transparent;
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    background: rgba(15, 76, 129, 0.05); /* very light primary */
    color: var(--primary-accent);
    border-right-color: var(--primary-accent);
}

.sidebar-menu .icon {
    font-size: 1.3rem;
    margin-left: 15px;
}

.pro-sidebar.collapsed .text {
    display: none;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--danger-color);
    font-weight: bold;
    cursor: pointer;
    padding: 10px 0;
}

.pro-sidebar.collapsed .logout-btn .text { display: none; }

/* Sidebar Submenu */
.sidebar-menu .has-submenu {
    position: relative;
}

.sidebar-menu .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    margin-right: 15px;
    margin-left: 15px;
}

.sidebar-menu .submenu.open {
    display: block;
    animation: fadeInSlideDown 0.3s ease-out forwards;
}

.sidebar-menu .submenu a {
    padding: 10px 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: none;
}

.sidebar-menu .submenu a:hover {
    background: rgba(15, 76, 129, 0.05);
    color: var(--primary-accent);
}

.sidebar-menu .arrow {
    margin-right: auto;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.sidebar-menu .has-submenu.open .arrow {
    transform: rotate(180deg);
}

@keyframes fadeInSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main Content Area */
.pro-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Header */
.pro-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 40px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--surface-color);
    color: var(--text-primary);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    position: relative;
}

.icon-btn .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name { font-weight: bold; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-secondary); }

/* Dashboard Wrapper */
.dashboard-wrapper {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.dashboard-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.page-title {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.page-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.quick-actions-bar {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.btn-action:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary-accent); }
.btn-success { background: var(--success-color); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; border-radius: 5px; color: white; border: none; cursor: pointer;}

/* KPI Grid */
.kpi-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    padding: 20px;
    border-radius: 16px;
    border-right: 4px solid transparent; /* Arabic RTL */
}

.border-primary { border-right-color: var(--primary-accent); }
.border-success { border-right-color: var(--success-color); }
.border-warning { border-right-color: #f59e0b; }
.border-danger { border-right-color: var(--danger-color); }

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kpi-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}
.bg-primary { background: var(--primary-accent); }
.bg-success { background: var(--success-color); }
.bg-warning { background: #f59e0b; }
.bg-danger { background: var(--danger-color); }

.kpi-value {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
}

.kpi-trend {
    font-size: 0.8rem;
    font-weight: 600;
}
.positive { color: var(--success-color); }
.negative { color: var(--danger-color); }
.neutral { color: var(--text-secondary); }

/* Charts Grid */
.charts-grid-pro {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    padding: 20px;
    border-radius: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.filter-select {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: var(--surface-color);
    color: var(--text-primary);
}

/* Bottom Grid */
.bottom-grid-pro {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.table-card, .list-card {
    padding: 20px;
    border-radius: 16px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-accent);
    font-weight: bold;
    cursor: pointer;
}

.table-responsive {
    overflow-x: auto;
}

.pro-table {
    width: 100%;
    border-collapse: collapse;
}

.pro-table th {
    text-align: right;
    padding: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
}

.pro-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-weight: 500;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}
.badge-success { background: rgba(1, 135, 134, 0.1); color: var(--success-color); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.badge-danger { background: rgba(197, 42, 26, 0.1); color: var(--danger-color); }

/* Pro List */
.pro-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--glass-border);
}
.list-item:last-child { border-bottom: none; }

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-left: 15px;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
}

.item-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 992px) {
    .charts-grid-pro, .bottom-grid-pro {
        grid-template-columns: 1fr;
    }
    
    .pro-sidebar {
        position: fixed;
        height: 100%;
        left: -260px; /* Hidden by default on small screens */
    }
    
    .pro-sidebar.expanded {
        left: 0;
    }
    
    .menu-btn { display: block; }
    
    .search-box { display: none; }
    
    .user-info { display: none; }
}

@media (max-width: 768px) {
    .dashboard-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Neon Inputs & Forms */
.select-input, .text-input, input[type='text'], input[type='number'], input[type='password'], input[type='date'], .modern-context-menu {
    background: var(--surface-color) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px;
    padding: 12px 15px;
    font-family: var(--font-base);
    transition: all 0.3s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.select-input:focus, .text-input:focus, input[type='text']:focus, input[type='number']:focus, input[type='password']:focus, input[type='date']:focus, textarea:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3), inset 0 0 5px rgba(56, 189, 248, 0.2) !important;
    background: var(--surface-active) !important;
}

.label, label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary) !important;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Scrollbar formatting for WebKit */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface-color); }
::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.5); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, 0.8); }

/* ═══════════════════════════════════════════════════════
   GLOBAL SMART SIDEBAR — Clean RTL Flexbox Design
   ═══════════════════════════════════════════════════════ */

:root {
    --sb-collapsed: 62px;
    --sb-expanded:  240px;
    --sb-bg:        rgba(5, 7, 16, 0.97);
    --sb-border:    rgba(56, 189, 248, 0.15);
    --sb-item-h:    52px;
}

body.has-sidebar {
    margin-right: var(--sb-collapsed);
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Ensure content never scrolls behind the sidebar */
    overflow-x: hidden;
}
body.has-sidebar.sidebar-open {
    margin-right: var(--sb-expanded);
}

/* Prevent ANY element from accidentally going behind the sidebar */
body.has-sidebar > *:not(.global-sidebar) {
    max-width: 100%;
    box-sizing: border-box;
}

/* ── Sidebar Container ── */
.global-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sb-collapsed);
    height: 100vh;
    background: var(--sb-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--sb-border);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0,0,0,0.7);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* NO overflow, NO direction hack - icon is absolute positioned */
}

.global-sidebar:hover {
    width: var(--sb-expanded);
    border-left-color: rgba(56, 189, 248, 0.35);
}

/* ── Header ── */
.sidebar-header {
    position: relative;
    height: 64px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Logo icon: always at far right */
.sidebar-logo-icon {
    position: absolute;
    right: 0;
    top: 0;
    width: var(--sb-collapsed);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px rgba(56,189,248,0.8));
    z-index: 1;
}

.sidebar-logo-text {
    font-size: 1rem;
    font-weight: 800;
    color: #e2e8f0;
    padding-right: 10px;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.3s ease, opacity 0.2s ease;
}

.global-sidebar:hover .sidebar-logo-text {
    max-width: 180px;
    opacity: 1;
    transition-delay: 0.05s;
}

/* ── Nav ── */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Hide scrollbar for sidebar nav */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* ── Items ── */
.sidebar-item {
    position: relative;   /* anchor for absolute icon */
    display: block;
    height: var(--sb-item-h);
    text-decoration: none;
    color: rgba(203, 213, 225, 0.85);
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.04);
    color: #fff;
}

.sidebar-item.active {
    background: rgba(56,189,248,0.08);
    color: #fff;
    font-weight: 600;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
}

/* ── ICON: ALWAYS at far right, zero gap ── */
.sidebar-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: var(--sb-collapsed);
    height: var(--sb-item-h);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.sidebar-item:hover .sidebar-icon {
    transform: translateY(-50%) scale(1.12);
}

/* ── TEXT: beside the icon (right:62px), hidden when collapsed ── */
.sidebar-text {
    position: absolute;
    right: var(--sb-collapsed);  /* starts just left of the icon */
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.9);
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition: max-width 0.3s ease, opacity 0.2s ease;
}

.global-sidebar:hover .sidebar-text {
    max-width: 180px;
    opacity: 1;
    transition-delay: 0.05s;
}

/* ── Footer ── */
.sidebar-footer {
    flex-shrink: 0;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logout {
    color: #f87171;
}
.sidebar-logout:hover {
    background: rgba(248,113,113,0.05);
}

/* --- Professional Motion Effects (Animations) --- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes neonPulse {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
    }
    50% {
        box-shadow: 0 8px 32px rgba(56, 189, 248, 0.2), inset 0 0 5px rgba(56, 189, 248, 0.3);
    }
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
    }
}

/* Base Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered animation for grid children globally */
.dashboard-grid > * {
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.dashboard-grid > *:nth-child(1) { animation-delay: 0.05s; }
.dashboard-grid > *:nth-child(2) { animation-delay: 0.1s; }
.dashboard-grid > *:nth-child(3) { animation-delay: 0.15s; }
.dashboard-grid > *:nth-child(4) { animation-delay: 0.2s; }
.dashboard-grid > *:nth-child(5) { animation-delay: 0.25s; }
.dashboard-grid > *:nth-child(6) { animation-delay: 0.3s; }
.dashboard-grid > *:nth-child(7) { animation-delay: 0.35s; }
.dashboard-grid > *:nth-child(8) { animation-delay: 0.4s; }
.dashboard-grid > *:nth-child(9) { animation-delay: 0.45s; }
.dashboard-grid > *:nth-child(10) { animation-delay: 0.5s; }
.dashboard-grid > *:nth-child(n+11) { animation-delay: 0.55s; }

/* Action Card Hover & Motion Details */
.action-card {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
    will-change: transform, box-shadow;
}

.action-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.5);
    z-index: 10;
}

/* Make glass panels pulse optionally */
.pulse-glow {
    animation: neonPulse 3s infinite alternate ease-in-out;
}

/* ═══════════════════════════════════════════════════════
   🎨 GLOBAL COLOR VIBRANCY ENHANCEMENT PATCH v2.0
   More vivid, readable, and professional UI colors
   ═══════════════════════════════════════════════════════ */

/* ── Stronger accent colors ── */
:root {
    --primary-accent:   #38bdf8;   /* Sky Blue — brighter */
    --success-color:    #22c55e;   /* Green — more vivid */
    --warning-color:    #f59e0b;   /* Amber */
    --danger-color:     #f43f5e;   /* Rose Red — stronger */
    --purple-color:     #c084fc;   /* Violet — vibrant */
    --primary-glow:     rgba(56, 189, 248, 0.45);
    --success-glow:     rgba(34, 197, 94, 0.45);
    --danger-glow:      rgba(244, 63, 94, 0.45);
}

/* ── Brighter neon text ── */
.neon-text-primary { color: #38bdf8; text-shadow: 0 0 12px rgba(56,189,248,1), 0 0 30px rgba(56,189,248,0.5); }
.neon-text-success { color: #4ade80; text-shadow: 0 0 12px rgba(74,222,128,1), 0 0 30px rgba(74,222,128,0.5); }
.neon-text-warning { color: #fcd34d; text-shadow: 0 0 12px rgba(252,211,77,1),  0 0 30px rgba(252,211,77,0.5); }
.neon-text-danger  { color: #fb7185; text-shadow: 0 0 12px rgba(251,113,133,1), 0 0 30px rgba(251,113,133,0.5); }
.neon-text-purple  { color: #d8b4fe; text-shadow: 0 0 12px rgba(216,180,254,1), 0 0 30px rgba(216,180,254,0.5); }

/* ── Stronger neon borders ── */
.neon-border-primary { border: 1px solid rgba(56,189,248,0.6);  box-shadow: 0 0 20px rgba(56,189,248,0.3),  inset 0 0 15px rgba(56,189,248,0.08); }
.neon-border-success { border: 1px solid rgba(74,222,128,0.6);  box-shadow: 0 0 20px rgba(74,222,128,0.3),  inset 0 0 15px rgba(74,222,128,0.08); }
.neon-border-warning { border: 1px solid rgba(252,211,77,0.6);  box-shadow: 0 0 20px rgba(252,211,77,0.3),  inset 0 0 15px rgba(252,211,77,0.08); }
.neon-border-danger  { border: 1px solid rgba(251,113,133,0.6); box-shadow: 0 0 20px rgba(251,113,133,0.3), inset 0 0 15px rgba(251,113,133,0.08); }
.neon-border-purple  { border: 1px solid rgba(192,132,252,0.6); box-shadow: 0 0 20px rgba(192,132,252,0.3), inset 0 0 15px rgba(192,132,252,0.08); }

/* ── Better action buttons ── */
.btn-success, .qa-success {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(22,163,74,0.5) !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
}
.btn-success:hover, .qa-success:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    box-shadow: 0 6px 25px rgba(34,197,94,0.7) !important;
    transform: translateY(-2px) !important;
}

/* ── Quick action buttons — more vivid ── */
.quick-action-btn {
    text-shadow: none !important;
    letter-spacing: 0.3px;
    font-size: 0.95rem !important;
}
.quick-action-btn:hover {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.3) !important;
    transform: translateX(-3px) !important;
}
.qa-primary   { background: linear-gradient(135deg, rgba(56,189,248,0.15), rgba(56,189,248,0.05)) !important; border-color: rgba(56,189,248,0.5) !important; color: #7dd3fc !important; }
.qa-warning   { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05)) !important;  border-color: rgba(245,158,11,0.5) !important;  color: #fcd34d !important; }
.qa-success   { background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05)) !important;   border-color: rgba(34,197,94,0.5) !important;   color: #86efac !important; }
.qa-danger    { background: linear-gradient(135deg, rgba(244,63,94,0.15), rgba(244,63,94,0.05)) !important;   border-color: rgba(244,63,94,0.5) !important;   color: #fda4af !important; }

/* ── Module gradient refresh on home ── */
.module-cash      { background: linear-gradient(145deg, #059669, #047857) !important; box-shadow: 0 6px 20px rgba(5,150,105,0.5) !important; }
.module-payment   { background: linear-gradient(145deg, #e11d48, #be123c) !important; box-shadow: 0 6px 20px rgba(225,29,72,0.5) !important; }
.module-inventory { background: linear-gradient(145deg, #7c3aed, #6d28d9) !important; box-shadow: 0 6px 20px rgba(124,58,237,0.5) !important; }
.module-sales     { background: linear-gradient(145deg, #2563eb, #1d4ed8) !important; box-shadow: 0 6px 20px rgba(37,99,235,0.5) !important; }
.module-statement { background: linear-gradient(145deg, #7c3aed, #5b21b6) !important; box-shadow: 0 6px 20px rgba(124,58,237,0.5) !important; }
.module-purchase  { background: linear-gradient(145deg, #d97706, #b45309) !important; box-shadow: 0 6px 20px rgba(217,119,6,0.5) !important; }
.module-analytics { background: linear-gradient(145deg, #0284c7, #0369a1) !important; box-shadow: 0 6px 20px rgba(2,132,199,0.5) !important; }
.module-partners  { background: linear-gradient(145deg, #0d9488, #0f766e) !important; box-shadow: 0 6px 20px rgba(13,148,136,0.5) !important; }
.module-payroll   { background: linear-gradient(145deg, #9333ea, #7e22ce) !important; box-shadow: 0 6px 20px rgba(147,51,234,0.5) !important; }
.module-settings  { background: linear-gradient(145deg, #475569, #334155) !important; box-shadow: 0 6px 20px rgba(71,85,105,0.5) !important; }
.module-audit     { background: linear-gradient(145deg, #1e40af, #1e3a8a) !important; box-shadow: 0 6px 20px rgba(30,64,175,0.5) !important; }

/* ── Background deeper glow ── */
body {
    background-image:
        radial-gradient(ellipse at 15% 15%, rgba(56,189,248,0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 85%, rgba(168,85,247,0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 0%, rgba(34,197,94,0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 100%, rgba(244,63,94,0.04) 0%, transparent 40%) !important;
}

/* ── Labels more readable ── */
.label {
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

/* ── KPI numbers bigger and glowing ── */
.neon-text-primary, .neon-text-success, .neon-text-warning, .neon-text-danger {
    font-weight: 900 !important;
}
