* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1c2024;
  background: #f4f4f5;
}

a { color: #2563eb; }

.admin-header {
  background: #1c2024;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header a { color: #fff; text-decoration: none; font-weight: 600; }

.admin-nav {
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
}

.admin-nav a { opacity: 0.85; }
.admin-nav a:hover { opacity: 1; }

.admin-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.card {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-tile {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 18px;
}

.stat-tile .value { font-size: 1.8rem; font-weight: 700; }
.stat-tile .label { font-size: 0.85rem; color: #6b7280; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eee; }

.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.85rem; }
.bar-row .bar-track { flex: 1; background: #eee; border-radius: 4px; height: 10px; overflow: hidden; }
.bar-row .bar-fill { background: #2563eb; height: 100%; }
.bar-row .bar-label { width: 190px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-count { width: 40px; text-align: right; flex: none; }

label { display: block; font-weight: 600; margin: 18px 0 6px; font-size: 0.88rem; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=url], textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }

.wysiwyg-hidden { display: none; }

/* Quill (vendored under admin/assets/vendor/quill) supplies its own
   toolbar/editor styling via quill.snow.css; this just fits it into our
   admin design system's sizing and border radius. */
.wysiwyg { margin-bottom: 4px; border-radius: 6px; overflow: hidden; }
.wysiwyg .ql-toolbar.ql-snow { border-color: #d4d4d8; background: #f4f4f5; border-radius: 6px 6px 0 0; }
.wysiwyg .ql-container.ql-snow { border-color: #d4d4d8; border-radius: 0 0 6px 6px; }
.wysiwyg .ql-editor { min-height: 110px; max-height: 360px; font-size: 0.92rem; font-family: inherit; }

fieldset { border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 22px; padding: 16px 18px; }
legend { font-weight: 700; padding: 0 6px; }

button, .button {
  display: inline-block;
  background: #1c2024;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

button:hover, .button:hover { background: #33383e; }

.btn-danger { background: #b42318; }
.btn-danger:hover { background: #8f1b13; }
.btn-small { padding: 6px 12px; font-size: 0.82rem; }
.btn-secondary { background: #fff; color: #1c2024; border: 1px solid #d4d4d8; }
.btn-secondary:hover { background: #f4f4f5; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; }
.flash--ok { background: #ecfdf3; border: 1px solid #b7e4c7; color: #1a7f4b; }
.flash--error { background: #fef2f2; border: 1px solid #f5c2c2; color: #b42318; }

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  border-bottom: 1px solid #e4e4e7;
}

.tabs a {
  padding: 10px 16px;
  text-decoration: none;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a:hover { color: #1c2024; }
.tabs a.active { color: #1c2024; border-bottom-color: #1c2024; }

.item-card {
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: #fafafa;
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.item-card-header strong { font-size: 0.8rem; color: #9ca3af; font-family: monospace; }

.item-card-footer { margin-top: 14px; }

.photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.photo-row img,
.photo-row .avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #52525b;
}

.photo-row form { margin: 0; display: flex; align-items: center; gap: 8px; }
.photo-row input[type=file] { font-size: 0.8rem; width: auto; }

.login-wrap {
  max-width: 380px;
  margin: 80px auto;
  padding: 0 20px;
}

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

.image-tile img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 10px;
  /* neutral checkerboard so transparent logos/PNGs are legible, not just
     invisible against a plain background */
  background-image:
    linear-gradient(45deg, #e4e4e7 25%, transparent 25%),
    linear-gradient(-45deg, #e4e4e7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e4e4e7 75%),
    linear-gradient(-45deg, transparent 75%, #e4e4e7 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #f9f9fa;
}

.image-tile .key { font-size: 0.75rem; color: #9ca3af; font-family: monospace; }

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

.color-field label { margin-top: 0; }

.color-field-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-field-row input[type=color] {
  width: 44px;
  height: 38px;
  padding: 2px;
  flex: none;
  cursor: pointer;
}

.color-hex {
  width: auto;
  flex: 1;
  font-family: monospace;
  text-transform: lowercase;
}
