* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f2f4f7;
  color: #1a1a1a;
  margin: 0;
  padding: 0 0 40px;
}
header {
  background: #075e54;
  color: white;
  padding: 20px 24px;
}
header h1 { margin: 0; font-size: 1.4rem; }
.subtitle { margin: 4px 0 0; opacity: 0.85; }
main {
  max-width: 720px;
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: white;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card h2 { margin-top: 0; font-size: 1.1rem; }
.hidden { display: none; }
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
}
input, select, textarea, button {
  font-size: 0.95rem;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
textarea { width: 100%; resize: vertical; }
button {
  background: #075e54;
  color: white;
  border: none;
  cursor: pointer;
}
button:hover { background: #064840; }
.muted { color: #666; font-size: 0.9rem; }
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.dot-connected { background: #2ecc71; }
.dot-disconnected { background: #e74c3c; }
.dot-qr_pending { background: #f39c12; }
.dot-unknown { background: #999; }
#qr-image {
  max-width: 300px;
  display: block;
  margin: 12px auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.85rem;
}
th, td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
th { color: #555; }
.status-terkirim { color: #2ecc71; font-weight: 600; }
.status-gagal { color: #e74c3c; font-weight: 600; }
.status-pending { color: #f39c12; font-weight: 600; }

tr.row-gagal { background: #fdecea; }

button.secondary {
  background: white;
  color: #075e54;
  border: 1px solid #075e54;
}
button.secondary:hover { background: #f0f7f6; }

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-retry {
  background: #e74c3c;
  padding: 4px 10px;
  font-size: 0.8rem;
}
.btn-retry:hover { background: #c0392b; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert-success {
  background: #e8f8ee;
  color: #1e8449;
  border: 1px solid #a8e6c1;
}
.alert-error {
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #f5b7b1;
}
.alert-info {
  background: #eef6fb;
  color: #21618c;
  border: 1px solid #aed6f1;
}
