:root {
  --color-primary: oklch(55% 0.12 195);
  --color-primary-hover: oklch(48% 0.13 195);
  --color-primary-subtle: oklch(95% 0.02 195);
  --surface-base: oklch(98.5% 0.003 195);
  --surface-raised: oklch(100% 0.002 195);
  --surface-pressed: oklch(96% 0.003 195);
  --border-subtle: oklch(88% 0.005 195);
  --border-prominent: oklch(75% 0.006 195);
  --text-primary: oklch(25% 0.01 195);
  --text-secondary: oklch(50% 0.008 195);
  --text-tertiary: oklch(65% 0.007 195);
  --color-success: oklch(60% 0.15 145);
  --color-warning: oklch(70% 0.12 85);
  --color-danger: oklch(55% 0.18 25);
  --color-info-bg: var(--color-primary-subtle);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  --sidebar-width: 180px;
  --topbar-height: 56px;
}

[data-theme="dark"] {
  --color-primary: oklch(60% 0.10 195);
  --color-primary-hover: oklch(53% 0.11 195);
  --color-primary-subtle: oklch(30% 0.03 195);
  --surface-base: oklch(18% 0.01 195);
  --surface-raised: oklch(23% 0.012 195);
  --surface-pressed: oklch(28% 0.014 195);
  --border-subtle: oklch(35% 0.015 195);
  --border-prominent: oklch(45% 0.018 195);
  --text-primary: oklch(92% 0.005 195);
  --text-secondary: oklch(75% 0.008 195);
  --text-tertiary: oklch(60% 0.007 195);
  --color-success: oklch(65% 0.12 145);
  --color-warning: oklch(75% 0.10 85);
  --color-danger: oklch(60% 0.15 25);
}

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

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
  text-decoration: none;
}

.topbar-logo-monogram {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.topbar-center {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
}

.topbar-btn:hover {
  background: var(--surface-pressed);
  color: var(--text-primary);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface-raised);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  z-index: 90;
  transition: transform 200ms ease-out;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
}

.sidebar-link:hover {
  background: var(--surface-pressed);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Main Layout */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height));
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Panels */
.panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-wrap: balance;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-grid .panel:nth-child(1) {
  grid-column: 1;
}

.dashboard-grid .panel:nth-child(2) {
  grid-column: 2;
}

.dashboard-full {
  grid-column: 1 / -1;
}

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

/* Big Number */
.big-number {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.big-number-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-pressed);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--color-primary);
  transition: width 200ms ease-out;
}

.progress-fill.warning {
  background: var(--color-warning);
}

.progress-fill.danger {
  background: var(--color-danger);
}

/* Lists */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-info {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.list-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Status Dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.success {
  background: var(--color-success);
}

.status-dot.warning {
  background: var(--color-warning);
}

.status-dot.danger {
  background: var(--color-danger);
}

.status-dot.inactive {
  background: var(--text-tertiary);
}

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

.data-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 12px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
}

.data-table tr:hover td {
  background: var(--surface-pressed);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
}

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

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

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: var(--surface-pressed);
}

/* Chart placeholder */
.chart-placeholder {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding-top: 16px;
}

.chart-bar {
  flex: 1;
  background: var(--color-primary);
  border-radius: 4px 4px 0 0;
  opacity: 0.8;
  min-height: 20px;
  transition: opacity 150ms ease-out;
}

.chart-bar:hover {
  opacity: 1;
}

/* News items */
.news-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-text {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.news-item-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Error / Info banners */
.banner {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.875rem;
}

.banner-danger {
  background: oklch(95% 0.03 25);
  color: var(--color-danger);
  border: 1px solid oklch(85% 0.05 25);
}

[data-theme="dark"] .banner-danger {
  background: oklch(25% 0.05 25);
  border-color: oklch(40% 0.08 25);
}

.banner-info {
  background: var(--color-primary-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

/* Skeleton loading */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.skeleton {
  background: var(--border-subtle);
  border-radius: 6px;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-prominent);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 150ms ease-out;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-subtle);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

/* Toggle switch */
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--border-prominent);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 150ms ease-out;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 150ms ease-out;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.active {
  background: var(--color-primary);
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
}

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .dashboard-grid,
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .dashboard-grid .panel:nth-child(2) {
    grid-column: 1;
  }
}

/* Page header */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  text-wrap: balance;
}

.page-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Team member card (detail page) */
.team-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 16px;
}

.team-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 600;
  flex-shrink: 0;
}

.team-card-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.team-card-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Utility */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.justify-between { justify-content: space-between; }
