*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/* LOGIN */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f0f2f5;
}

.login-card {
  background: #fff;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1890ff;
}

.error {
  color: #ff4d4f;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
}

.login-card button[type="submit"] {
  width: 100%;
  padding: 0.7rem;
  background: #1890ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.login-card button[type="submit"]:hover {
  background: #40a9ff;
}

.login-card button[type="submit"]:disabled {
  background: #d9d9d9;
  cursor: not-allowed;
}

/* DASHBOARD */

.dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

header h1 {
  font-size: 1.5rem;
  color: #333;
  margin: 0;
}

.btn-logout {
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  color: #555;
}

.btn-logout:hover {
  border-color: #ff4d4f;
  color: #ff4d4f;
}

.filters {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-size: 0.8rem;
  color: #888;
}

.filter-group input,
.filter-group select {
  padding: 0.5rem 0.65rem;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 0.9rem;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: #1890ff;
}

.btn-clear {
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  color: #555;
  font-size: 0.9rem;
}

.btn-clear:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.loading,
.empty {
  text-align: center;
  padding: 3rem;
  color: #999;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

th {
  background: #fafafa;
  font-weight: 600;
  font-size: 0.85rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover {
  background: #fafafa;
}

.badge {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.success {
  background: #f6ffed;
  color: #52c41a;
  border: 1px solid #b7eb8f;
}

.badge.fail {
  background: #fff2f0;
  color: #ff4d4f;
  border: 1px solid #ffccc7;
}

.btn-detail {
  padding: 0.3rem 0.75rem;
  background: #1890ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-detail:hover {
  background: #40a9ff;
}

/* PAGINATION */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-top: 0.5rem;
}

.pagination-info {
  font-size: 0.85rem;
  color: #888;
}

.pagination-controls {
  display: flex;
  gap: 0.35rem;
}

.pagination-controls button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  color: #333;
  transition: all 0.15s;
}

.pagination-controls button:hover:not(:disabled) {
  border-color: #1890ff;
  color: #1890ff;
}

.pagination-controls button:disabled {
  color: #d9d9d9;
  cursor: not-allowed;
  background: #fafafa;
}

/* MODAL */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
}

.btn-close:hover {
  color: #333;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.detail-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.detail-row strong {
  min-width: 80px;
  color: #555;
}

.payload-section {
  margin-top: 1.25rem;
}

.payload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.payload-header strong {
  color: #555;
}

.btn-copy {
  padding: 0.25rem 0.65rem;
  background: #fafafa;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #555;
}

.btn-copy:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.payload-section pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 400px;
  margin: 0;
}
