* { box-sizing: border-box; }

body {
  font-family: Tahoma, Verdana, Arial, sans-serif;
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px;
  background: #dfdfdf;
  color: #2a2a2a;
  font-size: 12px;
  line-height: 1.35;
}

a { color: #2e6f8d; text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #232323;
  color: #f4f4f4;
  border: 1px solid #101010;
  border-radius: 2px;
  padding: 7px 9px;
  margin-bottom: 8px;
}

.top h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.top h2 a {
  color: #f4f4f4;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  text-decoration: none;
}
.site-brand,
.site-brand a,
.site-brand img {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.site-brand a {
  display: inline-block;
  line-height: 0;
}
.site-brand img {
  display: block;
  max-height: 42px;
  width: auto;
  mix-blend-mode: normal;
}
.site-brand a:hover,
.site-brand a:focus,
.site-brand a:active,
.site-brand img:hover,
.site-brand img:focus,
.site-brand img:active {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

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

.profile-pic-nav {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.profile-pic-large {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 8px;
}

.card {
  background: #ebebeb;
  border: 1px solid #abc0cd;
  border-radius: 1px;
  padding: 8px;
  margin: 8px 0;
}

.section-title {
  margin: 2px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #3a4f5d;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 6px;
}

.listings-grid .listing-card {
  min-height: 128px;
}

.listing-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.listing-card p {
  margin: 6px 0 0;
}

.listing-thumb {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  display: block;
  margin-bottom: 6px;
  background: #d8d8d8;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.category-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 74px;
  justify-content: flex-start;
  background: linear-gradient(#f2f2f2, #e3e3e3);
  border: 1px solid #a7becb;
  color: #2b2b2b;
  padding: 8px;
}

.category-thumb {
  width: 100%;
  height: 96px;
  object-fit: contain;
  display: block;
  margin-bottom: 4px;
  border: 1px solid #a8bdca;
  background: #d8d8d8;
}

.category-tile.active {
  border-color: #6e9fb6;
  box-shadow: inset 0 0 0 1px #cfe2ec;
}

.search-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.muted { color: #5f6f77; }

.alert {
  padding: 8px;
  border-radius: 2px;
  margin: 8px 0;
  border: 1px solid;
}
.alert.success { background: #e5f4e8; border-color: #87bc90; }
.alert.error { background: #fae6e6; border-color: #d78c8c; }
.alert.info { background: #e8f0f8; border-color: #9fb8d3; }

input, select, textarea, button {
  width: 100%;
  padding: 7px;
  border: 1px solid #a8bdca;
  border-radius: 1px;
  background: #f8f8f8;
  color: #2a2a2a;
  font-size: 12px;
}

textarea { resize: vertical; }

button {
  width: auto;
  background: #ececec;
  border-color: #9e9e9e;
  cursor: pointer;
}
button:hover { background: #e2e2e2; }
button.secondary {
  background: #dde5ea;
  border-color: #9fb1bc;
}
button.danger {
  background: #c74d4d;
  color: #fff;
  border-color: #9f3f3f;
}

audit, summary {
  cursor: pointer;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  padding: 0 0 0 6px;
  margin-bottom: -1px;
  background: transparent;
  border-bottom: 1px solid #a8bdca;
}
.admin-tab {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #a8bdca;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#ececec, #dddddd);
  color: #2a2a2a;
  text-decoration: none;
  position: relative;
  top: 1px;
}
.admin-tab:hover {
  background: linear-gradient(#f2f2f2, #e4e4e4);
  text-decoration: none;
}
.admin-tab.active {
  background: #ebebeb;
  border-color: #a8bdca;
  font-weight: 700;
  z-index: 1;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.admin-grid > .card {
  margin: 0;
  height: 100%;
}

.admin-grid-span-2 {
  grid-column: 1 / -1;
}

.admin-grid-empty {
  min-height: 1px;
}
.inline-check {
  display: block;
  margin-top: 8px;
}
.inline-check input {
  width: auto;
  margin-right: 6px;
}

.caps-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.9fr) minmax(90px, 1fr) minmax(80px, 0.8fr) minmax(90px, 0.9fr) minmax(120px, 1.2fr) auto auto;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.caps-header {
  font-weight: 700;
  color: #3a4f5d;
  margin-bottom: 4px;
}

.caps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.caps-table th,
.caps-table td {
  border: 1px solid #a8bdca;
  padding: 6px;
  text-align: left;
}

.caps-table th {
  background: #e1e8ed;
}

.caps-table tbody tr.selected {
  background: #fff4bf;
}

.caps-table tbody tr.selected td {
  background: #fff4bf;
}

img {
  border: 1px solid #a8bdca;
  background: #ddd;
}

.audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.audit-filter-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.audit-log-card {
  overflow: hidden;
}

.audit-log-table-wrap {
  overflow-x: auto;
}

.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.audit-log-table th,
.audit-log-table td {
  border: 1px solid #a8bdca;
  padding: 6px;
  vertical-align: top;
  text-align: left;
}

.audit-log-table th {
  background: #e1e8ed;
}

.audit-log-table code,
.audit-log-table pre {
  font-size: 11px;
}

.audit-log-table pre {
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.media-caps-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.media-caps-layout > .card { margin: 0; }

.image-picker-stage {
  margin-top: 6px;
}

.image-picker-stage img {
  max-width: 100%;
  display: block;
}

.listing-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.cap-marker {
  position: absolute;
  width: 35px;
  height: 35px;
  border: 3px solid #d82222;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
}

@media (max-width: 820px) {
  .media-caps-layout {
    grid-template-columns: 1fr;
  }

  .audit-filter-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid-span-2 {
    grid-column: auto;
  }

  .caps-row {
    grid-template-columns: 1fr;
  }
}
