/* ==========================================================================
   SARTHAK JEWELLERY — Luxury Enterprise Theme
   Premium Gold Investment & Jewellery ERP
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Primary Gold Palette */
  --gold-50: #FFF9E6;
  --gold-100: #FFF0BF;
  --gold-200: #FFE066;
  --gold-300: #FFD700;
  --gold-400: #D4AF37;
  --gold-500: #C5A028;
  --gold-600: #B8860B;
  --gold-700: #8B6914;
  --gold-800: #6B5010;
  --gold-900: #4A370B;

  /* Backgrounds */
  --bg-void: #0A0A0A;
  --bg-primary: #0D0D0D;
  --bg-secondary: #121212;
  --bg-tertiary: #1B1B1B;
  --bg-elevated: #222222;
  --bg-card: rgba(27, 27, 27, 0.85);
  --bg-glass: rgba(255, 215, 0, 0.04);

  /* Text */
  --text-primary: #F5F5F0;
  --text-secondary: #A8A89A;
  --text-muted: #6B6B5E;
  --text-gold: #FFD700;
  --text-inverse: #0D0D0D;

  /* Borders & Effects */
  --border-subtle: rgba(212, 175, 55, 0.12);
  --border-gold: rgba(212, 175, 55, 0.35);
  --border-glow: rgba(255, 215, 0, 0.5);
  --shadow-gold: 0 0 40px rgba(255, 215, 0, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.5);
  --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3), 0 0 60px rgba(212, 175, 55, 0.1);

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, #FFD700 0%, #D4AF37 40%, #B8860B 100%);
  --gradient-gold-soft: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(184, 134, 11, 0.05) 100%);
  --gradient-dark: linear-gradient(180deg, #0D0D0D 0%, #1B1B1B 100%);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.18) 0%, transparent 60%),
                   radial-gradient(ellipse at 80% 80%, rgba(184, 134, 11, 0.08) 0%, transparent 40%);
  --gradient-border: linear-gradient(135deg, #FFD700, #B8860B, #FFD700);

  /* Spacing & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
  --header-height: 72px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: auto;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h4 { font-size: 1.35rem; }

a { color: var(--gold-400); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-300); }

img { max-width: 100%; height: auto; }
::selection { background: rgba(255, 215, 0, 0.3); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--gold-600); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-400); }

/* ==========================================================================
   PAGE LOADER
   ========================================================================== */
.sg-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.sg-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.sg-loader-coin {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--gradient-gold);
  box-shadow: var(--glow-gold);
  animation: coinSpin 1.5s ease-in-out infinite;
  position: relative;
}
.sg-loader-coin::after {
  content: '₹';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700; color: var(--bg-void);
}
.sg-loader-text {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.3em;
  color: var(--gold-400);
  text-transform: uppercase;
}
@keyframes coinSpin {
  0%, 100% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.1); }
}

/* ==========================================================================
   GOLD DUST PARTICLES
   ========================================================================== */
.gold-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.gold-particle {
  position: absolute;
  width: 3px; height: 3px;
  background: var(--gold-300);
  border-radius: 50%;
  opacity: 0;
  animation: floatDust linear infinite;
  box-shadow: 0 0 6px var(--gold-300);
}
@keyframes floatDust {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ==========================================================================
   GLASSMORPHISM CARDS
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-border);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated), var(--shadow-gold);
  border-color: var(--border-gold);
}
.glass-card:hover::before { opacity: 0.6; }

.glass-card-static {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Gradient border card */
.gold-border-card {
  position: relative;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 1px;
  background: var(--gradient-border);
}
.gold-border-card > .inner {
  background: var(--bg-tertiary);
  border-radius: calc(var(--radius-lg) - 1px);
  padding: 1.5rem;
  height: 100%;
}

/* ==========================================================================
   KPI CARDS
   ========================================================================== */
.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: -50%; right: -50%;
  width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.kpi-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
}
.kpi-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-gold-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  color: var(--gold-300);
  margin-bottom: 1rem;
}
.kpi-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.kpi-value.gold { color: var(--gold-300); }
.kpi-change {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: flex; align-items: center; gap: 0.35rem;
}
.kpi-change.up { color: #34D399; }
.kpi-change.down { color: #F87171; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--bg-void);
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.25);
  text-decoration: none;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
  color: var(--bg-void);
}
.btn-gold:active { transform: translateY(0); }

.btn-gold-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold-300);
  background: transparent;
  border: 1.5px solid var(--gold-400);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-gold-outline:hover {
  background: rgba(255, 215, 0, 0.1);
  box-shadow: var(--glow-gold);
  color: var(--gold-200);
}

