/* ========== RESET DASAR ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Segoe UI', sans-serif;
  height: 100%;
  background-color: #f5f5f5;
  overflow: hidden;
}

/* ========== WRAPPER ========== */
.wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 230px;
  background-color: #2e7d32;
  color: white;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 30px;
}

.sidebar-logo img {
  width: 80px;
}

.sidebar nav ul {
  list-style: none;
}
.sidebar nav ul li {
  margin: 10px 0;
}
.sidebar nav ul li a {
  color: white;
  text-decoration: none;
  padding: 10px;
  display: block;
  border-radius: 5px;
  transition: background 0.2s;
}
.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
  background-color: #388e3c;
}

/* ========== SIDEBAR TOGGLE (MOBILE) ========== */
.sidebar-toggle {
  display: none;
  font-size: 28px;
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: #2e7d32;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1000;
}

#toggle-sidebar {
  display: none;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  margin-left: 230px;
  flex: 1;
  background-color: #e8f5e9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard {
  flex: 1;
  padding: 30px;
}

.dashboard h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #2e7d32;
}

/* ========== TABLE ========== */
table, .tabel-data {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  margin-top: 20px;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.tabel-data th, .tabel-data td {
  padding: 10px;
  border: 1px solid #ccc;
  text-align: left;
}

.tabel-data th {
  background-color: #d0efdb;
  color: #2e7d32;
}

/* ========== FORM ========== */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-container input,
.form-container select,
.form-container textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.form-container button {
  background-color: #2e7d32;
  color: white;
  font-weight: bold;
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
}

.form-container button:hover {
  background-color: #388e3c;
}

/* ========== TOMBOL AKSI ========== */
.btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 5px;
  text-decoration: none;
  color: white;
  background-color: #2e7d32;
  border: 1px solid transparent;
}
.btn:hover {
  background-color: #388e3c;
}

.btn-edit, .btn-hapus {
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  color: white;
}
.btn-edit {
  background-color: #0277bd;
}
.btn-edit:hover {
  background-color: #01579b;
}
.btn-hapus {
  background-color: #c62828;
}
.btn-hapus:hover {
  background-color: #b71c1c;
}

.btn-export {
  background-color: #00897b;
  color: white;
  padding: 6px 10px;
  border-radius: 5px;
  text-decoration: none;
}
.btn-export:hover {
  background-color: #00695c;
}

/* ========== FILTER FORM ========== */
.filter-form {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.filter-form label {
  font-weight: 500;
  color: #2e7d32;
}
.filter-form select,
.filter-form button,
.filter-form a.btn-export {
  padding: 6px 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 14px;
}

/* ========== STATS GRID ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}
.stat-box {
  background-color: #e0f2f1;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.stat-box strong {
  font-size: 20px;
}
.stat-box.green { background-color: #a5d6a7; }
.stat-box.teal { background-color: #80cbc4; }
.stat-box.blue { background-color: #90caf9; }
.stat-box.orange { background-color: #ffcc80; }
.stat-box.purple { background-color: #ce93d8; }
.stat-box.red { background-color: #ef9a9a; }
.stat-box.grey { background-color: #e0e0e0; }

/* ========== BADGES ========== */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
}
.badge-success {
  background-color: #c8e6c9;
  color: #256029;
}
.badge-warning {
  background-color: #fff9c4;
  color: #8a6d3b;
}
.badge-danger {
  background-color: #ffcdd2;
  color: #b71c1c;
}

/* ========== FOOTER ========== */
.footer {
  padding: 15px;
  text-align: center;
  font-size: 14px;
  background-color: #d0efdb;
  border-top: 1px solid #ccc;
}
.footer a {
  color: #00695c;
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

/* ========== LOGIN PAGE ========== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f0f4f3;
}
.login-container {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
  text-align: center;
  width: 350px;
}
.login-container img {
  width: 80px;
  margin-bottom: 10px;
}
.login-container h2 {
  margin-bottom: 20px;
  color: #006400;
}
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
}
button {
  background-color: #006400;
  color: white;
  padding: 10px;
  width: 100%;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}
button:hover {
  background-color: #228B22;
}

/* ========== MODAL POPUP RESPONSIVE ========== */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  background: #fff;
  width: 95%;
  max-width: 700px;
  padding: 25px 20px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  font-size: 15px;
  overflow-y: auto;
  max-height: 90vh;
}
.modal h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
  color: #2e7d32;
}
.modal form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.modal form input,
.modal form select,
.modal form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
}
.modal form .btn {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
}

/* Backdrop modal */
#modalBackdrop,
#inputBackdrop {
  display: none;
  position: fixed;
  z-index: 998;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0,0,0,0.5);
}

/* Animasi modal */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}
.fade-out {
  animation: fadeOut 0.3s ease-in;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translate(-50%, -50%); }
  to   { opacity: 0; transform: translate(-50%, -48%); }
}

/* ========== PASSWORD PLAIN + TOGGLE 👁️ ========== */
.plain-password {
  border: none;
  background: transparent;
  font-family: monospace;
  width: 120px;
}
.btn-eye {
  background-color: #2e7d32;
  border: none;
  color: white;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  margin-left: 4px;
}

/* ========== SEARCH INPUT ========== */
#searchInput {
  font-size: 14px;
  margin-bottom: 15px;
}

/* ========== RESPONSIVE STYLE (MOBILE / TABLET) ========== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    width: 220px;
    z-index: 999;
    transition: left 0.3s ease-in-out;
  }
  #toggle-sidebar:checked ~ .sidebar {
    left: 0;
  }

  .main-content {
    margin-left: 0;
    padding: 70px 15px 15px;
  }

  .sidebar-toggle {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
  }

  .form-container,
  .filter-form,
  .form-box,
  .modal {
    padding: 10px;
    font-size: 14px;
    width: 100%;
  }

  .tabel-data {
    font-size: 13px;
  }
  .tabel-data th,
  .tabel-data td {
    padding: 6px;
  }

  .btn, .btn-edit, .btn-hapus, .btn-export {
    font-size: 13px;
    padding: 6px 8px;
  }

  .modal form label,
  .modal form input,
  .modal form select,
  .modal form textarea {
    width: 100% !important;
  }

  .table-responsive {
    overflow-x: auto;
    width: 100%;
  }
}

/* ========== TOMBOL AKSI TABLE ========== */
.btn-action {
  display: inline-block;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
  margin: 0 3px;
}
.btn-action.edit {
  background-color: #ffee58;
  color: #5d4037;
}
.btn-action.delete {
  background-color: #ef9a9a;
  color: #b71c1c;
}
.btn-action.edit:hover {
  background-color: #fff176;
}
.btn-action.delete:hover {
  background-color: #e57373;
}

