:root {
  /* Colors - Modern Corporate Palette */
  --primary: #4361ee;
  --primary-hover: #3a56d4;
  --secondary: #7209b7;
  --success: #4cc9f0;
  --info: #4895ef;
  --warning: #f72585;
  --danger: #ef476f;
  
  --bg-main: #f8f9fc;
  --bg-card: #ffffff;
  --bg-sidebar: #1e1e2d;
  --sidebar-text: #a2a3b7;
  --sidebar-hover: #2b2b40;
  
  --text-main: #2b2d42;
  --text-muted: #8d99ae;
  --border-color: #edf2f7;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: white;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  flex-shrink: 0;
}

.sidebar-header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.sidebar-nav {
  padding: var(--space-md) 0;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s;
  gap: var(--space-md);
}

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

.nav-item.active {
  border-left: 4px solid var(--primary);
  padding-left: calc(var(--space-lg) - 4px);
}

/* Main Content Area */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Navbar */
.navbar {
  height: 70px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #f3f6f9;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  width: 300px;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  margin-left: var(--space-sm);
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}

.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

/* Content Container */
.content {
  padding: var(--space-lg);
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.breadcrumb {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Grid System */
.grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.grid-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (max-width: 1024px) {
  .grid-charts {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.card-title {
  font-weight: 600;
  font-size: 1.1rem;
}

/* KPI Cards specifically */
.kpi-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-data .label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-data .value {
  font-size: 1.5rem;
  font-weight: 700;
}

.kpi-data .trend {
  font-size: 0.75rem;
  margin-top: 4px;
}

.trend.up { color: #10b981; }
.trend.down { color: #ef4444; }

/* Charts Placeholders */
.chart-placeholder {
  width: 100%;
  height: 300px;
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
  padding-top: var(--space-lg);
}

.bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.bar:hover { opacity: 1; }

.bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Table */
.table-container {
  width: 100%;
  overflow-x: auto;
}

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

th {
  text-align: left;
  padding: var(--space-md);
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
}

td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.employee-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-info { background: #e0f2fe; color: #075985; }

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-sm { padding: 4px 8px; font-size: 0.8rem; }

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

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

/* Helper Utilities */
.placeholder-image {
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
}

.placeholder-avatar {
  background: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