.btn-gold.btn-sm,
.btn-gold-outline.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  gap: 0.35rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.btn-ghost:hover {
  color: var(--gold-300);
  border-color: var(--border-gold);
  background: var(--bg-glass);
}

/* Ripple effect */
.btn-ripple { position: relative; overflow: hidden; }
.btn-ripple .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ==========================================================================
   NAVIGATION — PUBLIC
   ========================================================================== */
.sg-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(13, 13, 13, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.sg-navbar.scrolled {
  background: rgba(13, 13, 13, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.sg-navbar .nav-brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 0.5rem;
}
.sg-navbar .nav-brand img { height: 36px; }
.sg-navbar .nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}
.sg-navbar .nav-link:hover,
.sg-navbar .nav-link.active {
  color: var(--gold-300);
}
.sg-navbar .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 2px;
  background: var(--gradient-gold);
  border-radius: 1px;
}

/* Gold Rate Ticker */
.gold-ticker {
  background: linear-gradient(90deg, rgba(184, 134, 11, 0.2), rgba(255, 215, 0, 0.1), rgba(184, 134, 11, 0.2));
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 0;
  overflow: hidden;
  white-space: nowrap;
}
.gold-ticker-track {
  display: inline-flex;
  gap: 3rem;
  animation: tickerScroll 40s linear infinite;
}
.gold-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.gold-ticker-item .rate { color: var(--gold-300); font-weight: 600; }
.gold-ticker-item .change.up { color: #34D399; }
.gold-ticker-item .change.down { color: #F87171; }
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   SIDEBAR — ADMIN / PORTALS
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}
.app-sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
  flex-shrink: 0;
}
.sidebar-brand .brand-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--gradient-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: var(--bg-void);
  flex-shrink: 0;
  box-shadow: var(--glow-gold);
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}
.nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 1rem 0.75rem 0.5rem;
  white-space: nowrap;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  margin-bottom: 2px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.sidebar-link:hover {
  background: var(--bg-glass);
  color: var(--gold-300);
}
.sidebar-link.active {
  background: var(--gradient-gold-soft);
  color: var(--gold-300);
  box-shadow: inset 3px 0 0 var(--gold-400);
  font-weight: 600;
}
.sidebar-link.active .material-icons {
  color: var(--gold-300);
}
.sidebar-link i, .sidebar-link .material-icons {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--gold-600);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.nav-group {
  margin-bottom: 6px;
}
.nav-group > summary {
  list-style: none;
}
.nav-group > summary::-webkit-details-marker,
.nav-group > summary::marker {
  display: none;
  content: "";
}
.nav-group-toggle {
  font-weight: 600;
}
.nav-group-toggle .nav-chevron {
  margin-left: auto;
  font-size: 1.1rem;
  width: auto;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.nav-group[open] > .nav-group-toggle {
  background: var(--bg-tertiary);
  color: var(--gold-300);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin-bottom: 0;
}
.nav-group[open] > .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
  color: var(--gold-300);
}
.nav-group-toggle.has-active {
  color: var(--gold-300);
  background: var(--bg-tertiary);
}
.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.45rem 0.4rem 0.5rem 0.75rem;
  margin: 0 0 0.15rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: inset 3px 0 0 var(--gold-600);
}
.nav-submenu .nav-sub-link,
.nav-submenu .sidebar-link {
  position: relative;
  padding: 0.42rem 0.65rem 0.42rem 0.85rem;
  margin-bottom: 0;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  background: transparent;
  border-radius: 8px;
  box-shadow: none;
}
.nav-submenu .nav-sub-link .material-icons,
.nav-submenu .sidebar-link .material-icons {
  font-size: 0.95rem;
  width: 18px;
  color: var(--text-muted);
  opacity: 0.85;
}
.nav-submenu .nav-sub-link:hover,
.nav-submenu .sidebar-link:hover {
  background: rgba(255, 215, 0, 0.08);
  color: var(--gold-200);
}
.nav-submenu .nav-sub-link:hover .material-icons,
.nav-submenu .sidebar-link:hover .material-icons {
  color: var(--gold-300);
  opacity: 1;
}
.nav-submenu .nav-sub-link.active,
.nav-submenu .sidebar-link.active {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold-300);
  font-weight: 600;
  box-shadow: none;
}
.nav-submenu .nav-sub-link.active .material-icons,
.nav-submenu .sidebar-link.active .material-icons {
  color: var(--gold-300);
  opacity: 1;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  transition: margin-left var(--transition);
  display: flex;
  flex-direction: column;
}
.app-sidebar.collapsed ~ .app-main { margin-left: var(--sidebar-collapsed); }

