:root {
  /* Colors */
  --bg-color: #0b0f19;
  --sidebar-bg: rgba(15, 23, 42, 0.4);
  --glass-bg: rgba(30, 41, 59, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --brand-primary: #8b5cf6;
  --brand-secondary: #06b6d4;
  --brand-pink: #ec4899;

  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Atmospheric Gradients background */
body::before, body::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.5;
  animation: float 20s infinite alternate;
}

body::before {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--brand-primary) 0%, transparent 60%);
}

body::after {
  bottom: -10%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--brand-secondary) 0%, transparent 60%);
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Glassmorphism utility */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

/* Buttons */
.primary-btn {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-pink));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  filter: brightness(1.1);
}

.danger-btn {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.danger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
  filter: brightness(1.1);
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.logo i {
  font-size: 1.75rem;
  color: var(--brand-primary);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo h2 {
  font-size: 1.5rem;
  font-weight: 700;
}
.logo span {
  font-weight: 300;
  color: var(--brand-secondary);
}

.nav-links {
  list-style: none;
  flex: 1;
}

.nav-links li {
  margin-bottom: 0.5rem;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 1rem;
  border-radius: 12px;
  transition: var(--transition-smooth);
  font-weight: 500;
}

.nav-links a:hover, .nav-links li.active a {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-links li.active a {
  border-left: 3px solid var(--brand-primary);
  background: linear-gradient(90deg, rgba(139,92,246,0.1) 0%, transparent 100%);
}

.nav-links i {
  width: 20px;
  font-size: 1.1rem;
}

.nav-footer {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Main Content */
.content {
  flex: 1;
  padding: 2.5rem 3rem;
  height: 100vh;
  overflow-y: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.6s ease;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

header p {
  color: var(--text-muted);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition-smooth);
  animation: fadeInUp 0.5s ease backwards;
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.2);
}

.kpi-grid .kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-grid .kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-grid .kpi-card:nth-child(3) { animation-delay: 0.3s; }

.kpi-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--brand-primary);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--brand-secondary);
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.3);
}

.icon-pink {
  background: rgba(236, 72, 153, 0.15);
  color: var(--brand-pink);
  box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.3);
}

.kpi-data h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.kpi-data p {
  font-size: 1.75rem;
  font-weight: 700;
}

/* Charts Section */
.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.chart-container {
  padding: 1.5rem;
  animation: fadeInUp 0.5s ease backwards 0.4s;
}

.chart-container h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.chart-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Table Section */
.table-section {
  padding: 1.5rem;
  animation: fadeInUp 0.5s ease backwards 0.5s;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem;
  text-align: left;
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

tr:hover td {
  background: rgba(255,255,255,0.02);
}

.category-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(255,255,255,0.1);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  transform: translateY(-2px);
}

.edit-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  color: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

.delete-btn:hover {
  background: rgba(236, 72, 153, 0.2);
  color: var(--brand-pink);
  border-color: var(--brand-pink);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.close {
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: white;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

input, select {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: rgba(0,0,0,0.4);
}

input option {
  background: var(--bg-color);
}

.submit-btn {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
}

.text-center {
  text-align: center;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1024px) {
  .charts-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }
  .sidebar {
    width: 100%;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }
  .nav-links {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
  }
  .nav-links a {
    padding: 0.5rem 1rem;
    white-space: nowrap;
  }
  .content {
    padding: 1.5rem;
    height: auto;
    overflow-y: visible;
  }
}
