.admin-body {
  background: var(--ivory);
  min-height: 100svh;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  background: var(--navy);
  color: var(--ivory);
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.88rem;
}

.admin-top a {
  color: var(--gold-soft);
  text-decoration: none;
  margin-right: 12px;
}

.admin-top a:hover { color: var(--ivory); }

.admin-main {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.admin-who {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 16px;
}

.admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-page-head h1 {
  margin: 0;
  font-size: 1.75rem;
  text-align: left;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 20px 0 28px;
}

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

.admin-card {
  display: block;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.admin-card:hover { border-color: var(--gold); }

.admin-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  text-align: left;
}

.admin-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-form,
.admin-table {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  margin: 16px 0;
  padding: 18px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--navy);
}

.admin-form label.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-form h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  text-align: left;
}

.admin-table {
  border-collapse: collapse;
  padding: 0;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.92rem;
}

.admin-table tr.is-hidden { opacity: 0.55; }

.log-detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.admin-table .thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline-form { display: inline; margin: 0; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.btn.is-busy,
.link-btn.is-busy {
  cursor: wait;
  opacity: 0.7;
}

.send-status {
  margin: 10px 0 0;
  color: var(--navy);
  font-size: 0.95rem;
}

.notice {
  padding: 10px 14px;
  background: var(--paper);
  border-left: 3px solid var(--gold);
  margin: 12px 0;
}

.notice.is-error { border-color: #a33; }

.login-wrap {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ivory);
}

.login-wrap .admin-form {
  width: min(400px, 100%);
}

.login-wrap h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  text-align: left;
}

.caption-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.caption-form input { flex: 1 1 140px; }

.area-checks {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.area-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.rich-toolbar button,
.rich-toolbar select {
  font: inherit;
  font-size: 0.82rem;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}

.rich-editor {
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
  line-height: 1.55;
}

.rich-editor:focus {
  outline: 2px solid rgba(184, 146, 58, 0.45);
  outline-offset: 2px;
}

.upload-progress { margin-top: 14px; }
.upload-progress[hidden] { display: none; }
.upload-track {
  height: 14px;
  background: rgba(22, 52, 92, 0.14);
  overflow: hidden;
}
.upload-fill {
  height: 100%;
  width: 0;
  background: var(--navy);
}
.upload-track.is-busy .upload-fill {
  width: 35%;
  animation: upload-slide 1.1s ease-in-out infinite;
}
.upload-label {
  margin: 8px 0 0;
  color: var(--navy);
  font-size: 0.9rem;
}
#photo-upload button:disabled { opacity: 0.65; cursor: progress; }
@keyframes upload-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.admin-form textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: white;
  font: inherit;
  line-height: 1.5;
}

.bio-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.bio-admin-head h2 {
  margin: 0;
  text-align: left;
  font-size: 1.45rem;
}

.block-label {
  font-family: "Libre Baskerville", Georgia, serif;
  color: var(--navy);
  margin: 18px 0 6px;
}

.btn.small {
  padding: 8px 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.app-sheet {
  background: white;
  border: 1px solid var(--line);
  margin: 16px 0 8px;
  padding-bottom: 8px;
  color: var(--ink);
}

.app-sheet-banner {
  background: #16345c;
  color: #f4f0e6;
  text-align: center;
  padding: 14px 16px 12px;
  border-bottom: 4px solid #b8923a;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 600;
}

.app-sheet-title {
  text-align: center;
  margin: 18px 16px 0;
  color: var(--navy);
  font-size: 1.7rem;
}

.app-sheet-sub {
  text-align: center;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-sheet-rule {
  height: 1px;
  margin: 14px 28px 0;
  background: #b8923a;
  border: 0;
}

.app-sheet-who {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 28px 10px;
}

.app-sheet-who strong { font-size: 1.08rem; }
.app-sheet-who span { color: var(--muted); font-size: 0.9rem; }

.app-sheet section { margin: 0 28px 16px; }

.app-sheet h3 {
  margin: 0;
  background: #16345c;
  color: #f4f0e6;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px 6px 12px;
  border-left: 4px solid #b8923a;
  text-align: left;
  font-weight: 600;
}

.app-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 22px;
  margin-top: 12px;
}

.app-fields .wide { grid-column: 1 / -1; }

.app-fields span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.app-fields b {
  display: block;
  font-weight: 600;
}

.app-write {
  min-height: 140px;
  margin-top: 0;
  padding: 12px 14px;
  background: #f8f5ef;
  white-space: pre-wrap;
  line-height: 1.45;
}

.app-checks {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.app-checks li { margin: 5px 0; }

.app-box {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid #16345c;
  margin-right: 8px;
  vertical-align: -1px;
}

.app-box.on { background: #16345c; }

.app-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
}

.app-status b { color: var(--navy); }

.app-sign {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 28px;
  margin-top: 10px;
}

.app-sign span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.app-sign .line {
  min-height: 52px;
  border-bottom: 1px solid #d9d3c6;
}

.app-sign img {
  display: block;
  max-width: 280px;
  max-height: 90px;
  background: white;
}

.app-sign .when {
  margin-top: 18px;
  font-weight: 600;
}

.app-attach h3 { margin-bottom: 0; }

.app-file {
  display: block;
  width: 100%;
  margin-top: 0;
  background: white;
  border: 1px solid #d9d3c6;
  border-top: 0;
}

iframe.app-file { height: 720px; }
img.app-file { height: auto; }

.app-missing {
  margin: 8px 0 0;
  color: var(--muted);
}

.app-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 20px;
}

@media (max-width: 700px) {
  .app-fields,
  .app-sign { grid-template-columns: 1fr; }
  .app-sheet section,
  .app-sheet-who,
  .app-sheet-rule { margin-left: 14px; margin-right: 14px; }
}

.visit-panel {
  margin: 8px 0 28px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.visit-panel h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  text-align: left;
}

.visit-panel .admin-form {
  margin: 12px 0 16px;
  padding: 0;
  background: transparent;
  border: 0;
}

.visit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 8px;
}

.visit-grid div {
  padding: 12px 10px;
  text-align: center;
  background: var(--ivory);
  border-top: 2px solid var(--gold);
}

.visit-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.visit-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 400;
}

.visit-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

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