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

:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #2c3e50;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --light-gray: #ecf0f1;
  --dark-gray: #7f8c8d;
  --white: #ffffff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-gray);
  color: var(--secondary-color);
  line-height: 1.6;
}

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

/* Header */
.header {
  background: var(--secondary-color);
  color: var(--white);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

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

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav .user-info {
  font-size: 0.9rem;
}

.header-nav button {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.header-nav button:hover {
  background: var(--primary-dark);
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.auth-box {
  background: var(--white);
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

.auth-box h1 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--secondary-color);
}

.auth-box .logo {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 10px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--secondary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--light-gray);
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success-color);
  color: var(--white);
}

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

.btn-danger {
  background: var(--danger-color);
  color: var(--white);
}

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

.btn-secondary {
  background: var(--dark-gray);
  color: var(--white);
}

.btn-secondary:hover {
  background: #6c7a7d;
}

.btn-block {
  width: 100%;
}

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

/* Cards */
.card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--light-gray);
}

.card-header h2 {
  font-size: 1.25rem;
}

/* Project Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
  margin-bottom: 10px;
  color: var(--secondary-color);
}

.project-card p {
  color: var(--dark-gray);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--dark-gray);
  margin-bottom: 15px;
}

/* Progress Bar */
.progress-bar {
  background: var(--light-gray);
  border-radius: 10px;
  height: 20px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
  border-radius: 10px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 40px;
}

/* Tasks Table */
.tasks-table {
  width: 100%;
  border-collapse: collapse;
}

.tasks-table th,
.tasks-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--light-gray);
}

.tasks-table th {
  background: var(--light-gray);
  font-weight: 600;
  color: var(--secondary-color);
}

.tasks-table tr:hover {
  background: #f8f9fa;
}

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

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: var(--primary-color);
  color: var(--white);
}

.badge-success {
  background: var(--success-color);
  color: var(--white);
}

.badge-warning {
  background: var(--warning-color);
  color: var(--white);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark-gray);
}

.modal-close:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid var(--light-gray);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Alerts */
.alert {
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.alert-error {
  background: #fce4e4;
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

.alert-success {
  background: #e4fce4;
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

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

.stat-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-card .stat-label {
  color: var(--dark-gray);
  font-size: 0.9rem;
}

/* Time entries list */
.time-entries-list {
  max-height: 300px;
  overflow-y: auto;
}

.time-entry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--light-gray);
}

.time-entry-item:last-child {
  border-bottom: none;
}

.time-entry-info {
  flex: 1;
}

.time-entry-hours {
  font-weight: 600;
  color: var(--primary-color);
  margin-right: 15px;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 10px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .tasks-table {
    display: block;
    overflow-x: auto;
  }

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

/* Links */
.auth-link {
  text-align: center;
  margin-top: 20px;
}

.auth-link a {
  color: var(--primary-color);
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* Assignees */
.assignees-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.assignee-badge {
  background: var(--light-gray);
  color: var(--secondary-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

/* Multi-select */
.multi-select {
  min-height: 100px;
}
