* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  background: #f8fafc;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* ===== CONTAINER (MAX 1024px) ===== */
.container {
  background: #ffffff;
  margin: 32px 16px;
  padding: 28px;
  border-radius: 16px;
  width: 100%;
  max-width: 1024px;
  border: 1px solid #e5e7eb;
}

/* top contact */
.top-contact {
  text-align: center;
  font-size: 0.875rem;
  color: #475569;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.contact-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

/* ===== TITLE ===== */
h1 {
  font-size: 1.6rem;
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

/* ===== FIELD ===== */
.field {
  margin-bottom: 18px;
}

/* ===== LABEL ===== */
label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  display: block;
}

/* ===== INPUT & SELECT ===== */
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ===== TEXTAREA ===== */
textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  resize: both;
  white-space: pre;
  overflow-x: auto;
  overflow-y: auto;
}

textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ===== BUTTONS (ALL BLUE) ===== */
button {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  background: #3b82f6;
  color: white;
  transition: background 0.2s ease, transform 0.1s ease;
}

button:hover {
  background: #2563eb;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== BUY BTN (DARKER) ===== */
#buyBtn {
  background: #1d4ed8;
  font-weight: 700;
}

#buyBtn:hover {
  background: #1e40af;
}

/* secondary button vẫn xanh nhưng nhạt hơn chút (đúng “1 bộ màu”) */
.secondary-btn {
  background: #3b82f6;
}

.secondary-btn:hover {
  background: #2563eb;
}

/* ===== PRICE / TOTAL ===== */
.price-text {
  font-size: 1rem;
  font-weight: 600;
  color: #2563eb;
  text-align: center;
}

.total {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

/* ===== ACCOUNT INFO ===== */
.account-info {
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  white-space: pre-line;
  font-size: 0.9rem;
  color: #0f172a;
  margin-top: 10px;
}

/* ===== STATUS ===== */
.error {
  color: #dc2626;
  font-weight: 600;
  margin-top: 6px;
}

.success {
  color: #16a34a;
  font-weight: 600;
  margin-top: 6px;
}

.hint {
  color: #475569;
  font-weight: 500;
  margin-top: 6px;
}

/* ===== ACTIONS ===== */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

/* ===== HISTORY SECTION ===== */
.section-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 24px 0 18px;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.section-sub {
  font-size: 0.875rem;
  color: #475569;
}

/* table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

#order-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px; /* để mobile scroll ngang */
  background: #ffffff;
}

#order-table th,
#order-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  font-size: 0.9rem;
  color: #0f172a;
}

#order-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
}

#order-table tbody tr:hover {
  background: #f8fafc;
}

/* download btn in table */
.table-btn {
  width: auto;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.page-btn {
  width: auto;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin: 0;
}

.page-btn[disabled] {
  opacity: 1;
  background: #1d4ed8;
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
  .container {
    padding: 20px;
    margin: 20px 12px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.3rem;
  }

  button {
    font-size: 0.9rem;
    padding: 11px 14px;
  }

  .total {
    font-size: 1rem;
    padding: 10px;
  }

  textarea {
    min-height: 140px;
  }
}
