.admin-body {
  background: #f3f0e6;
}

.admin-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-top h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.admin-top p {
  margin: 8px 0 0;
  color: #59554a;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, .45fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.auth-wrap {
  min-height: calc(100vh - 75px);
  display: grid;
  place-items: center;
  padding: 30px 16px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, .62)),
    url("hero-products.jpg") center / cover no-repeat;
}

.auth-panel {
  width: min(480px, 100%);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  padding: 28px;
  background: rgba(10, 10, 10, .92);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.auth-panel .brand {
  margin-bottom: 24px;
}

.auth-panel .brand-logo img {
  width: min(220px, 70vw);
  height: auto;
}

.auth-panel .brand-logo > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.auth-panel h1 {
  font-size: 2rem;
}

.auth-panel p {
  color: rgba(255, 255, 255, .7);
}

.auth-panel label {
  color: #ffffff;
}

.auth-panel input {
  border-color: rgba(255, 255, 255, .22);
  background: #ffffff;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .07);
}

.auth-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .76);
  font-weight: 800;
}

.auth-switch button.active {
  background: var(--gold);
  color: #111111;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ops-grid {
  margin-bottom: 20px;
}

.stat {
  border: 1px solid #ded8c8;
  border-radius: var(--radius);
  padding: 18px;
  background: #ffffff;
}

.stat span {
  display: block;
  color: #6d6658;
  font-size: .82rem;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #ded8c8;
  border-radius: var(--radius);
  background: #ffffff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #e8e2d3;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: #f9f5e8;
  color: #50462f;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-thumb {
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #111111;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-form textarea {
  min-height: 130px;
}

.admin-form fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-form fieldset:disabled {
  opacity: .62;
}

.image-preview {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed #c7bea8;
  border-radius: var(--radius);
  background: #fffaf0;
  overflow: hidden;
}

.image-preview.compact {
  min-height: 118px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
}

.gallery-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px;
  min-height: 70px;
  padding: 10px;
  border: 1px dashed #c7bea8;
  border-radius: var(--radius);
  background: #fffaf0;
}

.gallery-preview > span {
  grid-column: 1 / -1;
  align-self: center;
  color: #6d6658;
  font-size: .9rem;
}

.gallery-item {
  display: grid;
  gap: 6px;
  align-content: start;
  font-size: .78rem;
  color: #5f594f;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  background: #111111;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: #5f594f;
  font-size: .9rem;
}

.check-row input {
  width: auto;
}

.check-row a {
  color: #6f5a24;
  text-decoration: underline;
}

.auth-panel .check-row {
  color: rgba(255, 255, 255, .78);
}

.auth-panel .check-row a {
  color: var(--gold-strong);
}

.admin-hidden {
  display: none !important;
}

#google-signin {
  margin-top: 14px;
}

@media (max-width: 980px) {
  .admin-grid,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .admin-top {
    align-items: flex-start;
    flex-direction: column;
  }
}
