@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg:           oklch(9% 0 0);
  --surface:      oklch(13% 0 0);
  --raised:       oklch(17% 0 0);
  --border:       oklch(23% 0 0);
  --accent:       oklch(57% 0.09 163);   /* #3F987F */
  --accent-soft:  oklch(57% 0.09 163 / 15%);
  --accent-hover: oklch(62% 0.09 163);
  --text-body:    oklch(87% 0 0);
  --text-muted:   oklch(52% 0 0);
  --danger:       #ff4d4f;
  --danger-hover: #ff7875;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --space-4:      4px;
  --space-8:      8px;
  --space-12:     12px;
  --space-16:     16px;
  --space-24:     24px;
  --space-32:     32px;
  --font-family:  'Inter', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--space-24);
}

.sidebar .brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-32);
  display: flex;
  align-items: center;
  gap: var(--space-8);
  text-decoration: none;
}

.sidebar .brand svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-sm);
  transition: all 120ms ease-out;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-links a:hover {
  background: var(--raised);
  color: var(--text-body);
}

.nav-links a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-32);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-32);
}

.page-title {
  font-size: 24px;
  font-weight: 600;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-24);
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgb(0 0 0 / 40%);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-24);
  margin-bottom: var(--space-32);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-24);
  margin-bottom: var(--space-32);
}

.metric-title {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-8);
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-body);
}

/* Tables */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}

.table-container:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgb(0 0 0 / 40%);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: var(--raised);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  padding: var(--space-12) var(--space-16);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: var(--space-12) var(--space-16);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  color: var(--text-body);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--raised);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--raised);
  color: var(--text-body);
}

.badge.admin { background: var(--accent-soft); color: var(--accent); }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 120ms ease-out;
  gap: var(--space-8);
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--raised);
  color: var(--text-body);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.input, .select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-body);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  width: 100%;
  transition: border-color 120ms ease-out;
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group {
  margin-bottom: var(--space-16);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-4);
  color: var(--text-muted);
  font-size: 13px;
}

/* Utility */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-4 { margin-bottom: var(--space-16); }
.mb-8 { margin-bottom: var(--space-32); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-8); }
.gap-4 { gap: var(--space-16); }

/* Chart Container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}
