/* ================================
   Base & Reset
================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f9fafb;
  color: #111827;
  padding: 20px;
}

/* ================================
   Container
================================ */
.container {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
}

/* ================================
   Typography
================================ */
h2 {
  font-size: 22px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
}

/* ================================
   Top Bar
================================ */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}

.top-bar h2 {
  margin: 0;
  font-weight: 600;
}

.top-bar button {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.top-bar button:hover {
  background: #1e40af;
}

/* ================================
   Buttons
================================ */
.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

/* ================================
   Filters & Actions
================================ */
.actions-bar,
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #ffffff;
  flex: 1;
  font-size: 14px;
}

/* ================================
   Table
================================ */
.table-wrapper {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  overflow-x: auto;
  margin-top: 20px;
}

/* ================================
   Table Actions (Fix inline buttons)
================================ */
.table-wrapper td {
  vertical-align: middle;
}

/* Wrap actions supaya inline */
.table-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px; /* jarak antara butang */
}

/* Butang kecil untuk dalam table */
.table-actions .btn {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Icon spacing */
.table-actions .btn i {
  font-size: 13px;
}

/* Optional: hover color */
.table-actions .btn:hover {
  transform: scale(1.05);
}


table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: #2563eb;
  color: white;
}

th, td {
  text-align: center;
  padding: 12px 10px;
  border-bottom: 1px solid #f1f1f1;
}

tr:hover td {
  background: #f9fafb;
}

.no-data {
  text-align: center;
  padding: 20px;
  font-style: italic;
  color: #777;
}

/* ================================
   Status
================================ */
.status-active {
  background-color: #f59e0b;
  color: white;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.status-complete {
  background-color: #16a34a;
  color: white;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}

/* ================================
   Floating Action Button (Mobile)
================================ */
.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  transition: background 0.2s;
  z-index: 999;
}

.fab:hover {
  background: #1e40af;
}

/* ================================
   Modal (Optional)
================================ */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ================================
   Responsive
================================ */
@media (max-width: 768px) {
  h2 { font-size: 1.2rem; }
  .btn { font-size: 12px; padding: 6px 12px; }
  th, td { padding: 8px; font-size: 12px; }

  table {
    display: none;
  }

  .fab {
    display: flex;
  }
}

@media (min-width: 769px) {
  .fab {
    display: none;
  }
}


/* ================================
   Modal Form Inputs & Layout
================================ */
.modal-content input,
.modal-content select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  background-color: #f9fafb;
  transition: border-color 0.2s, background-color 0.2s;
}

.modal-content input:focus,
.modal-content select:focus {
  outline: none;
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.modal-content h3 {
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 18px;
  color: #111827;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* Button styling reuse */
.modal-actions .btn-primary {
  background-color: #2563eb;
  color: white;
}

.modal-actions .btn-primary:hover {
  background-color: #1d4ed8;
}

.modal-actions .btn-danger {
  background-color: #ef4444;
  color: white;
}

.modal-actions .btn-danger:hover {
  background-color: #dc2626;
}

/* Modal visual improvement */
.modal-content {
  animation: fadeIn 0.2s ease-out;
  border: 1px solid #e5e7eb;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom Action Buttons */
.btn-edit {
  background-color: #facc15;
  border-color: #f59e0b;
  color: #111827;
}
.btn-edit:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-view {
  background-color: #10b981; /* Emerald green */
  color: white;
}
.btn-view:hover {
  background-color: #059669;
}

.btn i {
  margin-right: 6px;
}

/* ================================
   Live Lock Page Enhancement
   Scoped under .live-lock-page
================================ */
.live-lock-page .info-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.live-lock-page label {
  display: inline-block;
  margin: 8px 0 4px;
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.live-lock-page input[type="text"],
.live-lock-page input[type="number"],
.live-lock-page textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  transition: all 0.2s ease;
  font-size: 14px;
}

.live-lock-page input:focus,
.live-lock-page textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Header buttons inline */
.live-lock-page .action-buttons {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

/* Lock list summary */
.live-lock-page .lock-summary {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  font-weight: 500;
  color: #111827;
}

.live-lock-page .lock-summary b {
  color: #2563eb;
}

/* Lock table enhancement */
.live-lock-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.live-lock-page th {
  background: #2563eb;
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  font-weight: 500;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.live-lock-page td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.live-lock-page tr:nth-child(even) td {
  background: #f9fafb;
}

.live-lock-page .no-data {
  text-align: center;
  padding: 18px;
  font-style: italic;
  color: #9ca3af;
}

/* Add lock input inline */
.live-lock-page .lock-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.live-lock-page .lock-inputs input {
  width: 130px;
}

/* Smooth highlight when new row added */
@keyframes highlightRow {
  from { background-color: #dbeafe; }
  to { background-color: white; }
}
.live-lock-page tr.fade-in td {
  animation: highlightRow 1s ease;
}

/* Back button small spacing */
.live-lock-page .btn-danger {
  margin-left: 6px;
}

@keyframes flashAnim {
  from { background-color: #bbf7d0; }
  to { background-color: #ffffff; }
}
.flash {
  animation: flashAnim 0.3s ease;
}
