:root {
  color-scheme: only light;
  --ink: #1b1b1b;
  --muted: #5a5754;
  --accent: #c55b33;
  --accent-2: #1f6f5c;
  --cream: #f4f0ea;
  --paper: #fcfbf9;
  --shadow: 0 22px 60px rgba(28, 20, 12, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --border: 1px solid rgba(27, 27, 27, 0.12);
  --bg-gradient: radial-gradient(circle at top left, #f1e6d6 0%, transparent 55%),
    radial-gradient(circle at 85% 15%, #f6d8c9 0%, transparent 45%),
    radial-gradient(circle at 20% 80%, #e9efe7 0%, transparent 52%),
    linear-gradient(135deg, #fbf6ef 0%, #f1ede7 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg-gradient);
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  margin: 0 0 0.4em;
  font-weight: 600;
  letter-spacing: 0.02em;
}

p {
  margin: 0 0 1em;
  color: var(--muted);
}

a {
  color: inherit;
}

.page {
  position: relative;
  padding: 32px 6vw 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-title {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-nav.hidden {
  display: none;
}

.tab-button {
  border: var(--border);
  background: transparent;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.tab-button.is-active {
  background: var(--ink);
  color: #fff;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(197, 91, 51, 0.12);
  color: var(--accent);
  font-size: 0.85rem;
}

.button {
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.secondary {
  background: var(--paper);
  color: var(--ink);
  border: var(--border);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border: var(--border);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(22, 18, 12, 0.18);
}

.panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: var(--border);
}

.panel.hidden {
  display: none;
}

.status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(31, 111, 92, 0.12);
  color: var(--accent-2);
  font-size: 0.9rem;
}

.status.error {
  background: rgba(197, 91, 51, 0.12);
  color: var(--accent);
}

.layout {
  display: grid;
  gap: 24px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(27, 27, 27, 0.08);
  vertical-align: top;
}

.table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.table td .small {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.lead-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink);
}

.lead-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.lead-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  object-fit: cover;
  display: block;
  background: #f4f0ea;
}

.lead-summary {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  background: #fff;
}

.lead-summary img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  object-fit: cover;
}

.carousel {
  display: grid;
  gap: 10px;
}

.carousel-frame {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 220px;
  max-height: 60vh;
}

img.carousel-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border: 0;
  border-radius: 0;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(27, 27, 27, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

.carousel-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.carousel-thumb {
  border: 1px solid rgba(27, 27, 27, 0.12);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.carousel-thumb img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  display: block;
}

.carousel-thumb.is-active {
  border-color: #2f5f6e;
  box-shadow: 0 0 0 1px rgba(47, 95, 110, 0.2);
}

.table-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.table-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  overflow: hidden;
  background: #f4f0ea;
  flex-shrink: 0;
}

.span-two {
  grid-column: 1 / -1;
}

.image-preview {
  margin-top: 12px;
  width: min(260px, 100%);
  height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  background: #f4f0ea;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

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

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: var(--border);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.textarea {
  min-height: 78px;
  resize: vertical;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 18px;
}

.section-link {
  border: 1px solid #d9cbb7;
  background: #f8f2eb;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.section-link:hover {
  background: #efe6dd;
  border-color: #cdbda8;
}

.form-section {
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.section-header h3 {
  margin: 0;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-top {
  border: 1px solid #d9cbb7;
  background: #f8f2eb;
  color: var(--ink);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
}

.section-top:hover {
  background: #efe6dd;
  border-color: #cdbda8;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.social-links .social-link {
  border: 1px solid #d9cbb7;
  background: #ffffff;
  color: var(--ink);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.social-links .social-link:hover {
  background: #f4eee6;
  border-color: #cdbda8;
}

.social-links svg {
  width: 18px;
  height: 18px;
  display: block;
}

.social-links .social-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.social-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.social-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #e2d6c5;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.social-badge svg {
  width: 14px;
  height: 14px;
  display: block;
}

.social-badge:hover {
  background: #f4eee6;
  border-color: #cdbda8;
}

.form-section.is-collapsed .section-body {
  display: none;
}

.helper {
  font-size: 0.8rem;
  color: var(--muted);
}

.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.upload-row input[type="file"] {
  padding: 8px 10px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.bulk-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.select-col,
.select-cell {
  width: 36px;
  text-align: center;
}

.select-cell input {
  transform: scale(1.05);
}

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
}

.search input {
  min-width: 180px;
}

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.filter-checkbox input {
  accent-color: #2f5f6e;
}

.table thead th {
  vertical-align: top;
}

.filter-row th {
  background: #f7f3ef;
}

.filter-row .input,
.filter-row .select {
  width: 100%;
  min-width: 0;
}

.date-range {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-toolbar {
  margin-top: 12px;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e4d8c8;
  border-radius: 12px;
  background: #fbf7f2;
}

.schedule-item strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.schedule-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

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

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 30;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  border: var(--border);
  padding: 20px 20px 16px;
  box-shadow: 0 22px 50px rgba(15, 15, 15, 0.22);
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 16px;
}

.partner-search {
  margin: 16px 0 28px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  background: #fffaf4;
}

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

.partner-actions {
  margin-top: 12px;
}

.settings-block {
  margin-top: 28px;
}

.client-gallery-upload {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.client-gallery-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.client-gallery-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  background: #fff;
}

.client-gallery-item img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(27, 27, 27, 0.12);
}

.client-gallery-fields {
  display: grid;
  gap: 8px;
}

@media (max-width: 720px) {
  .client-gallery-upload {
    grid-template-columns: 1fr;
  }

  .client-gallery-item {
    grid-template-columns: 1fr;
  }

  .client-gallery-item img {
    width: 100%;
    height: 180px;
  }
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 111, 92, 0.12);
  color: var(--accent-2);
  font-size: 0.72rem;
  margin-right: 6px;
  margin-bottom: 4px;
}

.notice {
  padding: 12px 14px;
  background: rgba(197, 91, 51, 0.08);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .inventory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

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