@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette - Clean White & Green Theme */
  --bg-primary: #ffffff; /* pure white */
  --bg-secondary: #f8f9fa; /* very light gray */
  --bg-tertiary: #f1f3f5; /* light gray */
  
  --text-primary: #212529; /* dark text */
  --text-secondary: #495057;
  --text-muted: #868e96;
  
  --accent-primary: #547C45; /* Brand Dark Green */
  --accent-primary-hover: #456639;
  --gradient-accent: linear-gradient(135deg, #7DB85B, #547C45);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #7DB85B; /* Replaced blue info with light green */
  
  /* Borders & Shadows */
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Layout */
  --sidebar-width: 260px;
  --header-height: 70px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s var(--transition-normal) forwards;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--gradient-accent);
  color: white;
}

.sidebar-header h2 {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

/* Scrollbar styling */
.sidebar-nav::-webkit-scrollbar, .main-content::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track, .main-content::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-link i {
  margin-right: 0.75rem;
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(125, 184, 91, 0.1);
  color: var(--accent-primary);
}

.nav-link.active {
  background-color: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(84, 124, 69, 0.3);
}

.user-profile-mini {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.top-header {
  height: var(--header-height);
  background-color: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-primary);
}

.badge {
  position: static;
  top: -5px;
  right: -5px;
  background-color: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  display: inline-block;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* Content Area */
.main-content {
  padding: 2rem;
  flex: 1;
}

/* Cards */
.card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
}

.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.kpi-icon.blue { background-color: rgba(125, 184, 91, 0.15); color: var(--accent-primary); }
.kpi-icon.green { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
.kpi-icon.orange { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); }
.kpi-icon.purple { background-color: rgba(125, 184, 91, 0.15); color: var(--accent-primary); }

.kpi-details h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.kpi-details .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 0.95rem;
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: var(--bg-tertiary);
}

/* Status Tags */
.status {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status.success { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
.status.warning { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status.danger { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status.info { background-color: rgba(125, 184, 91, 0.15); color: var(--info); }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(84, 124, 69, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(84, 124, 69, 0.4);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: #475569;
}

.form-control {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(125, 184, 91, 0.2);
}

/* Utilities */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* Grid Layouts for Content */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* Map Placeholder */
.map-placeholder {
  width: 100%;
  height: 300px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-direction: column;
  gap: 1rem;
}

.map-placeholder i {
  font-size: 3rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 992px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
.nav-section {
    margin-bottom: 25px;
}

.nav-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 1rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}
.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.logout-link {
    color: var(--danger);
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }
  
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  
  .menu-toggle {
    display: block;
  }
  
}
