:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass: rgba(30, 41, 59, 0.7);
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-md:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.5;
}

h1,
h2,
h3,
.logo span {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.logo-icon {
  background: var(--accent-gradient);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.logo span {
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.nav-item i {
  width: 20px;
  height: 20px;
}

.nav-item.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Main Content */
.content {
  flex-grow: 1;
  padding: 2.5rem 3.5rem;
  background: radial-gradient(circle at top right, #1e293b, #0f172a);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

#view-title {
  font-size: 2.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

#view-description {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1.1rem;
}

.badge {
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Glass Components */
.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Charts & Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.chart-container {
  padding: 2rem;
  height: 450px;
}

/* Tables */
.table-section {
  padding: 2rem;
}

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

.btn-refresh {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-refresh:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

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

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

thead {
  border-bottom: 1px solid var(--border-color);
}

th {
  text-align: left;
  padding: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

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

.badge-growth {
  color: #10b981;
  font-weight: 600;
  font-size: 0.85rem;
}

.badge-inflation {
  color: #f43f5e;
  font-weight: 600;
}

.main-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.main-footer strong {
  color: var(--accent-indigo);
  font-weight: 600;
}

/* Responsive & Mobile First */
@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
    padding: 1.5rem 0.5rem;
  }
  .logo span,
  .nav-item span,
  .sidebar-footer {
    display: none;
  }
  .logo {
    justify-content: center;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .content {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    top: auto;
    flex-direction: row;
    padding: 0.75rem 1rem;
    z-index: 1000;
    border-right: none;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
  }

  .logo {
    display: none;
  }

  .nav-menu {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }

  .nav-item {
    width: auto;
    flex-direction: column;
    gap: 4px;
    font-size: 0.65rem;
    padding: 8px;
  }

  .nav-item span {
    display: block;
  }

  .nav-item i {
    width: 18px;
    height: 18px;
  }

  .content {
    padding: 1.5rem 1rem 6rem 1rem;
  }

  #view-title {
    font-size: 1.75rem;
  }

  #view-description {
    font-size: 0.9rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .chart-container {
    height: 320px;
    padding: 1rem;
  }

  .table-section {
    padding: 1rem;
  }

  th,
  td {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
}
