/* ===== Base ===== */
body {
  font-family: system-ui, Arial, sans-serif;
  margin: 24px;
}

.wrap {
  max-width: 1150px;
  margin: 0 auto;
}

h1, h2 {
  margin-top: 0;
}

/* ===== Navigation ===== */
.topnav {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.topnav a {
  color: #0b57d0;
  text-decoration: none;
}

.topnav a:hover {
  text-decoration: underline;
}

/* ===== Forms ===== */
form {
  border: 1px solid #ddd;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 14px;
  margin: 10px 0 6px;
}

input[type="text"],
input[type="date"],
input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
}

/* Field sizes */
input.short { max-width: 260px; }
input.medium { max-width: 420px; }

/* Layout */
.row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.col {
  flex: 1;
  min-width: 260px;
}

/* Buttons */
.btn {
  margin-top: 14px;
  padding: 10px 14px;
  border: 0;
  background: #111;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.btn-secondary {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  border-radius: 8px;
  cursor: pointer;
}

/* Errors */
.err {
  background: #ffecec;
  border: 1px solid #ffb3b3;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ===== Purchase ID Box ===== */
.purchase-id-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed #bbb;
  border-radius: 10px;
  background: #fafafa;
  margin-bottom: 12px;
}

.purchase-id-box strong {
  font-size: 16px;
  letter-spacing: 0.4px;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid #eee;
  text-align: left;
  padding: 10px;
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #fafafa;
}

/* Helpers */
.muted {
  color: #666;
  font-size: 13px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #f0f0f0;
}

.truncate {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: bottom;
}

/* ===== Meta box (edit.php) ===== */
.meta {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  background: #fff;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

@media (max-width: 700px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }
}
