/* ===== Global ===== */
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(180deg, #1b1b1b 0%, #ffffff 100%);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* ===== Container ===== */
.login-container {
  width: 480px;
  max-width: 96%;
  padding: 32px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(1, 85, 196, 0.08);
  text-align: center; /* hanya untuk logo & judul */
}

/* ===== Logo & Judul ===== */
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.logo img {
  height: 80px;
  width: 80px;
  object-fit: cover;
  border-radius: 8px;
  padding: 4px;
}

.logo h2 {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #0155c4; /* biru */
}

/* ===== Form ===== */
.login-container form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;  /* ✅ pastikan form isi center */
  gap: 12px;
}

input {
  width: 90%;           /* ✅ sejajar tengah */
  max-width: 400px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e6eefb;
  font-size: 14px;
  outline: none;
}

input:focus {
  border-color: #0155c4;
  box-shadow: 0 0 4px rgba(1, 85, 196, 0.2);
}

button {
  width: 90%;
  max-width: 400px;
  background: #0155c4;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 25px; /* lonjong modern */
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

button:hover {
  background: #013a86;
}

/* ===== Error ===== */
.error {
  color: #c53030;
  text-align: center;
  margin-bottom: 10px;
  font-size: 14px;
}

/* ===== Global ===== */
body {
  font-family: 'Poppins', sans-serif;
  background: #f6f9ff;
  margin: 0;
  padding: 20px;
}

.container {
 max-width: 1100px;
  margin: 650px auto 0; /* ⬅️ INI KUNCINYA */
}

/* =========================================================
   TOPBAR (FIXED)
========================================================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;

  background: #ffffff;
  padding: 15px 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);

  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand img {
  height: 60px;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #005BAC;
}

.brand-text p {
  font-size: 14px;
  margin: 2px 0 0;
}

/* ===== Tombol ===== */
.btn-card {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  font-weight: 600;
  color: #fff;
  transition: 0.3s;
  white-space: nowrap; /* anti patah */
}

/* warna */
.btn-card.tambah {
  background: #005BAC;
}

.btn-card.tambah:hover {
  background: #004080;
}

.btn-card.logout {
  background: #d9534f;
}

.btn-card.logout:hover {
  background: #b52b27;
}

.actions .btn-group {
  display: flex;
  gap: 8px;               /* spasi antar tombol */
  justify-content: flex-start; /* ke kiri */
  align-items: center;
  flex-wrap: wrap;        /* biar tidak kepotong di mobile */
}

.actions {
  display: flex;
  align-items: center;
}

.actions .btn-group {
  display: flex;
  gap: 8px;
}

/* tombol edit */
.btn-edit {
  padding: 8px 16px;
  border-radius: 6px;
  background: #0056b3;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
}

.btn-edit:hover {
  background: #004494;
}

/* tombol hapus */
.btn-hapus {
  padding: 8px 16px;
  border-radius: 6px;
  background: #d9534f;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
}

.btn-hapus:hover {
  background: #c9302c;
}

/* ===== Tabel ===== */
.table-list {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.table-list th {
  padding: 12px 15px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;   /* tetap tebal */
  background: #005BAC;
  color: #fff;
}

.table-list td {
  padding: 12px 15px;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  border-bottom: 1px solid #eee;
}

/* Hover hanya untuk isi tabel */
.table-list tbody tr:hover td {
  background: #f1f7ff;
}

/* ===== Aksi ===== */
.actions a {
  margin-right: 8px;
  text-decoration: none;
  font-weight: 600;
}

.actions a.edit {
  color: #005BAC;
}

.actions a.hapus {
  color: #d9534f;
}

/* Overlay popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center; /* horizontal center */
  align-items: center;     /* vertical center */
  z-index: 999;
  overflow-y: auto;        /* kalau terlalu tinggi tetap bisa scroll */
  padding: 20px;
  box-sizing: border-box;
}

/* Card di tengah */
.form-card {
  background: #ffffff;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  width: 95%;
  max-width: 1200px;

  max-height: 90vh;    /* supaya tidak melebihi layar */
  overflow-y: auto;    /* scroll internal */

  animation: popupFade 0.3s ease;
}

/* Animasi popup */
@keyframes popupFade {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ===== Form Card (Rata Tengah dengan ruang kanan-kiri) ===== */
.form-card {
  background: #ffffff;
  padding: 40px 50px;   /* ✅ atas-bawah 40px, kanan-kiri tetap longgar */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);

  width: 95%;
  max-width: 1200px;
  margin: 80px auto 60px; /* ✅ atas 80px, bawah 60px biar tidak nempel */
}

.form-card h2 {
  font-size: 24px;
  margin-bottom: 25px;
  font-weight: 700;
  color: #005BAC;
  text-align: center;
}

.form-card label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.form-card input[type="text"],
.form-card input[type="file"],
.form-card textarea,
.form-card select {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  transition: 0.2s;
  box-sizing: border-box; /* ✅ biar sejajar */
}

.form-card textarea {
  min-height: 200px;
  resize: vertical;
}

.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
  border-color: #005BAC;
  outline: none;
  box-shadow: 0 0 6px rgba(0,91,172,0.3);
}

