/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #f4f6f9;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background: #2c3e50;
  color: #fff;
  padding: 1rem 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

.header h1 {
  font-size: 1.4rem;
}

/* Nav */
.nav a {
  color: #fff;
  margin-left: 1.2rem;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav a:hover {
  color: #f0c040;
}

.nav a.active {
  color: #f0c040;
  font-weight: bold;
  border-bottom: 2px solid #f0c040;
  padding-bottom: 2px;
}

.logout {
  background: #e74c3c;
  padding: 6px 12px;
  border-radius: 4px;
}

.logout:hover {
  background: #c0392b;
  color: #fff;
}

/* Summary Section (Dashboard Home) */
.summary {
  padding: 2rem 0;
  flex: 1;
}

.summary .container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

.summary h2 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: #2c3e50;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.3s ease;
}

.card h3 {
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
  color: #34495e;
}

.card p {
  font-size: 1.3rem;
  font-weight: bold;
  color: #2c3e50;
}

.card:hover {
  transform: translateY(-5px);
}

/* Profit / Loss Card */
.card.profit {
  background: #eafaf1;
  border-left: 5px solid #27ae60;
}

.card.profit p {
  color: #27ae60;
}

/* Content Section (Employees, Work Orders, etc.) */
.content {
  padding: 2rem 0;
}

.content h2 {
  margin-bottom: 1rem;
  color: #2c3e50;
  font-size: 1.6rem;
}

/* Employee Form */
.employee-form {
  background: #fff;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.employee-form h3 {
  margin-bottom: 1rem;
  color: #34495e;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.employee-form input,
.employee-form select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
}

/* Buttons */
.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  margin: 2px;
  transition: background 0.3s ease;
}

.add-btn {
  background: #27ae60;
  color: #fff;
  margin-bottom: 1rem;
}

.add-btn:hover {
  background: #219150;
}

.save-btn {
  background: #27ae60;
  color: #fff;
}

.save-btn:hover {
  background: #219150;
}

.edit-btn {
  background: #3498db;
  color: #fff;
}

.edit-btn:hover {
  background: #2c80b4;
}

.delete-btn {
  background: #e74c3c;
  color: #fff;
}

.delete-btn:hover {
  background: #c0392b;
}

/* Tables with Grid Lines */
.employee-table,
.workorder-table,
.task-table,
.dailywork-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.employee-table th, .employee-table td,
.workorder-table th, .workorder-table td,
.task-table th, .task-table td,
.dailywork-table th, .dailywork-table td {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid #ddd;  /* ✅ visible grid lines */
  color: #333;
}

.employee-table th,
.workorder-table th,
.task-table th,
.dailywork-table th {
  background: #2c3e50;
  color: #fff;
  font-weight: 600;
}

.employee-table tr:nth-child(even),
.workorder-table tr:nth-child(even),
.task-table tr:nth-child(even),
.dailywork-table tr:nth-child(even) {
  background: #f9f9f9;
}

.employee-table tr:hover,
.workorder-table tr:hover,
.task-table tr:hover,
.dailywork-table tr:hover {
  background: #f0f6ff;
}

/* Footer */
.footer {
  background: #2c3e50;
  color: #fff;
  text-align: center;
  padding: 1rem 0;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    text-align: center;
  }
  .nav {
    margin-top: 0.5rem;
  }
  .nav a {
    margin: 0.5rem;
    display: inline-block;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .employee-table,
  .workorder-table,
  .task-table,
  .dailywork-table {
    font-size: 14px;
  }
}

.btn.small-btn {
  padding: 2px 6px;
  margin-left: 5px;
  font-size: 12px;
  background: #28a745;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
}
.btn.small-btn:hover {
  background: #218838;
}

/* ------------------------------
   RESPONSIVE LAYOUT ENHANCEMENTS
   (NO existing code is removed)
--------------------------------*/

/* Make form grid responsive */
@media(max-width: 768px) {
  .form-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .employee-form {
    padding: 12px;
  }

  input, select {
    font-size: 16px;
  }

  .btn {
    width: 100%;
    margin-bottom: 8px;
  }
}

/* Tablet / Small Laptop Improvements */
@media(min-width: 769px) and (max-width: 1100px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

/* Table responsiveness */
.employee-table {
  width: 100%;
  border-collapse: collapse;
}

.employee-table th,
.employee-table td {
  padding: 8px;
  white-space: nowrap; /* Prevent text wrap */
}

/* Mobile table scroll */
.employee-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin-top: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* Buttons on mobile */
@media(max-width: 600px) {
  .add-btn {
    width: 100%;
  }

  .edit-btn, .delete-btn {
    width: 100%;
    margin-bottom: 6px;
  }
}

/* Center text on phones */
@media(max-width: 480px) {
  .header h1 {
    font-size: 20px;
    text-align: center;
  }

  .content h2 {
    font-size: 18px;
  }
}