:root[data-theme='light'] {
  --bg-app: #f4f7fa;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-soft: rgba(59, 130, 246, 0.08);
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

:root[data-theme='dark'] {
  --bg-app: #020617;
  --bg-sidebar: #020617;
  --bg-card: #0f172a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #60a5fa;
  --primary-soft: rgba(96, 165, 250, 0.12);
  --border: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.5);
}

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-app);
}

/* Sidebar Precision */
.app-sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-right: 1px solid var(--border);
}

.logo-area {
  padding: 0.5rem 0.75rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
  background-color: var(--primary-soft);
  color: var(--primary);
}

/* Main Body Precision */
.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: 64px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  flex-shrink: 0;
}

.app-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Card & Grid Precision */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.glass-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.kpi-title { font-size: 0.8125rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 0.75rem; }
.kpi-value { font-size: 1.75rem; font-weight: 800; color: var(--text-main); margin: 0; }

/* Table Precision */
.data-table-wrapper {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.data-table th {
  background-color: var(--bg-app);
  padding: 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
}