/* Layout 2 Kolom */
.form-grid {
  display: grid;
  grid-template-columns: 1.7fr 1.3fr; /* kiri lebih lebar */
  gap: 50px;                          /* jarak antar kolom */
  margin-bottom: 25px;
}

.form-left, 
.form-right {
  display: flex;
  flex-direction: column;
}

/* Tombol di Tengah */
.form-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
}

.form-actions .btn-simpan,
.form-actions .btn-batal {
  display: inline-block;
  padding: 12px 40px;   /* ✅ sama tinggi & lebar */
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  min-width: 140px;
  transition: 0.2s;
  border: none;
  cursor: pointer;
}

.form-actions .btn-simpan {
  background: #0056b3;  /* Biru Muhammadiyah */
  color: #fff;
}

.form-actions .btn-simpan:hover {
  background: #004494;
}

.form-actions .btn-batal {
  background: #000000;  /* Merah */
  color: #fff;
  text-decoration: none;
}

.form-actions .btn-batal:hover {
  background: #000000;
}

/* Tombol hapus merah */
.btn-simpan[style*="background:#c0392b"] {
  background: #c0392b;
}
.btn-simpan[style*="background:#c0392b"]:hover {
  background: #e74c3c;
}

/* ====== CSS ====== */
.search-box {
  position: relative;       /* wajib untuk icon */
  width: 100%;
  max-width: 500px;         /* lebar search */
  margin: 20px auto;        /* ⬅️ CENTER */
}

.search-box i {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: #666;
  font-size: 16px;
}

.search-box input {
  width: 100%;
  padding: 10px 15px 10px 40px; /* kasih space buat icon */
  border: 1px solid #ddd;
  border-radius: 999px; /* bikin lonjong */
  outline: none;
  font-size: 15px;
  color: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.search-box input::placeholder {
  color: #999;
}

/* ================= RESPONSIF MOBILE ================= */

/* Tablet (<=768px) */
@media (max-width: 768px) {

  /* ===== Layout Global ===== */
  body {
    padding: 15px;
  }

  .container {
    padding: 0 10px;
  }

  /* ===== Topbar ===== */
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
  }

  .brand {
    flex-direction: row;
    gap: 10px;
  }

  .brand img {
    height: 45px;
  }

  .brand-text h1 {
    font-size: 17px;
  }

  .brand-text p {
    font-size: 13px;
  }

  /* Tombol di topbar */
  .btn-card {
    font-size: 13px;
    padding: 6px 12px;
  }

  /* ===== Tabel ===== */
  .table-list {
    display: block;
    overflow-x: auto;
    border-radius: 8px;
  }

  .table-list th,
  .table-list td {
    font-size: 13px;
    padding: 8px 10px;
  }

  /* ===== Form ===== */
  .form-grid {
    grid-template-columns: 1fr; /* jadi 1 kolom */
    gap: 18px;
  }

  .form-card {
    padding: 20px;
    margin: 20px auto;
  }

  .form-card h2 {
    font-size: 20px;
  }

  .form-card input,
  .form-card textarea,
  .form-card select {
    font-size: 14px;
    padding: 10px 12px;
  }

  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .form-actions .btn-simpan,
  .form-actions .btn-batal {
    width: 100%;
    border-radius: 8px;
    padding: 12px;
  }
}

/* HP Kecil (<=480px) */
@media (max-width: 480px) {

  /* Topbar brand */
  .brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .brand img {
    height: 40px;
  }

  .brand-text h1 {
    font-size: 15px;
  }

  .brand-text p {
    font-size: 12px;
  }

  /* Form lebih compact */
  .form-card {
    padding: 15px;
    margin: 15px auto;
  }

  .form-card h2 {
    font-size: 18px;
    margin-bottom: 15px;
  }

  .form-card input,
  .form-card textarea,
  .form-card select {
    font-size: 13px;
    padding: 8px 10px;
  }

  /* Tombol kecil */
  .btn-edit,
  .btn-hapus {
    padding: 6px 10px;
    font-size: 12px;
  }

  .table-list th,
  .table-list td {
    font-size: 12px;
    padding: 6px 8px;
  }

  .search-box input {
    font-size: 13px;
    padding: 7px 10px 7px 32px;
  }
}