/* style.css: Main stylesheet for SNGAD KPI application */

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

html {
  height: 100%;
  min-height: 100%;
}

:root {
  --primary-green: #2f855a;
  --secondary-green: #38a169;
  --light-green: #9ae6b4;
  --pale-green: #f0fff4;
  --border-green: #c6f6d5;
  --accent-green: #48bb78;
  --white: #ffffff;
  --light-gray: #f7fafc;
  --text-dark: #2d3748;
  --text-gray: #718096;
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --shadow-color: rgba(0, 0, 0, 0.2);
  --error-red: #e53e3e;
  --error-light-red: #fed7d7;
  --success-green: #38a169;
  --success-bg: #f0fff4;
  --dark-blue: #2b6cb0;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light-gray);
  min-height: 100vh;
  height: 100vh; /* Set explicit height */
  margin: 0;
  padding: 20px;
  box-sizing: border-box; /* Include padding in height calculation */
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Remove body padding for login page */
body:has(.login-container) {
  padding: 0;
}

.container {
  width: 100%;
  min-height: calc(100vh - 40px); /* 40px accounts for the body padding */
  margin: 0 auto;
  background: var(--white);
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(47, 133, 90, 0.15);
  overflow: hidden;
  border: 1px solid var(--border-green);
  display: flex;
  flex-direction: column;
}

.header {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
  color: var(--white);
  padding: 25px 30px;
  position: relative;
  overflow: hidden;
  margin-bottom: 0; /* Fix gap between header and content */
}

.header::before {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.header::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  position: relative;
  z-index: 1;
}

.header-title h1 {
  font-size: 2.2rem;
  margin-bottom: 5px;
  font-weight: 600;
}

.header-title p {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 300;
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.welcome-text {
  font-size: 0.95rem;
  opacity: 0.95;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.admin-links {
  margin-top: -15px;
  padding-bottom: 10px;
}

.admin-dashboard-btn,
.back-to-kpi-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-block;
}

.admin-dashboard-btn:hover,
.back-to-kpi-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Responsive design for dashboard */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

.view-data-link {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 10px;
  transition: all 0.3s;
  position: relative;
  z-index: 1;
}

.view-data-link:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

/* Second link with margin */
.view-data-link + .view-data-link {
  margin-left: 10px;
}

.form-container {
  padding: 40px;
  background: var(--white);
  flex: 1; /* Make the form grow to fill available space */
  display: flex;
  flex-direction: column;
}

.form-section {
  margin-bottom: 30px;
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(47, 133, 90, 0.05);
  flex: 1; /* Take up available space */
}

.section-title {
  font-size: 1.4rem;
  color: var(--primary-green);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light-green);
}

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

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-green);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: var(--white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary-green);
  background-color: var(--pale-green);
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.15);
}

textarea {
  height: 100px;
  resize: vertical;
}

.required {
  color: #e53e3e;
}

.submit-section {
  background: var(--pale-green);
  padding: 30px;
  margin: auto -40px -40px -40px; /* margin-top: auto pushes it to the bottom */
  border-top: 1px solid var(--border-green);
  text-align: center;
  width: calc(100% + 80px); /* To account for negative margins */
}

.submit-btn {
  background: var(--primary-green);
  color: white;
  padding: 15px 45px;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  box-shadow: 0 4px 10px rgba(47, 133, 90, 0.2);
  margin: 0 10px;
}