.app-header {
  height: var(--header-height);
  background: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-content {
  flex: 1;
  padding: 1.5rem;
  background: var(--gradient-hero), var(--bg-primary);
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.sg-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
}
.glass-card-static > .sg-table-wrap {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.sg-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}
.sg-table thead th {
  background: var(--bg-elevated);
  color: var(--gold-300);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: middle;
}
.sg-table thead th a,
.sg-table thead th a:visited,
.sg-table thead th a:hover {
  color: var(--gold-300) !important;
  text-decoration: none !important;
  font-size: inherit;
}
.sg-table tbody td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-primary);
  vertical-align: middle;
}
.sg-table tbody tr {
  transition: background 0.2s;
}
.sg-table tbody tr:hover {
  background: rgba(255, 215, 0, 0.03);
}
.sg-table tbody tr:last-child td { border-bottom: none; }

/* DataTables override */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.4rem 0.75rem !important;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--text-secondary) !important;
  padding: 1rem !important;
}
.dataTables_wrapper .paginate_button {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
}
.dataTables_wrapper .paginate_button.current {
  background: var(--gradient-gold) !important;
  color: var(--bg-void) !important;
  border: none !important;
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-label-sg {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}
.form-control-sg {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}
.form-control-sg:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}
.form-control-sg::placeholder { color: var(--text-muted); }
input[type="date"].form-control-sg {
  color-scheme: dark;
  cursor: pointer;
  min-height: 46px;
}
input[type="date"].form-control-sg::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
  filter: invert(0.85) sepia(1) saturate(5) hue-rotate(5deg);
}
select.form-control-sg {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23D4AF37' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
textarea.form-control-sg { resize: vertical; min-height: 100px; }

/* ==========================================================================
   BADGES & STATUS
   ========================================================================== */
.badge-sg {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.badge-success { background: rgba(52, 211, 153, 0.15); color: #34D399; }
.badge-warning { background: rgba(251, 191, 36, 0.15); color: #FBBF24; }
.badge-danger { background: rgba(248, 113, 113, 0.15); color: #F87171; }
.badge-info { background: rgba(96, 165, 250, 0.15); color: #60A5FA; }
.badge-gold { background: rgba(255, 215, 0, 0.15); color: #FFD700; }
.badge-purple { background: rgba(167, 139, 250, 0.15); color: #A78BFA; }

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: calc(var(--header-height) + 40px);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}
.hero-title .gold-text {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 2.5rem;
  font-weight: 300;
  line-height: 1.7;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section {
  padding: 5rem 0;
  position: relative;
}
.section-dark { background: var(--bg-secondary); }
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  margin-bottom: 1rem;
}
.section-desc {
  color: var(--text-secondary);
  max-width: 560px;
  font-size: 1.05rem;
  margin-bottom: 3rem;
}

/* ==========================================================================
   PRODUCT / JEWELLERY CARDS
   ========================================================================== */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}
.product-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-6px);
}
.product-card .product-img {
  aspect-ratio: 1;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-card .product-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-img img { transform: scale(1.08); }
.product-card .product-body { padding: 1.25rem; }
.product-card .product-cat {
  font-size: 0.75rem;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.product-card .product-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
.product-card .product-price {
  font-weight: 700;
  color: var(--gold-300);
  font-size: 1.1rem;
}
.product-card .product-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ==========================================================================
   CALCULATOR WIDGETS
   ========================================================================== */
.calc-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
}
.calc-widget .calc-result {
  background: var(--gradient-gold-soft);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}
.calc-widget .calc-result-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.sg-footer {
  background: var(--bg-void);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
}
.sg-footer h5 {
  font-family: var(--font-display);
  color: var(--gold-300);
  margin-bottom: 1.25rem;
  font-size: 1.15rem;
}
.sg-footer a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
  padding: 0.3rem 0;
}
.sg-footer a:hover { color: var(--gold-300); }
.sg-footer-bottom {
  border-top: 1px solid var(--border-subtle);
  margin-top: 3rem;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   LOGIN PAGES
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero), var(--bg-primary);
  position: relative;
  padding: 2rem;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-elevated), var(--shadow-gold);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .brand {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.input-group-sg {
  position: relative;
}
.input-group-sg > i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-400);
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 1;
}
.input-group-sg .form-control-sg {
  padding-left: 2.75rem;
}
.password-toggle-wrap {
  position: relative;
}
.password-toggle-wrap .form-control-sg {
  padding-right: 2.75rem;
}
.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  font-size: 1rem;
  line-height: 1;
  z-index: 2;
}
.password-toggle-btn:hover {
  color: var(--gold-300);
}
.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.login-options .form-check-label,
.login-options a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   CHARTS
   ========================================================================== */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.chart-card .chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.chart-card .chart-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

/* ==========================================================================
   STATS STRIP
   ========================================================================== */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}
