/* Total Theme: Royal Sapphire Blue, Deep Emerald Green, Shining Liquid Gold & Cream */
:root {
  --blue-darkest: #011921;
  --blue-dark: #03373b;
  --blue-main: #044e54;
  --blue-cyan: #0891b2;
  --blue-bright: #06b6d4;

  --emerald-darkest: #022c22;
  --emerald-dark: #064e3b;
  --emerald-main: #047857;
  --emerald-medium: #059669;

  --gold-shining: #ffd700;
  --gold-sunburst: #ffe87c;
  --gold-bright: #f5c842;
  --gold-rich: #f59e0b;
  --gold-deep: #d97706;

  --cream-bg: #fbf8f1;
  --cream-card: #ffffff;
  --cream-accent: #f5ead0;

  --navbar: #011921;
  --page-bg: #fbf8f1;
  --card-bg: #ffffff;
  --text-main: #011921;
  --text-secondary: #0891b2;
  --border: rgba(255, 215, 0, 0.4);
}

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;0,900;1,600&family=Poppins:wght@300;400;500;600;700&display=swap');

* { font-family: 'Poppins', sans-serif; box-sizing: border-box; }
h1,h2,h3,.gold-font { font-family: 'Playfair Display', serif; }

body {
  background: var(--cream-bg) !important;
  color: var(--text-main) !important;
  min-height: 100vh;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* ========== HIGH CONTRAST TITLES ========== */
.gold-font {
  color: #03373b !important;
  background: linear-gradient(135deg, #011921 0%, #03373b 40%, #d68b16 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  font-weight: 800 !important;
}

.shining-gold-text {
  color: #ffd700 !important;
  background: linear-gradient(135deg, #ffffff 0%, #ffe87c 30%, #ffd700 70%, #f59e0b 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.5)) !important;
  font-weight: 800 !important;
}

/* ========== TOP NAVBAR (ROYAL SAPPHIRE BLUEISH GLASS) ========== */
.nav-gold {
  background: linear-gradient(135deg, #011921 0%, #03373b 50%, #044e54 100%) !important;
  border-bottom: 2.5px solid #ffd700 !important;
  box-shadow: 0 6px 25px rgba(1, 25, 33, 0.6), 0 2px 15px rgba(255, 215, 0, 0.4) !important;
  backdrop-filter: blur(14px) !important;
  color: #FFFFFF !important;
}

.nav-logo {
  height: 45px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.7));
  transition: transform .25s ease;
}
.nav-logo:hover { transform: scale(1.06); }

.desktop-nav a, .mobile-menu a { color: #ffd700 !important; text-shadow: 0 0 6px rgba(255, 215, 0, 0.5); }

/* ========== SIDEBAR (ROYAL SAPPHIRE BLUEISH & SHINING GOLD) ========== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: linear-gradient(180deg, #011921 0%, #03373b 45%, #044e54 80%, #011921 100%) !important;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 30px rgba(1, 25, 33, 0.7), 2px 0 15px rgba(255, 215, 0, 0.35) !important;
  border-right: 2.5px solid #ffd700 !important;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  overflow: hidden !important;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.35) !important;
  background: rgba(1, 25, 33, 0.8) !important;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 2.5px solid #ffd700 !important;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.7), inset 0 0 8px rgba(255, 255, 255, 0.5) !important;
  flex-shrink: 0;
}

.sidebar-logo-text h2 {
  background: linear-gradient(135deg, #ffffff 0%, #ffe87c 35%, #ffd700 75%, #f59e0b 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.8px;
  margin: 0;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
}

.sidebar-logo-text p {
  color: #ffe87c !important;
  font-size: 10px;
  margin-top: 2px;
  letter-spacing: 1px;
  font-weight: 500;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 215, 0, 0.5); border-radius: 4px; }

.sidebar-section-label {
  padding: 8px 18px !important;
  color: #ffd700 !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 1.6px !important;
  text-transform: uppercase;
  position: sticky !important;
  top: 0 !important;
  background: #011921 !important;
  border-left: 3.5px solid #ffd700 !important;
  z-index: 10 !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6) !important;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255, 255, 255, 0.9) !important;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  border-left: 3px solid transparent;
  letter-spacing: 0.3px;
  position: relative;
}

.sidebar-nav a i {
  color: #ffd700 !important;
  font-size: 14px;
  transition: all 0.25s ease;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7)) !important;
}

.sidebar-nav a:hover {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), rgba(8, 145, 178, 0.15)) !important;
  color: #ffd700 !important;
  border-left-color: #ffd700 !important;
  padding-left: 24px !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.sidebar-nav a:hover i {
  color: #ffffff !important;
  transform: scale(1.18);
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1)) !important;
}

.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.45), rgba(8, 145, 178, 0.25)) !important;
  color: #ffffff !important;
  border-left-color: #ffd700 !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 18px rgba(255, 215, 0, 0.35);
}

.sidebar-nav a.active i {
  color: #ffffff !important;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1)) !important;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 215, 0, 0.35) !important;
  background: #011921 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.sidebar-user-info i {
  font-size: 26px;
  color: #ffd700;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

.user-details p {
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details span {
  color: #ffd700;
  font-size: 10px;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.sidebar-logout {
  padding: 6px 12px;
  background: linear-gradient(135deg, #03373b, #0891b2) !important;
  border: 1.5px solid #ffd700 !important;
  color: #ffd700 !important;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(3, 55, 59, 0.4), 0 0 8px rgba(255, 215, 0, 0.4);
  transition: all 0.2s ease;
}

.sidebar-logout:hover {
  background: linear-gradient(135deg, #ffe87c 0%, #ffd700 50%, #f59e0b 100%) !important;
  color: #011921 !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(255, 215, 0, 0.7);
}

/* ========== CARDS & FORM INPUTS (HIGH CONTRAST & READABILITY) ========== */
.jewel-card, .emi-card, .total-section, .stat-gem {
  background: #ffffff !important;
  border: 1.5px solid rgba(255, 215, 0, 0.5) !important;
  color: #011921 !important;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(1, 25, 33, 0.05), 0 0 10px rgba(255, 215, 0, 0.15) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-gem:hover, .jewel-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 30px rgba(1, 25, 33, 0.15), 0 0 18px rgba(255, 215, 0, 0.4) !important;
  border-color: #ffd700 !important;
}

.jewel-input, input, select, textarea {
  background: #ffffff !important;
  color: #011921 !important;
  border: 1.5px solid rgba(214, 139, 22, 0.35) !important;
  border-radius: 8px;
  font-weight: 500 !important;
}

.jewel-input::placeholder, input::placeholder {
  color: #0891b2 !important;
  opacity: 0.75 !important;
}

label {
  color: #03373b !important;
  font-weight: 600 !important;
}

.jewel-table {
  border: 1.5px solid rgba(255, 215, 0, 0.4) !important;
  border-radius: 10px;
  background: #ffffff !important;
}

.jewel-table th {
  background: linear-gradient(135deg, #011921 0%, #03373b 100%) !important;
  color: #ffd700 !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #ffd700 !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5) !important;
}

.jewel-table td {
  color: #011921 !important;
  font-weight: 500 !important;
}

/* ========== SHINING GOLD BUTTONS ========== */
.btn-jewel, .btn-gold {
  background: linear-gradient(135deg, #ffe87c 0%, #ffd700 45%, #f59e0b 80%, #d97706 100%) !important;
  border: 1.5px solid #ffffff !important;
  color: #011921 !important;
  border-radius: 10px;
  font-weight: 800 !important;
  padding: 9px 20px;
  box-shadow: 0 4px 18px rgba(255, 215, 0, 0.45), 0 0 10px rgba(255, 215, 0, 0.25) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-jewel:hover, .btn-gold:hover {
  background: linear-gradient(135deg, #ffffff 0%, #ffe87c 45%, #ffd700 100%) !important;
  color: #011921 !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.7), 0 0 15px rgba(255, 255, 255, 0.6) !important;
}

/* Glass Cards for 6 summary metrics */
.dark-glass-card {
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  transition: all 0.3s ease;
}

.glass-gold {
  background: linear-gradient(135deg, rgba(3, 55, 59, 0.9), rgba(1, 25, 33, 0.95)) !important;
  border: 1.5px solid #ffd700 !important;
  box-shadow: 0 6px 20px rgba(1, 25, 33, 0.5), 0 0 12px rgba(255, 215, 0, 0.4) !important;
}
.glass-emerald {
  background: linear-gradient(135deg, rgba(4, 78, 84, 0.9), rgba(3, 55, 59, 0.95)) !important;
  border: 1.5px solid #ffe87c !important;
  box-shadow: 0 6px 20px rgba(1, 25, 33, 0.5), 0 0 12px rgba(255, 215, 0, 0.4) !important;
}
.glass-rose {
  background: linear-gradient(135deg, rgba(181, 115, 14, 0.9), rgba(122, 78, 10, 0.95)) !important;
  border: 1.5px solid #ffd700 !important;
  box-shadow: 0 6px 20px rgba(214, 139, 22, 0.4), 0 0 12px rgba(255, 215, 0, 0.4) !important;
}
.glass-purple {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.9), rgba(3, 55, 59, 0.95)) !important;
  border: 1.5px solid #ffd700 !important;
  box-shadow: 0 6px 20px rgba(1, 25, 33, 0.5), 0 0 12px rgba(255, 215, 0, 0.4) !important;
}
.glass-orange {
  background: linear-gradient(135deg, rgba(122, 78, 10, 0.9), rgba(181, 115, 14, 0.95)) !important;
  border: 1.5px solid #ffe87c !important;
  box-shadow: 0 6px 20px rgba(214, 139, 22, 0.4), 0 0 12px rgba(255, 215, 0, 0.4) !important;
}
.glass-teal {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(1, 25, 33, 0.95)) !important;
  border: 1.5px solid #ffd700 !important;
  box-shadow: 0 6px 20px rgba(1, 25, 33, 0.5), 0 0 12px rgba(255, 215, 0, 0.4) !important;
}

/* ========== COMPREHENSIVE MOBILE RESPONSIVENESS ========== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%) !important;
    box-shadow: none !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 10px 0 40px rgba(1, 25, 33, 0.8) !important;
  }

  .page-wrapper, nav.nav-gold {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .mobile-burger {
    display: flex !important;
    align-items: center;
  }

  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .stock-grid, .grid {
    grid-template-columns: 1fr !important;
  }

  .table-container, .overflow-x-auto {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .jewel-table {
    min-width: 650px !important;
  }

  .modal-content {
    width: 94% !important;
    max-width: 450px !important;
    padding: 16px !important;
    margin: 10px auto !important;
  }

  .btn-jewel, .btn-gold, button, input, select {
    min-height: 42px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .grid-cols-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  
  .stat-gem, .dark-glass-card {
    padding: 10px 8px !important;
  }

  .text-base {
    font-size: 13px !important;
  }
  .text-lg {
    font-size: 14px !important;
  }
  .text-2xl, .text-3xl {
    font-size: 18px !important;
  }
}

/* Page wrapper animation */
.page-wrapper {
  animation: slideInFromRightGlobal 0.3s ease-out forwards;
}

@keyframes slideInFromRightGlobal {
  from { transform: translateX(18px); opacity: 0.95; }
  to { transform: none; opacity: 1; }
}