:root {
  color-scheme: light;
  --ink: #17201f;
  --muted: #65716e;
  --line: #d9dfdd;
  --paper: #fbfbf8;
  --white: #ffffff;
  --olive: #5c7a4d;
  --olive-dark: #38523a;
  --clay: #c7674e;
  --sky: #4c84a6;
  --gold: #d6a13f;
  --shadow: 0 18px 48px rgba(23, 32, 31, 0.12);
  --radius: 8px;
  --content: min(1180px, calc(100vw - 32px));
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(23, 32, 31, 0.1);
  background: rgba(251, 251, 248, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-actions,
.studio-actions,
.form-actions,
.form-heading,
.panel-heading,
.goal-topline,
.goal-bottomline,
.card-meta,
.card-actions,
.inventory-actions {
  display: flex;
  align-items: center;
}

.nav-actions {
  gap: 8px;
}

.nav-button,
.segment,
.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 760;
}

.nav-button,
.segment,
.secondary-button,
.ghost-button {
  background: transparent;
  color: var(--ink);
}

.nav-button.active,
.segment.active {
  border-color: rgba(92, 122, 77, 0.22);
  background: rgba(92, 122, 77, 0.14);
  color: var(--olive-dark);
}

.primary-button {
  border-color: var(--olive-dark);
  background: var(--olive-dark);
  color: var(--white);
}

.secondary-button {
  border-color: var(--line);
  background: var(--white);
}

.ghost-button {
  padding-inline: 10px;
  color: var(--muted);
}

.primary-button:hover,
.secondary-button:hover,
.nav-button:hover,
.segment:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.app-shell {
  min-height: calc(100vh - 72px);
}

.summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 32px;
  width: var(--content);
  margin: 0 auto;
  padding: 54px 0 30px;
}

.summary-copy h1,
.studio-login h1,
.studio-header h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 5vw, 5.6rem);
  font-weight: 520;
  letter-spacing: 0;
  line-height: 0.95;
}

.summary-copy p,
.studio-login p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-panel {
  align-self: end;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.goal-topline,
.goal-bottomline {
  justify-content: space-between;
  gap: 12px;
}

.goal-topline span,
.goal-bottomline {
  color: var(--muted);
  font-weight: 700;
}

.goal-topline strong {
  color: var(--olive-dark);
  font-size: 2rem;
}

.progress-track {
  height: 12px;
  margin: 18px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebe8;
}

.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--olive), var(--gold), var(--clay));
  transition: width 260ms ease;
}

.toolbar-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: var(--content);
  margin: 0 auto;
  padding: 20px 0;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.segment {
  min-height: 36px;
}

.search-box {
  position: relative;
  display: block;
  min-width: min(320px, 100%);
}

.search-box input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px 0 42px;
  background: var(--white);
  color: var(--ink);
}

.search-icon {
  position: absolute;
  top: 15px;
  left: 16px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -7px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: var(--content);
  margin: 0 auto;
  padding: 8px 0 56px;
}

.art-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.art-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #e8ece9;
}

.art-card-body {
  padding: 16px;
}

.art-card h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

