body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  margin: 0;
  padding: 0;
  display: flex;
}

/* Navigation bar styles */
.nav-bar {
  width: 220px;
  background-color: #2c3e50;
  color: white;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  border: 0;
}

.nav-logo {
  padding: 20px;
  font-size: 1.5rem;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: background-color 0.2s;
}

.nav-item:hover,
.nav-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item-icon {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.nav-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-footer a:hover {
  color: white;
}

/* Main content styles */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 20px;
  width: calc(100% - 220px);
  overflow-y: auto;
}

.dashboard {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-title {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 2rem;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 300px;
  overflow: hidden;
}

.card h2 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.meter {
  height: 20px;
  background-color: #ecf0f1;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.meter-bar {
  height: 100%;
  background-color: #3498db;
  border-radius: 10px;
  transition: width 0.5s ease-in-out;
}

.meter-value {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 1rem;
}

/* Time series styles */
.time-series-container {
  margin-top: 10px;
  width: 100%;
  height: 80px;
  position: relative;
  flex-grow: 1;
  overflow: hidden;
  padding-right: 25px;
}

.time-series-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.processes-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.processes-section h2 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* Process actions styles */
.processes-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.action-button {
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.action-button i {
  margin-right: 5px;
}

.action-button:hover {
  background-color: #e9ecef;
}

.refresh-button i {
  color: #3498db;
}

.start-all-button i,
.start-button i {
  color: #27ae60;
}

.stop-all-button i,
.stop-button i {
  color: #e74c3c;
}

.restart-all-button i,
.restart-button i {
  color: #f39c12;
}

.logs-button i {
  color: #7f8c8d;
}

.process-actions {
  display: flex;
  gap: 5px;
}

.action-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.action-icon:hover {
  background-color: #f8f9fa;
}

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

.processes-table th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid #ecf0f1;
  color: #7f8c8d;
  font-weight: 600;
}

.processes-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #ecf0f1;
}

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

.status-online td:nth-child(2) {
  color: #27ae60;
  font-weight: 600;
}

.status-stopped td:nth-child(2) {
  color: #e74c3c;
  font-weight: 600;
}

.status-errored td:nth-child(2) {
  color: #e74c3c;
  font-weight: 600;
}

.status-stopping td:nth-child(2) {
  color: #f39c12;
  font-weight: 600;
}

.status-launching td:nth-child(2) {
  color: #3498db;
  font-weight: 600;
}

/* Chart styles */
.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  flex-grow: 1;
  height: 150px;
  overflow: hidden;
}

.chart-container canvas {
  max-width: 100%;
  max-height: 100%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 5px;
}

.legend-label {
  font-size: 0.9rem;
  color: #7f8c8d;
}

/* Status background colors for the pie chart */
.status-online-bg {
  background-color: #27ae60;
}

.status-stopped-bg {
  background-color: #e74c3c;
}

.status-errored-bg {
  background-color: #e74c3c;
}

.status-stopping-bg {
  background-color: #f39c12;
}

.status-launching-bg {
  background-color: #3498db;
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 4px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slide-in 0.3s ease-out forwards;
  max-width: 300px;
}

.notification.info {
  background-color: #3498db;
}

.notification.success {
  background-color: #27ae60;
}

.notification.error {
  background-color: #e74c3c;
}

.notification.fade-out {
  animation: fade-out 0.5s ease-out forwards;
}

@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .nav-bar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

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

  .processes-table {
    font-size: 0.9rem;
  }
}

/* Process detail page styles */
.process-detail-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.process-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.back-button {
  margin-right: auto;
}

.process-info-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-row {
  display: flex;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ecf0f1;
}

.info-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  width: 100px;
  color: #7f8c8d;
}

.info-value {
  flex: 1;
}

.info-value.status-online {
  color: #27ae60;
  font-weight: 600;
}

.info-value.status-stopped {
  color: #e74c3c;
  font-weight: 600;
}

.info-value.status-errored {
  color: #e74c3c;
  font-weight: 600;
}

.info-value.status-stopping {
  color: #f39c12;
  font-weight: 600;
}

.info-value.status-launching {
  color: #3498db;
  font-weight: 600;
}

/* Logs styles */
.logs-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 400px;
}