.stat-item { text-align: center; }
.stat-item .stat-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==========================================================================
   NOTIFICATION BELL
   ========================================================================== */
.notif-bell {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}
.notif-bell:hover { color: var(--gold-300); border-color: var(--border-gold); }
.notif-bell .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: #F87171;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

/* ==========================================================================
   AVATAR
   ========================================================================== */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--bg-void);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ==========================================================================
   PAGE HEADER (PORTAL)
   ========================================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}
.page-header .breadcrumb-sg {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.page-header .breadcrumb-sg a { color: var(--text-secondary); }
.page-header .breadcrumb-sg a:hover { color: var(--gold-300); }

/* ==========================================================================
   TABS
   ========================================================================== */
.sg-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.sg-tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.sg-tab:hover { color: var(--gold-300); }
.sg-tab.active {
  color: var(--gold-300);
  border-bottom-color: var(--gold-400);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  .app-sidebar, .app-header, .sg-navbar, .no-print { display: none !important; }
  .app-main { margin-left: 0 !important; }
  body { background: #fff; color: #000; }
  .glass-card, .sg-table-wrap { border: 1px solid #ccc; box-shadow: none; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .app-main { margin-left: 0 !important; }
  :root { --sidebar-width: 280px; }
  .sidebar-toggle-btn { display: inline-flex !important; }
}

@media (max-width: 768px) {
  .app-content { padding: 1rem; }
  .kpi-value { font-size: 1.5rem; }
  .hero-ctas { flex-direction: column; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header h1 { font-size: 1.35rem; }
  .page-header .btn-gold,
  .page-header .btn-gold-outline {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Manager pages: toolbar + forms */
  .mgr-toolbar {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .mgr-toolbar .mgr-actions {
    justify-content: stretch !important;
    flex-wrap: wrap;
    width: 100%;
  }
  .mgr-toolbar .btn-gold-outline,
  .mgr-toolbar .btn-ghost {
    flex: 1 1 auto;
    min-width: 110px;
    text-align: center;
  }
  .mgr-form-card {
    padding: 1rem !important;
  }
  .mgr-form-card .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .mgr-form-card .d-flex.gap-4 {
    flex-direction: column;
    gap: 0.75rem !important;
  }
  .mgr-form-card .d-flex.gap-2 {
    flex-wrap: wrap;
  }
  .mgr-form-card .btn-gold {
    width: 100%;
  }
  .sg-grid .sg-table,
  .sg-table-wrap .sg-table {
    min-width: 720px;
  }
  .sg-table thead th,
  .sg-table tbody td {
    padding: 0.55rem 0.65rem;
    font-size: 0.75rem;
  }
  .sg-table thead th {
    font-size: 0.62rem;
  }
  .btn_box, .current_page {
    min-width: 32px;
    margin: 0.15rem;
  }
}

@media (max-width: 576px) {
  .app-content { padding: 0.75rem; }
  .glass-card-static { padding: 0.75rem !important; }
  .page-header { margin-bottom: 1rem; }
}

@media (min-width: 2560px) {
  .app-content { max-width: 2200px; margin: 0 auto; width: 100%; }
}

/* ==========================================================================
   UTILITY HELPERS
   ========================================================================== */
.text-gold { color: var(--gold-300) !important; }
.text-muted-sg { color: var(--text-muted) !important; }
.bg-glass { background: var(--bg-glass); }
.border-gold { border-color: var(--border-gold) !important; }
.glow-gold { box-shadow: var(--glow-gold); }
.gradient-text {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
  margin: 2rem 0;
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 3D Tilt Card */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
}

/* Progress bar gold */
.progress-gold {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.progress-gold .bar {
  height: 100%;
  background: var(--gradient-gold);
  border-radius: 3px;
  transition: width 1s ease;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; color: var(--gold-600); margin-bottom: 1rem; }

/* Quick action grid */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}
.quick-action:hover {
  border-color: var(--border-gold);
  color: var(--gold-300);
  box-shadow: var(--shadow-gold);
  transform: translateY(-3px);
}
.quick-action i, .quick-action .material-icons {
  font-size: 1.5rem;
  color: var(--gold-400);
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }
.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle-btn .material-icons { font-size: 1.35rem; }
