:root {
  --gold: #a8842c;
  --ink: #1a1a1a;
  --line: #d8d2c4;
  --bg: #faf8f4;
  --card: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.topbar {
  background: #111;
  color: #f3ead2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 14px; }
.monogram {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 1;
  color: var(--gold);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 24px; letter-spacing: 1.5px; }
.brand-sub { font-size: 12.5px; letter-spacing: 2.5px; text-transform: uppercase; color: #cbbd93; }
.tabs { display: flex; gap: 8px; }
.tab {
  background: transparent; color: #e8e0c8; border: 1px solid #55503e;
  padding: 9px 18px; border-radius: 4px; font-size: 15px; cursor: pointer;
}
.tab.active { background: var(--gold); border-color: var(--gold); color: #111; font-weight: 600; }
main { max-width: 1080px; margin: 22px auto 40px; padding: 0 16px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
fieldset {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px 16px; margin: 0;
}
fieldset.wide { grid-column: 1 / -1; }
legend {
  font-family: Georgia, "Times New Roman", serif; font-size: 16.5px;
  padding: 0 6px; color: #6d5516;
}
label { display: block; font-size: 13.5px; font-weight: 600; margin-top: 10px; }
label:first-of-type { margin-top: 2px; }
input, select, textarea {
  width: 100%; margin-top: 4px; padding: 9px 10px; font-size: 15px;
  border: 1px solid #c9c2b0; border-radius: 5px; font-family: inherit;
  background: #fff;
}
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.row2 label, .row2 label:first-of-type { margin-top: 0; }
.hint { font-size: 12.5px; color: #77705f; margin: 10px 0 0; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photo-slot {
  border: 1.5px dashed #c9c2b0; border-radius: 8px; padding: 10px;
  text-align: center; cursor: pointer; margin-top: 4px; font-weight: 600;
}
.photo-slot input { border: none; padding: 6px 0 0; font-size: 12.5px; }
.cam-btn { margin-top: 8px; }
.photo-preview { width: 100%; height: 130px; object-fit: cover; border-radius: 5px; margin-top: 8px; }
.hidden { display: none !important; }
.actions { margin-top: 18px; display: flex; align-items: center; gap: 14px; }
.btn {
  background: #fff; border: 1.5px solid #111; color: #111; border-radius: 5px;
  padding: 10px 20px; font-size: 15px; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn.primary { background: #111; color: #f3ead2; border-color: var(--gold); font-size: 16.5px; padding: 12px 28px; }
.btn.small { padding: 5px 12px; font-size: 13.5px; }
.btn.danger { border-color: #a33; color: #a33; }
.error { color: #a33; font-size: 14px; }
.banner {
  background: #f2ecd9; border: 1.5px solid var(--gold); border-radius: 8px;
  padding: 14px 18px; margin-bottom: 16px; font-size: 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.banner strong { font-family: Georgia, serif; font-size: 19px; }
.history-head { display: flex; gap: 10px; margin-bottom: 14px; }
.history-head input { flex: 1; margin-top: 0; }
.cert-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 13px 16px; margin-bottom: 10px; cursor: pointer;
}
.cert-card.void { opacity: 0.62; }
.cert-main { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.cert-no { font-family: Georgia, serif; font-weight: 700; font-size: 17px; }
.cert-item { font-weight: 600; }
.cert-meta { color: #5c5647; font-size: 13.5px; }
.badge {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  border-radius: 3px; padding: 2px 8px; background: #e6efdd; color: #3d621f;
}
.badge.void { background: #f3dede; color: #8c2f2f; }
.cert-actions { margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.edit-note { font-size: 12.5px; color: #8c6d1f; }
.edit-history { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.edit-history-title {
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: #6d5516;
}
.eh-when { font-size: 13px; font-weight: 600; margin-top: 7px; }
.eh-unlock { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.eh-unlock input { width: 180px; margin-top: 0; }
.cert-detail { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; cursor: default; }
.cert-detail .kv { font-size: 13.5px; color: #44403a; margin: 2px 0; }
.cert-detail .thumbs { display: flex; gap: 8px; margin-top: 8px; }
.cert-detail .thumbs img { flex: 1 1 0; min-width: 0; height: 82px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.brand-logo {
  height: 52px; max-width: 170px; object-fit: contain;
  background: #fff; border-radius: 6px; padding: 4px 8px;
}
.logo-box {
  border: 1.5px dashed #c9c2b0; border-radius: 8px; padding: 12px;
  text-align: center; margin-top: 4px; min-height: 84px;
  display: flex; align-items: center; justify-content: center;
}
.logo-preview { max-width: 100%; max-height: 110px; object-fit: contain; }
.logo-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.foot { text-align: center; color: #8a8271; font-size: 12.5px; padding: 18px 10px 30px; }
.licence-grid { margin-top: 16px; }
.license-status { font-family: Georgia, serif; font-size: 18px; margin: 4px 0 6px; }
.license-details .kv { font-size: 13.5px; color: #44403a; margin: 2px 0; }
#license-key, #rebind-token, #rebind-key { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
#license-banner { display: block; }
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .photos { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .brand-name { font-size: 19px; }
}

/* Staff attribution */
.staff-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 0; border-bottom: 1px dashed var(--line);
  font-size: 15px; font-weight: 600;
}
.staff-row .btn { margin-left: 2px; }
#staff-modal label { text-align: left; }
#staff-modal .cam-card { max-width: 420px; }

/* Camera capture modal */
.cam-modal { position: fixed; inset: 0; background: rgba(20, 18, 12, .72); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.cam-card { background: var(--card); border-radius: 10px; padding: 18px; width: 100%; max-width: 560px; text-align: center; }
.cam-card h3 { margin: 0 0 10px; }
.cam-card video, .cam-card img { width: 100%; max-height: 60vh; object-fit: contain; background: #111; border-radius: 6px; }
.cam-actions { margin-top: 12px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