.submit-btn:hover {
  background: var(--secondary-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(47, 133, 90, 0.3);
}

.reset-btn {
  background: var(--white);
  color: var(--primary-green);
  padding: 15px 35px;
  border: 2px solid var(--primary-green);
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 10px;
}

.reset-btn:hover {
  background: rgba(47, 133, 90, 0.05);
  color: var(--secondary-green);
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.csv-btn {
  background: var(--white);
  color: var(--primary-green);
  padding: 12px 25px;
  border: 2px solid var(--primary-green);
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 15px;
  box-shadow: 0 2px 5px rgba(47, 133, 90, 0.1);
}

.csv-btn:hover {
  background: var(--pale-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(47, 133, 90, 0.2);
}

/* Department checkboxes styling */
.checkbox-container {
  border: 2px solid var(--border-green);
  border-radius: 8px;
  padding: 15px;
  background-color: var(--white);
}

.checkbox-container label {
  font-weight: normal;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--secondary-green);
}

/* Radio button styling */
.radio-option {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  font-weight: normal;
}

.radio-option input[type="radio"] {
  margin-right: 8px;
}

/* Department grid layout */
.department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

/* Hidden element styling */
.hidden {
  display: none;
}

/* File upload styling */
.file-upload-hint {
  color: #7f8c8d;
  margin-top: 5px;
  display: block;
}

.file-upload-padding {
  padding: 8px;
}

/* Additional styles for KPI entry form page */
.filter-section {
    background: var(--pale-green);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-green);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
}

.button {
    background: var(--primary-green);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.button:hover {
    background: var(--secondary-green);
}

.secondary-button {
    background: white;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.secondary-button:hover {
    background: var(--pale-green);
}

.kpi-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    table-layout: fixed;
}

.kpi-table th:nth-child(1), .kpi-table td:nth-child(1) {
    width: 40%;
}

.kpi-table th:nth-child(2), .kpi-table td:nth-child(2) {
    width: 15%;
}

.kpi-table th:nth-child(3), .kpi-table td:nth-child(3) {
    width: 20%;
}

.kpi-table th:nth-child(4), .kpi-table td:nth-child(4) {
    width: 25%;
}

.kpi-table th, .kpi-table td {
    padding: 8px 12px;
    border: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}

.kpi-table th {
    background-color: var(--pale-green);
    font-weight: 600;
    color: var(--primary-green);
}

.kpi-table tr:nth-child(even) {
    background-color: #fafafa;
}

.kpi-table tr:hover {
    background-color: var(--light-gray);
}

.evidence-file {
    padding: 6px;
    width: 100%;
    font-size: 0.85rem;
}

.file-error {
    color: #e53e3e;
    font-size: 0.75rem;
    margin-top: 5px;
    padding: 2px 4px;
    background-color: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 3px;
    display: none;
}

.remarks-field {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: none;
    height: 32px;
    overflow: hidden;
}

.kpi-value-input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.content {
    padding: 0 20px 20px 20px;
    flex: 1;
    background: var(--white);
    margin-top: 0;
}

.message {
    padding: 15px;
    margin: 15px 20px;
    border-radius: 8px;
    position: relative;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(0);
}

.success {
    background-color: #c6f6d5;
    border: 1px solid #38a169;
    color: #2f855a;
    box-shadow: 0 2px 4px rgba(56, 161, 105, 0.1);
}

.error {
    background-color: #fed7d7;
    border: 1px solid #e53e3e;
    color: #c53030;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.1);
}

.info {
    background-color: #bee3f8;
    border: 1px solid #3182ce;
    color: #2c5282;
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.1);
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.no-data {
    text-align: center;
    padding: 30px;
    color: var(--text-gray);
    font-style: italic;
}

/* Time period summary styles */
.time-period-summary {
  background-color: var(--pale-green);
  border: 1px solid var(--border-green);
  padding: 12px 15px;
  margin-bottom: 15px;
  border-radius: 5px;
}

.time-period-summary p {
  margin: 0;
  color: var(--primary-green);
  font-size: 15px;
}

/* Button group styles */
.button-group {
  display: flex;
  gap: 10px;
}

.action-button {
  background-color: var(--secondary-green);
}

.action-button:hover {
  background-color: var(--primary-green);
  opacity: 0.9;
}

/* Dashboard Tiles Section */
.dashboard-tiles {
  padding: 20px 40px 40px 40px;
  background: var(--white);
}

.tiles-section {
  margin-bottom: 40px;
}

.tiles-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.5rem;
  color: var(--primary-green);
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--light-green);
  font-weight: 600;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.tile {
  background: var(--white);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: white;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-green);
}

.tile-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 15px auto;
  display: block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.tile.annual-tile .tile-icon {
  background-image: url('images/annual-icon.svg');
}

.tile.biannual-tile .tile-icon {
  background-image: url('images/biannual-icon.svg');
}

.tile.quarterly-tile .tile-icon {
  background-image: url('images/quarterly-icon.svg');
}

.tile.monthly-tile .tile-icon {
  background-image: url('images/monthly-icon.svg');
}

.tile-content h3 {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: white;
}

.tile-content p {
  font-size: 1.1rem;
  margin: 0;
  color: white;
  font-weight: 500;
  opacity: 0.95;
}

/* Color variations for different tile types */
.tile.annual-tile {
  background: #a855f7;
  border-color: #a855f7;
  color: white;
}

.tile.annual-tile:hover {
  background: #7c3aed;
  border-color: #7c3aed;
}

.tile.biannual-tile {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
}

.tile.biannual-tile:hover {
  background: #d97706;
  border-color: #d97706;
}

.tile.quarterly-tile {
  background: #ec4899;
  border-color: #ec4899;
  color: white;
}

.tile.quarterly-tile:hover {
  background: #db2777;
  border-color: #db2777;
}

.tile.monthly-tile {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.tile.monthly-tile:hover {
  background: #059669;
  border-color: #059669;
}

/* Back to Dashboard Button */
.back-to-dashboard {
  margin-bottom: 20px;
  margin-top: 10px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-green);
  color: white;
  padding: 10px 20px 10px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: var(--secondary-green);
  transform: translateX(-2px);
}

