* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f7f8fa;
  color: #1a1a1a;
}

.site-header {
  background: #ffffff;
  padding: 24px 40px;
  border-bottom: 1px solid #e4e6eb;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.site-header h1 {
  margin: 0;
  font-size: 24px;
}

.subtitle {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 14px;
}

#auth-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-email {
  font-size: 14px;
  color: #374151;
  font-weight: 600;
}

.auth-btn {
  background: #111827;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.auth-btn:hover {
  background: #1f2937;
}

.secondary-btn {
  background: white;
  color: #111827;
  border: 1px solid #d1d5db;
}

.secondary-btn:hover {
  background: #f3f4f6;
}

main {
  padding: 32px 40px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

#search-input {
  flex: 1;
  min-width: 200px;
}

#min-dr-input,
#min-da-input {
  width: 100px;
}

.site-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.site-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  padding: 12px 16px;
  border-bottom: 2px solid #e4e6eb;
  background: #fafbfc;
}

.site-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f2;
  font-size: 14px;
}

.site-table tr:last-child td {
  border-bottom: none;
}

.site-table tr:hover td {
  background: #f9fafb;
}

.domain-cell {
  font-weight: 600;
  color: #111827;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
}

.badge.dr {
  background: #e6f4ea;
  color: #1e7e34;
}

.badge.da {
  background: #e8f0fe;
  color: #1a56db;
}

.buy-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.buy-btn:hover {
  background: #1d4ed8;
}

/* ---------- Modals (shared by auth + buy + orders) ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: white;
  padding: 32px;
  border-radius: 10px;
  width: 100%;
  max-width: 360px;
  position: relative;
}

.orders-box {
  max-width: 480px;
  max-height: 70vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
}

.modal-box h2 {
  margin: 0 0 20px;
  font-size: 20px;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#auth-form input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.modal-submit-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.modal-submit-btn:hover {
  background: #1d4ed8;
}

.auth-message {
  font-size: 13px;
  color: #dc2626;
  min-height: 18px;
  margin: 10px 0 0;
}

.toggle-mode {
  font-size: 13px;
  color: #6b7280;
  margin: 14px 0 0;
  text-align: center;
}

.toggle-mode a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.buy-domain-label {
  font-weight: 600;
  color: #374151;
  margin: -12px 0 16px;
}

.radio-label {
  display: block;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.radio-label input {
  margin-right: 8px;
}

/* ---------- My Orders list ---------- */
.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #eef0f2;
}

.order-row:last-child {
  border-bottom: none;
}

.order-meta {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-pending_payment {
  background: #fef3c7;
  color: #92400e;
}

.status-paid {
  background: #d1fae5;
  color: #065f46;
}

.status-in_progress {
  background: #dbeafe;
  color: #1e40af;
}

.status-delivered {
  background: #d1fae5;
  color: #065f46;
}

/* ---------- Admin page ---------- */
.admin-tag {
  display: inline-block;
  background: #111827;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 8px;
}

.user-id-cell {
  font-size: 12px;
  color: #9ca3af;
  font-family: monospace;
}

.status-select {
  padding: 6px 10px;
  border-radius: 20px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
}