:root { --container-max: 960px; --grid-gap: 16px; --grid-cols: 2; }
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; margin: 0; background: #f6f7fb; color: #222; }
header { background: #2E7D32; color: #fff; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
header h1 { margin: 0; font-size: 20px; }
nav a { color: #fff; text-decoration: none; margin-left: 12px; }
main { max-width: var(--container-max); margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px; }
.alert { background: #ffe5e5; color: #7a0000; padding: 12px; border-radius: 6px; margin-bottom: 12px; }
form input[type=file] { display: inline-block; margin-right: 8px; }
button, .btn { background: #2E7D32; color: #fff; border: 0; padding: 10px 14px; border-radius: 6px; cursor: pointer; display: inline-block; text-decoration: none; font-size: 14px; }
button:hover, .btn:hover { background: #1B5E20; }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #5a6268; }
.btn-danger { background: #dc3545; }
.btn-danger:hover { background: #c82333; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; table-layout: fixed; }
th, td { border-bottom: 1px solid #eee; padding: 8px; text-align: left; font-size: 14px; }
thead th { background: #E8F5E9; cursor: pointer; user-select: none; }
thead th:hover { background: #C8E6C9; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background-color: #fafafa; }

/* Modal Styles */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.5); 
}

.modal-content {
  background-color: #fff;
  margin: 5% auto; 
  padding: 20px;
  border: 1px solid #888;
  width: 90%; 
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: var(--grid-gap);
}
.cols-1 { --grid-cols: 1; }
.cols-2 { --grid-cols: 2; }
.cols-3 { --grid-cols: 3; }
.dense { --grid-gap: 8px; }
.comfortable { --grid-gap: 16px; }
.spacious { --grid-gap: 24px; }
@media (max-width: 768px) { :root { --grid-cols: 1; } }

.modal-full-width {
  grid-column: span var(--grid-cols);
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 14px;
  color: #555;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group textarea {
  resize: vertical;
}
.container { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.field-group { margin-bottom: 8px; display: flex; }
.field-group label { font-weight: bold; width: 180px; flex-shrink: 0; color: #555; }
.field-group span { flex-grow: 1; }
.actions { margin-top: 24px; display: flex; gap: 12px; }
h2 { font-size: 18px; margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 8px; color: #2E7D32; }

/* Tabs */
.tabs {
  overflow: hidden;
  border-bottom: 1px solid #ccc;
  margin-bottom: 20px;
}
.tab-btn {
  background-color: inherit;
  float: left;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 10px 16px;
  transition: 0.3s;
  font-size: 14px;
  color: #555;
  border-radius: 6px 6px 0 0;
  margin-right: 4px;
}
.tab-btn:hover {
  background-color: #ddd;
}
.tab-btn.active {
  background-color: #fff;
  border: 1px solid #ccc;
  border-bottom: 1px solid #fff;
  color: #2E7D32;
  font-weight: 600;
  position: relative;
  top: 1px;
}
.tab-content {
  display: none;
  padding: 6px 0;
  animation: fadeEffect 1s;
}
.tab-content.active {
    display: block;
}

@keyframes fadeEffect {
  from {opacity: 0;}
  to {opacity: 1;}
}

/* Status Dots */
.status-dot { 
    display: inline-block; 
    width: 12px; 
    height: 12px; 
    border-radius: 50%; 
    margin-right: 4px; 
    vertical-align: middle;
}
.status-cell {
    white-space: nowrap;
}
.status-dot.green { background: #3cb371; }
.status-dot.red { background: #e74c3c; }

/* Context Menu */
.context-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 150px;
    padding: 4px 0;
}
.context-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
}
.context-menu li:hover {
    background-color: #E8F5E9;
    color: #2E7D32;
}
.context-menu li i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}
.context-menu hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 4px 0;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    border-radius: 4px;
    right: 0;
}

.dropdown-content a, .dropdown-content span {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    margin-left: 0;
    font-size: 14px;
    cursor: pointer;
}

.dropdown-content a:hover, .dropdown-content span:hover {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    color: #e6ffe6;
}

.dropbtn {
    cursor: pointer;
    color: #fff;
    margin-left: 12px;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #3cb371; /* Green matches status dots */
    border-radius: 4px 0 0 4px;
    transition: width 0.3s ease;
}

/* Action Buttons */
.btn-icon {
    text-decoration: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #333;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: #2E7D32;
}

.btn-icon.disabled {
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-icon.green-btn {
    color: #3cb371;
}
.btn-icon.green-btn:hover {
    color: #2e8b57;
}
