:root {
  --ink: #1B2430;
  --ink-soft: #2B3547;
  --paper: #F7F5F0;
  --paper-dim: #EEEBE3;
  --amber: #D9A441;
  --amber-deep: #B9860F;
  --clay: #B5533C;
  --slate: #5C6773;
  --line: rgba(27, 36, 48, 0.12);
  --line-strong: rgba(27, 36, 48, 0.22);
  --shadow: 0 1px 2px rgba(27,36,48,0.06), 0 6px 20px rgba(27,36,48,0.08);
  --radius: 10px;
  --display-font: 'Archivo Narrow', sans-serif;
  --body-font: 'Inter', sans-serif;
  --mono-font: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--amber-deep);
  outline-offset: 2px;
}

/* ---------- Topbar ---------- */

.topbar {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--amber);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  font-family: var(--mono-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--amber);
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.brand-text h1 {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.1;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: rgba(247,245,240,0.6);
  letter-spacing: 0.03em;
}

/* ---------- Nav ---------- */

.topnav {
  display: flex;
  gap: 20px;
  flex: 1 1 auto;
  justify-content: center;
}

.topnav a {
  color: rgba(247,245,240,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.topnav a:hover { color: var(--paper); }
.topnav a.active {
  color: var(--paper);
  border-color: var(--amber);
}

/* ---------- Panels (customers / orders pages) ---------- */

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}

.panel h2 {
  font-family: var(--display-font);
  font-size: 19px;
  margin: 0 0 16px;
}

/* ---------- Data tables ---------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-bottom: 6px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  font-family: var(--mono-font);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
}
.data-table tbody tr:hover { background: var(--paper-dim); }

.remove-item-btn {
  color: var(--clay);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
}
.remove-item-btn:hover { background: rgba(181,83,60,0.1); border-radius: 6px; }

.totals-box {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-family: var(--mono-font);
  font-size: 14px;
  color: var(--ink);
}
.totals-box .grand {
  font-size: 18px;
  font-weight: 700;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.form-row select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14.5px;
  color: var(--ink);
}

@media (max-width: 640px) {
  .topnav { order: 5; width: 100%; justify-content: space-between; padding-top: 8px; gap: 12px; }
  .panel { padding: 16px; }
  .data-table { font-size: 12.5px; }
  .data-table th, .data-table td { padding: 8px 6px; }
}

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--amber);
  color: var(--ink);
}
.btn-primary:hover { background: var(--amber-deep); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--paper-dim); }

.btn-ghost {
  background: transparent;
  color: var(--clay);
  border-color: transparent;
}
.btn-ghost:hover { background: rgba(181,83,60,0.08); }

.btn-link {
  background: none;
  border: none;
  color: var(--slate);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
  align-self: flex-start;
}

.plus { font-weight: 700; margin-right: 2px; }

.icon-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--slate);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  border-radius: 6px;
}
.icon-btn:hover { background: var(--paper-dim); color: var(--ink); }

/* ---------- Layout ---------- */

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.footer {
  text-align: center;
  padding: 22px 20px 40px;
  color: var(--slate);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* ---------- Toolbar ---------- */

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

.field { flex: 0 0 auto; }
.field-search { flex: 1 1 220px; }

.toolbar input,
.toolbar select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
}

.count-tag {
  margin-left: auto;
  font-family: var(--mono-font);
  font-size: 12.5px;
  color: var(--slate);
  background: var(--paper-dim);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ---------- Grid & Cards ---------- */

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

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-media .no-image {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--slate);
  letter-spacing: 0.04em;
}

.stamp {
  position: absolute;
  top: 10px;
  right: -6px;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 12px 4px 10px;
  transform: rotate(3deg);
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.stamp.in {
  background: rgba(217,164,65,0.95);
  color: var(--ink);
}
.stamp.out {
  background: rgba(181,83,60,0.95);
  color: #fff;
}

.card-body {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-type {
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}

.card-link {
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--amber-deep);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.card-link:hover { text-decoration: underline; }

.card-name {
  font-family: var(--display-font);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}

.card-price {
  font-family: var(--mono-font);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}

.card-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-left: -14px;
  margin-right: -14px;
  padding-left: 14px;
  padding-right: 14px;
}

.card-actions .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
  text-align: center;
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--slate);
}
.empty-state h2 {
  font-family: var(--display-font);
  color: var(--ink);
  font-size: 22px;
  margin: 6px 0 4px;
}
.empty-state p { margin: 0 0 18px; }
.empty-stamp {
  display: inline-block;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--slate);
  border: 2px dashed var(--line-strong);
  padding: 6px 16px;
  border-radius: 4px;
  transform: rotate(-2deg);
}
.hidden { display: none !important; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27,36,48,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal {
  background: var(--paper);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
}

.modal-head h2 {
  font-family: var(--display-font);
  font-size: 19px;
  margin: 0;
}

.modal-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="url"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14.5px;
  color: var(--ink);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.image-picker {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.image-preview {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 8px;
  border: 1px dashed var(--line-strong);
  background: var(--paper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-preview span {
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--slate);
  text-align: center;
  padding: 4px;
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-picker-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-btn { text-align: center; cursor: pointer; }

.or-text {
  font-size: 12px;
  color: var(--slate);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  background: var(--line-strong);
  border-radius: 999px;
  transition: 0.15s;
}
.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.switch input:checked + .slider {
  background: var(--amber);
}
.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.modal-actions-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 200;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .topbar-inner { padding: 14px 16px; }
  .brand-text h1 { font-size: 20px; }
  .btn { padding: 9px 12px; font-size: 13.5px; }
  .wrap { padding: 18px 14px 50px; }
  .toolbar { gap: 8px; }
  .field-search { flex-basis: 100%; }
  .count-tag { margin-left: 0; order: 5; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card-name { font-size: 15.5px; }
  .card-price { font-size: 14px; }
  .card-actions .btn { font-size: 12px; padding: 7px 6px; }
  .two-col { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .image-picker { flex-direction: column; align-items: stretch; }
  .image-preview { width: 100%; height: 140px; flex-basis: auto; }
}

/* ================================================================
   Additions for the revamped site: lightbox, login page, admin
   tables/forms, badges, and small utility classes.
   ================================================================ */

/* ---------- Clickable product image (opens lightbox) ---------- */

.card-media.zoomable { cursor: zoom-in; }
.card-media.zoomable:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: -2px; }

/* ---------- Lightbox ---------- */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 19, 26, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 500;
  cursor: zoom-out;
}

.lightbox-img {
  max-width: min(92vw, 900px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  cursor: default;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(247,245,240,0.12);
  border: 1px solid rgba(247,245,240,0.3);
  color: var(--paper);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 501;
}
.lightbox-close:hover { background: rgba(247,245,240,0.22); }

.lightbox-caption {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--paper);
  font-family: var(--mono-font);
  font-size: 13px;
  opacity: 0.85;
  text-align: center;
  padding: 0 16px;
}

/* ---------- Login page ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 30px 28px 26px;
}

.auth-card .brand-mark { margin-bottom: 10px; display: inline-block; }

.auth-card h1 {
  font-family: var(--display-font);
  font-size: 22px;
  margin: 4px 0 4px;
}

.auth-card p.sub {
  color: var(--slate);
  font-size: 13.5px;
  margin: 0 0 20px;
}

.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}

.auth-card input[type="text"],
.auth-card input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  font-size: 14.5px;
  background: #fff;
  color: var(--ink);
}

.auth-card .btn { width: 100%; margin-top: 20px; padding: 12px; font-size: 14.5px; }

.auth-error {
  background: rgba(181,83,60,0.1);
  color: var(--clay);
  border: 1px solid rgba(181,83,60,0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 14px;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--paper-dim);
  color: var(--slate);
}
.badge.in    { background: rgba(217,164,65,0.18); color: var(--amber-deep); }
.badge.out   { background: rgba(181,83,60,0.14);  color: var(--clay); }
.badge.admin { background: rgba(27,36,48,0.08);   color: var(--ink); }

/* ---------- File input (image upload) ---------- */

.file-input-btn {
  display: inline-block;
  text-align: center;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--ink);
}
.file-input-btn:hover { background: var(--paper-dim); }
.file-input-btn input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
  clip: rect(0,0,0,0);
}
.upload-progress {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--slate);
}

