.admin-body {
  background: #eef0f2;
}

.admin-body .site-header,
.admin-body .header-inner {
  height: 70px;
  overflow: hidden;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.admin-link,
.admin-text-btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.admin-link:hover,
.admin-text-btn:hover {
  text-decoration: underline;
}

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 48px;
  width: 100%;
}

.admin-card {
  max-width: none;
  margin-bottom: 20px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-title {
  margin-bottom: 0;
  text-align: left;
}

.section-title {
  margin: 0 0 20px;
  color: var(--blue);
  font-size: 1.15rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}

.admin-form label {
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 6px;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input:not([type]) {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #b8c0c8;
  border-radius: 2px;
}

.admin-form input:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 107, 184, 0.2);
}

.grid-form {
  max-width: none;
}

.photo-field {
  margin-bottom: 8px;
}

.photo-upload {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.photo-upload img {
  width: 120px;
  height: 140px;
  object-fit: cover;
  border: 1px solid #c5c9ce;
  background: #f7f7f7;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn-secondary {
  appearance: none;
  border: 1px solid #9aa3ad;
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 2px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #f3f5f7;
}

.btn-small {
  padding: 8px 18px;
  min-width: 0;
  font-size: 0.9rem;
}

.btn-danger {
  appearance: none;
  border: none;
  background: transparent;
  color: #b00020;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.btn-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.qr-panel {
  margin: 12px 0 8px;
  padding: 14px;
  border: 1px solid #d8dde3;
  background: #fafbfc;
}

.qr-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 400;
  color: #666;
}

.qr-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.qr-link-row input {
  flex: 1 1 220px;
  min-width: 0;
  font: inherit;
  font-size: 0.85rem;
  padding: 8px 10px;
  border: 1px solid #b8c0c8;
  background: #fff;
}

.qr-link-row .btn-small,
.qr-box .btn-small {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-box {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.qr-box canvas,
.qr-box .qr-image {
  display: block;
  border: 1px solid #ddd;
  background: #fff;
  width: 180px;
  height: 180px;
}

.qr-placeholder {
  width: 180px;
  height: 180px;
  border: 1px dashed #c5c9ce;
  background: #fff;
  color: #888;
  font-size: 0.78rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  box-sizing: border-box;
}

.qr-cell img,
.qr-cell canvas {
  display: block;
  border: 1px solid #e1e5ea;
  width: 64px;
  height: 64px;
}

.table-link {
  margin-top: 4px;
  font-size: 0.75rem;
}

.table-link a {
  color: var(--blue);
  font-weight: 600;
}

.table-link a:hover {
  text-decoration: underline;
}

.form-success {
  margin: 0;
  color: #0b6b2f;
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.records-table th,
.records-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e1e5ea;
  vertical-align: middle;
}

.records-table th {
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}

.records-table img {
  width: 44px;
  height: 52px;
  object-fit: cover;
  border: 1px solid #c5c9ce;
  display: block;
}

.row-actions {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.records-empty {
  padding: 16px 0;
  color: #666;
}

.preview-card .section-title {
  text-align: center;
}

.admin-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 960px) {
  .admin-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  /* Full-width rows — not :first-child (password card sits first in DOM) */
  .admin-layout > .records-card,
  .admin-layout > #password-card {
    grid-column: 1 / -1;
  }
}
