/* SB PORTAL - Premium Glassmorphism Design System */

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

:root {
  --bg-primary: #0b0819;
  --bg-secondary: #120e2e;
  --glass-bg: rgba(20, 16, 45, 0.55);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #a855f7 50%, #ec4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #db2777 100%);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
}

/* Reset and Globals */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 10%, rgba(59, 130, 246, 0.15) 0px, transparent 40%),
    radial-gradient(at 90% 80%, rgba(168, 85, 247, 0.15) 0px, transparent 40%),
    radial-gradient(at 50% 50%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

/* Glassmorphism Containers */
.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-md);
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}
.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Headings & Text */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  font-size: 14px;
  text-decoration: none;
  outline: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}
.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  transform: translateY(-2px);
}

.btn-success {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}
.btn-success:hover {
  background: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

/* Inputs */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}
.form-control:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
  background: rgba(0, 0, 0, 0.4);
}
.form-control::placeholder {
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-processing {
  background: rgba(6, 182, 212, 0.15);
  color: var(--info);
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.badge-completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Loading & Splash Screen */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Navigation Layout */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  background: rgba(15, 12, 38, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 30px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 40px;
  color: var(--text-primary);
  text-decoration: none;
}
.brand i {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 28px;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  margin-bottom: 30px;
}
.sidebar-profile .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--glass-border);
}
.sidebar-profile .profile-info {
  overflow: hidden;
}
.sidebar-profile .profile-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sidebar-profile .profile-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.nav-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}
.nav-item a:hover, .nav-item.active a {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 4px 0 0 var(--accent-purple);
}
.nav-item.logout-link a {
  color: #fca5a5;
}
.nav-item.logout-link a:hover {
  background: rgba(239, 68, 68, 0.1);
  box-shadow: inset 4px 0 0 var(--danger);
}

/* Main Content Area */
.main-content {
  padding: 40px;
  overflow-y: auto;
}

/* Top bar details */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}
.topbar .page-title h1 {
  font-size: 28px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.balance-widget {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.balance-widget span {
  color: var(--success);
}

/* Dashboard Grid & Cards */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 35px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
}
.stat-card.wallet-card::before { background: linear-gradient(90deg, #10b981, #059669); }
.stat-card.orders-card::before { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.stat-card.pending-card::before { background: linear-gradient(90deg, #f59e0b, #d97706); }
.stat-card.spent-card::before { background: linear-gradient(90deg, #ec4899, #db2777); }

.stat-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-card .card-icon {
  font-size: 20px;
  opacity: 0.7;
}
.stat-card.wallet-card .card-icon { color: var(--success); }
.stat-card.orders-card .card-icon { color: var(--accent-blue); }
.stat-card.pending-card .card-icon { color: var(--warning); }
.stat-card.spent-card .card-icon { color: var(--accent-pink); }

.stat-card .card-value {
  font-size: 28px;
  font-weight: 800;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 35px;
}
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* Tables */
.table-container {
  overflow-x: auto;
}
.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.custom-table th {
  padding: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}
.custom-table td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}
.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Landing Page Specific Styling */
.landing-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 80px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}
@media (max-width: 768px) {
  .landing-navbar {
    padding: 20px 24px;
  }
}
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  padding-top: 100px;
}
.hero-title {
  font-size: 72px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.1;
}
@media (max-width: 768px) {
  .hero-title {
    font-size: 44px;
  }
}
.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 35px;
}

.pricing-banner {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 50px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #dfaeff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 60px;
}

/* Features Grid */
.features-section {
  padding: 100px 80px;
  background: rgba(0, 0, 0, 0.2);
}
@media (max-width: 768px) {
  .features-section {
    padding: 60px 24px;
  }
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-header h2 {
  font-size: 36px;
  margin-bottom: 12px;
}
.section-header p {
  color: var(--text-secondary);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}
.feature-card {
  text-align: center;
}
.feature-card .feature-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-md);
  background: rgba(168, 85, 247, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  font-size: 24px;
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Stats Section */
.stats-section {
  padding: 80px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  text-align: center;
}
@media (max-width: 768px) {
  .stats-section {
    padding: 60px 24px;
  }
}
.landing-stat h3 {
  font-size: 48px;
  margin-bottom: 8px;
}
.landing-stat p {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Footer */
footer {
  padding: 40px 80px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 8, 25, 0.9);
}
@media (max-width: 768px) {
  footer {
    padding: 30px 24px;
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}
footer p {
  color: var(--text-secondary);
  font-size: 14px;
}
.footer-socials {
  display: flex;
  gap: 16px;
}
.footer-socials a {
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition-fast);
}
.footer-socials a:hover {
  color: var(--text-primary);
}

/* Authentication Page Shell */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
}
.auth-header {
  text-align: center;
  margin-bottom: 30px;
}
.auth-header h2 {
  font-size: 28px;
  margin-bottom: 8px;
}
.auth-header p {
  color: var(--text-secondary);
  font-size: 14px;
}
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-footer a {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 600;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* Toast Notification Overlay */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notification {
  min-width: 280px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease forwards;
}
.notification.success {
  border-left: 4px solid var(--success);
}
.notification.success i {
  color: var(--success);
}
.notification.error {
  border-left: 4px solid var(--danger);
}
.notification.error i {
  color: var(--danger);
}
.notification.warning {
  border-left: 4px solid var(--warning);
}
.notification.warning i {
  color: var(--warning);
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

/* Responsive sidebar */
@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px;
    border-right: none;
    border-top: 1px solid var(--glass-border);
    border-radius: 20px 20px 0 0;
  }
  .sidebar-profile, .brand, .sidebar .nav-links .logout-link, .sidebar .nav-item span {
    display: none;
  }
  .sidebar .nav-links {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
  }
  .sidebar .nav-item a {
    padding: 8px;
    border-radius: 50%;
  }
  .sidebar .nav-item a i {
    font-size: 20px;
  }
  .main-content {
    padding: 20px;
    padding-bottom: 80px; /* space for bottom nav */
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Modal UI */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-container {
  width: 90%;
  max-width: 500px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.modal-close:hover {
  color: var(--text-primary);
}
.modal-body img {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 15px auto;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
}

/* Search bar styling */
.search-wrapper {
  position: relative;
  margin-bottom: 20px;
}
.search-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-wrapper .form-control {
  padding-left: 40px;
}

/* Custom Live Price Widget styling on orders */
.price-display-box {
  background: rgba(168, 85, 247, 0.05);
  border: 1px dashed rgba(168, 85, 247, 0.3);
  padding: 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 20px;
}
.price-display-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.price-display-row:last-child {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: var(--text-primary);
}
.price-display-row .val {
  color: var(--text-primary);
}
.price-display-row.total-row .val {
  color: var(--accent-purple);
  font-size: 16px;
}

/* Analytics Chart height */
.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}