/* ---------- Order builder ---------- */

.order-item-row {
  display: grid;
  grid-template-columns: 2fr 90px 90px 32px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.order-item-row select,
.order-item-row input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
}
@media (max-width: 640px) {
  .order-item-row { grid-template-columns: 1fr 70px 70px 28px; gap: 6px; }
}

/* ---------- Misc ---------- */

.helper-text { font-size: 12.5px; color: var(--slate); margin: 4px 0 0; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.spinner-inline {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--amber-deep);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   v2 additions: category/fabric/size/colors, chip input, delivery
   zones, and card polish.
   ================================================================ */

/* ---------- Chip input (colors) ---------- */

.chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
.chip-input:focus-within { border-color: var(--amber-deep); box-shadow: 0 0 0 3px rgba(217,164,65,0.15); }
.chip-input input {
  flex: 1 1 140px;
  min-width: 120px;
  border: none;
  outline: none;
  padding: 4px 2px;
  font-size: 13.5px;
}
.chip-list { display: contents; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12.5px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--slate);
  font-size: 11px;
  width: 16px; height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.chip-remove:hover { background: rgba(0,0,0,0.08); color: var(--clay); }

/* ---------- Product card: category/fabric/size/colors ---------- */

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 2px;
}
.card-colors {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.color-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.color-dot-more {
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--slate);
}

