/* Must beat .login-wrap { display: flex } from ../styles/app.css */
[hidden] {
  display: none !important;
}

.admin-header {
  background: #1c1915;
  color: #fffcf7;
  padding: 1rem 1.25rem 0.75rem;
}

.sw-update-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #2c4a3e;
  color: #fffcf7;
}

.sw-update-banner[hidden] {
  display: none !important;
}

.sw-update-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sw-update-banner-reload {
  border: 1px solid #fffcf7;
  background: transparent;
  color: #fffcf7;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.admin-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.admin-brand {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: 0.04em;
}

.admin-header h1 {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
}

.admin-tabs {
  max-width: 960px;
  margin: 0.85rem auto 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-tabs select {
  min-width: 12rem;
  padding: 0.4rem 0.55rem;
}

.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1.5rem;
}

.app-account-bar {
  padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
}

.app-account-bar[hidden] {
  display: none !important;
}

.app-account-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-align: center;
}

.app-account-email {
  display: block;
  font-size: 0.92rem;
  color: #5c564c;
  word-break: break-all;
  text-align: center;
}

.app-account-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.app-account-bar .btn-secondary {
  color: #1c1915;
  border-color: #c9bfb0;
  min-width: 11rem;
}

.admin-panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.admin-panel h2 {
  margin: 0 0 0.5rem;
}

.item-card-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.products-currency-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d9d1c3;
  border-radius: 12px;
  background: #fffcf7;
}

.products-currency-bar label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
  min-width: 10rem;
}

.products-currency-bar select {
  padding: 0.45rem 0.55rem;
  border: 1px solid #c9bfb0;
  border-radius: 8px;
  font: inherit;
}

.products-currency-hint {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.85rem;
}

.product-import-help {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.product-import-help code {
  font-size: 0.8rem;
  word-break: break-all;
}

.product-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-import-file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  padding: 0.4rem 0.75rem;
}

.item-card-grid.is-sorting {
  gap: 0.65rem;
}

.item-empty {
  margin: 0.75rem 0 0;
}

.item-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #fffcf7;
  border: 1px solid #d9d1c3;
  border-radius: 14px;
  padding: 1rem 1.05rem;
}

.item-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.item-card-thumb {
  flex: 0 0 auto;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 10px;
  object-fit: cover;
  background: #eee8dc;
  border: 1px solid #d9d1c3;
}

.item-card-thumb--empty {
  background: linear-gradient(145deg, #f4f1ea, #e7e0d4);
}

.item-card-body {
  min-width: 0;
  flex: 1;
}

.item-card-drag {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  padding: 0;
  border: 1px solid #c9bfb0;
  border-radius: 8px;
  background: #f4f1ea;
  color: #5c564c;
  font: inherit;
  line-height: 1;
  letter-spacing: -0.08em;
  cursor: grab;
  touch-action: none;
}

.item-card-drag:active {
  cursor: grabbing;
}

.item-card--sortable {
  cursor: grab;
  user-select: none;
}

.item-card.is-dragging {
  opacity: 0.45;
}

.item-card.drag-over-above {
  box-shadow: inset 0 3px 0 #2c4a3e;
}

.item-card.drag-over-below {
  box-shadow: inset 0 -3px 0 #2c4a3e;
}

#products-sort-btn.is-active {
  background: #1c1915;
  color: #fffcf7;
  border-color: #1c1915;
}

.item-card-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1c1915;
}

.item-card-price {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1c1915;
}

.item-card-offer {
  margin: 0.25rem 0 0;
  color: #6b4f2a;
  font-weight: 600;
}

.item-card-desc,
.item-card-message {
  margin: 0.45rem 0 0;
  color: #5c564c;
  line-height: 1.4;
  white-space: pre-wrap;
}

.item-card-message {
  margin-top: 0;
  font-size: 1.02rem;
  color: #1c1915;
}

.item-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.item-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.item-chip.on {
  background: #e7f0e8;
  border-color: #b7cbb8;
  color: #2c4a3e;
}

.item-chip.off {
  background: #f3eee6;
  border-color: #d9d1c3;
  color: #7a7266;
}

.item-chip.muted-chip {
  background: #f4f1ea;
  border-color: #e4ddd0;
  color: #6a6358;
}

.item-card-actions {
  margin-top: auto;
  padding-top: 0.15rem;
}

.action-chooser {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.action-chooser-select {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.4rem 0.55rem;
  font: inherit;
  font-size: 0.9rem;
  color: #1c1915;
  background: #fff;
  border: 1px solid #c9bfb0;
  border-radius: 8px;
}

.action-chooser-select--danger {
  border-color: #d4a5a5;
  color: #8b2e2e;
}

.action-chooser-go {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  color: #fffcf7;
  background: #1c1915;
  border: 1px solid #1c1915;
  border-radius: 8px;
  cursor: pointer;
}

.action-chooser-go:hover,
.action-chooser-go:focus-visible {
  background: #3a3530;
  border-color: #3a3530;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-secondary,
button.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-tiny {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #c9bfb0;
  background: #fff;
  cursor: pointer;
}

.btn-tiny.danger {
  color: #8b2e2e;
  border-color: #d4a5a5;
}

.stack-form {
  display: grid;
  gap: 0.65rem;
  max-width: 36rem;
}

.stack-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
  padding: 0.45rem 0.55rem;
  border: 1px solid #c9bfb0;
  border-radius: 8px;
  font: inherit;
}

.product-photo {
  display: grid;
  gap: 0.55rem;
}

.product-photo-preview {
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 12px;
  border: 1px solid #d9d1c3;
  background: #f4f1ea;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.product-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-photo-preview.is-empty {
  color: #7a7468;
  font-size: 0.85rem;
}

.product-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.product-photo-actions .btn-secondary.danger {
  color: #9b1c1c;
  border-color: #e8b4b4;
}

.product-photo-hint {
  margin: 0;
  font-size: 0.8rem;
}

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

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 21, 0.45);
}

.admin-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fffcf7;
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.admin-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.admin-modal-head h3 {
  margin: 0;
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.admin-modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.muted {
  color: #5c564c;
}

#pick-view select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #c9bfb0;
  border-radius: 8px;
  font: inherit;
}
