:root {
  --bg: #f6f3ee;
  --panel: #ffffff;
  --line: #dedbd4;
  --text: #18181b;
  --muted: #66666f;
  --green: #047857;
  --green-dark: #065f46;
  --cyan-soft: #ecfeff;
  --cyan-text: #155e75;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

textarea {
  min-height: 96px;
}

label span {
  display: block;
  margin-bottom: 5px;
  color: #52525b;
  font-size: 13px;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.brand-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-right: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-emblem {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-copy,
.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  line-height: 1.1;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.brand-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.social-link:hover,
.social-link:focus-visible {
  transform: translateY(-1px);
  border-color: #18181b;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

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

.nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: #3f3f46;
  font-weight: 700;
  cursor: pointer;
}

.button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.button:hover {
  background: var(--green-dark);
}

.button.dark {
  border-color: #18181b;
  background: #18181b;
}

.button.ghost {
  border-color: #d4d4d8;
  background: #fff;
  color: #3f3f46;
}

.button.danger {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.button.danger:hover {
  background: #b91c1c;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.page {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.notice {
  margin-bottom: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 14px;
  background: #ecfdf5;
  color: #166534;
  font-weight: 700;
}

.notice.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.muted {
  color: var(--muted);
}

.layout-with-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
}

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
}

.panel {
  padding: 18px;
}

.cards {
  display: grid;
  gap: 16px;
}

.cards.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  overflow: hidden;
}

.card-body {
  padding: 16px;
}

.event-card img,
.hero-panel img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.photo-card {
  position: relative;
}

.photo-zoom-trigger {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
}

.photo-zoom-trigger img {
  display: block;
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: #f3f0ea;
}

.photo-zoom-trigger span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 6px;
  padding: 5px 8px;
  background: rgba(24, 24, 27, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 160ms ease;
}

.photo-zoom-trigger:hover span,
.photo-zoom-trigger:focus-visible span {
  opacity: 1;
}

.code {
  position: absolute;
  top: 10px;
  left: 10px;
  pointer-events: none;
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 800;
}

.row,
.price-row,
.rail-total,
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.between {
  justify-content: space-between;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.metrics span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fafaf9;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.pill,
.tag {
  display: inline-flex;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pill.good {
  background: #dcfce7;
  color: #166534;
}

.tag {
  background: var(--cyan-soft);
  color: var(--cyan-text);
}

.tag.active {
  background: var(--green);
  color: #fff;
}

.tagbar,
.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tagbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack.compact {
  gap: 8px;
}

.rail {
  align-self: start;
}

.price-row,
.rail-total {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.price-row small {
  display: block;
  color: var(--muted);
}

.rail-total {
  margin-top: 14px;
}

.rail-total.big strong {
  font-size: 24px;
}

.hero-panel {
  overflow: hidden;
  padding: 0;
}

.hero-panel > div {
  padding: 18px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.thumbs img {
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  min-width: min(100%, 360px);
}

.search-form label {
  flex: 1;
}

.cart-add {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: end;
  gap: 10px;
}

.cart-add-feedback {
  margin-top: 6px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.cart-line {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 80px 90px auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.cart-line img {
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.center {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.auth {
  width: min(440px, 100%);
  margin: 40px auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 18px;
}

.event-editor-grid {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.event-editor-grid > .stack {
  align-self: start;
  align-content: start;
}

.event-editor-grid .photo-manage-list {
  max-height: min(680px, 65vh);
  overflow-y: auto;
  padding-right: 4px;
}

.event-admin-list {
  display: grid;
  gap: 10px;
}

.event-admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.event-admin-card h3 {
  margin-bottom: 4px;
}

.event-edit,
.album-edit {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.album-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fafaf9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-chip strong {
  color: var(--text);
  font-size: 15px;
}

.muted-chip {
  font-weight: 600;
}

.grid.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.check input {
  width: auto;
}

.check.with-label {
  align-self: end;
  min-height: 42px;
}

.price-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 80px;
  align-items: center;
  gap: 10px;
}

.orders {
  display: grid;
  gap: 12px;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.order-status {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.note {
  border-radius: 6px;
  padding: 10px;
  background: #f4f4f5;
}

.mini-row {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
}

.photo-manage-list {
  display: grid;
  gap: 8px;
}

.photo-manage-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.photo-manage-item img {
  aspect-ratio: 1;
  width: 64px;
  border-radius: 6px;
  object-fit: cover;
}

.photo-manage-item p {
  margin-bottom: 0;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(24, 24, 27, 0.86);
  cursor: zoom-out;
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
}

.lightbox-dialog img {
  max-height: calc(100vh - 112px);
  width: 100%;
  border-radius: 8px;
  object-fit: contain;
  background: #111;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #18181b;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.lightbox-caption span {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .layout-with-rail,
  .admin-grid,
  .event-editor-grid {
    grid-template-columns: 1fr;
  }

  .cards.two,
  .cards.three,
  .cards.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cart-line,
  .price-edit,
  .event-admin-card,
  .photo-manage-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .cards.two,
  .cards.three,
  .cards.four,
  .metrics,
  .grid.two-cols {
    grid-template-columns: 1fr;
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-dialog {
    max-height: calc(100vh - 24px);
  }

  .lightbox-dialog img {
    max-height: calc(100vh - 96px);
  }
}

.cover-upload {
  display: grid;
  gap: 0.75rem;
}

.cover-upload img {
  width: min(320px, 100%);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.album-upload-box {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafafa;
}

.album-upload-box h3 {
  margin: 0;
  font-size: 16px;
}

.album-upload-box .muted,
.album-upload-hint {
  margin-bottom: 0;
}

.photo-filename {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.photo-card > .photo-filename {
  padding: 0 14px;
}

.lightbox-caption > div {
  display: grid;
  gap: 2px;
}

.lightbox-caption [data-lightbox-filename] {
  color: var(--muted);
  font-size: 14px;
}

.lightbox-dialog img {
  max-height: calc(100vh - 220px);
}

.lightbox-cart-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 96px auto;
  gap: 10px;
  align-items: end;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.lightbox-cart-form label {
  margin: 0;
}

.lightbox-cart-form .cart-add-feedback {
  grid-column: 1 / -1;
}

@media (max-width: 620px) {
  .lightbox-dialog img {
    max-height: calc(100vh - 210px);
  }

  .lightbox-cart-form {
    grid-template-columns: 1fr;
  }
}

.delivery-electronic-only select {
  background: #f4f4f5;
  color: #52525b;
}

.small {
  font-size: 13px;
}

.price-note-box {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fafafa;
}

.price-note-box span,
.price-note-box small,
.price-edit small {
  display: block;
}

@media (max-width: 680px) {
  .brand-wrap {
    width: 100%;
  }

  .brand-social {
    margin-left: 54px;
  }
}

.order-list {
  gap: 8px;
}

.order-row {
  padding: 0;
  overflow: hidden;
}

.order-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.order-summary::-webkit-details-marker {
  display: none;
}

.order-summary::before {
  content: "▸";
  align-self: center;
  color: var(--muted);
  font-size: 14px;
}

.order-row[open] .order-summary::before {
  content: "▾";
}

.order-summary-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.order-summary-main strong,
.order-summary-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.order-details {
  border-top: 1px solid var(--line);
  padding: 14px;
  background: #fafafa;
}

.order-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.order-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-meta-grid span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: white;
  font-size: 14px;
}

.order-meta-grid strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.order-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  background: white;
}

@media (max-width: 760px) {
  .order-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-summary::before {
    display: none;
  }

  .order-summary-meta {
    justify-content: flex-start;
  }

  .order-meta-grid,
  .order-item-row {
    grid-template-columns: 1fr;
  }
}
