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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  background: #2c3e50;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  color: white;
  font-size: 20px;
  font-weight: 600;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 10px;
}

.nav-menu a {
  color: #bdc3c7;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: #34495e;
  color: white;
}

/* Language Toggle Button */
.lang-toggle {
  background: #3498db;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-toggle:hover {
  background: #2980b9;
}

/* Nav User */
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ecf0f1;
  font-size: 14px;
}

.nav-user .btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-user .btn:hover {
  background: #c0392b;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  color: #333;
  margin-bottom: 20px;
}

h2 {
  color: #444;
  margin-bottom: 15px;
  font-size: 18px;
}

/* Dashboard Cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h3 {
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
}

.card-value {
  font-size: 32px;
  font-weight: 600;
  color: #2c3e50;
}

.card-warning .card-value {
  color: #e74c3c;
}

/* Sections */
.section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.task-item.task-delayed {
  border-left-color: #e74c3c;
  background: #fdf2f2;
}

.task-info strong {
  display: block;
  margin-bottom: 4px;
}

.task-project {
  font-size: 12px;
  color: #666;
}

.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: #e8f4fd;
  color: #2980b9;
}

.badge-danger {
  background: #fde8e8;
  color: #c0392b;
}

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

.empty-message {
  color: #999;
  text-align: center;
  padding: 20px;
}

/* Forms */
.form-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

input, textarea, select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #3498db;
}

/* Buttons */
button {
  background: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

button:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #95a5a6;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.btn-success {
  background: #27ae60;
}

.btn-success:hover {
  background: #219a52;
}

.btn-danger {
  background: #e74c3c;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-group {
  display: flex;
  gap: 10px;
}

/* Two Column Layout */
.two-column {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .two-column {
    grid-template-columns: 1fr;
  }
}

/* List Items */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.list-item:hover {
  background: #e9ecef;
}

.list-item.active {
  background: #e8f4fd;
  border-left: 4px solid #3498db;
}

.list-item-info h4 {
  margin-bottom: 4px;
  font-size: 14px;
}

.list-item-info p {
  font-size: 12px;
  color: #666;
}

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

/* Template Tasks */
.template-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 8px;
}

.template-task .task-order {
  width: 30px;
  height: 30px;
  background: #3498db;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.template-task .task-content {
  flex: 1;
}

.template-task .task-content h4 {
  margin-bottom: 4px;
  font-size: 14px;
}

.template-task .task-content p {
  font-size: 12px;
  color: #666;
}

.template-task .task-duration {
  font-size: 12px;
  color: #999;
  padding: 4px 8px;
  background: #e9ecef;
  border-radius: 4px;
}

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: #999;
  padding: 5px;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

/* Modal Box inside overlay */
.modal-overlay > .modal,
.modal-overlay > .modal-box {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* Standalone Modal (used in users.html) */
.modal:not(.modal-overlay > .modal) {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal:not(.modal-overlay > .modal).active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
}

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

/* Progress bar */
.progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #27ae60;
  transition: width 0.3s;
}

/* Status badges */
.status-pending { color: #f39c12; }
.status-in_progress { color: #3498db; }
.status-completed { color: #27ae60; }
.status-skipped { color: #95a5a6; }

/* Form actions */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}
