/* --- Variabel Warna & Gaya Global --- */
:root {
  --primary-color: #3b82f6; /* Biru INSIDER */
  --bg-color: #f3f4f6;
  --card-bg-color: #ffffff;
  --text-color: #1f2937;
  --subtle-text-color: #6b7280;
  --border-color: #e5e7eb;
  --header-bg-color: #dbeafe;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --font-family: "Poppins", sans-serif;
}

body.dark-mode {
  --bg-color: #111827;
  --card-bg-color: #1f2937;
  --text-color: #f9fafb;
  --subtle-text-color: #9ca3af;
  --border-color: #374151;
  --header-bg-color: #1e3a8a;
  --shadow-color: rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/* --- Layout Utama & Header --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* --- Kontainer Tabel Responsif --- */
.table-container {
  width: 100%;
  overflow-x: auto; /* Ini adalah kunci untuk responsivitas tabel */
  background-color: var(--card-bg-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow-color);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  min-width: 900px; /* Lebar minimum agar tidak terlalu sempit */
  border-collapse: collapse;
}

th,
td {
  padding: 1rem 1.25rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color);
}

thead th {
  background-color: var(--header-bg-color);
  font-weight: 600;
  position: sticky; /* Membuat header tabel tetap terlihat saat scroll vertikal */
  top: 0;
  z-index: 1;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

body.dark-mode tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

td small {
  display: block;
  margin-top: 0.25rem;
  color: var(--subtle-text-color);
  font-size: 0.85rem;
}

td.istirahat {
  background-color: #f5f5f5;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  color: var(--subtle-text-color);
}

body.dark-mode td.istirahat {
  background-color: #2c3e50;
}

/* --- Footer --- */
.page-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--subtle-text-color);
}

/* --- Dark Mode Toggle Switch --- */
.controls {
  display: flex;
  align-items: center;
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}
.controls {
  gap: 1rem;
}

.back-button {
  background-color: var(--primary-color);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.2s, transform 0.2s;
}

.back-button:hover {
  background-color: #2563eb; /* Warna biru sedikit lebih gelap */
  transform: translateY(-2px);
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary-color);
}
input:checked + .slider:before {
  transform: translateX(22px);
}