/* Responsive design for tiles */
@media (max-width: 768px) {
  .tiles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .tile {
    padding: 20px;
  }
  
  .tile-icon {
    width: 36px;
    height: 36px;
  }
  
  .tile-content h3 {
    font-size: 1.8rem;
  }
  
  .tile-content p {
    font-size: 1rem;
  }
  
  .dashboard-tiles {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .tiles-grid {
    grid-template-columns: 1fr;
  }
  
  .tiles-section {
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-container {
    padding: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .submit-section {
    padding: 20px;
  }

  .submit-btn,
  .reset-btn {
    width: 100%;
    margin: 10px 0;
  }
}

@media (max-width: 480px) {
  .login-container {
    flex-direction: column;
    padding: 0;
  }
  
  .login-image-section {
    flex: none;
    height: 250px;
    padding: 20px;
  }
  
  .login-svg-container {
    max-width: 200px;
  }
  
  .login-form-section {
    flex: 1;
    padding: 20px;
  }
  
  .login-box {
    max-width: 100%;
    border-radius: 15px;
    box-shadow: none;
    border: none;
  }
  
  .login-form-container {
    padding: 25px 20px;
  }
  
  .login-header {
    padding: 30px 20px;
  }
  
  .login-header h1 {
    font-size: 1.6rem;
  }
  
  .login-header h2 {
    font-size: 1.1rem;
  }
  
  .login-header p {
    font-size: 0.9rem;
  }
  
  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 12px 15px 12px 40px;
  }
  
  .input-icon {
    left: 12px;
    font-size: 1rem;
  }
  
  .login-btn {
    padding: 14px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) and (min-width: 481px) {
  .login-container {
    flex-direction: column;
  }
  
  .login-image-section {
    flex: none;
    height: 300px;
    padding: 30px;
  }
  
  .login-svg-container {
    max-width: 300px;
  }
  
  .login-form-section {
    flex: 1;
    padding: 30px;
  }
}

/* Search and Filter Styles */
.search-filter-section {
    margin-bottom: 30px;
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-green);
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--pale-green);
    border: 2px solid var(--border-green);
    border-radius: 12px;
    padding: 0 15px;
    transition: all 0.3s ease;
    max-width: 500px;
    width: 100%;
}

.search-box:focus-within {
    border-color: var(--secondary-green);
    box-shadow: 0 0 0 4px rgba(56, 161, 105, 0.1);
    background: var(--white);
}

.search-box i.fa-search {
    color: var(--text-gray);
    margin-right: 12px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.search-box:focus-within i.fa-search {
    color: var(--secondary-green);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 16px;
    color: var(--text-dark);
    outline: none;
    font-weight: 500;
}

.search-box input::placeholder {
    color: var(--text-gray);
    font-weight: 400;
}

.search-clear {
    cursor: pointer;
    color: var(--text-gray);
    padding: 5px;
    margin-left: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.search-clear:hover {
    background: var(--border-green);
    color: var(--error-red);
}

.search-results-count {
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
    padding-left: 5px;
}

.no-search-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
    background: var(--light-gray);
    border-radius: 12px;
    margin-top: 20px;
}

.no-search-results i {
    font-size: 48px;
    color: var(--text-gray);
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-search-results p {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 500;
}

.btn-clear-search {
    background: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-search:hover {
    background: var(--secondary-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47, 133, 90, 0.3);
}

/* Animation for filtered items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure search data attributes don't affect styling */
.project-item[data-project-name],
.project-item[data-project-description], 
.project-item[data-project-category] {
    /* Reset any potential attribute-based styling interference */
    display: block !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-filter-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .search-box input {
        font-size: 14px;
        padding: 12px 0;
    }
    
    .no-search-results {
        padding: 40px 15px;
    }
    
    .no-search-results i {
        font-size: 36px;
    }
    
    .no-search-results p {
        font-size: 16px;
    }
}

.item-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    font-style: italic;
}

.item-footer {
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
    margin-top: auto;
}

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

.item-meta small {
    color: #9ca3af;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-meta i {
    font-size: 10px;
}

/* Clickable title styling */
.clickable-title {
    cursor: pointer;
    transition: color 0.2s ease;
}

.clickable-title:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

/* Enhanced Item Card Styles */

.item-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
    padding: 12px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.stat-item i {
    color: var(--primary-green);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.item-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-view-details {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-view-details:hover {
    background: linear-gradient(135deg, var(--secondary-green), var(--accent-green));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47, 133, 90, 0.3);
}

.btn-edit-assignments {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-edit-assignments:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Responsive styles for item cards and department chips */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* Ensure project cards maintain consistent styling regardless of data attributes */
.project-item.item-card {
    /* Ensure specificity for project items */
    display: block;
    /* Override any potential conflicts from data attributes */
    visibility: visible;
    opacity: 1;
}

@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .department-chips {
        gap: 6px;
    }
    
    .department-chip {
        font-size: 10px;
        padding: 5px 10px;
        border-radius: 14px;
    }
    
    .item-card {
        padding: 20px;
    }
    
    .item-header h3 {
        font-size: 1.1rem;
    }
    
    .item-category {
        font-size: 10px;
        padding: 5px 10px;
        border-radius: 14px;
    }
    
    /* Enhanced cards responsive styles */
    .item-stats {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .stat-item {
        justify-content: center;
    }
    
    .item-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-view-details,
    .btn-edit-assignments {
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Timeline Comments Section */
.comments-section {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 4px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.comments-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.comments-section:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 8px 25px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.comments-section h4 {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-section h4::before {
    content: '💬';
    font-size: 1rem;
}

/* Modern Comment Input Form */
.comment-form {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.comment-form:focus-within {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.comment-input-group textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    outline: none;
}

.comment-input-group textarea:focus {
    border-color: rgba(59, 130, 246, 0.6);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-input-group textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.btn-comment {
    padding: 12px 16px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-comment:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-comment:active {
    transform: translateY(0);
}

/* Timeline Comments List */
.comments-list {
    position: relative;
    padding-left: 40px;
    margin-top: 20px;
}

/* Timeline center line */
.comments-list::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e2e8f0, #cbd5e0, #e2e8f0);
    border-radius: 1px;
}

/* Timeline comment container */
.comment {
    position: relative;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 20px;
    backdrop-filter: blur(5px);
}

/* Timeline dot/icon */
.comment::before {
    content: '💬';
    position: absolute;
    left: -40px;
    top: 20px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    z-index: 2;
}

/* Timeline connector arrow */
.comment::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 25px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid rgba(255, 255, 255, 0.9);
    filter: drop-shadow(-1px 0 1px rgba(0, 0, 0, 0.1));
}

/* Hover effects */
.comment:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(8px) translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 3px 10px rgba(0, 0, 0, 0.05);
}

.comment:hover::before {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: scale(1.1);
}

/* Alternate positioning for visual variety */
.comment:nth-child(even) {
    margin-left: -20px;
    margin-right: 20px;
}

.comment:nth-child(even)::before {
    left: calc(100% + 16px);
    background: linear-gradient(135deg, #10b981, #047857);
}

.comment:nth-child(even)::after {
    left: calc(100% + 2px);
    border-left: 10px solid rgba(255, 255, 255, 0.9);
    border-right: none;
}

.comment:nth-child(even):hover::before {
    background: linear-gradient(135deg, #047857, #065f46);
}

/* Timeline Comment Header */
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

/* Department badge in timeline */
.comment-header strong {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    box-shadow: 
        0 2px 8px rgba(16, 185, 129, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.comment-header strong:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 
        0 4px 16px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.comment-header strong:hover::before {
    left: 100%;
}

/* Timeline comment date */
.comment-header small {
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(100, 116, 139, 0.1);
    transition: all 0.3s ease;
}

.comment-header small:hover {
    background: rgba(100, 116, 139, 0.15);
    transform: translateY(-1px);
}

.comment-header small i {
    font-size: 9px;
    opacity: 0.7;
}

/* Timeline comment text */
.comment-text {
    color: #374151;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 8px;
    padding: 0;
    position: relative;
    text-align: justify;
    word-wrap: break-word;
}

/* No comments state with timeline theme */
.no-comments {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 40px 20px;
    background: rgba(249, 250, 251, 0.6);
    border-radius: 15px;
    border: 2px dashed rgba(209, 213, 219, 0.6);
    font-size: 14px;
    margin-left: 20px;
    position: relative;
}

.no-comments::before {
    content: '📝';
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

/* Responsive timeline adjustments */
@media (max-width: 768px) {
    .comments-section {
        padding: 16px;
        margin-top: 20px;
    }
    
    .comment-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-comment {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile timeline adjustments */
    .comments-list {
        padding-left: 20px;
    }
    
    .comments-list::before {
        left: 10px;
    }
    
    .comment {
        margin-left: 10px;
        margin-right: 0;
        padding: 15px;
    }
    
    .comment::before {
        left: -25px;
        width: 20px;
        height: 20px;
        font-size: 8px;
    }
    
    .comment::after {
        left: -8px;
        border-right-width: 8px;
        border-top-width: 6px;
        border-bottom-width: 6px;
    }
    
    /* Remove alternating layout on mobile */
    .comment:nth-child(even) {
        margin-left: 10px;
        margin-right: 0;
    }
    
    .comment:nth-child(even)::before {
        left: -25px;
        background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    }
    
    .comment:nth-child(even)::after {
        left: -8px;
        border-left: none;
        border-right: 8px solid rgba(255, 255, 255, 0.9);
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .no-comments {
        margin-left: 10px;
        padding: 30px 15px;
    }
}