:root {
  --bg: #0f172a10;
  --card: #ffffff;
  --accent1: #06b6d4;
  --accent2: #7c3aed;
  --muted: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --glass: rgba(255, 255, 255, 0.8);
}
* {
  box-sizing: border-box;
}
body {
  font-family: Poppins, Arial, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  margin: 0;
  color: #0f172a;
}
.wrap {
  max-width: 100%; /* allow full width */
  margin: 28px auto;
  padding: 20px;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}
h1 {
  font-size: 20px;
  margin: 0;
  line-height: 1.1; /* tighten vertical spacing */
  display: flex; /* keep baseline consistent */
  align-items: baseline;
}
.sub {
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.06);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #0f172a;
}
input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #c0c0c0;
  background: linear-gradient(180deg, #fff, #fbfdff);
  font-size: 14px;
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary {
  background: #fff;
  color: #000000;
  box-shadow: 0 8px 24px rgba(7, 89, 133, 0.12);
}
.btn-primary-pagination {
  background: #426ef1;
  color: #fff;
  box-shadow: 0 8px 24px rgba(7, 89, 133, 0.12);
}
.btn-primary-csv {
  background: #2fffff;
  color: #000000;
  border: 1px solid #000000;
  box-shadow: 0 8px 24px rgba(7, 89, 133, 0.12);
}
.btn-primary-excel {
  background: #64ff88;
  color: #000000;
  border: 1px solid #000000;
  box-shadow: 0 8px 24px rgba(7, 89, 133, 0.12);
}
.btn-primary-saverates {
  background: #a5ffb3;
  color: #004e11;
  border: 1px solid #0f6d00;
  box-shadow: 0 8px 24px rgba(7, 89, 133, 0.12);
}
.btn-primary-save {
  background: #a5ffb3;
  color: #004e11;
  border: 1px solid #0f6d00;
  box-shadow: 0 8px 24px rgba(7, 89, 133, 0.12);
}
.btn-ghost {
  background: transparent;
  border: 1px solid #9d9d9d;
  color: #334155;
}
.btn-ghost-delete {
  background: transparent;
  border: 1px solid #ff0000;
  color: #ff0000;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-small {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* table */
/* force table to respect min-widths */
#jobsTable {
  width: 100%;
  border-collapse: separate; /* allow spacing + min-widths */
  border-spacing: 8px 0; /* you can adjust if you want gaps */
  table-layout: auto; /* allow columns to expand naturally */
  font-size: 12px; /* increase font size a bit */
}

.table-wrap {
  overflow-x: visible; /* instead of visible */
  border: 1px solid #8d8d8d;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
th,
td {
  padding: 5px 20px;
  text-align: center;
}
thead th {
  background: rgb(97, 97, 240);
  color: white;
  font-weight: 600;
  border-radius: 10px;
}
tbody tr {
  background: linear-gradient(180deg, #ffffff, #f0f0f0);
}
.col-right {
  text-align: center;
}

/* admin panel */
.admin-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #0ea5a42a, #7c3aed10);
  display: none;
  transition: all 0.28s ease;
}
.admin-panel.open {
  display: block;
}
.status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 10px;
}
.status.default {
  background: #eef2ff;
  color: #334155;
  border: 1px solid #000000;
}
.status.edited {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #0f6d00;
}
.field-edited {
  background: linear-gradient(90deg, #ecfdf5, #f0fff7);
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f0f9ff, #f3fef8);
  font-weight: 700;
  color: #064e3b;
}

.no-record {
  background: #fff1f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
}

/* Admin Login Box */
.admin-login {
  max-width: 320px;
  margin: 50px auto;
  padding: 20px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.admin-login h3 {
  margin-bottom: 20px;
  font-size: 1.4rem;
  color: #0f172a;
}

.admin-login input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.admin-login input:focus {
  border-color: #06b6d4;
  outline: none;
}

.admin-login button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.admin-login button:hover {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

#loginError {
  margin-top: 10px;
  color: #ef4444;
  font-size: 0.9rem;
  display: none; /* hidden by default */
}

/* Loading Screen */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

/* Spinner */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3b82f6;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

/* Delete Confirmation Modal */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* dark background */
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  text-align: center;
  width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease;
}

.modal-actions {
  margin-top: 15px;
  display: flex;
  justify-content: space-around;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

#jobsTable th:nth-child(1) {
  min-width: 0px;
} /* Employee */
#jobsTable th:nth-child(2) {
  min-width: 0px;
} /* Position */
#jobsTable th:nth-child(3) {
  min-width: 110px;
} /* Project */
#jobsTable th:nth-child(4) {
  min-width: 150px;
} /* PO Number */
#jobsTable th:nth-child(5) {
  min-width: 150px;
} /* Outstation Rate */
#jobsTable th:nth-child(6) {
  min-width: 120px;
} /* Outstation Days */
#jobsTable th:nth-child(7) {
  min-width: 120px;
} /* OT Hours ODRD */
#jobsTable th:nth-child(8) {
  min-width: 120px;
} /* OT Hours RD */
#jobsTable th:nth-child(9) {
  min-width: 120px;
} /* OT Hours PH */
#jobsTable th:nth-child(10) {
  min-width: 120px;
} /* Other Cost */
#jobsTable th:nth-child(11) {
  min-width: 120px;
} /* Date */
#jobsTable th:nth-child(11) {
  min-width: 120px;
} /* Date */
