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

:root {
  --enviro-primary: #1A4A5E;
  --enviro-secondary: #3B82F6;
  --enviro-warning: #F59E0B;
  --enviro-success: #10B981;
  --enviro-danger: #EF4444;
  --bg-surface: #F8FAFC;
  --surface-card: #FFFFFF;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --border-light: #E2E8F0;
  --radius: 12px;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

* { 
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; 
}

body { 
  background: var(--bg-surface); 
  color: var(--text-primary);
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

/* Layout */
.page-container { 
  display: flex; 
  min-height: 100vh; 
  max-width: 100%;
  margin: 0;
}

.sidebar { 
  width: 260px; 
  background: var(--surface-card); 
  border-right: 1px solid var(--border-light); 
  box-shadow: var(--shadow-sm);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.main-content { 
  flex: 1; 
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-header {
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-light);
  padding: var(--spacing-md) var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--enviro-primary);
}

.content-area {
  padding: var(--spacing-xl);
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Cards */
.card { 
  background: var(--surface-card); 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius); 
  box-shadow: var(--shadow-sm); 
  padding: var(--spacing-lg); 
  margin-bottom: var(--spacing-lg);
}

.card-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: var(--spacing-lg); 
  padding-bottom: var(--spacing-md); 
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.card-body {
  margin: 0;
}

/* Buttons */
.btn { 
  padding: 12px 20px; 
  border-radius: var(--radius); 
  border: none; 
  font-weight: 500; 
  font-size: 16px; 
  cursor: pointer; 
  min-height: 48px; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) { 
  background: #132f3d; 
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface);
}

.btn-warning { 
  background: var(--enviro-warning); 
  color: #1E293B;
}

.btn-warning:hover:not(:disabled) {
  background: #D97706;
  color: white;
}

.btn-success {
  background: var(--enviro-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-danger {
  background: var(--enviro-danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #DC2626;
}

.btn-sm {
  padding: 8px 16px;
  min-height: 36px;
  font-size: 14px;
}

/* Typography */
h1 { 
  font-size: 32px; 
  font-weight: 700; 
  margin: 0 0 var(--spacing-lg) 0; 
  color: var(--enviro-primary); 
}

h2 { 
  font-size: 24px; 
  font-weight: 600; 
  margin: 0 0 var(--spacing-md) 0; 
  color: var(--text-primary); 
}

h3 { 
  font-size: 20px; 
  font-weight: 600; 
  margin: 0 0 var(--spacing-md) 0; 
}

.label { 
  font-size: 14px; 
  color: var(--text-secondary); 
  font-weight: 500; 
  display: block;
  margin-bottom: var(--spacing-xs);
}

.text-muted {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Tables */
.table { 
  width: 100%; 
  border-collapse: collapse; 
  background: var(--surface-card); 
  border-radius: var(--radius); 
  overflow: hidden; 
  box-shadow: var(--shadow-sm);
}

.table th { 
  background: var(--bg-surface); 
  padding: var(--spacing-md); 
  text-align: left; 
  font-weight: 600; 
  border-bottom: 2px solid var(--border-light);
  color: var(--text-primary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td { 
  padding: var(--spacing-md); 
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.table tr:hover { 
  background: #F1F5F9; 
}

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

/* Status Pills */
.status { 
  padding: 4px 12px; 
  border-radius: 9999px; 
  font-size: 14px; 
  font-weight: 500;
  display: inline-block;
}

.status-active { 
  background: #D1FAE5; 
  color: var(--enviro-success); 
}

.status-overdue { 
  background: #FEF3C7; 
  color: var(--enviro-warning); 
}

.status-pending {
  background: #DBEAFE;
  color: var(--enviro-secondary);
}

.status-danger {
  background: #FEE2E2;
  color: var(--enviro-danger);
}

.status-inactive {
  background: #F1F5F9;
  color: var(--text-secondary);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface-card);
  color: var(--text-primary);
  min-height: 48px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--enviro-primary);
  box-shadow: 0 0 0 3px rgba(26, 74, 94, 0.1);
}

.form-control::placeholder {
  color: var(--text-secondary);
}

.validation-message {
  color: var(--enviro-danger);
  font-size: 14px;
  margin-top: var(--spacing-xs);
}

/* Search */
.search-bar {
  position: relative;
  max-width: 400px;
}

.search-bar input {
  padding-left: 40px;
}

.search-bar::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

/* Filter Chips */
.filter-chips {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-lg);
}

.filter-chip {
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.filter-chip:hover {
  border-color: var(--enviro-primary);
  background: var(--bg-surface);
}

.filter-chip.active {
  background: var(--enviro-primary);
  color: white;
  border-color: var(--enviro-primary);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--spacing-lg);
  gap: var(--spacing-md);
}

.tab {
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.tab:hover {
  color: var(--enviro-primary);
}

.tab.active {
  color: var(--enviro-primary);
  border-bottom-color: var(--enviro-primary);
}

.tab-content {
  margin-top: var(--spacing-lg);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-md);
}

.kpi-title {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-xs) 0;
}

.kpi-footer {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: var(--spacing-sm);
}

/* Two Column Layout */
.two-column {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.two-column-left,
.two-column-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

/* Priority List */
.priority-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.priority-item {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.priority-item:hover {
  background: var(--bg-surface);
}

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

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

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .content-area {
    padding: var(--spacing-md);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