/* ---------- Card polish: subtle lift + refined media frame ---------- */

.card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(27,36,48,0.14);
}
.card-media { position: relative; overflow: hidden; }
.card-media img {
  transition: transform 0.35s ease;
}
.card:hover .card-media img { transform: scale(1.04); }
.card-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(to top, rgba(15,19,26,0.28), rgba(15,19,26,0));
  pointer-events: none;
}
.card-price {
  font-family: var(--display-font);
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ---------- Delivery note (public site) ---------- */

.delivery-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono-font);
  font-size: 12.5px;
  color: var(--slate);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0 18px;
}
.delivery-note .dot { color: var(--amber-deep); }

/* ---------- Delivery zones manager (admin orders page) ---------- */

.zones-panel { margin-top: 10px; }
.zone-row {
  display: grid;
  grid-template-columns: 1fr 120px 32px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.zone-row input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  font-size: 13px;
}

/* ================================================================
   v3 additions: multi-photo-by-color (admin repeater + public
   clickable swatches).
   ================================================================ */

/* ---------- Admin: photo-by-color repeater ---------- */

.photo-row {
  display: grid;
  grid-template-columns: 64px 1fr 32px;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.photo-row:first-child { padding-top: 4px; }

.photo-row-preview {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--paper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.photo-row-preview img { width: 100%; height: 100%; object-fit: cover; }
.no-image-sm {
  font-family: var(--mono-font);
  font-size: 9px;
  color: var(--slate);
  text-align: center;
  padding: 0 4px;
}

.photo-row-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photo-color-input {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
  font-weight: 600;
}
.photo-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.photo-row-actions .file-input-btn.small {
  padding: 7px 10px;
  font-size: 12.5px;
}
.photo-row-actions .photo-url-input {
  flex: 1 1 160px;
  min-width: 140px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
}

.photo-remove-btn { align-self: flex-start; margin-top: 4px; }

/* ---------- Public: clickable color swatches ---------- */

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 2px;
}
.swatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  outline: 1px solid var(--line-strong);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, outline-color 0.15s ease;
}
.swatch-dot:hover { transform: scale(1.14); }
.swatch-dot.active {
  outline: 2px solid var(--amber-deep);
  outline-offset: 1px;
}
.swatch-dot:focus-visible {
  outline: 2px solid var(--amber-deep);
  outline-offset: 2px;
}

/* ---------- Photo count badge on admin card thumbnail ---------- */

.photo-count-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15,19,26,0.72);
  color: var(--paper);
  font-family: var(--mono-font);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
}
