:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #0078d7;
  --accent-soft: rgba(0, 120, 215, 0.08);
  --border: #e5e7eb;
  --radius: 12px;
  --gap: 16px;

  --text-main: #1f2937;
  --text-muted: #6b7280;

  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-main);
}

/* ------------------------------
   PAGE LAYOUT
--------------------------------*/
#main {
  padding: 24px 28px;
}

.main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* ------------------------------
   KPI CARDS — Notion/Linear style
--------------------------------*/
.kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: 24px;
}

.card {
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform .12s ease, box-shadow .12s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.card h3 {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.card .value {
  font-size: 28px;
  margin-top: 10px;
  font-weight: 800;
  color: var(--accent);
}

/* ------------------------------
   PANELS
--------------------------------*/
.panel {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

/* ------------------------------
   INVENTORY CONTROLS
--------------------------------*/
.inventory-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.btn {
  padding: 9px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s, transform .1s;
}

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

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: #006ac0;
}

.btn.ghost {
  background: #f3f4f6;
  color: #374151;
}

.btn.ghost:hover {
  background: #e5e7eb;
}

/* ------------------------------
   TABLE — Linear style
--------------------------------*/
.inventory-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.inventory-table thead th {
  padding: 12px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.inventory-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f3f5;
}

.inventory-table tbody tr:hover {
  background: #f9fbff;
}

.inventory-table tbody tr.selected {
  background: var(--accent-soft);
  outline: 2px solid rgba(0, 120, 215, 0.15);
}

/* ------------------------------
   DETAILS PANEL
--------------------------------*/
.details {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.details .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.details .row span:first-child {
  color: var(--text-muted);
}

/* ------------------------------
   CHART PLACEHOLDER
--------------------------------*/
.chart-placeholder {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #eaf3ff, #f5f9ff);
  border-radius: var(--radius);
  border: 1px dashed #bcd4f6;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
}

/* ------------------------------
   POPULAR PRODUCTS
--------------------------------*/
.popular-products {
  display: flex;
  gap: var(--gap);
  margin-top: 16px;
}

.popular-products .product {
  background: #fff;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  flex: 1;
  text-align: center;
}

.popular-products img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* ------------------------------
   RESPONSIVE
--------------------------------*/
@media (max-width: 1000px) {
  .kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
  }
  .kpi {
    grid-template-columns: 1fr;
  }
}