/* ==============================================
   RESET & BASE - Enhanced Green Theme
   ============================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background: linear-gradient(135deg, #667e6b 0%, #2c3e50 100%);
  min-height: 100vh;
  padding: 20px;
}

/* Main container - enhanced */
.container {
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  padding: 30px;
  border: 1px solid rgba(39, 174, 96, 0.2);
}

/* ==============================================
   TYPOGRAPHY - Enhanced
   ============================================== */
h1 {
  color: #27ae60;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 3px solid #27ae60;
  font-weight: 600;
  letter-spacing: -0.5px;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  border-radius: 3px;
}

h2 {
  color: #27ae60;
  margin: 25px 0 15px;
  font-weight: 500;
}

/* ==============================================
   NAVIGATION - Enhanced
   ============================================== */
nav {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  padding: 15px 25px;
  border-radius: 8px;
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 25px;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

nav a,
nav span {
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

nav a.active {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==============================================
   FLASH MESSAGES - Enhanced
   ============================================== */
.flash {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash.success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border-left-color: #27ae60;
}

.flash.error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border-left-color: #dc3545;
}

/* ==============================================
   TABLES - Enhanced
   ============================================== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

th {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  font-weight: 600;
  padding: 15px 12px;
  text-align: left;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 12px 12px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

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

tr:nth-child(even) {
  background: #f8fafc;
}

tr:hover {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  transition: background 0.3s ease;
}

/* ==============================================
   FORMS - Enhanced
   ============================================== */
form {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="url"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8fafc;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #27ae60;
  background: white;
  box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

/* ==============================================
   BUTTONS - Enhanced
   ============================================== */
button,
.btn {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

button:active,
.btn:active {
  transform: translateY(0);
}

.btn-delete {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-delete:hover {
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-view {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-view:hover {
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* ==============================================
   ACTION LINKS - Enhanced
   ============================================== */
td a {
  color: #27ae60;
  text-decoration: none;
  margin-right: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

td a:hover {
  color: #219a52;
}

td a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #27ae60;
  transition: width 0.3s ease;
}

td a:hover::after {
  width: 100%;
}

td form {
  display: inline;
  padding: 0;
  background: none;
  box-shadow: none;
}

td button {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  padding: 5px 12px;
  font-size: 0.85rem;
  box-shadow: 0 2px 5px rgba(220, 53, 69, 0.2);
}

/* ==============================================
   AUTHENTICATION - Enhanced
   ============================================== */
.auth-container {
  max-width: 450px;
  margin: 50px auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #27ae60, #2ecc71, #27ae60);
}

.auth-container h1 {
  text-align: center;
  border-bottom: none;
  margin-bottom: 10px;
}

.auth-container h2 {
  text-align: center;
  color: #7f8c8d;
  font-weight: normal;
  margin-top: 5px;
  font-size: 1.1rem;
}

/* ==============================================
   DOCUMENTS - Enhanced
   ============================================== */
.upload-form {
  background: linear-gradient(135deg, #f8fafc 0%, #e9ecef 100%);
  border: 3px dashed #27ae60;
  border-radius: 12px;
  padding: 30px;
  margin: 25px 0;
  text-align: center;
  transition: all 0.3s ease;
}

.upload-form:hover {
  border-color: #219a52;
  background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
}

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

.documents-table th {
  background: linear-gradient(135deg, #f8fafc 0%, #e9ecef 100%);
  color: #2c3e50;
  border-bottom: 3px solid #27ae60;
  text-transform: none;
}

/* ==============================================
   DANGER ZONE - Enhanced
   ============================================== */
.danger-zone {
  margin-top: 40px;
  padding: 25px;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%);
  border: 2px solid #dc3545;
  border-radius: 12px;
  position: relative;
}

.danger-zone::before {
  content: '⚠️';
  position: absolute;
  top: -15px;
  left: 20px;
  background: #dc3545;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.danger-zone h3 {
  color: #dc3545;
  margin-bottom: 15px;
  font-weight: 600;
}

/* ==============================================
   BADGES - Enhanced
   ============================================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.badge-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border: 1px solid #27ae60;
}

.badge-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  color: #856404;
  border: 1px solid #ffc107;
}

.badge-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #dc3545;
}

/* ==============================================
   CARD COMPONENTS
   ============================================== */
.card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(39, 174, 96, 0.15);
  border-color: #27ae60;
}

/* ==============================================
   STATS CARDS
   ============================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, white 0%, #f8fafc 100%);
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #27ae60;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #27ae60;
  line-height: 1.2;
}

.stat-label {
  color: #7f8c8d;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==============================================
   LOADING STATES
   ============================================== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

/* ==============================================
   UTILITIES - Enhanced
   ============================================== */
.text-center {
  text-align: center;
}
.mt-3 {
  margin-top: 20px;
}
.mt-4 {
  margin-top: 30px;
}
.mb-3 {
  margin-bottom: 20px;
}
.mb-4 {
  margin-bottom: 30px;
}
.p-3 {
  padding: 20px;
}
.p-4 {
  padding: 30px;
}

/* Gradient backgrounds */
.bg-gradient-green {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
}

.bg-gradient-light {
  background: linear-gradient(135deg, #f8fafc 0%, #e9ecef 100%);
}

/* ==============================================
   RESPONSIVE - Enhanced
   ============================================== */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 20px;
  }

  nav {
    flex-direction: column;
    padding: 15px;
  }

  nav a {
    width: 100%;
    text-align: center;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    white-space: nowrap;
    padding: 10px 8px;
  }

  .auth-container {
    margin: 20px 15px;
    padding: 25px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  form {
    padding: 20px;
  }

  .danger-zone {
    padding: 20px;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    padding: 0.5in;
  }

  nav, button, .btn, .danger-zone {
    display: none;
  }

  .container {
    box-shadow: none;
    padding: 0;
  }

  table {
    box-shadow: none;
  }
}

/* Logo placeholder */
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo::before {
  content: '🌿';
  font-size: 1.8rem;
}