/* ===== CLEAN CLASSIC SIDEBAR DESIGN ===== */

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #146C43;
  --primary-600: #0F5A37;
  --primary-200: #d1e7dd;
  --ring: rgba(20,108,67,0.35);
  --radius: 14px;
  --shadow: 0 8px 24px rgba(17,24,39,0.08);
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); margin: 0; padding: 0; }

/* ===== SIDEBAR STYLING ===== */
.sidebar { 
  width: 250px; 
  min-height: 100vh; 
  position: fixed; 
  top: 0;
  left: 0;
  background: linear-gradient(180deg, #146C43 0%, #0A3D20 100%);
  color: #fff; 
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 4px 0 15px rgba(20, 108, 67, 0.3);
  z-index: 1000;
  overflow-y: auto;
}

.sidebar .brand { 
  background: linear-gradient(135deg, #20c997 0%, #146C43 100%);
  letter-spacing: 0.8px; 
  font-weight: 700; 
  font-size: 1.3rem; 
  padding: 25px 20px;
  text-align: center;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.sidebar .brand::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.sidebar .brand:hover::before {
  left: 100%;
}

.sidebar nav {
  padding: 0;
}

.sidebar a { 
  color: rgba(255, 255, 255, 0.8); 
  text-decoration: none;
  display: block;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
}

.sidebar a i {
  width: 20px;
  margin-right: 10px;
  text-align: center;
}

.sidebar a:hover { 
  background: linear-gradient(135deg, rgba(32, 201, 151, 0.2), rgba(20, 108, 67, 0.1));
  color: #fff;
  padding-left: 25px;
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(32, 201, 151, 0.2);
}

.sidebar a:hover i {
  color: #20c997;
  transform: scale(1.1);
}

.sidebar a.active { 
  background: linear-gradient(135deg, #20c997, #146C43);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(32, 201, 151, 0.3);
  position: relative;
}

.sidebar a.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 30px;
  background: #fff;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.sidebar a.active i {
  color: #fff;
  transform: scale(1.1);
}

/* Additional green theme enhancements */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(32, 201, 151, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(20, 108, 67, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.sidebar nav {
  position: relative;
  z-index: 2;
}

.sidebar .brand {
  position: relative;
  z-index: 2;
}

/* Sidebar Footer and Logout Button */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-logout::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.btn-logout:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
  color: #fff;
  text-decoration: none;
}

.btn-logout:hover::before {
  left: 100%;
}

.btn-logout i {
  transition: transform 0.3s ease;
}

.btn-logout:hover i {
  transform: scale(1.1);
}

/* ===== CONTENT STYLING ===== */
.content { 
  margin-left: 250px; 
  min-height: 100vh;
  position: relative;
  background: #f8f9fa;
  padding: 20px;
}

/* ===== NAVBAR STYLING ===== */
.navbar { 
  background: #ffffff; 
  box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
  border-bottom: 1px solid #e5e7eb;
}

/* ===== CARDS ===== */
.card { 
  border: 0; 
  border-radius: var(--radius); 
  box-shadow: var(--shadow); 
  background: var(--surface); 
  transition: transform 0.25s ease, box-shadow 0.25s ease; 
}

.card.metric .metric-value { 
  font-size: 2.125rem; 
  font-weight: 800; 
}

.card.metric .metric-label { 
  color: var(--muted); 
}

/* ===== BUTTONS ===== */
.btn-primary { 
  background: var(--primary); 
  border-color: var(--primary); 
  border-radius: var(--radius); 
  font-weight: 600; 
  transition: all 0.25s ease; 
}

.btn-primary:hover { 
  background: var(--primary-600); 
  border-color: var(--primary-600); 
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(20,108,67,0.3); 
}

/* ===== TABLES ===== */
.table { 
  background: var(--surface); 
  border-radius: var(--radius); 
  overflow: hidden; 
  box-shadow: var(--shadow); 
}

.table thead th { 
  background: #f8f9fa; 
  border-bottom: 2px solid #e5e7eb; 
  font-weight: 600; 
  color: var(--text); 
  padding: 15px; 
}

.table tbody td { 
  padding: 15px; 
  border-bottom: 1px solid #f3f4f6; 
  vertical-align: middle; 
}

.table tbody tr:hover { 
  background: #f8f9fa; 
}

/* ===== FORMS ===== */
.form-control { 
  border: 1px solid #d1d5db; 
  border-radius: var(--radius); 
  padding: 12px 16px; 
  transition: all 0.25s ease; 
}

.form-control:focus { 
  border-color: var(--primary); 
  box-shadow: 0 0 0 3px var(--ring); 
}

/* ===== ALERTS ===== */
.alert { 
  border-radius: var(--radius); 
  border: 0; 
  font-weight: 500; 
}

.alert-success { 
  background: #d1fae5; 
  color: #065f46; 
}

.alert-danger { 
  background: #fee2e2; 
  color: #991b1b; 
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .content {
    margin-left: 0;
  }
  
  .sidebar a {
    padding: 14px 20px;
    margin: 2px 8px;
  }
  
  .sidebar .brand {
    padding: 16px 20px;
    font-size: 1.2rem;
  }
}

/* ===== LOGIN PAGE SPECIFIC ===== */
body.login-page {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
  background: linear-gradient(135deg, #0A3D20 0%, #146C43 25%, #20c997 50%, #146C43 75%, #0A3D20 100%) !important;
}

body.login-page .content,
body.login-page div.content,
body.login-page .container,
body.login-page .container-fluid,
body.login-page main,
body.login-page section {
  margin-left: 0 !important;
  padding-left: 0 !important;
  position: static !important;
  z-index: auto !important;
  background: transparent !important;
  min-height: auto !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  max-width: none !important;
}

body.login-page .login-hover {
  width: 100% !important;
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.login-page .reveal-area {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 520px !important;
  margin: 0 auto !important;
}

body.login-page .container-fluid {
  width: 100% !important;
  max-width: 520px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

body.login-page section {
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

body.login-page .login-card {
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
  display: block !important;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.d-none { display: none; }
.d-block { display: block; }
.d-grid { display: grid; }
