* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  min-height: 100vh;
  background-color: #f5f5f5;
}

/* -----------------------------------------
   SIDEBAR — Tidak blink + mobile drawer halus
------------------------------------------ */

.sidebar {
  width: 220px;
  background-color: #2c3e50;
  color: white;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;

  /* Anti blink */
  visibility: hidden;
}

.sidebar.ready {
  visibility: visible;
}

.sidebar a {
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  display: block;
  transition: background 0.3s;
}

/* -----------------------------------------------------
   SIDEBAR ACTIVE STATE
----------------------------------------------------- */
.sidebar a.active {
  background-color: #1abc9c;      /* warna highlight */
  font-weight: bold;
  position: relative;
}

.sidebar a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: #16a085;           /* warna aksen */
  border-radius: 0 4px 4px 0;
}

.sidebar h2 {
  text-align: center;
  margin-bottom: 20px;
}

.sidebar a:hover {
  background-color: #34495e;
}

.logout-btn {
  margin: 10px 20px;
  padding: 10px;
  border: none;
  background: #c0392b;
  color: white;
  cursor: pointer;
  border-radius: 5px;
}

/* -----------------------------------------
   HAMBURGER BUTTON (mobile)
------------------------------------------ */

.menu-btn {
  display: none;
  position: fixed;
  top: 15px;
  left: 10px;
  background-color: #2c3e50;
  color: white;
  padding: 10px 12px;
  border: none;
  border-radius: 5px;
  z-index: 999;
  cursor: pointer;
}

/* -----------------------------------------
   MAIN CONTENT — Fade in super smooth (SPA-feel)
------------------------------------------ */

.main {
  flex: 1;
  padding: 20px;

  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s ease-out, transform .25s ease-out;
}

.main.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* -----------------------------------------------------
   CARD
----------------------------------------------------- */
.card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

/* -----------------------------------------------------
   SEARCH INPUT
----------------------------------------------------- */
#searchInput {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color .2s;
}

#searchInput:focus {
  border-color: #3498db;
  outline: none;
}

/* -----------------------------------------------------
   TABLE STYLE
----------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

thead {
  background: #2c3e50;
  color: white;
}

thead th {
  padding: 12px 10px;
  text-align: left;
}

tbody tr {
  background: white;
  border-bottom: 1px solid #eee;
  transition: background .15s;
}

tbody tr:hover {
  background: #f9f9f9;
}

tbody td {
  padding: 10px;
}

/* Responsive Table */
@media (max-width: 768px) {
  table, thead, tbody, tr, th, td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 10px;
    background: white;
    padding: 10px;
    border-radius: 6px;
  }

  td {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
  }

  td:last-child {
    border-bottom: none;
  }

  td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #333;
  }
}

/* -----------------------------------------------------
   PAGINATION
----------------------------------------------------- */
.pagination {
  margin-top: 15px;
  display: flex;
  gap: 8px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: rgb(148, 146, 146);
  border-radius: 5px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.pagination button:hover {
  background: #eee;
}

.pagination .active {
  background: #3498db;
  border-color: #2980b9;
  color: white;
}

/* -----------------------------------------------------
   FORM INPUT (global)
----------------------------------------------------- */
input[type=text],
input[type=email],
input[type=number],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
  transition: border-color .2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #3498db;
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* -----------------------------------------------------
   BUTTON
----------------------------------------------------- */
button,
.btn {
  padding: 10px 15px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s;
  font-size: 14px;
}

button:hover,
.btn:hover {
  background: #2980b9;
}

/* -----------------------------------------
    MOBILE MODE
------------------------------------------ */
@media (max-width: 768px) {

  body {
    flex-direction: column;
  }

  .menu-btn {
    display: block;
  }

  .sidebar {
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;

    /* Tidak ada transition saat load => anti blink */
    transform: translateX(-100%);
    transition: transform .3s ease;

    z-index: 998;
  }

  .sidebar.show {
    transform: translateX(0);
    transition: transform .3s ease;
  }

  .main {
    margin-top: 60px;
  }
}

/* -----------------------------------------------------
   BREADCRUMB
----------------------------------------------------- */
.breadcrumb {
  font-size: 14px;
  margin-bottom: 15px;
  color: #555;
}

.breadcrumb a {
  color: #3498db;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 5px;
  color: #888;
}

@media (max-width: 768px) {
  .breadcrumb {
    font-size: 13px;
  }
}

/* -----------------------------------------------------
   FORM LABEL
----------------------------------------------------- */
label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
  margin-top: 12px;
  color: #333;
  font-size: 14px;
}
