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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
}

.hidden {
  display: none !important;
}

/* Login Page */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-container h1 {
  margin-bottom: 30px;
  color: #333;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#login-form input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

#login-form button {
  padding: 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}

#login-form button:hover {
  background: #0056b3;
}

.hint {
  margin-top: 20px;
  color: #666;
  font-size: 12px;
}

/* Main App Layout */
#main-app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: #333;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar h2 {
  margin-bottom: 30px;
  text-align: center;
}

.sidebar ul {
  list-style: none;
  flex: 1;
}

.sidebar li {
  margin-bottom: 10px;
}

.sidebar a {
  display: block;
  padding: 12px 15px;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
  background: #555;
}

#logout-btn {
  padding: 10px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#logout-btn:hover {
  background: #c82333;
}

/* Content Area */
.content {
  flex: 1;
  padding: 30px;
}

.page-section h2 {
  margin-bottom: 20px;
  color: #333;
}

/* Tables */
table {
  width: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
}

tr:hover {
  background: #f8f9fa;
}

/* Buttons */
button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

button.primary {
  background: #007bff;
  color: white;
}

button.primary:hover {
  background: #0056b3;
}

button.secondary {
  background: #6c757d;
  color: white;
}

button.secondary:hover {
  background: #5a6268;
}

button.danger {
  background: #dc3545;
  color: white;
}

button.danger:hover {
  background: #c82333;
}

button.success {
  background: #28a745;
  color: white;
}

button.success:hover {
  background: #218838;
}

/* Task Status */
.task-status {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.task-status p {
  margin-bottom: 10px;
}

/* Filters */
.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.filters input,
.filters select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.filters input {
  flex: 1;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.close:hover {
  color: #333;
}

/* Form in Modal */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-form label {
  font-weight: 500;
  color: #555;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.modal-form textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-form .checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-form .checkbox-group input[type="checkbox"] {
  width: auto;
}

/* Output Card */
.output-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.output-card h3 {
  margin-bottom: 15px;
  color: #333;
}

.output-card .output-info {
  display: flex;
  gap: 30px;
  margin-bottom: 15px;
  color: #666;
  font-size: 14px;
}

.output-card .output-actions {
  display: flex;
  gap: 10px;
}

/* Source Results */
#source-results {
  margin-top: 20px;
}

.source-result {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.source-result.success {
  border-left: 4px solid #28a745;
}

.source-result.error {
  border-left: 4px solid #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
  #main-app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px;
  }

  .sidebar h2 {
    width: 100%;
    margin-bottom: 10px;
  }

  .sidebar ul {
    display: flex;
    flex: none;
  }

  .sidebar li {
    margin: 0 5px;
  }

  #logout-btn {
    margin-left: auto;
  }

  .filters {
    flex-direction: column;
  }
}
