/* RESET & DASAR */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  margin: 0; padding: 0;
  color: #111;
}

/* CONTAINER UTAMA */
.container {
  max-width: 800px;
  width: auto;
  margin: 50px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* JUDUL */
h1 { text-align: center; color: #333; margin-bottom: 30px; }
h2 { color: #222; margin: 0 0 12px 0; }
h3 { margin: 0 0 10px 0; }

/* KOTAK PENCARIAN */
.search-box { text-align: center; margin-bottom: 30px; width: 100%; }
.search-box form {
  display: flex; flex-direction: row; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%;
}
.search-box input {
  padding: 10px 15px; border: 1px solid #ddd; border-radius: 4px; width: 60%; font-size: 16px;
}
.search-box button {
  padding: 10px 20px; background-color: #0078d7; border: none; color: #fff;
  border-radius: 4px; cursor: pointer; font-size: 16px; margin-left: 10px;
}
.search-box button:hover { background-color: #0056b3; }

/* PESAN STATUS */
.message { padding: 10px 15px; margin: 20px 0; border-radius: 4px; text-align: center; }
.error   { background-color: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }
.success { background-color: #d4edda; border: 1px solid #c3e6cb; color: #155724; }

/* HASIL */
.result-box {
  margin-top: 30px; border: 1px solid #ddd; border-radius: 4px; padding: 20px; position: relative;
}
.result-header {
  display: flex; flex-direction: column; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px;
}
.result-box h2 { color: #333; font-size: 20px; margin-top: 0; margin-bottom: 10px; word-break: break-word; }

/* BADGE STATUS */
.status-badge {
  display: inline-block; padding: 8px 15px; border-radius: 20px; font-weight: bold; font-size: 14px;
  margin-bottom: 10px; align-self: flex-start;
}
.status-badge.not-activated { background-color: #e2e3e5; color: #383d41; }
.status-badge.active        { background-color: #d4edda; color: #155724; }
.status-badge.inactive      { background-color: #fff3cd; color: #856404; }
.status-badge.expired       { background-color: #f8d7da; color: #721c24; }

/* TABEL */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
table th, table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; }
table th { width: 30%; font-weight: bold; color: #555; }

/* CATATAN */
.note { background-color: #f8f9fa; padding: 15px; border-radius: 4px; margin-top: 20px; border-left: 4px solid #6c757d; }
.note.success { background-color: #d4edda; border-left: 4px solid #28a745; }
.note.info    { background-color: #e2f0fd; border-left: 4px solid #17a2b8; }
.note p { margin: 0; color: #333; }
.note strong { font-weight: bold; }

/* Tanggal kadaluarsa */
.expired-date { color: #dc3545; font-weight: bold; }

/* DEBUG header */
.debug-header { background-color: #f8f9fa; text-align: center; font-weight: bold; color: #6c757d; }

/* ROW TOTAL */
.total-row { background-color: #f8f9fa; }
.total-row th, .total-row td { font-weight: bold; border-top: 2px solid #dee2e6; }

/* TOTAL DATA */
.data-usage-row { background-color: #e8f4f8; }
.data-usage-row td strong { color: #0078d7; }

/* LOADING */
#loading { display: none; justify-content: center; align-items: center; text-align: center; margin: 20px 0; gap: 12px; }
#loading.active { display: flex; }
.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid #0078d7; border-top: 3px solid transparent; border-radius: 50%;
  animation: spin 1s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 16px; color: #333; vertical-align: middle; }

/* FOOTER */
footer {
  background-color: #f5f5f5; border-top: 1px solid #ddd; padding: 20px 0; font-size: 14px; color: #666;
  text-align: center; margin-top: 50px;
}
footer .footer-content {
  max-width: 800px; margin: 0 auto; padding: 0 20px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
}
footer .footer-content div, footer .footer-content a { margin: 5px 10px; color: #0078d7; text-decoration: none; }
footer .footer-content a:hover { text-decoration: underline; }

/* MODAL */
.modal {
  display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
}
.modal-content {
  background-color: #fff; margin: 10% auto; padding: 20px; border-radius: 8px; max-width: 500px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2); position: relative;
}
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 24px; font-weight: bold; color: #aaa; cursor: pointer; }
.close-modal:hover { color: #333; }
#helpModal .modal-content { text-align: left; }
#helpModal .modal-content h3 { text-align: center; }
#helpModal .modal-content ol { margin-left: 0; }
#helpModal .modal-content p { text-align: center; margin-top: 10px; }

/* RESPONSIVE */
@media (min-width: 768px) {
  .result-header { flex-direction: row; justify-content: space-between; align-items: center; }
  .result-box h2 { margin-bottom: 0; flex: 1; }
  .status-badge { margin-bottom: 0; margin-left: 10px; }
}
@media (max-width: 767px) {
  .container { margin: 20px 10px; padding: 15px; width: auto; }
  .search-box form { flex-direction: column; width: 100%; }
  .search-box input { width: 100%; margin-bottom: 10px; margin-right: 0; }
  .search-box button { width: 100%; margin-left: 0; }
  table th { width: 40%; }
  footer .footer-content { flex-direction: column; text-align: center; }
  footer .footer-content div, footer .footer-content a { margin: 8px 0; }
  .modal-content { margin: 20% auto; width: 90%; }
}
@media (max-width: 480px) {
  .container { margin: 10px; padding: 10px; }
  h1 { font-size: 20px; margin-bottom: 20px; }
  .result-box { padding: 15px; }
  .result-box h2 { font-size: 16px; }
  .status-badge { font-size: 12px; padding: 5px 10px; }
  .search-box input, .search-box button { padding: 8px 10px; font-size: 14px; }
  table th, table td { padding: 8px 10px; font-size: 14px; }
  .note { padding: 10px; }
}

/* ============ TAMBAHAN AGAR SELARAS DENGAN SETUP & ADMIN PANEL ============ */

/* Kartu/section generik (dipakai setup.php dan status.php) */
.card {
  background:#fff; border-radius:12px; box-shadow:0 6px 20px rgba(0,0,0,.08); padding:18px; margin-bottom:16px;
}

/* Grid dan kolom sederhana (setup form) */
.row { display:flex; flex-wrap:wrap; gap:16px; }
.col { flex:1 1 240px; }

label { display:block; margin-bottom:6px; font-weight:600; color:#333; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width:100%; padding:10px; border:1px solid #e5e7eb; border-radius:8px; font-size:14px; background:#fff;
}
textarea { min-height:90px; resize:vertical; }

/* Tombol generik */
.btn { display:inline-block; padding:10px 16px; border-radius:8px; border:0; background:#0d6efd; color:#fff; cursor:pointer; text-decoration:none; }
.btn.secondary { background:#6c757d; }
.btn.red { background:#dc3545; }
.btn.gray { background:#6c757d; }

/* Badge kecil (link/slug/lock) */
.link-badge, .slug-badge {
  display:inline-block; border:1px solid #e5e7eb; border-radius:999px; padding:3px 8px; color:#374151; font-size:12px; margin-left:8px;
}
.lock-badge {
  display:inline-block; margin-left:8px; padding:2px 8px; border-radius:999px; background:#eef2ff; color:#1e40af; font-weight:600; font-size:12px;
}

/* Notice lisensi bawah (index/footer) */
.notice { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.notice.trial   { background:#EFF6FF; border:1px solid #93C5FD; color:#1E3A8A; }
.notice.expired { background:#FEF2F2; border:1px solid #FCA5A5; color:#991B1B; }
.btn-wa { display:inline-block; background:#0d6efd; color:#fff; padding:6px 10px; border-radius:8px; text-decoration:none; margin-left:8px; }

/* Admin table helper */
.badge { display:inline-block; border:1px solid #e5e7eb; border-radius:999px; padding:2px 8px; font-size:12px; }
.muted { color:#6b7280; }

/* Router info panel (index) */
.router-info {
  margin-top:14px; padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; background:#f9fafb; color:#374151; font-size:14px;
}
.router-info b { color:#111827; }
.router-info .kv { display:inline-block; margin-right:16px; }
