/* 
  KAP ERP - Executive Dashboard 
  Aesthetic, Cutting-Edge, Glassmorphism Dark Mode
*/

/* Only apply when body has dashboard-active */
body.dashboard-active {
  background: linear-gradient(135deg, #15162B 0%, #1B1D3A 50%, #101127 100%);
  color: #FFFFFF;
  transition: background 0.5s ease;
}
body.dashboard-active .topnav {
  background: rgba(21, 22, 43, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
}
body.dashboard-active .pagehead h1 {
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #4F46E5, #00D2FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
body.dashboard-active .page-sub {
  color: #8F94B5;
}

/* Glassmorphism Cards */
.dash-glass {
  background: rgba(32, 34, 62, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dash-glass:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(79, 70, 229, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Glow effects */
.dash-glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}
.kpi-title {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-icon {
  font-size: 1.2rem;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}
.kpi-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  font-feature-settings: "tnum";
}
.kpi-sub {
  font-size: 0.8rem;
  margin-top: 8px;
  font-weight: 600;
}
.kpi-sub.up { color: #00E676; }
.kpi-sub.down { color: #FF2A7A; }

/* Dashboard layout rows */
.dash-bento {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 1100px) {
  .dash-bento { grid-template-columns: 1fr; }
}

.dc-head-glass {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.dc-head-glass h3 {
  font-size: 1.1rem;
  color: #fff;
  margin: 0;
  font-weight: 700;
}
.dc-head-glass .badge {
  background: rgba(255,255,255,0.1);
  color: #cbd5e1;
}

/* Modern Activity List */
.glass-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.glass-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255,255,255,0.03);
  transition: background 0.2s;
}
.glass-item:hover {
  background: rgba(0, 0, 0, 0.4);
}
.gi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.1rem;
}
.gi-icon.sales { background: rgba(0, 230, 118, 0.15); color: #00E676; }
.gi-icon.mfg { background: rgba(79, 70, 229, 0.15); color: #4F46E5; }
.gi-mid { flex: 1; min-width: 0; }
.gi-title { font-weight: 700; font-size: 0.9rem; color: #f1f5f9; }
.gi-sub { font-size: 0.8rem; color: #8F94B5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-amt { font-weight: 800; color: #fff; }

/* Micro animations */
.animated-fade {
  animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ApexCharts Theme Overrides for Glassmorphism */
.apexcharts-tooltip {
  background: rgba(15, 23, 42, 0.9) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
  color: #fff !important;
  border-radius: 8px !important;
}
.apexcharts-tooltip-title {
  background: rgba(0,0,0,0.3) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-family: 'Quicksand', sans-serif !important;
  font-weight: 700 !important;
}
.apexcharts-text {
  fill: #8F94B5 !important;
  font-family: 'Quicksand', sans-serif !important;
  font-weight: 600 !important;
}
.apexcharts-legend-text {
  color: #8F94B5 !important;
  font-family: 'Quicksand', sans-serif !important;
  font-weight: 600 !important;
}
