/* === Reset === */
* { box-sizing: border-box; }
body {
  font-family: Arial, sans-serif;
  background: #eef1f5;
  margin: 0; padding: 0;
  font-size: 14px; line-height: 1.5;
  color: #333;
}

/* === Navbar === */
header {
  background: #2c3e50;
  color: #fff;
  padding: 10px 15px;
}
header h1 {
  margin: 0; font-size: 18px;
  display: inline-block;
}
.nav {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex; flex-wrap: wrap;
}
.nav li { margin-right: 6px; }
.nav a {
  color: #fff;
  background: #34495e;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s;
}
.nav a:hover { background: #1abc9c; }

/* === Wrapper / Content === */
.wrapper { padding: 20px; }
.content h2 { margin-top: 0; font-size: 20px; }

/* === Card === */
.card {
  background: #fff;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Dashboard cards layout */
.cards {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.cards .card {
  flex: 1;
  text-align: center;
  padding: 20px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cards .card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #555;
}

.cards .card p {
  font-size: 22px;
  font-weight: bold;
  color: #1abc9c;
}


/* === Table === */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.table th, .table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: middle;
}
.table th {
  background: #f8f9fa;
  font-weight: bold;
}
.table tr:hover { background: #f1f1f1; }

/* Responsive table */
.table-responsive { width: 100%; overflow-x: auto; }
.table-responsive table { min-width: 600px; }

/* === Badge === */
.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7rem;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
}
.badge.admin    { background: #007bff; color:#fff; }
.badge.reseller { background: #28a745; color:#fff; }
.badge.agency   { background: #17a2b8; color:#fff; }
.badge.user     { background: #6c757d; color:#fff; }
.badge-warning  { background: #ffc107; color:#333; }

/* === Form === */
form {
  background: #fff;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 15px 0;
}
.form-group { margin-bottom: 15px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.form-group textarea { resize: vertical; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

form button {
  background: #1abc9c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}
form button:hover { background: #16a085; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 6px 12px;
  background: #1abc9c;
  color: #fff; border-radius: 4px;
  font-size: 13px; text-decoration: none;
}
.btn:hover { background: #16a085; }

.btn-sm {
  padding: 4px 8px;
  background: #3498db;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  margin-right: 4px;
}
.btn-sm:hover { background: #2980b9; }
.btn-sm.danger { background: #e74c3c; }
.btn-sm.danger:hover { background: #c0392b; }

.btn.danger { background: #e74c3c; }
.btn.danger:hover { background: #c0392b; }
.btn.warning { background: #f39c12; }
.btn.warning:hover { background: #d68910; }

/* === Login Box === */
.login-box {
  max-width: 350px;
  margin: 60px auto;
  padding: 20px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.login-box h2 { text-align: center; margin-top: 0; }
.login-box input {
  width: 100%; padding: 10px; margin: 8px 0;
  border: 1px solid #bbb; border-radius: 4px;
}
.login-box button {
  width: 100%; padding: 10px;
  background: #1abc9c; border: none;
  color: #fff; cursor: pointer;
}
.login-box button:hover { background: #16a085; }

/* === Messages === */
.error {
  background: #f8d7da; color: #721c24;
  padding: 8px; margin: 10px 0;
  border: 1px solid #f5c6cb; border-radius: 4px;
}
.success {
  background: #d4edda; color: #155724;
  padding: 8px; margin: 10px 0;
  border: 1px solid #c3e6cb; border-radius: 4px;
}

/* === Modal Custom === */
.modal-content-custom.large {
  width: 80% !important;
  max-width: 900px !important;
  height: auto;
}
.modal-body-scroll {
  max-height: 70vh;
  overflow-y: auto;
}
.modal-custom {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
}
.modal-content-custom {
  background: #fff;
  margin: 8% auto;
  padding: 20px;
  border-radius: 8px;
  width: 450px; max-width: 95%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.modal-header-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.modal-header-custom h5 { margin: 0; }
.modal-close {
  cursor: pointer; font-weight: bold;
  font-size: 18px; color: #888;
}
.modal-close:hover { color: #000; }

/* === Search Bar === */
/* Tambah ikon search di input */
.search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
}

.search-bar .search-input {
  position: relative;
  flex: 1;
}

.search-bar .search-input input[type="text"] {
  width: 100%;
  padding: 8px 12px 8px 32px; /* extra padding kiri buat ikon */
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  transition: border 0.2s, box-shadow 0.2s;
}

.search-bar .search-input input[type="text"]:focus {
  outline: none;
  border-color: #1abc9c;
  box-shadow: 0 0 5px rgba(26, 188, 156, 0.3);
}

.search-bar .search-input::before {
  content: "🔍";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #888;
}

.search-bar .btn {
  padding: 8px 14px;
  font-size: 14px;
}

/* Style dropdown filter */
.search-bar select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  color: #333;
  transition: border 0.2s, box-shadow 0.2s;
}

.search-bar select:focus {
  outline: none;
  border-color: #1abc9c;
  box-shadow: 0 0 5px rgba(26, 188, 156, 0.3);
}

.search-bar select + select {
  margin-left: 6px; /* kasih jarak antar dropdown */
}

/* Documentation Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
  gap: 20px;
  margin-top: 20px;
}
.doc-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
}
.doc-card .doc-category {
  font-size: 18px;
  margin-bottom: 10px;
  color: #2c3e50;
}
.doc-item h4 {
  font-size: 15px;
  margin: 5px 0;
  color: #16a085;
}
.doc-item .doc-content {
  font-size: 13px;
  color: #555;
}
.doc-item hr {
  border: none;
  border-bottom: 1px solid #eee;
  margin: 10px 0;
}
.doc-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.doc-box {
  flex: 1 1 calc(33.333% - 20px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 15px;
  min-width: 280px;
}
.doc-category {
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: bold;
  color: #2c3e50;
}


/* === Footer === */
footer {
  background: #f8f9fa;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 20px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav { flex-direction: column; align-items: center; }
  .nav li { margin: 4px 0; }
  .card { padding: 10px; }
  .form-grid .col { flex: 1 1 100%; }
  .table-responsive table { min-width: 100%; }
}

/* === Fix hidden fields === */
input[type="hidden"] {
  display: none !important;
}

/* License Key Box */
.license-box {
  background: #f8f9fa;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  white-space: pre-wrap;   /* biar wrap ke bawah */
  word-break: break-all;   /* pecah kata panjang */
  max-height: 200px;       /* kasih batas tinggi */
  overflow-y: auto;        /* scroll kalau kepanjangan */
  font-family: monospace;
  font-size: 13px;
}
.accordion-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.accordion-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 12px;
}

.accordion-title {
  font-weight: bold;
  cursor: pointer;
  margin: 0;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  transition: background 0.2s;
}

.accordion-title:hover {
  background: #e2e6ea;
}

.accordion-content {
  display: none;
  margin-top: 10px;
}

.accordion-content.active {
  display: block;
}

.doc-content {
  font-size: 14px;
  color: #444;
  margin-bottom: 10px;
}
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
}
/* --- Modal fix for long forms (modules list) --- */
.modal-custom {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  overflow-y: auto !important;   /* biar modal keseluruhan bisa di-scroll */
  padding: 40px 0;
}

.modal-content-custom {
  background: #fff;
  margin: auto;
  max-width: 600px;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  max-height: 90vh;              /* biar gak keluar layar */
  overflow-y: auto;              /* biar isi form scroll */
  display: flex;
  flex-direction: column;
}

.modal-header-custom {
  position: sticky;
  top: 0;
  background: #fff;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  z-index: 10;
}

.modal-close {
  cursor: pointer;
  float: right;
  font-size: 22px;
  margin-top: -5px;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  margin-top: 5px;
}