.logs-tabs {
  display: flex;
  background-color: #f8f9fa;
  border-bottom: 1px solid #ecf0f1;
}

.logs-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: #7f8c8d;
  transition: background-color 0.2s;
}

.logs-tab:hover {
  background-color: #ecf0f1;
}

.logs-tab.active {
  background-color: white;
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
}

.logs-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.log-panel {
  display: none;
  height: 100%;
  overflow: auto;
  padding: 10px;
  padding-top: 0;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  background-color: #2c3e50;
  color: #ecf0f1;
}

.log-panel.active {
  display: block;
}

.log-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#output-log-content {
  color: #ecf0f1;
}

#error-log-content {
  color: #e74c3c;
}

.process-name-link {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.process-name-link:hover {
  color: #3498db;
  text-decoration: underline;
}

.detail-button {
  color: #3498db;
}

/* Login page styles */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 20px;
}

.login-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 30px;
  width: 100%;
  max-width: 400px;
}

.login-title {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 25px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #555;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-group input {
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  padding: 10px 12px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #3498db;
  outline: none;
}

.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.login-button {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-button:hover {
  background-color: #2980b9;
}

.login-button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  opacity: 0.7;
}

.login-button i {
  margin-right: 8px;
}

/* Responsive adjustments for login page */
@media (max-width: 480px) {
  .login-card {
    padding: 20px;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .login-button {
    width: 100%;
  }
}

/* Logged in container styles */
.logged-in-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.user-info {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
}

.user-info p {
  margin: 8px 0;
  color: #333;
}

.logout-button {
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.logout-button:hover {
  background-color: #c0392b;
}

.logout-button i {
  margin-right: 8px;
}

.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  gap: 20px;
}

/* Responsive adjustments for login page */
@media (max-width: 480px) {
  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .logout-button {
    margin-left: 0;
    width: 100%;
  }
}

/* Users management styles */
.users-section {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-top: 20px;
}

.users-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.add-user-button {
  background-color: #27ae60;
}

.add-user-button:hover {
  background-color: #2ecc71;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.users-table th {
  background-color: #f8f9fa;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #ddd;
}

.users-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
}

.user-actions {
  gap: 10px;
}

.edit-user-button {
  color: #3498db;
}

.delete-user-button {
  color: #e74c3c;
}

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

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  width: 80%;
  max-width: 600px;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.close-modal:hover {
  color: #555;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 5px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-help {
  display: block;
  margin-top: 5px;
  color: #7f8c8d;
  font-size: 0.85em;
}

.submit-button {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.submit-button:hover {
  background-color: #2980b9;
}

.cancel-button {
  background-color: #95a5a6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.cancel-button:hover {
  background-color: #7f8c8d;
}

/* Responsive adjustments for users page */
@media (max-width: 768px) {
  .users-table {
    font-size: 14px;
  }

  .users-table th,
  .users-table td {
    padding: 8px 10px;
  }

  .modal-content {
    width: 95%;
    margin: 2% auto;
    padding: 20px;
    max-height: 90vh;
  }
}

/* Process permissions styles */
.process-permission-item {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  position: relative;
}

.process-permission-item .form-group {
  margin-bottom: 10px;
}

.process-permission-item .remove-process-permission {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}

.process-permission-item .remove-process-permission:hover {
  background-color: #c0392b;
}

#add-process-permission {
  background-color: #3498db;
  margin-bottom: 15px;
}

#add-process-permission:hover {
  background-color: #2980b9;
}

#process-permissions-container {
  margin-top: 10px;
}

/* Responsive adjustments for process permissions */
@media (max-width: 768px) {
  .process-permission-item {
    padding: 10px;
  }

  .process-permission-item .remove-process-permission {
    position: relative;
    top: auto;
    right: auto;
    margin-top: 10px;
    width: 100%;
  }
}

/* Styles for permission-based UI elements */
/* Ensure the back button is always visible and properly spaced */
.back-button {
  margin-right: auto;
}

/* Add a message when no permissions are available */
.logs-container[data-permission="false"]::before {
  content: "You don't have permission to view logs for this process.";
  display: block;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 5px;
  color: #6c757d;
  text-align: center;
  font-style: italic;
}