.card-meta {
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.price {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 850;
}

.card-story {
  min-height: 48px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.card-actions {
  justify-content: space-between;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(76, 132, 166, 0.13);
  color: #315f7a;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: capitalize;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 12px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(92, 122, 77, 0.13);
  color: var(--olive-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.stock-pill.sold {
  background: rgba(199, 103, 78, 0.13);
  color: #934431;
}

.status-pill.sold {
  background: rgba(199, 103, 78, 0.13);
  color: #934431;
}

.status-pill.draft,
.status-pill.hidden {
  background: rgba(101, 113, 110, 0.13);
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 44px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--muted);
  text-align: center;
}

.studio-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 40px;
  width: var(--content);
  margin: 0 auto;
  padding: 72px 0;
}

.login-panel,
.art-form,
.inventory-panel,
.sales-panel,
.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.login-panel {
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 820;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(76, 132, 166, 0.16);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "metrics metrics"
    "form inventory"
    "form sales";
  gap: 18px;
  width: var(--content);
  margin: 0 auto;
  padding: 40px 0 60px;
}

.studio-header {
  grid-area: header;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.studio-header h1 {
  font-size: clamp(2.1rem, 4vw, 4.2rem);
}

.studio-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metrics-row {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.art-form {
  grid-area: form;
  display: grid;
  align-self: start;
  gap: 16px;
  padding: 18px;
}

.form-heading,
.panel-heading {
  justify-content: space-between;
  gap: 12px;
}

.form-heading h2,
.panel-heading h2 {
  margin: 0;
  font-size: 1.02rem;
}

.panel-heading span {
  color: var(--muted);
  font-weight: 800;
}

.image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.image-preview {
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #eef2f0;
  color: var(--muted);
}

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

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

.inventory-panel {
  grid-area: inventory;
  min-width: 0;
  padding: 18px;
}

.sales-panel {
  grid-area: sales;
  min-width: 0;
  padding: 18px;
}

.inventory-list,
.sales-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.inventory-item,
.sale-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fcfcfa;
}

.inventory-item img,
.sale-item img {
  width: 72px;
  height: 84px;
  border-radius: 6px;
  object-fit: cover;
}

.inventory-item h3,
.sale-item h3 {
  margin: 0 0 5px;
  font-size: 0.98rem;
}

.inventory-item p,
.sale-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.inventory-actions {
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.small-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 820;
}

.danger-button {
  color: #9a392b;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 32, 31, 0.42);
}

.modal-root.open {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.modal-content {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr);
  gap: 22px;
  padding: 20px;
}

.modal img {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  object-fit: cover;
}

.modal h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.modal p {
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .summary-band,
  .studio-login,
  .studio-layout {
    grid-template-columns: 1fr;
  }

  .studio-layout {
    grid-template-areas:
      "header"
      "metrics"
      "form"
      "inventory"
      "sales";
  }

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

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

@media (max-width: 640px) {
  :root {
    --content: min(100vw - 24px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 118px;
  }

  .nav-actions {
    width: 100%;
  }

  .nav-button {
    flex: 1;
  }

  .summary-band,
  .studio-login,
  .studio-layout {
    padding-top: 28px;
  }

  .toolbar-band {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-grid,
  .metrics-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .studio-header {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-actions {
    justify-content: stretch;
  }

  .studio-actions button {
    flex: 1;
  }

  .inventory-item,
  .sale-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .inventory-item img,
  .sale-item img {
    width: 64px;
    height: 76px;
  }

  .inventory-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .inventory-actions button {
    flex: 1;
  }

  .modal-content {
    grid-template-columns: 1fr;
  }
}

/* Multi-image studio thumbnails */
.image-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.image-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f4eee2;
  aspect-ratio: 4 / 5;
}
.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-thumb.cover {
  outline: 3px solid #6c8d55;
  outline-offset: -3px;
}
.image-thumb .cover-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #6c8d55;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.image-thumb .thumb-actions {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.image-thumb .thumb-actions .small-button {
  font-size: 11px;
  padding: 4px 8px;
}

/* Shop card image badge */
.art-card-image {
  position: relative;
}
.image-count-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* Modal carousel */
.carousel {
  position: relative;
  background: #f4eee2;
  border-radius: 14px;
  overflow: hidden;
}
.carousel-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  aspect-ratio: 4 / 5;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.92);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #30586a;
  line-height: 1;
}
.carousel-arrow:hover {
  background: #fff;
}
.carousel-arrow.prev { left: 10px; }
.carousel-arrow.next { right: 10px; }
.carousel-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
}
.carousel-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.carousel-thumb {
  flex: 0 0 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: none;
  padding: 0;
  cursor: pointer;
}
.carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carousel-thumb.active {
  border-color: #6c8d55;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.lightbox-image {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}
.lightbox-close,
.lightbox-arrow {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lightbox-close:hover,
.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.25);
}
.lightbox-close {
  top: 18px;
  right: 18px;
}
.lightbox-arrow.prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-arrow.next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
}

/* Brand logo + Olive photo */
.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.summary-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  align-items: center;
}
.olive-photo {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
}
@media (max-width: 720px) {
  .summary-band {
    grid-template-columns: auto 1fr;
  }
  .olive-photo {
    width: 96px;
    height: 96px;
  }
  .brand-logo {
    width: 44px;
    height: 44px;
  }
}
