:root {
  --sv-dark: #141414;
  --sv-surface: #1E1D1B;
  --sv-cream: #F7F3EB;
  --sv-gold: #D8A641;
  --sv-gold-dark: #8C6618;
  --sv-success: #00BFA5;
  --sv-muted: #A79E90;
  --sv-line: rgba(216, 166, 65, 0.32);
  --sv-danger: #E56B6B;
  --sv-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(216, 166, 65, 0.16), transparent 42%),
    var(--sv-dark);
  color: var(--sv-cream);
  font-family: "Plus Jakarta Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

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

button, a { -webkit-tap-highlight-color: transparent; }

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(247, 243, 235, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sv-cream);
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  height: 36px;
  width: auto;
  max-width: 148px;
  object-fit: contain;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.header-home {
  color: var(--sv-gold);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.screen {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.panel {
  background: var(--sv-surface);
  border: 1px solid var(--sv-line);
  border-radius: 22px;
  box-shadow: var(--sv-shadow);
  padding: 32px 28px;
}

.panel-narrow {
  max-width: 480px;
  margin: 24px auto;
}

.kicker {
  color: var(--sv-gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.kicker-dark { color: var(--sv-gold-dark); }

h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.05; }

.lede {
  color: var(--sv-muted);
  margin: 12px 0 22px;
  line-height: 1.55;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sv-muted);
}

input, select, textarea {
  width: 100%;
  background: #141311;
  border: 1px solid rgba(247, 243, 235, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--sv-gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
}

.btn:disabled { opacity: 0.55; cursor: wait; }

.btn-gold {
  background: linear-gradient(180deg, #e3b85a, var(--sv-gold) 40%, var(--sv-gold-dark));
  color: #1a1408;
}

.btn-ghost {
  border-color: var(--sv-line);
  color: var(--sv-cream);
  background: rgba(255, 255, 255, 0.03);
}

.btn-danger {
  border-color: rgba(229, 107, 107, 0.45);
  color: #ffd2d2;
}

.btn-block { width: 100%; margin-top: 18px; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.form-error { color: var(--sv-danger); margin-top: 10px; line-height: 1.4; }

.callout {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--sv-line);
  background: rgba(216, 166, 65, 0.08);
  line-height: 1.5;
}

.callout .btn { margin-top: 12px; }

.muted { color: var(--sv-muted); line-height: 1.5; }

.app-bar, .toolbar, .app-actions, .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.app-bar {
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 18px;
}

.company-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.company-lockup h1 { font-size: 1.7rem; }

.company-lockup p { color: var(--sv-muted); margin-top: 2px; }

.company-logo, .company-initials, .certificate-initials, .monogram {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  background: #111;
  border: 1px solid var(--sv-line);
}

.company-initials, .certificate-initials, .monogram {
  display: grid;
  place-items: center;
  color: var(--sv-gold);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tabs {
  border-bottom: 1px solid rgba(247, 243, 235, 0.08);
  margin-bottom: 18px;
}

.tab, .pill {
  border: 0;
  background: transparent;
  color: var(--sv-muted);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.tab.is-active {
  color: var(--sv-cream);
  box-shadow: inset 0 -2px 0 var(--sv-gold);
  border-radius: 0;
}

.pill {
  border: 1px solid rgba(247, 243, 235, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.pill.is-active {
  background: var(--sv-gold);
  color: #1a1408;
  border-color: var(--sv-gold);
}

.toolbar { align-items: center; margin-bottom: 18px; }

.toolbar input { max-width: 360px; }

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

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

.offer-card, .mine-card, .profile-card {
  background: var(--sv-surface);
  border: 1px solid rgba(247, 243, 235, 0.08);
  border-radius: 18px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.mine-card, .profile-card { cursor: default; padding: 18px; }

.offer-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(160deg, rgba(216, 166, 65, 0.28), rgba(20, 20, 20, 0.2)),
    var(--sv-dark);
}

.offer-media img, .offer-media .monogram {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.discount-pill, .star-badge, .status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.discount-pill, .star-badge {
  position: absolute;
  top: 10px;
  background: rgba(20, 20, 20, 0.82);
  color: var(--sv-gold);
  border: 1px solid var(--sv-line);
}

.discount-pill { left: 10px; }
.star-badge { right: 10px; }

.offer-body { padding: 14px 14px 16px; }

.company-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sv-muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.company-line img, .mini-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.offer-body h3 { font-size: 1.25rem; margin-bottom: 6px; }

.offer-body p, .mine-card p { color: var(--sv-muted); line-height: 1.45; }

.valid-until { margin-top: 10px; font-size: 0.8rem; }

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

.mine-top, .mine-actions, .metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.mine-top { margin-bottom: 8px; }
.mine-actions, .metric-row { margin-top: 12px; }

.status-approved { background: rgba(0, 191, 165, 0.16); color: var(--sv-success); }
.status-pending { background: rgba(216, 166, 65, 0.16); color: var(--sv-gold); }
.status-paused { background: rgba(247, 243, 235, 0.08); color: var(--sv-cream); }
.status-rejected { background: rgba(229, 107, 107, 0.16); color: #ffc7c7; }

.reject-reason { color: #ffc7c7; margin-top: 8px; }

.profile-card h2 { font-size: 1.6rem; margin-bottom: 8px; }

.contact-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.2fr auto;
  gap: 8px;
  margin-top: 8px;
}

.image-preview-wrap img, #profileLogoPreview {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--sv-line);
  background: #111;
  margin-top: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.modal-dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--sv-surface);
  border: 1px solid var(--sv-line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--sv-shadow);
}

.modal-dialog-narrow { width: min(460px, 100%); }

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  border: 0;
  background: transparent;
  color: var(--sv-gold);
  font-weight: 800;
  cursor: pointer;
}

.detail-hero {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  background: #111;
}

.detail-hero img, .detail-hero .monogram {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 0;
}

.detail-copy { white-space: pre-wrap; line-height: 1.55; margin: 12px 0; }

.code-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--sv-gold);
  margin: 12px 0;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.certificate {
  background: var(--sv-cream);
  color: var(--sv-dark);
  border-radius: 18px;
  padding: 28px 20px 22px;
  text-align: center;
  border: 2px solid var(--sv-gold);
}

.certificate h2 { font-size: 2rem; margin: 8px 0; }

.certificate-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 8px;
}

.certificate-initials {
  margin: 0 auto 8px;
  background: #141414;
}

.certificate-contact { color: #5e5648; margin-bottom: 12px; }

.live-badge {
  display: inline-block;
  background: var(--sv-success);
  color: #04231f;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 6px 12px;
}

.clock-time {
  font-variant-numeric: tabular-nums;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 14px 0 0;
  color: var(--sv-gold-dark);
}

.clock-date { text-transform: capitalize; margin-top: 4px; }

.certificate-note {
  color: #6d6456;
  font-size: 0.82rem;
  margin-top: 12px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--sv-cream);
  color: var(--sv-dark);
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  z-index: 30;
  box-shadow: var(--sv-shadow);
}

.empty {
  padding: 28px 8px;
  color: var(--sv-muted);
}

@media (max-width: 720px) {
  .contact-row { grid-template-columns: 1fr; }
  .screen { width: min(1120px, calc(100% - 20px)); }
  .panel { padding: 24px 16px; }
  .clock-time { font-size: 2.3rem; }
}
